7 Commits
Author SHA1 Message Date
jinghui 4fb2ad0394 feat(转卖): 商品类目可手动修改,修复「无法识别商品类目,无法转卖」
- 校验放宽为 catId+channelCatId:部分闲鱼类目(电子资料 50023914/202036301)
  本就没有 tbCatId,上一版要求三项齐全会把详情类目判无效→转kgraph→400
- itemCatDTO.tbCatId 缺失写空串,不再提交字符串 None(FAIL_BIZ_JSON_ERROR 的雷)
- 新端点 POST /resell/categories:当前+识别+候选类目,带源商品图片调 kgraph,
  候选缺失的 catId 用识别结果/详情类目自动补齐
- 发布弹窗新增「商品类目/修改类目」可搜索候选,手选 > 详情 > kgraph 三级优先
- 一并带上 594e006 未出镜像的发布报文修复,随 v3.6.19 首个镜像发布
2026-11-17 12:24:59 +08:00
jinghui 594e00673e fix(转卖): 修复发布/编辑被闲鱼以 FAIL_BIZ_JSON_ERROR 拒绝
- itemLabelExtList 不再透传详情接口的展示型标签(结构与发布接口不同,
  原样提交会让闲鱼解析报文失败),改为发布实现统一用的空数组
- itemCatDTO 缺 channelCatId/tbCatId 时改走 kgraph 类目识别兜底,
  不再把字符串 None 提交上去
- 发布地址改为必须带 divisionId(selectedPoi 缺失时回落到常用地址)
2026-11-17 11:19:58 +08:00
jinghui b471ba0426 v3.6.18: 一键转卖发布502增强——违禁词只读预检+10分钟风控冷却+上游完整响应日志 2026-11-17 09:53:09 +08:00
jinghui 8724239593 v3.6.17: 一键转卖发布 422 修复(描述上限对齐闲鱼原文+标题30字)+ 校验原因中文化 2026-11-17 00:59:01 +08:00
jinghui 7b39f5287b docs: CHANGELOG 补 v3.6.14/15/16 三条 + README 版本范围更新到 v3.6.16 2026-11-17 00:29:41 +08:00
jinghui f3771c5a48 v3.6.16: 商品分状态显示(在售/已下架/草稿三套互不混排)
问题: 商品与发货页显示34件, 实际在售只有14件——本地库把20件已下架商品
和在售混在同一个列表里, 页头/页签/下拉全部用 items.length 口径。

- 新增状态分段页签: 在售 14 / 已下架 20 / 草稿 (品牌黄高亮, 带计数)
- 计数口径统一为 onSaleCount: 页头badge、商品页签、账号下拉全部改为在售数
- 空状态按状态区分文案(没有已下架商品/没有草稿/拉取中/拉取失败)
- 草稿本地库没有概念, 切到草稿页签时才按账号现拉闲鱼(带scope去重守卫)
- 后端新增 /items/xyh-list: 按闲鱼分组(在售/已下架/已售出/草稿)拉取,
  XianyuAutoAsync.get_item_list_info 增加 group_name 参数按名选分组,
  账号没有该分组时返回明确提示而非报错
2026-11-17 00:20:20 +08:00
jinghui fea5aee0cb v3.6.15: 使用说明页导航吸顶浮动 + 页面宽度自适应全屏
- 根因修复: main 上的 overflow-y:auto 把 sticky 锁死(自身不滚动, 滚动在 document), 去掉后吸顶恢复
- 使用说明页包裹层去掉 max-w-[1320px], 改 w-full 铺满(仅 help 页, 其他页保持原宽度)
- 导航移动端 nav 自身 sticky top-14(停在 header 下沿), 桌面端内层卡片 lg:sticky lg:top-2
- 锚点 scroll-mt-32 lg:scroll-mt-4, 跳转不被吸顶导航遮挡
- 顺带修上一轮中断遗留: ItemList 引用已删的 showOffShelf 会 ReferenceError, 改接 statusFilter
2026-11-16 22:57:49 +08:00
68 changed files with 1350 additions and 181 deletions

No files matched your search

+121
View File
@@ -4,6 +4,127 @@
---
## 2026-11-17 · v3.6.19
### ✨ 新功能
- **商品类目可手动修改(「无法识别商品类目,无法转卖」的治本方案)**
- 新端点 `POST /resell/categories`:一次调用返回「当前类目 + 识别类目 + 候选类目列表」,带源商品图片调用 kgraph(实测带图识别才稳定),候选缺失的 catId 用识别结果/详情类目自动补齐
- 发布弹窗新增「商品类目」区块 + 「修改类目」入口:可搜索的候选列表(最多 150 条)、当前项高亮「当前」、点选即回填并随发布提交,可随时「收起」
- 后端 `ResellPublishRequest.cat` 手选类目字段,发布时优先级:手选 > 商品详情自带类目 > kgraph 自动识别
### 🐛 修复
- **「无法识别商品类目,无法转卖」(发布被 400 拦下)**
- 根因:上一版把类目校验设成 `catId` + `channelCatId` + `tbCatId` 三项齐全,但不少闲鱼类目(本例「电子资料」)本身就没有 `tbCatId` → 详情类目被判无效 → 转 kgraph → 长标题常识别不出 → 直接 400
- 依据(抓参考实现源码核对):`validPublishCategoryMap` 只要求 catId+catName+channelCatId,`PublishCategory` 注释写明「部分闲鱼类目没有 TBCatID」,其内置兜底类目正是 `电子资料 (50023914 / 202036301)` 且要求 tbCatId 留空不许伪造
- 修复:校验放宽为 `catId` + `channelCatId`;`itemCatDTO.tbCatId` 缺失时写空串,绝不再提交字符串 `"None"`(这正是 `FAIL_BIZ_JSON_ERROR` 的雷)
- **发布报文两处(11-17 11:19 提交 594e006,随本版首个镜像一起发布,上一版镜像未包含)**
- `itemLabelExtList` 不再透传详情接口的展示型标签(结构与发布接口不同,原样提交会让闲鱼解析报文失败),改为发布实现统一用的空数组
- 发布地址必须带 `divisionId`(`selectedPoi` 缺失时回落到常用地址)
### ✅ 验证
- 服务端断言:两个商品的当前类目均判定可发布(`电子资料` tb 为空、`其他服务`),候选 8 条 / 1 条全部带齐 catId+channelCatId,前端渲染条数与后端返回一致
- 浏览器 1440×900 实测:打开一键转卖弹窗 →「商品类目」显示真实类目 → 点「修改类目」展开搜索框与候选 → 搜「视频」出空态、清空恢复 → 点选后类目由「其他服务」变「电子资料」并自动收起;全程未点发布
- 登录态验证走临时密码,用完已还原并复核失效(`checkpw=False`、原哈希一致)
---
## 2026-11-17 · v3.6.18
### 🐛 修复
- **一键转卖发布 502 复发(`FAIL_BIZ_JSON_ERROR::发布失败,请稍后重试吧!`)**
- 先用只读手段排除了四类常见原因:登录态(`prepublish.check` 返回 `limited=false`)、违禁词(`badwords.prepubcheck` 对 5 条收藏的标题+描述全部 `forbidPublish=false`)、描述长度(当前收藏 265~562 字,远低于上限)、在售数量(20 件,闲鱼上限 50)
- **发布前只读违禁词预检**:命中直接返回具体词(400),不再拿一次「必失败」的发布去给账号加风险分;预检接口自身故障时不阻断发布
- **风控冷却 600 秒**:goofish-cli 实测「发布失败后立刻重试会继续给账号加风险分」,原来 60 秒冷却会让前端每分钟重试一轮,反而把风控拖得更久。现在命中 `FAIL_BIZ_*`/`RGV587`/`USER_VALIDATE` 后 600 秒内直接返回「还需等待 N 秒(这段时间内重试会加重风控)」
- **上游失败打印完整响应**:`ret` + `data` 一起打日志(原来只有 `ret` 的通用文案,真正的子错误码在 `data` 里,没打出来就只能靠再发一次来猜)
- **发布载荷摘要日志**:每次发布记录标题/描述长度、图片数、标签数、类目、价格、发货方式、数量
- 前端兜底提示「请等 1 分钟后再试」→「发布已暂停 10 分钟,请到时再试」(与后端冷却时长一致)
### 🔍 排查记录
- 最后一次成功发布是 **2026-11-16 16:51**(探针在 1 秒内连发 6 件),其后 22:02、22:10、11-17 09:00 三次全部被闲鱼以通用「发布失败」拒绝
- **双实例抢同一账号**:旧系统 `xianyu-super`(8585) 与本系统(8586) 同时在跑账号 `687910262`——8585 近 6 小时 499 条相关日志,token 刷新每 300 秒一次且全部 `FAIL_SYS_SESSION_EXPIRED`;07:00 看门狗日报已判定「两个实例互相挤同一会话,大概率就是触发被挤爆啦风控的原因」。**待办:8585 / 8586 二选一保留该账号**
- 下一次发布失败时,日志里会直接给出上游 `data` 的真实子错误码,可据此终局定位
---
## 2026-11-17 · v3.6.17
### 🐛 修复
- **一键转卖发布报 `Request failed with status code 422`**
- 根因:预览回填的**商品描述是闲鱼原文**,实测最长 4684 字,而后端 `desc` 字段上限只有 2000 字,超限即被 FastAPI 拒为 422;前端又没有解析 `detail`,只把 axios 默认文案抛给用户,所以看不到到底哪个字段不合法
- 后端:`desc` 上限 2000 → 8000;`title` 上限 60 → **30**(对齐闲鱼真实限制,31~60 字会被 mtop 以 `FAIL_BIZ_TITLE_LENGTH_TOO_LONG` 拒绝,原来要到 502 才暴露)
- 前端请求层新增 `detailToMessage()`:把 Pydantic 的字段校验数组翻成「描述最多 8000 个字符(当前 4684 个)」这类中文原因,并对闲鱼风控(`RGV587`/`FAIL_BIZ_JSON_ERROR`)、登录态失效等业务错误给出人话提示
- 发布前置校验:标题 >30 字、描述 >8000 字直接在前端拦截并提示,不再把请求发出去
- AI 候选标题点击填入时截断到 30 字;标题输入框限 30 字并显示「闲鱼限 30 字,当前 N 字」;描述框放宽到 8000 字并显示字数
- **发布被闲鱼风控拦截时提示不可读**(日志实测 `FAIL_BIZ_JSON_ERROR::发布失败,请稍后重试吧!` 触发 60 秒冷却,前端只显示 502)→ 现在统一提示「闲鱼风控拦截,请等 1 分钟后再试」
### 🔍 排查记录
- 容器访问日志时间线(UTC+8):21:32 三次 422(描述超限),22:02/22:04/22:10 三次 502(闲鱼风控)。此前 422 全量日志中仅 3 条,均来自 `/resell/publish`
---
## 2026-11-17 · v3.6.16
### 🐛 修复
- **商品与发货页计数不对:显示 34 件,实际在售只有 14 件**
- 根因:本地库把 20 件**已下架**商品与 14 件在售商品混排在同一列表里,页头徽标、商品页签、账号下拉三处统一用了含下架的总数 `items.length`
- 计数口径全部改为「在售数」`onSaleCount`:页头徽标、`商品与专属发货` 页签、账号下拉(`全部账号(在售 14)`)
### ✨ 新功能
- **商品按状态分段显示:在售 / 已下架 / 草稿**
- 工具栏下方新增三态分段页签,带实时计数,选中态为品牌黄高亮
- 三套数据互不混排,切换即整表换数据;页头徽标跟随当前页签(`在售 14 件` / `已下架 20 件` / `草稿 N 件`)
- 空状态文案按状态区分(没有已下架商品 / 没有草稿 / 正在拉取 / 拉取失败)
- 草稿本地库没有概念,切到草稿页签时才按账号实时拉闲鱼(带 scope 去重守卫,不重复打接口)
### 🔧 后端
- 新增 `GET /items/xyh-list`:按闲鱼商品分组(在售 / 已下架 / 已售出 / 草稿)分页拉取,挂 `get_current_user` 鉴权
- `XianyuAutoAsync.get_item_list_info` 增加 `group_name` 参数按分组名选择;指定分组时不再复用上次缓存的「在售」分组
- 账号缺少对应分组时返回可读提示(列出现有分组名),不报成接口异常
### ✅ 验证
- 造 14 在售 + 20 下架的测试数据实测:在售页签 14 行 / 已下架 20 行 / 草稿 0,页签计数、页头徽标、页脚 `共 N 页(N 件)`、商品页签计数四处同步且一致
- 浏览器实测三态来回切换 + vision 核验视觉无重叠溢出
- 生产容器重启后 `/items/xyh-list` 返回 401(路由存在且鉴权生效)
- 测试账号、测试 cookie、测试商品已全部清除(用户表仅剩 admin、jinghui)
---
## 2026-11-17 · v3.6.15
### ✨ 新功能
- **使用说明页导航固定浮动**
- 桌面端左侧目录卡片吸顶悬浮,滚到任意位置目录始终可见
- 移动端顶部横向导航吸顶停在 header 下沿,锚点跳转不再被遮挡
- 根因:`main` 上的 `overflow-y: auto` 把 `position: sticky` 锁死(自身不滚动,实际滚动发生在 document),移除后吸顶恢复
- **使用说明页宽度自适应全屏**
- 该页去掉 `max-w-[1320px]` 限宽改 `w-full` 铺满可用宽度,右侧不再留大片空白;其他页面保持原有限宽
### 🐛 修复
- 商品页引用了已删除的 `showOffShelf` 会抛 `ReferenceError` 打崩页面,改接 `statusFilter`
---
## 2026-11-17 · v3.6.14
### ✨ 新功能
- **同行热卖店铺页美化**:卡片与表格视觉重做,新增斑马纹提升长表可读性
---
## 2026-11-16 · v3.6.13
### 🐛 修复
+1 -1
View File
@@ -47,7 +47,7 @@
| 📢 **公告与版本推送** | 接入授权系统:在线人数统计、新版本横幅提示、公告统一推送 |
| ✨ **品牌与体验** | 全站更名为「躺赚鱼」,中文界面,登录页 / 侧边栏 / 页脚统一 |
> 完整改动记录见 [CHANGELOG.md](CHANGELOG.md)(v1.1.0 → v3.6.11,逐版本带验证记录)。
> 完整改动记录见 [CHANGELOG.md](CHANGELOG.md)(v1.1.0 → v3.6.17,逐版本带验证记录)。
## 💡 为什么要用这个版本
+31 -9
View File
@@ -11213,7 +11213,7 @@ class XianyuLive:
items.append(item)
return items
async def get_item_list_info(self, page_number=1, page_size=20, retry_count=0):
async def get_item_list_info(self, page_number=1, page_size=20, retry_count=0, group_name=None):
"""动态发现当前账号的在售分组并获取商品列表。"""
if retry_count >= 4:
return {'error': '获取商品信息失败,重试次数过多'}
@@ -11315,7 +11315,8 @@ class XianyuLive:
return res_json
try:
item_group = getattr(self, '_item_list_group', None)
# 指定 group_name 时强制走分组发现,不能复用上次选中的“在售”缓存
item_group = None if group_name else getattr(self, '_item_list_group', None)
if page_number == 1 or not item_group:
discovery_response = await request_item_api({
'needGroupInfo': True,
@@ -11328,7 +11329,7 @@ class XianyuLive:
error_msg = discovery_ret[0] if discovery_ret else '未知错误'
if 'TOKEN' in str(error_msg).upper():
await asyncio.sleep(0.5)
return await self.get_item_list_info(page_number, page_size, retry_count + 1)
return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name)
return {'error': f"商品分组发现失败: {error_msg}"}
# 用 `or []` 兜住显式 None:闲鱼对无分组账号有时省略这个键
@@ -11348,8 +11349,28 @@ class XianyuLive:
f"【{self.cookie_id}】商品分组发现: account={self.myid}, "
f"groups={group_summary}"
)
item_group = self._select_item_group(groups)
if not item_group:
if group_name:
item_group = next(
(
group for group in groups
if isinstance(group, dict) and str(group.get('groupName')) == group_name
),
None,
)
if not item_group:
available = [
str(group.get('groupName')) for group in groups
if isinstance(group, dict) and group.get('groupName')
]
return {
'error': (
f'闲鱼账号没有名为「{group_name}」的商品分组'
f'(现有分组:{"、".join(available) or "无"})'
)
}
else:
item_group = self._select_item_group(groups)
if not item_group and not group_name:
# 没匹配到“在售”不代表拿不到商品:闲鱼可能改了分组文案,
# 账号也可能只有自定义分组。这里退回“按商品数最多的分组”,
# 真的一件商品都没有才如实返回空列表,而不是报成接口异常。
@@ -11424,7 +11445,8 @@ class XianyuLive:
confirmed=False,
response_fields=sorted(discovery_data.keys()),
)
self._item_list_group = item_group
if group_name is None:
self._item_list_group = item_group
group_id = item_group.get('groupId')
group_name = item_group.get('groupName', '在售')
@@ -11442,7 +11464,7 @@ class XianyuLive:
error_msg = response_ret[0] if response_ret else '未知错误'
if 'TOKEN' in str(error_msg).upper():
await asyncio.sleep(0.5)
return await self.get_item_list_info(page_number, page_size, retry_count + 1)
return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name)
return {'error': f"获取商品信息失败: {error_msg}"}
items_data = res_json.get('data', {})
@@ -11510,11 +11532,11 @@ class XianyuLive:
f"(第{retry_count + 1}次): {self._safe_str(e)}"
)
await asyncio.sleep(backoff)
return await self.get_item_list_info(page_number, page_size, retry_count + 1)
return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name)
except Exception as e:
logger.error(f"商品信息API请求异常: {self._safe_str(e)}")
await asyncio.sleep(0.5)
return await self.get_item_list_info(page_number, page_size, retry_count + 1)
return await self.get_item_list_info(page_number, page_size, retry_count + 1, group_name=group_name)
async def get_all_items(self, page_size=20, max_pages=None):
"""获取所有在售商品信息(自动分页)。"""
+2
View File
@@ -43,6 +43,7 @@ from app.routers.logistics_quote import create_logistics_quote_router
from app.routers.logistics_agent import create_logistics_agent_router
from app.routers.hotlist import create_hotlist_router
from app.routers.peer_shops import create_peer_shops_router
from app.routers.xyh_items import create_xyh_items_router
from utils.qr_login import qr_login_manager
from utils.xianyu_utils import trans_cookies
from utils.image_utils import image_manager
@@ -397,6 +398,7 @@ logger.info("已注册物流 Agent 路由")
app.include_router(create_hotlist_router(get_current_user, db_manager))
app.include_router(create_peer_shops_router(get_current_user, db_manager))
app.include_router(create_xyh_items_router(get_current_user, db_manager))
logger.info("已注册实时热卖榜路由")
from app.routers.pricewatch import create_pricewatch_router, start_scheduler as start_pricewatch_scheduler
+350 -31
View File
@@ -20,9 +20,18 @@ from pydantic import BaseModel, Field
from utils.xianyu_seller_api import SellerApiError, XianyuSellerAPI
from utils.search_parse import parse_search_items
from loguru import logger
MAX_IMAGES = 9
# 闲鱼服务端拒绝发布后的一段冷却。goofish-cli 的实测结论是:发布失败后立刻重试
# 会继续给账号加风险分,每 60 秒来一轮只会把风控拖得更久。所以这里直接挡住发布
# 并告诉用户还要等多久,而不是放任前端反复重试。
PUBLISH_COOLDOWN_SECONDS = 600
_publish_blocked_until: Dict[str, float] = {}
# 命中这些码说明是闲鱼风控/服务端拒绝,不是我们自己的参数问题
_RISK_DETAIL_RE = re.compile(r"FAIL_BIZ_[A-Z_]+|RGV587[A-Z_]*|USER_VALIDATE", re.I)
def _normalize_search_items(parsed: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
"""共享解析产出的字段比 ResellItem 多(publish_time/keywords),
@@ -48,12 +57,22 @@ class ResellPreviewRequest(BaseModel):
item_id: str
class ResellCatOverride(BaseModel):
"""手选类目:catId/channelCatId 必填,tbCatId 允许为空(部分闲鱼类目没有)。"""
cat_id: str = Field(min_length=1, max_length=32)
channel_cat_id: str = Field(min_length=1, max_length=32)
tb_cat_id: str = Field(default="", max_length=32)
cat_name: str = Field(default="", max_length=60)
class ResellPublishRequest(BaseModel):
cookie_id: str
item_id: str
title: str = Field(min_length=1, max_length=60)
# 闲鱼真实限制:标题 ≤30 字(超过会被 mtop 以 FAIL_BIZ_TITLE_LENGTH_TOO_LONG 拒绝)
title: str = Field(min_length=1, max_length=30)
price: float = Field(gt=0)
desc: str = Field(default="", max_length=2000)
# 源商品描述常在数千字(实测最长 4684),上限过小会让预览回填的描述直接 422
desc: str = Field(default="", max_length=8000)
# 包邮 / 无需邮寄 / 一口价
delivery: str = "包邮"
post_price: float = Field(default=0, ge=0)
@@ -61,6 +80,15 @@ class ResellPublishRequest(BaseModel):
# 自定义图片列表 [{url, width, height}]:用户在弹窗里增删/替换后的最终图片;
# 为空或全非法时回退源商品图片,保持向后兼容
images: Optional[List[Dict[str, Any]]] = None
# 用户在弹窗里手选的类目;三项齐全时直接采用,不再走自动识别
cat: Optional[ResellCatOverride] = None
class ResellCategoryRequest(BaseModel):
"""类目选择器数据源:当前类目 + 可选类目列表。"""
cookie_id: str
item_id: str = Field(default="", max_length=64)
title: str = Field(default="", max_length=120)
class ResellAiOptimizeRequest(BaseModel):
@@ -221,6 +249,74 @@ def create_resell_router(
)
return {"success": True, "item": _normalize_detail(result.get("data") or {})}
# ------------------------------------------------------------------
# 类目选择器数据源:当前类目 + kgraph 候选类目(「修改类目」用)
# ------------------------------------------------------------------
@router.post("/resell/categories")
async def resell_categories(
req: ResellCategoryRequest,
current_user: dict[str, Any] = Depends(get_current_user),
):
details = require_account(req.cookie_id, current_user)
title = (req.title or "").strip()
current: Dict[str, Any] = {}
current_name = ""
# 当前类目取源商品详情;查询失败不拦,候选列表照常返回
detail_images: List[Dict[str, Any]] = []
if req.item_id:
try:
result = await call_buyer(
req.cookie_id,
details["value"],
"mtop.taobao.idle.pc.detail",
{"itemId": str(req.item_id)},
spm_cnt="a21ybx.detail.0.0",
)
norm = _normalize_detail(result.get("data") or {})
current = dict(norm.get("cat") or {})
current_name = str(norm.get("cat_name") or "")
title = title or str(norm.get("title") or "")
detail_images = list(norm.get("images") or [])
except HTTPException:
pass
# 一次 kgraph 调用同时拿到识别结果和候选类目列表;
# 带上源商品图片,识别命中率和候选质量都明显更高
guess, guess_name, options = await _kgraph_categories(
req.cookie_id, details["value"], title, detail_images,
req.item_id or "catpick",
)
if not current:
current, current_name = dict(guess), guess_name
elif not _cat_is_publishable(current):
matched = _match_option(current, options)
if matched:
current = {
"catId": current.get("catId") or matched["cat_id"],
"channelCatId": current.get("channelCatId") or matched["channel_cat_id"],
"tbCatId": current.get("tbCatId") or matched["tb_cat_id"],
}
current_name = current_name or matched["cat_name"]
# 候选的 catId 补齐:kgraph 用识别结果补过,仍缺的用详情类目补
context_cat_id = str(current.get("catId") or "") or str(guess.get("catId") or "")
filled: List[Dict[str, Any]] = []
for opt in options:
if not opt.get("cat_id"):
opt = dict(opt, cat_id=context_cat_id)
if opt.get("cat_id") and opt.get("channel_cat_id"):
filled.append(opt)
options = filled
return {
"success": True,
"current": _cat_out(current, current_name),
"predicted": _cat_out(guess, guess_name),
"options": options,
"title": title,
}
# ------------------------------------------------------------------
# 一键转卖发布
# ------------------------------------------------------------------
@@ -232,6 +328,18 @@ def create_resell_router(
details = require_account(req.cookie_id, current_user)
cookies_str = details["value"]
# 冷却期内直接拦下:让前端显示还要等多久,而不是又发一次必失败的请求
blocked_until = _publish_blocked_until.get(req.cookie_id, 0.0)
if time.time() < blocked_until:
remain = int(round(blocked_until - time.time()))
raise HTTPException(
status_code=502,
detail=(
f"闲鱼判定该账号处于发布风控冷却期,发布已暂停,还需等待 {remain} 秒"
"(这段时间内重试会加重风控)"
),
)
if not req.title.strip():
raise HTTPException(status_code=400, detail="标题不能为空")
try:
@@ -272,14 +380,44 @@ def create_resell_router(
cat = dict(item_do.get("itemCatDTO") or {})
cat_name = _category_name(labels)
# 2. 类目名缺失时用 kgraph AI 识别兜底(正常详情都带,兜底很少触发)
if not cat.get("catId") or not cat_name:
cat, cat_name = await _recommend_category(
# 2. 类目:用户手选的优先,其次详情自带的(只补缺项,不改原类目),
# 最后才用 kgraph 识别兜底。发布要求 itemCatDTO 的
# catId/channelCatId/tbCatId 三项齐全——缺一项会提交字符串 "None",
# 闲鱼以 FAIL_BIZ_JSON_ERROR 拒绝整个报文。
if req.cat:
cat = {
"catId": req.cat.cat_id,
"channelCatId": req.cat.channel_cat_id,
"tbCatId": req.cat.tb_cat_id,
}
cat_name = (req.cat.cat_name or "").strip() or _category_name(labels)
elif not (_cat_is_publishable(cat) and cat_name):
guess, guess_name, options = await _kgraph_categories(
req.cookie_id, cookies_str,
req.title.strip(), images, req.item_id,
)
if not cat.get("catId"):
raise HTTPException(status_code=400, detail="无法识别商品类目,无法转卖")
matched = _match_option(cat, options)
if matched:
cat = {
"catId": str(cat.get("catId") or matched["cat_id"]),
"channelCatId": str(cat.get("channelCatId") or matched["channel_cat_id"]),
"tbCatId": str(cat.get("tbCatId") or matched["tb_cat_id"]),
}
cat_name = cat_name or matched["cat_name"]
if not _cat_is_publishable(cat):
cat, cat_name = guess, cat_name or guess_name
else:
cat_name = cat_name or guess_name
if not _cat_is_publishable(cat):
raise HTTPException(
status_code=400,
detail="无法识别商品类目,无法转卖:请点「修改类目」手动选择一个类目再发布",
)
if not (cat_name or "").strip():
raise HTTPException(
status_code=400,
detail="类目名称缺失:请点「修改类目」重新选择类目再发布",
)
# 3. 默认发布地址
poi_result = await call_buyer(
@@ -290,32 +428,95 @@ def create_resell_router(
)
poi_data = poi_result.get("data") or {}
addresses = poi_data.get("commonAddresses") or []
selected = poi_data.get("selectedPoi") or (addresses[0] if addresses else None)
# 发布地址必须带 divisionId:缺了 itemAddrDTO 会退化成空字段,闲鱼
# 解析报文失败,返回 FAIL_BIZ_JSON_ERROR(通用文案,看不出是地址问题)。
candidates = [poi_data.get("selectedPoi") or {}]
candidates += [a for a in addresses if isinstance(a, dict)]
selected = next(
(a for a in candidates if a.get("divisionId")),
None,
)
if not selected:
raise HTTPException(status_code=400, detail="账号未设置发布地址,请先在闲鱼 App 设置默认地址")
# 4. 组装发布报文(结构对齐 goofish-cli 真实发布验证过的 payload)
publish_desc = (req.desc or "").strip() or (item_do.get("desc") or "").strip()
# 发布前先跑只读的违禁词预检。闲鱼的违禁词/外联词检查覆盖标题、描述、评论、
# 消息所有位置,命中会直接让发布失败;预检是只读接口,先拦下来既能给出具体
# 词,也省掉一次“必失败”的发布去给账号加风险分。预检接口本身挂了不挡发布。
try:
badwords_result = await call_buyer(
req.cookie_id, cookies_str,
"mtop.taobao.idleitem.badwords.prepubcheck",
{
"title": f"{req.title.strip()}\n{publish_desc[:2000]}",
"scene": "pcPublish",
"sessionId": str(time.time_ns() // 1000),
},
spm_cnt="a21ybx.publish.0.0",
version="2.0",
)
except Exception: # noqa: BLE001 - 预检失败不能挡住正常发布
badwords_result = None
if badwords_result:
bw_data = badwords_result.get("data") or {}
if bw_data.get("forbidPublish"):
hit_words: List[str] = []
for entry in ((bw_data.get("badWordAlertInfo") or {}).get("items")) or []:
hit_words.extend(str(w) for w in (entry.get("words") or []))
if len(hit_words) >= 8:
break
hint = "、".join(hit_words[:8]) or "标题或描述"
raise HTTPException(
status_code=400,
detail=f"闲鱼违禁词预检未通过:{hint}。请修改标题/描述后重试",
)
payload = _build_publish_payload(
title=req.title.strip(),
desc=(req.desc or "").strip() or (item_do.get("desc") or "").strip(),
desc=publish_desc,
price_cent=price_cent,
post_price_cent=_money(req.post_price) if req.delivery == "一口价" and req.post_price > 0 else None,
delivery=req.delivery,
quantity=req.quantity,
images=images,
labels=labels,
cat=cat,
cat_name=cat_name,
location=selected,
original_price=item_do.get("originalPrice"),
)
result = await call_buyer(
req.cookie_id, cookies_str,
"mtop.idle.pc.idleitem.publish",
payload,
spm_cnt="a21ybx.publish.0.0",
# 每次发布都留一份载荷摘要,出问题时不用再猜用户填了什么
logger.info(
f"【转卖发布】{req.cookie_id} item={req.item_id} "
f"title_len={len(req.title.strip())} desc_len={len(publish_desc)} "
f"images={len(images)} cat={cat.get('catId')}/{cat.get('channelCatId')} "
f"cat_name={cat_name} "
f"price={req.price} delivery={req.delivery} qty={req.quantity}"
)
try:
result = await call_buyer(
req.cookie_id, cookies_str,
"mtop.idle.pc.idleitem.publish",
payload,
spm_cnt="a21ybx.publish.0.0",
)
except HTTPException as exc:
detail_text = str(exc.detail)
if _RISK_DETAIL_RE.search(detail_text):
# 闲鱼风控/服务端拒绝:进入冷却,期间任何发布请求都直接给可读提示
_publish_blocked_until[req.cookie_id] = time.time() + PUBLISH_COOLDOWN_SECONDS
upstream = _RISK_DETAIL_RE.sub("", detail_text).split("::")[-1].strip(" :")
raise HTTPException(
status_code=502,
detail=(
f"闲鱼服务端拒绝了本次发布({upstream[:60] or '风控拦截'})。"
f"为避免加重风控,发布已暂停 {PUBLISH_COOLDOWN_SECONDS // 60} 分钟,请到时再试"
),
) from exc
raise
new_id = str(((result.get("data") or {}).get("itemId") or "")).strip()
if not new_id:
raise HTTPException(status_code=502, detail="发布接口未返回商品 ID,请到闲鱼核实是否已发布")
@@ -497,14 +698,76 @@ def _category_name(labels: List[Dict[str, Any]]) -> str:
return ""
async def _recommend_category(
def _cat_is_publishable(cat: Optional[Dict[str, Any]]) -> bool:
"""发布可用的类目:catId 与 channelCatId 必填。
tbCatId 是可选的——部分闲鱼类目(例如「电子资料」)本身没有淘宝类目 ID,
官方发布实现里该项留空即可;缺失时必须写成空串,绝不能变成字符串 "None"
(那会让闲鱼以 FAIL_BIZ_JSON_ERROR 拒掉整个报文)。
"""
return bool(cat and cat.get("catId") and cat.get("channelCatId"))
def _category_option(raw: Any) -> Optional[Dict[str, str]]:
"""kgraph「分类」候选 → 前端可选的手选类目。
候选里 catId / tbCatId 常为空:catId 用调用方上下文补,tbCatId 本就允许为空。
"""
if not isinstance(raw, dict):
return None
channel = str(raw.get("channelCatId") or "")
name = str(raw.get("catName") or "")
if not channel or not name:
return None
return {
"cat_id": str(raw.get("catId") or ""),
"cat_name": name,
"channel_cat_id": channel,
"tb_cat_id": str(raw.get("tbCatId") or ""),
}
def _cat_out(cat: Optional[Dict[str, Any]], name: str = "") -> Dict[str, str]:
"""详情里的 itemCatDTO(数值 id)→ 前端/手选类目统一的四项格式。"""
cat = cat or {}
return {
"cat_id": str(cat.get("catId") or ""),
"channel_cat_id": str(cat.get("channelCatId") or ""),
"tb_cat_id": str(cat.get("tbCatId") or ""),
"cat_name": (name or "").strip() or str(cat.get("catName") or ""),
}
def _match_option(
cat: Optional[Dict[str, Any]],
options: List[Dict[str, str]],
) -> Optional[Dict[str, str]]:
"""详情类目与候选对上号时,用它补齐缺的 tbCatId / 类目名(不改原类目)。"""
if not cat:
return None
for key in ("catId", "channelCatId"):
value = str(cat.get(key) or "")
if not value:
continue
field = "cat_id" if key == "catId" else "channel_cat_id"
hit = next((opt for opt in options if opt[field] == value), None)
if hit:
return hit
return None
async def _kgraph_categories(
cookie_id: str,
cookies_str: str,
title: str,
images: List[Dict[str, Any]],
unique_seed: str,
) -> tuple[Dict[str, Any], str]:
"""kgraph AI 类目识别,仅在详情缺类目时兜底。"""
) -> tuple[Dict[str, Any], str, List[Dict[str, str]]]:
"""kgraph 类目识别:返回 (识别类目, 类目名, 可选类目列表)。
cardList 里 propertyName=分类 的 valuesList 就是发布页那份类目选择列表,
每项自带 catId/channelCatId/tbCatId,供前端「修改类目」手选用。
"""
image_infos = [{
"extraInfo": {"isH": "false", "isT": "false", "raw": "false"},
"isQrCode": False,
@@ -533,18 +796,69 @@ async def _recommend_category(
version="2.0",
)
except SellerApiError:
return {}, ""
return {}, "", []
finally:
await client.close()
predict = ((result.get("data") or {}).get("categoryPredictResult")) or {}
if not predict.get("catId"):
return {}, ""
data = result.get("data") or {}
options: List[Dict[str, str]] = []
seen = set()
for card in data.get("cardList") or []:
if not isinstance(card, dict):
continue
card_data = card.get("cardData") if isinstance(card.get("cardData"), dict) else card
if card_data.get("propertyName") != "分类":
continue
for raw in (card_data.get("valuesList") or card.get("valuesList") or [])[:400]:
opt = _category_option(raw)
if not opt:
continue
key = (opt["cat_id"], opt["channel_cat_id"])
if key in seen:
continue
seen.add(key)
options.append(opt)
predict = data.get("categoryPredictResult") or {}
predict_cat_id = str(predict.get("catId") or "")
# 候选常常只带 channelCatId(同一频道类目共用一个 catId),
# 先用识别结果的 catId 补齐,补不出的丢掉——发布必须有 catId。
for opt in options:
if not opt["cat_id"]:
opt["cat_id"] = predict_cat_id
options = [opt for opt in options if opt["cat_id"]]
if not predict_cat_id:
return {}, "", options
cat = {
"catId": str(predict.get("catId")),
"channelCatId": str(predict.get("channelCatId")),
"tbCatId": str(predict.get("tbCatId")),
"catId": predict_cat_id,
"channelCatId": str(predict.get("channelCatId") or ""),
"tbCatId": str(predict.get("tbCatId") or ""),
}
return cat, str(predict.get("catName") or "")
matched = _match_option(cat, options) if not _cat_is_publishable(cat) else None
if matched:
cat = {
"catId": cat["catId"] or matched["cat_id"],
"channelCatId": cat["channelCatId"] or matched["channel_cat_id"],
"tbCatId": cat["tbCatId"] or matched["tb_cat_id"],
}
cat_name = str(predict.get("catName") or (matched or {}).get("cat_name") or "")
if not _cat_is_publishable(cat):
return {}, "", options
return cat, cat_name, options
async def _recommend_category(
cookie_id: str,
cookies_str: str,
title: str,
images: List[Dict[str, Any]],
unique_seed: str,
) -> tuple[Dict[str, Any], str]:
"""kgraph AI 类目识别,仅在详情缺类目时兜底(返回值保持两元组)。"""
cat, cat_name, _ = await _kgraph_categories(cookie_id, cookies_str, title, images, unique_seed)
return cat, cat_name
def _build_publish_payload(
@@ -556,7 +870,6 @@ def _build_publish_payload(
delivery: str,
quantity: int,
images: List[Dict[str, Any]],
labels: List[Dict[str, Any]],
cat: Dict[str, Any],
cat_name: str,
location: Dict[str, Any],
@@ -617,17 +930,23 @@ def _build_publish_payload(
"simpleItem": "true",
"imageInfoDOList": image_do_list,
"itemTextDTO": {"desc": desc, "title": title, "titleDescSeparate": True},
"itemLabelExtList": labels or [],
# 必须是空数组:这里的 labels 是详情接口 itemDO.itemLabelExtList 的
# 展示型标签(propertyText/valueText),与发布接口要的结构完全不同,
# 原样透传会让闲鱼反序列化失败并返回 FAIL_BIZ_JSON_ERROR。
# 已核对真实发布实现(goofish-cli / PC 发布页):这一项恒为空。
"itemLabelExtList": [],
"itemPriceDTO": price_dto,
"userRightsProtocols": [{"enable": False, "serviceCode": "SKILL_PLAY_NO_MIND"}],
"itemPostFeeDTO": post_fee,
"itemAddrDTO": item_addr,
"defaultPrice": False,
# tbCatId 缺失时必须写空串:写成字符串 "None" 会被闲鱼以
# FAIL_BIZ_JSON_ERROR 拒掉(部分闲鱼类目本就没有淘宝类目 ID)。
"itemCatDTO": {
"catId": str(cat.get("catId")),
"catId": str(cat.get("catId") or ""),
"catName": cat_name,
"channelCatId": str(cat.get("channelCatId")),
"tbCatId": str(cat.get("tbCatId")),
"channelCatId": str(cat.get("channelCatId") or ""),
"tbCatId": str(cat.get("tbCatId") or ""),
},
"onlyTakeSelf": False,
"uniqueCode": str(time.time_ns() // 1000),
+302
View File
@@ -0,0 +1,302 @@
"""闲鱼实时商品:按状态分组列表(在售/已下架/已售出/草稿)与商品编辑。
分组数据来自 mtop.idle.web.xyh.item.list 的 itemGroupList(综合/在售/已售出/
自定义分组,账号有已下架商品时会出现「已下架」组);草稿组同理按名匹配,
闲鱼没开草稿分组时返回明确的空态提示而不是报错。
编辑走 mtop.idle.pc.idleitem.edit,报文结构与一键转卖发布
(mtop.idle.pc.idleitem.publish)完全一致,额外带 itemId。
"""
import logging
from typing import Any, Callable, Dict, List, Optional
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel
from XianyuAutoAsync import XianyuLive
from utils.xianyu_seller_api import SellerApiError, XianyuSellerAPI
from app.routers.resell import (
_build_publish_payload,
_category_name,
_detail_images,
_money,
_normalize_detail,
_recommend_category,
)
logger = logging.getLogger(__name__)
# 前端固定选项卡(必须与闲鱼分组名逐字一致,拉取时按名匹配)
XYH_STATUS_GROUPS = ("在售", "已下架", "已售出", "草稿")
class XyhDetailRequest(BaseModel):
cookie_id: str
item_id: str
class XyhEditRequest(BaseModel):
cookie_id: str
item_id: str
title: str
price: float
quantity: int = 1
delivery: str = "包邮"
post_price: float = 0
desc: str = ""
images: Optional[List[Dict[str, Any]]] = None
def create_xyh_items_router(
get_current_user: Callable[..., Dict[str, Any]],
db_manager: Any,
) -> APIRouter:
router = APIRouter()
def require_account(cookie_id: str, current_user: Dict[str, Any]) -> Dict[str, Any]:
details = db_manager.get_cookie_details(cookie_id)
if not details or details.get("user_id") != current_user["user_id"]:
raise HTTPException(status_code=404, detail="账号不存在或无权限")
if not details.get("value"):
raise HTTPException(status_code=400, detail="账号 Cookie 为空,无法调用闲鱼接口")
return details
async def call_buyer(
cookie_id: str,
cookies_str: str,
api: str,
payload: Dict[str, Any],
spm_cnt: str = "a21ybx.item.0.0",
version: str = "1.0",
) -> Dict[str, Any]:
client = XianyuSellerAPI(cookie_id, cookies_str)
try:
return await client._call_buyer(api, payload, spm_cnt=spm_cnt, version=version)
except SellerApiError as exc:
raise HTTPException(status_code=502, detail=str(exc)) from exc
finally:
await client.close()
# ------------------------------------------------------------------
# 分组商品列表:在售 / 已下架 / 已售出 / 草稿
# ------------------------------------------------------------------
@router.get("/items/xyh-list")
async def xyh_list(
cookie_id: str,
group_name: str = "在售",
page: int = 1,
current_user: Dict[str, Any] = Depends(get_current_user),
):
if group_name not in XYH_STATUS_GROUPS:
raise HTTPException(status_code=400, detail=f"不支持的商品状态:{group_name}")
details = require_account(cookie_id, current_user)
instance = XianyuLive(
cookies_str=details["value"],
cookie_id=cookie_id,
user_id=current_user["user_id"],
)
try:
result = await instance.get_item_list_info(max(1, page), 20, group_name=group_name)
finally:
await instance.close_session()
if result.get("error"):
# 分组不存在(如账号没有草稿分组)→ 200 空列表 + 提示,让前端显示空态
error_text = str(result["error"])
if "没有名为" in error_text:
return {"success": True, "group_name": group_name, "page": page,
"total": 0, "items": [], "notice": error_text}
raise HTTPException(status_code=502, detail=error_text)
items: List[Dict[str, Any]] = []
for it in result.get("items") or []:
if not isinstance(it, dict) or not it.get("id"):
continue
items.append({
"item_id": str(it.get("id") or ""),
"item_title": it.get("title") or "未命名商品",
"item_price": it.get("price") or "",
"item_image": it.get("item_image") or "",
"cookie_id": cookie_id,
"xyh_status": group_name,
})
return {
"success": True,
"group_name": result.get("group_name") or group_name,
"page": page,
"total": result.get("total_count") or len(items),
"items": items,
}
# ------------------------------------------------------------------
# 商品详情(编辑弹窗预填):字段与一键转卖预览一致 + 运费方式推断
# ------------------------------------------------------------------
def _infer_delivery(item_do: Dict[str, Any]) -> tuple[str, str]:
"""从详情的 postFee 推断运费方式与一口价运费(元)。"""
post_fee = item_do.get("postFee") or {}
if not isinstance(post_fee, dict):
return "包邮", ""
if post_fee.get("canFreeShipping"):
return "包邮", ""
price_cent = post_fee.get("postPriceInCent")
if price_cent:
try:
return "一口价", str(round(int(price_cent) / 100, 2))
except (TypeError, ValueError):
pass
if str(post_fee.get("templateId") or "") == "-100":
return "按距离计费", ""
return "无需邮寄", ""
@router.post("/items/xyh-detail")
async def xyh_detail(
req: XyhDetailRequest,
current_user: Dict[str, Any] = Depends(get_current_user),
):
details = require_account(req.cookie_id, current_user)
# 编辑页初始化数据(p_publish-index.js 用它预填),拿不到再回退商品详情
data: Dict[str, Any] = {}
try:
edit_detail = await call_buyer(
req.cookie_id,
details["value"],
"mtop.idle.pc.idleitem.editDetail",
{"itemId": str(req.item_id)},
spm_cnt="a21ybx.publish.0.0",
)
data = edit_detail.get("data") or {}
except HTTPException:
data = {}
# editDetail 结构可能不含 itemDO.title,拿不到就回退商品详情
item_do = data.get("itemDO") if isinstance(data.get("itemDO"), dict) else {}
if not item_do.get("title"):
result = await call_buyer(
req.cookie_id,
details["value"],
"mtop.taobao.idle.pc.detail",
{"itemId": str(req.item_id)},
spm_cnt="a21ybx.detail.0.0",
)
data = result.get("data") or {}
item = _normalize_detail(data)
delivery, post_price = _infer_delivery(data.get("itemDO") or {})
item["delivery"] = delivery
item["post_price"] = post_price
if not item.get("title"):
raise HTTPException(status_code=502, detail="详情里没有标题,无法编辑该商品")
return {"success": True, "item": item}
# ------------------------------------------------------------------
# 提交编辑:与一键转卖同一套报文(_build_publish_payload)+ itemId
# ------------------------------------------------------------------
@router.post("/items/xyh-edit")
async def xyh_edit(
req: XyhEditRequest,
current_user: Dict[str, Any] = Depends(get_current_user),
):
details = require_account(req.cookie_id, current_user)
cookies_str = details["value"]
if not req.title.strip():
raise HTTPException(status_code=400, detail="标题不能为空")
try:
price_cent = _money(req.price)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
# 1. 源详情:类目 / 标签 / 原价 / 未改动的图片兜底
detail_result = await call_buyer(
req.cookie_id, cookies_str,
"mtop.taobao.idle.pc.detail",
{"itemId": str(req.item_id)},
spm_cnt="a21ybx.detail.0.0",
)
detail = detail_result.get("data") or {}
item_do = detail.get("itemDO") or {}
images = _detail_images(item_do)
if req.images:
custom: List[Dict[str, Any]] = []
for raw in req.images[:9]:
if not isinstance(raw, dict):
continue
url = str(raw.get("url") or "").strip()
if not url.startswith(("http://", "https://")):
continue
try:
width = int(raw.get("width") or 1000)
height = int(raw.get("height") or 1000)
except (TypeError, ValueError):
width, height = 1000, 1000
custom.append({"url": url, "width": width, "height": height})
if custom:
images = custom
if not images:
raise HTTPException(status_code=400, detail="商品没有可用图片,无法保存")
labels = item_do.get("itemLabelExtList") or []
cat = dict(item_do.get("itemCatDTO") or {})
cat_name = _category_name(labels)
if not (cat.get("catId") and cat.get("channelCatId")
and cat.get("tbCatId") and cat_name):
# 类目字段不全时透传会变成 "None",闲鱼以 FAIL_BIZ_JSON_ERROR 拒绝
cat, cat_name = await _recommend_category(
req.cookie_id, cookies_str,
req.title.strip(), images, req.item_id,
)
if not cat.get("catId"):
raise HTTPException(status_code=400, detail="详情里没有类目信息,无法保存编辑")
# 2. 发布地址(与转卖一致,取账号默认)
poi_result = await call_buyer(
req.cookie_id, cookies_str,
"mtop.taobao.idle.local.poi.get",
{"longitude": 116.4, "latitude": 39.9},
spm_cnt="a21ybx.publish.0.0",
)
poi_data = poi_result.get("data") or {}
addresses = poi_data.get("commonAddresses") or []
candidates = [poi_data.get("selectedPoi") or {}]
candidates += [a for a in addresses if isinstance(a, dict)]
selected = next((a for a in candidates if a.get("divisionId")), None)
if not selected:
raise HTTPException(status_code=400, detail="账号未设置发布地址,请先在闲鱼 App 设置默认地址")
# 3. 组装报文(与一键转卖发布同一结构)+ itemId
payload = _build_publish_payload(
title=req.title.strip(),
desc=(req.desc or "").strip() or (item_do.get("desc") or "").strip(),
price_cent=price_cent,
post_price_cent=_money(req.post_price)
if req.delivery == "一口价" and req.post_price > 0 else None,
delivery=req.delivery,
quantity=max(1, int(req.quantity or 1)),
images=images,
cat=cat,
cat_name=cat_name,
location=selected,
original_price=item_do.get("originalPrice"),
)
# PC 编辑页(p_publish-index.js):有 itemId 走 edit,且
# bizcode/publishScene 必须是 pcMainPublish,沿用发布的 mainPublish 会
# 被服务端以 FAIL_BIZ_JSON_ERROR 拒绝(pyxianyu docs 实证)
payload["itemId"] = str(req.item_id)
payload["bizcode"] = "pcMainPublish"
payload["publishScene"] = "pcMainPublish"
result = await call_buyer(
req.cookie_id, cookies_str,
"mtop.idle.pc.idleitem.edit",
payload,
spm_cnt="a21ybx.publish.0.0",
)
data = result.get("data") or {}
edited_id = str(data.get("itemId") or req.item_id)
return {
"success": True,
"item_id": edited_id,
"url": f"https://www.goofish.com/item?id={edited_id}",
"title": req.title.strip(),
"price": req.price,
}
return router
+5 -2
View File
@@ -564,7 +564,7 @@ const App: React.FC = () => {
}}
/>
<main className="min-h-screen min-w-0 flex-1 overflow-y-auto lg:ml-[248px]">
<main className="min-h-screen min-w-0 flex-1 lg:ml-[248px]">
<header className="sticky top-0 z-20 flex h-14 items-center gap-3 border-b border-[var(--border)] bg-[var(--surface)] px-4 lg:hidden">
<button
type="button"
@@ -585,7 +585,10 @@ const App: React.FC = () => {
<div className={
activeTab === 'messages'
? 'h-[calc(100vh-3.5rem)] lg:h-screen overflow-hidden'
: 'mx-auto max-w-[1320px] p-4 pb-10 sm:p-6 lg:p-8'
: activeTab === 'help'
// 使用说明页信息密度低、要按屏宽铺满阅读,不再锁 1320px
? 'w-full p-4 pb-10 sm:p-6 lg:p-8'
: 'mx-auto max-w-[1320px] p-4 pb-10 sm:p-6 lg:p-8'
}>
<section hidden={activeTab !== 'dashboard'}>
<Suspense fallback={activeTab === 'dashboard' ? <PageLoader /> : null}><Dashboard /></Suspense>
+6 -4
View File
@@ -276,11 +276,13 @@ const Help: React.FC = () => {
};
return (
<div className="p-4 md:p-6">
<div>
<div className="flex flex-col lg:flex-row gap-6">
{/* 左侧定位菜单 */}
<nav id="help-nav" className="lg:w-48 shrink-0">
<div className="lg:sticky lg:top-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-3">
{/* 移动端 flex-col 下 nav 高度=内容,须让 nav 自身吸顶(父级是整页 flex 容器);
桌面端 nav 被拉伸到整行高,由内层卡片 sticky */}
<nav id="help-nav" className="sticky top-14 lg:top-auto z-10 lg:z-auto lg:w-56 shrink-0">
<div className="lg:sticky lg:top-2 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-3 shadow-sm">
<div className="px-2 pb-2 text-xs font-semibold text-slate-400 uppercase tracking-wider">
功能导航
</div>
@@ -329,7 +331,7 @@ const Help: React.FC = () => {
<section
key={it.id}
id={`help-${it.id}`}
className="bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-5 scroll-mt-4"
className="bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-5 scroll-mt-32 lg:scroll-mt-4"
>
<div className="flex items-center gap-2">
<span className="w-1.5 h-5 rounded-full bg-amber-500" />
+163 -27
View File
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useRef, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import {
Box,
@@ -32,6 +32,7 @@ import {
getItemDeliveryConfig,
getItemDeliveryConfigs,
getItems,
getXyhList,
getShippingRules,
saveItemDeliveryConfig,
polishItems,
@@ -245,27 +246,113 @@ const ItemList: React.FC = () => {
[deliveryConfigs],
);
// 下架商品默认藏起来:它们和在售的混在一起会让人误以为还能卖,
// 但不能直接删 —— 专属发货配置挂在商品上,重新上架还要接着用。
const [showOffShelf, setShowOffShelf] = useState(false);
const [statusFilter, setStatusFilter] = useState<'on_sale' | 'off_shelf' | 'draft'>('on_sale');
const isOffShelf = (item: Item) => item.listing_status === 'off_shelf';
const isDraft = (item: Item) => item.listing_status === 'draft';
const accountScopedItems = useMemo(
() => (listAccountFilter ? items.filter(item => item.cookie_id === listAccountFilter) : items),
[items, listAccountFilter],
);
const onSaleCount = useMemo(
() => accountScopedItems.filter(item => !isOffShelf(item) && !isDraft(item)).length,
[accountScopedItems],
);
const offShelfCount = useMemo(
() => accountScopedItems.filter(isOffShelf).length,
[accountScopedItems],
);
const visibleItems = useMemo(
() => (showOffShelf ? accountScopedItems : accountScopedItems.filter(item => !isOffShelf(item))),
[accountScopedItems, showOffShelf],
// 账号下拉里每个账号的在售数:口径与列表一致,下拉不再显示含下架的总数
const onSaleCountOf = useCallback(
(accountId: string) => items.filter(item => item.cookie_id === accountId && !isOffShelf(item) && !isDraft(item)).length,
[items],
);
// 闲鱼草稿:本地库无草稿概念,按账号实时从闲鱼拉取(xyh-list), account scope 变化时重拉。
const [draftState, setDraftState] = useState<{
scope: string;
items: Item[];
total: number;
notice: string;
error: string;
} | null>(null);
const [draftLoading, setDraftLoading] = useState(false);
const draftScopedItems = useMemo(() => {
const base = draftState?.items || [];
return listAccountFilter ? base.filter(item => item.cookie_id === listAccountFilter) : base;
}, [draftState, listAccountFilter]);
const draftTotal = draftState?.total ?? null;
const draftNotice = draftState?.notice || '';
const fetchDrafts = useCallback(async () => {
const scope = listAccountFilter || '__all__';
const accountIds = listAccountFilter ? [listAccountFilter] : accounts.map(a => a.id);
if (!accountIds.length) return;
// 同一账号范围已经拉过就不重复打闲鱼接口(轮询/重渲染都会走到这里)
if (draftState?.scope === scope) return;
setDraftLoading(true);
try {
const results = await Promise.all(
accountIds.map(async (aid) => {
try {
return await getXyhList(aid, '草稿', 1);
} catch (e: any) {
return { success: false, group_name: '草稿', page: 1, total: 0, items: [], notice: '', _error: e?.message || '拉取失败' };
}
}),
);
const merged: Item[] = [];
let total = 0;
let notice = '';
let error = '';
for (const r of results) {
if (r && r.success) {
total += typeof r.total === 'number' ? r.total : (r.items?.length || 0);
(r.items || []).forEach((x: any) => {
merged.push({
id: `draft:${x.cookie_id || ''}:${x.item_id}`,
cookie_id: x.cookie_id,
item_id: x.item_id,
item_title: x.item_title,
item_price: x.item_price,
item_image: x.item_image,
listing_status: 'draft',
} as Item);
});
if (r.notice) notice = r.notice;
} else {
notice = notice || (r as any).notice || '';
error = error || (r as any)._error || '';
}
}
setDraftState({ scope, items: merged, total, notice, error });
} catch (e: any) {
setDraftState({ scope, items: [], total: 0, notice: '', error: e?.message || '拉取失败' });
} finally {
setDraftLoading(false);
}
}, [listAccountFilter, accounts]);
// 切到草稿页签或换账号范围时才去闲鱼拉草稿(本地库没有草稿概念)
useEffect(() => {
if (statusFilter !== 'draft') return;
void fetchDrafts();
}, [statusFilter, fetchDrafts]);
const visibleItems = useMemo(() => {
if (statusFilter === 'draft') return draftScopedItems;
const base = accountScopedItems;
return statusFilter === 'on_sale'
? base.filter(item => !isOffShelf(item) && !isDraft(item))
: base.filter(isOffShelf);
}, [accountScopedItems, statusFilter, draftScopedItems]);
// 商品数据由后端一次性返回,这里做客户端分页:商品多时一屏几十行难以浏览
const totalPages = Math.max(1, Math.ceil(visibleItems.length / pageSize));
const pagedItems = useMemo(
@@ -677,14 +764,20 @@ const ItemList: React.FC = () => {
title="商品与发货"
description="同步在售商品并配置自动发货。"
icon={Box}
badge={<span className="status-badge status-badge-info">{items.length} 件商品</span>}
badge={(
<span className="status-badge status-badge-info">
{statusFilter === 'on_sale' && `在售 ${onSaleCount} 件`}
{statusFilter === 'off_shelf' && `已下架 ${offShelfCount} 件`}
{statusFilter === 'draft' && `草稿 ${draftTotal ?? '—'} 件`}
</span>
)}
/>
<PageTabs
value={activeSection}
onChange={setActiveSection}
items={[
{ id: 'products', label: '商品与专属发货', icon: ShoppingBag, count: items.length },
{ id: 'products', label: '商品与专属发货', icon: ShoppingBag, count: onSaleCount },
{ id: 'rules', label: '通用发货规则', icon: ListChecks, count: genericRules.length },
{ id: 'protection', label: '发货保护与黑名单', icon: ShieldAlert },
]}
@@ -716,30 +809,16 @@ const ItemList: React.FC = () => {
}}
aria-label="选择账号"
>
<option value="">全部账号({items.length})</option>
<option value="">全部账号(在售 {onSaleCount})</option>
{accounts.map(account => (
<option key={account.id} value={account.id}>
{accountNames.get(account.id)}({items.filter(i => i.cookie_id === account.id).length})
{accountNames.get(account.id)}(在售 {onSaleCountOf(account.id)})
</option>
))}
</select>
<span className="text-xs text-gray-500">
已配置专属发货 {configuredItemCount} 件
</span>
{offShelfCount > 0 && (
<label className="flex cursor-pointer items-center gap-1.5 text-xs text-gray-500">
<input
type="checkbox"
className="h-3.5 w-3.5 cursor-pointer accent-brand-500"
checked={showOffShelf}
onChange={event => {
setShowOffShelf(event.target.checked);
setPage(1);
}}
/>
显示已下架({offShelfCount})
</label>
)}
</div>
<div className="flex flex-wrap items-center gap-2">
@@ -774,6 +853,49 @@ const ItemList: React.FC = () => {
</div>
</div>
{/* 状态分段:在售/已下架/草稿三套数据互不混排。
本地库只有在售与下架,草稿要现拉闲鱼,故计数在拉取前显示为 — */}
<div className="flex flex-wrap items-center gap-1 border-b border-gray-200 px-4 py-2" role="tablist" aria-label="商品状态">
{([
{ id: 'on_sale', label: '在售', count: onSaleCount },
{ id: 'off_shelf', label: '已下架', count: offShelfCount },
{ id: 'draft', label: '草稿', count: draftTotal },
] as const).map(tab => {
const active = statusFilter === tab.id;
return (
<button
key={tab.id}
type="button"
role="tab"
aria-selected={active}
onClick={() => {
setStatusFilter(tab.id);
setPage(1);
}}
className={`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors ${
active
? 'bg-[var(--brand)] font-semibold text-[var(--brand-ink)] shadow-sm'
: 'text-gray-500 hover:bg-gray-100 hover:text-gray-700'
}`}
>
{tab.label}
<span className={`text-xs ${active ? 'text-[var(--brand-ink)]/70' : 'text-gray-400'}`}>
{tab.id === 'draft' && draftTotal === null ? '—' : tab.count}
</span>
</button>
);
})}
{statusFilter === 'draft' && draftLoading && (
<span className="ml-1 flex items-center gap-1 text-xs text-gray-400">
<Loader2 className="h-3.5 w-3.5 animate-spin" />
正在从闲鱼拉取草稿…
</span>
)}
{statusFilter === 'draft' && !draftLoading && draftNotice && (
<span className="ml-1 text-xs text-gray-400">{draftNotice}</span>
)}
</div>
{visibleItems.length > 0 ? (
<>
{/* 各列用固定宽度而非 minmax 压缩:列宽足够时内容不再挤在一起,
@@ -1030,8 +1152,22 @@ const ItemList: React.FC = () => {
</>
) : (
<EmptyState
title="暂无商品数据"
description="先选择闲鱼账号同步在售商品,也可以手动添加商品并直接配置自动发货。"
title={
statusFilter === 'off_shelf' ? '没有已下架商品'
: statusFilter === 'draft' ? '没有草稿'
: '暂无商品数据'
}
description={
statusFilter === 'off_shelf'
? '该账号目前没有被下架的商品。下架的商品会从在售列表移出,同步后自动归到这里。'
: statusFilter === 'draft'
? draftLoading
? '正在从闲鱼拉取草稿…'
: draftState?.error
? `草稿拉取失败:${draftState.error}`
: '该账号在闲鱼上没有未发布的草稿。'
: '先选择闲鱼账号同步在售商品,也可以手动添加商品并直接配置自动发货。'
}
icon={ShoppingBag}
action={(
<button type="button" onClick={openManualModal} className="ios-btn-secondary rounded-md px-4 py-2 text-sm">
+148 -7
View File
@@ -11,10 +11,11 @@ import {
Store,
X,
} from 'lucide-react';
import { AccountDetail, ResellItem, ResellPreviewItem } from '../types';
import { AccountDetail, ResellCategory, ResellItem, ResellPreviewItem } from '../types';
import {
getAccountDetails,
getResellAiOptimize,
getResellCategories,
getResellFavorites,
previewResellItem,
publishResellItem,
@@ -62,6 +63,8 @@ interface PublishForm {
delivery: string;
postPrice: string;
quantity: string;
/** 发布用的类目:预览/手选后填;为空则后端自动识别 */
cat: ResellCategory | null;
}
const emptyForm: PublishForm = {
@@ -71,6 +74,21 @@ const emptyForm: PublishForm = {
delivery: '包邮',
postPrice: '0',
quantity: '1',
cat: null,
};
// 详情里的类目字段转成发布用格式;缺 catId/channelCatId 的返回 null(交给手选)
const catFromDetail = (detail: ResellPreviewItem): ResellCategory | null => {
const cat = detail.cat || {};
const catId = String(cat.catId ?? '');
const channelCatId = String(cat.channelCatId ?? '');
if (!catId || !channelCatId) return null;
return {
cat_id: catId,
channel_cat_id: channelCatId,
tb_cat_id: String(cat.tbCatId ?? ''),
cat_name: detail.cat_name || '',
};
};
const Resell: React.FC = () => {
@@ -109,6 +127,11 @@ const Resell: React.FC = () => {
// AI 一键优化:候选标题 + 生成中状态
const [aiTitles, setAiTitles] = useState<string[]>([]);
const [aiLoading, setAiLoading] = useState(false);
// 类目选择器:候选类目列表 + 手选状态
const [catOptions, setCatOptions] = useState<ResellCategory[]>([]);
const [catLoading, setCatLoading] = useState(false);
const [showCatPicker, setShowCatPicker] = useState(false);
const [catKeyword, setCatKeyword] = useState('');
const accountNames = useMemo(
() => new Map(accounts.map(account => [
@@ -118,6 +141,13 @@ const Resell: React.FC = () => {
[accounts],
);
// 类目候选按关键词过滤(候选来自闲鱼 kgraph,通常上百条)
const filteredCats = useMemo(() => {
const kw = catKeyword.trim().toLowerCase();
if (!kw) return catOptions;
return catOptions.filter(opt => opt.cat_name.toLowerCase().includes(kw));
}, [catOptions, catKeyword]);
useEffect(() => {
getAccountDetails()
.then(data => {
@@ -307,6 +337,32 @@ const Resell: React.FC = () => {
}
};
// 类目候选:发布弹窗打开时拉一次,供「修改类目」搜索选择
const loadCategories = async (itemId: string, title: string) => {
setCatLoading(true);
try {
const res = await getResellCategories({
cookie_id: selectedAccount,
item_id: itemId,
title: title || '',
});
setCatOptions(res.options || []);
// 详情没给出可用类目时,用接口返回的当前类目兜底(tbCatId 允许为空)
const current = res.current;
if (current?.cat_id && current?.channel_cat_id) {
setForm(prev => (prev.cat ? prev : { ...prev, cat: current }));
}
} catch (error) {
// 候选列表拿不到不拦发布:仍按已识别/自动识别的类目发
setNotice({
type: 'warning',
message: `类目列表加载失败(${error instanceof Error ? error.message : '未知错误'}),可稍后再点「修改类目」`,
});
} finally {
setCatLoading(false);
}
};
const openResell = async (item: ResellItem) => {
if (!selectedAccount) {
setNotice({ type: 'error', message: '请先选择账号' });
@@ -318,6 +374,9 @@ const Resell: React.FC = () => {
setAiTitles([]);
setShowAddUrl(false);
setImgUrlDraft('');
setShowCatPicker(false);
setCatKeyword('');
setCatOptions([]);
// 预览未回前先用卡片图占位,详情回来后整组覆盖
setEditImages(
(item.images?.length
@@ -346,6 +405,7 @@ const Resell: React.FC = () => {
price: detailPrice.replace(/[^\d.]/g, '') || current.price,
desc: detail.desc || '',
quantity: String(detail.quantity || 1),
cat: catFromDetail(detail) || current.cat,
}));
} catch (error) {
// 预览失败不拦转卖:仍可用列表里的标题/价格手动填
@@ -353,6 +413,8 @@ const Resell: React.FC = () => {
} finally {
setPreviewLoading(false);
}
// 类目候选与当前类目并行拉取,弹窗打开即可点「修改类目」
void loadCategories(item.item_id, item.title || '');
};
const closeResell = () => {
@@ -360,6 +422,8 @@ const Resell: React.FC = () => {
setPublishItem(null);
setPreview(null);
setPublishedUrl('');
setShowCatPicker(false);
setCatKeyword('');
};
const submitPublish = async () => {
@@ -373,6 +437,15 @@ const Resell: React.FC = () => {
setNotice({ type: 'error', message: '请输入有效的价格' });
return;
}
const title = form.title.trim();
if (title.length > 30) {
setNotice({ type: 'error', message: `标题不能超过 30 个字(当前 ${title.length} 字,闲鱼硬限制)` });
return;
}
if (form.desc.length > 8000) {
setNotice({ type: 'error', message: `描述不能超过 8000 字(当前 ${form.desc.length} 字)` });
return;
}
setPublishing(true);
setNotice(null);
try {
@@ -386,6 +459,7 @@ const Resell: React.FC = () => {
post_price: Number(form.postPrice) || 0,
quantity: Number(form.quantity) || 1,
images: editImages.length ? editImages : undefined,
cat: form.cat && form.cat.cat_id ? form.cat : undefined,
});
setPublishedUrl(res.url);
setNotice({ type: 'success', message: `转卖发布成功:${res.title}` });
@@ -773,11 +847,14 @@ const Resell: React.FC = () => {
<input
id="resell-title"
value={form.title}
maxLength={60}
maxLength={30}
onChange={event => setForm(current => ({ ...current, title: event.target.value }))}
className="ios-input w-full rounded-md px-3 py-2.5"
placeholder="商品标题"
/>
<p className={`mt-1 text-xs ${form.title.length > 30 ? 'text-red-500' : 'text-gray-400'}`}>
闲鱼限 30 字,当前 {form.title.length} 字
</p>
{aiTitles.length > 0 && (
<div className="mt-2 flex flex-col gap-1.5">
<p className="text-xs text-gray-400">AI 候选标题(点击填入上方输入框):</p>
@@ -785,7 +862,7 @@ const Resell: React.FC = () => {
<button
key={`${title}-${index}`}
type="button"
onClick={() => setForm(current => ({ ...current, title }))}
onClick={() => setForm(current => ({ ...current, title: title.slice(0, 30) }))}
className={`rounded-md border px-2.5 py-1.5 text-left text-xs leading-relaxed transition ${
form.title === title
? 'border-purple-500 bg-purple-50 text-purple-700'
@@ -860,16 +937,80 @@ const Resell: React.FC = () => {
id="resell-desc"
value={form.desc}
rows={5}
maxLength={2000}
maxLength={8000}
onChange={event => setForm(current => ({ ...current, desc: event.target.value }))}
className="ios-input w-full rounded-md px-3 py-2.5"
placeholder="商品描述"
/>
<p className="mt-1 text-xs text-gray-400">{form.desc.length} / 8000</p>
</div>
{preview?.cat_name && (
<p className="text-xs text-gray-400">类目:{preview.cat_name}(发布时自动带上)</p>
)}
<div>
<div className="mb-2 flex items-center justify-between gap-3">
<label className="text-sm font-bold text-gray-700">商品类目</label>
<button
type="button"
onClick={() => setShowCatPicker(value => !value)}
className="text-xs font-bold text-[#ff4400] hover:underline"
>
{showCatPicker ? '收起' : '修改类目'}
</button>
</div>
<div className="ios-input rounded-md px-3 py-2.5 text-sm text-gray-800">
{form.cat?.cat_name || preview?.cat_name || '未识别(发布时自动识别)'}
</div>
{showCatPicker && (
<div className="mt-2 rounded-md border border-gray-200 bg-gray-50 p-3">
<input
value={catKeyword}
onChange={event => setCatKeyword(event.target.value)}
placeholder="搜索类目,如:电子资料 / 内存条"
className="ios-input w-full rounded-md px-3 py-2 text-sm"
aria-label="搜索类目"
/>
{catLoading ? (
<p className="mt-2 flex items-center gap-2 text-xs text-gray-500">
<Loader2 className="h-3.5 w-3.5 animate-spin" /> 正在加载类目…
</p>
) : filteredCats.length ? (
<ul className="mt-2 max-h-56 overflow-y-auto rounded-md bg-white">
{filteredCats.slice(0, 150).map(opt => {
const active = Boolean(
form.cat
&& form.cat.cat_id === opt.cat_id
&& form.cat.channel_cat_id === opt.channel_cat_id,
);
return (
<li key={`${opt.cat_id}-${opt.channel_cat_id}`}>
<button
type="button"
onClick={() => {
setForm(current => ({ ...current, cat: opt }));
setShowCatPicker(false);
setCatKeyword('');
}}
className={`flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm ${active ? 'bg-[#ffc940]/25 font-bold text-gray-900' : 'text-gray-700 hover:bg-gray-100'}`}
>
<span className="truncate">{opt.cat_name}</span>
<span className={`shrink-0 text-[10px] ${active ? 'text-gray-900' : 'text-gray-400'}`}>
{active ? '当前' : '选择'}
</span>
</button>
</li>
);
})}
</ul>
) : (
<p className="mt-2 text-xs text-gray-400">
{catOptions.length ? '没有匹配的类目,换个关键词试试' : '候选类目加载失败,可关掉弹窗重开重试'}
</p>
)}
<p className="mt-2 text-[11px] leading-4 text-gray-400">
候选来自闲鱼发布页的分类列表,选中后按该类目发布;自动识别不准确时可在这里手动改。
</p>
</div>
)}
</div>
{publishedUrl && (
<div className="rounded-md border border-green-200 bg-green-50 p-3 text-sm text-green-700">
+57
View File
@@ -25,6 +25,54 @@ request.interceptors.request.use(
(error) => Promise.reject(error),
);
const FIELD_LABELS: Record<string, string> = {
title: '标题',
desc: '描述',
price: '价格',
post_price: '运费',
quantity: '数量',
cookie_id: '账号',
item_id: '商品',
images: '图片',
};
/** 闲鱼常见的业务错误码 → 人话。放在前端兜底,后端也会做一次。 */
const BIZ_HINTS: Array<[RegExp, string]> = [
[/FAIL_BIZ_TITLE_LENGTH_TOO_LONG|标题不能超过\s*30/i, '标题不能超过 30 个字'],
[/FAIL_BIZ_JSON_ERROR|RGV587|挤爆|USER_VALIDATE/i, '闲鱼风控拦截,发布已暂停 10 分钟,请到时再试'],
[/FAIL_BIZ_DESC/i, '商品描述不符合闲鱼要求,请精简后重试'],
[/SESSION_EXPIRED|FAIL_SYS_SESSION_EXPIRED|令牌/i, '闲鱼登录态已失效,请重新扫码登录该账号'],
];
/** 把 FastAPI/Pydantic 的 detail(字符串或数组)翻成一句中文原因。 */
function detailToMessage(detail: unknown): string | null {
if (typeof detail === 'string' && detail.trim()) {
for (const [pattern, hint] of BIZ_HINTS) {
if (pattern.test(detail)) return hint;
}
return detail;
}
if (!Array.isArray(detail) || detail.length === 0) return null;
const parts = detail.map((entry) => {
const item = entry as { loc?: unknown[]; msg?: string; type?: string };
const loc = Array.isArray(item.loc) ? item.loc.filter((key) => key !== 'body' && key !== 'query') : [];
const field = loc.length ? String(loc[loc.length - 1]) : '';
const label = FIELD_LABELS[field] || field || '请求参数';
const msg = String(item.msg || '');
const max = msg.match(/at most (\d+) characters/);
if (max) return `${label}最多 ${max[1]} 个字符(当前 ${(item as { input?: unknown }).input ? String((item as { input?: unknown }).input).length : '?'} 个)`;
const min = msg.match(/at least (\d+) characters?/);
if (min) return `${label}至少 ${min[1]} 个字符`;
if (/greater than 0/.test(msg)) return `${label}必须大于 0`;
if (/greater than or equal to 0/.test(msg)) return `${label}不能为负数`;
if (/valid number/.test(msg)) return `${label}必须是数字`;
if (/valid integer|integer/i.test(msg)) return `${label}必须是整数`;
if (/field required|missing/i.test(item.type || msg)) return `缺少${label}`;
return msg ? `${label}:${msg}` : `${label}不合法`;
});
return parts.join(';');
}
request.interceptors.response.use(
(response: AxiosResponse) => response,
(error: AxiosError) => {
@@ -36,6 +84,15 @@ request.interceptors.response.use(
/* no-op (SSR) */
}
}
// 把后端的可读原因提到 message 上:默认 axios 只会说
// "Request failed with status code 422",用户看不到到底哪个字段不合法。
const readable = detailToMessage((error.response?.data as { detail?: unknown } | undefined)?.detail);
if (readable) {
const wrapped = new Error(readable) as Error & { status?: number; data?: unknown };
wrapped.status = error.response?.status;
wrapped.data = error.response?.data;
return Promise.reject(wrapped);
}
return Promise.reject(error);
},
);
+48
View File
@@ -633,6 +633,31 @@ export const getItems = async (): Promise<Item[]> => {
return Array.isArray(res) ? res : (res.items || []);
}
/** 闲鱼实时商品分组列表(在售 / 已下架 / 已售出 / 草稿),按账号 + 分组名拉取。 */
export const getXyhList = async (
cookieId: string,
groupName: string,
page = 1,
): Promise<{
success: boolean;
group_name: string;
page: number;
total: number;
items: Array<{
item_id: string;
item_title: string;
item_price: string;
item_image: string;
cookie_id: string;
xyh_status: string;
}>;
notice?: string;
}> => {
return get(
`/items/xyh-list?cookie_id=${encodeURIComponent(cookieId)}&group_name=${encodeURIComponent(groupName)}&page=${page}`,
);
}
export const syncItemsFromAccount = async (cookieId: string): Promise<any> => {
return post('/items/get-all-from-account', { cookie_id: cookieId });
}
@@ -1641,6 +1666,14 @@ export const getPrCookies = async (): Promise<{
cookies: { id: string }[];
}> => get('/pricewatch/cookies');
/** 可手选的商品类目:catId / channelCatId / tbCatId 三项缺一不可(缺一项发布会被闲鱼拒) */
export interface ResellCategory {
cat_id: string;
channel_cat_id: string;
tb_cat_id: string;
cat_name: string;
}
/** 发布转卖,返回新商品 ID 与链接。 */
export const publishResellItem = async (data: {
cookie_id: string;
@@ -1653,9 +1686,24 @@ export const publishResellItem = async (data: {
quantity?: number;
/** 弹窗里增删改后的图片列表;缺省则用源商品图片 */
images?: { url: string; width: number; height: number }[];
/** 用户在弹窗里手选的类目;带上则直接按它发布,不再自动识别 */
cat?: ResellCategory;
}): Promise<{ success: boolean; item_id: string; url: string; title: string; price: number }> =>
post('/resell/publish', data);
/** 类目选择器数据源:当前类目 + 候选类目列表(「修改类目」弹层用)。 */
export const getResellCategories = async (data: {
cookie_id: string;
item_id?: string;
title?: string;
}): Promise<{
success: boolean;
current: ResellCategory;
predicted: ResellCategory;
options: ResellCategory[];
title: string;
}> => post('/resell/categories', data);
/** 转卖图片本地上传(存服务端 resell_uploads,返回可直链访问的 path)。 */
export const uploadResellImage = async (file: File): Promise<{ success: boolean; path: string }> => {
const form = new FormData();
+8
View File
@@ -671,6 +671,14 @@ export interface ResellPreviewItem {
area: string;
}
/** 可手选的商品类目:catId / channelCatId / tbCatId 三项缺一不可(缺一项发布会被闲鱼拒) */
export interface ResellCategory {
cat_id: string;
channel_cat_id: string;
tb_cat_id: string;
cat_name: string;
}
// ==================== AI 一键优化建议 ====================
@@ -1 +1 @@
import{r as l,o as O,n as i,z as k,j as e,B as j,L as A,E as H,aE as q,S,K as z,aR as B}from"./index-HJMc2HxZ.js";import{P as F,a as U,E as D,S as o}from"./ui-vFagDj8B.js";import{S as $}from"./save-qf4Q-Bil.js";import{M as E}from"./message-square-text-CP89w054.js";import{E as G}from"./eye-off-VWv0mxs9.js";import{E as J}from"./eye-D3neYBSg.js";import{P as C}from"./play-zVF2f9jg.js";const I="https://ai.88531.cn/v1",Q="https://ai.88531.cn",f={ai_enabled:!1,model_name:"qwen-plus",api_key:"",api_key_configured:!1,base_url:I,user_agent:"codex_cli_rs/0.0.0 (Hermes Agent)",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""},ae=()=>{const[c,P]=l.useState([]),[t,y]=l.useState(""),[a,d]=l.useState(f),[R,x]=l.useState(!0),[p,N]=l.useState(!1),[u,_]=l.useState(!1),[g,w]=l.useState(!1),[h,K]=l.useState("你好,这个商品现在还能买吗?"),[v,b]=l.useState(""),r=l.useMemo(()=>c.find(s=>s.id===t),[c,t]);l.useEffect(()=>{O().then(s=>{var m;P(s),y(((m=s[0])==null?void 0:m.id)||"")}).catch(s=>i(s instanceof Error?s.message:"账号加载失败","error")).finally(()=>x(!1))},[]),l.useEffect(()=>{t&&(x(!0),b(""),w(!1),k(t).then(s=>d({...f,...s,api_key:""})).catch(s=>i(s instanceof Error?s.message:"AI配置加载失败","error")).finally(()=>x(!1)))},[t]);const n=(s,m)=>{d(M=>({...M,[s]:m}))},T=async()=>{if(!t){i("请先选择账号","warning");return}if(!a.model_name.trim()||!a.base_url.trim()){i("模型名称和接口地址不能为空","warning");return}N(!0);try{await z(t,a);const s=await k(t);d({...f,...s,api_key:""}),i("人工智能回复配置已保存","success")}catch(s){i(s instanceof Error?s.message:"AI配置保存失败","error")}finally{N(!1)}},L=async()=>{if(!t||!h.trim()){i("请选择账号并输入测试消息","warning");return}_(!0),b("");try{const s=await B(t,{message:h.trim(),item_title:"测试商品",item_price:100,item_desc:"仅用于测试人工智能回复,不会发送到闲鱼。"});b(s.reply||s.message||"测试完成"),i("AI回复测试完成","success")}catch(s){i(s instanceof Error?s.message:"AI回复测试失败","error")}finally{_(!1)}};return R&&c.length===0?e.jsx(F,{label:"正在加载 AI 回复配置"}):e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(U,{title:"AI 回复",description:"按账号配置模型连接、上下文记忆、议价边界和业务回复规则。",icon:j,actions:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-end gap-2",children:[e.jsxs("label",{className:"min-w-0 sm:w-72",children:[e.jsx("span",{className:"field-label",children:"当前账号"}),e.jsx("select",{value:t,onChange:s=>y(s.target.value),className:"ios-input w-full rounded-md px-3 py-2 text-sm font-semibold",children:c.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||`账号 ${s.id.slice(0,8)}`},s.id))})]}),e.jsxs("button",{type:"button",onClick:T,disabled:p||!t,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[p?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx($,{className:"h-4 w-4"}),p?"保存中":"保存配置"]})]})}),t?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel grid gap-4 p-4 lg:grid-cols-[1fr_auto] lg:items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-gray-900",children:[e.jsx(E,{className:"h-5 w-5"}),(r==null?void 0:r.nickname)||(r==null?void 0:r.remark)||t]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"回复优先级:关键词回复 → 人工智能回复 → 默认回复。AI失败时不会中断消息处理。"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[e.jsx("span",{className:"text-sm font-bold text-gray-700",children:a.ai_enabled?"已启用":"已停用"}),e.jsx("input",{type:"checkbox",checked:a.ai_enabled,onChange:s=>n("ai_enabled",s.target.checked),className:"h-5 w-5 accent-yellow-400"})]})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(340px,0.65fr)]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"模型连接",description:"支持 OpenAI 兼容接口;密钥留空时保留服务器中已有配置。",icon:j}),e.jsxs("div",{className:"grid gap-4 p-5 md:grid-cols-2",children:[e.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-brand-200 bg-brand-50 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-800",children:"没有 API Key?每天可免费领取额度"}),e.jsx("p",{className:"mt-0.5 text-xs text-gray-600",children:"兼容 OpenAI 接口,注册后把密钥填到下方即可直接用。"})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:e.jsxs("a",{href:Q,target:"_blank",rel:"norefLine truncated
import{r as l,o as O,n as i,z as k,j as e,B as j,L as A,E as H,aF as F,S,K as q,aS as z}from"./index-DsODdDMf.js";import{P as B,a as U,E as D,S as o}from"./ui-CQHd7VNo.js";import{S as $}from"./save-1bfmWlQj.js";import{M as E}from"./message-square-text-SsmtmT8O.js";import{E as G}from"./eye-off-BivEoqlz.js";import{E as J}from"./eye-DqWY05EP.js";import{P as C}from"./play-DS4dwZmR.js";const I="https://ai.88531.cn/v1",Q="https://ai.88531.cn",f={ai_enabled:!1,model_name:"qwen-plus",api_key:"",api_key_configured:!1,base_url:I,user_agent:"codex_cli_rs/0.0.0 (Hermes Agent)",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""},ae=()=>{const[c,P]=l.useState([]),[t,y]=l.useState(""),[a,d]=l.useState(f),[K,x]=l.useState(!0),[p,N]=l.useState(!1),[u,_]=l.useState(!1),[g,w]=l.useState(!1),[h,R]=l.useState("你好,这个商品现在还能买吗?"),[v,b]=l.useState(""),r=l.useMemo(()=>c.find(s=>s.id===t),[c,t]);l.useEffect(()=>{O().then(s=>{var m;P(s),y(((m=s[0])==null?void 0:m.id)||"")}).catch(s=>i(s instanceof Error?s.message:"账号加载失败","error")).finally(()=>x(!1))},[]),l.useEffect(()=>{t&&(x(!0),b(""),w(!1),k(t).then(s=>d({...f,...s,api_key:""})).catch(s=>i(s instanceof Error?s.message:"AI配置加载失败","error")).finally(()=>x(!1)))},[t]);const n=(s,m)=>{d(M=>({...M,[s]:m}))},T=async()=>{if(!t){i("请先选择账号","warning");return}if(!a.model_name.trim()||!a.base_url.trim()){i("模型名称和接口地址不能为空","warning");return}N(!0);try{await q(t,a);const s=await k(t);d({...f,...s,api_key:""}),i("人工智能回复配置已保存","success")}catch(s){i(s instanceof Error?s.message:"AI配置保存失败","error")}finally{N(!1)}},L=async()=>{if(!t||!h.trim()){i("请选择账号并输入测试消息","warning");return}_(!0),b("");try{const s=await z(t,{message:h.trim(),item_title:"测试商品",item_price:100,item_desc:"仅用于测试人工智能回复,不会发送到闲鱼。"});b(s.reply||s.message||"测试完成"),i("AI回复测试完成","success")}catch(s){i(s instanceof Error?s.message:"AI回复测试失败","error")}finally{_(!1)}};return K&&c.length===0?e.jsx(B,{label:"正在加载 AI 回复配置"}):e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(U,{title:"AI 回复",description:"按账号配置模型连接、上下文记忆、议价边界和业务回复规则。",icon:j,actions:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-end gap-2",children:[e.jsxs("label",{className:"min-w-0 sm:w-72",children:[e.jsx("span",{className:"field-label",children:"当前账号"}),e.jsx("select",{value:t,onChange:s=>y(s.target.value),className:"ios-input w-full rounded-md px-3 py-2 text-sm font-semibold",children:c.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||`账号 ${s.id.slice(0,8)}`},s.id))})]}),e.jsxs("button",{type:"button",onClick:T,disabled:p||!t,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[p?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx($,{className:"h-4 w-4"}),p?"保存中":"保存配置"]})]})}),t?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel grid gap-4 p-4 lg:grid-cols-[1fr_auto] lg:items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-gray-900",children:[e.jsx(E,{className:"h-5 w-5"}),(r==null?void 0:r.nickname)||(r==null?void 0:r.remark)||t]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"回复优先级:关键词回复 → 人工智能回复 → 默认回复。AI失败时不会中断消息处理。"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[e.jsx("span",{className:"text-sm font-bold text-gray-700",children:a.ai_enabled?"已启用":"已停用"}),e.jsx("input",{type:"checkbox",checked:a.ai_enabled,onChange:s=>n("ai_enabled",s.target.checked),className:"h-5 w-5 accent-yellow-400"})]})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(340px,0.65fr)]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"模型连接",description:"支持 OpenAI 兼容接口;密钥留空时保留服务器中已有配置。",icon:j}),e.jsxs("div",{className:"grid gap-4 p-5 md:grid-cols-2",children:[e.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-brand-200 bg-brand-50 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-800",children:"没有 API Key?每天可免费领取额度"}),e.jsx("p",{className:"mt-0.5 text-xs text-gray-600",children:"兼容 OpenAI 接口,注册后把密钥填到下方即可直接用。"})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:e.jsxs("a",{href:Q,target:"_blank",rel:"norefLine truncated
@@ -1,4 +1,4 @@
import{c as m,r as n,j as e,bD as h,e as g,P as b,E as l,aE as j,aU as f,aV as o,bE as N}from"./index-HJMc2HxZ.js";import{a as u,E as y}from"./ui-vFagDj8B.js";/**
import{c as m,r as n,j as e,bE as h,e as g,P as b,E as l,aF as j,aV as f,aW as o,bF as N}from"./index-DsODdDMf.js";import{a as u,E as y}from"./ui-CQHd7VNo.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as ee,r as i,j as e,U as Ce,B as Q,M as Ze,L as C,S as G,e as Ae,k as es,b as z,X as T,l as ss,m as O,o as ts,p as as,q as rs,s as ls,t as ns,n as m,u as Ie,v as Me,w as is,x as os,y as ds,z as cs,A as ms,D as xs,F as us,G as hs,H as ps,I as gs,J as fs,K as bs,N as ys}from"./index-HJMc2HxZ.js";import{P as js,a as Ns,E as _s}from"./ui-vFagDj8B.js";import{C as Z}from"./check-BsSr22q3.js";import{S as ws}from"./sparkles-Da7ZNkrd.js";import{P as vs,a as ks}from"./power-CG9iERWF.js";import{T as Ss}from"./trash-2-Du5uC3X5.js";import{K as Cs}from"./key-Y7KCy9_1.js";import{E as As}from"./eye-off-VWv0mxs9.js";import{E as Is}from"./eye-D3neYBSg.js";import{S as $e}from"./save-qf4Q-Bil.js";/**
import{c as ee,r as i,j as e,U as Ce,B as Q,M as Ze,L as C,S as G,e as Ae,k as es,b as z,X as T,l as ss,m as O,o as ts,p as as,q as rs,s as ls,t as ns,n as m,u as Ie,v as Me,w as is,x as os,y as ds,z as cs,A as ms,D as xs,F as us,G as hs,H as ps,I as gs,J as fs,K as bs,N as ys}from"./index-DsODdDMf.js";import{P as js,a as Ns,E as _s}from"./ui-CQHd7VNo.js";import{C as Z}from"./check-D0r7RhTo.js";import{S as ws}from"./sparkles-CRcwNwKo.js";import{P as vs,a as ks}from"./power-BffuaJ6g.js";import{T as Ss}from"./trash-2-CvZQL5SJ.js";import{K as Cs}from"./key-B7TfiDhV.js";import{E as As}from"./eye-off-BivEoqlz.js";import{E as Is}from"./eye-DqWY05EP.js";import{S as $e}from"./save-1bfmWlQj.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1 +1 @@
import{r as n,j as e,Q as C,e as A,aS as $,T as P,o as B,n as i,aX as H,bF as M}from"./index-HJMc2HxZ.js";import{P as D,a as R,N as z,S as d}from"./ui-vFagDj8B.js";import{S as O}from"./save-qf4Q-Bil.js";import{S as U}from"./shield-alert-fp78nSHa.js";import{F as X}from"./flower-2-Bz3yOpyy.js";import{M as q}from"./message-square-text-CP89w054.js";const r=200,E="宝贝收到了,很满意,感谢老板,欢迎下次再来!",G="亲,感谢支持!有任何问题随时找我~",I={auto_rate_enabled:"评价买家",auto_flower_enabled:"索要小红花",auto_thanks_enabled:"收货致谢",auto_receive_flower_enabled:"自动收下小红花"},K=[{value:300,label:"5 分钟"},{value:900,label:"15 分钟"},{value:1800,label:"30 分钟"},{value:3600,label:"1 小时"},{value:7200,label:"2 小时(默认)"},{value:21600,label:"6 小时"},{value:86400,label:"24 小时"}],ee=()=>{const[l,c]=n.useState(null),[p,h]=n.useState(!1),[b,_]=n.useState(!1),[o,T]=n.useState([]),[f,x]=n.useState({}),j=()=>{h(!0),Promise.all([$(),P().catch(()=>null),B().catch(()=>[])]).then(([t,a,s])=>{c({...t,auto_rate_template:(t.auto_rate_template??"").trim()||(a==null?void 0:a.auto_rate_template)||E}),T(s),x((a==null?void 0:a.accounts)??{})}).finally(()=>h(!1))},F=async(t,a)=>{const s=f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},w={...s,[a]:!s[a]};x(u=>({...u,[t]:w}));try{await M(t,{[a]:w[a]})}catch(u){x(k=>({...k,[t]:s})),i(`保存失败:${u.message}`)}};n.useEffect(()=>{j()},[]);const L=async()=>{if(!l)return;const t=(l.auto_rate_template||"").trim();if(!t){i("默认评价内容不能为空");return}if(t.length>r){i(`默认评价内容不能超过 ${r} 字`);return}_(!0);try{await H({auto_rate_template:t,auto_thanks_template:(l.auto_thanks_template||"").trim(),buyer_interaction_interval:String(S)}),i("买家互动配置已保存")}catch(a){i(`保存失败:${a.message}`)}finally{_(!1)}};if(!l)return e.jsx(D,{label:"正在加载买家互动配置"});const m=t=>f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},g=o.some(t=>m(t.id).auto_rate_enabled),y=o.some(t=>m(t.id).auto_thanks_enabled),N=l.auto_rate_template??"",v=l.auto_thanks_template??"",S=Number(l.buyer_interaction_interval)||7200;return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(R,{title:"买家互动",description:"评价买家、索要小红花与自动收花。涉及平台实际操作,请按账号开启。",icon:C,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:j,disabled:p,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(A,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:b,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(O,{className:"h-4 w-4"}),b?"保存中":"保存设置"]})]})}),e.jsx(z,{type:"warning",message:"评价提交后无法撤销,求花会向买家发送一条消息。建议先用测试订单验证效果。"}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"按账号开启",description:"逐个账号控制。关闭的账号不会自动执行,订单页也不显示入口、后端拒绝请求。",icon:U}),o.length===0?e.jsx("p",{className:"px-4 py-6 text-sm text-gray-500",children:"还没有账号,请先在账号管理里添加。"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 text-left text-xs text-gray-500",children:[e.jsx("th",{className:"px-4 py-2 font-semibold",children:"账号"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"评价买家"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"索要小红花"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"收货致谢"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"自动收下小红花"})]})}),e.jsx("tbody",{children:o.map(t=>{const a=m(t.id);return e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:t.nickname||t.id}),e.jsx("p",{className:"mt-0.5 font-mono text-xs text-gray-400",children:t.id})]}),["auto_rate_enabled","auto_flower_enabled","auto_thanks_enabled","auto_receive_flower_enabled"].map(s=>e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{type:"button",role:"switch","aria-checked":a[s],"aria-label":`${t.nickname||t.id} ${I[s]}`,onClick:()=>void F(t.id,s),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${a[s]?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{cLine truncated
import{r as n,j as e,Q as C,e as T,aT as $,T as P,o as B,n as i,aY as H,bG as M}from"./index-DsODdDMf.js";import{P as D,a as R,N as z,S as d}from"./ui-CQHd7VNo.js";import{S as G}from"./save-1bfmWlQj.js";import{S as O}from"./shield-alert-JYWkaAgT.js";import{F as U}from"./flower-2-Qv1fS9dP.js";import{M as q}from"./message-square-text-SsmtmT8O.js";const r=200,A="宝贝收到了,很满意,感谢老板,欢迎下次再来!",I="亲,感谢支持!有任何问题随时找我~",K={auto_rate_enabled:"评价买家",auto_flower_enabled:"索要小红花",auto_thanks_enabled:"收货致谢",auto_receive_flower_enabled:"自动收下小红花"},Q=[{value:300,label:"5 分钟"},{value:900,label:"15 分钟"},{value:1800,label:"30 分钟"},{value:3600,label:"1 小时"},{value:7200,label:"2 小时(默认)"},{value:21600,label:"6 小时"},{value:86400,label:"24 小时"}],ee=()=>{const[l,c]=n.useState(null),[p,h]=n.useState(!1),[b,_]=n.useState(!1),[o,E]=n.useState([]),[f,x]=n.useState({}),j=()=>{h(!0),Promise.all([$(),P().catch(()=>null),B().catch(()=>[])]).then(([t,a,s])=>{c({...t,auto_rate_template:(t.auto_rate_template??"").trim()||(a==null?void 0:a.auto_rate_template)||A}),E(s),x((a==null?void 0:a.accounts)??{})}).finally(()=>h(!1))},F=async(t,a)=>{const s=f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},w={...s,[a]:!s[a]};x(u=>({...u,[t]:w}));try{await M(t,{[a]:w[a]})}catch(u){x(k=>({...k,[t]:s})),i(`保存失败:${u.message}`)}};n.useEffect(()=>{j()},[]);const L=async()=>{if(!l)return;const t=(l.auto_rate_template||"").trim();if(!t){i("默认评价内容不能为空");return}if(t.length>r){i(`默认评价内容不能超过 ${r} 字`);return}_(!0);try{await H({auto_rate_template:t,auto_thanks_template:(l.auto_thanks_template||"").trim(),buyer_interaction_interval:String(S)}),i("买家互动配置已保存")}catch(a){i(`保存失败:${a.message}`)}finally{_(!1)}};if(!l)return e.jsx(D,{label:"正在加载买家互动配置"});const m=t=>f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},g=o.some(t=>m(t.id).auto_rate_enabled),y=o.some(t=>m(t.id).auto_thanks_enabled),N=l.auto_rate_template??"",v=l.auto_thanks_template??"",S=Number(l.buyer_interaction_interval)||7200;return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(R,{title:"买家互动",description:"评价买家、索要小红花与自动收花。涉及平台实际操作,请按账号开启。",icon:C,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:j,disabled:p,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(T,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:b,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(G,{className:"h-4 w-4"}),b?"保存中":"保存设置"]})]})}),e.jsx(z,{type:"warning",message:"评价提交后无法撤销,求花会向买家发送一条消息。建议先用测试订单验证效果。"}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"按账号开启",description:"逐个账号控制。关闭的账号不会自动执行,订单页也不显示入口、后端拒绝请求。",icon:O}),o.length===0?e.jsx("p",{className:"px-4 py-6 text-sm text-gray-500",children:"还没有账号,请先在账号管理里添加。"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 text-left text-xs text-gray-500",children:[e.jsx("th",{className:"px-4 py-2 font-semibold",children:"账号"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"评价买家"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"索要小红花"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"收货致谢"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"自动收下小红花"})]})}),e.jsx("tbody",{children:o.map(t=>{const a=m(t.id);return e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:t.nickname||t.id}),e.jsx("p",{className:"mt-0.5 font-mono text-xs text-gray-400",children:t.id})]}),["auto_rate_enabled","auto_flower_enabled","auto_thanks_enabled","auto_receive_flower_enabled"].map(s=>e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{type:"button",role:"switch","aria-checked":a[s],"aria-label":`${t.nickname||t.id} ${K[s]}`,onClick:()=>void F(t.id,s),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${a[s]?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{cLine truncated
@@ -1,4 +1,4 @@
import{c as P,r as m,j as e,X as D,a6 as re,n as j,a7 as de,a8 as M,a9 as G,b as z,aa as H,v as Y,ab as ce,ac as oe,ad as me}from"./index-HJMc2HxZ.js";import{a as pe,S as xe,E as B}from"./ui-vFagDj8B.js";import{P as U}from"./plus-CpIZThgs.js";import{S as he}from"./square-pen-D5BwtKk7.js";import{T as ye}from"./trash-2-Du5uC3X5.js";import{P as Z}from"./package-BcCU6KLb.js";import{S as ue}from"./save-qf4Q-Bil.js";import{I as q}from"./image-CqoWw8ci.js";import{P as be}from"./package-check-DzDzt8rk.js";/**
import{c as P,r as m,j as e,X as D,a6 as re,n as j,a7 as de,a8 as M,a9 as G,b as z,aa as H,v as Y,ab as ce,ac as oe,ad as me}from"./index-DsODdDMf.js";import{a as pe,S as xe,E as B}from"./ui-CQHd7VNo.js";import{P as U}from"./plus-fhLljyPf.js";import{S as he}from"./square-pen-DR0-XdRq.js";import{T as ye}from"./trash-2-CvZQL5SJ.js";import{P as Z}from"./package-C5umlMc4.js";import{S as ue}from"./save-1bfmWlQj.js";import{I as q}from"./image-BPsEsLmt.js";import{P as be}from"./package-check-DMYEV4p7.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
var Db=Object.defineProperty;var $b=(e,t,r)=>t in e?Db(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _i=(e,t,r)=>$b(e,typeof t!="symbol"?t+"":t,r);import{c as gu,r as v,a as bu,b as xu,g as Nb,R as Rb,d as Lb,j as I,C as zb,e as Bb,U as Fb,E as Wb,f as Kb,h as Ub,n as Hb,i as Ac}from"./index-HJMc2HxZ.js";import{P as Yb,a as Gb,b as Vb,S as qb,E as Ii}from"./ui-vFagDj8B.js";import{P as Ro}from"./package-BcCU6KLb.js";import{T as Lh}from"./trending-up-jQPihqZY.js";import{A as Xb}from"./activity-DNyIqxl-.js";import{P as Zb}from"./package-check-DzDzt8rk.js";/**
var Db=Object.defineProperty;var $b=(e,t,r)=>t in e?Db(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _i=(e,t,r)=>$b(e,typeof t!="symbol"?t+"":t,r);import{c as gu,r as v,a as bu,b as xu,g as Nb,R as Rb,d as Lb,j as I,C as zb,e as Bb,U as Fb,E as Wb,f as Kb,h as Ub,n as Hb,i as Ac}from"./index-DsODdDMf.js";import{P as Yb,a as Gb,b as Vb,S as qb,E as Ii}from"./ui-CQHd7VNo.js";import{P as Ro}from"./package-C5umlMc4.js";import{T as Lh}from"./trending-up-2bhyfwOI.js";import{A as Xb}from"./activity-C3vSFSwT.js";import{P as Zb}from"./package-check-DMYEV4p7.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1 +1 @@
import{r as o,j as e}from"./index-HJMc2HxZ.js";const r=[{group:"快速开始",items:[{id:"dashboard",label:"系统总览"},{id:"accounts",label:"账号管理"}]},{group:"闲鱼业务",items:[{id:"items",label:"商品与发货"},{id:"resell",label:"一键转卖"},{id:"hotlist",label:"实时热卖榜"},{id:"pricewatch",label:"价格监控"},{id:"orders",label:"订单管理"},{id:"buyer-interaction",label:"买家互动"},{id:"cards",label:"卡密库存"}]},{group:"消息与自动化",items:[{id:"messages",label:"消息中心"},{id:"auto-reply",label:"自动回复"},{id:"ai-reply",label:"AI 回复"},{id:"product-automation",label:"商品自动化"}]},{group:"系统",items:[{id:"notifications",label:"通知与日志"},{id:"settings",label:"系统设置"},{id:"users",label:"用户管理"},{id:"about",label:"关于本系统"}]}],p={dashboard:{title:"系统总览",intro:"登录后的首页,汇总账号、订单、营收和库存数据,一眼判断当前经营状态。",steps:["顶部时间筛选可切换统计周期:今天 / 昨天 / 三天内 / 7天内 / 一个月内 / 自定义。","「有效成交额」与「已到账」两张卡片展示所选周期内的资金数据。","「系统运行中」状态灯表示后端自动回复、定时任务正常运行。","左侧菜单点击任意功能即可切换页面,右上角可切换日间/夜间模式。"],tips:["新部署时没有订单记录,金额显示 ¥0.00 属正常,产生交易后自动累计。"]},accounts:{title:"账号管理",intro:"所有功能的入口:先把闲鱼账号接入系统,其他页面才能选择该账号操作。",steps:["点击「添加账号」,填入账号备注名与 Cookie(从浏览器登录闲鱼后在开发者工具 Network 里复制)。","保存后列表会显示该账号,可点击「检测」验证 Cookie 是否仍然有效。","失效的账号需要重新复制 Cookie 更新;不用的账号可「禁用」而不必删除。","启用状态的账号才会参与自动回复、订单同步、消息聚合等自动化。"],tips:["Cookie 等同账号登录态,请勿泄露;本系统只保存在自己的服务器数据库中。"]},items:{title:"商品与发货",intro:"同步闲鱼在售商品,为每个商品配置自动发货内容(卡密、网盘链接或文字说明)。",steps:["选择账号后点击同步,把该账号在闲鱼的在售商品拉取到列表。","给商品设置发货内容:虚拟商品可填卡密说明或网盘链接,实物商品可填物流备注。","买家付款后系统按这里配置的内容自动回复发货,无需手动复制粘贴。","商品价格、标题变化可通过刷新按钮同步最新状态。"],tips:["发货内容支持多行文本与链接,建议按「商品名称 + 提取码」格式写清楚。"]},resell:{title:"一键转卖",intro:"从收藏或搜索结果里挑商品,改好标题价格直接发布到自己账号,做无货源转卖。",steps:["右上角先选择要发布到的闲鱼账号。","点「我的收藏」→「加载收藏」读取该账号收藏的在售商品;或切到「搜索商品」按关键词找货。","在列表中勾选想转卖的商品,修改标题、价格、描述等发布信息。","点「一键转卖」发布,商品即挂到自己账号名下。"],tips:["发布前核对价格是否留足利润;同名商品重复转卖前先在商品列表确认未上架过。"]},hotlist:{title:"实时热卖榜",intro:"抓取闲鱼实时热卖数据,帮你判断什么好卖、该上什么货。",steps:["选择分类或直接查看综合热卖榜,列表按近期成交热度排序。","点击商品可查看详情与价格区间,作为自己定价的参考。","看中的品可直接跳「一键转卖」上架到自己账号。"],tips:["榜单数据为实时抓取,个别时段可能延迟,可点刷新重新拉取。"]},pricewatch:{title:"价格监控",intro:"设定关键词和目标价,系统定时搜索闲鱼,出现低于目标价的商品立即通知你捡漏。",steps:["点「新建规则」:填写关键词(如想蹲的商品名)、目标价、检测间隔,保存后立即执行一次检测。","检测结果展示匹配商品数、历史最低价与「最近一次」的完整商品信息(超长内容自动换行展示)。","低于目标价时触发通知——前提是已在「通知与日志」页配置好通知渠道并勾选「价格监控」事件(见下方章节)。","点「历史记录」查看每次检测的明细;不需要的规则可停用或删除。"],tips:["通知没发出来时,页面顶部的红色提示会写明去哪配置,按提示到「通知与日志」页补配即可。","关键词越具体匹配越准,避免太宽泛导致噪音过多。"]},orders:{title:"订单管理",intro:"汇总所选账号的闲鱼订单,查看状态、手动补发与核对发货记录。",steps:["选择账号与时间范围筛选订单,列表显示买家、商品、金额与状态。","自动发货成Line truncated
import{r as d,j as e}from"./index-DsODdDMf.js";const r=[{group:"快速开始",items:[{id:"dashboard",label:"系统总览"},{id:"accounts",label:"账号管理"}]},{group:"闲鱼业务",items:[{id:"items",label:"商品与发货"},{id:"resell",label:"一键转卖"},{id:"hotlist",label:"实时热卖榜"},{id:"pricewatch",label:"价格监控"},{id:"orders",label:"订单管理"},{id:"buyer-interaction",label:"买家互动"},{id:"cards",label:"卡密库存"}]},{group:"消息与自动化",items:[{id:"messages",label:"消息中心"},{id:"auto-reply",label:"自动回复"},{id:"ai-reply",label:"AI 回复"},{id:"product-automation",label:"商品自动化"}]},{group:"系统",items:[{id:"notifications",label:"通知与日志"},{id:"settings",label:"系统设置"},{id:"users",label:"用户管理"},{id:"about",label:"关于本系统"}]}],p={dashboard:{title:"系统总览",intro:"登录后的首页,汇总账号、订单、营收和库存数据,一眼判断当前经营状态。",steps:["顶部时间筛选可切换统计周期:今天 / 昨天 / 三天内 / 7天内 / 一个月内 / 自定义。","「有效成交额」与「已到账」两张卡片展示所选周期内的资金数据。","「系统运行中」状态灯表示后端自动回复、定时任务正常运行。","左侧菜单点击任意功能即可切换页面,右上角可切换日间/夜间模式。"],tips:["新部署时没有订单记录,金额显示 ¥0.00 属正常,产生交易后自动累计。"]},accounts:{title:"账号管理",intro:"所有功能的入口:先把闲鱼账号接入系统,其他页面才能选择该账号操作。",steps:["点击「添加账号」,填入账号备注名与 Cookie(从浏览器登录闲鱼后在开发者工具 Network 里复制)。","保存后列表会显示该账号,可点击「检测」验证 Cookie 是否仍然有效。","失效的账号需要重新复制 Cookie 更新;不用的账号可「禁用」而不必删除。","启用状态的账号才会参与自动回复、订单同步、消息聚合等自动化。"],tips:["Cookie 等同账号登录态,请勿泄露;本系统只保存在自己的服务器数据库中。"]},items:{title:"商品与发货",intro:"同步闲鱼在售商品,为每个商品配置自动发货内容(卡密、网盘链接或文字说明)。",steps:["选择账号后点击同步,把该账号在闲鱼的在售商品拉取到列表。","给商品设置发货内容:虚拟商品可填卡密说明或网盘链接,实物商品可填物流备注。","买家付款后系统按这里配置的内容自动回复发货,无需手动复制粘贴。","商品价格、标题变化可通过刷新按钮同步最新状态。"],tips:["发货内容支持多行文本与链接,建议按「商品名称 + 提取码」格式写清楚。"]},resell:{title:"一键转卖",intro:"从收藏或搜索结果里挑商品,改好标题价格直接发布到自己账号,做无货源转卖。",steps:["右上角先选择要发布到的闲鱼账号。","点「我的收藏」→「加载收藏」读取该账号收藏的在售商品;或切到「搜索商品」按关键词找货。","在列表中勾选想转卖的商品,修改标题、价格、描述等发布信息。","点「一键转卖」发布,商品即挂到自己账号名下。"],tips:["发布前核对价格是否留足利润;同名商品重复转卖前先在商品列表确认未上架过。"]},hotlist:{title:"实时热卖榜",intro:"抓取闲鱼实时热卖数据,帮你判断什么好卖、该上什么货。",steps:["选择分类或直接查看综合热卖榜,列表按近期成交热度排序。","点击商品可查看详情与价格区间,作为自己定价的参考。","看中的品可直接跳「一键转卖」上架到自己账号。"],tips:["榜单数据为实时抓取,个别时段可能延迟,可点刷新重新拉取。"]},pricewatch:{title:"价格监控",intro:"设定关键词和目标价,系统定时搜索闲鱼,出现低于目标价的商品立即通知你捡漏。",steps:["点「新建规则」:填写关键词(如想蹲的商品名)、目标价、检测间隔,保存后立即执行一次检测。","检测结果展示匹配商品数、历史最低价与「最近一次」的完整商品信息(超长内容自动换行展示)。","低于目标价时触发通知——前提是已在「通知与日志」页配置好通知渠道并勾选「价格监控」事件(见下方章节)。","点「历史记录」查看每次检测的明细;不需要的规则可停用或删除。"],tips:["通知没发出来时,页面顶部的红色提示会写明去哪配置,按提示到「通知与日志」页补配即可。","关键词越具体匹配越准,避免太宽泛导致噪音过多。"]},orders:{title:"订单管理",intro:"汇总所选账号的闲鱼订单,查看状态、手动补发与核对发货记录。",steps:["选择账号与时间范围筛选订单,列表显示买家、商品、金额与状态。","自动发货成Line truncated
@@ -1 +1 @@
import{r as n,bN as H,bO as O,j as e,bP as S,L as y,e as A,E as B}from"./index-HJMc2HxZ.js";import{P as F,a as U,N as q,b as z,E as V}from"./ui-vFagDj8B.js";import{T as R}from"./trending-up-jQPihqZY.js";import{P as W}from"./package-BcCU6KLb.js";const Y=2500,L=r=>r?r>=1e4?`${(r/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(r):"0",G=r=>{if(!r)return"—";const i=Date.now()-r;if(i<6e4)return"刚刚";if(i<36e5)return`${Math.floor(i/6e4)}分钟前`;if(i<864e5)return`${Math.floor(i/36e5)}小时前`;if(i<7*864e5)return`${Math.floor(i/864e5)}天前`;const o=new Date(r);return`${o.getMonth()+1}月${o.getDate()}日`},J=r=>{if(!r)return"—";const i=new Date(r),o=v=>String(v).padStart(2,"0");return`${i.getFullYear()}-${o(i.getMonth()+1)}-${o(i.getDate())}`},K=({rank:r})=>{const i=r===1?"bg-amber-400 text-white":r===2?"bg-gray-300 text-gray-700":r===3?"bg-orange-300 text-orange-900":"bg-[var(--surface-subtle)] text-[var(--text-soft)]";return e.jsx("span",{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-sm font-bold ${i}`,children:r})},se=()=>{const[r,i]=n.useState(!0),[o,v]=n.useState({}),[$,P]=n.useState([]),[d,M]=n.useState("digital"),[j,f]=n.useState(null),[h,_]=n.useState(0),[u,k]=n.useState(!1),g=n.useRef(null),I=n.useRef(d);I.current=d;const w=n.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=null)},[]),b=n.useCallback(async s=>{try{const a=await H();v(a.boards||{}),P(a.categories||[]),s!=null&&s.silent||i(!1),Object.values(a.boards||{}).some(x=>x.refreshing)?E():w()}catch(a){s!=null&&s.silent||(i(!1),f({type:"error",message:a.message||"榜单加载失败"}))}},[]),E=n.useCallback(()=>{g.current||(g.current=setInterval(()=>{b({silent:!0})},Y))},[b]);n.useEffect(()=>(b(),w),[b,w]),n.useEffect(()=>{if(h<=0)return;const s=setInterval(()=>_(a=>a<=1?0:a-1),1e3);return()=>clearInterval(s)},[h]);const t=o[d];n.useEffect(()=>{const s=o[d];!s||r||s.refreshing||s.items.length>0||s.cooldown_remaining>0||N(d)},[d,r,o]);const N=async s=>{if(!u){k(!0);try{const a=await O(s);a.started?(f({type:"info",message:a.categories&&a.categories.length>1?"已开始刷新全部类目,完成后自动更新。":"已开始抓取,十几秒后榜单自动刷新。"}),E()):a.reason==="cooldown"?f({type:"error",message:a.message||"刷新过于频繁,请稍后再试"}):f({type:"info",message:a.message||"已有刷新任务进行中"})}catch(a){f({type:"error",message:a.message||"刷新触发失败"})}finally{k(!1)}}};n.useEffect(()=>{t&&t.cooldown_remaining>0&&_(t.cooldown_remaining)},[t]);const T=n.useMemo(()=>$.map(s=>{var a;return{id:s.id,label:s.name,count:(a=o[s.id])==null?void 0:a.items.length}}),[$,o]),C=n.useMemo(()=>{if(!t)return[];const s={};return(t.items||[]).forEach(l=>{(l.keywords||[]).forEach(x=>{const p=s[x]||(s[x]={hits:0,want:0});p.hits+=1,p.want+=l.want_count||0})}),(t.keywords&&t.keywords.length?t.keywords:Object.keys(s)).map(l=>{var x,p;return{kw:l,hits:((x=s[l])==null?void 0:x.hits)||0,want:((p=s[l])==null?void 0:p.want)||0}}).sort((l,x)=>x.want-l.want)},[t]),m=!!(t!=null&&t.refreshing),c=t==null?void 0:t.progress,D=t!=null&&t.updated_at?G(t.updated_at*1e3):"尚未生成";return r?e.jsx(F,{label:"正在加载热卖榜"}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(U,{title:"实时热卖榜",description:"按「想要人数」排序的全网热卖商品,数据来自闲鱼实时搜索聚合。",icon:S,badge:e.jsx("span",{className:"rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text-soft)]",children:t?`更新于 ${D}`:"待生成"}),actions:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",className:"ios-btn-secondary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N("all"),disabled:u||m||h>0,children:[u||m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(A,{className:"h-4 w-4"}),"全部刷新"]}),e.jsxs("button",{type:"button",className:"ios-btn-primary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N(d),disabled:u||m||h>0,children:[m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(R,{className:"h-4 w-4"}),h>0?`${h}s 后可刷新`:"刷新本类目"]})]})}),j&&e.jsx(q,{type:j.type==="info"?"success":j.type,message:j.message,onClose:()=>f(null)}),e.jsx("div",{className:"toolbar",children:e.jsx(z,{value:d,onChange:M,items:T,ariaLabel:"热卖榜类目"})}),m&&e.jsx("div",{className:"section-panel",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm text-[var(--text-soft)]",children:[e.jsx(y,{className:"h-4 w-4 animate-spin text-[#ff4400]"}),e.jsxs("span",{children:["正在抓取「",(c==null?void 0:c.keyword)||"…","」",c&&c.total>0?`(${Math.min(c.done+1,c.total)}/${c.total})`:""]}),c&&c.total>0&&e.jsx("span",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-subtle)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[#ff4400] transition-all",style:{width:`${Math.round(c.Line truncated
import{r as n,bP as H,bQ as A,j as e,bR as R,L as y,e as B,E as F}from"./index-DsODdDMf.js";import{P as O,a as U,N as q,b as z,E as Q}from"./ui-CQHd7VNo.js";import{T as S}from"./trending-up-2bhyfwOI.js";import{P as V}from"./package-C5umlMc4.js";const W=2500,L=r=>r?r>=1e4?`${(r/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(r):"0",Y=r=>{if(!r)return"—";const i=Date.now()-r;if(i<6e4)return"刚刚";if(i<36e5)return`${Math.floor(i/6e4)}分钟前`;if(i<864e5)return`${Math.floor(i/36e5)}小时前`;if(i<7*864e5)return`${Math.floor(i/864e5)}天前`;const o=new Date(r);return`${o.getMonth()+1}月${o.getDate()}日`},G=r=>{if(!r)return"—";const i=new Date(r),o=v=>String(v).padStart(2,"0");return`${i.getFullYear()}-${o(i.getMonth()+1)}-${o(i.getDate())}`},J=({rank:r})=>{const i=r===1?"bg-amber-400 text-white":r===2?"bg-gray-300 text-gray-700":r===3?"bg-orange-300 text-orange-900":"bg-[var(--surface-subtle)] text-[var(--text-soft)]";return e.jsx("span",{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-sm font-bold ${i}`,children:r})},se=()=>{const[r,i]=n.useState(!0),[o,v]=n.useState({}),[$,P]=n.useState([]),[d,M]=n.useState("digital"),[j,f]=n.useState(null),[h,_]=n.useState(0),[u,k]=n.useState(!1),g=n.useRef(null),I=n.useRef(d);I.current=d;const w=n.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=null)},[]),b=n.useCallback(async s=>{try{const a=await H();v(a.boards||{}),P(a.categories||[]),s!=null&&s.silent||i(!1),Object.values(a.boards||{}).some(x=>x.refreshing)?E():w()}catch(a){s!=null&&s.silent||(i(!1),f({type:"error",message:a.message||"榜单加载失败"}))}},[]),E=n.useCallback(()=>{g.current||(g.current=setInterval(()=>{b({silent:!0})},W))},[b]);n.useEffect(()=>(b(),w),[b,w]),n.useEffect(()=>{if(h<=0)return;const s=setInterval(()=>_(a=>a<=1?0:a-1),1e3);return()=>clearInterval(s)},[h]);const t=o[d];n.useEffect(()=>{const s=o[d];!s||r||s.refreshing||s.items.length>0||s.cooldown_remaining>0||N(d)},[d,r,o]);const N=async s=>{if(!u){k(!0);try{const a=await A(s);a.started?(f({type:"info",message:a.categories&&a.categories.length>1?"已开始刷新全部类目,完成后自动更新。":"已开始抓取,十几秒后榜单自动刷新。"}),E()):a.reason==="cooldown"?f({type:"error",message:a.message||"刷新过于频繁,请稍后再试"}):f({type:"info",message:a.message||"已有刷新任务进行中"})}catch(a){f({type:"error",message:a.message||"刷新触发失败"})}finally{k(!1)}}};n.useEffect(()=>{t&&t.cooldown_remaining>0&&_(t.cooldown_remaining)},[t]);const T=n.useMemo(()=>$.map(s=>{var a;return{id:s.id,label:s.name,count:(a=o[s.id])==null?void 0:a.items.length}}),[$,o]),C=n.useMemo(()=>{if(!t)return[];const s={};return(t.items||[]).forEach(l=>{(l.keywords||[]).forEach(x=>{const p=s[x]||(s[x]={hits:0,want:0});p.hits+=1,p.want+=l.want_count||0})}),(t.keywords&&t.keywords.length?t.keywords:Object.keys(s)).map(l=>{var x,p;return{kw:l,hits:((x=s[l])==null?void 0:x.hits)||0,want:((p=s[l])==null?void 0:p.want)||0}}).sort((l,x)=>x.want-l.want)},[t]),m=!!(t!=null&&t.refreshing),c=t==null?void 0:t.progress,D=t!=null&&t.updated_at?Y(t.updated_at*1e3):"尚未生成";return r?e.jsx(O,{label:"正在加载热卖榜"}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(U,{title:"实时热卖榜",description:"按「想要人数」排序的全网热卖商品,数据来自闲鱼实时搜索聚合。",icon:R,badge:e.jsx("span",{className:"rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text-soft)]",children:t?`更新于 ${D}`:"待生成"}),actions:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",className:"ios-btn-secondary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N("all"),disabled:u||m||h>0,children:[u||m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(B,{className:"h-4 w-4"}),"全部刷新"]}),e.jsxs("button",{type:"button",className:"ios-btn-primary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N(d),disabled:u||m||h>0,children:[m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(S,{className:"h-4 w-4"}),h>0?`${h}s 后可刷新`:"刷新本类目"]})]})}),j&&e.jsx(q,{type:j.type==="info"?"success":j.type,message:j.message,onClose:()=>f(null)}),e.jsx("div",{className:"toolbar",children:e.jsx(z,{value:d,onChange:M,items:T,ariaLabel:"热卖榜类目"})}),m&&e.jsx("div",{className:"section-panel",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm text-[var(--text-soft)]",children:[e.jsx(y,{className:"h-4 w-4 animate-spin text-[#ff4400]"}),e.jsxs("span",{children:["正在抓取「",(c==null?void 0:c.keyword)||"…","」",c&&c.total>0?`(${Math.min(c.done+1,c.total)}/${c.total})`:""]}),c&&c.total>0&&e.jsx("span",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-subtle)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[#ff4400] transition-all",style:{width:`${Math.round(c.Line truncated
-16
View File
@@ -1,16 +0,0 @@
import{c as _e,r,ae as fs,af as Ee,n as w,j as e,e as ve,X as ee,L as V,ag as js,ah as Ns,ai as _s,v as xe,aj as vs,ak as Be,b as re,al as fe,am as je,an as ws,ao as ks,ap as Qe,aq as Re,o as Te,h as ye,a8 as Le,ar as ze,as as be,w as Ss,at as Cs,au as Ue,av as Ke,aw as Is,ax as $s,ay as Ms,az as Ds}from"./index-HJMc2HxZ.js";import{E as se,S as Ne,P as qe,a as Fs,b as Ps,N as Es}from"./ui-vFagDj8B.js";import{S as de}from"./shield-alert-fp78nSHa.js";import{S as ce}from"./save-qf4Q-Bil.js";import{T as me}from"./trash-2-Du5uC3X5.js";import{P as oe}from"./plus-CpIZThgs.js";import{P as Bs}from"./power-off-C7ZUVUtb.js";import{a as Rs,P as Ts}from"./power-CG9iERWF.js";import{P as We}from"./package-check-DzDzt8rk.js";import{S as Oe}from"./sparkles-Da7ZNkrd.js";import{S as Ls}from"./settings-2-CNr5zc9p.js";import{S as zs}from"./square-pen-D5BwtKk7.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Us=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Ks=_e("list-checks",Us);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qs=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],Ve=_e("scan-line",qs);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Os=[["path",{d:"M2 21a8 8 0 0 1 11.873-7",key:"74fkxq"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m17 17 5 5",key:"p7ous7"}],["path",{d:"m22 17-5 5",key:"gqnmv0"}]],He=_e("user-round-x",Os),Vs=({accounts:o=[],items:u=[],selectedAccount:x="",onSelectedAccountChange:N})=>{const[k,S]=r.useState([]),[B,y]=r.useState([]),[C,$]=r.useState(!1),[M,F]=r.useState(""),[g,m]=r.useState({scope:"account",buyer_id:"",buyer_nick:"",item_id:"",reason:""}),h=r.useMemo(()=>u.filter(t=>t.cookie_id===x),[u,x]);r.useEffect(()=>{x&&D()},[x]);const D=async()=>{if(x){$(!0);try{const[t,a]=await Promise.all([fs(x),Ee(x)]);S(t),y(a)}catch(t){w(`加载发货保护配置失败:${t.message}`)}finally{$(!1)}}},_=(t,a)=>{S(c=>c.map(f=>f.rule_code===t?{...f,...a,only_card_after_close:a.auto_close_order===!1?!1:a.only_card_after_close??f.only_card_after_close}:f))},L=async t=>{F(t.rule_code);try{const a=await js(x,t.rule_code,{enabled:t.enabled,priority:t.priority,block_reason:t.block_reason,auto_close_order:t.auto_close_order,only_card_after_close:t.only_card_after_close,excluded_item_ids:t.excluded_item_ids,config:t.config});_(t.rule_code,a),w(`“${t.rule_name}”已保存`)}catch(a){w(`保存失败:${a.message}`)}finally{F("")}},H=async()=>{if(!g.buyer_id.trim()){w("请输入买家 ID");return}if(g.scope==="item"&&!g.item_id){w("请选择黑名单生效的商品");return}try{await Ns({account_id:g.scope==="global"?void 0:x,buyer_id:g.buyer_id.trim(),buyer_nick:g.buyer_nick.trim(),item_id:g.scope==="item"?g.item_id:void 0,reason:g.reason.trim(),is_enabled:!0}),m({scope:g.scope,buyer_id:"",buyer_nick:"",item_id:"",reason:""}),y(await Ee(x))}catch(t){w(`添加失败:${t.message}`)}},z=async t=>{try{const a=await _s(t.id,{is_enabled:!t.is_enabled});y(c=>c.map(f=>f.id===t.id?a:f))}catch(a){w(`更新失败:${a.message}`)}},X=async t=>{if(await xe(`确认移除买家 ${t.buyer_nick||t.buyer_id}?`))try{await vs(t.id),y(a=>a.filter(c=>c.id!==t.id))}catch(a){w(`删除失败:${a.message}`)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"toolbar",children:[e.jsxs("div",{className:"toolbar__group w-full sm:w-auto",children:[e.jsx("label",{htmlFor:"protection-account",className:"text-xs font-bold text-gray-600",children:"应用账号"}),e.jsxs("select",{id:"protection-account",value:x,onChange:t=>N==null?void 0:N(t.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm sm:min-w-72",children:[e.jsx("option",{value:"",children:"请选择账号"}),o.map(t=>e.jsx("option",{value:t.id,children:t.nickname||t.remark||t.id},t.id))]})]}),e.jsxs("button",{type:"button",onClick:()=>void D(),disabled:!x||C,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[e.jsx(ve,{className:`h-4 w-4 ${C?"animate-spin":""}`}),"刷新"]})]}),x?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(Ne,{title:"发货拦截规则",description:"规则按优先级判定,可对指定商品设置排除项。",icon:de}),e.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[k.map(t=>e.jsxs("div",{className:"grid gap-4 py-5 xl:grid-cols-[minmax(230px,1fr)_minmax(360px,1.5fr)_44px] xl:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":t.enabled,onClick:()=>_(t.rule_code,{enabled:!t.enabled}),className:`relative h-6 w-11 rounded-full transition-colors ${t.enabled?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${t.enabled?"translate-x-5":"translate-x-0"}`})}),e.jsx("span",{className:"font-bold text-gray-900",children:t.rule_name})]}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:t.rule_description})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-[100px_1fr]",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["优先级",e.jsx("input",{type:"number",min:0,max:999,value:t.priority,onChange:a=>_(t.rule_code,{priority:Number(a.target.value)}),className:"mt-1 w-full rounded-md border border-gray-200 px-2 py-2 text-sm"})]}),e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后发送给买家的提示",e.jsx("input",{value:t.block_reason,onChange:a=>_(t.rule_code,{block_reason:a.target.value}),placeholder:"留空则只停止发货",className:"mt-1 w-full rounded-md border border-gray-200 px-3 py-2 text-sm font-normal"})]}),e.jsxs("div",{className:"rounded-md border border-gray-200 bg-gray-50 p-3 sm:col-span-2",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后处理",e.jsxs("span",{className:"mt-2 flex items-center gap-2 font-medium text-gray-700",children:[e.jsx("input",{type:"checkbox",checked:t.autoLine truncated
+16
View File
@@ -0,0 +1,16 @@
import{c as Me,r,ae as Ms,af as Xe,n as k,j as e,e as De,X as ne,L as O,ag as Ds,ah as Fs,ai as Ps,v as be,aj as Es,ak as Ge,b as pe,al as Ce,am as Ie,an as Bs,ao as Rs,ap as Ls,aq as ns,ar as Qe,o as We,h as ke,a8 as Je,as as Ye,at as Se,w as Ts,au as zs,av as Ze,aw as Ae,ax as Us,ay as Ks,az as qs,aA as Os}from"./index-DsODdDMf.js";import{E as re,S as $e,P as es,a as Vs,b as Hs,N as Xs}from"./ui-CQHd7VNo.js";import{S as ue}from"./shield-alert-JYWkaAgT.js";import{S as ge}from"./save-1bfmWlQj.js";import{T as ye}from"./trash-2-CvZQL5SJ.js";import{P as he}from"./plus-fhLljyPf.js";import{P as Gs}from"./power-off-DcIidedg.js";import{a as Qs,P as Ws}from"./power-BffuaJ6g.js";import{P as rs}from"./package-check-DMYEV4p7.js";import{S as ss}from"./sparkles-CRcwNwKo.js";import{S as Js}from"./settings-2-C_s9tppi.js";import{S as Ys}from"./square-pen-DR0-XdRq.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zs=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],As=Me("list-checks",Zs);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const et=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],ts=Me("scan-line",et);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const st=[["path",{d:"M2 21a8 8 0 0 1 11.873-7",key:"74fkxq"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m17 17 5 5",key:"p7ous7"}],["path",{d:"m22 17-5 5",key:"gqnmv0"}]],as=Me("user-round-x",st),tt=({accounts:c=[],items:u=[],selectedAccount:x="",onSelectedAccountChange:_})=>{const[C,I]=r.useState([]),[U,y]=r.useState([]),[$,F]=r.useState(!1),[P,R]=r.useState(""),[g,m]=r.useState({scope:"account",buyer_id:"",buyer_nick:"",item_id:"",reason:""}),h=r.useMemo(()=>u.filter(t=>t.cookie_id===x),[u,x]);r.useEffect(()=>{x&&E()},[x]);const E=async()=>{if(x){F(!0);try{const[t,a]=await Promise.all([Ms(x),Xe(x)]);I(t),y(a)}catch(t){k(`加载发货保护配置失败:${t.message}`)}finally{F(!1)}}},N=(t,a)=>{I(o=>o.map(f=>f.rule_code===t?{...f,...a,only_card_after_close:a.auto_close_order===!1?!1:a.only_card_after_close??f.only_card_after_close}:f))},V=async t=>{R(t.rule_code);try{const a=await Ds(x,t.rule_code,{enabled:t.enabled,priority:t.priority,block_reason:t.block_reason,auto_close_order:t.auto_close_order,only_card_after_close:t.only_card_after_close,excluded_item_ids:t.excluded_item_ids,config:t.config});N(t.rule_code,a),k(`“${t.rule_name}”已保存`)}catch(a){k(`保存失败:${a.message}`)}finally{R("")}},J=async()=>{if(!g.buyer_id.trim()){k("请输入买家 ID");return}if(g.scope==="item"&&!g.item_id){k("请选择黑名单生效的商品");return}try{await Fs({account_id:g.scope==="global"?void 0:x,buyer_id:g.buyer_id.trim(),buyer_nick:g.buyer_nick.trim(),item_id:g.scope==="item"?g.item_id:void 0,reason:g.reason.trim(),is_enabled:!0}),m({scope:g.scope,buyer_id:"",buyer_nick:"",item_id:"",reason:""}),y(await Xe(x))}catch(t){k(`添加失败:${t.message}`)}},H=async t=>{try{const a=await Ps(t.id,{is_enabled:!t.is_enabled});y(o=>o.map(f=>f.id===t.id?a:f))}catch(a){k(`更新失败:${a.message}`)}},Y=async t=>{if(await be(`确认移除买家 ${t.buyer_nick||t.buyer_id}?`))try{await Es(t.id),y(a=>a.filter(o=>o.id!==t.id))}catch(a){k(`删除失败:${a.message}`)}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"toolbar",children:[e.jsxs("div",{className:"toolbar__group w-full sm:w-auto",children:[e.jsx("label",{htmlFor:"protection-account",className:"text-xs font-bold text-gray-600",children:"应用账号"}),e.jsxs("select",{id:"protection-account",value:x,onChange:t=>_==null?void 0:_(t.target.value),className:"ios-input w-full rounded-md px-3 py-2.5 text-sm sm:min-w-72",children:[e.jsx("option",{value:"",children:"请选择账号"}),c.map(t=>e.jsx("option",{value:t.id,children:t.nickname||t.remark||t.id},t.id))]})]}),e.jsxs("button",{type:"button",onClick:()=>void E(),disabled:!x||$,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[e.jsx(De,{className:`h-4 w-4 ${$?"animate-spin":""}`}),"刷新"]})]}),x?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel",children:[e.jsx($e,{title:"发货拦截规则",description:"规则按优先级判定,可对指定商品设置排除项。",icon:ue}),e.jsxs("div",{className:"divide-y divide-gray-100 px-4",children:[C.map(t=>e.jsxs("div",{className:"grid gap-4 py-5 xl:grid-cols-[minmax(230px,1fr)_minmax(360px,1.5fr)_44px] xl:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":t.enabled,onClick:()=>N(t.rule_code,{enabled:!t.enabled}),className:`relative h-6 w-11 rounded-full transition-colors ${t.enabled?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${t.enabled?"translate-x-5":"translate-x-0"}`})}),e.jsx("span",{className:"font-bold text-gray-900",children:t.rule_name})]}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:t.rule_description})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-[100px_1fr]",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["优先级",e.jsx("input",{type:"number",min:0,max:999,value:t.priority,onChange:a=>N(t.rule_code,{priority:Number(a.target.value)}),className:"mt-1 w-full rounded-md border border-gray-200 px-2 py-2 text-sm"})]}),e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后发送给买家的提示",e.jsx("input",{value:t.block_reason,onChange:a=>N(t.rule_code,{block_reason:a.target.value}),placeholder:"留空则只停止发货",className:"mt-1 w-full rounded-md border border-gray-200 px-3 py-2 text-sm font-normal"})]}),e.jsxs("div",{className:"rounded-md border border-gray-200 bg-gray-50 p-3 sm:col-span-2",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600",children:["命中后处理",e.jsxs("span",{className:"mt-2 flex items-center gap-2 font-medium text-gray-700",children:[e.jsx("input",{type:"checkbox",checked:t.autoLine truncated
@@ -1 +1 @@
import{r as i,o as J,b2 as fe,ar as Ne,a8 as ve,b3 as we,j as e,M as R,B as P,e as Q,b as E,X as F,v as k,b4 as _e,n as t,al as V,am as ke,b5 as Se,b6 as Ce,b7 as De,b8 as Re,b9 as Pe}from"./index-HJMc2HxZ.js";import{a as Ee,b as Fe,E as S,P as Me,S as M}from"./ui-vFagDj8B.js";import{T}from"./truck-A9ZYOrzg.js";import{K as W}from"./key-Y7KCy9_1.js";import{P as Te}from"./plus-CpIZThgs.js";import{P as $,a as $e}from"./power-CG9iERWF.js";import{T as A}from"./trash-2-Du5uC3X5.js";import{P as Ae}from"./power-off-C7ZUVUtb.js";import{S as K}from"./save-qf4Q-Bil.js";import{S as Ke}from"./sparkles-Da7ZNkrd.js";const Ve=({mode:l})=>{const[x,L]=i.useState([]),[d,B]=i.useState(""),[y,Y]=i.useState("reply"),[j,Z]=i.useState([]),[I,h]=i.useState(!1),[f,z]=i.useState(null),[c,N]=i.useState({keyword:"",reply_content:""}),[C,ee]=i.useState([]),[se,ae]=i.useState([]),[te,u]=i.useState(!1),[v,H]=i.useState(null),[r,o]=i.useState({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),[O,le]=i.useState({}),[ie,g]=i.useState(!1),[Le,q]=i.useState(null),[n,m]=i.useState({cookie_id:"",enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),[re,U]=i.useState(!1);i.useEffect(()=>{if(l==="delivery"){b(),X(),J().then(L);return}J().then(s=>{L(s),s&&s.length>0&&B(a=>a||s[0].id)})},[l]),i.useEffect(()=>{l==="reply"&&d&&(_(),w())},[l,d]);const w=async()=>{try{const s=await fe();le(s)}catch(s){console.error("加载默认回复失败",s)}},b=async()=>{try{const s=await Ne();ee(s.filter(a=>!a.item_id))}catch(s){console.error("加载发货规则失败",s)}},X=async()=>{try{const s=await ve();ae(s)}catch(s){console.error("加载卡券失败",s)}},_=async()=>{if(d){U(!0);try{const s=await we(d);Z(s)}catch(s){console.error("加载关键词失败",s)}finally{U(!1)}}},ne=()=>{if(l==="delivery")H(null),o({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),u(!0);else if(y==="reply")z(null),N({keyword:"",reply_content:""}),h(!0);else{if(!d)return;G(d)}},G=async s=>{try{const a=await Se(s);q(a),m({cookie_id:s,enabled:a.enabled,reply_content:a.reply_content,reply_once:a.reply_once,reply_image_url:a.reply_image_url||""}),g(!0)}catch(a){console.error("加载默认回复失败",a),q(null),m({cookie_id:s,enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),g(!0)}},de=s=>{y==="reply"&&(z(s),N({keyword:s.keyword,reply_content:s.reply_content}),h(!0))},ce=s=>{H(s),o({keyword:s.item_keyword,cookie_id:s.cookie_id||"",card_id:String(s.card_group_id),description:s.name,enabled:s.enabled}),u(!0)},oe=async()=>{if(!d){t("请先选择账号");return}if(!c.keyword.trim()||!c.reply_content.trim()){t("请填写关键词和回复内容");return}try{await Re({id:f==null?void 0:f.id,keyword:c.keyword,reply_content:c.reply_content,match_type:"exact",enabled:!0},d),h(!1),_(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},me=async()=>{if(!r.keyword.trim()){t("请填写触发关键词");return}if(!r.card_id){t("请选择卡券");return}try{await V({id:v==null?void 0:v.id,item_keyword:r.keyword,cookie_id:r.cookie_id||void 0,item_id:void 0,card_group_id:parseInt(r.card_id),name:r.description,priority:1,enabled:r.enabled}),u(!1),b(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},pe=async s=>{if(!(!d||!await k("确认删除该关键词吗?")))try{await _e(s,d),_(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},xe=async s=>{if(await k("确认删除该发货规则吗?"))try{await ke(s),b(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ye=async s=>{try{await V({id:s.id,item_keyword:s.item_keyword,cookie_id:s.cookie_id,item_id:s.item_id,card_group_id:s.card_group_id,name:s.name,priority:s.priority,enabled:!s.enabled}),b()}catch(a){t("操作失败:"+a.message)}},he=async()=>{if(!n.cookie_id){t("请先选择账号");return}try{await Pe(n.cookie_id,{enabled:n.enabled,reply_content:n.reply_content,reply_once:n.reply_once,reply_image_url:n.reply_image_url}),g(!1),w(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},ue=async s=>{if(await k("确认删除该默认回复吗?"))try{await De(s),w(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ge=async s=>{if(await k("确认清空该账号的回复记录吗?清空后可以重新对所有对话使用默认回复。"))try{await Ce(s),t("清空成功!")}catch(a){t("清空失败:"+a.message)}},be=Object.values(O).filter(s=>s.enabled).length,je=()=>{l==="delivery"?Promise.all([b(),X()]):y==="reply"?_():w()},D=(s,a,p)=>e.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":p,onClick:a,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${s?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${s?"translate-x-5":""}`})});return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(Ee,{title:l==="reply"?"自动回复":"通用自动发货",description:l==="reply"?"管理账Line truncated
import{r as i,o as J,b3 as fe,as as Ne,a8 as ve,b4 as we,j as e,M as R,B as P,e as Q,b as E,X as F,v as k,b5 as _e,n as t,al as V,am as ke,b6 as Se,b7 as Ce,b8 as De,b9 as Re,ba as Pe}from"./index-DsODdDMf.js";import{a as Ee,b as Fe,E as S,P as Me,S as M}from"./ui-CQHd7VNo.js";import{T}from"./truck-BWE0A9OO.js";import{K as W}from"./key-B7TfiDhV.js";import{P as Te}from"./plus-fhLljyPf.js";import{P as $,a as $e}from"./power-BffuaJ6g.js";import{T as A}from"./trash-2-CvZQL5SJ.js";import{P as Ae}from"./power-off-DcIidedg.js";import{S as K}from"./save-1bfmWlQj.js";import{S as Ke}from"./sparkles-CRcwNwKo.js";const Ve=({mode:l})=>{const[x,L]=i.useState([]),[d,B]=i.useState(""),[y,Y]=i.useState("reply"),[j,Z]=i.useState([]),[I,h]=i.useState(!1),[f,z]=i.useState(null),[c,N]=i.useState({keyword:"",reply_content:""}),[C,ee]=i.useState([]),[se,ae]=i.useState([]),[te,u]=i.useState(!1),[v,H]=i.useState(null),[r,o]=i.useState({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),[O,le]=i.useState({}),[ie,g]=i.useState(!1),[Le,q]=i.useState(null),[n,m]=i.useState({cookie_id:"",enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),[re,U]=i.useState(!1);i.useEffect(()=>{if(l==="delivery"){b(),X(),J().then(L);return}J().then(s=>{L(s),s&&s.length>0&&B(a=>a||s[0].id)})},[l]),i.useEffect(()=>{l==="reply"&&d&&(_(),w())},[l,d]);const w=async()=>{try{const s=await fe();le(s)}catch(s){console.error("加载默认回复失败",s)}},b=async()=>{try{const s=await Ne();ee(s.filter(a=>!a.item_id))}catch(s){console.error("加载发货规则失败",s)}},X=async()=>{try{const s=await ve();ae(s)}catch(s){console.error("加载卡券失败",s)}},_=async()=>{if(d){U(!0);try{const s=await we(d);Z(s)}catch(s){console.error("加载关键词失败",s)}finally{U(!1)}}},ne=()=>{if(l==="delivery")H(null),o({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),u(!0);else if(y==="reply")z(null),N({keyword:"",reply_content:""}),h(!0);else{if(!d)return;G(d)}},G=async s=>{try{const a=await Se(s);q(a),m({cookie_id:s,enabled:a.enabled,reply_content:a.reply_content,reply_once:a.reply_once,reply_image_url:a.reply_image_url||""}),g(!0)}catch(a){console.error("加载默认回复失败",a),q(null),m({cookie_id:s,enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),g(!0)}},de=s=>{y==="reply"&&(z(s),N({keyword:s.keyword,reply_content:s.reply_content}),h(!0))},ce=s=>{H(s),o({keyword:s.item_keyword,cookie_id:s.cookie_id||"",card_id:String(s.card_group_id),description:s.name,enabled:s.enabled}),u(!0)},oe=async()=>{if(!d){t("请先选择账号");return}if(!c.keyword.trim()||!c.reply_content.trim()){t("请填写关键词和回复内容");return}try{await Re({id:f==null?void 0:f.id,keyword:c.keyword,reply_content:c.reply_content,match_type:"exact",enabled:!0},d),h(!1),_(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},me=async()=>{if(!r.keyword.trim()){t("请填写触发关键词");return}if(!r.card_id){t("请选择卡券");return}try{await V({id:v==null?void 0:v.id,item_keyword:r.keyword,cookie_id:r.cookie_id||void 0,item_id:void 0,card_group_id:parseInt(r.card_id),name:r.description,priority:1,enabled:r.enabled}),u(!1),b(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},pe=async s=>{if(!(!d||!await k("确认删除该关键词吗?")))try{await _e(s,d),_(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},xe=async s=>{if(await k("确认删除该发货规则吗?"))try{await ke(s),b(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ye=async s=>{try{await V({id:s.id,item_keyword:s.item_keyword,cookie_id:s.cookie_id,item_id:s.item_id,card_group_id:s.card_group_id,name:s.name,priority:s.priority,enabled:!s.enabled}),b()}catch(a){t("操作失败:"+a.message)}},he=async()=>{if(!n.cookie_id){t("请先选择账号");return}try{await Pe(n.cookie_id,{enabled:n.enabled,reply_content:n.reply_content,reply_once:n.reply_once,reply_image_url:n.reply_image_url}),g(!1),w(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},ue=async s=>{if(await k("确认删除该默认回复吗?"))try{await De(s),w(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ge=async s=>{if(await k("确认清空该账号的回复记录吗?清空后可以重新对所有对话使用默认回复。"))try{await Ce(s),t("清空成功!")}catch(a){t("清空失败:"+a.message)}},be=Object.values(O).filter(s=>s.enabled).length,je=()=>{l==="delivery"?Promise.all([b(),X()]):y==="reply"?_():w()},D=(s,a,p)=>e.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":p,onClick:a,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${s?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${s?"translate-x-5":""}`})});return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(Ee,{title:l==="reply"?"自动回复":"通用自动发货",description:l==="reply"?"管理账Line truncated
@@ -1,4 +1,4 @@
import{c as We,r as n,aW as mt,o as xt,n as u,h as ut,ba as ht,bb as ft,j as t,e as $e,L as U,bc as pt,X as gt,bd as bt,be as jt,bf as yt,aT as vt,bg as wt,bh as Nt,bi as kt,bj as St,v as Te,bk as Ct,bl as Mt}from"./index-HJMc2HxZ.js";import{I as Re,c as _t,S as Ee,E as It}from"./ui-vFagDj8B.js";import{S as Z}from"./settings-2-CNr5zc9p.js";import{S as $t}from"./search-DGiuF6uC.js";import{P as Tt}from"./package-BcCU6KLb.js";import{I as Rt}from"./image-CqoWw8ci.js";import{Z as Et}from"./zap-BhFCoS6N.js";import{S as Lt}from"./send-D67RiJNt.js";import{P as Le}from"./plus-CpIZThgs.js";import{T as Ue}from"./trash-2-Du5uC3X5.js";/**
import{c as We,r as n,aX as mt,o as xt,n as u,h as ut,bb as ht,bc as ft,j as t,e as $e,L as U,bd as pt,X as gt,be as bt,bf as jt,bg as yt,aU as vt,bh as wt,bi as Nt,bj as kt,bk as St,v as Te,bl as Ct,bm as Mt}from"./index-DsODdDMf.js";import{I as Re,c as _t,S as Ee,E as It}from"./ui-CQHd7VNo.js";import{S as Z}from"./settings-2-C_s9tppi.js";import{S as $t}from"./search-sxbkAeV0.js";import{P as Tt}from"./package-C5umlMc4.js";import{I as Rt}from"./image-BPsEsLmt.js";import{Z as Et}from"./zap-T1zC1hkQ.js";import{S as Lt}from"./send-KQw7ZSlT.js";import{P as Le}from"./plus-fhLljyPf.js";import{T as Ue}from"./trash-2-CvZQL5SJ.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -8,5 +8,5 @@ import{c as We,r as n,aW as mt,o as xt,n as u,h as ut,ba as ht,bb as ft,j as t,e
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ft=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],Pt=We("smile",Ft),At={微笑:"🙂",呲牙:"😁",咧嘴:"😁",大笑:"😄",笑哭:"😂",憨笑:"😊",微尬:"😅",尴尬:"😅",流汗:"😓",冷汗:"😰",流泪:"😭",大哭:"😭",快哭了:"😭",委屈:"🥺",可怜:"🥺",难过:"😢",失落:"😞",衰:"😞",捂脸:"🤦",掩面:"🤦",偷笑:"🤭",坏笑:"😏",阴险:"😈",淘气:"😜",调皮:"😜",吐舌:"😜",色色:"😍",色:"😍",爱慕:"😍",发呆:"😳",害羞:"😊",脸红:"😊",闭嘴:"🤐",睡觉:"😴",睡:"😴",困:"😪",打哈欠:"🥱",哈欠:"🥱",惊讶:"😲",吃惊:"😲",惊恐:"😱",吓:"😱",发怒:"😡",生气:"😡",怒:"😡",抓狂:"😫",疯狂:"😫",疑问:"❓",疑惑:"🤔",想想:"🤔",晕:"😵",晕倒:"😵",骷髅:"💀",敲打:"🔨",再见:"👋",拜拜:"👋",擦汗:"😅",抠鼻:"👃",鄙视:"🙄",白眼:"🙄",傲慢:"😏",得意:"😎",酷:"😎",饥饿:"🤤",馋嘴:"🤤",吐:"🤮",呕吐:"🤮",奋斗:"💪",加油:"💪",鼓掌:"👏",喝彩:"👏",调停:"🙏",抱拳:"🙏",作揖:"🙏",祈祷:"🙏",感谢:"🙏",亲亲:"😘",亲吻:"😘",飞吻:"😘",拥抱:"🤗",抱抱:"🤗",强:"👍",赞:"👍",点赞:"👍",弱:"👎",差评:"👎",握手:"🤝",胜利:"✌️",OK:"👌",剪刀:"✌️",手枪:"🔫",计算:"🧮",卡住:"😵",爱心:"❤️",红心:"❤️",心碎:"💔",玫瑰:"🌹",花朵:"🌸",凋谢:"🥀",樱花:"🌸",太阳:"☀️",月亮:"🌙",星星:"⭐",闪电:"⚡",彩虹:"🌈",咖啡:"☕",蛋糕:"🎂",生日快乐:"🎂",啤酒:"🍺",干杯:"🍻",西瓜:"🍉",苹果:"🍎",礼物:"🎁",红包:"🧧",恭喜发财:"🧧",灯笼:"🏮",爆竹:"🧨",庆祝:"🎉",撒花:"🎉",烟花:"🎆",足球:"⚽",篮球:"🏀",排球:"🏐",乒乓:"🏓",网球:"🎾",炸弹:"💣",刀:"🔪",猪头:"🐷",狗:"🐶",猫:"🐱",熊:"🐻",兔:"🐰",鸡:"🐔",公鸡:"🐔",蚂蚁:"🐜",蜗牛:"🐌",瓢虫:"🐞",蝴蝶:"🦋",蛇:"🐍",恐龙:"🦖",鲨鱼:"🦈"};function Pe(r){return r.replace(/\[([^\[\]]{1,8})\]/g,(o,d)=>At[d]??o)}const Dt=1e4,Ot=1e4,Ke="xianyu-message-read-watermarks-v2",zt=500,Ae=9,Wt=10*1024*1024,De=(r,o)=>`${r}\0${o}`,Kt=()=>{if(typeof window>"u")return{};try{const r=JSON.parse(window.localStorage.getItem(Ke)||"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(([,o])=>{if(!o||typeof o!="object"||Array.isArray(o))return!1;const d=o;return Number.isFinite(d.lastMessageTime)&&typeof d.lastMessageSummary=="string"&&Number.isFinite(d.unreadCount)}))}catch{return{}}},Bt=r=>{if(!(typeof window>"u"))try{const o=Object.entries(r).sort(([,d],[,g])=>g.lastMessageTime-d.lastMessageTime).slice(0,zt);window.localStorage.setItem(Ke,JSON.stringify(Object.fromEntries(o)))}catch{}},qt=(r,o)=>{if(!r)return!1;const d=Number(o.lastMessageTime)||0,g=String(o.lastMessageSummary||""),k=Number(o.unreadCount)||0;return d<r.lastMessageTime||d===r.lastMessageTime&&g===r.lastMessageSummary&&k<=r.unreadCount},F=r=>r?r.startsWith("//")?`https:${r}`:r:"",Oe=r=>{if(!r)return"";const o=r<1e12?r*1e3:r,d=new Date(o);if(Number.isNaN(d.getTime()))return"";const g=new Date;return d.toDateString()===g.toDateString()?d.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):d.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit"})},Gt=r=>{if(!r)return"-";const o=new Date(r.includes("T")?r:`${r.replace(" ","T")}Z`);return Number.isNaN(o.getTime())?r:o.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Y=r=>(r==null?void 0:r.displayName)||(r==null?void 0:r.accountId)||"未选择账号",ze=["#8c7900","#0f704b","#2a5f92","#945800","#6b5a8a","#b45309","#3f7a5c","#7c4d5e"],Ht=r=>{let o=0;for(let d=0;d<r.length;d+=1)o=o*31+r.charCodeAt(d)|0;return ze[Math.abs(o)%ze.length]},Qt={skip_reply:"跳过自动回复",skip_notify:"跳过外部通知"},ls=({isActive:r=!0})=>{const[o,d]=n.useState("messages"),[g,k]=n.useState("list"),[P,Be]=n.useState([]),[ee,qe]=n.useState([]),[te,Ge]=n.useState([]),[x,se]=n.useState(""),[S,A]=n.useState([]),[He,Qe]=n.useState(new Set),[j,D]=n.useState(""),[C,O]=n.useState([]),[z,W]=n.useState(""),[Ve,ae]=n.useState(!1),[Xe]=n.useState(()=>`conversation-filter-${Date.now()}-${Math.random().toString(36).slice(2)}`),[Je,re]=n.useState(!0),[K,ne]=n.useState(!1),[ie,le]=n.useState(!1),[B,q]=n.useState(""),[oe,ce]=n.useState([]),[de,G]=n.useState(!1),[H,me]=n.useState(!1),[b,Q]=n.useState([]),xe=n.useRef(null),V=n.useRef(null),ue=n.useRef(null),I=n.useRef(!1),$=n.useRef(""),T=n.useRef(Kt()),he=n.useRef(b);he.current=b,n.useEffect(()=>()=>{he.current.forEach(e=>URL.revokeObjectURL(e.url))},[]);const[y,Ze]=n.useState([]),[fe,pe]=n.useState(!0),[ge,Ye]=n.useState(""),[be,et]=n.useState(""),[X,je]=n.useState(""),[ye,tt]=n.useState("skipLine truncated
系统通知`,className:"ios-input min-h-20 resize-y rounded-md px-3 py-2.5 text-sm"}),t.jsxs("button",{type:"button",onClick:()=>void lt(),disabled:Ne,className:"ios-btn-primary flex min-h-11 items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[Ne?t.jsx(U,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"批量添加"]})]})]}),t.jsxs("section",{className:"section-panel",children:[t.jsx(Ee,{title:"现有规则",description:`当前筛选共 ${y.length} 条`,icon:Z}),t.jsxs("div",{className:"toolbar rounded-none border-x-0 border-t-0 shadow-none",children:[t.jsxs("div",{className:"toolbar__group",children:[t.jsxs("select",{value:ge,onChange:e=>Ye(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-52",children:[t.jsx("option",{value:"",children:"全部账号"}),ee.map(e=>t.jsx("option",{value:e.id,children:e.nickname||e.remark||e.id},e.id))]}),t.jsxs("select",{value:be,onChange:e=>et(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-44",children:[t.jsx("option",{value:"",children:"全部用途"}),t.jsx("option",{value:"skip_reply",children:"跳过自动回复"}),t.jsx("option",{value:"skip_notify",children:"跳过外部通知"})]}),t.jsxs("button",{type:"button",onClick:()=>void N(),className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:`h-4 w-4 ${fe?"animate-spin":""}`}),"查询"]})]}),w.length>0&&t.jsxs("button",{type:"button",onClick:()=>void ct(),className:"ios-btn-danger flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(Ue,{className:"h-4 w-4"}),"删除所选"]})]}),t.jsxs("div",{className:"divide-y divide-[#eeeeee] px-4",children:[y.length>0&&t.jsxs("label",{className:"flex items-center gap-3 py-3 text-xs font-bold text-[var(--text-muted)]",children:[t.jsx("input",{type:"checkbox",checked:at,onChange:e=>R(e.target.checked?y.map(s=>s.id):[]),className:"h-4 w-4 accent-[#f5c400]"}),"全选当前列表"]}),y.map(e=>t.jsxs("div",{className:"grid gap-3 py-4 sm:grid-cols-[24px_52px_180px_minmax(0,1fr)_44px] sm:items-center",children:[t.jsx("input",{type:"checkbox",checked:w.includes(e.id),onChange:s=>R(a=>s.target.checked?[...a,e.id]:a.filter(i=>i!==e.id)),className:"h-4 w-4 accent-[#f5c400]"}),t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,onClick:()=>void bt(e.id).then(N),title:e.enabled?"停用规则":"启用规则",className:`relative h-6 w-11 rounded-full transition-colors ${e.enabled?"bg-[#f5c800]":"bg-gray-300"}`,children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{children:[t.jsx("p",{className:"break-all text-sm font-bold text-[var(--text)]",children:e.cookie_id}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:Qt[e.filter_type]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"break-words text-sm font-medium text-[var(--text)]",children:e.keyword}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-soft)]",children:Gt(e.updated_at||e.created_at)})]}),t.jsx("button",{type:"button",onClick:()=>void ot(e),title:"删除规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(Ue,{className:"h-4 w-4"})})]},e.id)),!fe&&y.length===0&&t.jsx(It,{compact:!0,title:"暂无消息过滤规则",description:"添加规则后可跳过指定消息的自动回复或外部通知。",icon:Z})]})]})]})})};export{ls as default};
*/const Ft=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],Pt=We("smile",Ft),At={微笑:"🙂",呲牙:"😁",咧嘴:"😁",大笑:"😄",笑哭:"😂",憨笑:"😊",微尬:"😅",尴尬:"😅",流汗:"😓",冷汗:"😰",流泪:"😭",大哭:"😭",快哭了:"😭",委屈:"🥺",可怜:"🥺",难过:"😢",失落:"😞",衰:"😞",捂脸:"🤦",掩面:"🤦",偷笑:"🤭",坏笑:"😏",阴险:"😈",淘气:"😜",调皮:"😜",吐舌:"😜",色色:"😍",色:"😍",爱慕:"😍",发呆:"😳",害羞:"😊",脸红:"😊",闭嘴:"🤐",睡觉:"😴",睡:"😴",困:"😪",打哈欠:"🥱",哈欠:"🥱",惊讶:"😲",吃惊:"😲",惊恐:"😱",吓:"😱",发怒:"😡",生气:"😡",怒:"😡",抓狂:"😫",疯狂:"😫",疑问:"❓",疑惑:"🤔",想想:"🤔",晕:"😵",晕倒:"😵",骷髅:"💀",敲打:"🔨",再见:"👋",拜拜:"👋",擦汗:"😅",抠鼻:"👃",鄙视:"🙄",白眼:"🙄",傲慢:"😏",得意:"😎",酷:"😎",饥饿:"🤤",馋嘴:"🤤",吐:"🤮",呕吐:"🤮",奋斗:"💪",加油:"💪",鼓掌:"👏",喝彩:"👏",调停:"🙏",抱拳:"🙏",作揖:"🙏",祈祷:"🙏",感谢:"🙏",亲亲:"😘",亲吻:"😘",飞吻:"😘",拥抱:"🤗",抱抱:"🤗",强:"👍",赞:"👍",点赞:"👍",弱:"👎",差评:"👎",握手:"🤝",胜利:"✌️",OK:"👌",剪刀:"✌️",手枪:"🔫",计算:"🧮",卡住:"😵",爱心:"❤️",红心:"❤️",心碎:"💔",玫瑰:"🌹",花朵:"🌸",凋谢:"🥀",樱花:"🌸",太阳:"☀️",月亮:"🌙",星星:"⭐",闪电:"⚡",彩虹:"🌈",咖啡:"☕",蛋糕:"🎂",生日快乐:"🎂",啤酒:"🍺",干杯:"🍻",西瓜:"🍉",苹果:"🍎",礼物:"🎁",红包:"🧧",恭喜发财:"🧧",灯笼:"🏮",爆竹:"🧨",庆祝:"🎉",撒花:"🎉",烟花:"🎆",足球:"⚽",篮球:"🏀",排球:"🏐",乒乓:"🏓",网球:"🎾",炸弹:"💣",刀:"🔪",猪头:"🐷",狗:"🐶",猫:"🐱",熊:"🐻",兔:"🐰",鸡:"🐔",公鸡:"🐔",蚂蚁:"🐜",蜗牛:"🐌",瓢虫:"🐞",蝴蝶:"🦋",蛇:"🐍",恐龙:"🦖",鲨鱼:"🦈"};function Pe(r){return r.replace(/\[([^\[\]]{1,8})\]/g,(o,d)=>At[d]??o)}const Dt=1e4,Ot=1e4,Ke="xianyu-message-read-watermarks-v2",zt=500,Ae=9,Wt=10*1024*1024,De=(r,o)=>`${r}\0${o}`,Kt=()=>{if(typeof window>"u")return{};try{const r=JSON.parse(window.localStorage.getItem(Ke)||"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(([,o])=>{if(!o||typeof o!="object"||Array.isArray(o))return!1;const d=o;return Number.isFinite(d.lastMessageTime)&&typeof d.lastMessageSummary=="string"&&Number.isFinite(d.unreadCount)}))}catch{return{}}},Bt=r=>{if(!(typeof window>"u"))try{const o=Object.entries(r).sort(([,d],[,g])=>g.lastMessageTime-d.lastMessageTime).slice(0,zt);window.localStorage.setItem(Ke,JSON.stringify(Object.fromEntries(o)))}catch{}},qt=(r,o)=>{if(!r)return!1;const d=Number(o.lastMessageTime)||0,g=String(o.lastMessageSummary||""),k=Number(o.unreadCount)||0;return d<r.lastMessageTime||d===r.lastMessageTime&&g===r.lastMessageSummary&&k<=r.unreadCount},F=r=>r?r.startsWith("//")?`https:${r}`:r:"",Oe=r=>{if(!r)return"";const o=r<1e12?r*1e3:r,d=new Date(o);if(Number.isNaN(d.getTime()))return"";const g=new Date;return d.toDateString()===g.toDateString()?d.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):d.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit"})},Xt=r=>{if(!r)return"-";const o=new Date(r.includes("T")?r:`${r.replace(" ","T")}Z`);return Number.isNaN(o.getTime())?r:o.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Y=r=>(r==null?void 0:r.displayName)||(r==null?void 0:r.accountId)||"未选择账号",ze=["#8c7900","#0f704b","#2a5f92","#945800","#6b5a8a","#b45309","#3f7a5c","#7c4d5e"],Gt=r=>{let o=0;for(let d=0;d<r.length;d+=1)o=o*31+r.charCodeAt(d)|0;return ze[Math.abs(o)%ze.length]},Ht={skip_reply:"跳过自动回复",skip_notify:"跳过外部通知"},ls=({isActive:r=!0})=>{const[o,d]=n.useState("messages"),[g,k]=n.useState("list"),[P,Be]=n.useState([]),[ee,qe]=n.useState([]),[te,Xe]=n.useState([]),[x,se]=n.useState(""),[S,A]=n.useState([]),[Ge,He]=n.useState(new Set),[j,D]=n.useState(""),[C,O]=n.useState([]),[z,W]=n.useState(""),[Qe,ae]=n.useState(!1),[Ve]=n.useState(()=>`conversation-filter-${Date.now()}-${Math.random().toString(36).slice(2)}`),[Je,re]=n.useState(!0),[K,ne]=n.useState(!1),[ie,le]=n.useState(!1),[B,q]=n.useState(""),[oe,ce]=n.useState([]),[de,X]=n.useState(!1),[G,me]=n.useState(!1),[b,H]=n.useState([]),xe=n.useRef(null),Q=n.useRef(null),ue=n.useRef(null),I=n.useRef(!1),$=n.useRef(""),T=n.useRef(Kt()),he=n.useRef(b);he.current=b,n.useEffect(()=>()=>{he.current.forEach(e=>URL.revokeObjectURL(e.url))},[]);const[y,Ze]=n.useState([]),[fe,pe]=n.useState(!0),[ge,Ye]=n.useState(""),[be,et]=n.useState(""),[V,je]=n.useState(""),[ye,tt]=n.useState("skipLine truncated
系统通知`,className:"ios-input min-h-20 resize-y rounded-md px-3 py-2.5 text-sm"}),t.jsxs("button",{type:"button",onClick:()=>void lt(),disabled:Ne,className:"ios-btn-primary flex min-h-11 items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[Ne?t.jsx(U,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"批量添加"]})]})]}),t.jsxs("section",{className:"section-panel",children:[t.jsx(Ee,{title:"现有规则",description:`当前筛选共 ${y.length} 条`,icon:Z}),t.jsxs("div",{className:"toolbar rounded-none border-x-0 border-t-0 shadow-none",children:[t.jsxs("div",{className:"toolbar__group",children:[t.jsxs("select",{value:ge,onChange:e=>Ye(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-52",children:[t.jsx("option",{value:"",children:"全部账号"}),ee.map(e=>t.jsx("option",{value:e.id,children:e.nickname||e.remark||e.id},e.id))]}),t.jsxs("select",{value:be,onChange:e=>et(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-44",children:[t.jsx("option",{value:"",children:"全部用途"}),t.jsx("option",{value:"skip_reply",children:"跳过自动回复"}),t.jsx("option",{value:"skip_notify",children:"跳过外部通知"})]}),t.jsxs("button",{type:"button",onClick:()=>void N(),className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:`h-4 w-4 ${fe?"animate-spin":""}`}),"查询"]})]}),w.length>0&&t.jsxs("button",{type:"button",onClick:()=>void ct(),className:"ios-btn-danger flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(Ue,{className:"h-4 w-4"}),"删除所选"]})]}),t.jsxs("div",{className:"divide-y divide-[#eeeeee] px-4",children:[y.length>0&&t.jsxs("label",{className:"flex items-center gap-3 py-3 text-xs font-bold text-[var(--text-muted)]",children:[t.jsx("input",{type:"checkbox",checked:at,onChange:e=>R(e.target.checked?y.map(s=>s.id):[]),className:"h-4 w-4 accent-[#f5c400]"}),"全选当前列表"]}),y.map(e=>t.jsxs("div",{className:"grid gap-3 py-4 sm:grid-cols-[24px_52px_180px_minmax(0,1fr)_44px] sm:items-center",children:[t.jsx("input",{type:"checkbox",checked:w.includes(e.id),onChange:s=>R(a=>s.target.checked?[...a,e.id]:a.filter(i=>i!==e.id)),className:"h-4 w-4 accent-[#f5c400]"}),t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,onClick:()=>void bt(e.id).then(N),title:e.enabled?"停用规则":"启用规则",className:`relative h-6 w-11 rounded-full transition-colors ${e.enabled?"bg-[#f5c800]":"bg-gray-300"}`,children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{children:[t.jsx("p",{className:"break-all text-sm font-bold text-[var(--text)]",children:e.cookie_id}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:Ht[e.filter_type]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"break-words text-sm font-medium text-[var(--text)]",children:e.keyword}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-soft)]",children:Xt(e.updated_at||e.created_at)})]}),t.jsx("button",{type:"button",onClick:()=>void ot(e),title:"删除规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(Ue,{className:"h-4 w-4"})})]},e.id)),!fe&&y.length===0&&t.jsx(It,{compact:!0,title:"暂无消息过滤规则",description:"添加规则后可跳过指定消息的自动回复或外部通知。",icon:Z})]})]})]})})};export{ls as default};
@@ -1 +1 @@
import{r as l,j as t,bc as E,e as ee,L as te,aE as ot,C as ct,X as Se,o as dt,bm as mt,bn as xt,bo as pt,n as o,bp as ut,bq as ht,br as _e,v as se,bs as yt,bt as Re,bu as bt,bv as gt,bw as ft,bx as jt,by as Nt}from"./index-HJMc2HxZ.js";import{a as vt,b as wt,S as $,E as L}from"./ui-vFagDj8B.js";import{L as ae}from"./link-2-C9fPZMxa.js";import{S as le}from"./shield-alert-fp78nSHa.js";import{A as ne}from"./activity-DNyIqxl-.js";import{P as Ee}from"./plus-CpIZThgs.js";import{P as $e}from"./pen-line-BWqAQUqr.js";import{T as ie}from"./trash-2-Du5uC3X5.js";import{S as kt}from"./send-D67RiJNt.js";import{C as Ct,a as St}from"./chevron-right-C_49FSiS.js";import{S as Le}from"./save-qf4Q-Bil.js";import{C as _t}from"./check-BsSr22q3.js";const y={dingtalk:{label:"钉钉",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://oapi.dingtalk.com/robot/send?..."},{key:"secret",label:"加签密钥",type:"password",optional:!0}],defaults:{}},feishu:{label:"飞书",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/..."},{key:"secret",label:"签名密钥",type:"password",optional:!0}],defaults:{}},bark:{label:"Bark",fields:[{key:"device_key",label:"Device Key",type:"password"},{key:"server_url",label:"服务器地址",placeholder:"https://api.day.app",optional:!0}],defaults:{server_url:"https://api.day.app"}},email:{label:"邮件",fields:[{key:"smtp_server",label:"SMTP 服务器",placeholder:"留空则使用「系统设置 → 邮件服务」",optional:!0},{key:"smtp_port",label:"SMTP 端口",type:"number",placeholder:"留空则使用系统设置(如 465)",optional:!0},{key:"email_user",label:"发件邮箱",placeholder:"留空则使用系统设置的发件邮箱",optional:!0},{key:"email_password",label:"邮箱密码或授权码",type:"password",placeholder:"留空则使用系统设置的授权码",optional:!0},{key:"recipient_email",label:"接收邮箱",placeholder:"必填,通知发到这个邮箱"}],defaults:{}},webhook:{label:"Webhook",fields:[{key:"webhook_url",label:"Webhook 地址"},{key:"http_method",label:"请求方法",type:"select",options:["POST","PUT"]},{key:"headers",label:"请求头 JSON",type:"textarea",placeholder:'{"Authorization":"Bearer ..."}',optional:!0}],defaults:{http_method:"POST",headers:"{}"}},wechat:{label:"企业微信",fields:[{key:"webhook_url",label:"机器人 Webhook 地址"}],defaults:{}},telegram:{label:"Telegram",fields:[{key:"bot_token",label:"Bot Token",type:"password"},{key:"chat_id",label:"Chat ID"}],defaults:{}}},re=20,Rt=i=>{var k,x;const r=(x=(k=i==null?void 0:i.response)==null?void 0:k.data)==null?void 0:x.detail;if(r&&typeof r=="object"&&"message"in r){const b=r.message;if(typeof b=="string"&&b.trim())return b.trim()}return typeof r=="string"&&r.trim()?r.trim():i instanceof Error&&i.message?i.message:"测试发送失败,请稍后重试"},oe=i=>i.nickname||i.remark||i.id,T=i=>{if(!i)return"-";const r=new Date(i.includes("T")?i:`${i.replace(" ","T")}Z`);return Number.isNaN(r.getTime())?i:r.toLocaleString("zh-CN")},Wt=({isAdmin:i})=>{const[r,k]=l.useState("channels"),[x,b]=l.useState([]),[A,ce]=l.useState([]),[de,D]=l.useState([]),[Te,g]=l.useState({}),[f,Ae]=l.useState([]),[me,De]=l.useState([]),[C,xe]=l.useState(!0),[Pe,j]=l.useState(!1),[N,pe]=l.useState(null),[P,B]=l.useState("dingtalk"),[O,I]=l.useState(""),[d,p]=l.useState({}),[ue,he]=l.useState(!1),[Be,u]=l.useState(!1),[v,ye]=l.useState(null),[M,q]=l.useState(""),[W,G]=l.useState(""),[z,F]=l.useState(""),[H,h]=l.useState([]),[be,S]=l.useState(!1),[ge,Oe]=l.useState([]),[fe,Ie]=l.useState(0),[U,Me]=l.useState(""),[Z,qe]=l.useState(""),[w,_]=l.useState(0),[J,je]=l.useState(!1),[Ne,We]=l.useState([]),[ve,Ge]=l.useState(""),[R,we]=l.useState(""),[K,ke]=l.useState(!1),m=async()=>{xe(!0);try{const[e,s,a,n]=await Promise.all([dt(),mt(),xt(),pt()]);b(e),ce(s.data),D(a.data),g(c=>{const rt=new Set(a.data.map(Y=>String(Y.id)));return Object.fromEntries(Object.entries(c).filter(([Y])=>rt.has(Y)))}),Ae(n.events),De(n.priorities)}catch(e){o(`加载通知配置失败:${e.message}`)}finally{xe(!1)}};l.useEffect(()=>{m()},[]);const ze=()=>{const e="dingtalk";pe(null),B(e),I(""),p({...y[e].defaults}),j(!0)},Fe=e=>{pe(e),B(e.type),I(e.name),p({...y[e.type].defaults,...e.config}),j(!0)},He=e=>{B(e),p({...y[e].defaults})},Ue=async()=>{he(!0);try{N?await _e(N.id,{name:O,config:d,enabled:N.enabled}):await jt({name:O,type:P,config:d}),j(!1),await m()}catch(e){o(`保存通知渠道失败:${e.message}`)}finally{he(!1)}},Ze=async e=>{try{await _e(e.id,{enabled:!e.enabled}),ce(s=>s.map(a=>a.id===e.id?{...a,enabled:!a.enabled}:a)),e.enabled?D(s=>s.filter(a=>a.channel_id!==Number(e.id))):await m()}catch(s){o(`更新渠道状态失败:${s.message}`)}},Je=async e=>{if(await se(`确认删除通知渠道“${e.name}”?相关账号绑定也会被删除。`))try{await yt(e.id),await m()}catch(s){o(`删除通知渠道失败:${s.message}`)}},Ke=e=>{var s;return((s=f.find(a=Line truncated
import{r as l,j as t,bd as $,e as ee,L as te,aF as ot,C as ct,X as Se,o as dt,bn as mt,bo as xt,bp as pt,n as o,bq as ut,br as ht,bs as _e,v as se,bt as yt,bu as Re,bv as bt,bw as gt,bx as ft,by as jt,bz as Nt}from"./index-DsODdDMf.js";import{a as vt,b as wt,S as E,E as L}from"./ui-CQHd7VNo.js";import{L as ae}from"./link-2-DPJwJ3Cv.js";import{S as le}from"./shield-alert-JYWkaAgT.js";import{A as ne}from"./activity-C3vSFSwT.js";import{P as $e}from"./plus-fhLljyPf.js";import{P as Ee}from"./pen-line-lDrHTQ2Z.js";import{T as ie}from"./trash-2-CvZQL5SJ.js";import{S as kt}from"./send-KQw7ZSlT.js";import{C as Ct,a as St}from"./chevron-right-CJ-DrOxg.js";import{S as Le}from"./save-1bfmWlQj.js";import{C as _t}from"./check-D0r7RhTo.js";const y={dingtalk:{label:"钉钉",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://oapi.dingtalk.com/robot/send?..."},{key:"secret",label:"加签密钥",type:"password",optional:!0}],defaults:{}},feishu:{label:"飞书",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/..."},{key:"secret",label:"签名密钥",type:"password",optional:!0}],defaults:{}},bark:{label:"Bark",fields:[{key:"device_key",label:"Device Key",type:"password"},{key:"server_url",label:"服务器地址",placeholder:"https://api.day.app",optional:!0}],defaults:{server_url:"https://api.day.app"}},email:{label:"邮件",fields:[{key:"smtp_server",label:"SMTP 服务器",placeholder:"留空则使用「系统设置 → 邮件服务」",optional:!0},{key:"smtp_port",label:"SMTP 端口",type:"number",placeholder:"留空则使用系统设置(如 465)",optional:!0},{key:"email_user",label:"发件邮箱",placeholder:"留空则使用系统设置的发件邮箱",optional:!0},{key:"email_password",label:"邮箱密码或授权码",type:"password",placeholder:"留空则使用系统设置的授权码",optional:!0},{key:"recipient_email",label:"接收邮箱",placeholder:"必填,通知发到这个邮箱"}],defaults:{}},webhook:{label:"Webhook",fields:[{key:"webhook_url",label:"Webhook 地址"},{key:"http_method",label:"请求方法",type:"select",options:["POST","PUT"]},{key:"headers",label:"请求头 JSON",type:"textarea",placeholder:'{"Authorization":"Bearer ..."}',optional:!0}],defaults:{http_method:"POST",headers:"{}"}},wechat:{label:"企业微信",fields:[{key:"webhook_url",label:"机器人 Webhook 地址"}],defaults:{}},telegram:{label:"Telegram",fields:[{key:"bot_token",label:"Bot Token",type:"password"},{key:"chat_id",label:"Chat ID"}],defaults:{}}},re=20,Rt=i=>{var k,x;const r=(x=(k=i==null?void 0:i.response)==null?void 0:k.data)==null?void 0:x.detail;if(r&&typeof r=="object"&&"message"in r){const b=r.message;if(typeof b=="string"&&b.trim())return b.trim()}return typeof r=="string"&&r.trim()?r.trim():i instanceof Error&&i.message?i.message:"测试发送失败,请稍后重试"},oe=i=>i.nickname||i.remark||i.id,T=i=>{if(!i)return"-";const r=new Date(i.includes("T")?i:`${i.replace(" ","T")}Z`);return Number.isNaN(r.getTime())?i:r.toLocaleString("zh-CN")},Wt=({isAdmin:i})=>{const[r,k]=l.useState("channels"),[x,b]=l.useState([]),[A,ce]=l.useState([]),[de,D]=l.useState([]),[Te,g]=l.useState({}),[f,Ae]=l.useState([]),[me,De]=l.useState([]),[C,xe]=l.useState(!0),[Pe,j]=l.useState(!1),[N,pe]=l.useState(null),[P,B]=l.useState("dingtalk"),[O,I]=l.useState(""),[d,p]=l.useState({}),[ue,he]=l.useState(!1),[Be,u]=l.useState(!1),[v,ye]=l.useState(null),[M,q]=l.useState(""),[W,G]=l.useState(""),[z,F]=l.useState(""),[H,h]=l.useState([]),[be,S]=l.useState(!1),[ge,Oe]=l.useState([]),[fe,Ie]=l.useState(0),[U,Me]=l.useState(""),[Z,qe]=l.useState(""),[w,_]=l.useState(0),[J,je]=l.useState(!1),[Ne,We]=l.useState([]),[ve,Ge]=l.useState(""),[R,we]=l.useState(""),[K,ke]=l.useState(!1),m=async()=>{xe(!0);try{const[e,s,a,n]=await Promise.all([dt(),mt(),xt(),pt()]);b(e),ce(s.data),D(a.data),g(c=>{const rt=new Set(a.data.map(Y=>String(Y.id)));return Object.fromEntries(Object.entries(c).filter(([Y])=>rt.has(Y)))}),Ae(n.events),De(n.priorities)}catch(e){o(`加载通知配置失败:${e.message}`)}finally{xe(!1)}};l.useEffect(()=>{m()},[]);const ze=()=>{const e="dingtalk";pe(null),B(e),I(""),p({...y[e].defaults}),j(!0)},Fe=e=>{pe(e),B(e.type),I(e.name),p({...y[e.type].defaults,...e.config}),j(!0)},He=e=>{B(e),p({...y[e].defaults})},Ue=async()=>{he(!0);try{N?await _e(N.id,{name:O,config:d,enabled:N.enabled}):await jt({name:O,type:P,config:d}),j(!1),await m()}catch(e){o(`保存通知渠道失败:${e.message}`)}finally{he(!1)}},Ze=async e=>{try{await _e(e.id,{enabled:!e.enabled}),ce(s=>s.map(a=>a.id===e.id?{...a,enabled:!a.enabled}:a)),e.enabled?D(s=>s.filter(a=>a.channel_id!==Number(e.id))):await m()}catch(s){o(`更新渠道状态失败:${s.message}`)}},Je=async e=>{if(await se(`确认删除通知渠道“${e.name}”?相关账号绑定也会被删除。`))try{await yt(e.id),await m()}catch(s){o(`删除通知渠道失败:${s.message}`)}},Ke=e=>{var s;return((s=f.find(a=Line truncated
@@ -1,4 +1,4 @@
import{c as Re,r as l,h as ys,O as js,j as e,e as $,P as fs,E as vs,Q as Ns,b as N,X as _,o as _s,T as ws,V as Me,W as ks,Y as Ss,n,Z as Cs,v as Pe,_ as Os,$ as Es,a0 as Ls,a1 as Is,a2 as Ms,a3 as Ps,a4 as Ds,a5 as Fs}from"./index-HJMc2HxZ.js";import{a as As,b as $s,E as Rs}from"./ui-vFagDj8B.js";import{P as qs}from"./plus-CpIZThgs.js";import{T as De}from"./truck-A9ZYOrzg.js";import{S as Ts}from"./search-DGiuF6uC.js";import{P as Y}from"./package-check-DzDzt8rk.js";import{F as zs}from"./flower-2-Bz3yOpyy.js";import{E as Vs}from"./eye-D3neYBSg.js";import{S as Hs}from"./square-pen-D5BwtKk7.js";import{T as Js}from"./trash-2-Du5uC3X5.js";import{C as Ws,a as Bs}from"./chevron-right-C_49FSiS.js";import{S as Fe}from"./save-qf4Q-Bil.js";/**
import{c as Re,r as l,h as ys,O as js,j as e,e as $,P as fs,E as vs,Q as Ns,b as N,X as _,o as _s,T as ws,V as Me,W as ks,Y as Ss,n,Z as Cs,v as Pe,_ as Os,$ as Es,a0 as Ls,a1 as Is,a2 as Ms,a3 as Ps,a4 as Ds,a5 as Fs}from"./index-DsODdDMf.js";import{a as As,b as $s,E as Rs}from"./ui-CQHd7VNo.js";import{P as qs}from"./plus-fhLljyPf.js";import{T as De}from"./truck-BWE0A9OO.js";import{S as Ts}from"./search-sxbkAeV0.js";import{P as Y}from"./package-check-DMYEV4p7.js";import{F as zs}from"./flower-2-Qv1fS9dP.js";import{E as Vs}from"./eye-DqWY05EP.js";import{S as Hs}from"./square-pen-DR0-XdRq.js";import{T as Js}from"./trash-2-CvZQL5SJ.js";import{C as Ws,a as Bs}from"./chevron-right-CJ-DrOxg.js";import{S as Fe}from"./save-1bfmWlQj.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as B,r as d,bQ as T,o as V,bR as G,bS as J,j as e,bT as q,L as S,e as W,E as X}from"./index-HJMc2HxZ.js";import{P as Z,a as ee,N as te,E as D}from"./ui-vFagDj8B.js";import{S as K}from"./sparkles-Da7ZNkrd.js";import{P as se}from"./package-BcCU6KLb.js";import{S as re}from"./search-DGiuF6uC.js";import{T as ae}from"./trending-up-jQPihqZY.js";/**
import{c as B,r as d,bS as T,o as G,bT as J,bU as Q,j as e,bV as q,L as S,e as W,E as X}from"./index-DsODdDMf.js";import{P as Z,a as ee,N as te,E as D}from"./ui-CQHd7VNo.js";import{S as K}from"./sparkles-CRcwNwKo.js";import{P as se}from"./package-C5umlMc4.js";import{S as re}from"./search-sxbkAeV0.js";import{T as ae}from"./trending-up-2bhyfwOI.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as B,r as d,bQ as T,o as V,bR as G,bS as J,j as e,bT as q,L as S,e as W
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ie=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],oe=B("layers",ie),ce=2500,de=[{id:"sold",label:"按销量"},{id:"similarity",label:"按相似度"},{id:"credit",label:"按信用"},{id:"reviews",label:"按评论数"}],O=n=>!n||n<0?"0":n>=1e4?`${(n/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(n),xe=n=>n.replace(/&(hellip|nbsp|amp|lt|gt|quot|#39);/g,a=>({"&hellip;":"…","&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"})[a]??a),me=n=>{if(!n)return"—";const a=Date.now()-n*1e3;if(a<6e4)return"刚刚";if(a<36e5)return`${Math.floor(a/6e4)}分钟前`;if(a<864e5)return`${Math.floor(a/36e5)}小时前`;if(a<7*864e5)return`${Math.floor(a/864e5)}天前`;const c=new Date(n*1e3);return`${c.getMonth()+1}月${c.getDate()}日`},z=({value:n,max:a=100,suffix:c="%"})=>{const u=a>0?n/a:0,r=u>=.7?"bg-emerald-50 text-emerald-700 border-emerald-200":u>=.4?"bg-sky-50 text-sky-700 border-sky-200":"bg-[var(--surface-subtle)] text-[var(--text-soft)] border-[var(--border)]";return e.jsxs("span",{className:`inline-flex min-w-[3.5rem] justify-center rounded-full border px-2 py-0.5 text-xs font-semibold tabular-nums ${r}`,title:`${n} / ${a}`,children:[n,c]})},fe=({level:n,fallback:a})=>n?e.jsxs("span",{className:"inline-flex flex-col items-center gap-0.5",title:`信用等级 ${n} 级${a?`(${a})`:""}`,children:[e.jsxs("span",{className:"text-xs leading-none tracking-tight text-amber-500",children:["★".repeat(n),e.jsx("span",{className:"text-[var(--border)]",children:"☆".repeat(5-n)})]}),e.jsx("span",{className:"text-[11px] leading-none text-[var(--text-soft)]",children:a||`${n}级`})]}):e.jsx("span",{className:"text-xs text-gray-300 dark:text-gray-600",title:a||"未获取到信用数据",children:a||"—"}),pe=({reviews:n,goodRate:a,detail:c})=>e.jsxs("span",{className:"inline-flex flex-col items-end gap-0.5",title:c,children:[e.jsx("span",{className:"text-sm font-semibold tabular-nums text-[var(--text)]",children:O(n)}),a>0&&e.jsxs("span",{className:"text-[11px] leading-none tabular-nums text-emerald-600",children:[a,"% 好评"]})]}),w=({icon:n,label:a,children:c,title:u})=>e.jsxs("div",{className:"rounded-xl border border-[var(--border)] bg-[var(--surface-subtle)] px-3.5 py-3",title:u,children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[var(--text-soft)]",children:[e.jsx(n,{className:"h-3.5 w-3.5"}),a]}),e.jsx("div",{className:"mt-1.5 truncate text-sm font-semibold text-[var(--text)]",children:c})]}),ve=()=>{var E,P,R;const[n,a]=d.useState(!0),[c,u]=d.useState(""),[r,$]=d.useState(null),[f,y]=d.useState(!1),[x,j]=d.useState(null),[_,Y]=d.useState("sold"),[v,m]=d.useState(null),[A,C]=d.useState(""),[M,F]=d.useState(""),[b,I]=d.useState(!1),p=d.useRef(null),k=d.useCallback(()=>{p.current&&(clearInterval(p.current),p.current=null),y(!1),j(null)},[]),L=d.useCallback(async t=>{var o,s,l,g;try{const i=await T(t);i.data&&$(i.data),i.refreshing&&(y(!0),j({done:((o=i.progress)==null?void 0:o.done)??0,total:((s=i.progress)==null?void 0:s.total)??0,stage:((l=i.progress)==null?void 0:l.stage)||"抓取中"})),((g=i.progress)==null?void 0:g.state)==="error"&&i.progress.error&&m({type:"error",message:i.progress.error})}catch(i){console.error("加载同行店铺失败:",i)}},[]);d.useEffect(()=>{let t=!0;return(async()=>{try{const s=(await V())[0];if(!t)return;if(!s){m({type:"info",message:"请先在「账号管理」添加账号并同步商品,再回到本页。"}),a(!1);return}u(s.id),await L(s.id)}catch(o){console.error("初始化同行店铺失败:",o)}finally{t&&a(!1)}})(),()=>{t=!1,p.current&&clearInterval(p.current)}},[L]),d.useEffect(()=>{if(!(!f||!c))return p.current=setInterval(async()=>{var t,o,s,l,g;try{const i=await T(c);j({done:((t=i.progress)==null?void 0:t.done)??0,total:((o=i.progress)==null?void 0:o.total)??0,stage:((s=i.progress)==null?void 0:s.stage)||"抓取中"}),((l=i.progress)==null?void 0:l.state)==="done"?(k(),i.data&&$(i.data),m({type:"success",message:"同行店铺数据已更新。"})):((g=i.progress)==null?void 0:g.state)==="error"&&(k(),m({type:"error",message:i.progress.error||"抓取失败,请稍后重试。"}))}catch(i){console.error("轮询同行店铺失败:",i)}},ce),()=>{p.current&&clearInterval(p.current)}},[f,c,k]);const H=d.useCallback(async()=>{var t,o;if(!(!c||f)){m(null),C("");try{if((await G(c)).status==="running"){y(!0);return}y(!0),j({done:0,total:0,stage:"准备抓取"})}catch(s){const l=((o=(t=s==null?void 0:s.response)==null?void 0:t.data)==null?void 0:o.detail)||(s==null?void 0:s.message)||"触发刷新失败";m({type:"error",message:String(l)})}}},[c,f]),Q=d.useCallback(async()=>{var t,o;if(!(!c||b)){I(!0),m(null);try{const s=await J(c);s.statLine truncated
*/const ie=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],oe=B("layers",ie),ce=2500,de=[{id:"sold",label:"按销量"},{id:"similarity",label:"按相似度"},{id:"credit",label:"按信用"},{id:"reviews",label:"按评论数"}],O=n=>!n||n<0?"0":n>=1e4?`${(n/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(n),xe=n=>n.replace(/&(hellip|nbsp|amp|lt|gt|quot|#39);/g,a=>({"&hellip;":"…","&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"})[a]??a),me=n=>{if(!n)return"—";const a=Date.now()-n*1e3;if(a<6e4)return"刚刚";if(a<36e5)return`${Math.floor(a/6e4)}分钟前`;if(a<864e5)return`${Math.floor(a/36e5)}小时前`;if(a<7*864e5)return`${Math.floor(a/864e5)}天前`;const c=new Date(n*1e3);return`${c.getMonth()+1}月${c.getDate()}日`},z=({value:n,max:a=100,suffix:c="%"})=>{const u=a>0?n/a:0,r=u>=.7?"bg-emerald-50 text-emerald-700 border-emerald-200":u>=.4?"bg-sky-50 text-sky-700 border-sky-200":"bg-[var(--surface-subtle)] text-[var(--text-soft)] border-[var(--border)]";return e.jsxs("span",{className:`inline-flex min-w-[3.5rem] justify-center rounded-full border px-2 py-0.5 text-xs font-semibold tabular-nums ${r}`,title:`${n} / ${a}`,children:[n,c]})},fe=({level:n,fallback:a})=>n?e.jsxs("span",{className:"inline-flex flex-col items-center gap-0.5",title:`信用等级 ${n} 级${a?`(${a})`:""}`,children:[e.jsxs("span",{className:"text-xs leading-none tracking-tight text-amber-500",children:["★".repeat(n),e.jsx("span",{className:"text-[var(--border)]",children:"☆".repeat(5-n)})]}),e.jsx("span",{className:"text-[11px] leading-none text-[var(--text-soft)]",children:a||`${n}级`})]}):e.jsx("span",{className:"text-xs text-gray-300 dark:text-gray-600",title:a||"未获取到信用数据",children:a||"—"}),pe=({reviews:n,goodRate:a,detail:c})=>e.jsxs("span",{className:"inline-flex flex-col items-end gap-0.5",title:c,children:[e.jsx("span",{className:"text-sm font-semibold tabular-nums text-[var(--text)]",children:O(n)}),a>0&&e.jsxs("span",{className:"text-[11px] leading-none tabular-nums text-emerald-600",children:[a,"% 好评"]})]}),w=({icon:n,label:a,children:c,title:u})=>e.jsxs("div",{className:"rounded-xl border border-[var(--border)] bg-[var(--surface-subtle)] px-3.5 py-3",title:u,children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[var(--text-soft)]",children:[e.jsx(n,{className:"h-3.5 w-3.5"}),a]}),e.jsx("div",{className:"mt-1.5 truncate text-sm font-semibold text-[var(--text)]",children:c})]}),ve=()=>{var E,P,R;const[n,a]=d.useState(!0),[c,u]=d.useState(""),[r,$]=d.useState(null),[f,y]=d.useState(!1),[x,j]=d.useState(null),[_,Y]=d.useState("sold"),[v,m]=d.useState(null),[A,C]=d.useState(""),[M,U]=d.useState(""),[b,I]=d.useState(!1),p=d.useRef(null),k=d.useCallback(()=>{p.current&&(clearInterval(p.current),p.current=null),y(!1),j(null)},[]),L=d.useCallback(async t=>{var o,s,l,g;try{const i=await T(t);i.data&&$(i.data),i.refreshing&&(y(!0),j({done:((o=i.progress)==null?void 0:o.done)??0,total:((s=i.progress)==null?void 0:s.total)??0,stage:((l=i.progress)==null?void 0:l.stage)||"抓取中"})),((g=i.progress)==null?void 0:g.state)==="error"&&i.progress.error&&m({type:"error",message:i.progress.error})}catch(i){console.error("加载同行店铺失败:",i)}},[]);d.useEffect(()=>{let t=!0;return(async()=>{try{const s=(await G())[0];if(!t)return;if(!s){m({type:"info",message:"请先在「账号管理」添加账号并同步商品,再回到本页。"}),a(!1);return}u(s.id),await L(s.id)}catch(o){console.error("初始化同行店铺失败:",o)}finally{t&&a(!1)}})(),()=>{t=!1,p.current&&clearInterval(p.current)}},[L]),d.useEffect(()=>{if(!(!f||!c))return p.current=setInterval(async()=>{var t,o,s,l,g;try{const i=await T(c);j({done:((t=i.progress)==null?void 0:t.done)??0,total:((o=i.progress)==null?void 0:o.total)??0,stage:((s=i.progress)==null?void 0:s.stage)||"抓取中"}),((l=i.progress)==null?void 0:l.state)==="done"?(k(),i.data&&$(i.data),m({type:"success",message:"同行店铺数据已更新。"})):((g=i.progress)==null?void 0:g.state)==="error"&&(k(),m({type:"error",message:i.progress.error||"抓取失败,请稍后重试。"}))}catch(i){console.error("轮询同行店铺失败:",i)}},ce),()=>{p.current&&clearInterval(p.current)}},[f,c,k]);const V=d.useCallback(async()=>{var t,o;if(!(!c||f)){m(null),C("");try{if((await J(c)).status==="running"){y(!0);return}y(!0),j({done:0,total:0,stage:"准备抓取"})}catch(s){const l=((o=(t=s==null?void 0:s.response)==null?void 0:t.data)==null?void 0:o.detail)||(s==null?void 0:s.message)||"触发刷新失败";m({type:"error",message:String(l)})}}},[c,f]),F=d.useCallback(async()=>{var t,o;if(!(!c||b)){I(!0),m(null);try{const s=await Q(c);s.statLine truncated
@@ -1,4 +1,4 @@
import{c as C,r as l,bU as pe,bV as he,j as e,bW as X,e as M,X as q,bX as ue,aE as be,bY as je,bZ as ge,b_ as U,b$ as ve,c0 as _e,c1 as ye}from"./index-HJMc2HxZ.js";import{P as V,a as Ne,N as R,E as Z}from"./ui-vFagDj8B.js";import{P as fe}from"./plus-CpIZThgs.js";import{P as J}from"./play-zVF2f9jg.js";import{P as we}from"./pen-line-BWqAQUqr.js";import{T as ke}from"./trash-2-Du5uC3X5.js";import{S as Q}from"./search-DGiuF6uC.js";/**
import{c as C,r as l,bW as pe,bX as he,j as e,bY as X,e as E,X as q,bZ as ue,aF as be,b_ as je,b$ as ge,c0 as Z,c1 as ve,c2 as _e,c3 as ye}from"./index-DsODdDMf.js";import{P as J,a as Ne,N as R,E as Q}from"./ui-CQHd7VNo.js";import{P as fe}from"./plus-fhLljyPf.js";import{P as U}from"./play-DS4dwZmR.js";import{P as we}from"./pen-line-lDrHTQ2Z.js";import{T as ke}from"./trash-2-CvZQL5SJ.js";import{S as V}from"./search-sxbkAeV0.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -13,9 +13,9 @@ import{c as C,r as l,bU as pe,bV as he,j as e,bW as X,e as M,X as q,bX as ue,aE
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pe=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Ee=C("history",Pe);/**
*/const Pe=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Me=C("history",Pe);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Me=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Re=C("pause",Me),Ie=2500,p=t=>t==null?"—":`¥${Number(t).toLocaleString("zh-CN",{maximumFractionDigits:2})}`,L=()=>Math.floor(Date.now()/1e3),A=t=>{if(!t||t<=0)return"—";const c=Math.floor(t);return c<60?`${c} 秒前`:c<3600?`${Math.floor(c/60)} 分钟前`:c<86400?`${Math.floor(c/3600)} 小时前`:`${Math.floor(c/86400)} 天前`},Le=t=>t==null||t<0?"已停用":t<60?`${Math.max(0,Math.round(t))} 秒后`:t<3600?`${Math.floor(t/60)} 分钟后`:`${Math.floor(t/3600)} 小时后`,k=t=>{const c=t.trim();if(c==="")return null;const h=Number(c);return Number.isFinite(h)&&h>=0?h:null},ee={name:"",keyword:"",min_price:"",max_price:"",target_price:"",interval_minutes:"30",pages:"2",enabled:!0,cookie_id:"",min_seller_credit:"",min_seller_deals:"",ai_precise:!1},Ae=t=>({name:t.name,keyword:t.keyword,min_price:t.min_price===null?"":String(t.min_price),max_price:t.max_price===null?"":String(t.max_price),target_price:t.target_price===null?"":String(t.target_price),interval_minutes:String(t.interval_minutes),pages:String(t.pages||2),enabled:t.enabled!==!1,cookie_id:t.cookie_id||"",min_seller_credit:t.min_seller_credit||"",min_seller_deals:t.min_seller_deals!=null?String(t.min_seller_deals):"",ai_precise:!!t.ai_precise}),se=t=>{const c=t.keyword.trim();if(!c)return{input:null,error:"请填写搜索关键词"};const h=t.name.trim()||c,v=k(t.min_price),m=k(t.max_price);if(v!==null&&m!==null&&v>m)return{input:null,error:"最低价不能大于最高价"};const g=k(t.target_price);if(g!==null&&m!==null&&g>m)return{input:null,error:"目标价不能高于最高价"};const u=Number(t.interval_minutes);if(!Number.isFinite(u)||u<5)return{input:null,error:"检查间隔至少 5 分钟"};const i=Number(t.pages);return!Number.isFinite(i)||i<1||i>5?{input:null,error:"每轮页数取 1~5"}:{input:{name:h,keyword:c,min_price:v,max_price:m,target_price:g,interval_minutes:Math.round(u),pages:Math.round(i),enabled:t.enabled,cookie_id:t.cookie_id||null,min_seller_credit:t.min_seller_credit||null,min_seller_deals:k(t.min_seller_deals),ai_precise:t.ai_precise}}};function ze(){const[t,c]=l.useState([]),[h,v]=l.useState(!0),[m,g]=l.useState(""),[u,i]=l.useState(null),[te,F]=l.useState([]),[ae,_]=l.useState(!1),[y,D]=l.useState(null),[n,d]=l.useState(ee),[T,H]=l.useState(!1),[O,N]=l.useState(""),[S,Y]=l.useState(!1),[o,f]=l.useState(null),[B,b]=l.useState(""),[$,z]=l.useState(null),[G,P]=l.useState([]),[re,K]=l.useState(!1),w=l.useRef(new Set),x=l.useCallback(async()=>{try{const r=(await pe()).rules??[];c(r),g("");const a=new Set;for(const j of r)j.running&&a.add(j.id);const E=[...w.current].filter(j=>!a.has(j));w.current=a,E.length&&x()}catch(s){g(s instanceof Error?s.message:"加载失败")}finally{v(!1)}},[]);l.useEffect(()=>{x(),he().then(r=>F(r.cookies??[])).catch(()=>F([]));const s=setInterval(()=>void x(),Ie);return()=>clearInterval(s)},[x]);const ne=()=>{D(null),d(ee),f(null),b(""),N(""),_(!0)},le=s=>{D(s.id),d(Ae(s)),f(null),b(""),N(""),_(!0)},ie=async()=>{const{input:s,error:r}=se(n);if(!s){b(r??"参数有误");return}Y(!0),b(""),f(null);try{const a=await je({keyword:s.keyword,min_price:s.min_price,max_price:s.max_price,pages:s.pages,cookie_id:s.cookie_id,min_seller_credit:s.min_seller_credit,min_seller_deals:s.min_seller_deals,ai_precise:s.ai_precise});f(a),a.error?b(a.error):a.lowest||b("没搜到符合条件的商品,换个关键词或放宽价格区间试试")}catch(a){b(a instanceof Error?a.message:"试搜失败")}finally{Y(!1)}},ce=async()=>{const{input:s,error:r}=se(n);if(!s){N(r??"参数有误");return}H(!0),N("");try{y===null?await ge(s):await U(y,s),_(!1),i({type:"info",message:y===null?"规则已创建,可以立即检查一次":"规则已保存"}),await x()}catch(a){N(a instanceof Error?a.message:"保存失败")}finally{H(!1)}},de=async s=>{w.current.add(s.id),i(null);try{const r=await ve(s.id);if(!r.started)i({type:"info",message:r.message??"任务未启动"});else if(r.record){const a=r.record.lowest_price;a==null?i({type:"warning",message:`「${s.name}」没搜到可比价的商品(已记录一次空结果)`}):r.notified?i({type:"success",message:`已找到最低价 ${p(a)},通知已发送(${r.notify_reason||"命中"})`}):i({type:"info",message:`本次最低价 ${p(a)}(${r.notify_reason||"未触发通知"})`}),r.notify_error&&i({type:"error",message:`通知发送失败:${r.notify_error}`})}}catch(r){i({type:"error",message:r instanceof Error?r.message:"检查失败"})}finally{w.current.delete(s.id),await x()}},oe=async s=>{try{await U(s.id,{name:s.name,keyword:s.keyword,min_price:s.min_price,max_price:s.max_price,target_price:s.target_price,interval_minutes:s.interval_minutes,pages:s.pages,enabled:!s.enabled,cookie_id:s.cookie_id,min_seller_credit:s.min_seller_credit,min_seller_deals:s.min_seller_deals,ai_precise:s.ai_precise}),i({type:"success",message:s.enablLine truncated
*/const Ee=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Re=C("pause",Ee),Ie=2500,p=t=>t==null?"—":`¥${Number(t).toLocaleString("zh-CN",{maximumFractionDigits:2})}`,L=()=>Math.floor(Date.now()/1e3),F=t=>{if(!t||t<=0)return"—";const c=Math.floor(t);return c<60?`${c} 秒前`:c<3600?`${Math.floor(c/60)} 分钟前`:c<86400?`${Math.floor(c/3600)} 小时前`:`${Math.floor(c/86400)} 天前`},Le=t=>t==null||t<0?"已停用":t<60?`${Math.max(0,Math.round(t))} 秒后`:t<3600?`${Math.floor(t/60)} 分钟后`:`${Math.floor(t/3600)} 小时后`,k=t=>{const c=t.trim();if(c==="")return null;const h=Number(c);return Number.isFinite(h)&&h>=0?h:null},ee={name:"",keyword:"",min_price:"",max_price:"",target_price:"",interval_minutes:"30",pages:"2",enabled:!0,cookie_id:"",min_seller_credit:"",min_seller_deals:"",ai_precise:!1},Fe=t=>({name:t.name,keyword:t.keyword,min_price:t.min_price===null?"":String(t.min_price),max_price:t.max_price===null?"":String(t.max_price),target_price:t.target_price===null?"":String(t.target_price),interval_minutes:String(t.interval_minutes),pages:String(t.pages||2),enabled:t.enabled!==!1,cookie_id:t.cookie_id||"",min_seller_credit:t.min_seller_credit||"",min_seller_deals:t.min_seller_deals!=null?String(t.min_seller_deals):"",ai_precise:!!t.ai_precise}),se=t=>{const c=t.keyword.trim();if(!c)return{input:null,error:"请填写搜索关键词"};const h=t.name.trim()||c,v=k(t.min_price),m=k(t.max_price);if(v!==null&&m!==null&&v>m)return{input:null,error:"最低价不能大于最高价"};const g=k(t.target_price);if(g!==null&&m!==null&&g>m)return{input:null,error:"目标价不能高于最高价"};const u=Number(t.interval_minutes);if(!Number.isFinite(u)||u<5)return{input:null,error:"检查间隔至少 5 分钟"};const i=Number(t.pages);return!Number.isFinite(i)||i<1||i>5?{input:null,error:"每轮页数取 1~5"}:{input:{name:h,keyword:c,min_price:v,max_price:m,target_price:g,interval_minutes:Math.round(u),pages:Math.round(i),enabled:t.enabled,cookie_id:t.cookie_id||null,min_seller_credit:t.min_seller_credit||null,min_seller_deals:k(t.min_seller_deals),ai_precise:t.ai_precise}}};function ze(){const[t,c]=l.useState([]),[h,v]=l.useState(!0),[m,g]=l.useState(""),[u,i]=l.useState(null),[te,A]=l.useState([]),[ae,_]=l.useState(!1),[y,D]=l.useState(null),[n,d]=l.useState(ee),[T,H]=l.useState(!1),[O,N]=l.useState(""),[S,Y]=l.useState(!1),[o,f]=l.useState(null),[B,b]=l.useState(""),[$,z]=l.useState(null),[G,P]=l.useState([]),[re,K]=l.useState(!1),w=l.useRef(new Set),x=l.useCallback(async()=>{try{const r=(await pe()).rules??[];c(r),g("");const a=new Set;for(const j of r)j.running&&a.add(j.id);const M=[...w.current].filter(j=>!a.has(j));w.current=a,M.length&&x()}catch(s){g(s instanceof Error?s.message:"加载失败")}finally{v(!1)}},[]);l.useEffect(()=>{x(),he().then(r=>A(r.cookies??[])).catch(()=>A([]));const s=setInterval(()=>void x(),Ie);return()=>clearInterval(s)},[x]);const ne=()=>{D(null),d(ee),f(null),b(""),N(""),_(!0)},le=s=>{D(s.id),d(Fe(s)),f(null),b(""),N(""),_(!0)},ie=async()=>{const{input:s,error:r}=se(n);if(!s){b(r??"参数有误");return}Y(!0),b(""),f(null);try{const a=await je({keyword:s.keyword,min_price:s.min_price,max_price:s.max_price,pages:s.pages,cookie_id:s.cookie_id,min_seller_credit:s.min_seller_credit,min_seller_deals:s.min_seller_deals,ai_precise:s.ai_precise});f(a),a.error?b(a.error):a.lowest||b("没搜到符合条件的商品,换个关键词或放宽价格区间试试")}catch(a){b(a instanceof Error?a.message:"试搜失败")}finally{Y(!1)}},ce=async()=>{const{input:s,error:r}=se(n);if(!s){N(r??"参数有误");return}H(!0),N("");try{y===null?await ge(s):await Z(y,s),_(!1),i({type:"info",message:y===null?"规则已创建,可以立即检查一次":"规则已保存"}),await x()}catch(a){N(a instanceof Error?a.message:"保存失败")}finally{H(!1)}},de=async s=>{w.current.add(s.id),i(null);try{const r=await ve(s.id);if(!r.started)i({type:"info",message:r.message??"任务未启动"});else if(r.record){const a=r.record.lowest_price;a==null?i({type:"warning",message:`「${s.name}」没搜到可比价的商品(已记录一次空结果)`}):r.notified?i({type:"success",message:`已找到最低价 ${p(a)},通知已发送(${r.notify_reason||"命中"})`}):i({type:"info",message:`本次最低价 ${p(a)}(${r.notify_reason||"未触发通知"})`}),r.notify_error&&i({type:"error",message:`通知发送失败:${r.notify_error}`})}}catch(r){i({type:"error",message:r instanceof Error?r.message:"检查失败"})}finally{w.current.delete(s.id),await x()}},oe=async s=>{try{await Z(s.id,{name:s.name,keyword:s.keyword,min_price:s.min_price,max_price:s.max_price,target_price:s.target_price,interval_minutes:s.interval_minutes,pages:s.pages,enabled:!s.enabled,cookie_id:s.cookie_id,min_seller_credit:s.min_seller_credit,min_seller_deals:s.min_seller_deals,ai_precise:s.ai_precise}),i({type:"success",message:s.enablLine truncated
@@ -1,4 +1,4 @@
import{c as H,r as c,j as e,aA as J,e as ye,S as ge,E as be,L as j,aB as je,aC as _e,aD as Ne,aE as ve,X as O,o as fe,aF as we,aG as ke,aH as Ce,aI as U,n as r,v as E,aJ as $e,aK as Se,aL as Pe,aM as De,aN as Re,aO as Fe,aP as Me,aQ as Le}from"./index-HJMc2HxZ.js";import{P as Ie,a as Ae,b as Ee,S as _,E as N,N as ze}from"./ui-vFagDj8B.js";import{S as C}from"./search-DGiuF6uC.js";import{T as v}from"./trash-2-Du5uC3X5.js";import{S as z}from"./save-qf4Q-Bil.js";import{P as X}from"./play-zVF2f9jg.js";import{P as Te}from"./package-check-DzDzt8rk.js";import{L as Be}from"./link-2-C9fPZMxa.js";/**
import{c as H,r as c,j as e,aB as J,e as ye,S as ge,E as be,L as j,aC as je,aD as _e,aE as Ne,aF as ve,X as O,o as fe,aG as we,aH as ke,aI as Ce,aJ as U,n as r,v as E,aK as $e,aL as Se,aM as Pe,aN as De,aO as Re,aP as Fe,aQ as Me,aR as Le}from"./index-DsODdDMf.js";import{P as Ie,a as Ae,b as Ee,S as _,E as N,N as ze}from"./ui-CQHd7VNo.js";import{S as C}from"./search-sxbkAeV0.js";import{T as v}from"./trash-2-CvZQL5SJ.js";import{S as z}from"./save-1bfmWlQj.js";import{P as X}from"./play-DS4dwZmR.js";import{P as Te}from"./package-check-DMYEV4p7.js";import{L as Be}from"./link-2-DPJwJ3Cv.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
-6
View File
@@ -1,6 +0,0 @@
import{c as Fe,r,o as Ee,j as e,bG as le,L as g,b as Re,X as ie,E as Ae,bH as $e,bI as Ue,bJ as qe,bK as De,bL as Me,bM as Te}from"./index-HJMc2HxZ.js";import{a as ze,N as Be,b as He,E as ne}from"./ui-vFagDj8B.js";import{S as F}from"./search-DGiuF6uC.js";import{P as Oe}from"./plus-CpIZThgs.js";import{S as Ke}from"./sparkles-Da7ZNkrd.js";import{P as We}from"./package-BcCU6KLb.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ge=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],E=Fe("heart",Ge),Je=["包邮","无需邮寄","一口价","按距离计费"],z=d=>d.url?d.url:!d.item_id||d.item_id.startsWith("mock_")?"":`https://www.goofish.com/item?id=${d.item_id}`,ce=d=>new Promise(k=>{const n=new Image;n.onload=()=>k({width:n.naturalWidth||1e3,height:n.naturalHeight||1e3}),n.onerror=()=>k(null),n.src=d}),oe={title:"",price:"",desc:"",delivery:"包邮",postPrice:"0",quantity:"1"},ss=()=>{const[d,k]=r.useState([]),[n,B]=r.useState(""),[y,de]=r.useState("favorites"),[R,a]=r.useState(null),[S,me]=r.useState([]),[xe,ue]=r.useState(1),[pe,he]=r.useState(!1),[f,H]=r.useState(!1),[j,ge]=r.useState(!1),[_,fe]=r.useState(""),[O,be]=r.useState([]),[A,K]=r.useState(!1),[W,ye]=r.useState(!1),[x,G]=r.useState(null),[h,$]=r.useState(null),[J,V]=r.useState(!1),[c,u]=r.useState(oe),[I,X]=r.useState(!1),[C,U]=r.useState(""),[p,b]=r.useState([]),[Y,q]=r.useState(""),[je,D]=r.useState(!1),[v,L]=r.useState(!1),N=r.useRef(null),M=r.useRef(null),[Q,Z]=r.useState([]),[P,ee]=r.useState(!1),ve=r.useMemo(()=>new Map(d.map(s=>[s.id,s.nickname||s.remark||`账号 ${s.id.substring(0,6)}`])),[d]);r.useEffect(()=>{Ee().then(s=>{const t=s.filter(i=>i.enabled),l=t.length>0?t:s;k(l),B(i=>{var o;return i||((o=l[0])==null?void 0:o.id)||""})}).catch(()=>a({type:"error",message:"账号列表加载失败"}))},[]);const T=async(s=1)=>{if(!n){a({type:"error",message:"请先选择账号"});return}H(!0),a(null);try{const t=await $e(n,s,20),l=t.items||[];me(i=>s===1?l:[...i,...l]),he(!!t.next_page),ue(s),ge(!0),l.length===0&&s===1&&a({type:"error",message:"该账号没有可转卖的有效收藏"})}catch(t){a({type:"error",message:t instanceof Error?t.message:"收藏列表加载失败"})}finally{H(!1)}},se=r.useRef(!1);r.useEffect(()=>{!n||y!=="favorites"||j||f||se.current||(se.current=!0,T(1))},[n,y,j,f]);const te=async()=>{if(!n){a({type:"error",message:"请先选择账号"});return}if(!_.trim()){a({type:"error",message:"请输入搜索关键词"});return}K(!0),a(null);try{const s=await Ue(n,_.trim());be(s.items||[]),ye(!0),(s.items||[]).length===0&&a({type:"error",message:`没有搜到「${_.trim()}」相关商品`})}catch(s){a({type:"error",message:s instanceof Error?s.message:"搜索失败"})}finally{K(!1)}},Ne=s=>{if(p.length<=1){a({type:"error",message:"至少保留一张图片"});return}b(t=>t.filter((l,i)=>i!==s))},we=s=>{s<=0||b(t=>{const l=[...t],[i]=l.splice(s,1);return[i,...l]})},ke=async()=>{const s=Y.trim();if(!v){if(!/^https?:\/\//.test(s)){a({type:"error",message:"请输入以 http(s):// 开头的图片地址"});return}if(p.length>=9){a({type:"error",message:"最多 9 张图片"});return}L(!0);try{const t=await ce(s);if(!t){a({type:"error",message:"该图片地址无法加载(可能防盗链或已失效)"});return}b(l=>[...l,{url:s,...t}].slice(0,9)),q(""),D(!1),a({type:"success",message:"已添加图片"})}finally{L(!1)}}},Se=async(s,t)=>{if(!s||!s.length)return;const l=s[0];L(!0);try{const i=await qe(l),o=new URL(i.path,window.location.origin).href,w=await ce(o);if(!w){a({type:"error",message:"图片上传后无法加载,请重试"});return}if(t!=null)b(m=>m.map((Le,Pe)=>Pe===t?{url:o,...w}:Le)),a({type:"success",message:"图片已替换"});else{if(p.length>=9){a({type:"error",message:"最多 9 张图片"});return}b(m=>[...m,{url:o,...w}].slice(0,9)),a({type:"success",message:"图片已添加"})}/^(https?:\/\/)?(localhost|127\.0\.0\.1|192\.168\.)/.test(window.location.origin)&&a({type:"error",message:"当前访问地址非公网,闲鱼可能无法拉取上传的图片,建议通过公网域名操作"})}catch(i){a({type:"error",message:i instanceof Error?i.message:"图片上传失败"})}finally{L(!1),N.current&&(N.current.value=""),M.current=null}},_e=async()=>{if(!(!x||!n||P)){ee(!0);try{const s=await De({cookie_id:n,title:c.title,description:c.desc});if(!s.success){a({type:"error",message:s.message||"AI 优化失败,请重试"});return}const t=s.titles||[];Z(t),s.description&&s.description!==c.desc&&u(l=>({...l,desc:s.description})),a({type:"success",message:t.length?`AI 已生成 ${t.length} 个候选标题(点击选用),描述已同步优化`:"描述已优化"})}catch(s){a({type:"error",message:s instanceof Error?s.message:"AI 优化失败"})}finally{ee(!1)}}},Ie=async s=>{var t,l;if(!n){a({type:"error",message:"请先选择账号"});return}G(s),$(null),U(""),Z([]),D(!1),q(""),b((t=s.images)!=null&&t.length?s.images.map(i=>({url:i,width:1e3,height:1e3})):s.image?[{url:s.image,width:1e3,height:1e3}]:[]),u({...oe,title:s.title||"",price:(s.price||"").replace(/[^\d.]/g,"")}),V(!0);try{const o=(await Te({cookie_id:n,item_id:s.item_id})).item;$(o),(l=o.images)!=null&&l.length&&b(o.images.map(m=>({url:m.url,width:m.width||1e3,height:m.height||1e3})));const w=o.price!=null?String(o.price):"";u(m=>({...m,title Line truncated
+6
View File
@@ -0,0 +1,6 @@
import{c as ze,r,o as Be,j as e,bH as he,L as p,b as Ke,X as pe,E as He,bI as We,bJ as Je,bK as Ve,bL as Xe,bM as Ye,bN as Ge,bO as Qe}from"./index-DsODdDMf.js";import{a as Ze,N as et,b as tt,E as ge}from"./ui-CQHd7VNo.js";import{S as A}from"./search-sxbkAeV0.js";import{P as st}from"./plus-fhLljyPf.js";import{S as at}from"./sparkles-CRcwNwKo.js";import{P as rt}from"./package-C5umlMc4.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lt=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],U=ze("heart",lt),it=["包邮","无需邮寄","一口价","按距离计费"],W=d=>d.url?d.url:!d.item_id||d.item_id.startsWith("mock_")?"":`https://www.goofish.com/item?id=${d.item_id}`,fe=d=>new Promise(g=>{const c=new Image;c.onload=()=>g({width:c.naturalWidth||1e3,height:c.naturalHeight||1e3}),c.onerror=()=>g(null),c.src=d}),be={title:"",price:"",desc:"",delivery:"包邮",postPrice:"0",quantity:"1",cat:null},nt=d=>{const g=d.cat||{},c=String(g.catId??""),j=String(g.channelCatId??"");return!c||!j?null:{cat_id:c,channel_cat_id:j,tb_cat_id:String(g.tbCatId??""),cat_name:d.cat_name||""}},ht=()=>{var ue;const[d,g]=r.useState([]),[c,j]=r.useState(""),[N,ye]=r.useState("favorites"),[q,l]=r.useState(null),[S,je]=r.useState([]),[Ne,ve]=r.useState(1),[we,_e]=r.useState(!1),[f,J]=r.useState(!1),[v,ke]=r.useState(!1),[C,Se]=r.useState(""),[V,Ce]=r.useState([]),[D,X]=r.useState(!1),[Y,Ie]=r.useState(!1),[u,G]=r.useState(null),[b,M]=r.useState(null),[Q,Z]=r.useState(!1),[i,m]=r.useState(be),[I,ee]=r.useState(!1),[L,O]=r.useState(""),[h,y]=r.useState([]),[te,T]=r.useState(""),[Le,z]=r.useState(!1),[w,P]=r.useState(!1),_=r.useRef(null),B=r.useRef(null),[se,ae]=r.useState([]),[F,re]=r.useState(!1),[$,le]=r.useState([]),[Pe,ie]=r.useState(!1),[ne,E]=r.useState(!1),[K,R]=r.useState(""),Fe=r.useMemo(()=>new Map(d.map(t=>[t.id,t.nickname||t.remark||`账号 ${t.id.substring(0,6)}`])),[d]),ce=r.useMemo(()=>{const t=K.trim().toLowerCase();return t?$.filter(s=>s.cat_name.toLowerCase().includes(t)):$},[$,K]);r.useEffect(()=>{Be().then(t=>{const s=t.filter(n=>n.enabled),a=s.length>0?s:t;g(a),j(n=>{var o;return n||((o=a[0])==null?void 0:o.id)||""})}).catch(()=>l({type:"error",message:"账号列表加载失败"}))},[]);const H=async(t=1)=>{if(!c){l({type:"error",message:"请先选择账号"});return}J(!0),l(null);try{const s=await We(c,t,20),a=s.items||[];je(n=>t===1?a:[...n,...a]),_e(!!s.next_page),ve(t),ke(!0),a.length===0&&t===1&&l({type:"error",message:"该账号没有可转卖的有效收藏"})}catch(s){l({type:"error",message:s instanceof Error?s.message:"收藏列表加载失败"})}finally{J(!1)}},oe=r.useRef(!1);r.useEffect(()=>{!c||N!=="favorites"||v||f||oe.current||(oe.current=!0,H(1))},[c,N,v,f]);const de=async()=>{if(!c){l({type:"error",message:"请先选择账号"});return}if(!C.trim()){l({type:"error",message:"请输入搜索关键词"});return}X(!0),l(null);try{const t=await Je(c,C.trim());Ce(t.items||[]),Ie(!0),(t.items||[]).length===0&&l({type:"error",message:`没有搜到「${C.trim()}」相关商品`})}catch(t){l({type:"error",message:t instanceof Error?t.message:"搜索失败"})}finally{X(!1)}},$e=t=>{if(h.length<=1){l({type:"error",message:"至少保留一张图片"});return}y(s=>s.filter((a,n)=>n!==t))},Ee=t=>{t<=0||y(s=>{const a=[...s],[n]=a.splice(t,1);return[n,...a]})},Re=async()=>{const t=te.trim();if(!w){if(!/^https?:\/\//.test(t)){l({type:"error",message:"请输入以 http(s):// 开头的图片地址"});return}if(h.length>=9){l({type:"error",message:"最多 9 张图片"});return}P(!0);try{const s=await fe(t);if(!s){l({type:"error",message:"该图片地址无法加载(可能防盗链或已失效)"});return}y(a=>[...a,{url:t,...s}].slice(0,9)),T(""),z(!1),l({type:"success",message:"已添加图片"})}finally{P(!1)}}},Ae=async(t,s)=>{if(!t||!t.length)return;const a=t[0];P(!0);try{const n=await Ve(a),o=new URL(n.path,window.location.origin).href,k=await fe(o);if(!k){l({type:"error",message:"图片上传后无法加载,请重试"});return}if(s!=null)y(x=>x.map((Oe,Te)=>Te===s?{url:o,...k}:Oe)),l({type:"success",message:"图片已替换"});else{if(h.length>=9){l({type:"error",message:"最多 9 张图片"});return}y(x=>[...x,{url:o,...k}].slice(0,9)),l({type:"success",message:"图片已添加"})}/^(https?:\/\/)?(localhost|127\.0\.0\.1|192\.168\.)/.test(window.location.origin)&&l({type:"error",message:"当前访问地址非公网,闲鱼可能无法拉取上传的图片,建议通过公网域名操作"})}catch(n){l({type:"error",message:n instanceof Error?n.message:"图片上传失败"})}finally{P(!1),_.current&&(_.current.value=""),B.current=null}},Ue=async()=>{if(!(!u||!c||F)){re(!0);try{const t=await Xe({cookie_id:c,title:i.title,description:i.desc});if(!t.success){l({type:"error",message:t.message||"AI 优化失败,请重试"});return}const s=t.titles||[];ae(s),t.description&&t.description!==i.desc&&m(a=>({...a,desc:t.description})),l({type:"success",message:s.length?`AI 已生成 ${s.length} 个候选标题(点击选用),描述已同步优化`:"描述已优化"})}catch(t){l({type:"error",message:t instanceof Error?t.message:"AI 优化失败"})}finally{re(!1)}}},qe=async(t,s)=>{ie(!0);try{const a=await Qe({cookie_id:c,item_id:t,title:s||""});le(a.options||[]);const n=a.current;n!=null&&n.cat_id&&(n!=null& Line truncated
@@ -1,4 +1,4 @@
import{c as se,r as l,aS as ae,j as e,l as te,e as K,aT as ne,aU as v,aV as q,S as le,ak as O,aW as ie,aX as re,n as c,aY as ce,aZ as oe,a_ as de,a$ as pe,b0 as me,b1 as ue}from"./index-HJMc2HxZ.js";import{P as xe,a as he,b as ge,S as p,N as ye}from"./ui-vFagDj8B.js";import{S as je}from"./save-qf4Q-Bil.js";import{S as Q}from"./sparkles-Da7ZNkrd.js";import{Z as L}from"./zap-BhFCoS6N.js";import{E as w}from"./eye-off-VWv0mxs9.js";import{E as C}from"./eye-D3neYBSg.js";/**
import{c as se,r as l,aT as ae,j as e,l as te,e as K,aU as ne,aV as v,aW as q,S as le,ak as O,aX as ie,aY as re,n as c,aZ as ce,a_ as oe,a$ as de,b0 as pe,b1 as me,b2 as ue}from"./index-DsODdDMf.js";import{P as xe,a as he,b as ge,S as p,N as ye}from"./ui-CQHd7VNo.js";import{S as je}from"./save-1bfmWlQj.js";import{S as Q}from"./sparkles-CRcwNwKo.js";import{Z as L}from"./zap-T1zC1hkQ.js";import{E as w}from"./eye-off-BivEoqlz.js";import{E as C}from"./eye-DqWY05EP.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1 +1 @@
import{r as l,j as e,U as h,e as $,S as j,aT as A,L as f,ak as T,bz as L,n as i,v as y,bA as P,bB as R,aY as E,bC as _}from"./index-HJMc2HxZ.js";import{a as I,S as N,E as B}from"./ui-vFagDj8B.js";import{T as z}from"./trash-2-Du5uC3X5.js";const D=n=>{if(!n)return"-";const c=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(c.getTime())?n:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Y=()=>{const[n,c]=l.useState([]),[u,g]=l.useState(!0),[o,d]=l.useState(null),[w,p]=l.useState(null),[b,m]=l.useState(""),x=async()=>{g(!0);try{c(await L())}catch(t){i(`加载用户列表失败:${t.message}`,"error")}finally{g(!1)}};l.useEffect(()=>{x()},[]);const U=async t=>{if(o!==null)return;const s=t.is_active!==!1;if(!(s&&!await y(`禁用用户「${t.username}」?其所有在线会话将立即下线,且无法再登录。`,{title:"禁用用户",confirmLabel:"禁用",danger:!0}))){d(t.id);try{const a=await P(t.id,!s);i(a.message||"状态已更新","success"),await x()}catch(a){i(`操作失败:${a.message}`,"error")}finally{d(null)}}},C=async t=>{const[s,a]=E(b);if(!s){i(a,"warning");return}if(o===null){d(t.id);try{const r=await _(t.id,b);i(r.message||"密码已重置","success"),p(null),m("")}catch(r){i(`重置失败:${r.message}`,"error")}finally{d(null)}}},k=async t=>{if(o===null&&await y(`删除用户「${t.username}」?其名下的闲鱼账号、卡密、回复规则等数据将一并删除,不可恢复。`,{title:"删除用户",confirmLabel:"删除",danger:!0})){d(t.id);try{const s=await R(t.id);i(s.message||"用户已删除","success"),await x()}catch(s){i(`删除失败:${s.message}`,"error")}finally{d(null)}}};return e.jsxs("div",{className:"page-stack",children:[e.jsx(I,{title:"用户管理",description:"管理注册用户与登录权限。普通用户仅能操作分配给其名下的账号数据。",icon:h,actions:e.jsxs("button",{type:"button",onClick:()=>void x(),className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx($,{className:`h-4 w-4 ${u?"animate-spin":""}`}),"刷新"]})}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"权限说明",icon:j}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(j,{className:"h-4 w-4 text-[#8a6300]"}),"管理员(admin)"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"拥有全部权限:系统设置、通知与系统日志、用户管理,以及所有闲鱼账号和数据。"})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(A,{className:"h-4 w-4 text-[var(--text-soft)]"}),"普通用户"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"只能看到并操作自己名下的闲鱼账号、商品、订单与消息;侧栏不显示系统设置与用户管理,接口层也会拒绝其访问。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"用户列表",description:`共 ${n.length} 个用户`,icon:h}),e.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[n.map(t=>{const s=t.username==="admin",a=t.is_active===!1,r=o===t.id,v=w===t.id;return e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[var(--brand)] text-sm font-black text-[#2a2416]",children:t.username.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm font-bold text-[var(--text)]",children:t.username}),s&&e.jsx("span",{className:"rounded-full bg-[var(--brand)] px-2 py-0.5 text-[10px] font-bold text-[#2a2416]",children:"内置管理员"}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-bold ${a?"bg-red-50 text-red-600":"bg-emerald-50 text-emerald-600"}`,children:a?"已禁用":"正常"})]}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:t.email}),e.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-soft)]",children:[t.cookie_count??0," 个闲鱼账号 · ",t.card_count??0," 张卡密 · 注册于 ",D(t.created_at)]})]}),!s&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void U(t),disabled:r,className:a?"rounded-md bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-700 hover:bg-emerald-100 disabled:opacity-50":"rounded-md bg-amber-50 px-3 py-2 text-xs font-bolLine truncated
import{r as l,j as e,U as h,e as $,S as j,aU as A,L as f,ak as L,bA as P,n as i,v as y,bB as R,bC as T,aZ as E,bD as _}from"./index-DsODdDMf.js";import{a as I,S as N,E as B}from"./ui-CQHd7VNo.js";import{T as D}from"./trash-2-CvZQL5SJ.js";const H=n=>{if(!n)return"-";const c=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(c.getTime())?n:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},M=()=>{const[n,c]=l.useState([]),[u,g]=l.useState(!0),[o,d]=l.useState(null),[w,p]=l.useState(null),[b,m]=l.useState(""),x=async()=>{g(!0);try{c(await P())}catch(t){i(`加载用户列表失败:${t.message}`,"error")}finally{g(!1)}};l.useEffect(()=>{x()},[]);const U=async t=>{if(o!==null)return;const s=t.is_active!==!1;if(!(s&&!await y(`禁用用户「${t.username}」?其所有在线会话将立即下线,且无法再登录。`,{title:"禁用用户",confirmLabel:"禁用",danger:!0}))){d(t.id);try{const a=await R(t.id,!s);i(a.message||"状态已更新","success"),await x()}catch(a){i(`操作失败:${a.message}`,"error")}finally{d(null)}}},C=async t=>{const[s,a]=E(b);if(!s){i(a,"warning");return}if(o===null){d(t.id);try{const r=await _(t.id,b);i(r.message||"密码已重置","success"),p(null),m("")}catch(r){i(`重置失败:${r.message}`,"error")}finally{d(null)}}},k=async t=>{if(o===null&&await y(`删除用户「${t.username}」?其名下的闲鱼账号、卡密、回复规则等数据将一并删除,不可恢复。`,{title:"删除用户",confirmLabel:"删除",danger:!0})){d(t.id);try{const s=await T(t.id);i(s.message||"用户已删除","success"),await x()}catch(s){i(`删除失败:${s.message}`,"error")}finally{d(null)}}};return e.jsxs("div",{className:"page-stack",children:[e.jsx(I,{title:"用户管理",description:"管理注册用户与登录权限。普通用户仅能操作分配给其名下的账号数据。",icon:h,actions:e.jsxs("button",{type:"button",onClick:()=>void x(),className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx($,{className:`h-4 w-4 ${u?"animate-spin":""}`}),"刷新"]})}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"权限说明",icon:j}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(j,{className:"h-4 w-4 text-[#8a6300]"}),"管理员(admin)"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"拥有全部权限:系统设置、通知与系统日志、用户管理,以及所有闲鱼账号和数据。"})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(A,{className:"h-4 w-4 text-[var(--text-soft)]"}),"普通用户"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"只能看到并操作自己名下的闲鱼账号、商品、订单与消息;侧栏不显示系统设置与用户管理,接口层也会拒绝其访问。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"用户列表",description:`共 ${n.length} 个用户`,icon:h}),e.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[n.map(t=>{const s=t.username==="admin",a=t.is_active===!1,r=o===t.id,v=w===t.id;return e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[var(--brand)] text-sm font-black text-[#2a2416]",children:t.username.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm font-bold text-[var(--text)]",children:t.username}),s&&e.jsx("span",{className:"rounded-full bg-[var(--brand)] px-2 py-0.5 text-[10px] font-bold text-[#2a2416]",children:"内置管理员"}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-bold ${a?"bg-red-50 text-red-600":"bg-emerald-50 text-emerald-600"}`,children:a?"已禁用":"正常"})]}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:t.email}),e.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-soft)]",children:[t.cookie_count??0," 个闲鱼账号 · ",t.card_count??0," 张卡密 · 注册于 ",H(t.created_at)]})]}),!s&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void U(t),disabled:r,className:a?"rounded-md bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-700 hover:bg-emerald-100 disabled:opacity-50":"rounded-md bg-amber-50 px-3 py-2 text-xs font-bolLine truncated
@@ -1,4 +1,4 @@
import{c as t}from"./index-HJMc2HxZ.js";/**
import{c as t}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-HJMc2HxZ.js";/**
import{c}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as o}from"./index-HJMc2HxZ.js";/**
import{c as o}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-HJMc2HxZ.js";/**
import{c}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-HJMc2HxZ.js";/**
import{c}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
+1
View File
@@ -0,0 +1 @@
*,: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:rgb(var(--gray-200) / 1)}: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:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family: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:rgb(var(--gray-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}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}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relativeLine truncated
@@ -1,5 +1,5 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard--FxtSSVv.js","assets/ui-vFagDj8B.js","assets/package-BcCU6KLb.js","assets/trending-up-jQPihqZY.js","assets/activity-DNyIqxl-.js","assets/package-check-DzDzt8rk.js","assets/AccountList-BjdLqO36.js","assets/check-BsSr22q3.js","assets/sparkles-Da7ZNkrd.js","assets/power-CG9iERWF.js","assets/trash-2-Du5uC3X5.js","assets/key-Y7KCy9_1.js","assets/eye-off-VWv0mxs9.js","assets/eye-D3neYBSg.js","assets/save-qf4Q-Bil.js","assets/OrderList-B1BJSvV-.js","assets/plus-CpIZThgs.js","assets/truck-A9ZYOrzg.js","assets/search-DGiuF6uC.js","assets/flower-2-Bz3yOpyy.js","assets/square-pen-D5BwtKk7.js","assets/chevron-right-C_49FSiS.js","assets/CardList-m7fC7-tJ.js","assets/image-CqoWw8ci.js","assets/ItemList-Dbu6O3MZ.js","assets/shield-alert-fp78nSHa.js","assets/power-off-C7ZUVUtb.js","assets/settings-2-CNr5zc9p.js","assets/ProductAutomation-Ci49gkR0.js","assets/play-zVF2f9jg.js","assets/link-2-C9fPZMxa.js","assets/AIReply-CcwkuhBE.js","assets/message-square-text-CP89w054.js","assets/Settings-DL3TklaA.js","assets/zap-BhFCoS6N.js","assets/Keywords-CRMjpP8g.js","assets/MessageManagement-fe23Nnk-.js","assets/send-D67RiJNt.js","assets/NotificationsAndLogs-DzbKb1ro.js","assets/pen-line-BWqAQUqr.js","assets/UserManagement-BrqXqVxZ.js","assets/About-dsF7zD1m.js","assets/BuyerInteraction-BmDULHxP.js","assets/Resell-BW7BkIC8.js","assets/HotList-Ckzmv_3V.js","assets/PeerShops-Cfn8grUO.js","assets/PriceWatch-BjwtLnnv.js"])))=>i.map(i=>d[i]);
function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&&!Array.isArray(r)){for(const f in r)if(f!=="default"&&!(f in l)){const m=Object.getOwnPropertyDescriptor(r,f);m&&Object.defineProperty(l,f,m.get?m:{enumerable:!0,get:()=>r[f]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const y of m.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&r(y)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function r(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();function hh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Pc={exports:{}},lu={};/**
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-BwyP74XQ.js","assets/ui-CQHd7VNo.js","assets/package-C5umlMc4.js","assets/trending-up-2bhyfwOI.js","assets/activity-C3vSFSwT.js","assets/package-check-DMYEV4p7.js","assets/AccountList-rd9ol5A3.js","assets/check-D0r7RhTo.js","assets/sparkles-CRcwNwKo.js","assets/power-BffuaJ6g.js","assets/trash-2-CvZQL5SJ.js","assets/key-B7TfiDhV.js","assets/eye-off-BivEoqlz.js","assets/eye-DqWY05EP.js","assets/save-1bfmWlQj.js","assets/OrderList-UNGYTnVo.js","assets/plus-fhLljyPf.js","assets/truck-BWE0A9OO.js","assets/search-sxbkAeV0.js","assets/flower-2-Qv1fS9dP.js","assets/square-pen-DR0-XdRq.js","assets/chevron-right-CJ-DrOxg.js","assets/CardList-CEXfmWno.js","assets/image-BPsEsLmt.js","assets/ItemList-Dg9Wv7M0.js","assets/shield-alert-JYWkaAgT.js","assets/power-off-DcIidedg.js","assets/settings-2-C_s9tppi.js","assets/ProductAutomation-DK_ysI0r.js","assets/play-DS4dwZmR.js","assets/link-2-DPJwJ3Cv.js","assets/AIReply-CwxPMo_y.js","assets/message-square-text-SsmtmT8O.js","assets/Settings-BtQEQL92.js","assets/zap-T1zC1hkQ.js","assets/Keywords-Bj3mRqWd.js","assets/MessageManagement-CxE0X0kv.js","assets/send-KQw7ZSlT.js","assets/NotificationsAndLogs-Cuzu5LxK.js","assets/pen-line-lDrHTQ2Z.js","assets/UserManagement-f1XrG4E3.js","assets/About-1p95l6vG.js","assets/BuyerInteraction-DNWEGtID.js","assets/Resell-CUUz7jou.js","assets/HotList-BtLo2o4Z.js","assets/PeerShops-ntZtIie8.js","assets/PriceWatch-CEQpXaBy.js"])))=>i.map(i=>d[i]);
function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&&!Array.isArray(r)){for(const f in r)if(f!=="default"&&!(f in l)){const m=Object.getOwnPropertyDescriptor(r,f);m&&Object.defineProperty(l,f,m.get?m:{enumerable:!0,get:()=>r[f]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function r(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();function hh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Ic={exports:{}},lu={};/**
* @license React
* react-jsx-runtime.production.js
*
@@ -7,7 +7,7 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wm;function Ep(){if(wm)return lu;wm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(r,f,m){var y=null;if(m!==void 0&&(y=""+m),f.key!==void 0&&(y=""+f.key),"key"in f){m={};for(var p in f)p!=="key"&&(m[p]=f[p])}else m=f;return f=m.ref,{$$typeof:l,type:r,key:y,ref:f!==void 0?f:null,props:m}}return lu.Fragment=s,lu.jsx=c,lu.jsxs=c,lu}var zm;function Ap(){return zm||(zm=1,Pc.exports=Ep()),Pc.exports}var h=Ap(),Ic={exports:{}},ce={};/**
*/var wm;function Ep(){if(wm)return lu;wm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(r,f,m){var h=null;if(m!==void 0&&(h=""+m),f.key!==void 0&&(h=""+f.key),"key"in f){m={};for(var p in f)p!=="key"&&(m[p]=f[p])}else m=f;return f=m.ref,{$$typeof:l,type:r,key:h,ref:f!==void 0?f:null,props:m}}return lu.Fragment=s,lu.jsx=c,lu.jsxs=c,lu}var zm;function Ap(){return zm||(zm=1,Ic.exports=Ep()),Ic.exports}var y=Ap(),Pc={exports:{}},ce={};/**
* @license React
* react.production.js
*
@@ -15,7 +15,7 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var jm;function Tp(){if(jm)return ce;jm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),y=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),B=Symbol.iterator;function F(S){return S===null||typeof S!="object"?null:(S=B&&S[B]||S["@@iterator"],typeof S=="function"?S:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,Y={};function M(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}M.prototype.isReactComponent={},M.prototype.setState=function(S,j){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,j,"setState")},M.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function K(){}K.prototype=M.prototype;function Q(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}var ee=Q.prototype=new K;ee.constructor=Q,X(ee,M.prototype),ee.isPureReactComponent=!0;var Ee=Array.isArray;function me(){}var le={H:null,A:null,T:null,S:null},Le=Object.prototype.hasOwnProperty;function ct(S,j,H){var G=H.ref;return{$$typeof:l,type:S,key:j,ref:G!==void 0?G:null,props:H}}function be(S,j){return ct(S.type,j,S.props)}function Ce(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function ke(S){var j={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(H){return j[H]})}var xt=/\/+/g;function He(S,j){return typeof S=="object"&&S!==null&&S.key!=null?ke(""+S.key):j.toString(36)}function Re(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(me,me):(S.status="pending",S.then(function(j){S.status==="pending"&&(S.status="fulfilled",S.value=j)},function(j){S.status==="pending"&&(S.status="rejected",S.reason=j)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function z(S,j,H,G,ue){var Z=typeof S;(Z==="undefined"||Z==="boolean")&&(S=null);var k=!1;if(S===null)k=!0;else switch(Z){case"bigint":case"string":case"number":k=!0;break;case"object":switch(S.$$typeof){case l:case s:k=!0;break;case A:return k=S._init,z(k(S._payload),j,H,G,ue)}}if(k)return ue=ue(S),k=G===""?"."+He(S,0):G,Ee(ue)?(H="",k!=null&&(H=k.replace(xt,"$&/")+"/"),z(ue,j,H,"",function(Za){return Za})):ue!=null&&(Ce(ue)&&(ue=be(ue,H+(ue.key==null||S&&S.key===ue.key?"":(""+ue.key).replace(xt,"$&/")+"/")+k)),j.push(ue)),1;k=0;var ie=G===""?".":G+":";if(Ee(S))for(var Te=0;Te<S.length;Te++)G=S[Te],Z=ie+He(G,Te),k+=z(G,j,H,Z,ue);else if(Te=F(S),typeof Te=="function")for(S=Te.call(S),Te=0;!(G=S.next()).done;)G=G.value,Z=ie+He(G,Te++),k+=z(G,j,H,Z,ue);else if(Z==="object"){if(typeof S.then=="function")return z(Re(S),j,H,G,ue);throw j=String(S),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return k}function L(S,j,H){if(S==null)return S;var G=[],ue=0;return z(S,G,"","",function(Z){return j.call(H,Z,ue++)}),G}function I(S){if(S._status===-1){var j=S._result;j=j(),j.then(function(H){(S._status===0||S._status===-1)&&(S._status=1,S._result=H)},function(H){(S._status===0||S._status===-1)&&(S._status=2,S._result=H)}),S._status===-1&&(S._status=0,S._result=j)}if(S._status===1)return S._result.default;throw S._result}var Se=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},re={map:L,forEach:function(S,j,H){L(S,function(){j.apply(this,arguments)},H)},count:function(S){var j=0;return L(S,function(){j++}),j},toArray:function(S){return L(S,function(j){return j})||[]},only:function(S){if(!Ce(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ce.Activity=N,ce.Children=re,ce.Component=M,ce.Fragment=c,ce.Profiler=f,ce.PureComponent=Q,ce.StrictMode=r,ce.Suspense=v,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=le,ce.__COMPILER_RUNTIME={__proto__:null,c:function(S){return le.H.useMemoCache(S)}},ce.cache=function(S){return function(){return S.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(S,j,H){if(S==null)throw Error("The argumLine truncated
*/var jm;function Tp(){if(jm)return ce;jm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),B=Symbol.iterator;function F(S){return S===null||typeof S!="object"?null:(S=B&&S[B]||S["@@iterator"],typeof S=="function"?S:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,Y={};function C(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}C.prototype.isReactComponent={},C.prototype.setState=function(S,j){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,j,"setState")},C.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function K(){}K.prototype=C.prototype;function Q(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}var te=Q.prototype=new K;te.constructor=Q,X(te,C.prototype),te.isPureReactComponent=!0;var Ee=Array.isArray;function me(){}var le={H:null,A:null,T:null,S:null},Le=Object.prototype.hasOwnProperty;function ct(S,j,H){var G=H.ref;return{$$typeof:l,type:S,key:j,ref:G!==void 0?G:null,props:H}}function be(S,j){return ct(S.type,j,S.props)}function Me(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function ke(S){var j={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(H){return j[H]})}var xt=/\/+/g;function He(S,j){return typeof S=="object"&&S!==null&&S.key!=null?ke(""+S.key):j.toString(36)}function Re(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(me,me):(S.status="pending",S.then(function(j){S.status==="pending"&&(S.status="fulfilled",S.value=j)},function(j){S.status==="pending"&&(S.status="rejected",S.reason=j)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function z(S,j,H,G,ue){var Z=typeof S;(Z==="undefined"||Z==="boolean")&&(S=null);var k=!1;if(S===null)k=!0;else switch(Z){case"bigint":case"string":case"number":k=!0;break;case"object":switch(S.$$typeof){case l:case s:k=!0;break;case A:return k=S._init,z(k(S._payload),j,H,G,ue)}}if(k)return ue=ue(S),k=G===""?"."+He(S,0):G,Ee(ue)?(H="",k!=null&&(H=k.replace(xt,"$&/")+"/"),z(ue,j,H,"",function(Za){return Za})):ue!=null&&(Me(ue)&&(ue=be(ue,H+(ue.key==null||S&&S.key===ue.key?"":(""+ue.key).replace(xt,"$&/")+"/")+k)),j.push(ue)),1;k=0;var ie=G===""?".":G+":";if(Ee(S))for(var Te=0;Te<S.length;Te++)G=S[Te],Z=ie+He(G,Te),k+=z(G,j,H,Z,ue);else if(Te=F(S),typeof Te=="function")for(S=Te.call(S),Te=0;!(G=S.next()).done;)G=G.value,Z=ie+He(G,Te++),k+=z(G,j,H,Z,ue);else if(Z==="object"){if(typeof S.then=="function")return z(Re(S),j,H,G,ue);throw j=String(S),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return k}function L(S,j,H){if(S==null)return S;var G=[],ue=0;return z(S,G,"","",function(Z){return j.call(H,Z,ue++)}),G}function P(S){if(S._status===-1){var j=S._result;j=j(),j.then(function(H){(S._status===0||S._status===-1)&&(S._status=1,S._result=H)},function(H){(S._status===0||S._status===-1)&&(S._status=2,S._result=H)}),S._status===-1&&(S._status=0,S._result=j)}if(S._status===1)return S._result.default;throw S._result}var Se=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},re={map:L,forEach:function(S,j,H){L(S,function(){j.apply(this,arguments)},H)},count:function(S){var j=0;return L(S,function(){j++}),j},toArray:function(S){return L(S,function(j){return j})||[]},only:function(S){if(!Me(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ce.Activity=N,ce.Children=re,ce.Component=C,ce.Fragment=c,ce.Profiler=f,ce.PureComponent=Q,ce.StrictMode=r,ce.Suspense=v,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=le,ce.__COMPILER_RUNTIME={__proto__:null,c:function(S){return le.H.useMemoCache(S)}},ce.cache=function(S){return function(){return S.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(S,j,H){if(S==null)throw Error("The argumLine truncated
* @license React
* scheduler.production.js
*
@@ -23,7 +23,7 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Mm;function Op(){return Mm||(Mm=1,(function(l){function s(z,L){var I=z.length;z.push(L);e:for(;0<I;){var Se=I-1>>>1,re=z[Se];if(0<f(re,L))z[Se]=L,z[I]=re,I=Se;else break e}}function c(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var L=z[0],I=z.pop();if(I!==L){z[0]=I;e:for(var Se=0,re=z.length,S=re>>>1;Se<S;){var j=2*(Se+1)-1,H=z[j],G=j+1,ue=z[G];if(0>f(H,I))G<re&&0>f(ue,H)?(z[Se]=ue,z[G]=I,Se=G):(z[Se]=H,z[j]=I,Se=j);else if(G<re&&0>f(ue,I))z[Se]=ue,z[G]=I,Se=G;else break e}}return L}function f(z,L){var I=z.sortIndex-L.sortIndex;return I!==0?I:z.id-L.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var y=Date,p=y.now();l.unstable_now=function(){return y.now()-p}}var v=[],g=[],A=1,N=null,B=3,F=!1,W=!1,X=!1,Y=!1,M=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function ee(z){for(var L=c(g);L!==null;){if(L.callback===null)r(g);else if(L.startTime<=z)r(g),L.sortIndex=L.expirationTime,s(v,L);else break;L=c(g)}}function Ee(z){if(X=!1,ee(z),!W)if(c(v)!==null)W=!0,me||(me=!0,ke());else{var L=c(g);L!==null&&Re(Ee,L.startTime-z)}}var me=!1,le=-1,Le=5,ct=-1;function be(){return Y?!0:!(l.unstable_now()-ct<Le)}function Ce(){if(Y=!1,me){var z=l.unstable_now();ct=z;var L=!0;try{e:{W=!1,X&&(X=!1,K(le),le=-1),F=!0;var I=B;try{t:{for(ee(z),N=c(v);N!==null&&!(N.expirationTime>z&&be());){var Se=N.callback;if(typeof Se=="function"){N.callback=null,B=N.priorityLevel;var re=Se(N.expirationTime<=z);if(z=l.unstable_now(),typeof re=="function"){N.callback=re,ee(z),L=!0;break t}N===c(v)&&r(v),ee(z)}else r(v);N=c(v)}if(N!==null)L=!0;else{var S=c(g);S!==null&&Re(Ee,S.startTime-z),L=!1}}break e}finally{N=null,B=I,F=!1}L=void 0}}finally{L?ke():me=!1}}}var ke;if(typeof Q=="function")ke=function(){Q(Ce)};else if(typeof MessageChannel<"u"){var xt=new MessageChannel,He=xt.port2;xt.port1.onmessage=Ce,ke=function(){He.postMessage(null)}}else ke=function(){M(Ce,0)};function Re(z,L){le=M(function(){z(l.unstable_now())},L)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Le=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return B},l.unstable_next=function(z){switch(B){case 1:case 2:case 3:var L=3;break;default:L=B}var I=B;B=L;try{return z()}finally{B=I}},l.unstable_requestPaint=function(){Y=!0},l.unstable_runWithPriority=function(z,L){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var I=B;B=z;try{return L()}finally{B=I}},l.unstable_scheduleCallback=function(z,L,I){var Se=l.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Se+I:Se):I=Se,z){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=I+re,z={id:A++,callback:L,priorityLevel:z,startTime:I,expirationTime:re,sortIndex:-1},I>Se?(z.sortIndex=I,s(g,z),c(v)===null&&z===c(g)&&(X?(K(le),le=-1):X=!0,Re(Ee,I-Se))):(z.sortIndex=re,s(v,z),W||F||(W=!0,me||(me=!0,ke()))),z},l.unstable_shouldYield=be,l.unstable_wrapCallback=function(z){var L=B;return function(){var I=B;B=L;try{return z.apply(this,arguments)}finally{B=I}}}})(ar)),ar}var Cm;function Np(){return Cm||(Cm=1,tr.exports=Op()),tr.exports}var nr={exports:{}},rt={};/**
*/var Cm;function Op(){return Cm||(Cm=1,(function(l){function s(z,L){var P=z.length;z.push(L);e:for(;0<P;){var Se=P-1>>>1,re=z[Se];if(0<f(re,L))z[Se]=L,z[P]=re,P=Se;else break e}}function c(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var L=z[0],P=z.pop();if(P!==L){z[0]=P;e:for(var Se=0,re=z.length,S=re>>>1;Se<S;){var j=2*(Se+1)-1,H=z[j],G=j+1,ue=z[G];if(0>f(H,P))G<re&&0>f(ue,H)?(z[Se]=ue,z[G]=P,Se=G):(z[Se]=H,z[j]=P,Se=j);else if(G<re&&0>f(ue,P))z[Se]=ue,z[G]=P,Se=G;else break e}}return L}function f(z,L){var P=z.sortIndex-L.sortIndex;return P!==0?P:z.id-L.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var h=Date,p=h.now();l.unstable_now=function(){return h.now()-p}}var v=[],g=[],A=1,N=null,B=3,F=!1,W=!1,X=!1,Y=!1,C=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function te(z){for(var L=c(g);L!==null;){if(L.callback===null)r(g);else if(L.startTime<=z)r(g),L.sortIndex=L.expirationTime,s(v,L);else break;L=c(g)}}function Ee(z){if(X=!1,te(z),!W)if(c(v)!==null)W=!0,me||(me=!0,ke());else{var L=c(g);L!==null&&Re(Ee,L.startTime-z)}}var me=!1,le=-1,Le=5,ct=-1;function be(){return Y?!0:!(l.unstable_now()-ct<Le)}function Me(){if(Y=!1,me){var z=l.unstable_now();ct=z;var L=!0;try{e:{W=!1,X&&(X=!1,K(le),le=-1),F=!0;var P=B;try{t:{for(te(z),N=c(v);N!==null&&!(N.expirationTime>z&&be());){var Se=N.callback;if(typeof Se=="function"){N.callback=null,B=N.priorityLevel;var re=Se(N.expirationTime<=z);if(z=l.unstable_now(),typeof re=="function"){N.callback=re,te(z),L=!0;break t}N===c(v)&&r(v),te(z)}else r(v);N=c(v)}if(N!==null)L=!0;else{var S=c(g);S!==null&&Re(Ee,S.startTime-z),L=!1}}break e}finally{N=null,B=P,F=!1}L=void 0}}finally{L?ke():me=!1}}}var ke;if(typeof Q=="function")ke=function(){Q(Me)};else if(typeof MessageChannel<"u"){var xt=new MessageChannel,He=xt.port2;xt.port1.onmessage=Me,ke=function(){He.postMessage(null)}}else ke=function(){C(Me,0)};function Re(z,L){le=C(function(){z(l.unstable_now())},L)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Le=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return B},l.unstable_next=function(z){switch(B){case 1:case 2:case 3:var L=3;break;default:L=B}var P=B;B=L;try{return z()}finally{B=P}},l.unstable_requestPaint=function(){Y=!0},l.unstable_runWithPriority=function(z,L){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var P=B;B=z;try{return L()}finally{B=P}},l.unstable_scheduleCallback=function(z,L,P){var Se=l.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?Se+P:Se):P=Se,z){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=P+re,z={id:A++,callback:L,priorityLevel:z,startTime:P,expirationTime:re,sortIndex:-1},P>Se?(z.sortIndex=P,s(g,z),c(v)===null&&z===c(g)&&(X?(K(le),le=-1):X=!0,Re(Ee,P-Se))):(z.sortIndex=re,s(v,z),W||F||(W=!0,me||(me=!0,ke()))),z},l.unstable_shouldYield=be,l.unstable_wrapCallback=function(z){var L=B;return function(){var P=B;B=L;try{return z.apply(this,arguments)}finally{B=P}}}})(ar)),ar}var Mm;function Np(){return Mm||(Mm=1,tr.exports=Op()),tr.exports}var nr={exports:{}},rt={};/**
* @license React
* react-dom.production.js
*
@@ -31,7 +31,7 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Um;function Rp(){if(Um)return rt;Um=1;var l=vr();function s(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var A=2;A<arguments.length;A++)g+="&args[]="+encodeURIComponent(arguments[A])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var r={d:{f:c,r:function(){throw Error(s(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal");function m(v,g,A){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:v,containerInfo:g,implementation:A}}var y=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rt.createPortal=function(v,g){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(s(299));return m(v,g,null,A)},rt.flushSync=function(v){var g=y.T,A=r.p;try{if(y.T=null,r.p=2,v)return v()}finally{y.T=g,r.p=A,r.d.f()}},rt.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(v,g))},rt.prefetchDNS=function(v){typeof v=="string"&&r.d.D(v)},rt.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var A=g.as,N=p(A,g.crossOrigin),B=typeof g.integrity=="string"?g.integrity:void 0,F=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;A==="style"?r.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:N,integrity:B,fetchPriority:F}):A==="script"&&r.d.X(v,{crossOrigin:N,integrity:B,fetchPriority:F,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},rt.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var A=p(g.as,g.crossOrigin);r.d.M(v,{crossOrigin:A,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(v)},rt.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var A=g.as,N=p(A,g.crossOrigin);r.d.L(v,A,{crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},rt.preloadModule=function(v,g){if(typeof v=="string")if(g){var A=p(g.as,g.crossOrigin);r.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:A,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(v)},rt.requestFormReset=function(v){r.d.r(v)},rt.unstable_batchedUpdates=function(v,g){return v(g)},rt.useFormState=function(v,g,A){return y.H.useFormState(v,g,A)},rt.useFormStatus=function(){return y.H.useHostTransitionStatus()},rt.version="19.2.8",rt}var qm;function ph(){if(qm)return nr.exports;qm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),nr.exports=Rp(),nr.exports}/**
*/var Um;function Rp(){if(Um)return rt;Um=1;var l=vr();function s(v){var g="https://react.dev/errors/"+v;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var A=2;A<arguments.length;A++)g+="&args[]="+encodeURIComponent(arguments[A])}return"Minified React error #"+v+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var r={d:{f:c,r:function(){throw Error(s(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal");function m(v,g,A){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:N==null?null:""+N,children:v,containerInfo:g,implementation:A}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(v,g){if(v==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,rt.createPortal=function(v,g){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(s(299));return m(v,g,null,A)},rt.flushSync=function(v){var g=h.T,A=r.p;try{if(h.T=null,r.p=2,v)return v()}finally{h.T=g,r.p=A,r.d.f()}},rt.preconnect=function(v,g){typeof v=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(v,g))},rt.prefetchDNS=function(v){typeof v=="string"&&r.d.D(v)},rt.preinit=function(v,g){if(typeof v=="string"&&g&&typeof g.as=="string"){var A=g.as,N=p(A,g.crossOrigin),B=typeof g.integrity=="string"?g.integrity:void 0,F=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;A==="style"?r.d.S(v,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:N,integrity:B,fetchPriority:F}):A==="script"&&r.d.X(v,{crossOrigin:N,integrity:B,fetchPriority:F,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},rt.preinitModule=function(v,g){if(typeof v=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var A=p(g.as,g.crossOrigin);r.d.M(v,{crossOrigin:A,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(v)},rt.preload=function(v,g){if(typeof v=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var A=g.as,N=p(A,g.crossOrigin);r.d.L(v,A,{crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},rt.preloadModule=function(v,g){if(typeof v=="string")if(g){var A=p(g.as,g.crossOrigin);r.d.m(v,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:A,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(v)},rt.requestFormReset=function(v){r.d.r(v)},rt.unstable_batchedUpdates=function(v,g){return v(g)},rt.useFormState=function(v,g,A){return h.H.useFormState(v,g,A)},rt.useFormStatus=function(){return h.H.useHostTransitionStatus()},rt.version="19.2.8",rt}var qm;function ph(){if(qm)return nr.exports;qm=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),nr.exports=Rp(),nr.exports}/**
* @license React
* react-dom-client.production.js
*
@@ -39,15 +39,15 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Bm;function wp(){if(Bm)return uu;Bm=1;var l=Np(),s=vr(),c=ph();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function y(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(m(e)!==e)throw Error(r(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(r(188));return t!==e?null:e}for(var a=e,n=t;;){var u=a.return;if(u===null)break;var i=u.alternate;if(i===null){if(n=u.return,n!==null){a=n;continue}break}if(u.child===i.child){for(i=u.child;i;){if(i===a)return v(u),e;if(i===n)return v(u),t;i=i.sibling}throw Error(r(188))}if(a.return!==n.return)a=u,n=i;else{for(var o=!1,d=u.child;d;){if(d===a){o=!0,a=u,n=i;break}if(d===n){o=!0,n=u,a=i;break}d=d.sibling}if(!o){for(d=i.child;d;){if(d===a){o=!0,a=i,n=u;break}if(d===n){o=!0,n=i,a=u;break}d=d.sibling}if(!o)throw Error(r(189))}}if(a.alternate!==n)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,B=Symbol.for("react.element"),F=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),me=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Le=Symbol.for("react.lazy"),ct=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),Ce=Symbol.iterator;function ke(e){return e===null||typeof e!="object"?null:(e=Ce&&e[Ce]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Symbol.for("react.client.reference");function He(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case X:return"Fragment";case M:return"Profiler";case Y:return"StrictMode";case Ee:return"Suspense";case me:return"SuspenseList";case ct:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case W:return"Portal";case Q:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case ee:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return t=e.displayName||null,t!==null?t:He(e.type)||"Memo";case Le:t=e._payload,e=e._init;try{return He(e(t))}catch{}}return null}var Re=Array.isArray,z=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},Se=[],re=-1;function S(e){return{current:e}}function j(e){0>re||(e.current=Se[re],Se[re]=null,re--)}function H(e,t){re++,Se[re]=e.current,e.current=t}var G=S(null),ue=S(null),Z=S(null),k=S(null);function ie(e,t){switch(H(Z,t),H(ue,e),H(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pd(t),e=Id(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(G),H(G,e)}function Te(){j(G),j(ue),j(Z)}function Za(e){e.memoizedState!==null&&H(k,e);var t=G.current,a=Id(t,e.type);t!==a&&(H(ue,e),H(G,a))}function Ka(e){ue.current===e&&(j(G),j(ue)),k.current===e&&(j(k),eu._currentValue=I)}var Et,ol;function Zt(e){if(Et===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Et=t&&t[1]||"",ol=-1<a.stack.indexOf(`
*/var Bm;function wp(){if(Bm)return uu;Bm=1;var l=Np(),s=vr(),c=ph();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(m(e)!==e)throw Error(r(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(r(188));return t!==e?null:e}for(var a=e,n=t;;){var u=a.return;if(u===null)break;var i=u.alternate;if(i===null){if(n=u.return,n!==null){a=n;continue}break}if(u.child===i.child){for(i=u.child;i;){if(i===a)return v(u),e;if(i===n)return v(u),t;i=i.sibling}throw Error(r(188))}if(a.return!==n.return)a=u,n=i;else{for(var o=!1,d=u.child;d;){if(d===a){o=!0,a=u,n=i;break}if(d===n){o=!0,n=u,a=i;break}d=d.sibling}if(!o){for(d=i.child;d;){if(d===a){o=!0,a=i,n=u;break}if(d===n){o=!0,n=i,a=u;break}d=d.sibling}if(!o)throw Error(r(189))}}if(a.alternate!==n)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,B=Symbol.for("react.element"),F=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),me=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Le=Symbol.for("react.lazy"),ct=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),Me=Symbol.iterator;function ke(e){return e===null||typeof e!="object"?null:(e=Me&&e[Me]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Symbol.for("react.client.reference");function He(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case X:return"Fragment";case C:return"Profiler";case Y:return"StrictMode";case Ee:return"Suspense";case me:return"SuspenseList";case ct:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case W:return"Portal";case Q:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case te:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return t=e.displayName||null,t!==null?t:He(e.type)||"Memo";case Le:t=e._payload,e=e._init;try{return He(e(t))}catch{}}return null}var Re=Array.isArray,z=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},Se=[],re=-1;function S(e){return{current:e}}function j(e){0>re||(e.current=Se[re],Se[re]=null,re--)}function H(e,t){re++,Se[re]=e.current,e.current=t}var G=S(null),ue=S(null),Z=S(null),k=S(null);function ie(e,t){switch(H(Z,t),H(ue,e),H(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Id(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Id(t),e=Pd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(G),H(G,e)}function Te(){j(G),j(ue),j(Z)}function Za(e){e.memoizedState!==null&&H(k,e);var t=G.current,a=Pd(t,e.type);t!==a&&(H(ue,e),H(G,a))}function Ka(e){ue.current===e&&(j(G),j(ue)),k.current===e&&(j(k),eu._currentValue=P)}var Et,ol;function Zt(e){if(Et===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Et=t&&t[1]||"",ol=-1<a.stack.indexOf(`
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Et+e+ol}var At=!1;function se(e,t){if(!e||At)return"";At=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(w){var R=w}Reflect.construct(e,[],U)}else{try{U.call()}catch(w){R=w}e.call(U.prototype)}}else{try{throw Error()}catch(w){R=w}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(w){if(w&&R&&typeof w.stack=="string")return[w.stack,R.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),o=i[0],d=i[1];if(o&&d){var b=o.split(`
`),O=d.split(`
`);for(u=n=0;n<b.length&&!b[n].includes("DetermineComponentFrameRoot");)n++;for(;u<O.length&&!O[u].includes("DetermineComponentFrameRoot");)u++;if(n===b.length||u===O.length)for(n=b.length-1,u=O.length-1;1<=n&&0<=u&&b[n]!==O[u];)u--;for(;1<=n&&0<=u;n--,u--)if(b[n]!==O[u]){if(n!==1||u!==1)do if(n--,u--,0>u||b[n]!==O[u]){var D=`
`+b[n].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=n&&0<=u);break}}}finally{At=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Zt(a):""}function dt(e,t){switch(e.tag){case 26:case 27:case 5:return Zt(e.type);case 16:return Zt("Lazy");case 13:return e.child!==t&&t!==null?Zt("Suspense Fallback"):Zt("Suspense");case 19:return Zt("SuspenseList");case 0:case 15:return se(e.type,!1);case 11:return se(e.type.render,!1);case 1:return se(e.type,!0);case 31:return Zt("Activity");default:return""}}function Kt(e){try{var t="",a=null;do t+=dt(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
Error generating stack: `+n.message+`
`+n.stack}}var Jt=Object.prototype.hasOwnProperty,vn=l.unstable_scheduleCallback,fl=l.unstable_cancelCallback,Ja=l.unstable_shouldYield,ty=l.unstable_requestPaint,Tt=l.unstable_now,ay=l.unstable_getCurrentPriorityLevel,Rr=l.unstable_ImmediatePriority,wr=l.unstable_UserBlockingPriority,mu=l.unstable_NormalPriority,ny=l.unstable_LowPriority,zr=l.unstable_IdlePriority,ly=l.log,uy=l.unstable_setDisableYieldValue,dl=null,Ot=null;function Sa(e){if(typeof ly=="function"&&uy(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(dl,e)}catch{}}var Nt=Math.clz32?Math.clz32:cy,iy=Math.log,sy=Math.LN2;function cy(e){return e>>>=0,e===0?32:31-(iy(e)/sy|0)|0}var hu=256,yu=262144,pu=4194304;function $a(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function gu(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var u=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var d=n&134217727;return d!==0?(n=d&~i,n!==0?u=$a(n):(o&=d,o!==0?u=$a(o):a||(a=d&~e,a!==0&&(u=$a(a))))):(d=n&~i,d!==0?u=$a(d):o!==0?u=$a(o):a||(a=n&~e,a!==0&&(u=$a(a)))),u===0?0:t!==0&&t!==u&&(t&i)===0&&(i=u&-u,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:u}function ml(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ry(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jr(){var e=pu;return pu<<=1,(pu&62914560)===0&&(pu=4194304),e}function ki(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function hl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oy(e,t,a,n,u,i){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var d=e.entanglements,b=e.expirationTimes,O=e.hiddenUpdates;for(a=o&~a;0<a;){var D=31-Nt(a),U=1<<D;d[D]=0,b[D]=-1;var R=O[D];if(R!==null)for(O[D]=null,D=0;D<R.length;D++){var w=R[D];w!==null&&(w.lane&=-536870913)}a&=~U}n!==0&&Dr(e,n,0),i!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function Dr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Nt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Mr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Nt(a),u=1<<n;u&t|e[n]&t&&(e[n]|=t),a&=~u}}function Cr(e,t){var a=t&-t;return a=(a&42)!==0?1:Yi(a),(a&(e.suspendedLanes|t))!==0?0:a}function Yi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Vi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ur(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:xm(e.type))}function qr(e,t){var a=L.p;try{return L.p=e,t()}finally{L.p=a}}var _a=Math.random().toString(36).slice(2),at="__reactFiber$"+_a,ht="__reactProps$"+_a,Sn="__reactContainer$"+_a,Xi="__reactEvents$"+_a,fy="__reactListeners$"+_a,dy="__reactHandles$"+_a,Br="__reactResources$"+_a,yl="__reactMarker$"+_a;function Gi(e){delete e[at],delete e[ht],delete e[Xi],delete e[fy],delete e[dy]}function _n(e){var t=e[at];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Sn]||a[at]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=im(e);e!==null;){if(a=e[at])return a;e=im(e)}return t}e=a,a=e.parentNode}return null}function xn(e){if(e=e[at]||e[Sn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function En(e){var t=e[Br];return t||(t=e[Br]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ie(e){e[yl]=!0}var Hr=new Set,Lr={};function Fa(e,t){An(e,t),An(e+"Capture",t)}function An(e,t){for(Lr[e]=t,e=0;e<t.length;e++)Hr.add(t[e])}var my=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21 Line truncated
`).replace(G0,"")}function Fd(e,t){return t=$d(t),$d(e)===t}function ze(e,t,a,n,u,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||On(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&On(e,""+n);break;case"className":vu(e,"class",n);break;case"tabIndex":vu(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":vu(e,a,n);break;case"style":Jr(e,n,i);break;case"data":if(t!=="object"){vu(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=_u(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&ze(e,t,"name",u.name,u,null),ze(e,t,"formEncType",u.formEncType,u,null),ze(e,t,"formMethod",u.formMethod,u,null),ze(e,t,"formTarget",u.formTarget,u,null)):(ze(e,t,"encType",u.encType,u,null),ze(e,t,"method",u.method,u,null),ze(e,t,"target",u.target,u,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=_u(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=na);break;case"onScroll":n!=null&&ye("scroll",e);break;case"onScrollEnd":n!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(r(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=_u(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":ye("beforetoggle",e),ye("toggle",e),bu(e,"popover",n);break;case"xlinkActuate":aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":aa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":aa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":aa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":aa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":bu(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=by.get(a)||a,bu(e,a,n))}}function Cc(e,t,a,n,u,i){switch(a){case"style":Jr(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(r(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"children":typeof n=="string"?On(e,n):(typeof n=="number"||typeof n=="bigint")&&On(e,""+n);break;case"onScroll":n!=null&&ye("scroll",e);break;case"onScrollEnd":n!=null&&ye("scrollend",e);break;case"onClick":n!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
`+n.stack}}var Jt=Object.prototype.hasOwnProperty,vn=l.unstable_scheduleCallback,fl=l.unstable_cancelCallback,Ja=l.unstable_shouldYield,ty=l.unstable_requestPaint,Tt=l.unstable_now,ay=l.unstable_getCurrentPriorityLevel,Rr=l.unstable_ImmediatePriority,wr=l.unstable_UserBlockingPriority,mu=l.unstable_NormalPriority,ny=l.unstable_LowPriority,zr=l.unstable_IdlePriority,ly=l.log,uy=l.unstable_setDisableYieldValue,dl=null,Ot=null;function Sa(e){if(typeof ly=="function"&&uy(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(dl,e)}catch{}}var Nt=Math.clz32?Math.clz32:cy,iy=Math.log,sy=Math.LN2;function cy(e){return e>>>=0,e===0?32:31-(iy(e)/sy|0)|0}var hu=256,yu=262144,pu=4194304;function $a(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function gu(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var u=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var d=n&134217727;return d!==0?(n=d&~i,n!==0?u=$a(n):(o&=d,o!==0?u=$a(o):a||(a=d&~e,a!==0&&(u=$a(a))))):(d=n&~i,d!==0?u=$a(d):o!==0?u=$a(o):a||(a=n&~e,a!==0&&(u=$a(a)))),u===0?0:t!==0&&t!==u&&(t&i)===0&&(i=u&-u,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:u}function ml(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ry(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jr(){var e=pu;return pu<<=1,(pu&62914560)===0&&(pu=4194304),e}function ki(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function hl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oy(e,t,a,n,u,i){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var d=e.entanglements,b=e.expirationTimes,O=e.hiddenUpdates;for(a=o&~a;0<a;){var D=31-Nt(a),U=1<<D;d[D]=0,b[D]=-1;var R=O[D];if(R!==null)for(O[D]=null,D=0;D<R.length;D++){var w=R[D];w!==null&&(w.lane&=-536870913)}a&=~U}n!==0&&Dr(e,n,0),i!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function Dr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Nt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Cr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Nt(a),u=1<<n;u&t|e[n]&t&&(e[n]|=t),a&=~u}}function Mr(e,t){var a=t&-t;return a=(a&42)!==0?1:Yi(a),(a&(e.suspendedLanes|t))!==0?0:a}function Yi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Vi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ur(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:xm(e.type))}function qr(e,t){var a=L.p;try{return L.p=e,t()}finally{L.p=a}}var _a=Math.random().toString(36).slice(2),at="__reactFiber$"+_a,ht="__reactProps$"+_a,Sn="__reactContainer$"+_a,Xi="__reactEvents$"+_a,fy="__reactListeners$"+_a,dy="__reactHandles$"+_a,Br="__reactResources$"+_a,yl="__reactMarker$"+_a;function Gi(e){delete e[at],delete e[ht],delete e[Xi],delete e[fy],delete e[dy]}function _n(e){var t=e[at];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Sn]||a[at]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=im(e);e!==null;){if(a=e[at])return a;e=im(e)}return t}e=a,a=e.parentNode}return null}function xn(e){if(e=e[at]||e[Sn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function En(e){var t=e[Br];return t||(t=e[Br]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[yl]=!0}var Hr=new Set,Lr={};function Fa(e,t){An(e,t),An(e+"Capture",t)}function An(e,t){for(Lr[e]=t,e=0;e<t.length;e++)Hr.add(t[e])}var my=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21 Line truncated
`).replace(G0,"")}function Fd(e,t){return t=$d(t),$d(e)===t}function ze(e,t,a,n,u,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||On(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&On(e,""+n);break;case"className":vu(e,"class",n);break;case"tabIndex":vu(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":vu(e,a,n);break;case"style":Jr(e,n,i);break;case"data":if(t!=="object"){vu(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=_u(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&ze(e,t,"name",u.name,u,null),ze(e,t,"formEncType",u.formEncType,u,null),ze(e,t,"formMethod",u.formMethod,u,null),ze(e,t,"formTarget",u.formTarget,u,null)):(ze(e,t,"encType",u.encType,u,null),ze(e,t,"method",u.method,u,null),ze(e,t,"target",u.target,u,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=_u(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=na);break;case"onScroll":n!=null&&ye("scroll",e);break;case"onScrollEnd":n!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(r(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=_u(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":ye("beforetoggle",e),ye("toggle",e),bu(e,"popover",n);break;case"xlinkActuate":aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":aa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":aa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":aa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":aa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":bu(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=by.get(a)||a,bu(e,a,n))}}function Mc(e,t,a,n,u,i){switch(a){case"style":Jr(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(r(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"children":typeof n=="string"?On(e,n):(typeof n=="number"||typeof n=="bigint")&&On(e,""+n);break;case"onScroll":n!=null&&ye("scroll",e);break;case"onScrollEnd":n!=null&&ye("scrollend",e);break;case"onClick":n!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -62,7 +62,7 @@ Error generating stack: `+n.message+`
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kp=q.forwardRef(({color:l="currentColor",size:s=24,strokeWidth:c=2,absoluteStrokeWidth:r,className:f="",children:m,iconNode:y,...p},v)=>q.createElement("svg",{ref:v,...Lp,width:s,height:s,stroke:l,strokeWidth:r?Number(c)*24/Number(s):c,className:gh("lucide",f),...!m&&!Hp(p)&&{"aria-hidden":"true"},...p},[...y.map(([g,A])=>q.createElement(g,A)),...Array.isArray(m)?m:[m]]));/**
*/const kp=q.forwardRef(({color:l="currentColor",size:s=24,strokeWidth:c=2,absoluteStrokeWidth:r,className:f="",children:m,iconNode:h,...p},v)=>q.createElement("svg",{ref:v,...Lp,width:s,height:s,stroke:l,strokeWidth:r?Number(c)*24/Number(s):c,className:gh("lucide",f),...!m&&!Hp(p)&&{"aria-hidden":"true"},...p},[...h.map(([g,A])=>q.createElement(g,A)),...Array.isArray(m)?m:[m]]));/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -102,7 +102,7 @@ Error generating stack: `+n.message+`
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pp=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ip=de("chevron-up",Pp);/**
*/const Ip=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Pp=de("chevron-up",Ip);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -202,7 +202,7 @@ Error generating stack: `+n.message+`
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],C1=de("refresh-cw",M1);/**
*/const C1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],M1=de("refresh-cw",C1);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -252,12 +252,12 @@ Error generating stack: `+n.message+`
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const W1=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],P1=de("user-round",W1);/**
*/const W1=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],I1=de("user-round",W1);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const I1=[["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"}]],Gm=de("user",I1);/**
*/const P1=[["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"}]],Gm=de("user",P1);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -272,12 +272,12 @@ Error generating stack: `+n.message+`
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_h=de("x",lg),fr="xianyu-theme-preference",xh="(prefers-color-scheme: dark)",Eh=q.createContext(null),Ah=l=>l==="light"||l==="dark"||l==="system"?l:"system",ug=()=>{if(typeof window>"u")return"system";try{return Ah(window.localStorage.getItem(fr))}catch{return"system"}},ig=()=>typeof window>"u"?"light":window.matchMedia(xh).matches?"dark":"light",sg=({children:l})=>{const[s,c]=q.useState(ug),[r,f]=q.useState(ig);q.useEffect(()=>{const v=window.matchMedia(xh),g=A=>{f(A.matches?"dark":"light")};return f(v.matches?"dark":"light"),v.addEventListener("change",g),()=>v.removeEventListener("change",g)},[]),q.useEffect(()=>{const v=g=>{g.key===fr&&c(Ah(g.newValue))};return window.addEventListener("storage",v),()=>window.removeEventListener("storage",v)},[]);const m=s==="system"?r:s;q.useLayoutEffect(()=>{const v=document.documentElement;v.dataset.theme=m,v.dataset.themePreference=s,v.classList.toggle("dark",m==="dark"),v.style.colorScheme=m;try{window.localStorage.setItem(fr,s)}catch{}},[m,s]);const y=q.useCallback(v=>{c(v)},[]),p=q.useMemo(()=>({theme:s,resolvedTheme:m,setTheme:y}),[m,y,s]);return h.jsx(Eh.Provider,{value:p,children:l})},cg=()=>{const l=q.useContext(Eh);if(!l)throw new Error("useTheme must be used inside ThemeProvider");return l},ll=[{value:"light",label:"浅色",description:"使用浅色主题",icon:Q1},{value:"dark",label:"深色",description:"使用深色主题",icon:D1},{value:"system",label:"自动",description:"跟随系统外观",icon:z1}],dr=({compact:l=!1,className:s=""})=>{const{theme:c,resolvedTheme:r,setTheme:f}=cg(),m=(y,p)=>{var A,N;let v=p;if(y.key==="ArrowRight"||y.key==="ArrowDown")v=(p+1)%ll.length;else if(y.key==="ArrowLeft"||y.key==="ArrowUp")v=(p-1+ll.length)%ll.length;else if(y.key==="Home")v=0;else if(y.key==="End")v=ll.length-1;else return;y.preventDefault();const g=ll[v].value;f(g),(N=(A=y.currentTarget.parentElement)==null?void 0:A.querySelector(`[data-theme-option="${g}"]`))==null||N.focus()};return h.jsxs("div",{className:`theme-picker ${l?"theme-picker--compact":""} ${s}`.trim(),"data-resolved-theme":r,children:[!l&&h.jsxs("div",{className:"theme-picker__heading",children:[h.jsx("span",{children:"显示主题"}),h.jsx("span",{className:"theme-picker__status",children:c==="system"?`自动 · ${r==="dark"?"深色":"浅色"}`:c==="dark"?"深色":"浅色"})]}),h.jsx("div",{className:"theme-switcher",role:"radiogroup","aria-label":"显示主题",children:ll.map((y,p)=>{const v=y.icon,g=c===y.value;return h.jsxs("button",{type:"button",role:"radio","aria-checked":g,"aria-label":y.description,title:y.description,tabIndex:g?0:-1,"data-theme-option":y.value,className:`theme-switcher__option ${g?"theme-switcher__option--active":""}`,onClick:()=>f(y.value),onKeyDown:A=>m(A,p),children:[h.jsx(v,{className:"h-3.5 w-3.5"}),!l&&h.jsx("span",{children:y.label})]},y.value)})})]})};function Th(l,s){return function(){return l.apply(s,arguments)}}const{toString:rg}=Object.prototype,{getPrototypeOf:sl}=Object,{iterator:ru,toStringTag:Oh}=Symbol,Ci=(({hasOwnProperty:l})=>(s,c)=>l.call(s,c))(Object.prototype),cu=(l,s)=>{let c=l;const r=[];for(;c!=null&&c!==Object.prototype;){if(r.indexOf(c)!==-1)return!1;if(r.push(c),Ci(c,s))return!0;c=sl(c)}return!1},og=(l,s)=>l!=null&&cu(l,s)?l[s]:void 0,Sr=(l=>s=>{const c=rg.call(s);return l[c]||(l[c]=c.slice(8,-1).toLowerCase())})(Object.create(null)),Qt=l=>(l=l.toLowerCase(),s=>Sr(s)===l),Bi=l=>s=>typeof s===l,{isArray:pn}=Array,gn=Bi("undefined");function cl(l){return l!==null&&!gn(l)&&l.constructor!==null&&!gn(l.constructor)&&_t(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const Nh=Qt("ArrayBuffer");function fg(l){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(l):s=l&&l.buffer&&Nh(l.buffer),s}const dg=Bi("string"),_t=Bi("function"),Rh=Bi("number"),rl=l=>l!==null&&typeof l=="object",mg=l=>l===!0||l===!1,ji=l=>{if(!rl(l))return!1;const s=sl(l);return(s===null||s===Object.prototype||sl(s)===null)&&!cu(l,Oh)&&!cu(l,ru)},hg=l=>{if(!rl(l)||cl(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},yg=Qt("Date"),pg=Qt("File"),gg=l=>!!(l&&typeof l.uri<"u"),bg=l=>l&&typeof l.getParts<"u",vg=Qt("Blob"),Sg=Qt("FileList"),_g=Qt("Set"),xg=l=>rl(l)&&_t(l.pipe);function Eg(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Qm=Eg(),Zm=typeof Qm.FormData<"u"?Qm.FormData:void 0,Ag=l=>{if(!l)return!1;if(Zm&&l instanceof Zm)return!0;const s=sl(l);if(!s||s===Object.prototype||!_t(l.append))return!1;const c=Sr(l);return c==="formdata"||c==="object"&&_t(l.toString)&&l.toString()==="[object FormData]"},Tg=Qt("URLSearchParams"),[Og,Ng,Rg,wg]=["ReadableStream","Request","Response","Headers"].map(Qt),zg=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ou(l,s,{allOwnKeys:c=!1}={}){if(l===null||typeoLine truncated
`).forEach(function(y){f=y.indexOf(":"),c=y.substring(0,f).trim().toLowerCase(),r=y.substring(f+1).trim();const p=x.hasOwnProp(s,c);!c||p&&x.hasOwnProp(eb,c)||(c==="set-cookie"?p?s[c].push(r):s[c]=[r]:s[c]=p?s[c]+", "+r:r)}),s};function ab(l){let s=0,c=l.length;for(;s<c;){const r=l.charCodeAt(s);if(r!==9&&r!==32)break;s+=1}for(;c>s;){const r=l.charCodeAt(c-1);if(r!==9&&r!==32)break;c-=1}return s===0&&c===l.length?l:l.slice(s,c)}const nb=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lb=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function _r(l,s){return x.isArray(l)?l.map(c=>_r(c,s)):ab(String(l).replace(s,""))}const ub=l=>_r(l,nb),ib=l=>_r(l,lb);function Ch(l){const s=Object.create(null);return x.forEach(l.toJSON(),(c,r)=>{s[r]=ib(c)}),s}const Km=Symbol("internals");function iu(l){return l&&String(l).trim().toLowerCase()}function Di(l){return l===!1||l==null?l:x.isArray(l)?l.map(Di):ub(String(l))}function sb(l){const s=Object.create(null),c=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=c.exec(l);)s[r[1]]=r[2];return s}const cb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function lr(l){let s=0,c=l.length;for(;s<c;){const r=l.charCodeAt(s);if(r!==9&&r!==32)break;s+=1}for(;c>s;){const r=l.charCodeAt(c-1);if(r!==9&&r!==32)break;c-=1}return s===0&&c===l.length?l:l.slice(s,c)}function rb(l){const s=l.length-1;if(s<1||l.charCodeAt(0)!==34||l.charCodeAt(s)!==34)return l;let c="";for(let r=1;r<s;r++){const f=l.charCodeAt(r);if(f===34||f===92&&(r+=1,r>=s))return l;c+=l[r]}return c}function ob(l){const s=Object.create(null),c=String(l);let r=0,f=!1,m=!1;function y(p){const v=lr(c.slice(r,p)),g=v.indexOf("=");if(g<1)return;const A=lr(v.slice(0,g));if(!cb.test(A))return;const N=A.toLowerCase();if(N==="__proto__"||N==="constructor"||N==="prototype")return;const B=lr(v.slice(g+1));s[N]=rb(B)}for(let p=0;p<c.length;p++){const v=c.charCodeAt(p);f?m?m=!1:v===92?m=!0:v===34&&(f=!1):v===34?f=!0:(v===44||v===59)&&(y(p),r=p+1)}return y(c.length),s}const fb=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function ur(l,s,c,r,f){if(x.isFunction(r))return r.call(this,s,c);if(f&&(s=c),!!x.isString(s)){if(x.isString(r))return s.indexOf(r)!==-1;if(x.isRegExp(r))return r.test(s)}}function db(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,c,r)=>c.toUpperCase()+r)}function mb(l,s){const c=x.toCamelCase(" "+s);["get","set","has"].forEach(r=>{Object.defineProperty(l,r+c,{__proto__:null,value:function(f,m,y){return this[r].call(this,s,f,m,y)},configurable:!0})})}let ft=class{constructor(s){s&&this.set(s)}set(s,c,r){const f=this;function m(p,v,g){const A=iu(v);if(!A)return;const N=x.findKey(f,A);(!N||f[N]===void 0||g===!0||g===void 0&&f[N]!==!1)&&(f[N||v]=Di(p))}const y=(p,v)=>x.forEach(p,(g,A)=>m(g,A,v));if(x.isPlainObject(s)||s instanceof this.constructor)y(s,c);else if(x.isString(s)&&(s=s.trim())&&!fb(s))y(tb(s),c);else if(x.isObject(s)&&x.isSafeIterable(s)){let p=Object.create(null),v,g;for(const A of s){if(!x.isArray(A))throw new TypeError("Object iterator must return a key-value pair");g=A[0],x.hasOwnProp(p,g)?(v=p[g],p[g]=x.isArray(v)?[...v,A[1]]:[v,A[1]]):p[g]=A[1]}y(p,c)}else s!=null&&m(c,s,r);return this}get(s,c){if(s=iu(s),s){const r=x.findKey(this,s);if(r){const f=this[r];if(!c)return f;if(c===!0)return sb(f);if(x.isFunction(c))return c.call(this,f,r);if(x.isRegExp(c))return c.exec(f);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,c){if(s=iu(s),s){const r=x.findKey(this,s);return!!(r&&this[r]!==void 0&&(!c||ur(this,this[r],r,c)))}return!1}delete(s,c){const r=this;let f=!1;function m(y){if(y=iu(y),y){const p=x.findKey(r,y);p&&(!c||ur(r,r[p],p,c))&&(delete r[p],f=!0)}}return x.isArray(s)?s.forEach(m):m(s),f}clear(s){const c=Object.keys(this);let r=c.length,f=!1;for(;r--;){const m=c[r];(!s||ur(this,this[m],m,s,!0))&&(delete this[m],f=!0)}return f}normalize(s){const c=this,r={};return x.forEach(this,(f,m)=>{const y=x.findKey(r,m);if(y){c[y]=Di(f),delete c[m];return}const p=s?db(m):String(m).trim();p!==m&&delete c[m],c[p]=Di(f),r[p]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const c=Object.create(null);return x.forEach(this,(r,f)=>{r!=null&&r!==!1&&(c[f]=s&&x.isArray(r)?r.join(", "):r)}),c}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,c])=>s+": "+c).join(`
`)}getSetCookie(){const s=this.get("set-cookie");return x.isArray(s)?s:s==null||s===!1?[]:[s]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static parseParameters(s){return ob(s)}static concat(s,...c){const r=new this(s);return c.forEach(f=>r.set(f)),r}static accessor(s){const r=(this[Km]=this[Km]={accessors:{}}).accessors,f=this.prototype;function m(y){const p=iu(y);r[p]||(mb(f,y),r[p]=!0)}return x.isArray(s)?s.forEach(m):m(s),this}};ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);x.reduceDescriptors(ft.prototype,({value:l},s)=>{let c=s[0].toUpperCase()+s.slice(1);return{get:()=>l,set(r){this[c]=r}}});x.freezeMethods(ft);const Ui="[REDACTED ****]";function hb(l){if(x.hasOwnProp(l,"toJSON"))return!0;let s=Object.getPrototypeOf(l);for(;s&&s!==Object.prototype;){if(x.hasOwnProp(s,"toJSON"))return!0;s=Object.getPrototypeOf(s)}return!1}function yb(l,s){const c=new Set(s.map(m=>String(m).toLowerCase())),r=[],f=m=>{if(m===null||typeof m!="object"||x.isBuffer(m))return m;if(r.indexOf(m)!==-1)return;m instanceof ft&&(m=m.toJSON()),r.push(m);let y;if(x.isArray(m))y=[],m.forEach((p,v)=>{const g=f(p);x.isUndefined(g)||(y[v]=g)});else{if(!x.isPlainObject(m)&&hb(m))return r.pop(),m;y=Object.create(null);for(const[p,v]of Object.entries(m)){const g=c.has(p.toLowerCase())?Ui:f(v);x.isUndefined(g)||(y[p]=g)}}return r.pop(),y};return f(l)}function Jm(l){try{return String(l)}catch{return""}}function pb(l){return l.errors.map(c=>{try{return c&&c.message?Jm(c.message):Jm(c)}catch{return""}}).filter(Boolean).join("; ")||l.name||"AggregateError"}let V=class Uh extends Error{static from(s,c,r,f,m,y){let p=s.message;!p&&x.isArray(s.errors)&&s.errors.length&&(p=pb(s));const v=new Uh(p,c||s.code,r,f,m);return Object.defineProperty(v,"cause",{__proto__:null,value:s,writable:!0,enumerable:!1,configurable:!0}),v.name=s.name,s.status!=null&&v.status==null&&(v.status=s.status),y&&Object.assign(v,y),v}constructor(s,c,r,f,m){super(s),Object.defineProperty(this,"message",{__proto__:null,value:s,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,c&&(this.code=c),r&&(this.config=r),f&&(this.request=f),m&&(this.response=m,this.status=m.status)}toJSON(){const s=this.config,c=s&&x.hasOwnProp(s,"redact")?s.redact:void 0,r=x.isArray(c)&&c.length>0?yb(s,c):x.toJSONObject(s);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";V.ERR_BAD_OPTION="ERR_BAD_OPTION";V.ECONNABORTED="ECONNABORTED";V.ETIMEDOUT="ETIMEDOUT";V.ECONNREFUSED="ECONNREFUSED";V.ERR_NETWORK="ERR_NETWORK";V.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";V.ERR_DEPRECATED="ERR_DEPRECATED";V.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";V.ERR_BAD_REQUEST="ERR_BAD_REQUEST";V.ERR_CANCELED="ERR_CANCELED";V.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";V.ERR_INVALID_URL="ERR_INVALID_URL";V.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const gb=null,qh=100;function hr(l){return x.isPlainObject(l)||x.isArray(l)}function Bh(l){return x.endsWith(l,"[]")?l.slice(0,-2):l}function ir(l,s,c){return l?l.concat(s).map(function(f,m){return f=Bh(f),!c&&m?"["+f+"]":f}).join(c?".":""):s}function bb(l){return x.isArray(l)&&!l.some(hr)}const vb=x.toFlatObject(x,{},null,function(s){return/^is[A-Z]/.test(s)});function Hi(l,s,c){if(!x.isObject(l))throw new TypeError("target must be an object");s=s||new FormData,c=x.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,function(K,Q){return!x.isUndefined(Q[K])});const r=c.metaTokens,f=c.visitor||W,m=c.dots,y=c.indexes,p=c.Blob||typeof Blob<"u"&&Blob,v=c.maxDepth===void 0?qh:c.maxDepth,g=p&&x.isSpecCompliantForm(s),A=[];if(!x.isFunction(f))throw new TypeError("visitor must be a function");function N(M){if(M===null)return"";if(x.isDate(M))return M.toISOString();if(x.isBoolean(M))return M.toString();if(!g&&x.isBlob(M))throw new V("Blob is not supported. Use a Buffer instead.");if(x.isArrayBuffer(M)||x.isTypedArray(M)){if(g&&typeof p=="function")return new p([M]);throw new V("Blob is not supported. Use a Buffer instead.",V.ERR_NOT_SUPPORT)}return M}function B(M){if(M>v)throw new V("Object is too deeply nested ("+M+" levels). Max depth: "+v,V.ERR_FORM_DATA_DEPTH_EXCEEDED)}function F(M,K){if(v===1/0)return JSON.stringify(M);const Q=[];return JSON.stringify(M,function(Ee,me){if(!x.isObject(me))return me;for(;Q.length&&Q[Q.length-1]!==this;)Q.pop();return Q.push(me),B(K+Q.length-1),me})}function W(M,K,Q){let ee=M;if(x.isReactNative(s)&&x.isReactNativeBlob(M))return s.append(ir(Q,K,m),N(M)),!1;if(M&&!Q&&typeof M=="object"){if(x.endsWith(K,"{}"))K=r?K:K.slice(0,-2),M=F(M,1);else if(x.isArray(M)&&bb(M)||(x.isFileList(M)||x.endsWith(K,"[]"))&&(ee=x.toArray(M)))return K=Bh(K),ee.forEach(function(me,le){!(x.is Line truncated
`+y.map(ch).join(`
`):" "+ch(y[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+p,V.ERR_NOT_SUPPORT)}return f}const Jh={getAdapter:hv,adapters:Or};function cr(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new du(null,l)}function rr(l){return cr(l),l.headers=ft.from(l.headers),l.data=sr.call(l,l.transformRequest),["post","put","patch"].indexOf(l.method)!==-1&&l.headers.setContentType("application/x-www-form-urlencoded",!1),Jh.getAdapter(l.adapter||fu.adapter,l)(l).then(function(r){cr(l),l.response=r;try{r.data=sr.call(l,l.transformResponse,r)}finally{delete l.response}return r.headers=ft.from(r.headers),r},function(r){if(!Vh(r)&&(cr(l),r&&r.response)){l.response=r.response;try{r.response.data=sr.call(l,l.transformResponse,r.response)}finally{delete l.response}r.response.headers=ft.from(r.response.headers)}return Promise.reject(r)})}const Li={};["object","boolean","number","function","string","symbol"].forEach((l,s)=>{Li[l]=function(r){return typeof r===l||"a"+(s<1?"n ":" ")+l}});const rh={};Li.transitional=function(s,c,r){function f(m,y){return"[Axios v"+Tr+"] Transitional option '"+m+"'"+y+(r?". "+r:"")}return(m,y,p)=>{if(s===!1)throw new V(f(y," has been removed"+(c?" in "+c:"")),V.ERR_DEPRECATED);return c&&!rh[y]&&(rh[y]=!0,console.warn(f(y," has been deprecated since v"+c+" and will be removed in the near future"))),s?s(m,y,p):!0}};Li.spelling=function(s){return(c,r)=>(console.warn(`${r} is likely a misspelling of ${s}`),!0)};function yv(l,s,c){if(typeof l!="object"||l===null)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const r=Object.keys(l);let f=r.length;for(;f-- >0;){const m=r[f],y=Object.prototype.hasOwnProperty.call(s,m)?s[m]:void 0;if(y){const p=l[m],v=p===void 0||y(p,m,l);if(v!==!0)throw new V("option "+m+" must be "+v,V.ERR_BAD_OPTION_VALUE);continue}if(c!==!0)throw new V("Unknown option "+m,V.ERR_BAD_OPTION)}}const Mi={assertOptions:yv,validators:Li},ot=Mi.validators;let yn=class{constructor(s){this.defaults=s||{},this.interceptors={request:new Fm,response:new Fm}}async request(s,c){try{return await this._request(s,c)}catch(r){if(r instanceof Error){let f={};Error.captureStackTrace?Error.captureStackTrace(f):f=new Error;const m=(()=>{if(!f.stack)return"";const y=f.stack.indexOf(`
`);return y===-1?"":f.stack.slice(y+1)})();try{if(!r.stack)r.stack=m;else if(m){const y=m.indexOf(`
`),p=y===-1?-1:m.indexOf(`
`,y+1),v=p===-1?"":m.slice(p+1);String(r.stack).endsWith(v)||(r.stack+=`
`+m)}}catch{}}throw r}}_request(s,c){typeof s=="string"?(c=c||{},c.url=s):c=s||{},c=bn(this.defaults,c);const{transitional:r,paramsSerializer:f,headers:m}=c;r!==void 0&&Mi.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean),advertiseZstdAcceptEncoding:ot.transitional(ot.boolean),validateStatusUndefinedResolves:ot.transitional(ot.boolean)},!1),f!=null&&(x.isFunction(f)?c.paramsSerializer={serialize:f}:Mi.assertOptions(f,{encode:ot.function,serialize:ot.function},!0)),c.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?c.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:c.allowAbsoluteUrls=!0),Mi.assertOptions(c,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),c.method=(c.method||this.defaults.method||"get").toLowerCase();let y=m&&x.merge(m.common,m[c.method]);m&&x.forEach(["delete","get","head","post","put","patch","query","common"],W=>{delete m[W]}),c.headers=ft.concat(y,m);const p=[];let v=!0;this.interceptors.request.forEach(function(X){if(typeof X.runWhen=="function"&&X.runWhen(c)===!1)return;v=v&&X.synchronous;const Y=c.transitional||Er;Y&&Y.legacyInterceptorReqResOrdering?p.unshift(X.fulfilled,X.rejected):p.push(X.fulfilled,X.rejected)});const g=[];this.interceptors.response.forEach(function(X){g.push(X.fulfilled,X.rejected)});let A,N=0,B;if(!v){const W=[rr.bind(this),void 0];for(W.unshift(...p),W.push(...g),B=W.length,A=Promise.resolve(c);N<B;)A=A.then(W[N++],W[N++]);return A}B=p.length;let F=c;for(;N<B;){const W=p[N++],X=p[N++];try{F=W?W(F):F}catch(Y){if(!X){A=Promise.reject(Y);break}try{const M=X.call(this,Y);x.isThenable(M)&&(A=Promise.resolve(M).then(()=>rr.call(this,F)))}catch(M){A=Promise.reject(M)}break}}if(!A)try{A=rr.call(this,F)}catch(W){A=Promise.reject(W)}for(N=0,B=g.length;N<B;)A=A.then(g[N++],g[N++]);return A}getUri(s){s=bn(this.defaults,s);const c=Gh(s.baseURL,s.url,s.allowAbsoluteUrls,s);return Lh(c,s.params,s.paramsSerializer)}};x.forEach(["delete","get","head","options"],function(s){yn.prototype[s]=function(c,r){return this.request(bn(r||{},{method:s,url:c,data:r&&x.hasOwnProp(r,"data")?r.data:void 0}))}});x.forEach(["post","put","patch","query"],function(s){function c(r){return function(m,y,p){return this.request(bn(p||{},{method:s,headers:r?{"Content-Type":"multipart/form-data"}:{},url:m,data:y}))}}yn.prototype[s]=c(),s!=="query"&&(yn.prototype[s+"Form"]=c(!0))});let pv=class $h{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let c;this.promise=new Promise(function(m){c=m});const r=this;this.promise.then(f=>{if(!r._listeners)return;let m=r._listeners.length;for(;m-- >0;)r._listeners[m](f);r._listeners=null}),this.promise.then=f=>{let m;const y=new Promise(p=>{r.subscribe(p),m=p}).then(f);return y.cancel=function(){r.unsubscribe(m)},y},s(function(m,y,p){r.reason||(r.reason=new du(m,y,p),c(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const c=this._listeners.indexOf(s);c!==-1&&this._listeners.splice(c,1)}toAbortSignal(){const s=new AbortController,c=r=>{s.abort(r)};return this.subscribe(c),s.signal.unsubscribe=()=>this.unsubscribe(c),s.signal}static source(){let s;return{token:new $h(function(f){s=f}),cancel:s}}};function gv(l){return function(c){return l.apply(null,c)}}function bv(l){return x.isObject(l)&&l.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCe Line truncated
*/const lg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_h=de("x",lg),fr="xianyu-theme-preference",xh="(prefers-color-scheme: dark)",Eh=q.createContext(null),Ah=l=>l==="light"||l==="dark"||l==="system"?l:"system",ug=()=>{if(typeof window>"u")return"system";try{return Ah(window.localStorage.getItem(fr))}catch{return"system"}},ig=()=>typeof window>"u"?"light":window.matchMedia(xh).matches?"dark":"light",sg=({children:l})=>{const[s,c]=q.useState(ug),[r,f]=q.useState(ig);q.useEffect(()=>{const v=window.matchMedia(xh),g=A=>{f(A.matches?"dark":"light")};return f(v.matches?"dark":"light"),v.addEventListener("change",g),()=>v.removeEventListener("change",g)},[]),q.useEffect(()=>{const v=g=>{g.key===fr&&c(Ah(g.newValue))};return window.addEventListener("storage",v),()=>window.removeEventListener("storage",v)},[]);const m=s==="system"?r:s;q.useLayoutEffect(()=>{const v=document.documentElement;v.dataset.theme=m,v.dataset.themePreference=s,v.classList.toggle("dark",m==="dark"),v.style.colorScheme=m;try{window.localStorage.setItem(fr,s)}catch{}},[m,s]);const h=q.useCallback(v=>{c(v)},[]),p=q.useMemo(()=>({theme:s,resolvedTheme:m,setTheme:h}),[m,h,s]);return y.jsx(Eh.Provider,{value:p,children:l})},cg=()=>{const l=q.useContext(Eh);if(!l)throw new Error("useTheme must be used inside ThemeProvider");return l},ll=[{value:"light",label:"浅色",description:"使用浅色主题",icon:Q1},{value:"dark",label:"深色",description:"使用深色主题",icon:D1},{value:"system",label:"自动",description:"跟随系统外观",icon:z1}],dr=({compact:l=!1,className:s=""})=>{const{theme:c,resolvedTheme:r,setTheme:f}=cg(),m=(h,p)=>{var A,N;let v=p;if(h.key==="ArrowRight"||h.key==="ArrowDown")v=(p+1)%ll.length;else if(h.key==="ArrowLeft"||h.key==="ArrowUp")v=(p-1+ll.length)%ll.length;else if(h.key==="Home")v=0;else if(h.key==="End")v=ll.length-1;else return;h.preventDefault();const g=ll[v].value;f(g),(N=(A=h.currentTarget.parentElement)==null?void 0:A.querySelector(`[data-theme-option="${g}"]`))==null||N.focus()};return y.jsxs("div",{className:`theme-picker ${l?"theme-picker--compact":""} ${s}`.trim(),"data-resolved-theme":r,children:[!l&&y.jsxs("div",{className:"theme-picker__heading",children:[y.jsx("span",{children:"显示主题"}),y.jsx("span",{className:"theme-picker__status",children:c==="system"?`自动 · ${r==="dark"?"深色":"浅色"}`:c==="dark"?"深色":"浅色"})]}),y.jsx("div",{className:"theme-switcher",role:"radiogroup","aria-label":"显示主题",children:ll.map((h,p)=>{const v=h.icon,g=c===h.value;return y.jsxs("button",{type:"button",role:"radio","aria-checked":g,"aria-label":h.description,title:h.description,tabIndex:g?0:-1,"data-theme-option":h.value,className:`theme-switcher__option ${g?"theme-switcher__option--active":""}`,onClick:()=>f(h.value),onKeyDown:A=>m(A,p),children:[y.jsx(v,{className:"h-3.5 w-3.5"}),!l&&y.jsx("span",{children:h.label})]},h.value)})})]})};function Th(l,s){return function(){return l.apply(s,arguments)}}const{toString:rg}=Object.prototype,{getPrototypeOf:sl}=Object,{iterator:ru,toStringTag:Oh}=Symbol,Mi=(({hasOwnProperty:l})=>(s,c)=>l.call(s,c))(Object.prototype),cu=(l,s)=>{let c=l;const r=[];for(;c!=null&&c!==Object.prototype;){if(r.indexOf(c)!==-1)return!1;if(r.push(c),Mi(c,s))return!0;c=sl(c)}return!1},og=(l,s)=>l!=null&&cu(l,s)?l[s]:void 0,Sr=(l=>s=>{const c=rg.call(s);return l[c]||(l[c]=c.slice(8,-1).toLowerCase())})(Object.create(null)),Qt=l=>(l=l.toLowerCase(),s=>Sr(s)===l),Bi=l=>s=>typeof s===l,{isArray:pn}=Array,gn=Bi("undefined");function cl(l){return l!==null&&!gn(l)&&l.constructor!==null&&!gn(l.constructor)&&_t(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const Nh=Qt("ArrayBuffer");function fg(l){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(l):s=l&&l.buffer&&Nh(l.buffer),s}const dg=Bi("string"),_t=Bi("function"),Rh=Bi("number"),rl=l=>l!==null&&typeof l=="object",mg=l=>l===!0||l===!1,ji=l=>{if(!rl(l))return!1;const s=sl(l);return(s===null||s===Object.prototype||sl(s)===null)&&!cu(l,Oh)&&!cu(l,ru)},hg=l=>{if(!rl(l)||cl(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},yg=Qt("Date"),pg=Qt("File"),gg=l=>!!(l&&typeof l.uri<"u"),bg=l=>l&&typeof l.getParts<"u",vg=Qt("Blob"),Sg=Qt("FileList"),_g=Qt("Set"),xg=l=>rl(l)&&_t(l.pipe);function Eg(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Qm=Eg(),Zm=typeof Qm.FormData<"u"?Qm.FormData:void 0,Ag=l=>{if(!l)return!1;if(Zm&&l instanceof Zm)return!0;const s=sl(l);if(!s||s===Object.prototype||!_t(l.append))return!1;const c=Sr(l);return c==="formdata"||c==="object"&&_t(l.toString)&&l.toString()==="[object FormData]"},Tg=Qt("URLSearchParams"),[Og,Ng,Rg,wg]=["ReadableStream","Request","Response","Headers"].map(Qt),zg=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ou(l,s,{allOwnKeys:c=!1}={}){if(l===null||typeoLine truncated
`).forEach(function(h){f=h.indexOf(":"),c=h.substring(0,f).trim().toLowerCase(),r=h.substring(f+1).trim();const p=x.hasOwnProp(s,c);!c||p&&x.hasOwnProp(eb,c)||(c==="set-cookie"?p?s[c].push(r):s[c]=[r]:s[c]=p?s[c]+", "+r:r)}),s};function ab(l){let s=0,c=l.length;for(;s<c;){const r=l.charCodeAt(s);if(r!==9&&r!==32)break;s+=1}for(;c>s;){const r=l.charCodeAt(c-1);if(r!==9&&r!==32)break;c-=1}return s===0&&c===l.length?l:l.slice(s,c)}const nb=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),lb=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function _r(l,s){return x.isArray(l)?l.map(c=>_r(c,s)):ab(String(l).replace(s,""))}const ub=l=>_r(l,nb),ib=l=>_r(l,lb);function Mh(l){const s=Object.create(null);return x.forEach(l.toJSON(),(c,r)=>{s[r]=ib(c)}),s}const Km=Symbol("internals");function iu(l){return l&&String(l).trim().toLowerCase()}function Di(l){return l===!1||l==null?l:x.isArray(l)?l.map(Di):ub(String(l))}function sb(l){const s=Object.create(null),c=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=c.exec(l);)s[r[1]]=r[2];return s}const cb=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function lr(l){let s=0,c=l.length;for(;s<c;){const r=l.charCodeAt(s);if(r!==9&&r!==32)break;s+=1}for(;c>s;){const r=l.charCodeAt(c-1);if(r!==9&&r!==32)break;c-=1}return s===0&&c===l.length?l:l.slice(s,c)}function rb(l){const s=l.length-1;if(s<1||l.charCodeAt(0)!==34||l.charCodeAt(s)!==34)return l;let c="";for(let r=1;r<s;r++){const f=l.charCodeAt(r);if(f===34||f===92&&(r+=1,r>=s))return l;c+=l[r]}return c}function ob(l){const s=Object.create(null),c=String(l);let r=0,f=!1,m=!1;function h(p){const v=lr(c.slice(r,p)),g=v.indexOf("=");if(g<1)return;const A=lr(v.slice(0,g));if(!cb.test(A))return;const N=A.toLowerCase();if(N==="__proto__"||N==="constructor"||N==="prototype")return;const B=lr(v.slice(g+1));s[N]=rb(B)}for(let p=0;p<c.length;p++){const v=c.charCodeAt(p);f?m?m=!1:v===92?m=!0:v===34&&(f=!1):v===34?f=!0:(v===44||v===59)&&(h(p),r=p+1)}return h(c.length),s}const fb=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function ur(l,s,c,r,f){if(x.isFunction(r))return r.call(this,s,c);if(f&&(s=c),!!x.isString(s)){if(x.isString(r))return s.indexOf(r)!==-1;if(x.isRegExp(r))return r.test(s)}}function db(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,c,r)=>c.toUpperCase()+r)}function mb(l,s){const c=x.toCamelCase(" "+s);["get","set","has"].forEach(r=>{Object.defineProperty(l,r+c,{__proto__:null,value:function(f,m,h){return this[r].call(this,s,f,m,h)},configurable:!0})})}let ft=class{constructor(s){s&&this.set(s)}set(s,c,r){const f=this;function m(p,v,g){const A=iu(v);if(!A)return;const N=x.findKey(f,A);(!N||f[N]===void 0||g===!0||g===void 0&&f[N]!==!1)&&(f[N||v]=Di(p))}const h=(p,v)=>x.forEach(p,(g,A)=>m(g,A,v));if(x.isPlainObject(s)||s instanceof this.constructor)h(s,c);else if(x.isString(s)&&(s=s.trim())&&!fb(s))h(tb(s),c);else if(x.isObject(s)&&x.isSafeIterable(s)){let p=Object.create(null),v,g;for(const A of s){if(!x.isArray(A))throw new TypeError("Object iterator must return a key-value pair");g=A[0],x.hasOwnProp(p,g)?(v=p[g],p[g]=x.isArray(v)?[...v,A[1]]:[v,A[1]]):p[g]=A[1]}h(p,c)}else s!=null&&m(c,s,r);return this}get(s,c){if(s=iu(s),s){const r=x.findKey(this,s);if(r){const f=this[r];if(!c)return f;if(c===!0)return sb(f);if(x.isFunction(c))return c.call(this,f,r);if(x.isRegExp(c))return c.exec(f);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,c){if(s=iu(s),s){const r=x.findKey(this,s);return!!(r&&this[r]!==void 0&&(!c||ur(this,this[r],r,c)))}return!1}delete(s,c){const r=this;let f=!1;function m(h){if(h=iu(h),h){const p=x.findKey(r,h);p&&(!c||ur(r,r[p],p,c))&&(delete r[p],f=!0)}}return x.isArray(s)?s.forEach(m):m(s),f}clear(s){const c=Object.keys(this);let r=c.length,f=!1;for(;r--;){const m=c[r];(!s||ur(this,this[m],m,s,!0))&&(delete this[m],f=!0)}return f}normalize(s){const c=this,r={};return x.forEach(this,(f,m)=>{const h=x.findKey(r,m);if(h){c[h]=Di(f),delete c[m];return}const p=s?db(m):String(m).trim();p!==m&&delete c[m],c[p]=Di(f),r[p]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const c=Object.create(null);return x.forEach(this,(r,f)=>{r!=null&&r!==!1&&(c[f]=s&&x.isArray(r)?r.join(", "):r)}),c}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,c])=>s+": "+c).join(`
`)}getSetCookie(){const s=this.get("set-cookie");return x.isArray(s)?s:s==null||s===!1?[]:[s]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static parseParameters(s){return ob(s)}static concat(s,...c){const r=new this(s);return c.forEach(f=>r.set(f)),r}static accessor(s){const r=(this[Km]=this[Km]={accessors:{}}).accessors,f=this.prototype;function m(h){const p=iu(h);r[p]||(mb(f,h),r[p]=!0)}return x.isArray(s)?s.forEach(m):m(s),this}};ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);x.reduceDescriptors(ft.prototype,({value:l},s)=>{let c=s[0].toUpperCase()+s.slice(1);return{get:()=>l,set(r){this[c]=r}}});x.freezeMethods(ft);const Ui="[REDACTED ****]";function hb(l){if(x.hasOwnProp(l,"toJSON"))return!0;let s=Object.getPrototypeOf(l);for(;s&&s!==Object.prototype;){if(x.hasOwnProp(s,"toJSON"))return!0;s=Object.getPrototypeOf(s)}return!1}function yb(l,s){const c=new Set(s.map(m=>String(m).toLowerCase())),r=[],f=m=>{if(m===null||typeof m!="object"||x.isBuffer(m))return m;if(r.indexOf(m)!==-1)return;m instanceof ft&&(m=m.toJSON()),r.push(m);let h;if(x.isArray(m))h=[],m.forEach((p,v)=>{const g=f(p);x.isUndefined(g)||(h[v]=g)});else{if(!x.isPlainObject(m)&&hb(m))return r.pop(),m;h=Object.create(null);for(const[p,v]of Object.entries(m)){const g=c.has(p.toLowerCase())?Ui:f(v);x.isUndefined(g)||(h[p]=g)}}return r.pop(),h};return f(l)}function Jm(l){try{return String(l)}catch{return""}}function pb(l){return l.errors.map(c=>{try{return c&&c.message?Jm(c.message):Jm(c)}catch{return""}}).filter(Boolean).join("; ")||l.name||"AggregateError"}let V=class Uh extends Error{static from(s,c,r,f,m,h){let p=s.message;!p&&x.isArray(s.errors)&&s.errors.length&&(p=pb(s));const v=new Uh(p,c||s.code,r,f,m);return Object.defineProperty(v,"cause",{__proto__:null,value:s,writable:!0,enumerable:!1,configurable:!0}),v.name=s.name,s.status!=null&&v.status==null&&(v.status=s.status),h&&Object.assign(v,h),v}constructor(s,c,r,f,m){super(s),Object.defineProperty(this,"message",{__proto__:null,value:s,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,c&&(this.code=c),r&&(this.config=r),f&&(this.request=f),m&&(this.response=m,this.status=m.status)}toJSON(){const s=this.config,c=s&&x.hasOwnProp(s,"redact")?s.redact:void 0,r=x.isArray(c)&&c.length>0?yb(s,c):x.toJSONObject(s);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";V.ERR_BAD_OPTION="ERR_BAD_OPTION";V.ECONNABORTED="ECONNABORTED";V.ETIMEDOUT="ETIMEDOUT";V.ECONNREFUSED="ECONNREFUSED";V.ERR_NETWORK="ERR_NETWORK";V.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";V.ERR_DEPRECATED="ERR_DEPRECATED";V.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";V.ERR_BAD_REQUEST="ERR_BAD_REQUEST";V.ERR_CANCELED="ERR_CANCELED";V.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";V.ERR_INVALID_URL="ERR_INVALID_URL";V.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const gb=null,qh=100;function hr(l){return x.isPlainObject(l)||x.isArray(l)}function Bh(l){return x.endsWith(l,"[]")?l.slice(0,-2):l}function ir(l,s,c){return l?l.concat(s).map(function(f,m){return f=Bh(f),!c&&m?"["+f+"]":f}).join(c?".":""):s}function bb(l){return x.isArray(l)&&!l.some(hr)}const vb=x.toFlatObject(x,{},null,function(s){return/^is[A-Z]/.test(s)});function Hi(l,s,c){if(!x.isObject(l))throw new TypeError("target must be an object");s=s||new FormData,c=x.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,function(K,Q){return!x.isUndefined(Q[K])});const r=c.metaTokens,f=c.visitor||W,m=c.dots,h=c.indexes,p=c.Blob||typeof Blob<"u"&&Blob,v=c.maxDepth===void 0?qh:c.maxDepth,g=p&&x.isSpecCompliantForm(s),A=[];if(!x.isFunction(f))throw new TypeError("visitor must be a function");function N(C){if(C===null)return"";if(x.isDate(C))return C.toISOString();if(x.isBoolean(C))return C.toString();if(!g&&x.isBlob(C))throw new V("Blob is not supported. Use a Buffer instead.");if(x.isArrayBuffer(C)||x.isTypedArray(C)){if(g&&typeof p=="function")return new p([C]);throw new V("Blob is not supported. Use a Buffer instead.",V.ERR_NOT_SUPPORT)}return C}function B(C){if(C>v)throw new V("Object is too deeply nested ("+C+" levels). Max depth: "+v,V.ERR_FORM_DATA_DEPTH_EXCEEDED)}function F(C,K){if(v===1/0)return JSON.stringify(C);const Q=[];return JSON.stringify(C,function(Ee,me){if(!x.isObject(me))return me;for(;Q.length&&Q[Q.length-1]!==this;)Q.pop();return Q.push(me),B(K+Q.length-1),me})}function W(C,K,Q){let te=C;if(x.isReactNative(s)&&x.isReactNativeBlob(C))return s.append(ir(Q,K,m),N(C)),!1;if(C&&!Q&&typeof C=="object"){if(x.endsWith(K,"{}"))K=r?K:K.slice(0,-2),C=F(C,1);else if(x.isArray(C)&&bb(C)||(x.isFileList(C)||x.endsWith(K,"[]"))&&(te=x.toArray(C)))return K=Bh(K),te.forEach(function(me,le){!(x.is Line truncated
`+h.map(ch).join(`
`):" "+ch(h[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+p,V.ERR_NOT_SUPPORT)}return f}const Jh={getAdapter:hv,adapters:Or};function cr(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new du(null,l)}function rr(l){return cr(l),l.headers=ft.from(l.headers),l.data=sr.call(l,l.transformRequest),["post","put","patch"].indexOf(l.method)!==-1&&l.headers.setContentType("application/x-www-form-urlencoded",!1),Jh.getAdapter(l.adapter||fu.adapter,l)(l).then(function(r){cr(l),l.response=r;try{r.data=sr.call(l,l.transformResponse,r)}finally{delete l.response}return r.headers=ft.from(r.headers),r},function(r){if(!Vh(r)&&(cr(l),r&&r.response)){l.response=r.response;try{r.response.data=sr.call(l,l.transformResponse,r.response)}finally{delete l.response}r.response.headers=ft.from(r.response.headers)}return Promise.reject(r)})}const Li={};["object","boolean","number","function","string","symbol"].forEach((l,s)=>{Li[l]=function(r){return typeof r===l||"a"+(s<1?"n ":" ")+l}});const rh={};Li.transitional=function(s,c,r){function f(m,h){return"[Axios v"+Tr+"] Transitional option '"+m+"'"+h+(r?". "+r:"")}return(m,h,p)=>{if(s===!1)throw new V(f(h," has been removed"+(c?" in "+c:"")),V.ERR_DEPRECATED);return c&&!rh[h]&&(rh[h]=!0,console.warn(f(h," has been deprecated since v"+c+" and will be removed in the near future"))),s?s(m,h,p):!0}};Li.spelling=function(s){return(c,r)=>(console.warn(`${r} is likely a misspelling of ${s}`),!0)};function yv(l,s,c){if(typeof l!="object"||l===null)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const r=Object.keys(l);let f=r.length;for(;f-- >0;){const m=r[f],h=Object.prototype.hasOwnProperty.call(s,m)?s[m]:void 0;if(h){const p=l[m],v=p===void 0||h(p,m,l);if(v!==!0)throw new V("option "+m+" must be "+v,V.ERR_BAD_OPTION_VALUE);continue}if(c!==!0)throw new V("Unknown option "+m,V.ERR_BAD_OPTION)}}const Ci={assertOptions:yv,validators:Li},ot=Ci.validators;let yn=class{constructor(s){this.defaults=s||{},this.interceptors={request:new Fm,response:new Fm}}async request(s,c){try{return await this._request(s,c)}catch(r){if(r instanceof Error){let f={};Error.captureStackTrace?Error.captureStackTrace(f):f=new Error;const m=(()=>{if(!f.stack)return"";const h=f.stack.indexOf(`
`);return h===-1?"":f.stack.slice(h+1)})();try{if(!r.stack)r.stack=m;else if(m){const h=m.indexOf(`
`),p=h===-1?-1:m.indexOf(`
`,h+1),v=p===-1?"":m.slice(p+1);String(r.stack).endsWith(v)||(r.stack+=`
`+m)}}catch{}}throw r}}_request(s,c){typeof s=="string"?(c=c||{},c.url=s):c=s||{},c=bn(this.defaults,c);const{transitional:r,paramsSerializer:f,headers:m}=c;r!==void 0&&Ci.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean),advertiseZstdAcceptEncoding:ot.transitional(ot.boolean),validateStatusUndefinedResolves:ot.transitional(ot.boolean)},!1),f!=null&&(x.isFunction(f)?c.paramsSerializer={serialize:f}:Ci.assertOptions(f,{encode:ot.function,serialize:ot.function},!0)),c.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?c.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:c.allowAbsoluteUrls=!0),Ci.assertOptions(c,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),c.method=(c.method||this.defaults.method||"get").toLowerCase();let h=m&&x.merge(m.common,m[c.method]);m&&x.forEach(["delete","get","head","post","put","patch","query","common"],W=>{delete m[W]}),c.headers=ft.concat(h,m);const p=[];let v=!0;this.interceptors.request.forEach(function(X){if(typeof X.runWhen=="function"&&X.runWhen(c)===!1)return;v=v&&X.synchronous;const Y=c.transitional||Er;Y&&Y.legacyInterceptorReqResOrdering?p.unshift(X.fulfilled,X.rejected):p.push(X.fulfilled,X.rejected)});const g=[];this.interceptors.response.forEach(function(X){g.push(X.fulfilled,X.rejected)});let A,N=0,B;if(!v){const W=[rr.bind(this),void 0];for(W.unshift(...p),W.push(...g),B=W.length,A=Promise.resolve(c);N<B;)A=A.then(W[N++],W[N++]);return A}B=p.length;let F=c;for(;N<B;){const W=p[N++],X=p[N++];try{F=W?W(F):F}catch(Y){if(!X){A=Promise.reject(Y);break}try{const C=X.call(this,Y);x.isThenable(C)&&(A=Promise.resolve(C).then(()=>rr.call(this,F)))}catch(C){A=Promise.reject(C)}break}}if(!A)try{A=rr.call(this,F)}catch(W){A=Promise.reject(W)}for(N=0,B=g.length;N<B;)A=A.then(g[N++],g[N++]);return A}getUri(s){s=bn(this.defaults,s);const c=Gh(s.baseURL,s.url,s.allowAbsoluteUrls,s);return Lh(c,s.params,s.paramsSerializer)}};x.forEach(["delete","get","head","options"],function(s){yn.prototype[s]=function(c,r){return this.request(bn(r||{},{method:s,url:c,data:r&&x.hasOwnProp(r,"data")?r.data:void 0}))}});x.forEach(["post","put","patch","query"],function(s){function c(r){return function(m,h,p){return this.request(bn(p||{},{method:s,headers:r?{"Content-Type":"multipart/form-data"}:{},url:m,data:h}))}}yn.prototype[s]=c(),s!=="query"&&(yn.prototype[s+"Form"]=c(!0))});let pv=class $h{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let c;this.promise=new Promise(function(m){c=m});const r=this;this.promise.then(f=>{if(!r._listeners)return;let m=r._listeners.length;for(;m-- >0;)r._listeners[m](f);r._listeners=null}),this.promise.then=f=>{let m;const h=new Promise(p=>{r.subscribe(p),m=p}).then(f);return h.cancel=function(){r.unsubscribe(m)},h},s(function(m,h,p){r.reason||(r.reason=new du(m,h,p),c(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const c=this._listeners.indexOf(s);c!==-1&&this._listeners.splice(c,1)}toAbortSignal(){const s=new AbortController,c=r=>{s.abort(r)};return this.subscribe(c),s.signal.unsubscribe=()=>this.unsubscribe(c),s.signal}static source(){let s;return{token:new $h(function(f){s=f}),cancel:s}}};function gv(l){return function(c){return l.apply(null,c)}}function bv(l){return x.isObject(l)&&l.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCe Line truncated
-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:rgb(var(--gray-200) / 1)}: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:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family: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:rgb(var(--gray-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}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}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relativeLine truncated
@@ -1,4 +1,4 @@
import{c}from"./index-HJMc2HxZ.js";/**
import{c}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as o}from"./index-HJMc2HxZ.js";/**
import{c as o}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as o}from"./index-HJMc2HxZ.js";/**
import{c as o}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-HJMc2HxZ.js";/**
import{c}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-HJMc2HxZ.js";/**
import{c}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-HJMc2HxZ.js";/**
import{c as e}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-HJMc2HxZ.js";/**
import{c}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
import{c as W,j as e,L as $,aE as A,bX as H,X as R,r as x,b as z}from"./index-HJMc2HxZ.js";/**
import{c as W,j as e,L as $,aF as A,bZ as H,X as R,r as x,b as z}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.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=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],C=W("inbox",M),D=({title:s,description:a,icon:c,badge:n,actions:t})=>e.jsxs("header",{className:"page-header",children:[e.jsxs("div",{className:"page-header__identity",children:[c&&e.jsx("span",{className:"page-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h1",{className:"page-title",children:s}),n]}),a&&e.jsx("p",{className:"page-description",children:a})]})]}),t&&e.jsx("div",{className:"page-actions",children:t})]}),F=({value:s,onChange:a,items:c,ariaLabel:n="页面分区"})=>e.jsx("div",{className:"page-tabs",role:"tablist","aria-label":n,children:c.map(t=>{const p=t.icon,m=s===t.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":m,onClick:()=>a(t.id),className:`page-tab ${m?"page-tab--active":""}`,children:[p&&e.jsx(p,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{children:t.label}),t.count!==void 0&&e.jsx("span",{className:"page-tab__count",children:t.count})]},t.id)})}),I=({title:s,description:a,icon:c,actions:n})=>e.jsxs("div",{className:"section-panel__header",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[c&&e.jsx("span",{className:"section-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"section-title",children:s}),a&&e.jsx("p",{className:"section-description",children:a})]})]}),n&&e.jsx("div",{className:"section-header__actions",children:n})]}),q=({type:s,message:a,onClose:c,children:n})=>{const t=s==="success"?A:H;return e.jsxs("div",{className:`notice-banner notice-banner--${s}`,role:"status",children:[e.jsx(t,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1",children:a??n}),c&&e.jsx("button",{type:"button",onClick:c,"aria-label":"关闭提示",children:e.jsx(R,{className:"h-4 w-4"})})]})},T=({title:s,description:a,icon:c=C,action:n,compact:t=!1})=>e.jsxs("div",{className:`empty-state ${t?"empty-state--compact":""}`,children:[e.jsx("span",{className:"empty-state__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-6 w-6"})}),e.jsx("h3",{children:s}),a&&e.jsx("p",{children:a}),n&&e.jsx("div",{className:"mt-4",children:n})]}),X=({label:s="正在加载"})=>e.jsxs("div",{className:"page-loading",role:"status",children:[e.jsx($,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:s})]}),K=({open:s,onClose:a,trigger:c,placement:n="bottom",align:t="left",panelClassName:p="max-h-72 w-80",children:m,portal:h=!1})=>{const f=x.useRef(null),v=x.useRef(null),[j,L]=x.useState(null);x.useEffect(()=>{if(!s)return;const u=o=>{var i,l;const r=o.target;(i=f.current)!=null&&i.contains(r)||(l=v.current)!=null&&l.contains(r)||a()},d=o=>{o.key==="Escape"&&a()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d)}},[s,a]),x.useLayoutEffect(()=>{if(!s||!h)return;const u=()=>{var y,E,_;const r=(y=f.current)==null?void 0:y.getBoundingClientRect();if(!r)return;const i=8,l=((E=v.current)==null?void 0:E.offsetHeight)??0,w=((_=v.current)==null?void 0:_.offsetWidth)??0,N=window.innerHeight-r.bottom-i,b=r.top-i,k=(n==="top"?b>=l||b>=N?"top":"bottom":N>=l||N>=b?"bottom":"top")==="top"?r.top-l-i:r.bottom+i,P=t==="left"?Math.min(r.left,Math.max(i,window.innerWidth-w-i)):Math.max(i,Math.min(r.right-w,window.innerWidth-w-i));L({top:k,left:P,minWidth:r.width})};u();let d=0;const o=()=>{cancelAnimationFrame(d),d=requestAnimationFrame(u)};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{cancelAnimationFrame(d),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[s,h,n,t,m]);const g=e.jsx("div",{ref:v,className:`overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--surface)] p-2 shadow-lg ${h?"fixed z-50":`absolute z-20 ${n==="top"?"bottom-8":"top-8"} ${t==="left"?"left-0":"right-0"}`} ${p}`,style:h&&j?{top:j.top,left:j.left,minWidth:j.minWidth}:void 0,children:m});return e.jsxs("div",{ref:f,className:"relative",children:[c,s&&(h?z.createPortal(g,document.body):g)]})};export{T as E,C as I,q as N,X as P,I as S,D as a,F as b,K as c};
*/const M=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],C=W("inbox",M),B=({title:s,description:a,icon:c,badge:n,actions:t})=>e.jsxs("header",{className:"page-header",children:[e.jsxs("div",{className:"page-header__identity",children:[c&&e.jsx("span",{className:"page-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h1",{className:"page-title",children:s}),n]}),a&&e.jsx("p",{className:"page-description",children:a})]})]}),t&&e.jsx("div",{className:"page-actions",children:t})]}),D=({value:s,onChange:a,items:c,ariaLabel:n="页面分区"})=>e.jsx("div",{className:"page-tabs",role:"tablist","aria-label":n,children:c.map(t=>{const p=t.icon,m=s===t.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":m,onClick:()=>a(t.id),className:`page-tab ${m?"page-tab--active":""}`,children:[p&&e.jsx(p,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{children:t.label}),t.count!==void 0&&e.jsx("span",{className:"page-tab__count",children:t.count})]},t.id)})}),I=({title:s,description:a,icon:c,actions:n})=>e.jsxs("div",{className:"section-panel__header",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[c&&e.jsx("span",{className:"section-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"section-title",children:s}),a&&e.jsx("p",{className:"section-description",children:a})]})]}),n&&e.jsx("div",{className:"section-header__actions",children:n})]}),q=({type:s,message:a,onClose:c,children:n})=>{const t=s==="success"?A:H;return e.jsxs("div",{className:`notice-banner notice-banner--${s}`,role:"status",children:[e.jsx(t,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1",children:a??n}),c&&e.jsx("button",{type:"button",onClick:c,"aria-label":"关闭提示",children:e.jsx(R,{className:"h-4 w-4"})})]})},T=({title:s,description:a,icon:c=C,action:n,compact:t=!1})=>e.jsxs("div",{className:`empty-state ${t?"empty-state--compact":""}`,children:[e.jsx("span",{className:"empty-state__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-6 w-6"})}),e.jsx("h3",{children:s}),a&&e.jsx("p",{children:a}),n&&e.jsx("div",{className:"mt-4",children:n})]}),K=({label:s="正在加载"})=>e.jsxs("div",{className:"page-loading",role:"status",children:[e.jsx($,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:s})]}),U=({open:s,onClose:a,trigger:c,placement:n="bottom",align:t="left",panelClassName:p="max-h-72 w-80",children:m,portal:h=!1})=>{const f=x.useRef(null),v=x.useRef(null),[j,L]=x.useState(null);x.useEffect(()=>{if(!s)return;const u=o=>{var i,l;const r=o.target;(i=f.current)!=null&&i.contains(r)||(l=v.current)!=null&&l.contains(r)||a()},d=o=>{o.key==="Escape"&&a()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d)}},[s,a]),x.useLayoutEffect(()=>{if(!s||!h)return;const u=()=>{var y,E,_;const r=(y=f.current)==null?void 0:y.getBoundingClientRect();if(!r)return;const i=8,l=((E=v.current)==null?void 0:E.offsetHeight)??0,w=((_=v.current)==null?void 0:_.offsetWidth)??0,N=window.innerHeight-r.bottom-i,b=r.top-i,k=(n==="top"?b>=l||b>=N?"top":"bottom":N>=l||N>=b?"bottom":"top")==="top"?r.top-l-i:r.bottom+i,P=t==="left"?Math.min(r.left,Math.max(i,window.innerWidth-w-i)):Math.max(i,Math.min(r.right-w,window.innerWidth-w-i));L({top:k,left:P,minWidth:r.width})};u();let d=0;const o=()=>{cancelAnimationFrame(d),d=requestAnimationFrame(u)};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{cancelAnimationFrame(d),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[s,h,n,t,m]);const g=e.jsx("div",{ref:v,className:`overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--surface)] p-2 shadow-lg ${h?"fixed z-50":`absolute z-20 ${n==="top"?"bottom-8":"top-8"} ${t==="left"?"left-0":"right-0"}`} ${p}`,style:h&&j?{top:j.top,left:j.left,minWidth:j.minWidth}:void 0,children:m});return e.jsxs("div",{ref:f,className:"relative",children:[c,s&&(h?z.createPortal(g,document.body):g)]})};export{T as E,C as I,q as N,K as P,I as S,B as a,D as b,U as c};
@@ -1,4 +1,4 @@
import{c as a}from"./index-HJMc2HxZ.js";/**
import{c as a}from"./index-DsODdDMf.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
+2 -2
View File
@@ -24,8 +24,8 @@
}
})();
</script>
<script type="module" crossorigin src="/static/assets/index-HJMc2HxZ.js"></script>
<link rel="stylesheet" crossorigin href="/static/assets/index-FJu-e0YF.css">
<script type="module" crossorigin src="/static/assets/index-DsODdDMf.js"></script>
<link rel="stylesheet" crossorigin href="/static/assets/index-DJevgMfP.css">
</head>
<body>
<div id="root"></div>
+8
View File
@@ -377,6 +377,14 @@ class XianyuSellerAPI:
return result
last_ret = ret_list
# 失败时把上游完整响应一起打出来。ret 里往往只有“发布失败,请稍后
# 重试吧!”这类通用文案,真正的子错误码在 data 里;不打出来就只能
# 猜是风控、配额还是字段不合法,每次都要靠再发一次来试。
try:
_data = json.dumps(result.get("data"), ensure_ascii=False)[:800]
except Exception: # noqa: BLE001 - 日志兜底,绝不影响主流程
_data = str(result.get("data"))[:800]
logger.warning(f"【{self.cookie_id}】{api} 业务失败 ret={ret_list} data={_data}")
if risk_control.is_risk_control_error("; ".join(ret_list)):
guard.trip("; ".join(ret_list))
raise SellerApiError(api, ret_list)