功能:完善聊天媒体展示与交易事件兼容

- 支持保存并展示会话关联商品主图
- 支持识别、持久化和播放 AMR 语音消息及其时长
- 补齐聊天接口 OpenAPI 契约、跨方言迁移和前端构建资源
- 兼容嵌套交易事件字段并避免改价卡片重复触发拍下事件
This commit is contained in:
Christ committed 2026-08-20 20:59:37 +08:00
1 parent 50eca2fca6
commit 58f91ac77d
58 files changed
+1040 -209

No files matched your search

+3 -1
View File
@@ -7657,6 +7657,7 @@ components:
buyer_avatar_url: {type: string}
item_id: {type: string}
item_title: {type: string}
item_image_url: {type: string}
last_message: {type: string}
last_message_at: {type: integer}
unread_count: {type: integer}
@@ -7671,8 +7672,9 @@ components:
direction: {type: string, enum: [incoming, outgoing]}
sender_id: {type: string}
sender_name: {type: string}
message_type: {type: string, enum: [text, image, video, system]}
message_type: {type: string, enum: [text, image, video, audio, system]}
content: {type: string}
media_duration: {type: integer}
status: {type: string, enum: [received, sending, sent, failed]}
read_status: {type: integer}
read_at: {type: integer}
@@ -0,0 +1,154 @@
// @vitest-environment jsdom
import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
import { AudioMessage, formatAudioTime, secureAudioURL } from './AudioMessage';
/** recorderHarness 保存可观察的解码器状态和事件回调,使测试不依赖浏览器 AudioContext。 */
const recorderHarness = vi.hoisted(() => ({
/** initialized 表示测试解码器是否已完成 AMR 初始化。 */
initialized: false,
/** playing 表示测试解码器当前是否播放。 */
playing: false,
/** paused 表示测试解码器当前是否暂停。 */
paused: false,
/** initError 控制下一次媒体初始化是否失败。 */
initError: null as Error | null,
/** playEvent、pauseEvent、resumeEvent、stopEvent 和 endedEvent 保存组件注册的生命周期回调。 */
playEvent: null as (() => void) | null,
pauseEvent: null as (() => void) | null,
resumeEvent: null as (() => void) | null,
stopEvent: null as (() => void) | null,
endedEvent: null as (() => void) | null,
/** initWithUrl 记录待解码媒体地址,并按 initError 决定成功或失败。 */
initWithUrl: vi.fn(async function initWithUrl(): Promise<void> {
if (recorderHarness.initError) throw recorderHarness.initError;
recorderHarness.initialized = true;
}),
/** play 从头播放并触发组件注册的播放事件。 */
play: vi.fn(function play(): void {
recorderHarness.playing = true;
recorderHarness.paused = false;
recorderHarness.playEvent?.();
}),
/** pause 暂停播放并触发组件注册的暂停事件。 */
pause: vi.fn(function pause(): void {
recorderHarness.playing = false;
recorderHarness.paused = true;
recorderHarness.pauseEvent?.();
}),
/** resume 从暂停位置继续并触发组件注册的恢复事件。 */
resume: vi.fn(function resume(): void {
recorderHarness.playing = true;
recorderHarness.paused = false;
recorderHarness.resumeEvent?.();
}),
/** destroy 记录组件是否释放解码缓存和浏览器音频节点。 */
destroy: vi.fn(),
/** isInit 返回测试解码器是否已经完成初始化。 */
isInit: vi.fn(/* 当前回调返回测试解码器的初始化状态。 */ (): boolean => recorderHarness.initialized),
/** isPlaying 返回测试解码器当前播放状态。 */
isPlaying: vi.fn(/* 当前回调返回测试解码器的播放状态。 */ (): boolean => recorderHarness.playing),
/** isPaused 返回测试解码器当前暂停状态。 */
isPaused: vi.fn(/* 当前回调返回测试解码器的暂停状态。 */ (): boolean => recorderHarness.paused),
/** getDuration 返回三秒的确定性语音长度。 */
getDuration: vi.fn(/* 当前回调提供确定性的三秒总时长。 */ (): number => 3),
/** getCurrentPosition 返回一秒的确定性播放进度。 */
getCurrentPosition: vi.fn(/* 当前回调提供确定性的一秒播放进度。 */ (): number => 1),
/** onPlay、onPause、onResume、onStop 和 onEnded 接收组件注册的解码器事件。 */
onPlay: vi.fn(/* callback 是组件注册的播放开始回调。 */ (callback: () => void): void => { recorderHarness.playEvent = callback; }),
onPause: vi.fn(/* callback 是组件注册的播放暂停回调。 */ (callback: () => void): void => { recorderHarness.pauseEvent = callback; }),
onResume: vi.fn(/* callback 是组件注册的播放恢复回调。 */ (callback: () => void): void => { recorderHarness.resumeEvent = callback; }),
onStop: vi.fn(/* callback 是组件注册的主动停止回调。 */ (callback: () => void): void => { recorderHarness.stopEvent = callback; }),
onEnded: vi.fn(/* callback 是组件注册的自然结束回调。 */ (callback: () => void): void => { recorderHarness.endedEvent = callback; }),
}));
vi.mock('benz-amr-recorder', /* 当前工厂回调用确定性替身隔离浏览器音频实现。 */ () => ({
/** default 模拟聊天路由加载后通过 new 创建的 AMR 解码器。 */
default: vi.fn(/* MockBenzAMRRecorder 返回当前测试共享的解码器替身。 */ function MockBenzAMRRecorder() { return recorderHarness; }),
}));
/** resetRecorderHarness 清除测试间的播放状态、回调和调用记录。 */
function resetRecorderHarness(): void {
recorderHarness.initialized = false;
recorderHarness.playing = false;
recorderHarness.paused = false;
recorderHarness.initError = null;
recorderHarness.playEvent = null;
recorderHarness.pauseEvent = null;
recorderHarness.resumeEvent = null;
recorderHarness.stopEvent = null;
recorderHarness.endedEvent = null;
// method 保存当前待清理调用记录的测试替身。
for (const /* method 是当前待清理调用记录的测试替身。 */ method of [
recorderHarness.initWithUrl, recorderHarness.play, recorderHarness.pause, recorderHarness.resume,
recorderHarness.destroy, recorderHarness.isInit, recorderHarness.isPlaying, recorderHarness.isPaused,
recorderHarness.getDuration, recorderHarness.getCurrentPosition, recorderHarness.onPlay,
recorderHarness.onPause, recorderHarness.onResume, recorderHarness.onStop, recorderHarness.onEnded,
]) method.mockClear();
}
beforeEach(/* 当前回调在每条测试前恢复解码器初始状态。 */ () => resetRecorderHarness());
afterEach(/* 当前回调清理 React 容器及临时全局对象。 */ () => {
cleanup();
vi.unstubAllGlobals();
});
describe('AudioMessage', /* 当前测试套件覆盖语音组件的主要交互生命周期。 */ () => {
test('首次点击延迟解码并支持播放、暂停和继续', /* 当前测试回调验证成功播放路径和资源释放。 */ async () => {
// view 保存组件渲染句柄,用于验证卸载会释放解码器。
const view = render(<AudioMessage messageKey="voice-1" src="https://cdn.example/voice.amr" outgoing={false} initialDuration={3} />);
expect(screen.getByText('0:03')).toBeTruthy();
fireEvent.click(screen.getByRole('button', { name: '播放语音消息' }));
await waitFor(/* 当前轮询回调等待异步解码完成并进入播放态。 */ () => expect(screen.getByRole('button', { name: '暂停语音消息' })).toBeTruthy());
expect(recorderHarness.initWithUrl).toHaveBeenCalledWith('https://cdn.example/voice.amr');
expect(screen.getByText('0:00 / 0:03')).toBeTruthy();
fireEvent.click(screen.getByRole('button', { name: '暂停语音消息' }));
expect(screen.getByRole('button', { name: '继续播放语音消息' })).toBeTruthy();
fireEvent.click(screen.getByRole('button', { name: '继续播放语音消息' }));
expect(recorderHarness.resume).toHaveBeenCalledTimes(1);
view.unmount();
expect(recorderHarness.destroy).toHaveBeenCalledTimes(1);
});
test('解码失败后展示可重试状态', /* 当前测试回调验证失败提示与再次初始化。 */ async () => {
recorderHarness.initError = new Error('decode failed');
render(<AudioMessage messageKey="voice-error" src="https://cdn.example/broken.amr" outgoing initialDuration={3} />);
fireEvent.click(screen.getByRole('button', { name: '播放语音消息' }));
await waitFor(/* 当前轮询回调等待失败状态写入界面。 */ () => expect(screen.getByRole('button', { name: '重新加载语音消息' })).toBeTruthy());
expect(screen.getByText('加载失败,点击重试')).toBeTruthy();
recorderHarness.initError = null;
fireEvent.click(screen.getByRole('button', { name: '重新加载语音消息' }));
await waitFor(/* 当前轮询回调等待重试成功并开始播放。 */ () => expect(screen.getByRole('button', { name: '暂停语音消息' })).toBeTruthy());
expect(recorderHarness.initWithUrl).toHaveBeenCalledTimes(2);
});
test('另一条语音开始时暂停当前播放器', /* 当前测试回调验证同页语音互斥播放。 */ async () => {
render(<>
<AudioMessage messageKey="voice-a" src="https://cdn.example/a.amr" outgoing={false} />
<AudioMessage messageKey="voice-b" src="https://cdn.example/b.amr" outgoing={false} />
</>);
// playButtons 按 DOM 顺序保存两条语音的初始播放按钮。
const playButtons = screen.getAllByRole('button', { name: '播放语音消息' });
fireEvent.click(playButtons[0]);
await waitFor(/* 当前轮询回调等待首条语音进入播放态。 */ () => expect(recorderHarness.play).toHaveBeenCalledTimes(1));
act(/* 当前回调模拟另一条语音取得播放权。 */ () => window.dispatchEvent(new CustomEvent('ydisks:chat-audio-play', { detail: 'voice-b' })));
expect(recorderHarness.pause).toHaveBeenCalledTimes(1);
});
});
describe('audio helpers', /* 当前测试套件覆盖媒体地址和时长格式化边界。 */ () => {
test('只在 HTTPS 页面升级阿里云 OSS 的语音协议', /* 当前测试回调验证混合内容兼容范围。 */ () => {
vi.stubGlobal('location', { protocol: 'https:' });
expect(secureAudioURL('http://voice.oss-cn-hangzhou.aliyuncs.com/a.amr?token=1')).toBe('https://voice.oss-cn-hangzhou.aliyuncs.com/a.amr?token=1');
expect(secureAudioURL('http://example.com/a.amr')).toBe('http://example.com/a.amr');
});
test('把播放器秒数格式化为固定宽度时间', /* 当前测试回调验证正常、跨分钟和非法秒数。 */ () => {
expect(formatAudioTime(3.8)).toBe('0:03');
expect(formatAudioTime(65)).toBe('1:05');
expect(formatAudioTime(Number.NaN)).toBe('0:00');
});
});
@@ -0,0 +1,240 @@
import { Loader2, Pause, Play, RotateCcw } from 'lucide-react';
import React from 'react';
import BenzAMRRecorder from 'benz-amr-recorder';
/** AudioMessageProps 描述一条已归一化闲鱼语音消息的播放输入。 */
interface AudioMessageProps {
/** messageKey 是消息稳定键,用于在多条语音之间协调互斥播放。 */
messageKey: string;
/** src 是平台返回的 AMR 媒体地址,不包含账号 Cookie 等登录凭证。 */
src: string;
/** outgoing 控制语音气泡使用本人或对方的视觉方向。 */
outgoing: boolean;
/** initialDuration 是平台载荷提供的秒级时长,首次点击前用于直接展示语音长度。 */
initialDuration?: number;
}
/** AudioPlaybackState 描述语音从未加载、异步解码到播放结束的短暂 UI 状态。 */
type AudioPlaybackState = 'idle' | 'loading' | 'playing' | 'paused' | 'error';
/** audioPlaybackEventName 是同页语音播放器之间广播互斥播放请求的事件名称。 */
const audioPlaybackEventName = 'ydisks:chat-audio-play';
/** waveformBars 保存紧凑语音波形的相对高度,避免用随机布局造成每次渲染跳动。 */
const waveformBars = [6, 10, 15, 8, 17, 12, 7, 16, 11, 6, 14, 9];
/**
* secureAudioURL 在 HTTPS 页面中只升级阿里云 OSS 的 HTTP 媒体地址,避免混合内容拦截。
* source 是平台返回的原始媒体地址;返回值保持查询参数不变,无法解析时原样返回。
*/
export function secureAudioURL(source: string): string {
// trimmedURL 去除协议载荷外围空白,防止合法 URL 因格式噪声加载失败。
const trimmedURL = source.trim();
if (typeof location === 'undefined' || location.protocol !== 'https:') return trimmedURL;
try {
// mediaURL 用标准 URL 解析器保留签名查询参数,仅允许改写已验证支持 TLS 的 OSS 域名。
const mediaURL = new URL(trimmedURL);
if (mediaURL.protocol === 'http:' && mediaURL.hostname.endsWith('.aliyuncs.com')) {
mediaURL.protocol = 'https:';
}
return mediaURL.toString();
} catch (parseError /* parseError 仅说明平台媒体地址不是有效绝对 URL,不向界面暴露其内容。 */) {
return trimmedURL;
}
}
/**
* formatAudioTime 把播放器提供的秒数格式化为 mm:ss。
* seconds 是当前进度或总时长;非有限值按零处理,返回固定宽度时间文本。
*/
export function formatAudioTime(seconds: number): string {
// safeSeconds 是已取整且不小于零的可展示秒数。
const safeSeconds = Number.isFinite(seconds) ? Math.max(0, Math.floor(seconds)) : 0;
// minutes 是完整分钟部分。
const minutes = Math.floor(safeSeconds / 60);
// remainderSeconds 是不足一分钟的秒数部分。
const remainderSeconds = safeSeconds % 60;
return `${minutes}:${remainderSeconds.toString().padStart(2, '0')}`;
}
/** announceAudioPlayback 通知同一聊天页的其他语音暂停,messageKey 标识新取得播放权的消息。 */
function announceAudioPlayback(messageKey: string): void {
window.dispatchEvent(new CustomEvent<string>(audioPlaybackEventName, { detail: messageKey }));
}
/** AudioMessage 提供 AMR 延迟解码、播放/暂停、进度反馈、失败重试及组件卸载清理。 */
export const AudioMessage: React.FC<AudioMessageProps> = ({ messageKey, src, outgoing, initialDuration = 0 }) => {
/** playerRef 拥有当前消息的 AMR 解码器;组件卸载或地址变化时负责 destroy。 */
const playerRef = React.useRef<BenzAMRRecorder | null>(null);
/** generationRef 标识最近一次异步初始化,晚到的媒体下载或解码结果不得覆盖新消息状态。 */
const generationRef = React.useRef(0);
/** playbackState 和 setPlaybackState 保存仅供当前气泡展示的播放生命周期状态。 */
const [playbackState, setPlaybackState] = React.useState<AudioPlaybackState>('idle');
/** duration 和 setDuration 保存平台载荷或解码器确认的总时长,单位为秒,不属于服务端消息状态。 */
const [duration, setDuration] = React.useState(initialDuration);
/** progress 和 setProgress 保存播放进度,单位为秒,由播放期间的短定时器更新。 */
const [progress, setProgress] = React.useState(0);
/**
* 地址变化或组件卸载时销毁解码器并使未完成初始化失效;底层 XHR 无取消接口,代次检查负责隔离晚到结果。
*/
React.useEffect(/* 当前回调登记媒体地址对应的解码器释放责任。 */ () => {
return /* 当前清理回调在地址变化或组件卸载时销毁当前解码器。 */ () => {
generationRef.current += 1;
playerRef.current?.destroy();
playerRef.current = null;
};
}, [src]);
/** 服务端刷新同一条语音的时长时同步初始展示值,播放后的解码结果仍可覆盖该值。 */
React.useEffect(/* 当前回调同步服务端提供的秒级语音时长。 */ () => {
setDuration(Math.max(0, initialDuration));
}, [initialDuration]);
/** 监听同页其他语音取得播放权的事件,并在清理阶段移除全局监听器。 */
React.useEffect(/* 当前回调同步同页语音播放器的互斥事件监听。 */ () => {
/** pauseForOtherMessage 在另一条消息开始播放时暂停当前解码器,避免多个声音重叠。 */
const pauseForOtherMessage = (event: Event): void => {
// activeMessageKey 是新取得播放权的消息键;类型转换仅发生在本模块自定义事件边界。
const activeMessageKey = (event as CustomEvent<string>).detail;
// player 是当前组件拥有的解码器;未初始化或已暂停时无需动作。
const player = playerRef.current;
if (activeMessageKey !== messageKey && player?.isPlaying()) player.pause();
};
window.addEventListener(audioPlaybackEventName, pauseForOtherMessage);
return /* 当前清理回调移除播放器互斥事件监听。 */ () => window.removeEventListener(audioPlaybackEventName, pauseForOtherMessage);
}, [messageKey]);
/** 播放期间轮询解码器进度;暂停、结束或卸载时立即清理定时器。 */
React.useEffect(/* 当前回调只在播放态创建进度轮询定时器。 */ () => {
if (playbackState !== 'playing') return undefined;
// progressTimer 每 100 毫秒同步一次可见进度,不参与音频时序控制。
const progressTimer = window.setInterval(/* 当前定时回调从解码器读取最新播放位置。 */ () => {
// player 是本次轮询读取的当前解码器,销毁后不再更新 UI。
const player = playerRef.current;
if (player) setProgress(player.getCurrentPosition());
}, 100);
return /* 当前清理回调在播放态结束时释放进度定时器。 */ () => window.clearInterval(progressTimer);
}, [playbackState]);
/** bindPlayerEvents 把解码器事件映射为当前代次的 React 状态,避免陈旧实例回写。 */
const bindPlayerEvents = (player: BenzAMRRecorder, generation: number): void => {
/** isCurrentGeneration 判断回调所属解码器是否仍由当前气泡持有。 */
const isCurrentGeneration = (): boolean => generationRef.current === generation && playerRef.current === player;
player.onPlay(/* 当前回调在音频从头开始时切换播放态。 */ () => {
if (isCurrentGeneration()) setPlaybackState('playing');
});
player.onResume(/* 当前回调在暂停后继续时恢复播放态。 */ () => {
if (isCurrentGeneration()) setPlaybackState('playing');
});
player.onPause(/* 当前回调在用户或互斥规则暂停时保留当前进度。 */ () => {
if (isCurrentGeneration()) setPlaybackState('paused');
});
player.onStop(/* 当前回调在主动停止时复位到语音开头。 */ () => {
if (!isCurrentGeneration()) return;
setPlaybackState('idle');
setProgress(0);
});
player.onEnded(/* 当前回调在自然播放结束时恢复可重新播放状态。 */ () => {
if (!isCurrentGeneration()) return;
setPlaybackState('idle');
setProgress(0);
});
};
/** handleToggle 响应播放按钮:已播放时暂停,已暂停时继续,首次点击才下载并解码 AMR 数据。 */
const handleToggle = async (): Promise<void> => {
// currentPlayer 是按钮点击时已经存在的解码器实例。
const currentPlayer = playerRef.current;
if (currentPlayer?.isPlaying()) {
currentPlayer.pause();
return;
}
if (currentPlayer?.isPaused()) {
announceAudioPlayback(messageKey);
currentPlayer.resume();
return;
}
if (currentPlayer?.isInit()) {
announceAudioPlayback(messageKey);
currentPlayer.play();
return;
}
if (playbackState === 'loading') return;
// generation 是本次动态导入和网络解码的代次,地址切换或卸载会令其失效。
const generation = generationRef.current + 1;
generationRef.current = generation;
setPlaybackState('loading');
setProgress(0);
try {
// player 拥有这条消息的解码缓存;解码器随聊天路由加载,媒体数据仍只在首次点击时下载。
const player = new BenzAMRRecorder();
playerRef.current = player;
bindPlayerEvents(player, generation);
await player.initWithUrl(secureAudioURL(src));
if (generationRef.current !== generation || playerRef.current !== player) {
player.destroy();
return;
}
setDuration(player.getDuration() || Math.max(0, initialDuration));
announceAudioPlayback(messageKey);
player.play();
} catch (loadError /* loadError 可能来自跨域下载或 AMR 解码,界面仅显示可重试提示。 */) {
if (generationRef.current !== generation) return;
playerRef.current?.destroy();
playerRef.current = null;
setPlaybackState('error');
setProgress(0);
}
};
// visibleSeconds 在播放或暂停时显示当前进度,其余状态显示平台或解码器提供的总时长。
const visibleSeconds = playbackState === 'playing' || playbackState === 'paused' ? progress : duration;
// timeLabel 在静止状态突出总时长,播放时再补充当前进度,避免占用单行语音气泡的垂直空间。
const timeLabel = duration > 0 ? (playbackState === 'playing' || playbackState === 'paused' ? `${formatAudioTime(visibleSeconds)} / ${formatAudioTime(duration)}` : formatAudioTime(duration)) : '--:--';
// statusLabel 为播放器状态提供不依赖图标和颜色的可读说明。
const statusLabel = playbackState === 'loading' ? '正在解码'
: playbackState === 'playing' ? '正在播放'
: playbackState === 'paused' ? '已暂停'
: playbackState === 'error' ? '加载失败,点击重试'
: '语音消息';
// buttonLabel 为播放按钮提供完整的辅助技术操作名称。
const buttonLabel = playbackState === 'playing' ? '暂停语音消息'
: playbackState === 'paused' ? '继续播放语音消息'
: playbackState === 'error' ? '重新加载语音消息'
: playbackState === 'loading' ? '正在加载语音消息'
: '播放语音消息';
return (
<div className={`flex h-11 min-w-56 items-center gap-2 rounded-2xl border px-2 shadow-sm ${outgoing ? 'rounded-br-md border-sky-400 bg-sky-500 text-white' : 'rounded-bl-md border-slate-200 bg-white text-slate-800'}`}>
<button
type="button"
aria-label={buttonLabel}
title={buttonLabel}
disabled={playbackState === 'loading'}
onClick={/* 当前回调把用户点击交给可重试的异步播放流程。 */ () => void handleToggle()}
className={`flex h-7 w-7 shrink-0 items-center justify-center rounded-full transition focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-wait ${outgoing ? 'bg-white text-sky-600 hover:bg-sky-50 focus-visible:ring-white' : 'bg-sky-50 text-sky-600 hover:bg-sky-100 focus-visible:ring-sky-400'}`}
>
{playbackState === 'loading' ? <Loader2 className="h-4 w-4 animate-spin" />
: playbackState === 'playing' ? <Pause className="h-4 w-4 fill-current" />
: playbackState === 'error' ? <RotateCcw className="h-4 w-4" />
: <Play className="ml-px h-4 w-4 fill-current" />}
</button>
<div className="min-w-0 flex flex-1 items-center gap-2">
<div className="flex h-5 flex-1 items-center gap-0.5" aria-hidden="true">
{waveformBars.map(/* barHeight 和 barIndex 分别决定稳定波形柱的像素高度与 React 键。 */ (barHeight, barIndex) => (
<span
key={`${messageKey}-${barIndex}`}
className={`w-0.5 rounded-full ${playbackState === 'playing' ? 'animate-pulse' : ''} ${outgoing ? 'bg-sky-100' : playbackState === 'error' ? 'bg-red-300' : 'bg-sky-400'}`}
style={{ height: `${barHeight}px`, animationDelay: `${barIndex * 45}ms` }}
/>
))}
</div>
<span className={`shrink-0 font-mono text-[11px] font-semibold tabular-nums ${outgoing ? 'text-sky-100' : playbackState === 'error' ? 'text-red-500' : 'text-slate-500'}`}>{timeLabel}</span>
<span className="sr-only">{statusLabel}</span>
</div>
</div>
);
};
+6 -2
View File
@@ -83,6 +83,8 @@ export interface ChatSession {
item_id?: string;
/** 会话关联商品标题。 */
item_title?: string;
/** 会话关联商品主图的公开地址。 */
item_image_url?: string;
/** 最近一条消息内容。 */
last_message: string;
/** 最近一条消息的 Unix 秒时间戳。 */
@@ -107,10 +109,12 @@ export interface ChatMessage {
sender_id: string;
/** 发送者名称。 */
sender_name: string;
/** 消息类型,system 表示平台通知或交易卡片。 */
message_type: 'text' | 'image' | 'video' | 'system';
/** 消息类型;audio 表示需在浏览器解码的语音,system 表示平台通知或交易卡片。 */
message_type: 'text' | 'image' | 'video' | 'audio' | 'system';
/** 消息正文或媒体地址。 */
content: string;
/** 语音消息的秒级时长;非语音或平台未提供时省略。 */
media_duration?: number;
/** 消息发送状态。 */
status: 'received' | 'sending' | 'sent' | 'failed';
/** 平台已读状态;旧消息可能没有该字段。 */
+8 -2
View File
@@ -5,6 +5,7 @@ Search,Send,Smile,UserRound,Wifi,WifiOff,X,
import React from 'react';
import Lightbox from 'yet-another-react-lightbox';
import 'yet-another-react-lightbox/styles.css';
import { AudioMessage } from '../components/AudioMessage';
import { useChat } from '../hooks';
import { unreadBadgeClassName,unreadBadgeLabel } from '../state';
@@ -96,14 +97,13 @@ const Chat: React.FC = () => {
<div className="min-h-0 flex-1 overflow-y-auto">
{filteredSessions.map(/* 当前回调处理集合中的单个元素。 */ session => (
<button key={session.chat_id} type="button" onClick={/* 当前回调处理用户交互或异步状态变化。 */ () => setActiveChatID(session.chat_id)}
className={`flex w-full gap-3 border-b border-slate-100 p-4 text-left transition-colors ${session.chat_id === activeChatID ? 'bg-white shadow-chat-active' : 'hover:bg-white/80'}`}>
className={`flex w-full gap-3 border-b border-slate-100 p-3.5 text-left transition-colors ${session.chat_id === activeChatID ? 'bg-white shadow-chat-active' : 'hover:bg-white/80'}`}>
<div className="flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-slate-200 text-slate-500">
{session.buyer_avatar_url ? <img src={session.buyer_avatar_url} alt="" className="h-full w-full object-cover" /> : <UserRound className="h-5 w-5" />}
</div>
<div className="min-w-0 flex-1">
<div className="flex items-center gap-2">
<span className="truncate text-sm font-extrabold text-slate-900">{session.buyer_name || `用户 ${session.buyer_id}`}</span>
<span className="ml-auto shrink-0 text-[10px] font-medium text-slate-400">{formatClock(session.last_message_at)}</span>
</div>
<div className="mt-1 flex items-center gap-2">
<span className="truncate text-xs text-slate-500">{session.last_message || '暂无消息'}</span>
@@ -111,6 +111,10 @@ const Chat: React.FC = () => {
</div>
{session.item_title && <div className="mt-1.5 truncate text-[10px] font-medium text-sky-700">商品 · {session.item_title}</div>}
</div>
<div className="flex shrink-0 flex-col items-end gap-1.5">
<span className="text-[10px] font-medium text-slate-400">{formatClock(session.last_message_at)}</span>
{session.item_image_url && <img src={session.item_image_url} alt="" className="h-9 w-11 rounded-[4px] border border-slate-200 object-cover" />}
</div>
</button>
))}
{filteredSessions.length === 0 && <div className="px-6 py-16 text-center text-sm text-slate-400">当前账号暂无匹配会话</div>}
@@ -171,6 +175,8 @@ const Chat: React.FC = () => {
</button>
) : message.message_type === 'video' ? (
<video src={message.content} controls preload="metadata" className="max-h-80 max-w-full rounded-2xl bg-black" />
) : message.message_type === 'audio' ? (
<AudioMessage messageKey={message.message_key} src={message.content} outgoing={outgoing} initialDuration={message.media_duration} />
) : (
<div className={`rounded-2xl px-4 py-2.5 text-sm leading-6 shadow-sm ${outgoing ? 'rounded-br-md bg-sky-500 text-white' : 'rounded-bl-md border border-slate-200 bg-white text-slate-800'}`}>{renderXianyuText(message.content)}</div>
)}
+6 -1
View File
@@ -38,8 +38,13 @@ describe('online chat UI contract', () => {
expect(chat).toContain('activeAccount?.avatar_url');
expect(chat).toContain("message.message_type === 'image'");
expect(chat).toContain("message.message_type === 'video'");
expect(chat).toContain("message.message_type === 'audio'");
expect(chat).toContain('initialDuration={message.media_duration}');
expect(chat).toContain('session.item_image_url');
expect(chat).toContain('rounded-[4px]');
expect(chat).toContain('<AudioMessage');
expect(chatHook).toContain('sendChatImage');
} /* 测试回调断言头像、媒体类型及发送 API 的渲染能力。 */);
} /* 测试回调断言头像、图片、视频、语音及发送 API 的渲染能力。 */);
test('renders official notices as neutral system messages', () => {
const chat = source('app/features/chat/pages/Chat.tsx'); /* chat 表示chat。 */
+16
View File
@@ -9,6 +9,7 @@
"version": "0.0.0",
"dependencies": {
"axios": "^1.13.2",
"benz-amr-recorder": "^1.1.5",
"lucide-react": "^0.562.0",
"openapi-fetch": "^0.14.0",
"react": "^19.2.3",
@@ -2204,6 +2205,21 @@
"node": ">=6.0.0"
}
},
"node_modules/benz-amr-recorder": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/benz-amr-recorder/-/benz-amr-recorder-1.1.5.tgz",
"integrity": "sha512-NepctcNTsZHK8NxBb5uKO5p8S+xkbm+vD6GLSkCYdJeEsriexvgumLHpDkanX4QJBcLRMVtg16buWMs+gUPB3g==",
"license": "MIT",
"dependencies": {
"benz-recorderjs": "^1.0.5"
}
},
"node_modules/benz-recorderjs": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/benz-recorderjs/-/benz-recorderjs-1.0.5.tgz",
"integrity": "sha512-EwedOQo9KLti7HxDi/eZY51PSRbAXnOdEZmLvJ6ro3QQSoF9Y3AXBt57MIllGvVz5vtFYMeikG+GD7qTm3+p9w==",
"license": "MIT"
},
"node_modules/bidi-js": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz",
+1
View File
@@ -16,6 +16,7 @@
},
"dependencies": {
"axios": "^1.13.2",
"benz-amr-recorder": "^1.1.5",
"lucide-react": "^0.562.0",
"openapi-fetch": "^0.14.0",
"react": "^19.2.3",
@@ -2460,6 +2460,7 @@ export interface components {
buyer_avatar_url?: string;
item_id?: string;
item_title?: string;
item_image_url?: string;
last_message: string;
last_message_at: number;
unread_count: number;
@@ -2474,8 +2475,9 @@ export interface components {
sender_id: string;
sender_name: string;
/** @enum {string} */
message_type: "text" | "image" | "video" | "system";
message_type: "text" | "image" | "video" | "audio" | "system";
content: string;
media_duration?: number;
/** @enum {string} */
status: "received" | "sending" | "sent" | "failed";
read_status?: number;
+4
View File
@@ -78,6 +78,10 @@ export default defineConfig({
if (modulePath.includes('/lucide-react/')) {
return 'icons-vendor';
}
// AMR 解码器体积较大,随聊天懒加载路由使用独立块,避免拖慢应用首屏并保持依赖可审计。
if (modulePath.includes('/benz-amr-recorder/')) {
return 'audio-codec';
}
return 'vendor';
},
},
+2 -2
View File
@@ -31,7 +31,7 @@ func (a *Adapter) HandleChatMessage(ctx context.Context, message engine.ChatMess
// selfID 保存当前账号从 Cookie 解析出的平台用户标识,用于过滤同账号 WebSocket 回显。
if selfID := protocol.TransCookies(message.CookieStr)["unb"]; selfID != "" &&
strings.TrimSuffix(strings.TrimSpace(message.SenderUserID), "@goofish") == strings.TrimSuffix(strings.TrimSpace(selfID), "@goofish") {
a.logger.Info("忽略账号自身发送的聊天回显", "account", message.AccountID, "chat_id", message.ChatID, "sender_id", message.SenderUserID)
a.logger.Debug("忽略账号自身发送的聊天回显", "account", message.AccountID, "chat_id", message.ChatID, "sender_id", message.SenderUserID)
return nil
}
// stored、inserted、err 保存落库消息、是否首次插入及持久化错误。
@@ -77,7 +77,7 @@ func (a *Adapter) HandleMessageRead(ctx context.Context, event engine.MessageRea
return err
}
if err == nil && message != nil {
a.logger.Info("聊天出站消息已标记已读", "account", event.AccountID, "chat_id", event.ChatID,
a.logger.Debug("聊天出站消息已标记已读", "account", event.AccountID, "chat_id", event.ChatID,
"message_id", event.MessageID, "message_key", message.MessageKey, "read_status", message.ReadStatus)
}
return nil
@@ -11,11 +11,11 @@ import (
// TestChatSessionFromApplicationKeepsNonSensitiveFields 验证会话转换只复制非敏感展示字段。
func TestChatSessionFromApplicationKeepsNonSensitiveFields(t *testing.T) {
// session 保存应用层聊天会话摘要。
session := chatapp.Session{AccountID: "account-1", ChatID: "chat-1", BuyerID: "buyer-1", BuyerName: "买家", BuyerAvatar: "avatar", ItemID: "item-1", ItemTitle: "商品", LastMessage: "你好", LastMessageAt: 42, UnreadCount: 3}
session := chatapp.Session{AccountID: "account-1", ChatID: "chat-1", BuyerID: "buyer-1", BuyerName: "买家", BuyerAvatar: "avatar", ItemID: "item-1", ItemTitle: "商品", ItemImageURL: "https://img.example/item.jpg", LastMessage: "你好", LastMessageAt: 42, UnreadCount: 3}
// converted 保存转换后的 legacy 聊天会话模型。
converted := ChatSessionFromApplication(session)
// expected 保存应由领域仓储接收的非敏感会话字段。
expected := db.ChatSession{CookieID: "account-1", ChatID: "chat-1", BuyerID: "buyer-1", BuyerName: "买家", BuyerAvatar: "avatar", ItemID: "item-1", ItemTitle: "商品", LastMessage: "你好", LastMessageAt: 42, UnreadCount: 3}
expected := db.ChatSession{CookieID: "account-1", ChatID: "chat-1", BuyerID: "buyer-1", BuyerName: "买家", BuyerAvatar: "avatar", ItemID: "item-1", ItemTitle: "商品", ItemImageURL: "https://img.example/item.jpg", LastMessage: "你好", LastMessageAt: 42, UnreadCount: 3}
if !reflect.DeepEqual(converted, expected) {
t.Fatalf("聊天会话转换异常: got=%+v want=%+v", converted, expected)
}
@@ -24,14 +24,14 @@ func TestChatSessionFromApplicationKeepsNonSensitiveFields(t *testing.T) {
// TestChatMessagesFromDBKeepsMessageContract 验证数据库消息转换为应用消息时完整保留 API 所需字段。
func TestChatMessagesFromDBKeepsMessageContract(t *testing.T) {
// messages 保存 legacy 聊天仓储返回的消息模型。
messages := []db.ChatMessage{{ID: 7, CookieID: "account-1", ChatID: "chat-1", MessageKey: "key-1", Direction: "incoming", SenderID: "buyer-1", SenderName: "买家", MessageType: "text", Content: "你好", Status: "received", ReadStatus: 2, ReadAt: 88, SentAt: 99}}
messages := []db.ChatMessage{{ID: 7, CookieID: "account-1", ChatID: "chat-1", MessageKey: "key-1", Direction: "incoming", SenderID: "buyer-1", SenderName: "买家", MessageType: "audio", Content: "https://media.example/voice.amr", MediaDuration: 3, Status: "received", ReadStatus: 2, ReadAt: 88, SentAt: 99}}
// converted 保存不再暴露数据库模型的应用层消息。
converted := ChatMessagesFromDB(messages)
if len(converted) != 1 {
t.Fatalf("消息数量异常: got=%d", len(converted))
}
// expected 保存应用层消息字段。
expected := chatapp.Message{ID: 7, AccountID: "account-1", ChatID: "chat-1", MessageKey: "key-1", Direction: "incoming", SenderID: "buyer-1", SenderName: "买家", MessageType: "text", Content: "你好", Status: "received", ReadStatus: 2, ReadAt: 88, SentAt: 99}
expected := chatapp.Message{ID: 7, AccountID: "account-1", ChatID: "chat-1", MessageKey: "key-1", Direction: "incoming", SenderID: "buyer-1", SenderName: "买家", MessageType: "audio", Content: "https://media.example/voice.amr", MediaDuration: 3, Status: "received", ReadStatus: 2, ReadAt: 88, SentAt: 99}
if !reflect.DeepEqual(converted[0], expected) {
t.Fatalf("聊天消息转换异常: got=%+v want=%+v", converted[0], expected)
}
+2 -2
View File
@@ -37,7 +37,7 @@ func (r chatRepository) ListMessages(ctx context.Context, userID int64, accountI
messages = append(messages, chatapp.Message{
ID: row.ID, AccountID: row.CookieID, ChatID: row.ChatID, MessageKey: row.MessageKey,
Direction: row.Direction, SenderID: row.SenderID, SenderName: row.SenderName,
MessageType: row.MessageType, Content: row.Content, Status: row.Status,
MessageType: row.MessageType, Content: row.Content, MediaDuration: row.MediaDuration, Status: row.Status,
ReadStatus: row.ReadStatus, ReadAt: row.ReadAt, SentAt: row.SentAt,
})
}
@@ -58,7 +58,7 @@ func (r chatRepository) ListSessions(ctx context.Context, userID int64, accountI
sessions = append(sessions, chatapp.Session{
AccountID: row.CookieID, ChatID: row.ChatID, BuyerID: row.BuyerID,
BuyerName: row.BuyerName, BuyerAvatar: row.BuyerAvatar, ItemID: row.ItemID,
ItemTitle: row.ItemTitle, LastMessage: row.LastMessage, LastMessageAt: row.LastMessageAt,
ItemTitle: row.ItemTitle, ItemImageURL: row.ItemImageURL, LastMessage: row.LastMessage, LastMessageAt: row.LastMessageAt,
UnreadCount: row.UnreadCount,
})
}
+7 -2
View File
@@ -36,8 +36,13 @@ func (subscriptionDomainRepository) SaveMessage(_ context.Context, _ db.ChatSess
return &message, true, nil
}
// UpdateMessageType 满足领域聊天仓储接口的消息类型更新能力。
func (subscriptionDomainRepository) UpdateMessageType(context.Context, string, string, string) error {
// UpdateMessageContent 满足领域聊天仓储接口的富媒体分类与地址更新能力。
func (subscriptionDomainRepository) UpdateMessageContent(context.Context, string, string, string, string) error {
return nil
}
// UpdateMessageMediaDuration 满足领域聊天仓储接口的富媒体时长更新能力。
func (subscriptionDomainRepository) UpdateMessageMediaDuration(context.Context, string, string, int64) error {
return nil
}
+2 -2
View File
@@ -108,7 +108,7 @@ func dbChatSession(session chatapp.Session) db.ChatSession {
return db.ChatSession{
CookieID: session.AccountID, ChatID: session.ChatID, BuyerID: session.BuyerID,
BuyerName: session.BuyerName, BuyerAvatar: session.BuyerAvatar, ItemID: session.ItemID,
ItemTitle: session.ItemTitle, LastMessage: session.LastMessage, LastMessageAt: session.LastMessageAt,
ItemTitle: session.ItemTitle, ItemImageURL: session.ItemImageURL, LastMessage: session.LastMessage, LastMessageAt: session.LastMessageAt,
UnreadCount: session.UnreadCount,
}
}
@@ -121,7 +121,7 @@ func chatApplicationMessage(message *db.ChatMessage) chatapp.Message {
return chatapp.Message{
ID: message.ID, AccountID: message.CookieID, ChatID: message.ChatID, MessageKey: message.MessageKey,
Direction: message.Direction, SenderID: message.SenderID, SenderName: message.SenderName,
MessageType: message.MessageType, Content: message.Content, Status: message.Status,
MessageType: message.MessageType, Content: message.Content, MediaDuration: message.MediaDuration, Status: message.Status,
ReadStatus: message.ReadStatus, ReadAt: message.ReadAt, SentAt: message.SentAt,
}
}
+1 -1
View File
@@ -103,7 +103,7 @@ func chatApplicationSession(session *db.ChatSession) chatapp.Session {
return chatapp.Session{
AccountID: session.CookieID, ChatID: session.ChatID, BuyerID: session.BuyerID,
BuyerName: session.BuyerName, BuyerAvatar: session.BuyerAvatar, ItemID: session.ItemID,
ItemTitle: session.ItemTitle, LastMessage: session.LastMessage, LastMessageAt: session.LastMessageAt,
ItemTitle: session.ItemTitle, ItemImageURL: session.ItemImageURL, LastMessage: session.LastMessage, LastMessageAt: session.LastMessageAt,
UnreadCount: session.UnreadCount,
}
}
+4
View File
@@ -46,6 +46,8 @@ type Message struct {
MessageType string
// Content 是文本或媒体地址,不包含平台凭证。
Content string
// MediaDuration 是语音消息的秒级时长;非语音或平台未提供时为零。
MediaDuration int64
// Status 是消息投递状态。
Status string
// ReadStatus 是平台确认的读取状态;值为 2 表示对方已读,其他值表示尚未确认。
@@ -72,6 +74,8 @@ type Session struct {
ItemID string
// ItemTitle 是会话关联商品标题。
ItemTitle string
// ItemImageURL 是会话关联商品主图的公开地址。
ItemImageURL string
// LastMessage 是最近消息摘要。
LastMessage string
// LastMessageAt 是最近消息时间的 Unix 秒时间戳。
+7 -1
View File
@@ -5,6 +5,8 @@ import (
"errors"
"fmt"
"time"
"xianyu-go/internal/db"
)
// handleAIPricingMode 在订单创建事件中优先执行 AI 报价,并阻止互斥的固定价格规则继续运行。
@@ -30,11 +32,15 @@ func (c *Center) handleAIPricingMode(ctx context.Context, task Task) (bool, erro
}
// quote 是与账号、买家、商品、会话和有效期匹配后原子领取的最新报价;claimErr 是领取错误。
quote, claimErr := c.store.AIReply.ClaimPendingQuote(ctx, task.AccountID, task.ChatID, task.BuyerID, task.ItemID, task.OrderID, time.Now().UTC().Unix())
if errors.Is(claimErr, db.ErrAIBargainQuoteAlreadyClaimed) {
c.logger.Debug("订单已领取 AI 报价,忽略重复订单事件", "account", task.AccountID, "order_id", task.OrderID)
return true, nil
}
if claimErr != nil {
return true, fmt.Errorf("领取 AI 自动改价报价: %w", claimErr)
}
if quote == nil {
c.logger.Info("订单没有可用的 AI 有效报价,不执行改价", "account", task.AccountID, "order_id", task.OrderID, "item_id", task.ItemID)
c.logger.Debug("订单没有可用的 AI 有效报价,不执行改价", "account", task.AccountID, "order_id", task.OrderID, "item_id", task.ItemID)
return true, nil
}
// targetPriceCents 是 AI 单件报价按已知购买数量折算后的订单目标总价。
+139 -1
View File
@@ -203,9 +203,136 @@ func fieldsFromRaw(raw map[string]any) rawFields {
f.orderID = matchOrderID(f.reminderURL)
}
}
// 平台交易卡片会随客户端版本把订单事实移动到不同嵌套层级或 JSON 字符串中;
// 固定路径未命中时,只补齐仍为空的明确业务字段,不能覆盖已按优先路径解析出的事实。
if f.chatID == "" || f.orderID == "" || f.itemID == "" || f.buyerID == "" {
supplementEventFacts(&f, raw, 0)
}
return f
}
// fallbackEventFactsMaxDepth 限制平台原始报文递归解析深度,避免异常报文占用无限栈空间。
const fallbackEventFactsMaxDepth = 16
// supplementEventFacts 从非固定层级的对象、数组和内嵌 JSON 中补齐交易事实。
// 它只接受具有明确字段名或交易链接语义的值,不会从普通聊天正文猜测订单标识。
func supplementEventFacts(fields *rawFields, value any, depth int) {
if fields == nil || value == nil || depth > fallbackEventFactsMaxDepth {
return
}
switch // typedValue 保存当前原始节点按运行时类型断言后的值。
typedValue := value.(type) {
case map[string]any:
// key、nestedValue 分别是当前对象字段名和待继续解析的字段值。
for key, nestedValue := range typedValue {
supplementEventFactByKey(fields, key, nestedValue)
supplementEventFacts(fields, nestedValue, depth+1)
}
case []any:
// nestedValue 是当前数组中的报文节点。
for _, nestedValue := range typedValue {
supplementEventFacts(fields, nestedValue, depth+1)
}
case string:
// text 是去除两端空白后的原始字符串,可能是交易链接或内嵌 JSON。
text := strings.TrimSpace(typedValue)
if fields.orderID == "" {
fields.orderID = matchOrderID(text)
}
if !strings.HasPrefix(text, "{") && !strings.HasPrefix(text, "[") {
return
}
// nestedValue 是内嵌 JSON 反序列化后的节点;解析失败时该字符串不携带可安全识别的结构化事实。
var nestedValue any
if json.Unmarshal([]byte(text), &nestedValue) == nil {
supplementEventFacts(fields, nestedValue, depth+1)
}
}
}
// supplementEventFactByKey 按平台字段名补齐一项交易事实,并保留固定路径优先的已有值。
func supplementEventFactByKey(fields *rawFields, key string, value any) {
if fields == nil {
return
}
// normalizedKey 是移除大小写、下划线和短横线差异后的平台字段名。
normalizedKey := normalizeEventFactKey(key)
// text 是当前字段的字符串形式;数字订单号会由 JSON 解码后的数值统一转换。
text := strings.TrimSpace(strAny(value))
switch normalizedKey {
case "orderid", "bizorderid", "tradeid", "orderno", "tradeno":
if fields.orderID == "" {
fields.orderID = directOrderID(text)
}
case "updatekey":
if fields.updateKey == "" {
fields.updateKey = text
}
// chatID、orderID 是 updateKey 中稳定编码的会话和订单标识。
chatID, orderID := parseUpdateKey(text)
if fields.chatID == "" {
fields.chatID = chatID
}
if fields.orderID == "" {
fields.orderID = orderID
}
case "chatid", "sessionid", "sid":
if fields.chatID == "" {
fields.chatID = trimGoofishSID(text)
}
case "itemid", "auctionid":
if fields.itemID == "" {
fields.itemID = text
}
case "buyerid", "peeruserid", "senderuserid":
if fields.buyerID == "" {
fields.buyerID = text
}
case "reminderurl", "targeturl", "url", "deeplink", "link":
supplementEventFactsFromURL(fields, text)
}
}
// normalizeEventFactKey 统一平台字段名的大小写和分隔符,兼容同一字段的不同协议命名。
func normalizeEventFactKey(key string) string {
// normalized 是去除字段名分隔符并转为小写后的比较值。
normalized := strings.ReplaceAll(strings.ReplaceAll(strings.TrimSpace(key), "_", ""), "-", "")
return strings.ToLower(normalized)
}
// directOrderID 校验直接字段中的闲鱼订单标识,避免把普通文本或短数字误用为可执行订单号。
func directOrderID(value string) string {
if len(value) < 10 {
return ""
}
// character 是订单标识中的当前字符;闲鱼交易订单号只允许十进制数字。
for _, character := range value {
if character < '0' || character > '9' {
return ""
}
}
return value
}
// supplementEventFactsFromURL 从交易跳转链接补齐订单、商品、买家和会话标识。
func supplementEventFactsFromURL(fields *rawFields, rawURL string) {
if fields == nil || strings.TrimSpace(rawURL) == "" {
return
}
if fields.itemID == "" {
fields.itemID = queryValue(rawURL, "itemId")
}
if fields.buyerID == "" {
fields.buyerID = queryValue(rawURL, "peerUserId")
}
if fields.chatID == "" {
fields.chatID = queryValue(rawURL, "sid")
}
if fields.orderID == "" {
fields.orderID = matchOrderID(rawURL)
}
}
// isOrderPaidEvent 封装is订单PaidEvent业务协调。
func isOrderPaidEvent(f rawFields) bool {
if f.orderRole == "buyer" {
@@ -224,11 +351,21 @@ func isOrderCreatedEvent(f rawFields) bool {
if f.orderRole == "buyer" {
return false
}
if isPriceModifiedEvent(f) {
return false
}
return strings.Contains(f.text, "我已拍下") ||
strings.Contains(f.text, "已拍下,待付款") ||
strings.Contains(f.redReminder, "等待买家付款")
}
// isPriceModifiedEvent 判断卖家改价后的确认卡片,避免它沿用“等待买家付款”文案时被重复识别为拍下事件。
func isPriceModifiedEvent(f rawFields) bool {
// displayText 汇总卡片的业务键和展示文本;这些字段都不包含用户聊天正文。
displayText := strings.ToUpper(strings.Join([]string{f.updateKey, f.text, f.redReminder, f.title, f.detail}, "\n"))
return strings.Contains(displayText, "TRADE_MODIFY_FEE") || strings.Contains(displayText, "我已修改价格")
}
// isBuyerReviewedEvent 封装is买家ReviewedEvent业务协调。
func isBuyerReviewedEvent(f rawFields) bool {
// 闲鱼评价样本:
@@ -340,7 +477,8 @@ var orderIDPatterns = []*regexp.Regexp{
regexp.MustCompile(`orderId[=:](\d{10,})`),
regexp.MustCompile(`order_detail\?id=(\d{10,})`),
regexp.MustCompile(`bizOrderId[=:](\d{10,})`),
regexp.MustCompile(`id=(\d{10,})`),
// 独立 id 参数必须位于查询参数边界,不能把 sid= 中的后缀误判为订单号。
regexp.MustCompile(`(?:^|[?&])id=(\d{10,})(?:[&#]|$)`),
}
// extractOrderRoleFromContent 封装extract订单RoleFrom内容业务协调。
+40
View File
@@ -153,6 +153,46 @@ func TestExtractTaskFromWS_OrderCreated(t *testing.T) {
}
}
// TestExtractTaskFromWS_OrderCreatedUsesNestedFallbackFacts 验证新版卡片将交易字段放入非固定嵌套 JSON 时,仍能生成完整的真实改价任务。
func TestExtractTaskFromWS_OrderCreatedUsesNestedFallbackFacts(t *testing.T) {
// raw 是保留既有展示文案、但把订单主键移动到扩展 JSON 的新版卖家交易卡片。
raw := mustMap(t, `{
"1": {
"2": "63107041124@goofish",
"10": {
"redReminder": "等待买家付款",
"reminderContent": "[我已拍下,待付款]",
"senderUserId": "2222315258815",
"reminderUrl": "fleamarket://message_chat?itemId=1063177864132&peerUserId=2222315258815&sid=63107041124"
},
"8": {"extra": "{\"trade\":{\"bizOrderId\":\"3310145690545023994\"}}"}
}
}`)
// task 是解析后的订单创建任务,必须具备领取 AI 报价和调用真实改价所需的四项事实。
task := ExtractTaskFromWS("acc1", "cookie", raw)
if task == nil || task.TriggerType != TriggerOrderCreated || task.OrderID != "3310145690545023994" ||
task.ChatID != "63107041124" || task.ItemID != "1063177864132" || task.BuyerID != "2222315258815" {
t.Fatalf("新版卡片任务=%+v", task)
}
}
// TestExtractTaskFromWS_PriceModifiedEventIgnored 验证改价确认卡片不会因“等待买家付款”提示被重复识别为订单创建。
func TestExtractTaskFromWS_PriceModifiedEventIgnored(t *testing.T) {
// raw 是闲鱼在卖家改价成功后推送的确认卡片,沿用待付款提醒但业务键明确为改价。
raw := mustMap(t, `{
"1": {"2": "65854441361@goofish", "10": {
"redReminder": "等待买家付款",
"reminderContent": "[我已修改价格,等待你付款]",
"extJson": "{\"updateKey\":\"65854441361:5127636708304071608:2:TRADE_MODIFY_FEE_SELLER:26\"}"
}}
}`)
// task 是改价确认卡片的自动化解析结果,正确行为是不产生任何订单创建任务。
task := ExtractTaskFromWS("acc1", "cookie", raw)
if task != nil {
t.Fatalf("改价确认卡片不应触发自动改价: %+v", task)
}
}
// TestExtractTaskFromWS_BuyerOrderCreatedIgnored 校验买家角色的拍下卡片不进入卖家自动化。
func TestExtractTaskFromWS_BuyerOrderCreatedIgnored(t *testing.T) {
// raw 是当前账号自己下单产生的买家角色拍下卡片样本。
+49
View File
@@ -0,0 +1,49 @@
// Package chat 提供闲鱼实时与历史聊天载荷的非敏感展示字段归一能力。
package chat
import "encoding/json"
// extractMediaDuration 递归读取语音载荷的 duration 字段,避免将视频等其他媒体时长误用于语音展示。
// raw 是实时或历史协议的解码对象;messageType 已由媒体地址分类确定;返回值为正整数秒,缺失时为零。
func extractMediaDuration(raw map[string]any, messageType string) int64 {
if messageType != "audio" {
return 0
}
// inspect 从任意嵌套 JSON 容器中定位语音对象,遇到第一个正数秒值即结束。
var inspect func(any) int64
inspect = func(value any) int64 {
switch // typed 是当前递归节点的协议原始类型。
typed := value.(type) {
case string:
// nested 保存成功反序列化的内层 JSON,实时 WebSocket 经常将其作为字符串封装。
var nested any
if json.Unmarshal([]byte(typed), &nested) == nil {
return inspect(nested)
}
case map[string]any:
// audio 保存当前消息的语音元数据对象;只有其 duration 具备媒体语义。
audio := mapValue(typed["audio"])
// duration 保存当前语音对象声明的秒级时长,正数表示可以直接用于播放前展示。
if duration := int64Value(audio["duration"]); duration > 0 {
return duration
}
// child 是当前对象的子载荷,继续兼容协议多层包装。
for _, child := range typed {
// duration 保存当前子载荷递归解析出的秒级语音时长。
if duration := inspect(child); duration > 0 {
return duration
}
}
case []any:
// child 是当前数组中的一项协议载荷。
for _, child := range typed {
// duration 保存当前数组项递归解析出的秒级语音时长。
if duration := inspect(child); duration > 0 {
return duration
}
}
}
return 0
}
return inspect(raw)
}
+12 -5
View File
@@ -18,8 +18,10 @@ type Repository interface {
SyncSessionSummary(ctx context.Context, cookieID, chatID, summary string, sentAt, observedModifyAt int64, unread int) error
// SaveMessage 幂等保存聊天消息并返回落库结果。
SaveMessage(ctx context.Context, session db.ChatSession, message db.ChatMessage, unread bool) (*db.ChatMessage, bool, error)
// UpdateMessageType 更新历史消息的展示类型。
UpdateMessageType(ctx context.Context, cookieID, key, messageType string) error
// UpdateMessageContent 用历史接口返回的富媒体分类和地址纠正已有占位消息。
UpdateMessageContent(ctx context.Context, cookieID, key, messageType, content string) error
// UpdateMessageMediaDuration 用历史接口返回的秒级时长补齐已有富媒体消息。
UpdateMessageMediaDuration(ctx context.Context, cookieID, key string, duration int64) error
// UpdateMessageStatus 更新外发消息状态并返回最新消息。
UpdateMessageStatus(ctx context.Context, cookieID, key, status string) (*db.ChatMessage, error)
// CountUnreadUserMessages 返回当前会话中非系统入站消息的未读数量。
@@ -61,9 +63,14 @@ func (r storeRepository) SaveMessage(ctx context.Context, session db.ChatSession
return r.store.Chats.SaveMessage(ctx, session, message, unread)
}
// UpdateMessageType 委托历史消息类型更新。
func (r storeRepository) UpdateMessageType(ctx context.Context, cookieID, key, messageType string) error {
return r.store.Chats.UpdateMessageType(ctx, cookieID, key, messageType)
// UpdateMessageContent 委托历史消息富媒体分类与内容更新。
func (r storeRepository) UpdateMessageContent(ctx context.Context, cookieID, key, messageType, content string) error {
return r.store.Chats.UpdateMessageContent(ctx, cookieID, key, messageType, content)
}
// UpdateMessageMediaDuration 委托历史消息秒级时长更新。
func (r storeRepository) UpdateMessageMediaDuration(ctx context.Context, cookieID, key string, duration int64) error {
return r.store.Chats.UpdateMessageMediaDuration(ctx, cookieID, key, duration)
}
// UpdateMessageStatus 委托外发消息状态更新。
+9 -2
View File
@@ -34,8 +34,15 @@ func (*fakeRepository) SaveMessage(_ context.Context, _ db.ChatSession, message
return &message, true, nil
}
// UpdateMessageType 模拟更新历史消息类型。
func (*fakeRepository) UpdateMessageType(context.Context, string, string, string) error { return nil }
// UpdateMessageContent 模拟更新历史消息的富媒体分类和地址。
func (*fakeRepository) UpdateMessageContent(context.Context, string, string, string, string) error {
return nil
}
// UpdateMessageMediaDuration 模拟更新历史语音的秒级时长。
func (*fakeRepository) UpdateMessageMediaDuration(context.Context, string, string, int64) error {
return nil
}
// UpdateMessageStatus 模拟更新外发消息状态。
func (*fakeRepository) UpdateMessageStatus(_ context.Context, _ string, _ string, status string) (*db.ChatMessage, error) {
+27 -9
View File
@@ -148,7 +148,7 @@ func (s *Service) RecordConversationPage(ctx context.Context, accountID, myID st
unreadCount := s.conversationUnreadCount(ctx, accountID, cid, peerID, conv, last, summary)
// session 保存待写入的非敏感会话摘要及归一后的未读数量。
session := db.ChatSession{CookieID: accountID, ChatID: cid, BuyerID: peerID, BuyerName: peerName, BuyerAvatar: avatar,
ItemID: cleanNilString(ext["itemId"]), ItemTitle: cleanNilString(ext["itemTitle"]), LastMessage: summary,
ItemID: cleanNilString(ext["itemId"]), ItemTitle: cleanNilString(ext["itemTitle"]), ItemImageURL: cleanNilString(ext["itemMainPic"]), LastMessage: summary,
LastMessageAt: lastMessageAt, UnreadCount: unreadCount}
if // err 用于本次流程后续判断的err
err := s.repository.UpsertSession(ctx, session); err != nil {
@@ -397,9 +397,11 @@ func (s *Service) RecordIncoming(ctx context.Context, in Incoming) (*db.ChatMess
// session 用于本次流程后续判断的会话
session := db.ChatSession{CookieID: in.AccountID, ChatID: in.ChatID, BuyerID: in.BuyerID,
BuyerName: in.BuyerName, BuyerAvatar: extractString(in.Raw, "avatar", "avatarUrl", "senderAvatar"),
ItemID: in.ItemID, ItemTitle: extractString(in.Raw, "itemTitle", "title")}
ItemID: in.ItemID, ItemTitle: extractString(in.Raw, "itemTitle", "title"), ItemImageURL: extractString(in.Raw, "itemMainPic", "itemImage", "itemImageUrl")}
// messageType、content 用于本次流程后续判断的消息Type、content
messageType, content := extractMessageContent(in.Raw, in.Text)
// mediaDuration 保存平台语音载荷的秒级时长;非语音或缺失时保持零值。
mediaDuration := extractMediaDuration(in.Raw, messageType)
if isOfficialSystemMessage(in.Raw, in.BuyerID, in.Text) {
messageType = "system"
if strings.TrimSuffix(strings.TrimSpace(in.BuyerID), "@goofish") == "1400" {
@@ -410,7 +412,7 @@ func (s *Service) RecordIncoming(ctx context.Context, in Incoming) (*db.ChatMess
}
// message 用于本次流程后续判断的消息
message := db.ChatMessage{MessageKey: key, Direction: "incoming", SenderID: in.BuyerID,
SenderName: in.BuyerName, MessageType: messageType, Content: content, Status: "received", SentAt: sentAt}
SenderName: in.BuyerName, MessageType: messageType, Content: content, MediaDuration: mediaDuration, Status: "received", SentAt: sentAt}
// stored、inserted、err 保存落库消息、首次插入标识及错误;系统消息永不增加用户红点。
stored, inserted, err := s.repository.SaveMessage(ctx, session, message, messageType != "system")
if err == nil && inserted {
@@ -446,12 +448,20 @@ func (s *Service) RecordHistoryPage(ctx context.Context, accountID, chatID, myID
if err != nil {
return page, err
}
if message.MessageType == "system" {
if // err 用于本次流程后续判断的err
err := s.repository.UpdateMessageType(ctx, accountID, message.MessageKey, "system"); err != nil {
return page, err
if message.MessageType != "text" && (stored.MessageType != message.MessageType || stored.Content != message.Content) {
// updateErr 保存历史接口用真实媒体地址纠正已有占位消息时的持久化错误。
if updateErr := s.repository.UpdateMessageContent(ctx, accountID, message.MessageKey, message.MessageType, message.Content); updateErr != nil {
return page, updateErr
}
stored.MessageType = "system"
stored.MessageType = message.MessageType
stored.Content = message.Content
}
if message.MediaDuration > 0 && stored.MediaDuration != message.MediaDuration {
// durationErr 保存把历史语音时长补齐到既有消息行时的持久化错误。
if durationErr := s.repository.UpdateMessageMediaDuration(ctx, accountID, message.MessageKey, message.MediaDuration); durationErr != nil {
return page, durationErr
}
stored.MediaDuration = message.MediaDuration
}
page.Messages = append(page.Messages, *stored)
}
@@ -506,6 +516,8 @@ func parseHistoryMessage(accountID, chatID, myID string, model map[string]any) (
}
// messageType、content 用于本次流程后续判断的消息Type、content
messageType, content := extractMessageContent(rawContent, fallback)
// mediaDuration 保存历史自定义载荷提供的语音时长,单位为秒。
mediaDuration := extractMediaDuration(rawContent, messageType)
if isOfficialSystemMessage(rawContent, senderID, fallback) {
messageType = "system"
if senderID == "1400" {
@@ -522,7 +534,7 @@ func parseHistoryMessage(accountID, chatID, myID string, model map[string]any) (
}
return db.ChatMessage{CookieID: accountID, ChatID: chatID, MessageKey: key, Direction: direction,
SenderID: senderID, SenderName: senderName, MessageType: messageType, Content: content,
Status: status, SentAt: int64Value(message["createAt"])}, true
MediaDuration: mediaDuration, Status: status, SentAt: int64Value(message["createAt"])}, true
}
// mapValue 封装map值业务协调。
@@ -609,6 +621,12 @@ func extractMessageContent(raw map[string]any, fallback string) (string, string)
return "video", mediaURL
}
}
if contentType == "3" || typed["audio"] != nil {
// mediaURL 保存闲鱼语音载荷中的 AMR 地址;同一载荷的秒级时长由独立解析器持久化。
if mediaURL := extractString(typed["audio"], "url", "audioUrl", "playUrl"); mediaURL != "" {
return "audio", mediaURL
}
}
// child 表示当前遍历过程中的child
for _, child := range typed {
if // kind、mediaURL 用于本次流程后续判断的kind、mediaURL
+65 -3
View File
@@ -70,6 +70,49 @@ func TestRecordHistoryPageParsesDirectionMediaAndDeduplicates(t *testing.T) {
}
}
// TestRecordHistoryPageRepairsStoredAudioPlaceholder 验证历史刷新能把旧版已落库的“[语音]”占位行升级为可播放 AMR 地址。
func TestRecordHistoryPageRepairsStoredAudioPlaceholder(t *testing.T) {
// store 和 cleanup 分别是 SQLite 测试存储及资源释放函数。
store, cleanup := chatTestStore(t)
defer cleanup()
// ctx 是本次占位消息写入和历史修复共享的测试上下文。
ctx := context.Background()
// service 是执行历史消息归一和富媒体纠正的聊天服务。
service := New(store)
// session 保存语音消息所属的非敏感会话信息。
session := db.ChatSession{CookieID: "account-1", ChatID: "audio-chat", BuyerID: "peer", BuyerName: "对方"}
if // saveErr 表示模拟旧版保存语音占位行时的数据库错误。
_, _, saveErr := store.Chats.SaveMessage(ctx, session, db.ChatMessage{
MessageKey: "audio-message", Direction: "incoming", SenderID: "peer", SenderName: "对方",
MessageType: "text", Content: "[语音]", Status: "received", SentAt: 3000,
}, false); saveErr != nil {
t.Fatal(saveErr)
}
// encodedAudio 是历史接口 custom.data 中 Base64 编码的真实语音载荷。
encodedAudio := base64.StdEncoding.EncodeToString([]byte(`{"contentType":3,"audio":{"duration":3,"url":"https://media.example/voice.amr"}}`))
// body 模拟同一平台消息稍后从历史接口返回完整 AMR 地址。
body := map[string]any{"userMessageModels": []any{
map[string]any{"message": map[string]any{
"messageId": "audio-message", "createAt": float64(3000),
"extension": map[string]any{"senderUserId": "peer@goofish", "reminderTitle": "对方"},
"content": map[string]any{"custom": map[string]any{"data": encodedAudio, "summary": "[语音]"}},
}},
}}
// page 和 historyErr 分别是修复后的历史页及处理错误。
page, historyErr := service.RecordHistoryPage(ctx, "account-1", "audio-chat", "self", session, body)
if historyErr != nil {
t.Fatal(historyErr)
}
if len(page.Messages) != 1 || page.Messages[0].MessageType != "audio" || page.Messages[0].Content != "https://media.example/voice.amr" || page.Messages[0].MediaDuration != 3 {
t.Fatalf("history audio was not repaired: %+v", page.Messages)
}
// stored 和 readErr 分别是数据库中修复后的消息及读取错误。
stored, readErr := store.Chats.GetMessageByKey(ctx, "account-1", "audio-message")
if readErr != nil || stored.MessageType != "audio" || stored.Content != "https://media.example/voice.amr" || stored.MediaDuration != 3 {
t.Fatalf("stored audio placeholder was not repaired: message=%+v err=%v", stored, readErr)
}
}
// TestRecordHistoryPageClassifiesOfficialCardsAsSystem 封装TestRecordHistory页码ClassifiesOfficial卡密列表As系统业务协调。
func TestRecordHistoryPageClassifiesOfficialCardsAsSystem(t *testing.T) {
// store、cleanup 用于本次流程后续判断的store、cleanup
@@ -168,7 +211,7 @@ func TestRecordConversationPageImportsHistoricalContacts(t *testing.T) {
// body 用于本次流程后续判断的请求体
body := map[string]any{"hasMore": true, "nextCursor": float64(888), "userConvs": []any{
map[string]any{"singleChatUserConversation": map[string]any{
"singleChatConversation": map[string]any{"cid": "history-cid@goofish", "pairFirst": "self@goofish", "pairSecond": "peer-9@goofish", "extension": `{"itemTitle":"旧商品"}`},
"singleChatConversation": map[string]any{"cid": "history-cid@goofish", "pairFirst": "self@goofish", "pairSecond": "peer-9@goofish", "extension": `{"itemTitle":"旧商品","itemMainPic":"https://img.example/history-item.jpg"}`},
"lastMessage": map[string]any{"message": map[string]any{"createAt": float64(123456), "extension": map[string]any{"senderUserId": "peer-9@goofish", "reminderTitle": "历史用户"}, "content": map[string]any{"custom": map[string]any{"data": encoded}}}},
"modifyTime": float64(987654), "redPoint": float64(2),
}},
@@ -194,6 +237,9 @@ func TestRecordConversationPageImportsHistoricalContacts(t *testing.T) {
if rows[0].LastMessageAt != 123456 {
t.Fatalf("used conversation modifyTime instead of last message createAt: %d", rows[0].LastMessageAt)
}
if rows[0].ItemImageURL != "https://img.example/history-item.jpg" {
t.Fatalf("conversation item image=%q", rows[0].ItemImageURL)
}
}
// TestRecordConversationPageHandlesXianxiaomiAndRemovesInvisibleSessions 封装TestRecordConversation页码HandlesXianxiaomiAndRemovesInvisibleSessions业务协调。
@@ -439,8 +485,8 @@ func TestIncomingMessagePersistsDeduplicatesAndPublishesByOwner(t *testing.T) {
}
}
// TestExtractMessageContentSupportsImageAndVideo 封装TestExtract消息内容Supports图片AndVideo业务协调。
func TestExtractMessageContentSupportsImageAndVideo(t *testing.T) {
// TestExtractMessageContentSupportsMedia 验证图片、视频和 AMR 语音载荷均归一为可展示的媒体地址。
func TestExtractMessageContentSupportsMedia(t *testing.T) {
// imageRaw 用于本次流程后续判断的图片原始
imageRaw := map[string]any{"payload": `{"contentType":2,"image":{"pics":[{"url":"https://cdn/image.jpg"}]}}`}
if // kind、content 用于本次流程后续判断的kind、content
@@ -453,6 +499,22 @@ func TestExtractMessageContentSupportsImageAndVideo(t *testing.T) {
kind, content := extractMessageContent(videoRaw, "[视频]"); kind != "video" || content != "https://cdn/video.mp4" {
t.Fatalf("video kind=%q content=%q", kind, content)
}
// audioRaw 模拟实时 WebSocket 中 1.6.3.5 携带的语音 JSON 字符串。
audioRaw := map[string]any{"1": map[string]any{"6": map[string]any{"3": map[string]any{"5": `{"contentType":3,"audio":{"duration":3,"url":"http://cdn.example/voice.amr"}}`}}}}
if // kind、content 分别是语音分类结果和供前端解码的 AMR 地址。
kind, content := extractMessageContent(audioRaw, "[语音]"); kind != "audio" || content != "http://cdn.example/voice.amr" {
t.Fatalf("audio kind=%q content=%q", kind, content)
}
// duration 保存从同一嵌套语音载荷提取出的秒级长度,必须在播放前就可供 UI 使用。
duration := extractMediaDuration(audioRaw, "audio")
if duration != 3 {
t.Fatalf("audio duration=%d, want 3", duration)
}
// nonAudioDuration 验证视频等媒体的 duration 不会误写入语音展示字段。
nonAudioDuration := extractMediaDuration(videoRaw, "video")
if nonAudioDuration != 0 {
t.Fatalf("non-audio duration=%d, want 0", nonAudioDuration)
}
if // kind、content 用于本次流程后续判断的kind、content
kind, content := extractMessageContent(nil, " 你好 "); kind != "text" || content != "你好" {
t.Fatalf("text kind=%q content=%q", kind, content)
+5 -4
View File
@@ -2,6 +2,7 @@ package db
import (
"context"
"errors"
"testing"
)
@@ -44,10 +45,10 @@ func TestAIBargainQuoteLifecycle(t *testing.T) {
if err != nil || claimed == nil || claimed.PriceCents != 9000 {
t.Fatalf("领取最新报价失败: quote=%+v err=%v", claimed, err)
}
// duplicate 是同一订单重复事件的领取结果,必须幂等为空。
duplicate, err := store.AIReply.ClaimPendingQuote(ctx, "quote-account", "chat-1", "buyer-1", "item-1", "order-1", 1000)
if err != nil || duplicate != nil {
t.Fatalf("重复订单不应再次领取: quote=%+v err=%v", duplicate, err)
// duplicate、duplicateErr 分别是同一订单重复事件的领取结果和幂等标识错误。
duplicate, duplicateErr := store.AIReply.ClaimPendingQuote(ctx, "quote-account", "chat-1", "buyer-1", "item-1", "order-1", 1000)
if !errors.Is(duplicateErr, ErrAIBargainQuoteAlreadyClaimed) || duplicate != nil {
t.Fatalf("重复订单应返回已领取标识: quote=%+v err=%v", duplicate, duplicateErr)
}
if err = store.AIReply.FinishQuote(ctx, claimed.ID, "adjusted", ""); err != nil {
t.Fatal(err)
+4 -1
View File
@@ -6,6 +6,9 @@ import (
"errors"
)
// ErrAIBargainQuoteAlreadyClaimed 表示同一订单已绑定过 AI 报价,重复事件不得再次执行外部改价。
var ErrAIBargainQuoteAlreadyClaimed = errors.New("AI 议价报价已被该订单领取")
// AIConversationMessage 是一个账号会话中的 AI 对话消息。
type AIConversationMessage struct {
Role string
@@ -200,7 +203,7 @@ func (a *AIReply) ClaimPendingQuote(ctx context.Context, cookieID, chatID, buyer
return nil, err
}
if existingCount > 0 {
return nil, nil
return nil, ErrAIBargainQuoteAlreadyClaimed
}
if _, err = tx.ExecContext(ctx, `UPDATE ai_bargain_quotes SET status='expired',updated_at=CURRENT_TIMESTAMP
WHERE cookie_id=? AND status='pending' AND expires_at<?`, cookieID, now); err != nil {
+49 -36
View File
@@ -11,13 +11,15 @@ import (
// ChatSession 用于本次流程后续判断的聊天会话
type ChatSession struct {
CookieID string `json:"account_id"`
ChatID string `json:"chat_id"`
BuyerID string `json:"buyer_id"`
BuyerName string `json:"buyer_name"`
BuyerAvatar string `json:"buyer_avatar_url"`
ItemID string `json:"item_id"`
ItemTitle string `json:"item_title"`
CookieID string `json:"account_id"`
ChatID string `json:"chat_id"`
BuyerID string `json:"buyer_id"`
BuyerName string `json:"buyer_name"`
BuyerAvatar string `json:"buyer_avatar_url"`
ItemID string `json:"item_id"`
ItemTitle string `json:"item_title"`
// ItemImageURL 是会话商品主图的公开地址,仅用于聊天列表展示。
ItemImageURL string `json:"item_image_url"`
LastMessage string `json:"last_message"`
LastMessageAt int64 `json:"last_message_at"`
UnreadCount int `json:"unread_count"`
@@ -34,10 +36,12 @@ type ChatMessage struct {
SenderName string `json:"sender_name"`
MessageType string `json:"message_type"`
Content string `json:"content"`
Status string `json:"status"`
ReadStatus int `json:"read_status"`
ReadAt int64 `json:"read_at,omitempty"`
SentAt int64 `json:"sent_at"`
// MediaDuration 是平台语音消息提供的秒级时长,非语音或缺失时为零。
MediaDuration int64 `json:"media_duration"`
Status string `json:"status"`
ReadStatus int `json:"read_status"`
ReadAt int64 `json:"read_at,omitempty"`
SentAt int64 `json:"sent_at"`
}
// ChatStore 用于本次流程后续判断的聊天Store
@@ -54,11 +58,11 @@ func (s *ChatStore) UpsertSession(ctx context.Context, session ChatSession) erro
prefix := dialectInsertIgnorePrefix(s.Dialect)
// query 用于本次流程后续判断的查询
query := prefix + ` INTO chat_sessions
(cookie_id,chat_id,buyer_id,buyer_name,buyer_avatar_url,item_id,item_title,last_message,last_message_at,unread_count,created_at,updated_at)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?)` + dialectInsertIgnore(s.Dialect, []string{"cookie_id", "chat_id"})
(cookie_id,chat_id,buyer_id,buyer_name,buyer_avatar_url,item_id,item_title,item_image_url,last_message,last_message_at,unread_count,created_at,updated_at)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)` + dialectInsertIgnore(s.Dialect, []string{"cookie_id", "chat_id"})
if // err 用于本次流程后续判断的err
_, err := s.DB.ExecContext(ctx, query, session.CookieID, session.ChatID, session.BuyerID, session.BuyerName,
session.BuyerAvatar, session.ItemID, session.ItemTitle, session.LastMessage, session.LastMessageAt,
session.BuyerAvatar, session.ItemID, session.ItemTitle, session.ItemImageURL, session.LastMessage, session.LastMessageAt,
session.UnreadCount, now, now); err != nil {
return err
}
@@ -69,11 +73,12 @@ func (s *ChatStore) UpsertSession(ctx context.Context, session ChatSession) erro
buyer_avatar_url=CASE WHEN ?<>'' THEN ? ELSE buyer_avatar_url END,
item_id=CASE WHEN ?<>'' THEN ? ELSE item_id END,
item_title=CASE WHEN ?<>'' THEN ? ELSE item_title END,
item_image_url=CASE WHEN ?<>'' THEN ? ELSE item_image_url END,
last_message=CASE WHEN last_message_at<=? THEN ? ELSE last_message END,
last_message_at=CASE WHEN last_message_at<=? THEN ? ELSE last_message_at END,
unread_count=CASE WHEN ?>unread_count THEN ? ELSE unread_count END,updated_at=?
WHERE cookie_id=? AND chat_id=?`, session.BuyerID, session.BuyerID, session.BuyerName, session.BuyerName,
session.BuyerAvatar, session.BuyerAvatar, session.ItemID, session.ItemID, session.ItemTitle, session.ItemTitle,
session.BuyerAvatar, session.BuyerAvatar, session.ItemID, session.ItemID, session.ItemTitle, session.ItemTitle, session.ItemImageURL, session.ItemImageURL,
session.LastMessageAt, session.LastMessage, session.LastMessageAt, session.LastMessageAt,
session.UnreadCount, session.UnreadCount, now, session.CookieID, session.ChatID)
return err
@@ -180,11 +185,11 @@ func (s *ChatStore) SaveMessage(ctx context.Context, session ChatSession, messag
sessionPrefix := dialectInsertIgnorePrefix(s.Dialect)
// sessionInsert 用于本次流程后续判断的会话Insert
sessionInsert := sessionPrefix + ` INTO chat_sessions
(cookie_id,chat_id,buyer_id,buyer_name,buyer_avatar_url,item_id,item_title,last_message,last_message_at,unread_count,created_at,updated_at)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?)` + dialectInsertIgnore(s.Dialect, []string{"cookie_id", "chat_id"})
(cookie_id,chat_id,buyer_id,buyer_name,buyer_avatar_url,item_id,item_title,item_image_url,last_message,last_message_at,unread_count,created_at,updated_at)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)` + dialectInsertIgnore(s.Dialect, []string{"cookie_id", "chat_id"})
if // err 用于本次流程后续判断的err
_, err := tx.ExecContext(ctx, sessionInsert, session.CookieID, session.ChatID, session.BuyerID,
session.BuyerName, session.BuyerAvatar, session.ItemID, session.ItemTitle, "", int64(0), 0, now, now); err != nil {
session.BuyerName, session.BuyerAvatar, session.ItemID, session.ItemTitle, session.ItemImageURL, "", int64(0), 0, now, now); err != nil {
return nil, false, fmt.Errorf("建立聊天会话: %w", err)
}
@@ -192,11 +197,11 @@ func (s *ChatStore) SaveMessage(ctx context.Context, session ChatSession, messag
prefix := dialectInsertIgnorePrefix(s.Dialect)
// query 保存带已读字段的幂等插入 SQL,三方言冲突时保持同一列顺序。
query := prefix + ` INTO chat_messages
(cookie_id,chat_id,message_key,direction,sender_id,sender_name,message_type,content,status,read_status,read_at,sent_at,created_at)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)` + dialectInsertIgnore(s.Dialect, []string{"cookie_id", "message_key"})
(cookie_id,chat_id,message_key,direction,sender_id,sender_name,message_type,content,media_duration,status,read_status,read_at,sent_at,created_at)
VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)` + dialectInsertIgnore(s.Dialect, []string{"cookie_id", "message_key"})
// res、err 保存插入结果及执行错误,用于判断是否更新会话摘要。
res, err := tx.ExecContext(ctx, query, message.CookieID, message.ChatID, message.MessageKey,
message.Direction, message.SenderID, message.SenderName, message.MessageType, message.Content,
message.Direction, message.SenderID, message.SenderName, message.MessageType, message.Content, message.MediaDuration,
message.Status, message.ReadStatus, message.ReadAt, message.SentAt, now)
if err != nil {
return nil, false, fmt.Errorf("保存聊天消息: %w", err)
@@ -236,11 +241,11 @@ func (s *ChatStore) SaveMessage(ctx context.Context, session ChatSession, messag
}
if // err 用于本次流程后续判断的err
_, err := tx.ExecContext(ctx, `UPDATE chat_sessions SET buyer_id=?,buyer_name=?,buyer_avatar_url=?,
item_id=?,item_title=?,last_message=CASE WHEN last_message_at<=? THEN ? ELSE last_message END,
item_id=?,item_title=?,item_image_url=CASE WHEN ?<>'' THEN ? ELSE item_image_url END,last_message=CASE WHEN last_message_at<=? THEN ? ELSE last_message END,
last_message_at=CASE WHEN last_message_at<=? THEN ? ELSE last_message_at END,
unread_count=unread_count+?,updated_at=?
WHERE cookie_id=? AND chat_id=?`, session.BuyerID, session.BuyerName, session.BuyerAvatar,
session.ItemID, session.ItemTitle, message.SentAt, message.Content, message.SentAt, message.SentAt, unreadDelta, now,
session.ItemID, session.ItemTitle, session.ItemImageURL, session.ItemImageURL, message.SentAt, message.Content, message.SentAt, message.SentAt, unreadDelta, now,
session.CookieID, session.ChatID); err != nil {
return nil, false, fmt.Errorf("更新聊天会话: %w", err)
}
@@ -259,23 +264,31 @@ func (s *ChatStore) GetMessageByKey(ctx context.Context, cookieID, key string) (
// m 保存按账号和幂等键读取的完整聊天消息。
var m ChatMessage
// err 保存查询错误;不存在时转换为仓储统一的 ErrNotFound。
err := s.DB.QueryRowContext(ctx, `SELECT id,cookie_id,chat_id,message_key,direction,sender_id,sender_name,message_type,content,status,read_status,read_at,sent_at
err := s.DB.QueryRowContext(ctx, `SELECT id,cookie_id,chat_id,message_key,direction,sender_id,sender_name,message_type,content,media_duration,status,read_status,read_at,sent_at
FROM chat_messages WHERE cookie_id=? AND message_key=?`, cookieID, key).Scan(
&m.ID, &m.CookieID, &m.ChatID, &m.MessageKey, &m.Direction, &m.SenderID, &m.SenderName,
&m.MessageType, &m.Content, &m.Status, &m.ReadStatus, &m.ReadAt, &m.SentAt)
&m.MessageType, &m.Content, &m.MediaDuration, &m.Status, &m.ReadStatus, &m.ReadAt, &m.SentAt)
if errors.Is(err, sql.ErrNoRows) {
return nil, ErrNotFound
}
return &m, err
}
// UpdateMessageType refreshes the classification of an already persisted
// message when a later history response exposes richer protocol metadata.
// UpdateMessageType 更新消息类型。
func (s *ChatStore) UpdateMessageType(ctx context.Context, cookieID, key, messageType string) error {
// err 用于本次流程后续判断的err
_, err := s.DB.ExecContext(ctx, `UPDATE chat_messages SET message_type=?
WHERE cookie_id=? AND message_key=?`, messageType, cookieID, key)
// UpdateMessageContent 用历史接口暴露的富媒体分类与地址纠正已持久化占位消息。
// ctx 控制数据库更新生命周期;cookieID 和 key 定位消息;messageType 和 content 是新的非敏感展示内容。
func (s *ChatStore) UpdateMessageContent(ctx context.Context, cookieID, key, messageType, content string) error {
// err 保存更新消息展示分类与内容地址时的数据库错误。
_, err := s.DB.ExecContext(ctx, `UPDATE chat_messages SET message_type=?,content=?
WHERE cookie_id=? AND message_key=?`, messageType, content, cookieID, key)
return err
}
// UpdateMessageMediaDuration 用历史载荷中的秒级时长补齐已持久化语音消息。
// ctx 控制数据库更新生命周期;cookieID 和 key 定位消息;duration 以秒为单位,零值代表平台未提供。
func (s *ChatStore) UpdateMessageMediaDuration(ctx context.Context, cookieID, key string, duration int64) error {
// err 保存更新富媒体时长时的数据库错误,调用方据此决定是否返回历史刷新失败。
_, err := s.DB.ExecContext(ctx, `UPDATE chat_messages SET media_duration=?
WHERE cookie_id=? AND message_key=?`, duration, cookieID, key)
return err
}
@@ -286,7 +299,7 @@ func (s *ChatStore) ListSessions(ctx context.Context, userID int64, cookieID str
}
// rows、err 用于本次流程后续判断的rows、err
rows, err := s.DB.QueryContext(ctx, `SELECT cs.cookie_id,cs.chat_id,cs.buyer_id,cs.buyer_name,cs.buyer_avatar_url,
cs.item_id,cs.item_title,cs.last_message,cs.last_message_at,cs.unread_count
cs.item_id,cs.item_title,cs.item_image_url,cs.last_message,cs.last_message_at,cs.unread_count
FROM chat_sessions cs JOIN cookies c ON c.id=cs.cookie_id
WHERE c.user_id=? AND cs.cookie_id=? ORDER BY cs.last_message_at DESC LIMIT ?`, userID, cookieID, limit)
if err != nil {
@@ -300,7 +313,7 @@ func (s *ChatStore) ListSessions(ctx context.Context, userID int64, cookieID str
var row ChatSession
if // err 用于本次流程后续判断的err
err := rows.Scan(&row.CookieID, &row.ChatID, &row.BuyerID, &row.BuyerName, &row.BuyerAvatar,
&row.ItemID, &row.ItemTitle, &row.LastMessage, &row.LastMessageAt, &row.UnreadCount); err != nil {
&row.ItemID, &row.ItemTitle, &row.ItemImageURL, &row.LastMessage, &row.LastMessageAt, &row.UnreadCount); err != nil {
return nil, err
}
result = append(result, row)
@@ -314,7 +327,7 @@ func (s *ChatStore) ListMessages(ctx context.Context, userID int64, cookieID, ch
limit = 50
}
// query 保存按时间倒序读取再反转为时间正序的分页 SQL。
query := `SELECT m.id,m.cookie_id,m.chat_id,m.message_key,m.direction,m.sender_id,m.sender_name,m.message_type,m.content,m.status,m.read_status,m.read_at,m.sent_at
query := `SELECT m.id,m.cookie_id,m.chat_id,m.message_key,m.direction,m.sender_id,m.sender_name,m.message_type,m.content,m.media_duration,m.status,m.read_status,m.read_at,m.sent_at
FROM chat_messages m JOIN cookies c ON c.id=m.cookie_id
WHERE c.user_id=? AND m.cookie_id=? AND m.chat_id=?`
// args 用于本次流程后续判断的args
@@ -339,7 +352,7 @@ func (s *ChatStore) ListMessages(ctx context.Context, userID int64, cookieID, ch
var m ChatMessage
// err 保存当前行字段映射错误,避免返回缺少已读字段的不完整消息。
if err := rows.Scan(&m.ID, &m.CookieID, &m.ChatID, &m.MessageKey, &m.Direction, &m.SenderID,
&m.SenderName, &m.MessageType, &m.Content, &m.Status, &m.ReadStatus, &m.ReadAt, &m.SentAt); err != nil {
&m.SenderName, &m.MessageType, &m.Content, &m.MediaDuration, &m.Status, &m.ReadStatus, &m.ReadAt, &m.SentAt); err != nil {
return nil, err
}
result = append(result, m)
+8 -6
View File
@@ -107,7 +107,7 @@ func TestMigrate_AppliesCleanSchema(t *testing.T) {
}
// TestMigrate_UpgradesDatabaseWithMainChatVersions 验证已发布 main 的 00029/00030
// 聊天迁移可以原样升级到包含 AI 议价自动改价状态的 00034 最终版本。
// 聊天迁移可以原样升级到包含聊天媒体展示字段的 00035 最终版本。
func TestMigrate_UpgradesDatabaseWithMainChatVersions(t *testing.T) {
// tmpDir 保存隔离的已发布 main 数据库目录,测试结束后由 testing 清理。
tmpDir := t.TempDir()
@@ -133,23 +133,23 @@ func TestMigrate_UpgradesDatabaseWithMainChatVersions(t *testing.T) {
// ctx 提供迁移 API 所需的调用上下文;升级本身不依赖请求生命周期。
ctx := context.Background()
// migrateErr 保存从 main 00030 接续 dev 00031 至 00034 时的迁移失败。
// migrateErr 保存从 main 00030 接续 dev 00031 至 00035 时的迁移失败。
if migrateErr := Migrate(ctx, rawDB, DialectSQLite); migrateErr != nil {
t.Fatalf("upgrade from main 00030: %v", migrateErr)
}
if !tableExists(t, rawDB, "order_reconciliations") {
t.Fatal("order_reconciliations should be created by the dev schema baseline migration")
}
if !columnExists(t, rawDB, "chat_messages", "read_status") || !columnExists(t, rawDB, "chat_messages", "read_at") {
t.Fatal("chat read tracking columns should remain after dev schema baseline upgrade")
if !columnExists(t, rawDB, "chat_messages", "read_status") || !columnExists(t, rawDB, "chat_messages", "read_at") || !columnExists(t, rawDB, "chat_messages", "media_duration") || !columnExists(t, rawDB, "chat_sessions", "item_image_url") {
t.Fatal("chat read tracking and media presentation columns should remain after dev schema baseline upgrade")
}
// finalVersion 验证迁移账本已推进到包含批量发布间隔的最新 dev schema 版本。
finalVersion, versionErr := goose.GetDBVersion(rawDB)
if versionErr != nil {
t.Fatalf("read final migration version: %v", versionErr)
}
if finalVersion != 34 {
t.Fatalf("final migration version=%d, want 34", finalVersion)
if finalVersion != 35 {
t.Fatalf("final migration version=%d, want 35", finalVersion)
}
}
@@ -267,9 +267,11 @@ func TestLatestMigrationsDownUpSQLite(t *testing.T) {
{"account_task_settings", "auto_rate_enabled"},
{"account_task_runs", "run_key"},
{"chat_sessions", "unread_count"},
{"chat_sessions", "item_image_url"},
{"chat_messages", "message_key"},
{"chat_messages", "read_status"},
{"chat_messages", "read_at"},
{"chat_messages", "media_duration"},
{"notification_outbox", "uncertain_at"},
} {
if !columnExists(t, d, c.table, c.col) {
@@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE chat_sessions ADD COLUMN item_image_url VARCHAR(2048) NOT NULL DEFAULT '';
ALTER TABLE chat_messages ADD COLUMN media_duration BIGINT NOT NULL DEFAULT 0;
-- +goose Down
ALTER TABLE chat_messages DROP COLUMN media_duration;
ALTER TABLE chat_sessions DROP COLUMN item_image_url;
@@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE chat_sessions ADD COLUMN item_image_url TEXT NOT NULL DEFAULT '';
ALTER TABLE chat_messages ADD COLUMN media_duration BIGINT NOT NULL DEFAULT 0;
-- +goose Down
ALTER TABLE chat_messages DROP COLUMN media_duration;
ALTER TABLE chat_sessions DROP COLUMN item_image_url;
@@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE chat_sessions ADD COLUMN item_image_url TEXT NOT NULL DEFAULT '';
ALTER TABLE chat_messages ADD COLUMN media_duration INTEGER NOT NULL DEFAULT 0;
-- +goose Down
ALTER TABLE chat_messages DROP COLUMN media_duration;
ALTER TABLE chat_sessions DROP COLUMN item_image_url;
+2
View File
@@ -1367,9 +1367,11 @@ func TestMultiDB_LatestMigrationsDownUp(t *testing.T) {
{"account_task_settings", "auto_rate_enabled"},
{"account_task_runs", "run_key"},
{"chat_sessions", "unread_count"},
{"chat_sessions", "item_image_url"},
{"chat_messages", "message_key"},
{"chat_messages", "read_status"},
{"chat_messages", "read_at"},
{"chat_messages", "media_duration"},
} {
if !columnExistsForDialect(t, tg.store.DB, tg.dialect, c.table, c.col) {
t.Fatalf("column missing after re-up: %s.%s", c.table, c.col)
+1 -1
View File
@@ -219,7 +219,7 @@ func (d *messageDispatcher) markAndCheckDedup(decrypted map[string]any, chat *Ch
if // last、ok 用于本次流程后续判断的last、ok
last, ok := d.processed[msgID]; ok {
if now.Sub(last) < MessageExpireTime {
d.logger.Info("消息已处理过,跳过", "msg_id", truncID(msgID))
d.logger.Debug("消息已处理过,跳过", "msg_id", truncID(msgID))
return false
}
}
+1 -1
View File
@@ -88,7 +88,7 @@ func (r *wsRecorder) start(ctx context.Context) {
if cleanupErr != nil && ctx.Err() == nil {
r.logger.Warn("清理过期 WS 报文失败", "cookie_id", r.cookieID, "err", cleanupErr)
} else if deleted > 0 {
r.logger.Info("已清理过期 WS 报文", "cookie_id", r.cookieID, "deleted", deleted)
r.logger.Debug("已清理过期 WS 报文", "cookie_id", r.cookieID, "deleted", deleted)
}
// ticker 定期触发队列刷盘。
+1 -1
View File
@@ -349,7 +349,7 @@ func (s *Server) resolveChatReadMessageIDs(ctx context.Context, accountID, chatI
// id 保存应用层解析后的平台消息标识。
id := s.chatApplication().ResolveReadMessageID(ctx, accountID, chatID, rawID)
if !strings.HasSuffix(id, ".PNM") {
slog.Warn("未找到旧聊天消息对应的 PNM,跳过已读上报", "account", accountID, "chat_id", chatID, "message_id", rawID)
slog.Debug("未找到旧聊天消息对应的 PNM,跳过已读上报", "account", accountID, "chat_id", chatID, "message_id", rawID)
continue
}
// exists 表示该平台消息标识是否已经加入本次上报请求。
@@ -177,7 +177,7 @@ func testOpenAPIChatHistoryAndReadSuccess(t *testing.T) {
srv, store, cleanup := newTestServerWithChat(t)
defer cleanup()
// saveErr 表示写入可查询聊天消息失败。
_, _, saveErr := store.Chats.SaveMessage(context.Background(), db.ChatSession{CookieID: "acc1", ChatID: "chat-contract", BuyerID: "buyer-contract", BuyerName: "契约买家"}, db.ChatMessage{MessageKey: "message-contract", Direction: "incoming", SenderID: "buyer-contract", SenderName: "契约买家", MessageType: "text", Content: "契约消息", Status: "received", SentAt: 1}, true)
_, _, saveErr := store.Chats.SaveMessage(context.Background(), db.ChatSession{CookieID: "acc1", ChatID: "chat-contract", BuyerID: "buyer-contract", BuyerName: "契约买家", ItemImageURL: "https://img.example/item.jpg"}, db.ChatMessage{MessageKey: "message-contract", Direction: "incoming", SenderID: "buyer-contract", SenderName: "契约买家", MessageType: "audio", Content: "https://media.example/voice.amr", MediaDuration: 3, Status: "received", SentAt: 1}, true)
if saveErr != nil {
t.Fatalf("写入聊天夹具失败: %v", saveErr)
}
+7 -3
View File
@@ -74,6 +74,8 @@ type chatSessionDTO struct {
ItemID string `json:"item_id"`
// ItemTitle 是会话关联商品标题。
ItemTitle string `json:"item_title"`
// ItemImageURL 是会话关联商品主图的公开地址。
ItemImageURL string `json:"item_image_url"`
// LastMessage 是最近一条消息摘要。
LastMessage string `json:"last_message"`
// LastMessageAt 是最近消息时间的 Unix 秒。
@@ -87,7 +89,7 @@ func newChatSessionDTOFromApplication(session chatapp.Session) chatSessionDTO {
return chatSessionDTO{
AccountID: session.AccountID, ChatID: session.ChatID, BuyerID: session.BuyerID,
BuyerName: session.BuyerName, BuyerAvatar: session.BuyerAvatar, ItemID: session.ItemID,
ItemTitle: session.ItemTitle, LastMessage: session.LastMessage,
ItemTitle: session.ItemTitle, ItemImageURL: session.ItemImageURL, LastMessage: session.LastMessage,
LastMessageAt: session.LastMessageAt, UnreadCount: session.UnreadCount,
}
}
@@ -123,6 +125,8 @@ type chatMessageDTO struct {
MessageType string `json:"message_type"`
// Content 是消息文本或媒体地址。
Content string `json:"content"`
// MediaDuration 是语音消息的秒级时长;零值表示平台未提供。
MediaDuration int64 `json:"media_duration"`
// Status 是消息投递状态。
Status string `json:"status"`
// ReadStatus 是平台已读回执状态;值为 2 时表示对方已读。
@@ -142,7 +146,7 @@ func newChatMessageDTOFromApplication(message *chatapp.Message) chatMessageDTO {
ID: message.ID, AccountID: message.AccountID, ChatID: message.ChatID,
MessageKey: message.MessageKey, Direction: message.Direction,
SenderID: message.SenderID, SenderName: message.SenderName,
MessageType: message.MessageType, Content: message.Content,
MessageType: message.MessageType, Content: message.Content, MediaDuration: message.MediaDuration,
Status: message.Status, ReadStatus: message.ReadStatus, ReadAt: message.ReadAt, SentAt: message.SentAt,
}
}
@@ -156,7 +160,7 @@ func newChatMessageDTOsFromApplication(messages []chatapp.Message) []chatMessage
result = append(result, chatMessageDTO{
ID: message.ID, AccountID: message.AccountID, ChatID: message.ChatID,
MessageKey: message.MessageKey, Direction: message.Direction, SenderID: message.SenderID,
SenderName: message.SenderName, MessageType: message.MessageType, Content: message.Content,
SenderName: message.SenderName, MessageType: message.MessageType, Content: message.Content, MediaDuration: message.MediaDuration,
Status: message.Status, ReadStatus: message.ReadStatus, ReadAt: message.ReadAt, SentAt: message.SentAt,
})
}
+8 -8
View File
@@ -10,19 +10,19 @@ import (
chatapp "xianyu-go/internal/application/chat"
)
// TestChatMessageDTOKeepsReadReceipt 验证聊天传输 DTO 不会丢弃平台出站已读回执。
// TestChatMessageDTOKeepsReadReceipt 验证聊天传输 DTO 不会丢弃平台已读回执和语音长度。
func TestChatMessageDTOKeepsReadReceipt(t *testing.T) {
// message 保存带已读确认的应用层出站消息。
message := chatapp.Message{ID: 7, AccountID: "account-1", ChatID: "chat-1", MessageKey: "message-1", Direction: "outgoing", Status: "sent", ReadStatus: 2, ReadAt: 88, SentAt: 99}
message := chatapp.Message{ID: 7, AccountID: "account-1", ChatID: "chat-1", MessageKey: "message-1", Direction: "outgoing", MessageType: "audio", MediaDuration: 3, Status: "sent", ReadStatus: 2, ReadAt: 88, SentAt: 99}
// single 保存单消息接口使用的传输 DTO。
single := newChatMessageDTOFromApplication(&message)
if single.ReadStatus != 2 || single.ReadAt != 88 {
t.Fatalf("单消息响应丢失已读回执: got=%+v", single)
if single.ReadStatus != 2 || single.ReadAt != 88 || single.MediaDuration != 3 {
t.Fatalf("单消息响应丢失已读回执或语音时长: got=%+v", single)
}
// page 保存历史消息接口使用的传输 DTO 列表。
page := newChatMessageDTOsFromApplication([]chatapp.Message{message})
if len(page) != 1 || page[0].ReadStatus != 2 || page[0].ReadAt != 88 {
t.Fatalf("消息分页响应丢失已读回执: got=%+v", page)
if len(page) != 1 || page[0].ReadStatus != 2 || page[0].ReadAt != 88 || page[0].MediaDuration != 3 {
t.Fatalf("消息分页响应丢失已读回执或语音时长: got=%+v", page)
}
}
@@ -32,7 +32,7 @@ func TestChatEventDTOUsesFrontendContract(t *testing.T) {
event := chatapp.Event{
Type: "message.created",
Message: &chatapp.Message{AccountID: "account-1", ChatID: "chat-1", MessageKey: "message-1", Direction: "incoming", SenderID: "buyer-1", SenderName: "买家", MessageType: "text", Status: "received", SentAt: 9},
Session: &chatapp.Session{AccountID: "account-1", ChatID: "chat-1", BuyerID: "buyer-1", BuyerName: "买家"},
Session: &chatapp.Session{AccountID: "account-1", ChatID: "chat-1", BuyerID: "buyer-1", BuyerName: "买家", ItemImageURL: "https://img.example/item.jpg"},
}
// encoded、marshalErr 分别保存 DTO 编码结果和编码错误。
encoded, marshalErr := json.Marshal(newChatEventDTOFromApplication(event))
@@ -52,7 +52,7 @@ func TestChatEventDTOUsesFrontendContract(t *testing.T) {
}
// session 保存事件中的会话对象,也必须使用同一命名约定。
session, sessionOK := payload["session"].(map[string]any)
if !sessionOK || session["account_id"] != "account-1" || session["chat_id"] != "chat-1" || session["AccountID"] != nil {
if !sessionOK || session["account_id"] != "account-1" || session["chat_id"] != "chat-1" || session["item_image_url"] != "https://img.example/item.jpg" || session["AccountID"] != nil {
t.Fatalf("会话 WebSocket 契约错误: %#v", payload["session"])
}
// specPath 是测试包相对仓库根目录的唯一 OpenAPI 契约位置。
@@ -1,3 +1,3 @@
import{b as ie,j as e,a as l,c as Me}from"./react-vendor-l-BBvuKH.js";import{r as T,c as L}from"./index-2BJ5Kkse.js";import{c as Ae,o as Pe}from"./contract-COFcZjyb.js";import{n as de,X as ce,f as Be,L as J,o as qe,p as Ge,q as Oe,r as Te,s as Le,U as Ie,t as te,u as ze,k as _e,Q as we,v as Ee,R as We,w as Ve,x as Ke,y as Ne,K as He,z as Je,F as Xe,e as Ye,H as Ze}from"./icons-vendor-CIGXYOCp.js";import"./vendor-cRYyTeIw.js";const Fe=(a,s)=>{const t=a.avatar_url||"";if(!t)return"";try{const r=new URL(t,window.location.origin);return r.hostname.endsWith("alicdn.com")&&r.searchParams.set("_v",s),r.toString()}catch{return t}},es=async a=>{const s=await T(n=>L.GET("/api/v1/accounts/details",{signal:n}),a),t=Ae(s,["data","accounts","details"]),r=Date.now().toString();return t.map(n=>({id:n.id,cookie_configured:n.has_cookie===!0,enabled:n.enabled,auto_confirm:n.auto_confirm,remark:n.remark,pause_duration:n.pause_duration,paused_until:Number(n.paused_until||0),paused:n.paused===!0,username:n.username||"",login_password_configured:void 0,show_browser:n.show_browser===!0||n.show_browser===1||n.show_browser==="1"||n.show_browser==="true",nickname:n.nickname||n.remark||`账号 ${n.id.substring(0,6)}`,avatar_url:Fe(n,r),profile_error:n.profile_error||"",ai_enabled:!1,auto_rate_enabled:n.auto_rate_enabled,rate_content:n.rate_content||"不错的买家,交易愉快",auto_polish_enabled:n.auto_polish_enabled,polish_time:n.polish_time||"03:00",last_rate_scan_at:Number(n.last_rate_scan_at||0),last_polish_date:n.last_polish_date||"",last_polish_at:Number(n.last_polish_at||0)}))},ve=async(a,s)=>T(t=>L.GET("/api/v1/account-tasks/{cid}",{params:{path:{cid:a}},signal:t}),s),ke=async(a,s,t)=>T(r=>L.PUT("/api/v1/account-tasks/{cid}",{params:{path:{cid:a}},body:s,signal:r}),t),ss=async(a,s,t)=>T(r=>L.POST("/api/v1/account-tasks/{cid}/run",{params:{path:{cid:a}},body:{task_type:s},signal:r}),{timeoutMs:12e4,...t}),as=async a=>await T(t=>L.GET("/api/v1/accounts/runtime-status",{signal:t}),a),ts=async a=>T(s=>L.POST("/api/v1/qr-login/generate",{signal:s}),{...a,timeoutMs:(a==null?void 0:a.timeoutMs)??13e4}),rs=async(a,s)=>T(t=>L.GET("/api/v1/qr-login/check/{session_id}",{params:{path:{session_id:a}},signal:t}),{signal:s,timeoutMs:1e4}),ns=async(a,s)=>T(t=>L.POST("/api/v1/qr-login/complete-verification/{session_id}",{params:{path:{session_id:a}},body:{target_account_id:s||""},signal:t})),ls=async(a,s)=>T(t=>L.PUT("/api/v1/accounts/{cid}/status",{params:{path:{cid:a}},body:{enabled:s},signal:t})),os=async a=>T(s=>L.DELETE("/api/v1/accounts/{cid}",{params:{path:{cid:a}},signal:s})),is=async(a,s,t)=>T(r=>L.PUT("/api/v1/accounts/{cid}/pause-duration",{params:{path:{cid:a}},body:{pause_duration:s},signal:r}),t),cs=async(a,s,t)=>T(r=>L.PUT("/api/v1/accounts/{cid}/settings",{params:{path:{cid:a}},body:s,signal:r}),t),ds=async(a,s)=>T(t=>L.GET("/api/v1/accounts/{cid}/long-login",{params:{path:{cid:a}},signal:t}),s),us=async(a,s,t)=>T(r=>L.PUT("/api/v1/accounts/{cid}/long-login",{params:{path:{cid:a}},body:{enabled:s},signal:r}),t),xs=async(a,s)=>T(t=>L.POST("/api/v1/password-login",{body:a,signal:t}),s),ms=async(a,s)=>T(r=>L.GET("/api/v1/password-login/check/{session_id}",{params:{path:{session_id:a}},signal:r}),{signal:s,timeoutMs:1e4}),bs=async(a,s)=>T(t=>L.DELETE("/api/v1/password-login/cancel/{session_id}",{params:{path:{session_id:a}},signal:t}),s),hs=async a=>T(s=>L.POST("/api/v1/accounts/{cid}/refresh-profile",{params:{path:{cid:a}},signal:s})),gs=async a=>{const s=await T(t=>L.GET("/api/v1/settings/ai-reply",{signal:t}),a);return Pe(s,["settings","data","result"])||{}},ps=async(a,s)=>T(t=>L.GET("/api/v1/settings/ai-reply/{cookie_id}",{params:{path:{cookie_id:a}},signal:t}),s),fs=async(a,s,t)=>{const r={ai_enabled:s.ai_enabled??!1,auto_adjust_price_enabled:s.auto_adjust_price_enabled??!1,max_discount_percent:s.max_discount_percent??10,max_discount_amount:s.max_discount_amount??100,max_bargain_rounds:s.max_bargain_rounds??3,custom_prompts:s.custom_prompts??""};return T(n=>L.PUT("/api/v1/settings/ai-reply/{cookie_id}",{params:{path:{cookie_id:a}},body:r,signal:n}),t)},ys=a=>{if(Array.isArray(a))return a.filter(Boolean);if(typeof a!="string"||!a.trim())return[];try{const s=JSON.parse(a);if(Array.isArray(s))return s.filter(Boolean)}catch{}return a.split(/[,\s;]+/).map(s=>s.trim()).filter(Boolean)},js=async a=>{const s=await T(r=>L.GET("/api/v1/notifications/channels",{signal:r}),a);return{success:!0,data:Ae(s,["data","channels","items"]).map(r=>{const n={},c=r.type==="ding_talk"?"dingtalk":r.type==="lark"?"feishu":r.type;return{id:String(r.id),name:r.name,type:c,config:n,event_types:ys(r.event_types),enabled:r.enabled}})}},_s=async(a,s)=>{const t=await T(n=>L.GET("/api/v1/notifications/accounts/{cid}/bindings",{params:{path:{cid:a}},signal:n}),s),r=Pe(t,["data","result"])||{};return Array.isArray(r.channel_ids)?r.channel_ids:[]},ws=({account:a,settings:s,saving:t,onChange:r,onClose:n,onSave:c})=>{const i=y=>r({...s,...y}),d=()=>i(s.ai_enaLine truncated
import{b as ie,j as e,a as l,d as Me}from"./react-vendor-Bf9ELcll.js";import{r as T,c as L}from"./index-BcKVxEYs.js";import{c as Ae,o as Pe}from"./contract-COFcZjyb.js";import{n as de,X as ce,f as Be,L as J,o as qe,p as Ge,q as Oe,r as Te,s as Le,U as Ie,t as te,u as ze,k as _e,Q as we,v as Ee,R as We,w as Ve,x as Ke,y as Ne,K as He,z as Je,F as Xe,e as Ye,H as Ze}from"./icons-vendor-B5fJPoU1.js";import"./vendor-BE-_xUHH.js";const Fe=(a,s)=>{const t=a.avatar_url||"";if(!t)return"";try{const r=new URL(t,window.location.origin);return r.hostname.endsWith("alicdn.com")&&r.searchParams.set("_v",s),r.toString()}catch{return t}},es=async a=>{const s=await T(n=>L.GET("/api/v1/accounts/details",{signal:n}),a),t=Ae(s,["data","accounts","details"]),r=Date.now().toString();return t.map(n=>({id:n.id,cookie_configured:n.has_cookie===!0,enabled:n.enabled,auto_confirm:n.auto_confirm,remark:n.remark,pause_duration:n.pause_duration,paused_until:Number(n.paused_until||0),paused:n.paused===!0,username:n.username||"",login_password_configured:void 0,show_browser:n.show_browser===!0||n.show_browser===1||n.show_browser==="1"||n.show_browser==="true",nickname:n.nickname||n.remark||`账号 ${n.id.substring(0,6)}`,avatar_url:Fe(n,r),profile_error:n.profile_error||"",ai_enabled:!1,auto_rate_enabled:n.auto_rate_enabled,rate_content:n.rate_content||"不错的买家,交易愉快",auto_polish_enabled:n.auto_polish_enabled,polish_time:n.polish_time||"03:00",last_rate_scan_at:Number(n.last_rate_scan_at||0),last_polish_date:n.last_polish_date||"",last_polish_at:Number(n.last_polish_at||0)}))},ve=async(a,s)=>T(t=>L.GET("/api/v1/account-tasks/{cid}",{params:{path:{cid:a}},signal:t}),s),ke=async(a,s,t)=>T(r=>L.PUT("/api/v1/account-tasks/{cid}",{params:{path:{cid:a}},body:s,signal:r}),t),ss=async(a,s,t)=>T(r=>L.POST("/api/v1/account-tasks/{cid}/run",{params:{path:{cid:a}},body:{task_type:s},signal:r}),{timeoutMs:12e4,...t}),as=async a=>await T(t=>L.GET("/api/v1/accounts/runtime-status",{signal:t}),a),ts=async a=>T(s=>L.POST("/api/v1/qr-login/generate",{signal:s}),{...a,timeoutMs:(a==null?void 0:a.timeoutMs)??13e4}),rs=async(a,s)=>T(t=>L.GET("/api/v1/qr-login/check/{session_id}",{params:{path:{session_id:a}},signal:t}),{signal:s,timeoutMs:1e4}),ns=async(a,s)=>T(t=>L.POST("/api/v1/qr-login/complete-verification/{session_id}",{params:{path:{session_id:a}},body:{target_account_id:s||""},signal:t})),ls=async(a,s)=>T(t=>L.PUT("/api/v1/accounts/{cid}/status",{params:{path:{cid:a}},body:{enabled:s},signal:t})),os=async a=>T(s=>L.DELETE("/api/v1/accounts/{cid}",{params:{path:{cid:a}},signal:s})),is=async(a,s,t)=>T(r=>L.PUT("/api/v1/accounts/{cid}/pause-duration",{params:{path:{cid:a}},body:{pause_duration:s},signal:r}),t),cs=async(a,s,t)=>T(r=>L.PUT("/api/v1/accounts/{cid}/settings",{params:{path:{cid:a}},body:s,signal:r}),t),ds=async(a,s)=>T(t=>L.GET("/api/v1/accounts/{cid}/long-login",{params:{path:{cid:a}},signal:t}),s),us=async(a,s,t)=>T(r=>L.PUT("/api/v1/accounts/{cid}/long-login",{params:{path:{cid:a}},body:{enabled:s},signal:r}),t),xs=async(a,s)=>T(t=>L.POST("/api/v1/password-login",{body:a,signal:t}),s),ms=async(a,s)=>T(r=>L.GET("/api/v1/password-login/check/{session_id}",{params:{path:{session_id:a}},signal:r}),{signal:s,timeoutMs:1e4}),bs=async(a,s)=>T(t=>L.DELETE("/api/v1/password-login/cancel/{session_id}",{params:{path:{session_id:a}},signal:t}),s),hs=async a=>T(s=>L.POST("/api/v1/accounts/{cid}/refresh-profile",{params:{path:{cid:a}},signal:s})),gs=async a=>{const s=await T(t=>L.GET("/api/v1/settings/ai-reply",{signal:t}),a);return Pe(s,["settings","data","result"])||{}},ps=async(a,s)=>T(t=>L.GET("/api/v1/settings/ai-reply/{cookie_id}",{params:{path:{cookie_id:a}},signal:t}),s),fs=async(a,s,t)=>{const r={ai_enabled:s.ai_enabled??!1,auto_adjust_price_enabled:s.auto_adjust_price_enabled??!1,max_discount_percent:s.max_discount_percent??10,max_discount_amount:s.max_discount_amount??100,max_bargain_rounds:s.max_bargain_rounds??3,custom_prompts:s.custom_prompts??""};return T(n=>L.PUT("/api/v1/settings/ai-reply/{cookie_id}",{params:{path:{cookie_id:a}},body:r,signal:n}),t)},ys=a=>{if(Array.isArray(a))return a.filter(Boolean);if(typeof a!="string"||!a.trim())return[];try{const s=JSON.parse(a);if(Array.isArray(s))return s.filter(Boolean)}catch{}return a.split(/[,\s;]+/).map(s=>s.trim()).filter(Boolean)},js=async a=>{const s=await T(r=>L.GET("/api/v1/notifications/channels",{signal:r}),a);return{success:!0,data:Ae(s,["data","channels","items"]).map(r=>{const n={},c=r.type==="ding_talk"?"dingtalk":r.type==="lark"?"feishu":r.type;return{id:String(r.id),name:r.name,type:c,config:n,event_types:ys(r.event_types),enabled:r.enabled}})}},_s=async(a,s)=>{const t=await T(n=>L.GET("/api/v1/notifications/accounts/{cid}/bindings",{params:{path:{cid:a}},signal:n}),s),r=Pe(t,["data","result"])||{};return Array.isArray(r.channel_ids)?r.channel_ids:[]},ws=({account:a,settings:s,saving:t,onChange:r,onClose:n,onSave:c})=>{const i=y=>r({...s,...y}),d=()=>i(s.ai_enaLine truncated
例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等`,className:"w-full ios-input px-4 py-3 rounded-xl h-40 resize-none"})]}),e.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-bold text-blue-900 mb-2 flex items-center gap-2",children:[e.jsx(Be,{className:"w-4 h-4"}),"AI如何工作"]}),e.jsxs("ul",{className:"text-xs text-blue-800 space-y-1",children:[e.jsx("li",{children:"• 自动识别买家的砍价请求"}),e.jsx("li",{children:"• 根据设定的策略智能回复"}),e.jsx("li",{children:"• 在合理范围内同意降价或礼貌拒绝"}),e.jsx("li",{children:"• 只有开启自动改价后,已发送给买家的有效报价才会用于真实订单改价"})]})]})]}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex gap-3 w-full",children:[e.jsx("button",{onClick:n,className:"flex-1 px-6 py-3 rounded-xl font-bold bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",disabled:t,children:"取消"}),e.jsxs("button",{onClick:(()=>void c()),className:"flex-1 ios-btn-primary px-6 py-3 rounded-xl font-bold flex items-center justify-center gap-2",disabled:t,children:[t?e.jsx(J,{className:"w-4 h-4 animate-spin"}):e.jsx(qe,{className:"w-4 h-4"}),t?"保存中...":"保存"]})]})})]})}),document.body)},Ce=a=>({account_id:a.id,auto_rate_enabled:a.auto_rate_enabled===!0,rate_content:a.rate_content||"不错的买家,交易愉快",auto_polish_enabled:a.auto_polish_enabled===!0,polish_time:a.polish_time||"03:00",last_rate_scan_at:a.last_rate_scan_at,last_polish_date:a.last_polish_date,last_polish_at:a.last_polish_at}),Z=(a,s,t)=>a===s&&!t.aborted,ye=(a,s)=>a instanceof Error?a.message:s,je=a=>a instanceof Error&&a.message==="请求已取消",Se=(a,s)=>!a&&s==="",Ns=({account:a,onSaved:s})=>{const[t,r]=l.useState(()=>Ce(a)),[n,c]=l.useState(!0),[i,d]=l.useState(!1),[m,x]=l.useState(""),[f,b]=l.useState(""),[h,y]=l.useState(null),[C,g]=l.useState(null),p=l.useRef(0),I=l.useRef(null);l.useEffect(()=>{var v;const R=++p.current;(v=I.current)==null||v.abort();const _=new AbortController;return I.current=_,r(Ce(a)),y(null),b(""),d(!1),x(""),g(null),c(!0),ve(a.id,{signal:_.signal}).then(A=>{Z(p.current,R,_.signal)&&r(A)}).catch(A=>{Z(p.current,R,_.signal)&&!je(A)&&b(ye(A,"加载任务设置失败"))}).finally(()=>{Z(p.current,R,_.signal)&&c(!1)}),(()=>_.abort())},[a.id]),l.useEffect(()=>(()=>{var R;return(R=I.current)==null?void 0:R.abort()}),[]);const B=l.useCallback(async()=>{var v;if(!Se(i,m))return;const R=++p.current;(v=I.current)==null||v.abort();const _=new AbortController;I.current=_,d(!0),b(""),g(null);try{const A=await ke(a.id,t,{signal:_.signal});if(!Z(p.current,R,_.signal))return;r(A),s(A)}catch(A){Z(p.current,R,_.signal)&&!je(A)&&(b(ye(A,"保存失败")),g(()=>B))}finally{Z(p.current,R,_.signal)&&d(!1)}},[a.id,t,s,m,i]),G=l.useCallback(async R=>{var A;if(!Se(i,m)||!a.enabled)return;const _=++p.current;(A=I.current)==null||A.abort();const v=new AbortController;I.current=v,x(R),b(""),y(null),g(null);try{await ke(a.id,t,{signal:v.signal});const N=await ss(a.id,R,{signal:v.signal}),P=await ve(a.id,{signal:v.signal});if(!Z(p.current,_,v.signal))return;y(N.summary),r(P),s(P)}catch(N){Z(p.current,_,v.signal)&&!je(N)&&(b(ye(N,"任务执行失败")),g(()=>(()=>G(R))))}finally{Z(p.current,_,v.signal)&&x("")}},[a.enabled,a.id,t,s,m,i]),D=l.useCallback(async()=>{C&&await C()},[C]);return{form:t,loading:n,saving:i,running:m,summary:h,error:f,retryAvailable:C!==null,setForm:r,save:B,run:G,retry:D}},Re=({checked:a,onChange:s,label:t})=>e.jsx("button",{type:"button","aria-label":t,"aria-pressed":a,onClick:s,className:`relative h-8 w-14 shrink-0 rounded-full transition-colors ${a?"bg-sky-500":"bg-slate-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-6 w-6 rounded-full bg-white shadow-sm transition-transform ${a?"translate-x-6":""}`})}),vs=({account:a,onClose:s,onSaved:t})=>{const{form:r,loading:n,saving:c,running:i,error:d,summary:m,retryAvailable:x,setForm:f,save:b,run:h,retry:y}=Ns({account:a,onSaved:t});return e.jsx("div",{className:"modal-overlay-centered",children:e.jsxs("div",{className:"modal-container",style:{maxWidth:"640px"},role:"dialog","aria-modal":"true","aria-labelledby":"account-task-title",children:[e.jsxs("div",{className:"modal-header",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"account-task-title",className:"text-2xl font-extrabold text-slate-950",children:"账号自动任务"}),e.jsx("p",{className:"mt-1 text-sm text-slate-500",children:a.nickname||a.remark||a.id})]}),e.jsx("button",{type:"button",onClick:s,className:"rounded-xl p-2 text-slate-400 hover:bg-slate-100 hover:text-slate-700","aria-label":"关闭",children:e.jsx(ce,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body space-y-5",children:[n&&e.jsx("div",{className:"rounded-xl bg-slate-50 px-4 py-3 text-sm text-slate-500",children:"正在读取任务设置..."}),e.jsx("section",{ Line truncated
@@ -1,4 +1,4 @@
import{a as c,b as U,j as e}from"./react-vendor-l-BBvuKH.js";import{r as M,c as O,a as ee}from"./index-2BJ5Kkse.js";import{c as te}from"./contract-COFcZjyb.js";import{X as V,W as ae,J as z,Y as se,L as q,N as J,C as X,_ as le,$ as Y,a0 as K,a1 as ne,I as re,a2 as oe,V as ce,y as ie,P as de,o as xe}from"./icons-vendor-CIGXYOCp.js";import"./vendor-cRYyTeIw.js";const pe=l=>{let n=l.api_config;if(typeof n=="string"&&n.trim())try{n=JSON.parse(n)}catch{n=void 0}return{...l,api_config:n||void 0}},Q=l=>({name:l.name,type:l.type,api_config:l.api_config?JSON.stringify(l.api_config):"",text_content:l.text_content,data_content:l.data_content,image_url:l.image_url,description:l.description,enabled:l.enabled,delay_seconds:l.delay_seconds,is_multi_spec:l.is_multi_spec,spec_name:l.spec_name,spec_value:l.spec_value}),me=async l=>{const n=await M(p=>O.GET("/api/v1/cards",{signal:p}),l);return te(n,["cards","data","items"]).map(pe)},he=async l=>M(n=>O.POST("/api/v1/cards",{body:Q(l),signal:n})),H=async(l,n)=>M(a=>O.PUT("/api/v1/cards/{card_id}",{params:{path:{card_id:String(l)}},body:Q(n),signal:a})),ue=async l=>M(n=>O.DELETE("/api/v1/cards/{card_id}",{params:{path:{card_id:String(l)}},signal:n})),be=async(l,n)=>{const a=new FormData;return a.append("file",l),M(p=>O.POST("/api/v1/cards/batch",{body:ee(a),signal:p}),n)},ge=async(l,n,a)=>M(p=>O.POST("/api/v1/cards/{card_id}/append-data",{params:{path:{card_id:String(l)}},body:{content:n},signal:p}),a),ye=(l,n,a)=>{const p=a.trim().toLocaleLowerCase();return l.filter(h=>(!n||h.type===n)&&(!p||h.name.toLocaleLowerCase().includes(p)))},Z=l=>l.split(`
import{a as c,b as U,j as e}from"./react-vendor-Bf9ELcll.js";import{r as M,c as O,a as ee}from"./index-BcKVxEYs.js";import{c as te}from"./contract-COFcZjyb.js";import{X as V,W as ae,J as z,Y as se,L as q,N as J,C as X,_ as le,$ as Y,a0 as K,a1 as ne,I as re,a2 as oe,V as ce,y as ie,P as de,o as xe}from"./icons-vendor-B5fJPoU1.js";import"./vendor-BE-_xUHH.js";const pe=l=>{let n=l.api_config;if(typeof n=="string"&&n.trim())try{n=JSON.parse(n)}catch{n=void 0}return{...l,api_config:n||void 0}},Q=l=>({name:l.name,type:l.type,api_config:l.api_config?JSON.stringify(l.api_config):"",text_content:l.text_content,data_content:l.data_content,image_url:l.image_url,description:l.description,enabled:l.enabled,delay_seconds:l.delay_seconds,is_multi_spec:l.is_multi_spec,spec_name:l.spec_name,spec_value:l.spec_value}),me=async l=>{const n=await M(p=>O.GET("/api/v1/cards",{signal:p}),l);return te(n,["cards","data","items"]).map(pe)},he=async l=>M(n=>O.POST("/api/v1/cards",{body:Q(l),signal:n})),H=async(l,n)=>M(a=>O.PUT("/api/v1/cards/{card_id}",{params:{path:{card_id:String(l)}},body:Q(n),signal:a})),ue=async l=>M(n=>O.DELETE("/api/v1/cards/{card_id}",{params:{path:{card_id:String(l)}},signal:n})),be=async(l,n)=>{const a=new FormData;return a.append("file",l),M(p=>O.POST("/api/v1/cards/batch",{body:ee(a),signal:p}),n)},ge=async(l,n,a)=>M(p=>O.POST("/api/v1/cards/{card_id}/append-data",{params:{path:{card_id:String(l)}},body:{content:n},signal:p}),a),ye=(l,n,a)=>{const p=a.trim().toLocaleLowerCase();return l.filter(h=>(!n||h.type===n)&&(!p||h.name.toLocaleLowerCase().includes(p)))},Z=l=>l.split(`
`).map(n=>n.trim()).filter(Boolean),fe=(l,n,a)=>!!(l&&Z(n).length>0&&!a),F=(l,n,a,p)=>l===n&&a===p,W=()=>({name:"",type:"data",content:"",description:"",enabled:!0,delay_seconds:0,api_method:"GET",api_timeout:10,api_headers:"",api_params:""}),G=(l,n)=>l instanceof Error?l.message:n,je=({cards:l,loadCards:n})=>{const[a,p]=c.useState(!1),[h,_]=c.useState(!1),[f,j]=c.useState(null),[d,T]=c.useState({}),[i,y]=c.useState(W),[N,b]=c.useState(""),[r,x]=c.useState(""),s=c.useMemo(()=>l.filter(o=>o.type==="data"),[l]),u=c.useMemo(()=>ye(l,N,r),[l,r,N]),I=c.useCallback(o=>{var t,g,k,S,C;j(o),T({id:o.id,name:o.name||"",type:o.type||"text",api_url:((t=o.api_config)==null?void 0:t.url)||"",api_method:((g=o.api_config)==null?void 0:g.method)||"GET",api_timeout:((k=o.api_config)==null?void 0:k.timeout)||10,api_headers:((S=o.api_config)==null?void 0:S.headers)||"",api_params:((C=o.api_config)==null?void 0:C.params)||"",text_content:o.text_content||"",data_content:o.data_content||"",image_url:o.image_url||"",delay_seconds:o.delay_seconds||0,description:o.description||"",enabled:o.enabled}),p(!0)},[]),L=c.useCallback(async()=>{var o,t,g,k,S,C,m,A;if(f){if(!((o=d.name)!=null&&o.trim())){alert("请输入卡密名称");return}if(!d.type){alert("请选择卡密类型");return}try{const w={name:d.name.trim(),type:d.type,description:(t=d.description)==null?void 0:t.trim(),delay_seconds:d.delay_seconds||0,enabled:d.enabled??!0};d.type==="api"?w.api_config={url:((g=d.api_url)==null?void 0:g.trim())||"",method:d.api_method||"GET",timeout:d.api_timeout||10,headers:((k=d.api_headers)==null?void 0:k.trim())||void 0,params:((S=d.api_params)==null?void 0:S.trim())||void 0}:d.type==="text"?w.text_content=((C=d.text_content)==null?void 0:C.trim())||"":d.type==="data"?w.data_content=((m=d.data_content)==null?void 0:m.trim())||"":d.type==="image"&&(w.image_url=((A=d.image_url)==null?void 0:A.trim())||""),await H(f.id,w),p(!1),await n()}catch(w){console.error("更新卡密失败:",w),alert(G(w,"更新失败,请重试"))}}},[d,n,f]),P=c.useCallback(async o=>{if(confirm("确认删除该卡密吗?"))try{await ue(o),await n()}catch(t){console.error("删除卡密失败:",t),alert(G(t,"删除失败,请重试"))}},[n]),v=c.useCallback(async()=>{if(!i.name.trim()){alert("请输入卡密名称");return}if(!i.content.trim()){alert(i.type==="api"?"请输入 API 地址":"请输入卡密内容");return}try{const o={name:i.name.trim(),type:i.type,description:i.description.trim(),enabled:i.enabled,delay_seconds:i.delay_seconds};i.type==="text"&&(o.text_content=i.content.trim()),i.type==="data"&&(o.data_content=i.content.trim()),i.type==="image"&&(o.image_url=i.content.trim()),i.type==="api"&&(o.api_config={url:i.content.trim(),method:i.api_method,timeout:i.api_timeout,headers:i.api_headers.trim()||void 0,params:i.api_params.trim()||void 0}),await he(o),_(!1),y(W()),await n()}catch(o){console.error("添加卡密失败:",o),alert(G(o,"添加失败,请重试"))}},[i,n]),B=c.useCallback(async o=>{try{await H(o.id,{...o,enabled:!o.enabled}),await n()}catch(t){console.error("切换状态失败:",t)}},[n]),R=c.useCallback(async o=>{try{await navigator.clipboard.writeText(String(o)),alert(`已复制卡密组ID:${o}`)}catch{prompt("复制卡密组ID",String(o))}},[]),D=c.useCallback(()=>{const g=[["名称","类型","内容","描述","启用","延迟秒","多规格","规格名","规格值"],...[["VIP月卡","data",`VIP-MONTH-001
VIP-MONTH-002
VIP-MONTH-003`,"按行消费的卡密队列","是","0","否","",""],["感谢文案","text","感谢购买,如有问题联系客服~","固定文本","是","0","否","",""],["教程图","image","https://cdn.example.com/tutorial.jpg","图片URL","是","0","否","",""]]].map(m=>m.map(A=>`"${String(A).replace(/"/g,'""')}"`).join(",")).join(`
@@ -1 +0,0 @@
import{j as e,c as x0,a as i}from"./react-vendor-l-BBvuKH.js";import{L as re}from"./vendor-cRYyTeIw.js";import{g as M0,p as le,b as F0,m as P0,s as ce,d as oe,e as pe,f as me,h as z0}from"./index-2BJ5Kkse.js";import{L as X,al as ge,am as de,M as B0,I as xe,R as ue,ad as U0,k as he,an as _e,t as J0,ao as be,ap as fe,ai as Q0,X as je}from"./icons-vendor-CIGXYOCp.js";const Z0=[["尊嘟假嘟","https://img.alicdn.com/imgextra/i2/O1CN01hWzOgD1KcmFEIaGwE_!!6000000001185-2-tps-64-64.png_110x10000.jpg_.webp"],["鸡哔你","https://img.alicdn.com/imgextra/i1/O1CN01P9TVJl1JCqCZcQIdW_!!6000000000993-2-tps-64-64.png_110x10000.jpg_.webp"],["谁懂啊","https://img.alicdn.com/imgextra/i1/O1CN01r9qUnx1g3tcrtSmcs_!!6000000004087-2-tps-64-64.png_110x10000.jpg_.webp"],["吗喽","https://img.alicdn.com/imgextra/i4/O1CN01dTynZh1LnbIYTHI1D_!!6000000001344-2-tps-64-64.png_110x10000.jpg_.webp"],["功德+1","https://img.alicdn.com/imgextra/i1/O1CN01l1G5pS1IVn37pfQJi_!!6000000000899-2-tps-64-64.png_110x10000.jpg_.webp"],["city不city啊","https://img.alicdn.com/imgextra/i2/O1CN01zRjPTR29lWHqabmDA_!!6000000008108-2-tps-64-64.png_110x10000.jpg_.webp"],["激推","https://img.alicdn.com/imgextra/i3/O1CN01ADTJ6u1khypfxbfnQ_!!6000000004716-2-tps-64-64.png_110x10000.jpg_.webp"],["微笑","https://img.alicdn.com/imgextra/i1/O1CN017b61R51wRk2lVV7vx_!!6000000006305-2-tps-980-980.png_110x10000.jpg_.webp"],["龇牙","https://img.alicdn.com/imgextra/i2/O1CN01nmOh4S22Yxz8IdEVf_!!6000000007133-2-tps-980-980.png_110x10000.jpg_.webp"],["流泪","https://img.alicdn.com/imgextra/i2/O1CN01Ec1EaL1zqQETcM2dX_!!6000000006765-2-tps-980-980.png_110x10000.jpg_.webp"],["尴尬","https://img.alicdn.com/imgextra/i2/O1CN01UrWH7a1ZVBrgRYXlc_!!6000000003199-2-tps-980-980.png_110x10000.jpg_.webp"],["撇嘴","https://img.alicdn.com/imgextra/i2/O1CN01Sr7o2b1lUWg5KfOD8_!!6000000004822-2-tps-980-980.png_110x10000.jpg_.webp"],["破涕为笑","https://img.alicdn.com/imgextra/i4/O1CN01pPetah1gkwndfn7Fs_!!6000000004181-2-tps-980-980.png_110x10000.jpg_.webp"],["捂脸哭","https://img.alicdn.com/imgextra/i2/O1CN0170KgpE1dE1TuQgd66_!!6000000003703-2-tps-980-980.png_110x10000.jpg_.webp"],["害羞","https://img.alicdn.com/imgextra/i3/O1CN01ZoB0Lb1ps7XpqP8PQ_!!6000000005415-2-tps-980-980.png_110x10000.jpg_.webp"],["感动","https://img.alicdn.com/imgextra/i2/O1CN01wqD4ly29yndR3Qp3A_!!6000000008137-2-tps-980-980.png_110x10000.jpg_.webp"],["滴泪","https://img.alicdn.com/imgextra/i1/O1CN01MpkJ3L1oUTTqfryOn_!!6000000005228-2-tps-980-980.png_110x10000.jpg_.webp"],["暗中观察","https://img.alicdn.com/imgextra/i1/O1CN010LO9yj272W07GlLls_!!6000000007739-2-tps-980-980.png_110x10000.jpg_.webp"],["偷笑","https://img.alicdn.com/imgextra/i4/O1CN01vJtO031g818IuYO7x_!!6000000004096-2-tps-980-980.png_110x10000.jpg_.webp"],["ok","https://img.alicdn.com/imgextra/i3/O1CN01QRkqDF25tz0WcANje_!!6000000007585-2-tps-980-980.png_110x10000.jpg_.webp"],["送花","https://img.alicdn.com/imgextra/i2/O1CN01PpzBNX1JNpeJBWnvr_!!6000000001017-2-tps-980-980.png_110x10000.jpg_.webp"],["大哭","https://img.alicdn.com/imgextra/i4/O1CN014TiaNb1ViEgNvRrTB_!!6000000002686-2-tps-980-980.png_110x10000.jpg_.webp"],["色","https://img.alicdn.com/imgextra/i2/O1CN01840t1B1JaCLGvHnBK_!!6000000001044-2-tps-980-980.png_110x10000.jpg_.webp"],["惊慌","https://img.alicdn.com/imgextra/i1/O1CN01mnqO7G1LAfUnfAN2U_!!6000000001259-2-tps-980-980.png_110x10000.jpg_.webp"],["惊讶","https://img.alicdn.com/imgextra/i3/O1CN0127IeyS1Kw0p0P4jzI_!!6000000001227-2-tps-980-980.png_110x10000.jpg_.webp"],["得意","https://img.alicdn.com/imgextra/i4/O1CN018QUnFv1WpOUES9POZ_!!6000000002837-2-tps-980-980.png_110x10000.jpg_.webp"],["睡","https://img.alicdn.com/imgextra/i2/O1CN01RprGZl1lqVgnEJLCx_!!6000000004870-2-tps-980-980.png_110x10000.jpg_.webp"],["不好意思","https://img.alicdn.com/imgextra/i3/O1CN01rMJJgn1SUXzuVpUhO_!!6000000002250-2-tps-980-980.png_110x10000.jpg_.webp"],["托腮","https://img.alicdn.com/imgextra/i1/O1CN01w3reBU1d3wlgOBtyZ_!!6000000003681-2-tps-980-980.png_110x10000.jpg_.webp"],["发怒","https://img.alicdn.com/imgextra/i2/O1CN013Wzy8d2A8PxGJZPpT_!!6000000008158-2-tps-980-980.png_110x10000.jpg_.webp"],["难过","https://img.alicdn.com/imgextra/i2/O1CN01zcwaSh1G9gZCFuFal_!!6000000000580-2-tps-980-980.png_110x10000.jpg_.webp"],["调皮","https://img.alicdn.com/imgextra/i3/O1CN01Zd1YHi1TI0lwpBe8c_!!6000000002358-2-tps-980-980.png_110x10000.jpg_.webp"],["愉快","https://img.alicdn.com/imgextra/i2/O1CN0145wDk21SWpyjTvsvA_!!6000000002255-2-tps-980-980.png_110x10000.jpg_.webp"],["白眼","https://img.alicdn.com/imgextra/i4/O1CN01nexGth1hwEAT1SHO2_!!6000000004341-2-tps-980-980.png_110x10000.jpg_.webp"],["拒绝","https://img.alicdn.com/imgextra/i2/O1CN01nqusqS1uHXzoUcpXr_!!6000000006012-2-tps-980-980.png_110x10000.jpg_.webp"],["期待","https://img.alicdn.com/imgextra/i3/O1CN01M44QY11Oh8Q5PdMIx_!!6000000001736-2-tps-980-980.png_110x10000.jpg_.webp"],["困","https://img.alicdn.com/imgextra/i4/O1CN01J4hFFz1Y9pmNdBq76_ Line truncated
@@ -0,0 +1 @@
import{d as S,j as e,a as n}from"./react-vendor-Bf9ELcll.js";import{L as oe}from"./vendor-BE-_xUHH.js";import{B as pe}from"./audio-codec-mjVr_wwJ.js";import{L as $,al as de,am as me,q as ge,an as xe,ao as ue,M as z0,I as he,R as _e,ad as D0,k as be,ap as fe,t as W0,aq as je,ar as we,ai as J0,X as Ne}from"./icons-vendor-B5fJPoU1.js";import{g as U0,p as ye,b as Q0,m as V0,s as Ce,d as Oe,e as ve,f as ke,h as Z0}from"./index-BcKVxEYs.js";const F0="ydisks:chat-audio-play",Se=[6,10,15,8,17,12,7,16,11,6,14,9];function Re(r){const c=r.trim();if(typeof location>"u"||location.protocol!=="https:")return c;try{const a=new URL(c);return a.protocol==="http:"&&a.hostname.endsWith(".aliyuncs.com")&&(a.protocol="https:"),a.toString()}catch{return c}}function q0(r){const c=Number.isFinite(r)?Math.max(0,Math.floor(r)):0,a=Math.floor(c/60),i=c%60;return`${a}:${i.toString().padStart(2,"0")}`}function T0(r){window.dispatchEvent(new CustomEvent(F0,{detail:r}))}const Ee=({messageKey:r,src:c,outgoing:a,initialDuration:i=0})=>{const x=S.useRef(null),N=S.useRef(0),[d,R]=S.useState("idle"),[E,L]=S.useState(i),[W,q]=S.useState(0);S.useEffect(()=>(()=>{var u;N.current+=1,(u=x.current)==null||u.destroy(),x.current=null}),[c]),S.useEffect(()=>{L(Math.max(0,i))},[i]),S.useEffect(()=>{const u=b=>{const j=b.detail,y=x.current;j!==r&&(y!=null&&y.isPlaying())&&y.pause()};return window.addEventListener(F0,u),(()=>window.removeEventListener(F0,u))},[r]),S.useEffect(()=>{if(d!=="playing")return;const u=window.setInterval(()=>{const b=x.current;b&&q(b.getCurrentPosition())},100);return(()=>window.clearInterval(u))},[d]);const T=(u,b)=>{const j=()=>N.current===b&&x.current===u;u.onPlay(()=>{j()&&R("playing")}),u.onResume(()=>{j()&&R("playing")}),u.onPause(()=>{j()&&R("paused")}),u.onStop(()=>{j()&&(R("idle"),q(0))}),u.onEnded(()=>{j()&&(R("idle"),q(0))})},n0=async()=>{var j;const u=x.current;if(u!=null&&u.isPlaying()){u.pause();return}if(u!=null&&u.isPaused()){T0(r),u.resume();return}if(u!=null&&u.isInit()){T0(r),u.play();return}if(d==="loading")return;const b=N.current+1;N.current=b,R("loading"),q(0);try{const y=new pe;if(x.current=y,T(y,b),await y.initWithUrl(Re(c)),N.current!==b||x.current!==y){y.destroy();return}L(y.getDuration()||Math.max(0,i)),T0(r),y.play()}catch{if(N.current!==b)return;(j=x.current)==null||j.destroy(),x.current=null,R("error"),q(0)}},A=d==="playing"||d==="paused"?W:E,G=E>0?d==="playing"||d==="paused"?`${q0(A)} / ${q0(E)}`:q0(E):"--:--",D=d==="loading"?"正在解码":d==="playing"?"正在播放":d==="paused"?"已暂停":d==="error"?"加载失败,点击重试":"语音消息",k=d==="playing"?"暂停语音消息":d==="paused"?"继续播放语音消息":d==="error"?"重新加载语音消息":d==="loading"?"正在加载语音消息":"播放语音消息";return e.jsxs("div",{className:`flex h-11 min-w-56 items-center gap-2 rounded-2xl border px-2 shadow-sm ${a?"rounded-br-md border-sky-400 bg-sky-500 text-white":"rounded-bl-md border-slate-200 bg-white text-slate-800"}`,children:[e.jsx("button",{type:"button","aria-label":k,title:k,disabled:d==="loading",onClick:(()=>void n0()),className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full transition focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-wait ${a?"bg-white text-sky-600 hover:bg-sky-50 focus-visible:ring-white":"bg-sky-50 text-sky-600 hover:bg-sky-100 focus-visible:ring-sky-400"}`,children:d==="loading"?e.jsx($,{className:"h-4 w-4 animate-spin"}):d==="playing"?e.jsx(de,{className:"h-4 w-4 fill-current"}):d==="error"?e.jsx(me,{className:"h-4 w-4"}):e.jsx(ge,{className:"ml-px h-4 w-4 fill-current"})}),e.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-2",children:[e.jsx("div",{className:"flex h-5 flex-1 items-center gap-0.5","aria-hidden":"true",children:Se.map((u,b)=>e.jsx("span",{className:`w-0.5 rounded-full ${d==="playing"?"animate-pulse":""} ${a?"bg-sky-100":d==="error"?"bg-red-300":"bg-sky-400"}`,style:{height:`${u}px`,animationDelay:`${b*45}ms`}},`${r}-${b}`))}),e.jsx("span",{className:`shrink-0 font-mono text-[11px] font-semibold tabular-nums ${a?"text-sky-100":d==="error"?"text-red-500":"text-slate-500"}`,children:G}),e.jsx("span",{className:"sr-only",children:D})]})]})},X0=[["尊嘟假嘟","https://img.alicdn.com/imgextra/i2/O1CN01hWzOgD1KcmFEIaGwE_!!6000000001185-2-tps-64-64.png_110x10000.jpg_.webp"],["鸡哔你","https://img.alicdn.com/imgextra/i1/O1CN01P9TVJl1JCqCZcQIdW_!!6000000000993-2-tps-64-64.png_110x10000.jpg_.webp"],["谁懂啊","https://img.alicdn.com/imgextra/i1/O1CN01r9qUnx1g3tcrtSmcs_!!6000000004087-2-tps-64-64.png_110x10000.jpg_.webp"],["吗喽","https://img.alicdn.com/imgextra/i4/O1CN01dTynZh1LnbIYTHI1D_!!6000000001344-2-tps-64-64.png_110x10000.jpg_.webp"],["功德+1","https://img.alicdn.com/imgextra/i1/O1CN01l1G5pS1IVn37pfQJi_!!6000000000899-2-tps-64-64.png_110x10000.jpg_.webp"],["city不city啊","https://img.alicdn.com/imgextra/i2/O1CN01zRjPTR29lWHqabmDA_!!6000000008108-2-tps-64-64.png Line truncated
@@ -1 +1 @@
import{j as e,a as c}from"./react-vendor-l-BBvuKH.js";import{f as ge}from"./dateTime-DDi7rqpW.js";import{j as xe,k as he,l as se,D as pe,c as be,P as fe,m as ae,E as ye,T as je}from"./icons-vendor-CIGXYOCp.js";import{R as q,B as ve,X as re,Y as ne,T as W,a as Ne,C as X,A as we,b as _e,c as ke,P as le,d as oe,L as De}from"./charts-vendor-DlHaeEQJ.js";import{r as M,c as K}from"./index-2BJ5Kkse.js";import{c as ue,o as Se}from"./contract-COFcZjyb.js";import"./vendor-cRYyTeIw.js";const F=t=>{const a=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${a}-${s}-${l}`},J=(t,a)=>{const s=new Date(t);return s.setHours(12,0,0,0),s.setDate(s.getDate()+a),s},H=(t,a)=>({startDate:F(J(t,-(a-1))),endDate:F(t)}),me=(t,a=new Date,s="",l="")=>{if(t==="custom"&&s&&l){if(s>l)throw new Error("开始日期不能晚于结束日期");return{startDate:s,endDate:l}}return t==="yesterday"?H(J(a,-1),1):H(a,t==="3days"?3:t==="30days"?30:t==="today"?1:7)},Ce=t=>{const a=new Date(`${t.startDate}T12:00:00`),s=new Date(`${t.endDate}T12:00:00`),l=Math.round((s.getTime()-a.getTime())/864e5)+1,n=J(a,-1);return H(n,l)},i=(t,a)=>a===void 0?`rgb(var(--color-${t}))`:`rgb(var(--color-${t}) / ${a})`,$e=({chartData:t,selectedRangeLabel:a,totalAmount:s})=>e.jsxs("div",{className:"ios-card p-8 rounded-xl",children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:"营收趋势分析"}),e.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:[a,"的销售额走势"]})]}),e.jsx("div",{className:"dashboard-revenue-chart h-[350px] w-full",children:t.length===0||s===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[e.jsx(xe,{className:"w-16 h-16 mb-4 opacity-20"}),e.jsx("p",{className:"text-lg font-medium",children:"暂无营收数据"}),e.jsx("p",{className:"text-sm mt-2",children:"所选时间范围内暂无订单记录"})]}):t.length<=2?e.jsx(q,{width:"100%",height:"100%",children:e.jsxs(ve,{data:t,margin:{top:30,right:20,left:0,bottom:30},barCategoryGap:"45%",children:[e.jsx(re,{dataKey:"name",axisLine:!1,tickLine:!1,tick:{fill:i("neutral-700"),fontSize:14,fontWeight:600},dy:10}),e.jsx(ne,{axisLine:!1,tickLine:!1,tick:{fill:i("neutral-400"),fontSize:13,fontWeight:500},tickFormatter:(l=>`¥${l}`)}),e.jsx(W,{contentStyle:{backgroundColor:i("white"),borderRadius:"8px",border:`1px solid ${i("neutral-200")}`,boxShadow:"var(--shadow-xl)",padding:"12px 16px"},labelStyle:{color:i("neutral-500"),fontWeight:500},itemStyle:{color:i("brand"),fontWeight:600},cursor:{fill:i("brand",.08)},formatter:(l=>[`¥${Number(l).toFixed(2)}`,"营收"])}),e.jsx(Ne,{dataKey:"amount",fill:i("brand"),maxBarSize:72,radius:[12,12,0,0],activeBar:!1,stroke:"none",strokeWidth:0,children:t.map((l,n)=>e.jsx(X,{fill:i("brand"),stroke:"none",strokeWidth:0},`cell-${n}`))})]})}):e.jsx(q,{width:"100%",height:"100%",children:e.jsxs(we,{data:t,margin:{top:10,right:10,left:-20,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"colorAmount",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:i("brand"),stopOpacity:.5}),e.jsx("stop",{offset:"95%",stopColor:i("brand"),stopOpacity:0})]})}),e.jsx(re,{dataKey:"name",axisLine:!1,tickLine:!1,tick:{fill:i("neutral-400"),fontSize:13,fontWeight:500},dy:15}),e.jsx(ne,{axisLine:!1,tickLine:!1,tick:{fill:i("neutral-400"),fontSize:13,fontWeight:500}}),e.jsx(_e,{vertical:!1,stroke:i("neutral-100"),strokeDasharray:"3 3"}),e.jsx(W,{contentStyle:{backgroundColor:i("white"),borderRadius:"8px",border:`1px solid ${i("neutral-200")}`,boxShadow:"var(--shadow-xl)",padding:"12px 16px"},labelStyle:{color:i("neutral-500"),fontWeight:500},itemStyle:{color:i("brand"),fontWeight:600},cursor:{stroke:i("brand"),strokeWidth:2,strokeDasharray:"4 4"}}),e.jsx(ke,{type:"monotone",dataKey:"amount",stroke:i("brand"),strokeWidth:4,fillOpacity:1,fill:"url(#colorAmount)",activeDot:{r:8,fill:i("white"),stroke:i("brand"),strokeWidth:2}})]})})})]}),ie=t=>{const a=String(t||"");return a==="paid"?"pending_ship":["processing","pending_ship","shipped","completed","cancelled","refunding"].includes(a)?a:"unknown"},Re=async t=>M(a=>K.GET("/api/v1/analytics/dashboard",{signal:a}),t),Le=async(t,a)=>{const s=await M(n=>K.GET("/api/v1/items",{params:{query:{cookie_id:t}},signal:n}),a);return ue(s,["items","data","results"]).map(n=>({...n,id:n.id||`${n.cookie_id}-${n.item_id}`,is_multi_spec:n.is_multi_spec===!0||n.is_multi_spec===1,multi_quantity_delivery:n.multi_quantity_delivery===!0||n.multi_quantity_delivery===1}))},ce=async(t=7,a)=>{let s;if(typeof t=="number"){const l=new Date,n=new Date;n.setDate(n.getDate()-t),s={start_date:F(n),end_date:F(l)}}else s=t;return M(l=>K.GET("/api/v1/analytics/orders",{params:{query:{...s,timezone_offset_minutes:-new Date().getTimezoneOffset()}},signal:l}),a)},Te=async(t,a)=>{const s=await M(u=>K.GET("/api/v1/analytics/orders/valid",{params:{query:{...t,timezone_oLine truncated
import{j as e,a as c}from"./react-vendor-Bf9ELcll.js";import{f as ge}from"./dateTime-DDi7rqpW.js";import{j as xe,k as he,l as se,D as pe,c as be,P as fe,m as ae,E as ye,T as je}from"./icons-vendor-B5fJPoU1.js";import{R as q,B as ve,X as re,Y as ne,T as W,a as Ne,C as X,A as we,b as _e,c as ke,P as le,d as oe,L as De}from"./charts-vendor-DBu_rVrn.js";import{r as M,c as K}from"./index-BcKVxEYs.js";import{c as ue,o as Se}from"./contract-COFcZjyb.js";import"./vendor-BE-_xUHH.js";const F=t=>{const a=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${a}-${s}-${l}`},J=(t,a)=>{const s=new Date(t);return s.setHours(12,0,0,0),s.setDate(s.getDate()+a),s},H=(t,a)=>({startDate:F(J(t,-(a-1))),endDate:F(t)}),me=(t,a=new Date,s="",l="")=>{if(t==="custom"&&s&&l){if(s>l)throw new Error("开始日期不能晚于结束日期");return{startDate:s,endDate:l}}return t==="yesterday"?H(J(a,-1),1):H(a,t==="3days"?3:t==="30days"?30:t==="today"?1:7)},Ce=t=>{const a=new Date(`${t.startDate}T12:00:00`),s=new Date(`${t.endDate}T12:00:00`),l=Math.round((s.getTime()-a.getTime())/864e5)+1,n=J(a,-1);return H(n,l)},i=(t,a)=>a===void 0?`rgb(var(--color-${t}))`:`rgb(var(--color-${t}) / ${a})`,$e=({chartData:t,selectedRangeLabel:a,totalAmount:s})=>e.jsxs("div",{className:"ios-card p-8 rounded-xl",children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("h3",{className:"text-xl font-bold text-gray-900",children:"营收趋势分析"}),e.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:[a,"的销售额走势"]})]}),e.jsx("div",{className:"dashboard-revenue-chart h-[350px] w-full",children:t.length===0||s===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[e.jsx(xe,{className:"w-16 h-16 mb-4 opacity-20"}),e.jsx("p",{className:"text-lg font-medium",children:"暂无营收数据"}),e.jsx("p",{className:"text-sm mt-2",children:"所选时间范围内暂无订单记录"})]}):t.length<=2?e.jsx(q,{width:"100%",height:"100%",children:e.jsxs(ve,{data:t,margin:{top:30,right:20,left:0,bottom:30},barCategoryGap:"45%",children:[e.jsx(re,{dataKey:"name",axisLine:!1,tickLine:!1,tick:{fill:i("neutral-700"),fontSize:14,fontWeight:600},dy:10}),e.jsx(ne,{axisLine:!1,tickLine:!1,tick:{fill:i("neutral-400"),fontSize:13,fontWeight:500},tickFormatter:(l=>`¥${l}`)}),e.jsx(W,{contentStyle:{backgroundColor:i("white"),borderRadius:"8px",border:`1px solid ${i("neutral-200")}`,boxShadow:"var(--shadow-xl)",padding:"12px 16px"},labelStyle:{color:i("neutral-500"),fontWeight:500},itemStyle:{color:i("brand"),fontWeight:600},cursor:{fill:i("brand",.08)},formatter:(l=>[`¥${Number(l).toFixed(2)}`,"营收"])}),e.jsx(Ne,{dataKey:"amount",fill:i("brand"),maxBarSize:72,radius:[12,12,0,0],activeBar:!1,stroke:"none",strokeWidth:0,children:t.map((l,n)=>e.jsx(X,{fill:i("brand"),stroke:"none",strokeWidth:0},`cell-${n}`))})]})}):e.jsx(q,{width:"100%",height:"100%",children:e.jsxs(we,{data:t,margin:{top:10,right:10,left:-20,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"colorAmount",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:i("brand"),stopOpacity:.5}),e.jsx("stop",{offset:"95%",stopColor:i("brand"),stopOpacity:0})]})}),e.jsx(re,{dataKey:"name",axisLine:!1,tickLine:!1,tick:{fill:i("neutral-400"),fontSize:13,fontWeight:500},dy:15}),e.jsx(ne,{axisLine:!1,tickLine:!1,tick:{fill:i("neutral-400"),fontSize:13,fontWeight:500}}),e.jsx(_e,{vertical:!1,stroke:i("neutral-100"),strokeDasharray:"3 3"}),e.jsx(W,{contentStyle:{backgroundColor:i("white"),borderRadius:"8px",border:`1px solid ${i("neutral-200")}`,boxShadow:"var(--shadow-xl)",padding:"12px 16px"},labelStyle:{color:i("neutral-500"),fontWeight:500},itemStyle:{color:i("brand"),fontWeight:600},cursor:{stroke:i("brand"),strokeWidth:2,strokeDasharray:"4 4"}}),e.jsx(ke,{type:"monotone",dataKey:"amount",stroke:i("brand"),strokeWidth:4,fillOpacity:1,fill:"url(#colorAmount)",activeDot:{r:8,fill:i("white"),stroke:i("brand"),strokeWidth:2}})]})})})]}),ie=t=>{const a=String(t||"");return a==="paid"?"pending_ship":["processing","pending_ship","shipped","completed","cancelled","refunding"].includes(a)?a:"unknown"},Re=async t=>M(a=>K.GET("/api/v1/analytics/dashboard",{signal:a}),t),Le=async(t,a)=>{const s=await M(n=>K.GET("/api/v1/items",{params:{query:{cookie_id:t}},signal:n}),a);return ue(s,["items","data","results"]).map(n=>({...n,id:n.id||`${n.cookie_id}-${n.item_id}`,is_multi_spec:n.is_multi_spec===!0||n.is_multi_spec===1,multi_quantity_delivery:n.multi_quantity_delivery===!0||n.multi_quantity_delivery===1}))},ce=async(t=7,a)=>{let s;if(typeof t=="number"){const l=new Date,n=new Date;n.setDate(n.getDate()-t),s={start_date:F(n),end_date:F(l)}}else s=t;return M(l=>K.GET("/api/v1/analytics/orders",{params:{query:{...s,timezone_offset_minutes:-new Date().getTimezoneOffset()}},signal:l}),a)},Te=async(t,a)=>{const s=await M(u=>K.GET("/api/v1/analytics/orders/valid",{params:{query:{...t,timezone_oLine truncated
@@ -1,2 +1,2 @@
import{j as e,a as r,b as we}from"./react-vendor-l-BBvuKH.js";import{r as B,c as q,a as Qe,A as gt}from"./index-2BJ5Kkse.js";import{c as et}from"./contract-COFcZjyb.js";import{a3 as yt,U as $e,R as Se,N as De,a4 as Pe,a5 as _e,V as ft,y as jt,B as vt,a6 as Oe,a7 as Nt,a8 as wt,A as _t,d as kt,X as ye,o as Ct,a9 as Ue,I as ze}from"./icons-vendor-CIGXYOCp.js";import"./vendor-cRYyTeIw.js";const Ke="ydisks-amap-js-api",It="c9b68d4ce9a2a97f22a4a439404488ca";let fe=null;const St=()=>It,Pt=()=>window.AMap?Promise.resolve(window.AMap):fe||(fe=new Promise((s,a)=>{const n=document.getElementById(Ke),d=n||document.createElement("script"),u=()=>{window.__ydisksAmapLoaded=void 0,window.clearTimeout(G)},f=()=>{window.AMap?(u(),s(window.AMap)):(u(),a(new Error("高德地图 API 加载完成但未找到 AMap 对象")))},G=window.setTimeout(()=>{u(),a(new Error("高德地图 API 加载超时,请检查网络或 VITE_AMAP_JS_KEY 配置"))},15e3);window.__ydisksAmapLoaded=f,d.id=Ke,d.async=!0,d.src=`https://webapi.amap.com/maps?v=2.0&key=${encodeURIComponent(St())}&plugin=AMap.PlaceSearch&callback=__ydisksAmapLoaded`,d.onerror=()=>{u(),a(new Error("高德地图 API 加载失败,请检查网络或 VITE_AMAP_JS_KEY 配置"))},n||document.head.appendChild(d)}).catch(s=>{throw fe=null,s}),fe),ke=s=>Number.isFinite(s)&&s!==0,Bt=s=>{var u,f;const a=Number((u=s.location)==null?void 0:u.lng),n=Number((f=s.location)==null?void 0:f.lat),d={area:String(s.adname||"").trim(),city:String(s.cityname||"").trim(),division_id:String(s.adcode||"").trim(),longitude:a,latitude:n,poi_id:String(s.id||"").trim(),poi_name:String(s.name||"").trim(),province:String(s.pname||"").trim()};return!d.division_id||!d.province||!d.city||!d.poi_id||!d.poi_name||!ke(a)||!ke(n)||a<-180||a>180||n<-90||n>90?null:d},qt=async(s,a,n={})=>{if(!ke(s)||!ke(a)||s<-180||s>180||a<-90||a>90)throw new Error("经纬度无效");const d=await Pt();return new Promise((u,f)=>{var $,R;let G=!1;const k=Math.max(1,n.timeoutMs??1e4),M=F=>{var p;G||(G=!0,globalThis.clearTimeout(W),(p=n.signal)==null||p.removeEventListener("abort",I),F())},I=()=>M(()=>f(new DOMException("aborted","AbortError"))),W=globalThis.setTimeout(()=>M(()=>f(new Error("高德地图附近地址查询超时,请稍后重试"))),k);if(($=n.signal)!=null&&$.aborted){I();return}(R=n.signal)==null||R.addEventListener("abort",I,{once:!0}),new d.PlaceSearch({extensions:"all",pageSize:10}).searchNearBy("",[s,a],1e3,(F,p)=>{var x;if(G)return;if(F!=="complete"){if(F==="no_data"){M(()=>u([]));return}M(()=>f(new Error("高德地图附近地址查询失败,请稍后重试")));return}const E=(((x=p==null?void 0:p.poiList)==null?void 0:x.pois)||[]).map(Bt).filter(j=>j!==null);M(()=>u(E))})})},Et=async s=>B(a=>q.GET("/api/v1/accounts/details",{signal:a}),s),Je=async s=>B(a=>q.GET("/api/v1/automation-rules",{signal:a}),s),Lt=(s,a,n)=>qt(s,a,n),Be=(s,a)=>{if(s instanceof gt)switch(s.code){case"stock_permission_missing":return"发布失败:该账号没有库存发布权限,无法按库存数量发布商品。请换账号或先在闲鱼确认库存能力。";case"conflict":case"item_conflict":return"商品状态已发生变化,请刷新后重试。";case"external_result_unknown":case"manual_review_required":return"平台结果暂时无法确认,请先人工核对闲鱼状态,再决定是否重试。";case"retryable":case"temporarily_unavailable":return"平台暂时不可用,请稍后重试。";default:return s.message||a}if(s instanceof Error)return s.message;const n=typeof s=="object"&&s!==null&&"message"in s?s.message:void 0;return typeof n=="string"?n:a},qe=s=>s===!0||s===1||s==="1",Ze=async(s,a)=>{const n=await B(u=>q.GET("/api/v1/items",{params:{query:{cookie_id:s}},signal:u}),a);return et(n,["items","data","results"]).map(u=>({...u,id:u.id||`${u.cookie_id}-${u.item_id}`,is_multi_spec:qe(u.is_multi_spec),is_multi_qty_ship:qe(u.is_multi_qty_ship??u.multi_quantity_delivery),multi_quantity_delivery:qe(u.multi_quantity_delivery??u.is_multi_qty_ship)}))},At=async s=>B(a=>q.POST("/api/v1/items/get-all-from-account",{body:{cookie_id:s},signal:a})),Mt=async(s,a)=>B(n=>q.DELETE("/api/v1/items/{cookie_id}/{item_id}",{params:{path:{cookie_id:s,item_id:a}},signal:n})),Rt=async(s,a)=>B(n=>q.POST("/api/v1/items/{cookie_id}",{params:{path:{cookie_id:s}},body:a,signal:n})),Ft=async s=>{const a=new FormData;a.set("cookie_id",s.cookie_id),a.set("title",s.title),a.set("description",s.description),a.set("price",s.price),a.set("original_price",s.original_price||""),a.set("quantity",String(s.quantity)),a.set("postage_mode",s.postage_mode),a.set("postage",s.postage||""),s.location&&a.set("location",JSON.stringify(s.location));for(const n of s.images)a.append("images",n);return B(n=>q.POST("/api/v1/items/publish",{body:Qe(a),signal:n}))},Gt=async(s,a,n)=>B(d=>q.POST("/api/v1/items/publish-categories/recommend",{body:{cookie_id:s,keyword:a},signal:d}),n),Tt=async(s,a)=>{const n=new FormData;return n.set("file",s.file),s.imagesZip&&n.seLine truncated
import{j as e,a as r,b as we}from"./react-vendor-Bf9ELcll.js";import{r as B,c as q,a as Qe,A as gt}from"./index-BcKVxEYs.js";import{c as et}from"./contract-COFcZjyb.js";import{a3 as yt,U as $e,R as Se,N as De,a4 as Pe,a5 as _e,V as ft,y as jt,B as vt,a6 as Oe,a7 as Nt,a8 as wt,A as _t,d as kt,X as ye,o as Ct,a9 as Ue,I as ze}from"./icons-vendor-B5fJPoU1.js";import"./vendor-BE-_xUHH.js";const Ke="ydisks-amap-js-api",It="c9b68d4ce9a2a97f22a4a439404488ca";let fe=null;const St=()=>It,Pt=()=>window.AMap?Promise.resolve(window.AMap):fe||(fe=new Promise((s,a)=>{const n=document.getElementById(Ke),d=n||document.createElement("script"),u=()=>{window.__ydisksAmapLoaded=void 0,window.clearTimeout(G)},f=()=>{window.AMap?(u(),s(window.AMap)):(u(),a(new Error("高德地图 API 加载完成但未找到 AMap 对象")))},G=window.setTimeout(()=>{u(),a(new Error("高德地图 API 加载超时,请检查网络或 VITE_AMAP_JS_KEY 配置"))},15e3);window.__ydisksAmapLoaded=f,d.id=Ke,d.async=!0,d.src=`https://webapi.amap.com/maps?v=2.0&key=${encodeURIComponent(St())}&plugin=AMap.PlaceSearch&callback=__ydisksAmapLoaded`,d.onerror=()=>{u(),a(new Error("高德地图 API 加载失败,请检查网络或 VITE_AMAP_JS_KEY 配置"))},n||document.head.appendChild(d)}).catch(s=>{throw fe=null,s}),fe),ke=s=>Number.isFinite(s)&&s!==0,Bt=s=>{var u,f;const a=Number((u=s.location)==null?void 0:u.lng),n=Number((f=s.location)==null?void 0:f.lat),d={area:String(s.adname||"").trim(),city:String(s.cityname||"").trim(),division_id:String(s.adcode||"").trim(),longitude:a,latitude:n,poi_id:String(s.id||"").trim(),poi_name:String(s.name||"").trim(),province:String(s.pname||"").trim()};return!d.division_id||!d.province||!d.city||!d.poi_id||!d.poi_name||!ke(a)||!ke(n)||a<-180||a>180||n<-90||n>90?null:d},qt=async(s,a,n={})=>{if(!ke(s)||!ke(a)||s<-180||s>180||a<-90||a>90)throw new Error("经纬度无效");const d=await Pt();return new Promise((u,f)=>{var $,R;let G=!1;const k=Math.max(1,n.timeoutMs??1e4),M=F=>{var p;G||(G=!0,globalThis.clearTimeout(W),(p=n.signal)==null||p.removeEventListener("abort",I),F())},I=()=>M(()=>f(new DOMException("aborted","AbortError"))),W=globalThis.setTimeout(()=>M(()=>f(new Error("高德地图附近地址查询超时,请稍后重试"))),k);if(($=n.signal)!=null&&$.aborted){I();return}(R=n.signal)==null||R.addEventListener("abort",I,{once:!0}),new d.PlaceSearch({extensions:"all",pageSize:10}).searchNearBy("",[s,a],1e3,(F,p)=>{var x;if(G)return;if(F!=="complete"){if(F==="no_data"){M(()=>u([]));return}M(()=>f(new Error("高德地图附近地址查询失败,请稍后重试")));return}const E=(((x=p==null?void 0:p.poiList)==null?void 0:x.pois)||[]).map(Bt).filter(j=>j!==null);M(()=>u(E))})})},Et=async s=>B(a=>q.GET("/api/v1/accounts/details",{signal:a}),s),Je=async s=>B(a=>q.GET("/api/v1/automation-rules",{signal:a}),s),Lt=(s,a,n)=>qt(s,a,n),Be=(s,a)=>{if(s instanceof gt)switch(s.code){case"stock_permission_missing":return"发布失败:该账号没有库存发布权限,无法按库存数量发布商品。请换账号或先在闲鱼确认库存能力。";case"conflict":case"item_conflict":return"商品状态已发生变化,请刷新后重试。";case"external_result_unknown":case"manual_review_required":return"平台结果暂时无法确认,请先人工核对闲鱼状态,再决定是否重试。";case"retryable":case"temporarily_unavailable":return"平台暂时不可用,请稍后重试。";default:return s.message||a}if(s instanceof Error)return s.message;const n=typeof s=="object"&&s!==null&&"message"in s?s.message:void 0;return typeof n=="string"?n:a},qe=s=>s===!0||s===1||s==="1",Ze=async(s,a)=>{const n=await B(u=>q.GET("/api/v1/items",{params:{query:{cookie_id:s}},signal:u}),a);return et(n,["items","data","results"]).map(u=>({...u,id:u.id||`${u.cookie_id}-${u.item_id}`,is_multi_spec:qe(u.is_multi_spec),is_multi_qty_ship:qe(u.is_multi_qty_ship??u.multi_quantity_delivery),multi_quantity_delivery:qe(u.multi_quantity_delivery??u.is_multi_qty_ship)}))},At=async s=>B(a=>q.POST("/api/v1/items/get-all-from-account",{body:{cookie_id:s},signal:a})),Mt=async(s,a)=>B(n=>q.DELETE("/api/v1/items/{cookie_id}/{item_id}",{params:{path:{cookie_id:s,item_id:a}},signal:n})),Rt=async(s,a)=>B(n=>q.POST("/api/v1/items/{cookie_id}",{params:{path:{cookie_id:s}},body:a,signal:n})),Ft=async s=>{const a=new FormData;a.set("cookie_id",s.cookie_id),a.set("title",s.title),a.set("description",s.description),a.set("price",s.price),a.set("original_price",s.original_price||""),a.set("quantity",String(s.quantity)),a.set("postage_mode",s.postage_mode),a.set("postage",s.postage||""),s.location&&a.set("location",JSON.stringify(s.location));for(const n of s.images)a.append("images",n);return B(n=>q.POST("/api/v1/items/publish",{body:Qe(a),signal:n}))},Gt=async(s,a,n)=>B(d=>q.POST("/api/v1/items/publish-categories/recommend",{body:{cookie_id:s,keyword:a},signal:d}),n),Tt=async(s,a)=>{const n=new FormData;return n.set("file",s.file),s.imagesZip&&n.seLine truncated
`),ee=new Blob(["\uFEFF"+A],{type:"text/csv;charset=utf-8"}),T=URL.createObjectURL(ee),P=document.createElement("a");P.href=T,P.download="批量铺货模板.csv",document.body.appendChild(P),P.click(),P.remove(),URL.revokeObjectURL(T)},[]),i=r.useCallback(()=>{y(o=>({...o,cookie_id:s||o.cookie_id})),p(!0)},[s]),h=r.useCallback(()=>{v(o=>({...o,cookie_id:s||o.cookie_id})),x(!0)},[s]),L=r.useCallback(async o=>{if(!(o?s:g.cookie_id))return alert("请先选择发布账号");if(!navigator.geolocation)return alert("当前浏览器不支持定位");O();const A=new AbortController;Q.current=A;const ee=++K.current;S(!0);try{const T=await new Promise((ue,he)=>{const Ce=te=>ue(te),ie=te=>he(te);navigator.geolocation.getCurrentPosition(Ce,ie,{enableHighAccuracy:!0,timeout:15e3,maximumAge:6e4})});if(A.signal.aborted||ee!==K.current)return;const P=await Lt(T.coords.longitude,T.coords.latitude,{signal:A.signal});if(A.signal.aborted||ee!==K.current)return;if(!P.length)throw new Error("当前位置附近没有可用的高德发货地,请稍后重试");o?(G(P),k(P[0])):(H(P),z(P[0]))}catch(T){if(A.signal.aborted||ee!==K.current)return;if(typeof T=="object"&&T!==null&&"code"in T){const P=T;alert(P.code===P.PERMISSION_DENIED?"定位权限被拒绝,请在浏览器设置中允许定位":"无法获取当前位置,请稍后重试")}else alert(Be(T,"获取发货地失败"))}finally{ee===K.current&&(Q.current=null,S(!1))}},[O,g.cookie_id,s,k,G]);return{selectedAccount:s,setSelectedAccount:a,loading:M,publishing:W,showEditModal:$,setShowEditModal:R,showAddModal:F,setShowAddModal:p,showPublishModal:E,setShowPublishModal:x,locationLoading:j,publishLocations:Y,setPublishLocations:H,publishLocation:X,setPublishLocation:z,selectedItem:D,editForm:C,setEditForm:le,addForm:b,setAddForm:y,publishForm:g,setPublishForm:v,publishImagePreviews:m,handleSync:ae,handleEdit:de,handleSaveEdit:ne,handleDelete:xe,handleAddItem:me,handlePublishItem:ve,downloadPublishTemplate:l,openAddModal:i,openPublishModal:h,locateForPublish:L}},Ht=s=>{const a=String(s||"").trim();return a?/^[¥¥]/.test(a)?a:`¥${a}`:"-"},as=({onConfigureDelivery:s})=>{const[a,n]=r.useState([]),[d,u]=r.useState([]),[f,G]=r.useState([]),[k,M]=r.useState(""),[I,W]=r.useState(""),U=r.useRef(0),$=r.useRef(0),R=r.useCallback(async()=>{const t=++U.current,c=await Ze();t===U.current&&n(c)},[]),F=r.useCallback(async()=>{const t=++$.current,c=await Je();t===$.current&&u(c)},[]),p=Wt({selectedAccount:k,loadItems:R,loadShippingRules:F}),{showBatchModal:E,batchLoading:x,batchPhase:j,batchFile:S,setBatchFile:Y,batchImagesZip:H,setBatchImagesZip:X,batchCategoryKeyword:z,setBatchCategoryKeyword:D,batchCategoryLoading:Z,batchFallbackCategory:C,setBatchFallbackCategory:le,batchPreview:b,batchDetail:y,recentBatch:g,setRecentBatch:v,batchLocations:m,batchLocation:re,batchPublishIntervalSeconds:Q,setBatchPublishIntervalSeconds:K,setBatchLocations:O,setBatchLocation:ae,openBatchModal:de,handleRecommendBatchCategory:ne,openRecentBatchResult:xe,handlePreviewBatch:me,handleStartBatch:ve,handleCancelBatch:l,abandonBatchPreview:i,closeBatchModal:h,handleRetryBatchFailed:L}=p,o=Yt({selectedAccount:k,setSelectedAccount:M,setItems:n,loadItems:R,loadShippingRules:F,onConfigureDelivery:s,setBatchLocations:O,setBatchLocation:ae}),{loading:N,publishing:A,showEditModal:ee,setShowEditModal:T,showAddModal:P,setShowAddModal:ue,showPublishModal:he,setShowPublishModal:Ce,locationLoading:ie,publishLocations:te,setPublishLocations:st,publishLocation:at,setPublishLocation:Ee,selectedItem:Le,editForm:se,setEditForm:Ne,addForm:J,setAddForm:pe,publishForm:w,setPublishForm:V,publishImagePreviews:Ae,handleSync:lt,handleEdit:rt,handleSaveEdit:nt,handleDelete:it,handleAddItem:ct,handlePublishItem:ot,downloadPublishTemplate:dt,openAddModal:xt,openPublishModal:mt,locateForPublish:Me}=o;r.useEffect(()=>{const t=new AbortController,c=++U.current,_=++$.current;let ge=!0;return Promise.all([Et({signal:t.signal}),Ze(void 0,{signal:t.signal}),Je({signal:t.signal}),tt(20,{signal:t.signal})]).then(([ce,ht,pt,Te])=>{if(!ge||t.signal.aborted||c!==U.current||_!==$.current)return;G(ce),n(ht),u(pt);const bt=Te.find(Ie=>["running","canceling"].includes(Ie.status))||Te.find(Ie=>Ie.status!=="preview");v(bt||null)}).catch(ce=>{t.signal.aborted||console.error("加载商品配置失败:",ce)}),(()=>{ge=!1,t.abort()})},[]);const ut=t=>d.filter(c=>c.cookie_id===t.cookie_id&&c.item_id===t.item_id).length>0?d.filter(c=>c.cookie_id===t.cookie_id&&c.item_id===t.item_id):d.filter(c=>c.cookie_id===t.cookie_id&&!c.item_id),Re=r.useMemo(()=>new Map(f.map(t=>[t.id,t])),[f]),Fe=r.useMemo(()=>I?a.filter(t=>t.cookie_id===I):a,[I,a]),be=t=>{const c=Re.get(t),_=(c==null?void 0:c.remark)||(c==null?void 0:c.nickname);return _?`${_} · ${t.slice(0,6)}`:`账号 ${t.slice(0,8)}`},Ge=t=>{const c=Re.get(t);return(c==null?void 0:c.remark)||(c==null?void 0:c.nickname)||"未命名账号"};return e.jsxs("div",{className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{ Line truncated
@@ -1 +1 @@
import{j as e,b as _e,a as d}from"./react-vendor-l-BBvuKH.js";import{aj as te,ai as ae,ak as je,u as Q,e as I,L as z,w as Ne,y as ve,t as V,X as ne,z as re,F as le,o as ke,R as we,N as Se}from"./icons-vendor-CIGXYOCp.js";import{r as R,c as B}from"./index-2BJ5Kkse.js";import"./vendor-cRYyTeIw.js";const Y=["smtp_server","smtp_port","smtp_user","smtp_password","smtp_from_name","smtp_from_address","smtp_use_tls","smtp_use_ssl"],H=(s,t)=>{if(typeof s=="boolean")return s;if(typeof s=="string"){if(["true","1","yes","on"].includes(s.toLowerCase()))return!0;if(["false","0","no","off"].includes(s.toLowerCase()))return!1}return t},oe=s=>{const t=Object.prototype.hasOwnProperty.call(s,"use_custom_smtp"),a=Y.some(r=>String(s[r]??"").trim()!=="");return{...s,use_custom_smtp:t?H(s.use_custom_smtp,!1):a}},ie=(s,t)=>{const a={...s,use_custom_smtp:!0};for(const r of Y)String(a[r]??"").trim()===""&&t[r]!==void 0&&(a[r]=t[r]);return a.smtp_port||(a.smtp_port=587),a.smtp_from_address||(a.smtp_from_address=a.smtp_user||""),a.smtp_use_tls=H(a.smtp_use_tls,!0),a.smtp_use_ssl=H(a.smtp_use_ssl,!1),a},ce=s=>{const t=oe(s),a={to_email:String(t.to_email??"").trim(),use_custom_smtp:t.use_custom_smtp===!0};if(a.use_custom_smtp)for(const r of Y)a[r]=t[r];return a},F={bark:{label:"Bark",icon:I,fields:[{key:"server_url",label:"Bark 服务器",placeholder:"https://api.day.app",required:!0},{key:"device_key",label:"Device Key",placeholder:"你的 Bark 设备 Key",required:!0},{key:"title",label:"标题(可选)",placeholder:"Ydisks闲鱼助手"},{key:"sound",label:"铃声(可选)",placeholder:"default"},{key:"group",label:"分组(可选)",placeholder:"xianyu"}],guide:{steps:["App Store 搜索并安装 Bark(免费)","打开 Bark App,首页会显示一条测试 URL,形如 https://api.day.app/<key>/这是测试推送内容","URL 路径里 <key> 那一段就是 Device Key,复制填入","服务器地址默认 https://api.day.app,自建服务端则填自建域名"],urlFormat:"https://api.day.app/<你的key>/测试内容",note:"不需要 secret,Device Key 本身就是唯一凭证。"}},dingtalk:{label:"钉钉机器人",icon:Q,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",required:!0},{key:"secret",label:"加签密钥",placeholder:"SEC...",help:"安全设置勾选「加签」后生成,SEC 开头"}],guide:{steps:["钉钉进入一个群(可建单人群)→ 右上角 群设置","机器人 → 添加机器人 → 选择「自定义机器人」","安全设置勾选「加签」","完成页同时展示 Webhook 地址和 SEC 开头的 Secret,两个都复制","Webhook URL 填上面,Secret 填加签密钥"],urlFormat:"https://oapi.dingtalk.com/robot/send?access_token=XXX",note:"加签密钥可选,但强烈建议启用,否则机器人可能被滥用。"}},feishu:{label:"飞书机器人",icon:Q,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",required:!0},{key:"secret",label:"签名校验密钥",placeholder:"sec-...",help:"安全设置选「签名校验」后生成"}],guide:{steps:["飞书进入目标群 → 右上角 更多 → 设置","群机器人 → 添加机器人 → 自定义机器人","安全设置选择「签名校验」,复制生成的秘钥","完成会给 Webhook 地址,复制","Webhook URL 填上面,秘钥填签名校验密钥"],urlFormat:"https://open.feishu.cn/open-apis/bot/v2/hook/xxx",note:"签名密钥可选,建议启用。频率限制:单机器人 100 次/分钟。"}},wechat:{label:"企业微信机器人",icon:Q,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",required:!0}],guide:{steps:["企业微信进入一个内部群 → 右上角 … → 群设置","找到「群机器人」(新版可能叫「消息推送」)","添加 → 选择自定义机器人","完成给 Webhook 地址(含 ?key=),复制填入"],urlFormat:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXX",note:"不需要 secret,URL 里的 key 就是唯一凭证,注意不要泄露。频率限制 20 条/分钟。"}},webhook:{label:"自定义 Webhook",icon:je,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://your-server/notify",required:!0}],guide:{steps:["仅适用于自己有服务器的用户:在你自己的机器上起一个 HTTP 接口收 JSON","系统会 POST 这个 URL,Content-Type: application/json","请求体固定为右侧 JSON 格式,按需解析 message 字段"],urlFormat:'{"message":"告警正文","timestamp":"2026-07-05 12:00:00","source":"xianyu-auto-reply"}',note:"若用 Server酱 / PushPlus 等第三方推送服务,格式不兼容,需写中间脚本转发,或改用对应专用渠道。"}},telegram:{label:"Telegram",icon:ae,fields:[{key:"bot_token",label:"Bot Token",placeholder:"123456:ABC-DEF...",required:!0},{key:"chat_id",label:"Chat ID",placeholder:"-1001234567890 或你的Line truncated
import{j as e,b as _e,a as d}from"./react-vendor-Bf9ELcll.js";import{aj as te,ai as ae,ak as je,u as Q,e as I,L as z,w as Ne,y as ve,t as V,X as ne,z as re,F as le,o as ke,R as we,N as Se}from"./icons-vendor-B5fJPoU1.js";import{r as R,c as B}from"./index-BcKVxEYs.js";import"./vendor-BE-_xUHH.js";const Y=["smtp_server","smtp_port","smtp_user","smtp_password","smtp_from_name","smtp_from_address","smtp_use_tls","smtp_use_ssl"],H=(s,t)=>{if(typeof s=="boolean")return s;if(typeof s=="string"){if(["true","1","yes","on"].includes(s.toLowerCase()))return!0;if(["false","0","no","off"].includes(s.toLowerCase()))return!1}return t},oe=s=>{const t=Object.prototype.hasOwnProperty.call(s,"use_custom_smtp"),a=Y.some(r=>String(s[r]??"").trim()!=="");return{...s,use_custom_smtp:t?H(s.use_custom_smtp,!1):a}},ie=(s,t)=>{const a={...s,use_custom_smtp:!0};for(const r of Y)String(a[r]??"").trim()===""&&t[r]!==void 0&&(a[r]=t[r]);return a.smtp_port||(a.smtp_port=587),a.smtp_from_address||(a.smtp_from_address=a.smtp_user||""),a.smtp_use_tls=H(a.smtp_use_tls,!0),a.smtp_use_ssl=H(a.smtp_use_ssl,!1),a},ce=s=>{const t=oe(s),a={to_email:String(t.to_email??"").trim(),use_custom_smtp:t.use_custom_smtp===!0};if(a.use_custom_smtp)for(const r of Y)a[r]=t[r];return a},F={bark:{label:"Bark",icon:I,fields:[{key:"server_url",label:"Bark 服务器",placeholder:"https://api.day.app",required:!0},{key:"device_key",label:"Device Key",placeholder:"你的 Bark 设备 Key",required:!0},{key:"title",label:"标题(可选)",placeholder:"Ydisks闲鱼助手"},{key:"sound",label:"铃声(可选)",placeholder:"default"},{key:"group",label:"分组(可选)",placeholder:"xianyu"}],guide:{steps:["App Store 搜索并安装 Bark(免费)","打开 Bark App,首页会显示一条测试 URL,形如 https://api.day.app/<key>/这是测试推送内容","URL 路径里 <key> 那一段就是 Device Key,复制填入","服务器地址默认 https://api.day.app,自建服务端则填自建域名"],urlFormat:"https://api.day.app/<你的key>/测试内容",note:"不需要 secret,Device Key 本身就是唯一凭证。"}},dingtalk:{label:"钉钉机器人",icon:Q,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",required:!0},{key:"secret",label:"加签密钥",placeholder:"SEC...",help:"安全设置勾选「加签」后生成,SEC 开头"}],guide:{steps:["钉钉进入一个群(可建单人群)→ 右上角 群设置","机器人 → 添加机器人 → 选择「自定义机器人」","安全设置勾选「加签」","完成页同时展示 Webhook 地址和 SEC 开头的 Secret,两个都复制","Webhook URL 填上面,Secret 填加签密钥"],urlFormat:"https://oapi.dingtalk.com/robot/send?access_token=XXX",note:"加签密钥可选,但强烈建议启用,否则机器人可能被滥用。"}},feishu:{label:"飞书机器人",icon:Q,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",required:!0},{key:"secret",label:"签名校验密钥",placeholder:"sec-...",help:"安全设置选「签名校验」后生成"}],guide:{steps:["飞书进入目标群 → 右上角 更多 → 设置","群机器人 → 添加机器人 → 自定义机器人","安全设置选择「签名校验」,复制生成的秘钥","完成会给 Webhook 地址,复制","Webhook URL 填上面,秘钥填签名校验密钥"],urlFormat:"https://open.feishu.cn/open-apis/bot/v2/hook/xxx",note:"签名密钥可选,建议启用。频率限制:单机器人 100 次/分钟。"}},wechat:{label:"企业微信机器人",icon:Q,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",required:!0}],guide:{steps:["企业微信进入一个内部群 → 右上角 … → 群设置","找到「群机器人」(新版可能叫「消息推送」)","添加 → 选择自定义机器人","完成给 Webhook 地址(含 ?key=),复制填入"],urlFormat:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXX",note:"不需要 secret,URL 里的 key 就是唯一凭证,注意不要泄露。频率限制 20 条/分钟。"}},webhook:{label:"自定义 Webhook",icon:je,fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://your-server/notify",required:!0}],guide:{steps:["仅适用于自己有服务器的用户:在你自己的机器上起一个 HTTP 接口收 JSON","系统会 POST 这个 URL,Content-Type: application/json","请求体固定为右侧 JSON 格式,按需解析 message 字段"],urlFormat:'{"message":"告警正文","timestamp":"2026-07-05 12:00:00","source":"xianyu-auto-reply"}',note:"若用 Server酱 / PushPlus 等第三方推送服务,格式不兼容,需写中间脚本转发,或改用对应专用渠道。"}},telegram:{label:"Telegram",icon:ae,fields:[{key:"bot_token",label:"Bot Token",placeholder:"123456:ABC-DEF...",required:!0},{key:"chat_id",label:"Chat ID",placeholder:"-1001234567890 或你的Line truncated
@@ -1 +1 @@
import{j as e,b as H,a as r}from"./react-vendor-l-BBvuKH.js";import{f as ee}from"./dateTime-DDi7rqpW.js";import{U as ne,I as ie,X as K,J as oe,R as Y,N as ce,O as se,m as te,E as de,F as xe,V as me,y as ue,h as he,g as pe,o as ge}from"./icons-vendor-CIGXYOCp.js";import{r as O,c as M,a as be}from"./index-2BJ5Kkse.js";import{o as ye,c as fe}from"./contract-COFcZjyb.js";import"./vendor-cRYyTeIw.js";const je=[{key:"all",label:"全部"},{key:"processing",label:"处理中"},{key:"shipped",label:"已发货"},{key:"pending_ship",label:"待发货"},{key:"completed",label:"已完成"},{key:"cancelled",label:"已取消"},{key:"refunding",label:"退款中"}],ve=s=>{const t=typeof s=="object"&&s!==null?s:{},a=Array.isArray(t.results)?t.results:[];return{total:Number(t.total||0),success_count:Number(t.success_count||0),failed_count:Number(t.failed_count||0),results:a.map(Ne)}},Ne=s=>{const t=typeof s=="object"&&s!==null?s:{};return{order_id:String(t.order_id||"unknown"),success:t.success===!0,message:String(t.message||"")}},we=s=>(s==null?void 0:s.results.filter(_e))||[],_e=s=>!s.success,ke=(s,t)=>s!==null&&!t,Ce=s=>{if(!s)return"请选择订单文件";const t=s.name.toLowerCase().split(".").pop()||"";return["xlsx","csv","tsv","json"].includes(t)?"":"仅支持 .xlsx、.csv、.tsv、.json 格式"},z=(s,t)=>s===t,Se=(s,t)=>s instanceof Error&&s.message?s.message:t,Ee=({filter:s,onFilterChange:t,accountFilter:a,onAccountFilterChange:u,accounts:h,accountName:x,searchText:p,onSearchChange:f})=>{const b=i=>t(i.currentTarget.dataset.status||"all"),y=i=>u(i.target.value),j=i=>f(i.target.value);return e.jsxs("div",{className:"p-4 border-b border-gray-50 flex flex-col md:flex-row gap-4 justify-between items-center bg-surface-muted",children:[e.jsx("div",{className:"flex gap-1 p-1 bg-gray-200/50 rounded-xl overflow-x-auto max-w-full",children:je.map(i=>e.jsx("button",{"data-status":i.key,onClick:b,className:`px-5 py-2 rounded-lg text-sm font-bold transition-all whitespace-nowrap ${s===i.key?"bg-white text-black shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:i.label},i.key))}),e.jsxs("div",{className:"flex w-full md:w-auto flex-col sm:flex-row gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ne,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),e.jsxs("select",{"aria-label":"按账号筛选订单",value:a,onChange:y,className:"ios-input pl-10 pr-9 py-2.5 rounded-xl w-full sm:w-56 bg-white border-none shadow-sm",children:[e.jsx("option",{value:"",children:"全部账号"}),h.map(i=>e.jsx("option",{value:i.id,children:x(i.id)},i.id))]})]}),e.jsxs("div",{className:"relative group",children:[e.jsx(ie,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 group-focus-within:text-brand transition-colors"}),e.jsx("input",{type:"text",placeholder:"搜索订单号/商品/买家...",value:p,onChange:j,className:"ios-input pl-10 pr-4 py-2.5 rounded-xl w-64 bg-white border-none shadow-sm focus:ring-0"})]})]})]})},Oe=s=>{const t=x=>{var p;s.setImportFile(((p=x.target.files)==null?void 0:p[0])||null)},a=()=>s.closeImportModal(),u=()=>void s.handleImportOrders(),h=()=>void s.handleRetryImport();return s.showImportModal?H.createPortal(e.jsx("div",{className:"modal-overlay-centered",children:e.jsxs("div",{className:"modal-container",children:[e.jsx("div",{className:"modal-header",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"插入订单"}),e.jsx("button",{onClick:a,className:"p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors",children:e.jsx(K,{className:"w-5 h-5 text-gray-600"})})]})}),e.jsxs("div",{className:"modal-body space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"选择Excel文件"}),e.jsx("input",{type:"file",accept:".xlsx,.csv,.tsv,.json",onChange:t,className:"w-full ios-input px-4 py-3 rounded-xl text-sm"}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"支持 .xlsx、.csv、.tsv、.json 格式"})]}),s.importFile&&e.jsx("div",{className:"p-3 bg-blue-50 rounded-xl",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(oe,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm font-medium text-blue-900",children:s.importFile.name})]})}),s.importError&&e.jsxs("div",{className:"rounded-xl bg-red-50 border border-red-100 p-3 text-sm text-red-700 flex items-center justify-between gap-3",children:[e.jsx("span",{children:s.importError}),e.jsx("button",{type:"button",onClick:h,disabled:s.importing||!s.importFile,className:"font-bold whitespace-nowrap",children:"重试"})]}),s.importResult&&s.importResult.failed_count>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-xl bg-amber-50 border border-amber-100 p-3 text-sm font-bold text-amber-800",children:["导入完成:成功 "Line truncated
import{j as e,b as H,a as r}from"./react-vendor-Bf9ELcll.js";import{f as ee}from"./dateTime-DDi7rqpW.js";import{U as ne,I as ie,X as K,J as oe,R as Y,N as ce,O as se,m as te,E as de,F as xe,V as me,y as ue,h as he,g as pe,o as ge}from"./icons-vendor-B5fJPoU1.js";import{r as O,c as M,a as be}from"./index-BcKVxEYs.js";import{o as ye,c as fe}from"./contract-COFcZjyb.js";import"./vendor-BE-_xUHH.js";const je=[{key:"all",label:"全部"},{key:"processing",label:"处理中"},{key:"shipped",label:"已发货"},{key:"pending_ship",label:"待发货"},{key:"completed",label:"已完成"},{key:"cancelled",label:"已取消"},{key:"refunding",label:"退款中"}],ve=s=>{const t=typeof s=="object"&&s!==null?s:{},a=Array.isArray(t.results)?t.results:[];return{total:Number(t.total||0),success_count:Number(t.success_count||0),failed_count:Number(t.failed_count||0),results:a.map(Ne)}},Ne=s=>{const t=typeof s=="object"&&s!==null?s:{};return{order_id:String(t.order_id||"unknown"),success:t.success===!0,message:String(t.message||"")}},we=s=>(s==null?void 0:s.results.filter(_e))||[],_e=s=>!s.success,ke=(s,t)=>s!==null&&!t,Ce=s=>{if(!s)return"请选择订单文件";const t=s.name.toLowerCase().split(".").pop()||"";return["xlsx","csv","tsv","json"].includes(t)?"":"仅支持 .xlsx、.csv、.tsv、.json 格式"},z=(s,t)=>s===t,Se=(s,t)=>s instanceof Error&&s.message?s.message:t,Ee=({filter:s,onFilterChange:t,accountFilter:a,onAccountFilterChange:u,accounts:h,accountName:x,searchText:p,onSearchChange:f})=>{const b=i=>t(i.currentTarget.dataset.status||"all"),y=i=>u(i.target.value),j=i=>f(i.target.value);return e.jsxs("div",{className:"p-4 border-b border-gray-50 flex flex-col md:flex-row gap-4 justify-between items-center bg-surface-muted",children:[e.jsx("div",{className:"flex gap-1 p-1 bg-gray-200/50 rounded-xl overflow-x-auto max-w-full",children:je.map(i=>e.jsx("button",{"data-status":i.key,onClick:b,className:`px-5 py-2 rounded-lg text-sm font-bold transition-all whitespace-nowrap ${s===i.key?"bg-white text-black shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:i.label},i.key))}),e.jsxs("div",{className:"flex w-full md:w-auto flex-col sm:flex-row gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ne,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"}),e.jsxs("select",{"aria-label":"按账号筛选订单",value:a,onChange:y,className:"ios-input pl-10 pr-9 py-2.5 rounded-xl w-full sm:w-56 bg-white border-none shadow-sm",children:[e.jsx("option",{value:"",children:"全部账号"}),h.map(i=>e.jsx("option",{value:i.id,children:x(i.id)},i.id))]})]}),e.jsxs("div",{className:"relative group",children:[e.jsx(ie,{className:"w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 group-focus-within:text-brand transition-colors"}),e.jsx("input",{type:"text",placeholder:"搜索订单号/商品/买家...",value:p,onChange:j,className:"ios-input pl-10 pr-4 py-2.5 rounded-xl w-64 bg-white border-none shadow-sm focus:ring-0"})]})]})]})},Oe=s=>{const t=x=>{var p;s.setImportFile(((p=x.target.files)==null?void 0:p[0])||null)},a=()=>s.closeImportModal(),u=()=>void s.handleImportOrders(),h=()=>void s.handleRetryImport();return s.showImportModal?H.createPortal(e.jsx("div",{className:"modal-overlay-centered",children:e.jsxs("div",{className:"modal-container",children:[e.jsx("div",{className:"modal-header",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsx("h3",{className:"text-2xl font-extrabold text-gray-900",children:"插入订单"}),e.jsx("button",{onClick:a,className:"p-2 bg-gray-100 rounded-full hover:bg-gray-200 transition-colors",children:e.jsx(K,{className:"w-5 h-5 text-gray-600"})})]})}),e.jsxs("div",{className:"modal-body space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"选择Excel文件"}),e.jsx("input",{type:"file",accept:".xlsx,.csv,.tsv,.json",onChange:t,className:"w-full ios-input px-4 py-3 rounded-xl text-sm"}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"支持 .xlsx、.csv、.tsv、.json 格式"})]}),s.importFile&&e.jsx("div",{className:"p-3 bg-blue-50 rounded-xl",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(oe,{className:"w-4 h-4 text-blue-600"}),e.jsx("span",{className:"text-sm font-medium text-blue-900",children:s.importFile.name})]})}),s.importError&&e.jsxs("div",{className:"rounded-xl bg-red-50 border border-red-100 p-3 text-sm text-red-700 flex items-center justify-between gap-3",children:[e.jsx("span",{children:s.importError}),e.jsx("button",{type:"button",onClick:h,disabled:s.importing||!s.importFile,className:"font-bold whitespace-nowrap",children:"重试"})]}),s.importResult&&s.importResult.failed_count>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-xl bg-amber-50 border border-amber-100 p-3 text-sm font-bold text-amber-800",children:["导入完成:成功 "Line truncated
@@ -1 +1 @@
import{j as e,a as d,b as Oe}from"./react-vendor-l-BBvuKH.js";import{k as We,ae as ut,af as St,m as Rt,ag as pt,R as Ge,N as rt,Z as lt,u as At,n as nt,I as Pt,a1 as Tt,X as Ae,V as qe,y as Pe,h as Mt,g as $t,a6 as Et,ah as Lt,o as it,ai as It}from"./icons-vendor-CIGXYOCp.js";import{r as N,c as w}from"./index-2BJ5Kkse.js";import{o as $e,c as Ze}from"./contract-COFcZjyb.js";import"./vendor-cRYyTeIw.js";const Ve=(t,s)=>t.allowed_resolutions.includes(s),Dt=(t,s)=>({runs:t.runs.filter(l=>!s||l.cookie_id===s),pending_tasks:t.pending_tasks.filter(l=>!s||l.cookie_id===s)}),Ft=t=>({external_result_unknown:"外部动作结果未知",invalid_snapshot:"历史数据无法恢复",rule_unavailable:"规则不可用",partial_failure:"部分动作失败",execution_failed:"动作执行失败"})[t]||"自动化异常",zt=({runs:t,pendingTasks:s,onResolveRun:l,onResolveDeferredTask:u})=>e.jsxs("section",{className:"rounded-2xl border border-red-200 bg-red-50 p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(We,{className:"w-5 h-5 text-red-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-black text-red-900",children:"需要人工处理的自动化任务"}),e.jsx("p",{className:"text-sm text-red-700 mt-1",children:"请先在闲鱼聊天、订单或商品列表中核对真实结果,再选择继续或重试。"})]})]}),e.jsxs("div",{className:"space-y-3",children:[t.map(r=>e.jsxs("div",{className:"rounded-xl border border-red-100 bg-white p-4 flex flex-col lg:flex-row lg:items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-bold text-gray-900",children:["账号 ",r.cookie_id," · 订单 ",r.order_id||"-"," · 已记录发送 ",r.sent_count," 条"]}),e.jsx("div",{className:"text-xs font-bold text-red-800 mt-1",children:Ft(r.issue_kind)}),e.jsx("div",{className:"text-xs text-red-700 mt-1 break-words",children:r.error_message})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[Ve(r,"continue")&&e.jsx("button",{onClick:(()=>l(r.id,"continue")),className:"px-3 py-2 rounded-lg bg-emerald-100 text-emerald-800 text-xs font-bold",children:"已执行,继续下一步"}),Ve(r,"retry")&&e.jsx("button",{onClick:(()=>l(r.id,"retry")),className:"px-3 py-2 rounded-lg bg-amber-100 text-amber-800 text-xs font-bold",children:"未执行,安全重试"}),Ve(r,"cancel")&&e.jsx("button",{onClick:(()=>l(r.id,"cancel")),className:"px-3 py-2 rounded-lg bg-gray-100 text-gray-700 text-xs font-bold",children:"终止"})]})]},`run-${r.id}`)),s.map(r=>e.jsxs("div",{className:"rounded-xl border border-red-100 bg-white p-4 flex flex-col lg:flex-row lg:items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-bold text-gray-900",children:["账号 ",r.cookie_id," · 延迟任务重试已达 ",r.attempt_count," 次"]}),e.jsx("div",{className:"text-xs text-red-700 mt-1 break-words",children:r.error_message})]}),e.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.jsx("button",{onClick:(()=>u(r.id,"retry")),className:"px-3 py-2 rounded-lg bg-amber-100 text-amber-800 text-xs font-bold",children:"重新入队"}),e.jsx("button",{onClick:(()=>u(r.id,"dismiss")),className:"px-3 py-2 rounded-lg bg-gray-100 text-gray-700 text-xs font-bold",children:"忽略"})]})]},`task-${r.id}`))]})]}),Ot=async t=>N(s=>w.GET("/api/v1/accounts/details",{signal:s}),t),gt=async t=>N(s=>w.GET("/api/v1/cards",{signal:s}),t),bt=async(t,s)=>N(l=>w.GET("/api/v1/items",{params:{query:{cookie_id:t}},signal:l}),s),ht=t=>t.map(s=>{var l,u;return{id:String(s.id),name:s.name||"",trigger_type:s.trigger_type||"order_paid",item_keyword:s.item_title||s.item_id||"",cookie_id:s.cookie_id||"",item_id:s.item_id||"",item_title:s.item_title||"",card_group_id:Number(((l=(s.actions||[]).find(r=>r.action_type==="send_card"))==null?void 0:l.card_id)||0),card_group_name:((u=(s.actions||[]).find(r=>r.action_type==="send_card"))==null?void 0:u.card_name)||"",priority:s.priority||100,enabled:s.enabled||!1,config_json:s.config_json||"{}",actions:(s.actions||[]).map(r=>({id:r.id?String(r.id):void 0,action_type:r.action_type,card_id:Number(r.card_id||0),card_name:r.card_name||"",delivery_count:Number(r.delivery_count||1),message_template:r.message_template||"",delay_seconds:Number(r.delay_seconds||0),config_json:r.config_json||"{}",enabled:r.enabled!==!1,sort_order:Number(r.sort_order||0)})),variants:(s.actions||[]).filter(r=>r.action_type==="send_card").map(r=>{let h={};try{h=JSON.parse(r.config_json||"{}")}catch{}return{id:r.id?String(r.id):void 0,spec_name:h.spec_name||"",spec_value:h.spec_value||"",card_id:Number(r.card_id||0),card_name:r.card_name||"",delivery_count:Number(r.delivery_count||1),enabled:r.enabled!==!1,delay_override:h.delay_override===!0,delay_seconds:Number(r.delay_seconds||0),config_json:r.config_json||"{}"}})}}),Gt=async()=>{const t=await N(l=>w.GET("/api/v1/automation-rules",{signal:l})),s=Ze(Line truncated
import{j as e,a as d,b as Oe}from"./react-vendor-Bf9ELcll.js";import{k as We,ae as ut,af as St,m as Rt,ag as pt,R as Ge,N as rt,Z as lt,u as At,n as nt,I as Pt,a1 as Tt,X as Ae,V as qe,y as Pe,h as Mt,g as $t,a6 as Et,ah as Lt,o as it,ai as It}from"./icons-vendor-B5fJPoU1.js";import{r as N,c as w}from"./index-BcKVxEYs.js";import{o as $e,c as Ze}from"./contract-COFcZjyb.js";import"./vendor-BE-_xUHH.js";const Ve=(t,s)=>t.allowed_resolutions.includes(s),Dt=(t,s)=>({runs:t.runs.filter(l=>!s||l.cookie_id===s),pending_tasks:t.pending_tasks.filter(l=>!s||l.cookie_id===s)}),Ft=t=>({external_result_unknown:"外部动作结果未知",invalid_snapshot:"历史数据无法恢复",rule_unavailable:"规则不可用",partial_failure:"部分动作失败",execution_failed:"动作执行失败"})[t]||"自动化异常",zt=({runs:t,pendingTasks:s,onResolveRun:l,onResolveDeferredTask:u})=>e.jsxs("section",{className:"rounded-2xl border border-red-200 bg-red-50 p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(We,{className:"w-5 h-5 text-red-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-black text-red-900",children:"需要人工处理的自动化任务"}),e.jsx("p",{className:"text-sm text-red-700 mt-1",children:"请先在闲鱼聊天、订单或商品列表中核对真实结果,再选择继续或重试。"})]})]}),e.jsxs("div",{className:"space-y-3",children:[t.map(r=>e.jsxs("div",{className:"rounded-xl border border-red-100 bg-white p-4 flex flex-col lg:flex-row lg:items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-bold text-gray-900",children:["账号 ",r.cookie_id," · 订单 ",r.order_id||"-"," · 已记录发送 ",r.sent_count," 条"]}),e.jsx("div",{className:"text-xs font-bold text-red-800 mt-1",children:Ft(r.issue_kind)}),e.jsx("div",{className:"text-xs text-red-700 mt-1 break-words",children:r.error_message})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[Ve(r,"continue")&&e.jsx("button",{onClick:(()=>l(r.id,"continue")),className:"px-3 py-2 rounded-lg bg-emerald-100 text-emerald-800 text-xs font-bold",children:"已执行,继续下一步"}),Ve(r,"retry")&&e.jsx("button",{onClick:(()=>l(r.id,"retry")),className:"px-3 py-2 rounded-lg bg-amber-100 text-amber-800 text-xs font-bold",children:"未执行,安全重试"}),Ve(r,"cancel")&&e.jsx("button",{onClick:(()=>l(r.id,"cancel")),className:"px-3 py-2 rounded-lg bg-gray-100 text-gray-700 text-xs font-bold",children:"终止"})]})]},`run-${r.id}`)),s.map(r=>e.jsxs("div",{className:"rounded-xl border border-red-100 bg-white p-4 flex flex-col lg:flex-row lg:items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"font-bold text-gray-900",children:["账号 ",r.cookie_id," · 延迟任务重试已达 ",r.attempt_count," 次"]}),e.jsx("div",{className:"text-xs text-red-700 mt-1 break-words",children:r.error_message})]}),e.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.jsx("button",{onClick:(()=>u(r.id,"retry")),className:"px-3 py-2 rounded-lg bg-amber-100 text-amber-800 text-xs font-bold",children:"重新入队"}),e.jsx("button",{onClick:(()=>u(r.id,"dismiss")),className:"px-3 py-2 rounded-lg bg-gray-100 text-gray-700 text-xs font-bold",children:"忽略"})]})]},`task-${r.id}`))]})]}),Ot=async t=>N(s=>w.GET("/api/v1/accounts/details",{signal:s}),t),gt=async t=>N(s=>w.GET("/api/v1/cards",{signal:s}),t),bt=async(t,s)=>N(l=>w.GET("/api/v1/items",{params:{query:{cookie_id:t}},signal:l}),s),ht=t=>t.map(s=>{var l,u;return{id:String(s.id),name:s.name||"",trigger_type:s.trigger_type||"order_paid",item_keyword:s.item_title||s.item_id||"",cookie_id:s.cookie_id||"",item_id:s.item_id||"",item_title:s.item_title||"",card_group_id:Number(((l=(s.actions||[]).find(r=>r.action_type==="send_card"))==null?void 0:l.card_id)||0),card_group_name:((u=(s.actions||[]).find(r=>r.action_type==="send_card"))==null?void 0:u.card_name)||"",priority:s.priority||100,enabled:s.enabled||!1,config_json:s.config_json||"{}",actions:(s.actions||[]).map(r=>({id:r.id?String(r.id):void 0,action_type:r.action_type,card_id:Number(r.card_id||0),card_name:r.card_name||"",delivery_count:Number(r.delivery_count||1),message_template:r.message_template||"",delay_seconds:Number(r.delay_seconds||0),config_json:r.config_json||"{}",enabled:r.enabled!==!1,sort_order:Number(r.sort_order||0)})),variants:(s.actions||[]).filter(r=>r.action_type==="send_card").map(r=>{let h={};try{h=JSON.parse(r.config_json||"{}")}catch{}return{id:r.id?String(r.id):void 0,spec_name:h.spec_name||"",spec_value:h.spec_value||"",card_id:Number(r.card_id||0),card_name:r.card_name||"",delivery_count:Number(r.delivery_count||1),enabled:r.enabled!==!1,delay_override:h.delay_override===!0,delay_seconds:Number(r.delay_seconds||0),config_json:r.config_json||"{}"}})}}),Gt=async()=>{const t=await N(l=>w.GET("/api/v1/automation-rules",{signal:l})),s=Ze(Line truncated
@@ -1 +1 @@
import{a as r,j as e}from"./react-vendor-l-BBvuKH.js";import{r as M,c as q}from"./index-2BJ5Kkse.js";import{f as xe,R as ae,aa as ue,r as pe,z as T,F as D,ab as me,t as he,S as re,ac as le,ad as ge,o as ye}from"./icons-vendor-CIGXYOCp.js";import"./vendor-cRYyTeIw.js";const ne="https://dashscope.aliyuncs.com/compatible-mode/v1",fe=[{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}],be=new Set(["ai_api_key_configured","smtp_password_configured","qq_reply_secret_key_configured","captcha.remote_secret_key_configured","smtp_server","smtp_port","smtp_user","smtp_password","smtp_from","smtp_from_name","smtp_from_address","registration_enabled","show_default_login_info","login_captcha_enabled","item_sync_enabled","item_sync_interval","item_sync_max_pages","default_reply"]),oe=new Set(["ai_api_key","smtp_password","qq_reply_secret_key","captcha.remote_secret_key"]),we=s=>{if("values"in s||"secrets"in s)return s;const a={},n={};for(const[d,x]of Object.entries(s))if(x!=null){if(oe.has(d)){n[d]=x===""?{action:"clear"}:{action:"replace",value:String(x)};continue}(typeof x=="string"||typeof x=="number"||typeof x=="boolean")&&(a[d]=x)}return Object.keys(n).length>0?{values:a,secrets:n}:a},je=s=>{const a={...s};for(const n of oe){const d=`${n}_configured`;d in a&&(a[d]=a[d]===!0||a[d]==="true")}if("renewal_log_retention_days"in a){const n=Number(a.renewal_log_retention_days);a.renewal_log_retention_days=Number.isFinite(n)?n:10}return a},ve=async(s,a)=>M(n=>q.PUT("/api/v1/session/credentials",{body:s,signal:n}),a),_e=async s=>{const a=await M(n=>q.GET("/api/v1/settings/system",{signal:n}),s);return je(a)},Ne=async(s,a)=>M(n=>q.PUT("/api/v1/settings/system",{body:we(s),signal:n}),a),Se=async(s,a="",n)=>{const d=await M(x=>q.POST("/api/v1/settings/ai-models",{body:{base_url:s,api_key:a},signal:x}),n);return Array.isArray(d.models)?d.models:[]},ke=async s=>M(a=>q.GET("/api/v1/session",{signal:a}),s),Ce=s=>Object.fromEntries(Object.entries(s).filter(([a,n])=>!be.has(a)&&n!==void 0&&n!==null)),Ee=s=>s.new_username.trim().length<3?"用户名至少需要 3 个字符":s.current_password?s.new_password&&s.new_password.length<8?"新密码至少需要 8 个字符":s.new_password!==s.confirm_password?"两次输入的新密码不一致":"":"请输入当前密码确认身份",f=(s,a,n)=>s===a&&!n.aborted,K=s=>s instanceof Error&&s.message==="请求已取消",U=(s,a)=>s instanceof Error?s.message:a,Ae=(s="")=>({new_username:s,current_password:"",new_password:"",confirm_password:""}),$=(s,a)=>({type:s,text:a}),Ie=()=>{const[s,a]=r.useState(null),[n,d]=r.useState(!1),[x,m]=r.useState(""),[S,A]=r.useState(!1),[R,k]=r.useState(""),[C,w]=r.useState([]),[j,I]=r.useState(!1),[P,u]=r.useState(""),[z,v]=r.useState(!1),[G,L]=r.useState(!1),[F,p]=r.useState(!1),[b,V]=r.useState(!1),[Y,J]=r.useState(!1),[W,_]=r.useState(!1),[O,y]=r.useState(null),[t,ee]=r.useState(()=>Ae()),[ce,B]=r.useState("idle"),se=r.useRef(null),te=r.useRef(null),h=r.useRef(0),H=r.useRef(null);te.current=s;const E=r.useCallback(()=>{var c;(c=H.current)==null||c.abort();const o=new AbortController;return H.current=o,h.current+=1,{controller:o,sequence:h.current}},[]),Q=r.useCallback(async(o,c=!1,l)=>{const i=o||te.current,g=(i==null?void 0:i.ai_api_url)||(i==null?void 0:i.ai_base_url)||ne;I(!0),u("");try{const N=await Se(g,(i==null?void 0:i.ai_api_key)||"",{signal:l});if(l!=null&&l.aborted)return;w(N),v(c&&N.length>0),!(i!=null&&i.ai_model)&&N.length>0&&a(Z=>Z&&{...Z,ai_model:N[0]})}catch(N){if(l!=null&&l.aborted||K(N))return;w([]),v(!1),u(U(N,"读取模型失败"))}finally{l!=null&&l.aborted||I(!1)}},[]),X=r.useCallback(()=>{const{controller:o,sequence:c}=E();d(!0),B("loading"),m(""),Promise.all([_e({signal:o.signal}),ke({signal:o.signal})]).then(([l,i])=>{f(h.current,c,o.signal)&&(a(l),i.username&&ee(g=>({...g,new_username:i.username||""})),Q(l,!1,o.signal),B("success"))}).catch(l=>{!f(h.current,c,o.signal)||K(l)||(a(null),m(U(l,"加载配置失败")),B("error"))}).finally(()=>{f(h.current,c,o.signal)&&d(!1)})},[E,Q]);r.useEffect(()=>(X(),(()=>{var o;return(o=H.current)==null?void 0:o.abort()})),[X]),r.useEffect(()=>{const o=c=>{var l;(l=se.current)!=null&&l.contains(c.target)||v(!1)};return document.addEventListener("mousedown",o),(()=>document.removeEventListener("mousedown",o))},[]);const ie=r.useCallback(async()=>{if(!s||S)return;const{controller:o,sequence:c}=E();A(!0),k("");try{if(await Ne(Ce(s),{signal:o.signal}),!f(h.current,c,o.signal))return;window.alert("系统配置已保存")}catch(l){if(!f(h.current,c,o.signal)||K(l))return;k(U(l,"保存配置失败"))}finally{f(h.current,c,o.signal)&&A(!1)}},[E,S,s]),de=r.useCallback(async o=>{o.preventDefault(),y(null);const c=Ee(t);if(c){y($("error",c));return}const{controller:l,sequence:i}=E();_(!0);try{const g=await ve({current_password:t.current_password,new_username:t.new_username.trim(),new_password:t.new_password||void 0},{signal:l.signal});if(!f(h.currentLine truncated
import{a as r,j as e}from"./react-vendor-Bf9ELcll.js";import{r as M,c as q}from"./index-BcKVxEYs.js";import{f as xe,R as ae,aa as ue,r as pe,z as T,F as D,ab as me,t as he,S as re,ac as le,ad as ge,o as ye}from"./icons-vendor-B5fJPoU1.js";import"./vendor-BE-_xUHH.js";const ne="https://dashscope.aliyuncs.com/compatible-mode/v1",fe=[{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}],be=new Set(["ai_api_key_configured","smtp_password_configured","qq_reply_secret_key_configured","captcha.remote_secret_key_configured","smtp_server","smtp_port","smtp_user","smtp_password","smtp_from","smtp_from_name","smtp_from_address","registration_enabled","show_default_login_info","login_captcha_enabled","item_sync_enabled","item_sync_interval","item_sync_max_pages","default_reply"]),oe=new Set(["ai_api_key","smtp_password","qq_reply_secret_key","captcha.remote_secret_key"]),we=s=>{if("values"in s||"secrets"in s)return s;const a={},n={};for(const[d,x]of Object.entries(s))if(x!=null){if(oe.has(d)){n[d]=x===""?{action:"clear"}:{action:"replace",value:String(x)};continue}(typeof x=="string"||typeof x=="number"||typeof x=="boolean")&&(a[d]=x)}return Object.keys(n).length>0?{values:a,secrets:n}:a},je=s=>{const a={...s};for(const n of oe){const d=`${n}_configured`;d in a&&(a[d]=a[d]===!0||a[d]==="true")}if("renewal_log_retention_days"in a){const n=Number(a.renewal_log_retention_days);a.renewal_log_retention_days=Number.isFinite(n)?n:10}return a},ve=async(s,a)=>M(n=>q.PUT("/api/v1/session/credentials",{body:s,signal:n}),a),_e=async s=>{const a=await M(n=>q.GET("/api/v1/settings/system",{signal:n}),s);return je(a)},Ne=async(s,a)=>M(n=>q.PUT("/api/v1/settings/system",{body:we(s),signal:n}),a),Se=async(s,a="",n)=>{const d=await M(x=>q.POST("/api/v1/settings/ai-models",{body:{base_url:s,api_key:a},signal:x}),n);return Array.isArray(d.models)?d.models:[]},ke=async s=>M(a=>q.GET("/api/v1/session",{signal:a}),s),Ce=s=>Object.fromEntries(Object.entries(s).filter(([a,n])=>!be.has(a)&&n!==void 0&&n!==null)),Ee=s=>s.new_username.trim().length<3?"用户名至少需要 3 个字符":s.current_password?s.new_password&&s.new_password.length<8?"新密码至少需要 8 个字符":s.new_password!==s.confirm_password?"两次输入的新密码不一致":"":"请输入当前密码确认身份",f=(s,a,n)=>s===a&&!n.aborted,K=s=>s instanceof Error&&s.message==="请求已取消",U=(s,a)=>s instanceof Error?s.message:a,Ae=(s="")=>({new_username:s,current_password:"",new_password:"",confirm_password:""}),$=(s,a)=>({type:s,text:a}),Ie=()=>{const[s,a]=r.useState(null),[n,d]=r.useState(!1),[x,m]=r.useState(""),[S,A]=r.useState(!1),[R,k]=r.useState(""),[C,w]=r.useState([]),[j,I]=r.useState(!1),[P,u]=r.useState(""),[z,v]=r.useState(!1),[G,L]=r.useState(!1),[F,p]=r.useState(!1),[b,V]=r.useState(!1),[Y,J]=r.useState(!1),[W,_]=r.useState(!1),[O,y]=r.useState(null),[t,ee]=r.useState(()=>Ae()),[ce,B]=r.useState("idle"),se=r.useRef(null),te=r.useRef(null),h=r.useRef(0),H=r.useRef(null);te.current=s;const E=r.useCallback(()=>{var c;(c=H.current)==null||c.abort();const o=new AbortController;return H.current=o,h.current+=1,{controller:o,sequence:h.current}},[]),Q=r.useCallback(async(o,c=!1,l)=>{const i=o||te.current,g=(i==null?void 0:i.ai_api_url)||(i==null?void 0:i.ai_base_url)||ne;I(!0),u("");try{const N=await Se(g,(i==null?void 0:i.ai_api_key)||"",{signal:l});if(l!=null&&l.aborted)return;w(N),v(c&&N.length>0),!(i!=null&&i.ai_model)&&N.length>0&&a(Z=>Z&&{...Z,ai_model:N[0]})}catch(N){if(l!=null&&l.aborted||K(N))return;w([]),v(!1),u(U(N,"读取模型失败"))}finally{l!=null&&l.aborted||I(!1)}},[]),X=r.useCallback(()=>{const{controller:o,sequence:c}=E();d(!0),B("loading"),m(""),Promise.all([_e({signal:o.signal}),ke({signal:o.signal})]).then(([l,i])=>{f(h.current,c,o.signal)&&(a(l),i.username&&ee(g=>({...g,new_username:i.username||""})),Q(l,!1,o.signal),B("success"))}).catch(l=>{!f(h.current,c,o.signal)||K(l)||(a(null),m(U(l,"加载配置失败")),B("error"))}).finally(()=>{f(h.current,c,o.signal)&&d(!1)})},[E,Q]);r.useEffect(()=>(X(),(()=>{var o;return(o=H.current)==null?void 0:o.abort()})),[X]),r.useEffect(()=>{const o=c=>{var l;(l=se.current)!=null&&l.contains(c.target)||v(!1)};return document.addEventListener("mousedown",o),(()=>document.removeEventListener("mousedown",o))},[]);const ie=r.useCallback(async()=>{if(!s||S)return;const{controller:o,sequence:c}=E();A(!0),k("");try{if(await Ne(Ce(s),{signal:o.signal}),!f(h.current,c,o.signal))return;window.alert("系统配置已保存")}catch(l){if(!f(h.current,c,o.signal)||K(l))return;k(U(l,"保存配置失败"))}finally{f(h.current,c,o.signal)&&A(!1)}},[E,S,s]),de=r.useCallback(async o=>{o.preventDefault(),y(null);const c=Ee(t);if(c){y($("error",c));return}const{controller:l,sequence:i}=E();_(!0);try{const g=await ve({current_password:t.current_password,new_username:t.new_username.trim(),new_password:t.new_password||void 0},{signal:l.signal});if(!f(h.currentLine truncated
@@ -0,0 +1,5 @@
import{c as ke,g as Gr}from"./react-vendor-Bf9ELcll.js";var m5={exports:{}},Yr=m5.exports,ye;function Xr(){return ye||(ye=1,(function(Ae,qr){(function(E5,Z2){Ae.exports=Z2()})(Yr,(function(){function E5(q1,h1){if(!(q1 instanceof h1))throw new TypeError("Cannot call a class as a function")}function Z2(q1,h1){for(var l1=0;l1<h1.length;l1++){var t1=h1[l1];t1.enumerable=t1.enumerable||!1,t1.configurable=!0,"value"in t1&&(t1.writable=!0),Object.defineProperty(q1,t1.key,t1)}}function n6(q1,h1,l1){return h1&&Z2(q1.prototype,h1),l1&&Z2(q1,l1),q1}var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof ke<"u"?ke:typeof self<"u"?self:{},t6={exports:{}};(function(q1,h1){(function(l1,t1){q1.exports=t1()})(Re,(function(){var l1=function(){var M1=0,T1=[],I1=[],P0;self.onmessage=function(F1){switch(F1.data.command){case"init":n0(F1.data.config);break;case"record":r2(F1.data.buffer);break;case"exportWAV":m1(F1.data.type);break;case"getBuffer":w0();break;case"clear":Z1();break}};function n0(F1){P0=F1.sampleRate}function r2(F1){T1.push(F1[0]),I1.push(F1[1]),M1+=F1[0].length}function m1(F1){var h0=v0(T1,M1),B1=v0(I1,M1),x1=x0(h0,B1),m0=D2(x1),H0=new Blob([m0],{type:F1});self.postMessage({type:"blob",data:H0})}function w0(){var F1=[];F1.push(v0(T1,M1)),F1.push(v0(I1,M1)),self.postMessage({type:"buffer",data:F1})}function Z1(){M1=0,T1=[],I1=[]}function v0(F1,h0){for(var B1=new Float32Array(h0),x1=0,m0=0;m0<F1.length;m0++)B1.set(F1[m0],x1),x1+=F1[m0].length;return B1}function x0(F1,h0){for(var B1=F1.length+h0.length,x1=new Float32Array(B1),m0=0,H0=0;m0<B1;)x1[m0++]=F1[H0],x1[m0++]=h0[H0],H0++;return x1}function U1(F1,h0,B1){for(var x1=0;x1<B1.length;x1++,h0+=2){var m0=Math.max(-1,Math.min(1,B1[x1]));F1.setInt16(h0,m0<0?m0*32768:m0*32767,!0)}}function i2(F1,h0,B1){for(var x1=0;x1<B1.length;x1++)F1.setUint8(h0+x1,B1.charCodeAt(x1))}function D2(F1){var h0=new ArrayBuffer(44+F1.length*2),B1=new DataView(h0);return i2(B1,0,"RIFF"),B1.setUint32(4,36+F1.length*2,!0),i2(B1,8,"WAVE"),i2(B1,12,"fmt "),B1.setUint32(16,16,!0),B1.setUint16(20,1,!0),B1.setUint16(22,2,!0),B1.setUint32(24,P0,!0),B1.setUint32(28,P0*4,!0),B1.setUint16(32,4,!0),B1.setUint16(34,16,!0),i2(B1,36,"data"),B1.setUint32(40,F1.length*2,!0),U1(B1,44,F1),B1}},t1=l1.toString().replace(/^\s*function.*?\(\)\s*{/,"").replace(/}\s*$/,""),N=function(M1,T1){var I1=T1||{},P0=I1.bufferLen||4096;this.context=M1.context,this.node=(this.context.createScriptProcessor||this.context.createJavaScriptNode).call(this.context,P0,2,2);var n0=new Worker((window.URL||window.webkitURL).createObjectURL(new Blob([t1],{type:"text/javascript"})));n0.onmessage=function(Z1){Z1.data.type==="blob"?w0(Z1.data.data):m1(Z1.data.data)},n0.postMessage({command:"init",config:{sampleRate:this.context.sampleRate}});var r2=!1,m1,w0;this.node.onaudioprocess=function(Z1){r2&&n0.postMessage({command:"record",buffer:[Z1.inputBuffer.getChannelData(0),Z1.inputBuffer.getChannelData(1)]})},this.configure=function(Z1){for(var v0 in Z1)Z1.hasOwnProperty(v0)&&(I1[v0]=Z1[v0])},this.record=function(){r2=!0},this.stop=function(){r2=!1},this.clear=function(){n0.postMessage({command:"clear"})},this.getBuffer=function(Z1){m1=Z1||I1.callback,n0.postMessage({command:"getBuffer"})},this.exportWAV=function(Z1,v0){if(w0=Z1||I1.callback,v0=v0||I1.type||"audio/wav",!w0)throw new Error("Callback not set");n0.postMessage({command:"exportWAV",type:v0})},this.release=function(){this.stop(),this.clear(),this.configure=this.record=this.stop=this.clear=this.getBuffer=this.exportWAV=function(){},M1.disconnect(this.node),this.node.onaudioprocess=null,this.node.disconnect(),n0.terminate()},M1.connect(this.node),this.node.connect(this.context.destination)};N.forceDownload=function(M1,T1){var I1=(window.URL||window.webkitURL).createObjectURL(M1),P0=window.document.createElement("a");P0.href=I1,P0.download=T1||"output.wav";var n0=document.createEvent("Event");n0.initEvent("click",!0,!0),P0.dispatchEvent(n0)};var R1=N;return R1}))})(t6);var Se=t6.exports,o6=window.AudioContext||window.webkitAudioContext||window.mozAudioContext,_0=null,s6=!0;o6||(s6=!1,console.warn("Web Audio API is Unsupported."));var M0=(function(){function q1(){E5(this,q1),this._recorderStream=null,this._recorderStreamSourceNode=null,this._recorder=null,this._isRecording=!1,this._curSourceNode=null}return n6(q1,[{key:"playPcm",value:function(l1,t1,N,R1){(!_0||_0.state==="closed")&&(_0=new o6),(_0.state==="interrupted"||_0.state==="suspended")&&_0.resume(),t1=t1||8e3,this.stopPcm();var M1=R1&&R1>.001?l1.slice(t1*R1):l1;if(!M1.length)return N();var T1,I1;this._curSourceNode=_0.createBufferSource();try{T1=_0.createBuffer(1,M1.length,t1)}catch{t1<11025?(T1=_0.createBuffer(1,M1.length,t1*4),this._curSourceNode.playbackRate.value=.25):(T1=_0.createBuffer(1,M1.length,t1*2),this._curSourceNode.playbackRate.value=.5)}T1.copyToChannel?T1.copyToChannel(M1,0,0):(I1=T1.getChannelData(0),I1.set(M1)),this._curSourceNode.buffer=T1,this._curSourceNode.loop=!1,this._curSourceNode.conLine truncated
`,WAV_HEADER_SIZE:44},N={canvas:{},print:(function(E){console.log(E)}),_main:(function(){return t1.Decoder_Interface_init=N._Decoder_Interface_init,t1.Decoder_Interface_exit=N._Decoder_Interface_exit,t1.Decoder_Interface_Decode=N._Decoder_Interface_Decode,t1.Encoder_Interface_init=N._Encoder_Interface_init,t1.Encoder_Interface_exit=N._Encoder_Interface_exit,t1.Encoder_Interface_Encode=N._Encoder_Interface_Encode,0})},N;N||(N=(typeof N<"u"?N:null)||{});var R1={};for(var M1 in N)N.hasOwnProperty(M1)&&(R1[M1]=N[M1]);var T1=typeof window=="object",I1=typeof importScripts=="function",P0=!T1&&!0&&!I1;if(P0)N.print||(N.print=print),typeof printErr<"u"&&(N.printErr=printErr),typeof read<"u"?N.read=read:N.read=function(){throw"no read() available (jsc?)"},N.readBinary=function(b){if(typeof readbuffer=="function")return new Uint8Array(readbuffer(b));var k=read(b,"binary");return U1(typeof k=="object"),k},typeof scriptArgs<"u"?N.arguments=scriptArgs:typeof arguments<"u"&&(N.arguments=arguments);else if(T1||I1){if(N.read=function(b){var k=new XMLHttpRequest;return k.open("GET",b,!1),k.send(null),k.responseText},typeof arguments<"u"&&(N.arguments=arguments),typeof console<"u")N.print||(N.print=function(b){console.log(b)}),N.printErr||(N.printErr=function(b){console.log(b)});else{var n0=!1;N.print||(N.print=n0&&typeof dump<"u"?(function(E){dump(E)}):(function(E){}))}I1&&(N.load=importScripts),typeof N.setWindowTitle>"u"&&(N.setWindowTitle=(function(E){document.title=E}))}else throw"Unknown runtime environment. Where are we?";function r2(E){eval.call(null,E)}!N.load&&N.read&&(N.load=function(b){r2(N.read(b))}),N.print||(N.print=(function(){})),N.printErr||(N.printErr=N.print),N.arguments||(N.arguments=[]),N.thisProgram||(N.thisProgram="./this.program"),N.print=N.print,N.printErr=N.printErr,N.preRun=[],N.postRun=[];for(var M1 in R1)R1.hasOwnProperty(M1)&&(N[M1]=R1[M1]);var m1={setTempRet0:(function(E){x0=E}),getTempRet0:(function(){return x0}),stackSave:(function(){return Z0}),stackRestore:(function(E){Z0=E}),getNativeTypeSize:(function(E){switch(E){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(E[E.length-1]==="*")return m1.QUANTUM_SIZE;if(E[0]==="i"){var b=parseInt(E.substr(1));return U1(b%8===0),b/8}else return 0}}}),getNativeFieldSize:(function(E){return Math.max(m1.getNativeTypeSize(E),m1.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(E,b){return b==="double"||b==="i64"?E&7&&(U1((E&7)===4),E+=4):U1((E&3)===0),E}),getAlignSize:(function(E,b,k){return!k&&(E=="i64"||E=="double")?8:E?Math.min(b||(E?m1.getNativeFieldSize(E):0),m1.QUANTUM_SIZE):Math.min(b,8)}),dynCall:(function(E,b,k){return k&&k.length?(k.splice||(k=Array.prototype.slice.call(k)),k.splice(0,0,b),N["dynCall_"+E].apply(null,k)):N["dynCall_"+E].call(null,b)}),functionPointers:[],addFunction:(function(E){for(var b=0;b<m1.functionPointers.length;b++)if(!m1.functionPointers[b])return m1.functionPointers[b]=E,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}),removeFunction:(function(E){m1.functionPointers[(E-2)/2]=null}),warnOnce:(function(E){m1.warnOnce.shown||(m1.warnOnce.shown={}),m1.warnOnce.shown[E]||(m1.warnOnce.shown[E]=1,N.printErr(E))}),funcWrappers:{},getFuncWrapper:(function(E,b){U1(b),m1.funcWrappers[b]||(m1.funcWrappers[b]={});var k=m1.funcWrappers[b];return k[E]||(k[E]=function(){return m1.dynCall(b,E,arguments)}),k[E]}),getCompilerSetting:(function(E){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"}),stackAlloc:(function(E){var b=Z0;return Z0=Z0+E|0,Z0=Z0+15&-16,b}),staticAlloc:(function(E){var b=m2;return m2=m2+E|0,m2=m2+15&-16,b}),dynamicAlloc:(function(E){var b=K0;if(K0=K0+E|0,K0=K0+15&-16,K0>=E2){var k=qe();if(!k)return K0=b,0}return b}),alignMemory:(function(E,b){var k=E=Math.ceil(E/(b||16))*(b||16);return k}),makeBigInt:(function(E,b,k){var A=k?+(E>>>0)+ +(b>>>0)*4294967296:+(E>>>0)+ +(b|0)*4294967296;return A}),GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};N.Runtime=m1;var w0=!1,Z1,v0,x0;function U1(E,b){E||b2("Assertion failed: "+b)}function i2(E){var b=N["_"+E];if(!b)try{b=[eval][0]("_"+E)}catch{}return U1(b,"Cannot call unknown function "+E+" (perhaps LLVM optimizations or closure removed it?)"),b}var D2,F1;(function(){var E={stackSave:(function(){m1.stackSave()}),stackRestore:(function(){m1.stackRestore()}),arrayToC:(function(z){var R=m1.stackAlloc(z.length);return p6(z,R),R}),stringToC:(function(z){var R=0;return z!=null&&z!==0&&(R=m1.stackAlloc((z.length<<2)+1),R5(z,R)),R})},b={string:E.stringToC,array:E.arrayToC};F1=function(R,J,Q,i1,T){var r1=i2(R),o1=[],f1=0;if(i1)for(var y1=0;y1<i1.length;y1++){var L1=b[Q[y1]];L1?(f1===0&&(f1=m1.stackSave()),o1[y1]=L1(i1[y1])):o1[y1]=i1[y1]}var i0=r1.apply(null,o1);if(J==="string"&&(i0=U2(i0)),f1!==0){if(T&&T.async){EmterpreterAsync.asyncFinalizers.push((function( Line truncated
`)):typeof readline=="function"&&(b=readline(),b!==null&&(b+=`
`)),!b)return null;E.input=p2(b,!0)}return E.input.shift()}),put_char:(function(E,b){b===null||b===10?(N.print(v2(E.output,0)),E.output=[]):b!=0&&E.output.push(b)}),flush:(function(E){E.output&&E.output.length>0&&(N.print(v2(E.output,0)),E.output=[])})},default_tty1_ops:{put_char:(function(E,b){b===null||b===10?(N.printErr(v2(E.output,0)),E.output=[]):b!=0&&E.output.push(b)}),flush:(function(E){E.output&&E.output.length>0&&(N.printErr(v2(E.output,0)),E.output=[])})}},A1={ops_table:null,mount:(function(E){return A1.createNode(null,"/",16895,0)}),createNode:(function(E,b,k,A){if(C.isBlkdev(k)||C.isFIFO(k))throw new C.ErrnoError(g.EPERM);A1.ops_table||(A1.ops_table={dir:{node:{getattr:A1.node_ops.getattr,setattr:A1.node_ops.setattr,lookup:A1.node_ops.lookup,mknod:A1.node_ops.mknod,rename:A1.node_ops.rename,unlink:A1.node_ops.unlink,rmdir:A1.node_ops.rmdir,readdir:A1.node_ops.readdir,symlink:A1.node_ops.symlink},stream:{llseek:A1.stream_ops.llseek}},file:{node:{getattr:A1.node_ops.getattr,setattr:A1.node_ops.setattr},stream:{llseek:A1.stream_ops.llseek,read:A1.stream_ops.read,write:A1.stream_ops.write,allocate:A1.stream_ops.allocate,mmap:A1.stream_ops.mmap,msync:A1.stream_ops.msync}},link:{node:{getattr:A1.node_ops.getattr,setattr:A1.node_ops.setattr,readlink:A1.node_ops.readlink},stream:{}},chrdev:{node:{getattr:A1.node_ops.getattr,setattr:A1.node_ops.setattr},stream:C.chrdev_stream_ops}});var e=C.createNode(E,b,k,A);return C.isDir(e.mode)?(e.node_ops=A1.ops_table.dir.node,e.stream_ops=A1.ops_table.dir.stream,e.contents={}):C.isFile(e.mode)?(e.node_ops=A1.ops_table.file.node,e.stream_ops=A1.ops_table.file.stream,e.usedBytes=0,e.contents=null):C.isLink(e.mode)?(e.node_ops=A1.ops_table.link.node,e.stream_ops=A1.ops_table.link.stream):C.isChrdev(e.mode)&&(e.node_ops=A1.ops_table.chrdev.node,e.stream_ops=A1.ops_table.chrdev.stream),e.timestamp=Date.now(),E&&(E.contents[b]=e),e}),getFileDataAsRegularArray:(function(E){if(E.contents&&E.contents.subarray){for(var b=[],k=0;k<E.usedBytes;++k)b.push(E.contents[k]);return b}return E.contents}),getFileDataAsTypedArray:(function(E){return E.contents?E.contents.subarray?E.contents.subarray(0,E.usedBytes):new Uint8Array(E.contents):new Uint8Array}),expandFileStorage:(function(E,b){if(E.contents&&E.contents.subarray&&b>E.contents.length&&(E.contents=A1.getFileDataAsRegularArray(E),E.usedBytes=E.contents.length),!E.contents||E.contents.subarray){var k=E.contents?E.contents.buffer.byteLength:0;if(k>=b)return;var A=1024*1024;b=Math.max(b,k*(k<A?2:1.125)|0),k!=0&&(b=Math.max(b,256));var e=E.contents;E.contents=new Uint8Array(b),E.usedBytes>0&&E.contents.set(e.subarray(0,E.usedBytes),0);return}for(!E.contents&&b>0&&(E.contents=[]);E.contents.length<b;)E.contents.push(0)}),resizeFileStorage:(function(E,b){if(E.usedBytes!=b){if(b==0){E.contents=null,E.usedBytes=0;return}if(!E.contents||E.contents.subarray){var k=E.contents;E.contents=new Uint8Array(new ArrayBuffer(b)),k&&E.contents.set(k.subarray(0,Math.min(b,E.usedBytes))),E.usedBytes=b;return}if(E.contents||(E.contents=[]),E.contents.length>b)E.contents.length=b;else for(;E.contents.length<b;)E.contents.push(0);E.usedBytes=b}}),node_ops:{getattr:(function(E){var b={};return b.dev=C.isChrdev(E.mode)?E.id:1,b.ino=E.id,b.mode=E.mode,b.nlink=1,b.uid=0,b.gid=0,b.rdev=E.rdev,C.isDir(E.mode)?b.size=4096:C.isFile(E.mode)?b.size=E.usedBytes:C.isLink(E.mode)?b.size=E.link.length:b.size=0,b.atime=new Date(E.timestamp),b.mtime=new Date(E.timestamp),b.ctime=new Date(E.timestamp),b.blksize=4096,b.blocks=Math.ceil(b.size/b.blksize),b}),setattr:(function(E,b){b.mode!==void 0&&(E.mode=b.mode),b.timestamp!==void 0&&(E.timestamp=b.timestamp),b.size!==void 0&&A1.resizeFileStorage(E,b.size)}),lookup:(function(E,b){throw C.genericErrors[g.ENOENT]}),mknod:(function(E,b,k,A){return A1.createNode(E,b,k,A)}),rename:(function(E,b,k){if(C.isDir(E.mode)){var A;try{A=C.lookupNode(b,k)}catch{}if(A)for(var e in A.contents)throw new C.ErrnoError(g.ENOTEMPTY)}delete E.parent.contents[E.name],E.name=k,b.contents[k]=E,E.parent=b}),unlink:(function(E,b){delete E.contents[b]}),rmdir:(function(E,b){var k=C.lookupNode(E,b);for(var A in k.contents)throw new C.ErrnoError(g.ENOTEMPTY);delete E.contents[b]}),readdir:(function(E){var b=[".",".."];for(var k in E.contents)E.contents.hasOwnProperty(k)&&b.push(k);return b}),symlink:(function(E,b,k){var A=A1.createNode(E,b,41471,0);return A.link=k,A}),readlink:(function(E){if(!C.isLink(E.mode))throw new C.ErrnoError(g.EINVAL);return E.link})},stream_ops:{read:(function(E,b,k,A,e){var l=E.node.contents;if(e>=E.node.usedBytes)return 0;var z=Math.min(E.node.usedBytes-e,A);if(U1(z>=0),z>8&&l.subarray)b.set(l.subarray(e,e+z),k);else for(var R=0;R<z;R++)b[k+R]=l[e+R];return z}),write:(function(E,b,k,A,e,l){if(!A)return 0;var z=E.node;if(z.timestamp=Date.now(),b.subarray&&(!z.contents||z.contents.subarray)){if(l)return z.contents=b.subarray(k,k+A),z.usedBytes=A,A;if(z.usedBytes===0&&e===0)return z.contents=new Uint8Array(b.subarray(k,k Line truncated
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,k="abort("+E+") at "+_5()+b;throw y6&&y6.forEach((function(A){k=A(k,E)})),k}if(N.abort=N.abort=b2,N.preInit)for(typeof N.preInit=="function"&&(N.preInit=[N.preInit]);N.preInit.length>0;)N.preInit.pop()();var A6=!0;return N.noInitialRun&&(A6=!1),N.noExitRuntime=!0,P5(),t1})();self.onmessage=function(t1){switch(t1.data.command){case"encode":h1(t1.data.samples,t1.data.sampleRate);break;case"decode":l1(t1.data.buffer);break}};function h1(t1,N){N=N||8e3,self.postMessage({command:"encode",amr:q1.encode(t1,N,7)})}function l1(t1){self.postMessage({command:"decode",amr:q1.decode(t1)})}},Me=De.toString().replace(/^\s*function.*?\(\)\s*{/,"").replace(/}\s*$/,""),Pe=(window.URL||window.webkitURL).createObjectURL(new Blob([Me],{type:"text/javascript"})),Te=(function(){function q1(){var h1=this;E5(this,q1),this._isInit=!1,this._isInitRecorder=!1,this._recorderControl=new M0,this._samples=new Float32Array(0),this._rawData=new Uint8Array(0),this._blob=null,this._onEnded=null,this._onAutoEnded=null,this._onPlay=null,this._onPause=null,this._onResume=null,this._onStop=null,this._onStartRecord=null,this._onCancelRecord=null,this._onFinishRecord=null,this._isPlaying=!1,this._isPaused=!1,this._startCtxTime=0,this._pauseTime=0,this._playEmpty=function(){h1._recorderControl.playPcm(new Float32Array(10),24e3)},this._onEndCallback=function(){h1._isPlaying&&(h1._isPlaying=!1,h1._onStop&&h1._onStop(),h1._onAutoEnded&&h1._onAutoEnded()),h1._isPaused||h1._onEnded&&h1._onEnded()},this._runAMRWorker=function(l1,t1){var N=new Worker(Pe);N.postMessage(l1),N.onmessage=function(R1){t1(R1.data.amr),N.terminate()}}}return n6(q1,[{key:"isInit",value:function(){return this._isInit}},{key:"initWithArrayBuffer",value:function(l1){var t1=this;return(this._isInit||this._isInitRecorder)&&q1.throwAlreadyInitialized(),this._playEmpty(),new Promise(function(N,R1){var M1=new Uint8Array(l1);t1.decodeAMRAsync(M1).then(function(T1){t1._samples=T1,t1._isInit=!0,t1._samples?(t1._rawData=M1,N()):M0.decodeAudioArrayBufferByContext(l1).then(function(I1){return t1._isInit=!0,t1.encodeAMRAsync(I1,M0.getCtxSampleRate())}).then(function(I1){return t1._rawData=I1,t1._blob=q1.rawAMRData2Blob(I1),t1.decodeAMRAsync(I1)}).then(function(I1){t1._samples=I1,N()}).catch(function(){R1(new Error("Failed to decode."))})})})}},{key:"initWithBlob",value:function(l1){var t1=this;(this._isInit||this._isInitRecorder)&&q1.throwAlreadyInitialized(),this._playEmpty(),this._blob=l1;var N=new Promise(function(R1){var M1=new FileReader;M1.onload=function(T1){R1(T1.target.result)},M1.readAsArrayBuffer(l1)});return N.then(function(R1){return t1.initWithArrayBuffer(R1)})}},{key:"initWithUrl",value:function(l1){var t1=this;(this._isInit||this._isInitRecorder)&&q1.throwAlreadyInitialized(),this._playEmpty();var N=new Promise(function(R1,M1){var T1=new XMLHttpRequest;T1.open("GET",l1,!0),T1.responseType="arraybuffer",T1.onload=function(){R1(this.response)},T1.onerror=function(){M1(new Error("Failed to fetch "+l1))},T1.send()});return N.then(function(R1){return t1.initWithArrayBuffer(R1)})}},{key:"initWithRecord",value:function(){var l1=this;return(this._isInit||this._isInitRecorder)&&q1.throwAlreadyInitialized(),this._playEmpty(),new Promise(function(t1,N){l1._recorderControl.initRecorder().then(function(){l1._isInitRecorder=!0,t1()}).catch(function(R1){N(R1)})})}},{key:"on",value:function(l1,t1){if(typeof t1=="function"||t1===null)switch(l1){case"play":this._onPlay=t1;break;case"stop":this._onStop=t1;break;case"pause":this._onPause=t1;break;case"resume":this._onResume=t1;break;case"ended":this._onEnded=t1;break;case"autoEnded":this._onAutoEnded=t1;break;case"startRecord":this._onStartRecord=t1;break;case"cancelRecord":this._onCancelRecord=t1;break;case"finishRecord":this._onFinishRecord=t1;break;case"*":case"all":this._onEnded=t1,this._onAutoEnded=t1,this._onPlay=t1,this._onPause=t1,this._onResume=t1,this._onStop=t1,this._onStartRecord=t1,this._onCancelRecord=t1,this._onFinishRecord=t1;break}}},{key:"off",value:function(l1){this.on(l1,null)}},{key:"onPlay",value:function(l1){this.on("play",l1)}},{key:"onStop",value:function(l1){this.on("stop",l1)}},{key:"onPause",value:function(l1){this.on("pause",l1)}},{key:"onResume",value:function(l1){this.on("resume",l1)}},{key:"onEnded",value:function(l1){this.on("ended",l1)}},{key:"onAutoEnded",value:function(l1){this.on("autoEnded",l1)}},{key:"onStartRecord",value:function(l1){this.on("startRecord",l1)}},{key:"onFinishRecord",value:function(l1){this.on("finishRecord",l1)}},{key:"onCancelRecord",value:function(l1){this.on("cancelRecord",l1)}},{key:"play",value:function(l1){var t1=l1&&l1<this.getDuration()?parseFloat(l1):0;if(!this._isInit)throw new Error("Please init AMR first.");this._onPlay&&this._onPlay(),this._isPlaying=!0,this._isPaused=!1,this._startCtxTime=M0.getCtxTime()-t1,this._recorderControl.playPcm(this._samples,this._isInitRecorder?M0.getCtxSampleRa Line truncated
@@ -1,4 +1,4 @@
import{a as d,b as fo,R as Sp}from"./react-vendor-l-BBvuKH.js";import{c as Z,g as Qt,u as cu,w as Ip,a as P,s as Ca,b as Te,t as Ep,p as re,d as Qe,e as q,f as kp,D as G,I as su,r as Xf,E as jp,h as Cp,i as Tp,j as ir,k as dn,l as $p,m as Mp,n as Dp,P as _p}from"./vendor-cRYyTeIw.js";var Np=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function vo(e){if(typeof e!="string")return!1;var t=Np;return t.includes(e)}var Lp=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gLine truncated
import{a as d,b as fo,R as Sp}from"./react-vendor-Bf9ELcll.js";import{c as Z,g as Qt,u as cu,w as Ip,a as P,s as Ca,b as Te,t as Ep,p as re,d as Qe,e as q,f as kp,D as G,I as su,r as Xf,E as jp,h as Cp,i as Tp,j as ir,k as dn,l as $p,m as Mp,n as Dp,P as _p}from"./vendor-BE-_xUHH.js";var Np=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function vo(e){if(typeof e!="string")return!1;var t=Np;return t.includes(e)}var Lp=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gLine truncated
A`).concat(i,",").concat(i,",0,1,1,").concat(2*o,",").concat(a,`
H`).concat(He,"M").concat(2*o,",").concat(a,`
A`).concat(i,",").concat(i,",0,1,1,").concat(o,",").concat(a),className:"recharts-legend-icon"});if(u==="rect")return d.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(He/8,"h").concat(He,"v").concat(He*3/4,"h").concat(-He,"z"),className:"recharts-legend-icon"});if(d.isValidElement(t.legendIcon)){var c=wd({},t);return delete c.legendIcon,d.cloneElement(t.legendIcon,c)}return d.createElement(bd,{fill:l,cx:a,cy:a,size:He,sizeType:"diameter",type:u})}function qy(e){var t=e.payload,r=e.iconSize,n=e.layout,a=e.formatter,i=e.inactiveColor,o=e.iconType,l=e.labelStyle,u={x:0,y:0,width:He,height:He},c={display:n==="horizontal"?"inline-block":"block",marginRight:10},s={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((f,v)=>{var h=f.formatter||a,m=Z({"recharts-legend-item":!0,["legend-item-".concat(v)]:!0,inactive:f.inactive});if(f.type==="none")return null;var p=typeof l=="object"?wd({},l):{};p.color=f.inactive?i:p.color||f.color;var y=h?h(f.value,f,v):f.value;return d.createElement("li",Zn({className:m,style:c,key:"legend-item-".concat(v)},hn(e,f,v)),d.createElement(ho,{width:r,height:r,viewBox:u,style:s,"aria-label":"".concat(f.value," legend icon")},d.createElement(Yy,{data:f,iconType:o,inactiveColor:i})),d.createElement("span",{className:"recharts-legend-item-text",style:p},y))})}var Xy=e=>{var t=Ae(e,Vy),r=t.payload,n=t.layout,a=t.align;if(!r||!r.length)return null;var i={padding:0,margin:0,textAlign:n==="horizontal"?a:"left"};return d.createElement("ul",{className:"recharts-default-legend",style:i},d.createElement(qy,Zn({},t,{payload:r})))};function Ad(e,t,r){return t===!0?cu(e,r):typeof t=="function"?cu(e,t):e}var bo=d.createContext(null),Zy=e=>e,ee=()=>{var e=d.useContext(bo);return e?e.store.dispatch:Zy},Fn=()=>{},Qy=()=>Fn,Jy=(e,t)=>e===t;function M(e){var t=d.useContext(bo),r=d.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Fn,[t,e]);return Ip.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Qy,t?t.store.getState:Fn,t?t.store.getState:Fn,r,Jy)}var Pd=e=>e.legend.settings,eg=e=>e.legend.size,tg=e=>e.legend.payload,rg=P([tg,Pd],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?Ca(n,r):n});function ng(){return M(rg)}function ag(e,t){return ug(e)||lg(e,t)||og(e,t)||ig()}function ig(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1,4 +1,4 @@
import{a as h}from"./react-vendor-l-BBvuKH.js";/**
import{a as y}from"./react-vendor-Bf9ELcll.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -13,409 +13,419 @@ import{a as h}from"./react-vendor-l-BBvuKH.js";/**
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const m=h.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:s="",children:y,iconNode:i,...d},p)=>h.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",s),...!y&&!x(d)&&{"aria-hidden":"true"},...d},[...i.map(([r,l])=>h.createElement(r,l)),...Array.isArray(y)?y:[y]]));/**
*/const g=y.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:s="",children:h,iconNode:i,...d},p)=>y.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:k("lucide",s),...!h&&!x(d)&&{"aria-hidden":"true"},...d},[...i.map(([r,l])=>y.createElement(r,l)),...Array.isArray(h)?h:[h]]));/**
* @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 e=(t,a)=>{const c=h.forwardRef(({className:o,...s},y)=>h.createElement(m,{ref:y,iconNode:a,className:k(`lucide-${M(n(t))}`,`lucide-${t}`,o),...s}));return c.displayName=n(t),c};/**
*/const e=(t,a)=>{const c=y.forwardRef(({className:o,...s},h)=>y.createElement(g,{ref:h,iconNode:a,className:k(`lucide-${M(n(t))}`,`lucide-${t}`,o),...s}));return c.displayName=n(t),c};/**
* @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 g=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Z1=e("activity",g);/**
*/const m=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],G1=e("activity",m);/**
* @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 u=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],K1=e("arrow-right",u);/**
*/const u=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Q1=e("arrow-right",u);/**
* @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 $=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],G1=e("bell",$);/**
*/const $=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],J1=e("bell",$);/**
* @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 N=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Q1=e("bot",N);/**
*/const N=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],X1=e("bot",N);/**
* @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 f=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],J1=e("box",f);/**
*/const w=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Y1=e("box",w);/**
* @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 w=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],X1=e("calendar-clock",w);/**
*/const f=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],e2=e("calendar-clock",f);/**
* @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 z=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Y1=e("check-check",z);/**
*/const z=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],a2=e("check-check",z);/**
* @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 b=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],e2=e("check",b);/**
*/const b=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t2=e("check",b);/**
* @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 q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],a2=e("chevron-down",q);/**
*/const q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],c2=e("chevron-down",q);/**
* @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 C=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],t2=e("chevron-left",C);/**
*/const C=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],o2=e("chevron-left",C);/**
* @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 j=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],c2=e("chevron-right",j);/**
*/const j=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],h2=e("chevron-right",j);/**
* @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 A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],o2=e("circle-alert",A);/**
*/const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y2=e("circle-alert",A);/**
* @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 H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],y2=e("circle-check",H);/**
*/const H=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],s2=e("circle-check",H);/**
* @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 V=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],h2=e("circle-dashed",V);/**
*/const V=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],d2=e("circle-dashed",V);/**
* @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 L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],s2=e("circle-dollar-sign",L);/**
*/const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],n2=e("circle-dollar-sign",L);/**
* @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 S=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],d2=e("clock-3",S);/**
*/const P=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],k2=e("clock-3",P);/**
* @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 P=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],n2=e("clock",P);/**
*/const S=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],i2=e("clock",S);/**
* @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 U=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],k2=e("cloud-upload",U);/**
*/const U=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],p2=e("cloud-upload",U);/**
* @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 D=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],i2=e("code",D);/**
*/const D=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],r2=e("code",D);/**
* @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 E=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],p2=e("copy",E);/**
*/const E=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],l2=e("copy",E);/**
* @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 B=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],r2=e("credit-card",B);/**
*/const R=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],M2=e("credit-card",R);/**
* @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 R=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],l2=e("database",R);/**
*/const B=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],_2=e("database",B);/**
* @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 T=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],M2=e("dollar-sign",T);/**
*/const T=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],x2=e("dollar-sign",T);/**
* @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 W=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],_2=e("external-link",W);/**
*/const W=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],v2=e("external-link",W);/**
* @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 F=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],x2=e("eye-off",F);/**
*/const F=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],g2=e("eye-off",F);/**
* @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 I=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],v2=e("eye",I);/**
*/const I=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],m2=e("eye",I);/**
* @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 O=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],m2=e("file-down",O);/**
*/const O=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],u2=e("file-down",O);/**
* @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 Z=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],g2=e("file-text",Z);/**
*/const Z=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],$2=e("file-text",Z);/**
* @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 K=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],u2=e("funnel",K);/**
*/const K=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],N2=e("funnel",K);/**
* @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 G=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],$2=e("gift",G);/**
*/const G=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],w2=e("gift",G);/**
* @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 Q=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],N2=e("git-commit-horizontal",Q);/**
*/const Q=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],f2=e("git-commit-horizontal",Q);/**
* @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 J=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],f2=e("image-plus",J);/**
*/const J=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],z2=e("image-plus",J);/**
* @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 X=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],w2=e("image",X);/**
*/const X=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],b2=e("image",X);/**
* @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 Y=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],z2=e("key",Y);/**
*/const Y=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],q2=e("key",Y);/**
* @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 e1=[["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"}]],b2=e("layers",e1);/**
*/const e1=[["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"}]],C2=e("layers",e1);/**
* @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 a1=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],q2=e("layout-dashboard",a1);/**
*/const a1=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],j2=e("layout-dashboard",a1);/**
* @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 t1=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],C2=e("link-2",t1);/**
*/const t1=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],A2=e("link-2",t1);/**
* @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 c1=[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 19H3",key:"zzsher"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]],j2=e("list-plus",c1);/**
*/const c1=[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 19H3",key:"zzsher"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]],H2=e("list-plus",c1);/**
* @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 o1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],A2=e("loader-circle",o1);/**
*/const o1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],V2=e("loader-circle",o1);/**
* @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 y1=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],H2=e("locate-fixed",y1);/**
*/const h1=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],L2=e("locate-fixed",h1);/**
* @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 h1=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],V2=e("lock-keyhole",h1);/**
*/const y1=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],P2=e("lock-keyhole",y1);/**
* @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 s1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],L2=e("lock",s1);/**
*/const s1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],S2=e("lock",s1);/**
* @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 d1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],S2=e("log-out",d1);/**
*/const d1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],U2=e("log-out",d1);/**
* @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 n1=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],P2=e("mail",n1);/**
*/const n1=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],D2=e("mail",n1);/**
* @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 k1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}]],U2=e("message-circle-more",k1);/**
*/const k1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}]],E2=e("message-circle-more",k1);/**
* @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:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],D2=e("message-circle",i1);/**
*/const i1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],R2=e("message-circle",i1);/**
* @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 p1=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],E2=e("message-square-quote",p1);/**
*/const p1=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],B2=e("message-square-quote",p1);/**
* @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 r1=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],B2=e("package-check",r1);/**
*/const r1=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],T2=e("package-check",r1);/**
* @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 l1=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],R2=e("package-plus",l1);/**
*/const l1=[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],W2=e("package-plus",l1);/**
* @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 M1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],T2=e("package",M1);/**
*/const M1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],F2=e("package",M1);/**
* @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 _1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],W2=e("pen",_1);/**
*/const _1=[["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"}]],I2=e("pause",_1);/**
* @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 x1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],F2=e("play",x1);/**
*/const x1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],O2=e("pen",x1);/**
* @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 v1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],I2=e("plus",v1);/**
*/const v1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Z2=e("play",v1);/**
* @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 m1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],O2=e("power",m1);/**
*/const g1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],K2=e("plus",g1);/**
* @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 g1=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Z2=e("qr-code",g1);/**
*/const m1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],G2=e("power",m1);/**
* @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 u1=[["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"}]],K2=e("refresh-cw",u1);/**
*/const u1=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Q2=e("qr-code",u1);/**
* @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 $1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],G2=e("save",$1);/**
*/const $1=[["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"}]],J2=e("refresh-cw",$1);/**
* @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 N1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Q2=e("search",N1);/**
*/const N1=[["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"}]],X2=e("rotate-ccw",N1);/**
* @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 f1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],J2=e("send",f1);/**
*/const w1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Y2=e("save",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 w1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],X2=e("settings",w1);/**
*/const f1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],e0=e("search",f1);/**
* @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 z1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Y2=e("shield-check",z1);/**
*/const z1=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],a0=e("send",z1);/**
* @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 b1=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],e0=e("shopping-bag",b1);/**
*/const b1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],t0=e("settings",b1);/**
* @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 q1=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],a0=e("shopping-cart",q1);/**
*/const q1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],c0=e("shield-check",q1);/**
* @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 C1=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],t0=e("sliders-horizontal",C1);/**
*/const C1=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],o0=e("shopping-bag",C1);/**
* @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 j1=[["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"}]],c0=e("smile",j1);/**
*/const j1=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],h0=e("shopping-cart",j1);/**
* @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 A1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],o0=e("sparkles",A1);/**
*/const A1=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],y0=e("sliders-horizontal",A1);/**
* @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 H1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],y0=e("square-pen",H1);/**
*/const H1=[["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"}]],s0=e("smile",H1);/**
* @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 V1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],h0=e("trash-2",V1);/**
*/const V1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],d0=e("sparkles",V1);/**
* @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 L1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],s0=e("trending-up",L1);/**
*/const L1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],n0=e("square-pen",L1);/**
* @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 S1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],d0=e("triangle-alert",S1);/**
*/const P1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],k0=e("trash-2",P1);/**
* @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 P1=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],n0=e("truck",P1);/**
*/const S1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],i0=e("trending-up",S1);/**
* @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 U1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],k0=e("upload",U1);/**
*/const U1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],p0=e("triangle-alert",U1);/**
* @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 D1=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],i0=e("user-round",D1);/**
*/const D1=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],r0=e("truck",D1);/**
* @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 E1=[["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"}]],p0=e("user",E1);/**
*/const E1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],l0=e("upload",E1);/**
* @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 B1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],r0=e("users",B1);/**
*/const R1=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],M0=e("user-round",R1);/**
* @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 R1=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],l0=e("webhook",R1);/**
*/const B1=[["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"}]],_0=e("user",B1);/**
* @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 T1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],M0=e("wifi-off",T1);/**
*/const T1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],x0=e("users",T1);/**
* @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 W1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],_0=e("wifi",W1);/**
*/const W1=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],v0=e("webhook",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 F1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],x0=e("x",F1);/**
*/const F1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],g0=e("wifi-off",F1);/**
* @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:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],v0=e("zap",I1);export{w2 as $,K1 as A,J1 as B,r2 as C,M2 as D,_2 as E,v2 as F,N2 as G,d0 as H,Q2 as I,k0 as J,z2 as K,A2 as L,U2 as M,I2 as N,n0 as O,T2 as P,Z2 as Q,K2 as R,Y2 as S,s0 as T,p0 as U,y0 as V,j2 as W,x0 as X,m2 as Y,v0 as Z,i2 as _,L2 as a,g2 as a0,t0 as a1,p2 as a2,u2 as a3,R2 as a4,k2 as a5,y2 as a6,h2 as a7,C2 as a8,H2 as a9,l2 as aa,a2 as ab,V2 as ac,i0 as ad,d2 as ae,$2 as af,s2 as ag,b2 as ah,J2 as ai,P2 as aj,l0 as ak,_0 as al,M0 as am,Y1 as an,c0 as ao,f2 as ap,q2 as b,r0 as c,e0 as d,G1 as e,X2 as f,c2 as g,t2 as h,S2 as i,a0 as j,o2 as k,Z1 as l,B2 as m,Q1 as n,G2 as o,E2 as p,F2 as q,o0 as r,X1 as s,e2 as t,D2 as u,n2 as v,W2 as w,O2 as x,h0 as y,x2 as z};
*/const I1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],m0=e("wifi",I1);/**
* @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 O1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],u0=e("x",O1);/**
* @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 Z1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],$0=e("zap",Z1);export{b2 as $,Q1 as A,Y1 as B,M2 as C,x2 as D,v2 as E,m2 as F,f2 as G,p0 as H,e0 as I,l0 as J,q2 as K,V2 as L,E2 as M,K2 as N,r0 as O,F2 as P,Q2 as Q,J2 as R,c0 as S,i0 as T,_0 as U,n0 as V,H2 as W,u0 as X,u2 as Y,$0 as Z,r2 as _,S2 as a,$2 as a0,y0 as a1,l2 as a2,N2 as a3,W2 as a4,p2 as a5,s2 as a6,d2 as a7,A2 as a8,L2 as a9,_2 as aa,c2 as ab,P2 as ac,M0 as ad,k2 as ae,w2 as af,n2 as ag,C2 as ah,a0 as ai,D2 as aj,v0 as ak,I2 as al,X2 as am,m0 as an,g0 as ao,a2 as ap,s0 as aq,z2 as ar,j2 as b,x0 as c,o0 as d,J1 as e,t0 as f,h2 as g,o2 as h,U2 as i,h0 as j,y2 as k,G1 as l,T2 as m,X1 as n,Y2 as o,B2 as p,Z2 as q,d0 as r,e2 as s,t2 as t,R2 as u,i2 as v,O2 as w,G2 as x,k0 as y,g2 as z};
@@ -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(147 197 253 / .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(147 197 253 / .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(--color-neutral-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(--color-neutral-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--color-neutral-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}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:6Line truncated
@@ -1,2 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-BWfd6MyT.js","assets/react-vendor-l-BBvuKH.js","assets/dateTime-DDi7rqpW.js","assets/icons-vendor-CIGXYOCp.js","assets/charts-vendor-DlHaeEQJ.js","assets/vendor-cRYyTeIw.js","assets/vendor-DUblxfbA.css","assets/contract-COFcZjyb.js","assets/AccountList-CZJPJAzU.js","assets/OrderList-CMWPVZno.js","assets/CardList-BC38wNai.js","assets/ItemList-BgZXwlJZ.js","assets/Settings-BOxCHLU8.js","assets/Rules-BaD_vse7.js","assets/Notifications-DFdczI4g.js","assets/Chat-B7ZHVqg5.js"])))=>i.map(i=>d[i]);
import{c as P,j as t,a as l,d as K}from"./react-vendor-l-BBvuKH.js";import{o as W}from"./vendor-cRYyTeIw.js";import{L as z,a as I,S as J,U as Q,A as X,b as ee,c as te,M as se,C as ne,B as re,d as ae,Z as oe,e as ie,f as ce,G as R,g as le,h as de,i as ue}from"./icons-vendor-CIGXYOCp.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))c(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&c(a)}).observe(document,{childList:!0,subtree:!0});function s(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function c(r){if(r.ep)return;r.ep=!0;const i=s(r);fetch(r.href,i)}})();class he extends P.Component{constructor(){super(...arguments),this.state={hasError:!1},this.handleReload=()=>{window.location.reload()}}static getDerivedStateFromError(){return{hasError:!0}}render(){const{hasError:n}=this.state,{children:s}=this.props;return n?t.jsx("main",{className:"flex min-h-screen items-center justify-center bg-canvas p-6 text-ink",children:t.jsxs("section",{className:"max-w-md text-center",children:[t.jsx("h1",{className:"text-xl font-semibold",children:"页面暂时无法显示"}),t.jsx("button",{className:"ios-btn-primary mt-6 px-4 py-2",type:"button",onClick:this.handleReload,children:"重新加载"})]})}):s}}let S=!1;class O extends Error{constructor(n,s){super(pe(s,n)),this.name="ApiError",this.status=n,this.code=N(s)?s.code:`http_${n}`,this.requestId=N(s)?s.request_id:void 0,this.request_id=this.requestId,this.details=N(s)?s.details:void 0,this.payload=s}}const me=()=>{S||typeof window>"u"||(S=!0,window.dispatchEvent(new Event("auth:logout")),queueMicrotask(()=>{S=!1}))},fe=(e,n)=>{const s=new AbortController,c=()=>s.abort(e==null?void 0:e.reason);e!=null&&e.aborted?c():e==null||e.addEventListener("abort",c,{once:!0});const r=globalThis.setTimeout(()=>s.abort(new DOMException("timeout","TimeoutError")),Math.max(1,n));return{signal:s.signal,cleanup:()=>{globalThis.clearTimeout(r),e==null||e.removeEventListener("abort",c)}}},N=e=>{if(typeof e!="object"||e===null)return!1;const n=e;return typeof n.code=="string"&&typeof n.message=="string"},pe=(e,n)=>typeof e=="string"?e:N(e)?e.message:`请求失败: ${n}`,xe=3e4,ge=(e,n)=>fetch(e,{...n,credentials:"include"}),be=typeof location>"u"?"http://localhost":location.origin,v=W({baseUrl:be,fetch:ge});function nt(e){return e}async function w(e,n={}){var c;const s=fe(n.signal,n.timeoutMs??xe);try{const r=await e(s.signal);if(r.response.status===401&&!n.skipAuthLogout&&me(),r.error!==void 0)throw new O(r.response.status,r.error);if(r.data===void 0)throw new O(r.response.status,void 0);return r.data}catch(r){throw s.signal.aborted?new Error((c=n.signal)!=null&&c.aborted?"请求已取消":"请求超时,请稍后重试"):r}finally{s.cleanup()}}const ve=async e=>{const n=await w(s=>v.POST("/api/v1/session/login",{body:e,signal:s}),{skipAuthLogout:!0});return{...n,token:n.token??void 0}},we=async e=>{const n=await w(s=>v.POST("/api/v1/session/initialize",{body:{password:e},signal:s}),{skipAuthLogout:!0});return{...n,token:n.token??void 0}},ye=async e=>w(n=>v.GET("/api/v1/session",{signal:n}),e),Le=async()=>({success:!0,message:(await w(n=>v.POST("/api/v1/session/logout",{body:{},signal:n}))).message}),U=l.createContext(void 0),je=({children:e})=>{const[n,s]=l.useState(!1),[c,r]=l.useState(!1),[i,a]=l.useState(!0),[o,u]=l.useState(!1),d=()=>{s(!1),r(!1)};l.useEffect(()=>{const x=new AbortController;let p=!0;ye({signal:x.signal}).then(b=>{if(p){if((b==null?void 0:b.initialized)===!1){u(!0),d();return}u(!1),b!=null&&b.authenticated?(s(!0),r(b.is_admin===!0)):d()}}).catch(b=>{!p||b instanceof DOMException&&b.name==="AbortError"||(u(!1),d())}).finally(()=>{p&&a(!1)});const h=()=>d();return window.addEventListener("auth:logout",h),(()=>{p=!1,x.abort(),window.removeEventListener("auth:logout",h)})},[]);const m=async x=>{const p=await ve(x);return p.success&&(u(!1),s(!0),r(p.is_admin===!0)),p},g=async x=>{const p=await we(x);return p.success&&(u(!1),s(!0),r(p.is_admin===!0)),p},f=async()=>{try{await Le()}finally{d()}};return t.jsx(U.Provider,{value:{checkingAuth:i,isLoggedIn:n,isAdmin:c,needsInit:o,signIn:m,initialize:g,signOut:f},children:e})},B=()=>{const e=l.useContext(U);if(!e)throw new Error("useSession 必须在 SessionProvider 内使用");return e},q="ydisks.sidebar.v1",Ce=()=>{try{return window.localStorage.getItem(q)==="collapsed"}catch{return!1}},_e=e=>{try{window.localStorage.setItem(q,e?"collapsed":"expanded")}catch{}},Ne=({className:e="w-full h-full text-white"})=>t.jsx("svg",{className:e,viewBox:"0 0 256 256","aria-hidden":"true",children:t.jsx("g",{stroke:"nLine truncated
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-nm_Ta7yG.js","assets/react-vendor-Bf9ELcll.js","assets/dateTime-DDi7rqpW.js","assets/icons-vendor-B5fJPoU1.js","assets/charts-vendor-DBu_rVrn.js","assets/vendor-BE-_xUHH.js","assets/vendor-DUblxfbA.css","assets/contract-COFcZjyb.js","assets/AccountList-ClEQWLWq.js","assets/OrderList-CTwm_EVa.js","assets/CardList-Ptkqaql3.js","assets/ItemList-nhrE5KKq.js","assets/Settings-DasfRIJS.js","assets/Rules-4R6_G6FE.js","assets/Notifications-BwTLeimZ.js","assets/Chat-CXgshIQ-.js","assets/audio-codec-mjVr_wwJ.js"])))=>i.map(i=>d[i]);
import{d as P,j as t,a as l,e as K}from"./react-vendor-Bf9ELcll.js";import{o as W}from"./vendor-BE-_xUHH.js";import{L as z,a as I,S as J,U as Q,A as X,b as ee,c as te,M as se,C as ne,B as re,d as ae,Z as oe,e as ie,f as ce,G as R,g as le,h as de,i as ue}from"./icons-vendor-B5fJPoU1.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))c(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&c(a)}).observe(document,{childList:!0,subtree:!0});function s(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function c(r){if(r.ep)return;r.ep=!0;const i=s(r);fetch(r.href,i)}})();class he extends P.Component{constructor(){super(...arguments),this.state={hasError:!1},this.handleReload=()=>{window.location.reload()}}static getDerivedStateFromError(){return{hasError:!0}}render(){const{hasError:n}=this.state,{children:s}=this.props;return n?t.jsx("main",{className:"flex min-h-screen items-center justify-center bg-canvas p-6 text-ink",children:t.jsxs("section",{className:"max-w-md text-center",children:[t.jsx("h1",{className:"text-xl font-semibold",children:"页面暂时无法显示"}),t.jsx("button",{className:"ios-btn-primary mt-6 px-4 py-2",type:"button",onClick:this.handleReload,children:"重新加载"})]})}):s}}let S=!1;class O extends Error{constructor(n,s){super(pe(s,n)),this.name="ApiError",this.status=n,this.code=N(s)?s.code:`http_${n}`,this.requestId=N(s)?s.request_id:void 0,this.request_id=this.requestId,this.details=N(s)?s.details:void 0,this.payload=s}}const me=()=>{S||typeof window>"u"||(S=!0,window.dispatchEvent(new Event("auth:logout")),queueMicrotask(()=>{S=!1}))},fe=(e,n)=>{const s=new AbortController,c=()=>s.abort(e==null?void 0:e.reason);e!=null&&e.aborted?c():e==null||e.addEventListener("abort",c,{once:!0});const r=globalThis.setTimeout(()=>s.abort(new DOMException("timeout","TimeoutError")),Math.max(1,n));return{signal:s.signal,cleanup:()=>{globalThis.clearTimeout(r),e==null||e.removeEventListener("abort",c)}}},N=e=>{if(typeof e!="object"||e===null)return!1;const n=e;return typeof n.code=="string"&&typeof n.message=="string"},pe=(e,n)=>typeof e=="string"?e:N(e)?e.message:`请求失败: ${n}`,xe=3e4,ge=(e,n)=>fetch(e,{...n,credentials:"include"}),be=typeof location>"u"?"http://localhost":location.origin,v=W({baseUrl:be,fetch:ge});function nt(e){return e}async function w(e,n={}){var c;const s=fe(n.signal,n.timeoutMs??xe);try{const r=await e(s.signal);if(r.response.status===401&&!n.skipAuthLogout&&me(),r.error!==void 0)throw new O(r.response.status,r.error);if(r.data===void 0)throw new O(r.response.status,void 0);return r.data}catch(r){throw s.signal.aborted?new Error((c=n.signal)!=null&&c.aborted?"请求已取消":"请求超时,请稍后重试"):r}finally{s.cleanup()}}const ve=async e=>{const n=await w(s=>v.POST("/api/v1/session/login",{body:e,signal:s}),{skipAuthLogout:!0});return{...n,token:n.token??void 0}},we=async e=>{const n=await w(s=>v.POST("/api/v1/session/initialize",{body:{password:e},signal:s}),{skipAuthLogout:!0});return{...n,token:n.token??void 0}},ye=async e=>w(n=>v.GET("/api/v1/session",{signal:n}),e),Le=async()=>({success:!0,message:(await w(n=>v.POST("/api/v1/session/logout",{body:{},signal:n}))).message}),U=l.createContext(void 0),je=({children:e})=>{const[n,s]=l.useState(!1),[c,r]=l.useState(!1),[i,a]=l.useState(!0),[o,u]=l.useState(!1),d=()=>{s(!1),r(!1)};l.useEffect(()=>{const x=new AbortController;let p=!0;ye({signal:x.signal}).then(b=>{if(p){if((b==null?void 0:b.initialized)===!1){u(!0),d();return}u(!1),b!=null&&b.authenticated?(s(!0),r(b.is_admin===!0)):d()}}).catch(b=>{!p||b instanceof DOMException&&b.name==="AbortError"||(u(!1),d())}).finally(()=>{p&&a(!1)});const h=()=>d();return window.addEventListener("auth:logout",h),(()=>{p=!1,x.abort(),window.removeEventListener("auth:logout",h)})},[]);const m=async x=>{const p=await ve(x);return p.success&&(u(!1),s(!0),r(p.is_admin===!0)),p},g=async x=>{const p=await we(x);return p.success&&(u(!1),s(!0),r(p.is_admin===!0)),p},f=async()=>{try{await Le()}finally{d()}};return t.jsx(U.Provider,{value:{checkingAuth:i,isLoggedIn:n,isAdmin:c,needsInit:o,signIn:m,initialize:g,signOut:f},children:e})},B=()=>{const e=l.useContext(U);if(!e)throw new Error("useSession 必须在 SessionProvider 内使用");return e},q="ydisks.sidebar.v1",Ce=()=>{try{return window.localStorage.getItem(q)==="collapsed"}catch{return!1}},_e=e=>{try{window.localStorage.setItem(q,e?"collapsed":"expanded")}catch{}},Ne=({className:e="w-full h-full text-white"})=>t.jsx("svg",{className:e,viewBox:"0 0 256 256","aria-hidden":"true",children:t.jsx("g",{stroke:"nLine truncated
@@ -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(147 197 253 / .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(147 197 253 / .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(--color-neutral-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(--color-neutral-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--color-neutral-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}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:6Line truncated
@@ -1,4 +1,4 @@
function ws(M,Sl){for(var W=0;W<Sl.length;W++){const o=Sl[W];if(typeof o!="string"&&!Array.isArray(o)){for(const al in o)if(al!=="default"&&!(al in M)){const vl=Object.getOwnPropertyDescriptor(o,al);vl&&Object.defineProperty(M,al,vl.get?vl:{enumerable:!0,get:()=>o[al]})}}}return Object.freeze(Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}))}function E1(M){return M&&M.__esModule&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M}var ai={exports:{}},ge={};/**
function ws(M,Sl){for(var W=0;W<Sl.length;W++){const o=Sl[W];if(typeof o!="string"&&!Array.isArray(o)){for(const al in o)if(al!=="default"&&!(al in M)){const vl=Object.getOwnPropertyDescriptor(o,al);vl&&Object.defineProperty(M,al,vl.get?vl:{enumerable:!0,get:()=>o[al]})}}}return Object.freeze(Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}))}var ed=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function E1(M){return M&&M.__esModule&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M}var ai={exports:{}},ge={};/**
* @license React
* react-jsx-runtime.production.js
*
@@ -6,7 +6,7 @@ function ws(M,Sl){for(var W=0;W<Sl.length;W++){const o=Sl[W];if(typeof o!="strin
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var m1;function Ws(){if(m1)return ge;m1=1;var M=Symbol.for("react.transitional.element"),Sl=Symbol.for("react.fragment");function W(o,al,vl){var Ol=null;if(vl!==void 0&&(Ol=""+vl),al.key!==void 0&&(Ol=""+al.key),"key"in al){vl={};for(var Rl in al)Rl!=="key"&&(vl[Rl]=al[Rl])}else vl=al;return al=vl.ref,{$$typeof:M,type:o,key:Ol,ref:al!==void 0?al:null,props:vl}}return ge.Fragment=Sl,ge.jsx=W,ge.jsxs=W,ge}var s1;function $s(){return s1||(s1=1,ai.exports=Ws()),ai.exports}var ed=$s(),ei={exports:{}},C={};/**
*/var m1;function Ws(){if(m1)return ge;m1=1;var M=Symbol.for("react.transitional.element"),Sl=Symbol.for("react.fragment");function W(o,al,vl){var Ol=null;if(vl!==void 0&&(Ol=""+vl),al.key!==void 0&&(Ol=""+al.key),"key"in al){vl={};for(var Rl in al)Rl!=="key"&&(vl[Rl]=al[Rl])}else vl=al;return al=vl.ref,{$$typeof:M,type:o,key:Ol,ref:al!==void 0?al:null,props:vl}}return ge.Fragment=Sl,ge.jsx=W,ge.jsxs=W,ge}var s1;function $s(){return s1||(s1=1,ai.exports=Ws()),ai.exports}var nd=$s(),ei={exports:{}},C={};/**
* @license React
* react.production.js
*
@@ -14,7 +14,7 @@ function ws(M,Sl){for(var W=0;W<Sl.length;W++){const o=Sl[W];if(typeof o!="strin
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var d1;function Fs(){if(d1)return C;d1=1;var M=Symbol.for("react.transitional.element"),Sl=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),al=Symbol.for("react.profiler"),vl=Symbol.for("react.consumer"),Ol=Symbol.for("react.context"),Rl=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),il=Symbol.iterator;function wl(v){return v===null||typeof v!="object"?null:(v=il&&v[il]||v["@@iterator"],typeof v=="function"?v:null)}var Bl={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ql=Object.assign,Ut={};function Wl(v,E,O){this.props=v,this.context=E,this.refs=Ut,this.updater=O||Bl}Wl.prototype.isReactComponent={},Wl.prototype.setState=function(v,E){if(typeof v!="object"&&typeof v!="function"&&v!=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,v,E,"setState")},Wl.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function wt(){}wt.prototype=Wl.prototype;function Nl(v,E,O){this.props=v,this.context=E,this.refs=Ut,this.updater=O||Bl}var nt=Nl.prototype=new wt;nt.constructor=Nl,ql(nt,Wl.prototype),nt.isPureReactComponent=!0;var Tt=Array.isArray;function Gl(){}var x={H:null,A:null,T:null,S:null},Xl=Object.prototype.hasOwnProperty;function Et(v,E,O){var U=O.ref;return{$$typeof:M,type:v,key:E,ref:U!==void 0?U:null,props:O}}function Qu(v,E){return Et(v.type,E,v.props)}function At(v){return typeof v=="object"&&v!==null&&v.$$typeof===M}function Ql(v){var E={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(O){return E[O]})}var zu=/\/+/g;function rt(v,E){return typeof v=="object"&&v!==null&&v.key!=null?Ql(""+v.key):E.toString(36)}function St(v){switch(v.status){case"fulfilled":return v.value;case"rejected":throw v.reason;default:switch(typeof v.status=="string"?v.then(Gl,Gl):(v.status="pending",v.then(function(E){v.status==="pending"&&(v.status="fulfilled",v.value=E)},function(E){v.status==="pending"&&(v.status="rejected",v.reason=E)})),v.status){case"fulfilled":return v.value;case"rejected":throw v.reason}}throw v}function b(v,E,O,U,Y){var X=typeof v;(X==="undefined"||X==="boolean")&&(v=null);var F=!1;if(v===null)F=!0;else switch(X){case"bigint":case"string":case"number":F=!0;break;case"object":switch(v.$$typeof){case M:case Sl:F=!0;break;case $:return F=v._init,b(F(v._payload),E,O,U,Y)}}if(F)return Y=Y(v),F=U===""?"."+rt(v,0):U,Tt(Y)?(O="",F!=null&&(O=F.replace(zu,"$&/")+"/"),b(Y,E,O,"",function(Oa){return Oa})):Y!=null&&(At(Y)&&(Y=Qu(Y,O+(Y.key==null||v&&v.key===Y.key?"":(""+Y.key).replace(zu,"$&/")+"/")+F)),E.push(Y)),1;F=0;var Cl=U===""?".":U+":";if(Tt(v))for(var dl=0;dl<v.length;dl++)U=v[dl],X=Cl+rt(U,dl),F+=b(U,E,O,X,Y);else if(dl=wl(v),typeof dl=="function")for(v=dl.call(v),dl=0;!(U=v.next()).done;)U=U.value,X=Cl+rt(U,dl++),F+=b(U,E,O,X,Y);else if(X==="object"){if(typeof v.then=="function")return b(St(v),E,O,U,Y);throw E=String(v),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return F}function _(v,E,O){if(v==null)return v;var U=[],Y=0;return b(v,U,"","",function(X){return E.call(O,X,Y++)}),U}function q(v){if(v._status===-1){var E=v._result;E=E(),E.then(function(O){(v._status===0||v._status===-1)&&(v._status=1,v._result=O)},function(O){(v._status===0||v._status===-1)&&(v._status=2,v._result=O)}),v._status===-1&&(v._status=0,v._result=E)}if(v._status===1)return v._result.default;throw v._result}var P=typeof reportError=="function"?reportError:function(v){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof v=="object"&&v!==null&&typeof v.message=="string"?String(v.message):String(v),error:v});if(!window.dispatchEvent(E))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",v);return}console.error(v)},el={map:_,forEach:function(v,E,O){_(v,function(){E.apply(this,arguments)},O)},count:function(v){var E=0;return _(v,function(){E++}),E},toArray:function(v){return _(v,function(E){return E})||[]},only:function(v){if(!At(v))throw Error("React.Children.only expected to receive a single React element child.");return v}};return C.Activity=R,C.Children=el,C.Component=Wl,C.Fragment=W,C.Profiler=al,C.PureComponent=Nl,C.StrictMode=o,C.Suspense=N,C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,C.__COMPILER_RUNTIME={__proto__:null,c:function(v){return x.H.useMemoCache(v)}},C.cache=function(v){return function(){return v.apply(null,arguments)}},C.cacheSignal=function(){return null},C.cloneElement=function(v,E,O){if(v==null)throw Error("The argumentLine truncated
*/var d1;function Fs(){if(d1)return C;d1=1;var M=Symbol.for("react.transitional.element"),Sl=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),al=Symbol.for("react.profiler"),vl=Symbol.for("react.consumer"),Ol=Symbol.for("react.context"),Rl=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),il=Symbol.iterator;function wl(v){return v===null||typeof v!="object"?null:(v=il&&v[il]||v["@@iterator"],typeof v=="function"?v:null)}var Bl={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ql=Object.assign,Ut={};function Wl(v,E,O){this.props=v,this.context=E,this.refs=Ut,this.updater=O||Bl}Wl.prototype.isReactComponent={},Wl.prototype.setState=function(v,E){if(typeof v!="object"&&typeof v!="function"&&v!=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,v,E,"setState")},Wl.prototype.forceUpdate=function(v){this.updater.enqueueForceUpdate(this,v,"forceUpdate")};function wt(){}wt.prototype=Wl.prototype;function Nl(v,E,O){this.props=v,this.context=E,this.refs=Ut,this.updater=O||Bl}var nt=Nl.prototype=new wt;nt.constructor=Nl,ql(nt,Wl.prototype),nt.isPureReactComponent=!0;var Tt=Array.isArray;function Gl(){}var x={H:null,A:null,T:null,S:null},Xl=Object.prototype.hasOwnProperty;function Et(v,E,O){var U=O.ref;return{$$typeof:M,type:v,key:E,ref:U!==void 0?U:null,props:O}}function Qu(v,E){return Et(v.type,E,v.props)}function At(v){return typeof v=="object"&&v!==null&&v.$$typeof===M}function Ql(v){var E={"=":"=0",":":"=2"};return"$"+v.replace(/[=:]/g,function(O){return E[O]})}var zu=/\/+/g;function rt(v,E){return typeof v=="object"&&v!==null&&v.key!=null?Ql(""+v.key):E.toString(36)}function St(v){switch(v.status){case"fulfilled":return v.value;case"rejected":throw v.reason;default:switch(typeof v.status=="string"?v.then(Gl,Gl):(v.status="pending",v.then(function(E){v.status==="pending"&&(v.status="fulfilled",v.value=E)},function(E){v.status==="pending"&&(v.status="rejected",v.reason=E)})),v.status){case"fulfilled":return v.value;case"rejected":throw v.reason}}throw v}function b(v,E,O,U,Y){var X=typeof v;(X==="undefined"||X==="boolean")&&(v=null);var F=!1;if(v===null)F=!0;else switch(X){case"bigint":case"string":case"number":F=!0;break;case"object":switch(v.$$typeof){case M:case Sl:F=!0;break;case $:return F=v._init,b(F(v._payload),E,O,U,Y)}}if(F)return Y=Y(v),F=U===""?"."+rt(v,0):U,Tt(Y)?(O="",F!=null&&(O=F.replace(zu,"$&/")+"/"),b(Y,E,O,"",function(Oa){return Oa})):Y!=null&&(At(Y)&&(Y=Qu(Y,O+(Y.key==null||v&&v.key===Y.key?"":(""+Y.key).replace(zu,"$&/")+"/")+F)),E.push(Y)),1;F=0;var Cl=U===""?".":U+":";if(Tt(v))for(var dl=0;dl<v.length;dl++)U=v[dl],X=Cl+rt(U,dl),F+=b(U,E,O,X,Y);else if(dl=wl(v),typeof dl=="function")for(v=dl.call(v),dl=0;!(U=v.next()).done;)U=U.value,X=Cl+rt(U,dl++),F+=b(U,E,O,X,Y);else if(X==="object"){if(typeof v.then=="function")return b(St(v),E,O,U,Y);throw E=String(v),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return F}function _(v,E,O){if(v==null)return v;var U=[],Y=0;return b(v,U,"","",function(X){return E.call(O,X,Y++)}),U}function q(v){if(v._status===-1){var E=v._result;E=E(),E.then(function(O){(v._status===0||v._status===-1)&&(v._status=1,v._result=O)},function(O){(v._status===0||v._status===-1)&&(v._status=2,v._result=O)}),v._status===-1&&(v._status=0,v._result=E)}if(v._status===1)return v._result.default;throw v._result}var P=typeof reportError=="function"?reportError:function(v){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof v=="object"&&v!==null&&typeof v.message=="string"?String(v.message):String(v),error:v});if(!window.dispatchEvent(E))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",v);return}console.error(v)},el={map:_,forEach:function(v,E,O){_(v,function(){E.apply(this,arguments)},O)},count:function(v){var E=0;return _(v,function(){E++}),E},toArray:function(v){return _(v,function(E){return E})||[]},only:function(v){if(!At(v))throw Error("React.Children.only expected to receive a single React element child.");return v}};return C.Activity=R,C.Children=el,C.Component=Wl,C.Fragment=W,C.Profiler=al,C.PureComponent=Nl,C.StrictMode=o,C.Suspense=N,C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,C.__COMPILER_RUNTIME={__proto__:null,c:function(v){return x.H.useMemoCache(v)}},C.cache=function(v){return function(){return v.apply(null,arguments)}},C.cacheSignal=function(){return null},C.cloneElement=function(v,E,O){if(v==null)throw Error("The argumentLine truncated
* @license React
* scheduler.production.js
*
@@ -46,4 +46,4 @@ function ws(M,Sl){for(var W=0;W<Sl.length;W++){const o=Sl[W];if(typeof o!="strin
`+i[a].replace(" at new "," at ");return l.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",l.displayName)),g}while(1<=a&&0<=e);break}}}finally{Qn=!1,Error.prepareStackTrace=u}return(u=l?l.displayName||l.name:"")?Tu(u):""}function O1(l,t){switch(l.tag){case 26:case 27:case 5:return Tu(l.type);case 16:return Tu("Lazy");case 13:return l.child!==t&&t!==null?Tu("Suspense Fallback"):Tu("Suspense");case 19:return Tu("SuspenseList");case 0:case 15:return jn(l.type,!1);case 11:return jn(l.type.render,!1);case 1:return jn(l.type,!0);case 31:return Tu("Activity");default:return""}}function mi(l){try{var t="",u=null;do t+=O1(l,u),u=l,l=l.return;while(l);return t}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}var Zn=Object.prototype.hasOwnProperty,Vn=M.unstable_scheduleCallback,xn=M.unstable_cancelCallback,M1=M.unstable_shouldYield,D1=M.unstable_requestPaint,$l=M.unstable_now,U1=M.unstable_getCurrentPriorityLevel,si=M.unstable_ImmediatePriority,di=M.unstable_UserBlockingPriority,Te=M.unstable_NormalPriority,r1=M.unstable_LowPriority,hi=M.unstable_IdlePriority,H1=M.log,N1=M.unstable_setDisableYieldValue,Ma=null,Fl=null;function Wt(l){if(typeof H1=="function"&&N1(l),Fl&&typeof Fl.setStrictMode=="function")try{Fl.setStrictMode(Ma,l)}catch{}}var kl=Math.clz32?Math.clz32:q1,p1=Math.log,R1=Math.LN2;function q1(l){return l>>>=0,l===0?32:31-(p1(l)/R1|0)|0}var Ee=256,Ae=262144,_e=4194304;function Eu(l){var t=l&42;if(t!==0)return t;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Oe(l,t,u){var a=l.pendingLanes;if(a===0)return 0;var e=0,n=l.suspendedLanes,f=l.pingedLanes;l=l.warmLanes;var c=a&134217727;return c!==0?(a=c&~n,a!==0?e=Eu(a):(f&=c,f!==0?e=Eu(f):u||(u=c&~l,u!==0&&(e=Eu(u))))):(c=a&~n,c!==0?e=Eu(c):f!==0?e=Eu(f):u||(u=a&~l,u!==0&&(e=Eu(u)))),e===0?0:t!==0&&t!==e&&(t&n)===0&&(n=e&-e,u=t&-t,n>=u||n===32&&(u&4194048)!==0)?t:e}function Da(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function C1(l,t){switch(l){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 oi(){var l=_e;return _e<<=1,(_e&62914560)===0&&(_e=4194304),l}function Ln(l){for(var t=[],u=0;31>u;u++)t.push(l);return t}function Ua(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Y1(l,t,u,a,e,n){var f=l.pendingLanes;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=u,l.entangledLanes&=u,l.errorRecoveryDisabledLanes&=u,l.shellSuspendCounter=0;var c=l.entanglements,i=l.expirationTimes,d=l.hiddenUpdates;for(u=f&~u;0<u;){var g=31-kl(u),T=1<<g;c[g]=0,i[g]=-1;var h=d[g];if(h!==null)for(d[g]=null,g=0;g<h.length;g++){var S=h[g];S!==null&&(S.lane&=-536870913)}u&=~T}a!==0&&Si(l,a,0),n!==0&&e===0&&l.tag!==0&&(l.suspendedLanes|=n&~(f&~t))}function Si(l,t,u){l.pendingLanes|=t,l.suspendedLanes&=~t;var a=31-kl(t);l.entangledLanes|=t,l.entanglements[a]=l.entanglements[a]|1073741824|u&261930}function gi(l,t){var u=l.entangledLanes|=t;for(l=l.entanglements;u;){var a=31-kl(u),e=1<<a;e&t|l[a]&t&&(l[a]|=t),u&=~e}}function bi(l,t){var u=t&-t;return u=(u&42)!==0?1:Kn(u),(u&(l.suspendedLanes|t))!==0?0:u}function Kn(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=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:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function Jn(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function zi(){var l=_.p;return l!==0?l:(l=window.event,l===void 0?32:e1(l.type))}function Ti(l,t){var u=_.p;try{return _.p=l,t()}finally{_.p=u}}var $t=Math.random().toString(36).slice(2),Ml="__reactFiber$"+$t,jl="__reactProps$"+$t,ju="__reactContainer$"+$t,wn="__reactEvents$"+$t,B1="__reactListeners$"+$t,G1="__reactHandles$"+$t,Ei="__reactResources$"+$t,ra="__reactMarker$"+$t;function Wn(l){delete l[Ml],delete l[jl],delete l[wn],delete l[B1],delete l[G1]}function Zu(l){var t=l[Ml];if(t)return t;for(var u=l.parentNode;u;){if(t=u[ju]||u[Ml]){if(u=t.alternate,t.child!==null||u!==null&&u.child!==null)for(l=Vv(l);l!==null;){if(u=l[Ml])return u;l=Vv(l)}return t}l=u,u=l.parentNode}return null}function Vu(l){if(l=l[Ml]||l[ju]){var t=l.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return l}return null}function Ha(l){var t=l.tag;if(t===5||t===26||t===27||t===6)return l.stateNode;throw Error(o(33))}function xu(l){var t=l[Ei];return t||(t=l[Ei]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Al(l){l[ra]=!0}var Ai=new Set,_i={};function Au(l,t){Lu(l,t),Lu(l+"Capture",t)}function Lu(l,t){for(_i[l]=t,l=0;l<t.length;l++)Ai.add(t[l])}var X1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21 Line truncated
`).replace(os,"")}function Rv(l,t){return t=pv(t),pv(l)===t}function tl(l,t,u,a,e,n){switch(u){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ju(l,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ju(l,""+a);break;case"className":De(l,"class",a);break;case"tabIndex":De(l,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":De(l,u,a);break;case"style":Ri(l,a,n);break;case"data":if(t!=="object"){De(l,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||u!=="href")){l.removeAttribute(u);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){l.removeAttribute(u);break}a=re(""+a),l.setAttribute(u,a);break;case"action":case"formAction":if(typeof a=="function"){l.setAttribute(u,"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 n=="function"&&(u==="formAction"?(t!=="input"&&tl(l,t,"name",e.name,e,null),tl(l,t,"formEncType",e.formEncType,e,null),tl(l,t,"formMethod",e.formMethod,e,null),tl(l,t,"formTarget",e.formTarget,e,null)):(tl(l,t,"encType",e.encType,e,null),tl(l,t,"method",e.method,e,null),tl(l,t,"target",e.target,e,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){l.removeAttribute(u);break}a=re(""+a),l.setAttribute(u,a);break;case"onClick":a!=null&&(l.onclick=Nt);break;case"onScroll":a!=null&&j("scroll",l);break;case"onScrollEnd":a!=null&&j("scrollend",l);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(u=a.__html,u!=null){if(e.children!=null)throw Error(o(60));l.innerHTML=u}}break;case"multiple":l.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":l.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){l.removeAttribute("xlink:href");break}u=re(""+a),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?l.setAttribute(u,""+a):l.removeAttribute(u);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":a&&typeof a!="function"&&typeof a!="symbol"?l.setAttribute(u,""):l.removeAttribute(u);break;case"capture":case"download":a===!0?l.setAttribute(u,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?l.setAttribute(u,a):l.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?l.setAttribute(u,a):l.removeAttribute(u);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?l.removeAttribute(u):l.setAttribute(u,a);break;case"popover":j("beforetoggle",l),j("toggle",l),Me(l,"popover",a);break;case"xlinkActuate":Ht(l,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ht(l,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ht(l,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ht(l,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ht(l,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ht(l,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ht(l,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ht(l,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ht(l,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Me(l,"is",a);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=x1.get(u)||u,Me(l,u,a))}}function Qc(l,t,u,a,e,n){switch(u){case"style":Ri(l,a,n);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(u=a.__html,u!=null){if(e.children!=null)throw Error(o(60));l.innerHTML=u}}break;case"children":typeof a=="string"?Ju(l,a):(typeof a=="number"||typeof a=="bigint")&&Ju(l,""+a);break;case"onScroll":a!=null&&j("scroll",l);break;case"onScrollEnd":a!=null&&j("scrollend",l);break;case"onClick":a!=null&&(l.onclick=Nt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML" Line truncated
`).replace(os,"")}function Rv(l,t){return t=pv(t),pv(l)===t}function tl(l,t,u,a,e,n){switch(u){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ju(l,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ju(l,""+a);break;case"className":De(l,"class",a);break;case"tabIndex":De(l,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":De(l,u,a);break;case"style":Ri(l,a,n);break;case"data":if(t!=="object"){De(l,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||u!=="href")){l.removeAttribute(u);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){l.removeAttribute(u);break}a=re(""+a),l.setAttribute(u,a);break;case"action":case"formAction":if(typeof a=="function"){l.setAttribute(u,"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 n=="function"&&(u==="formAction"?(t!=="input"&&tl(l,t,"name",e.name,e,null),tl(l,t,"formEncType",e.formEncType,e,null),tl(l,t,"formMethod",e.formMethod,e,null),tl(l,t,"formTarget",e.formTarget,e,null)):(tl(l,t,"encType",e.encType,e,null),tl(l,t,"method",e.method,e,null),tl(l,t,"target",e.target,e,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){l.removeAttribute(u);break}a=re(""+a),l.setAttribute(u,a);break;case"onClick":a!=null&&(l.onclick=Nt);break;case"onScroll":a!=null&&j("scroll",l);break;case"onScrollEnd":a!=null&&j("scrollend",l);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(u=a.__html,u!=null){if(e.children!=null)throw Error(o(60));l.innerHTML=u}}break;case"multiple":l.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":l.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){l.removeAttribute("xlink:href");break}u=re(""+a),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?l.setAttribute(u,""+a):l.removeAttribute(u);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":a&&typeof a!="function"&&typeof a!="symbol"?l.setAttribute(u,""):l.removeAttribute(u);break;case"capture":case"download":a===!0?l.setAttribute(u,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?l.setAttribute(u,a):l.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?l.setAttribute(u,a):l.removeAttribute(u);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?l.removeAttribute(u):l.setAttribute(u,a);break;case"popover":j("beforetoggle",l),j("toggle",l),Me(l,"popover",a);break;case"xlinkActuate":Ht(l,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ht(l,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ht(l,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ht(l,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ht(l,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ht(l,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ht(l,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ht(l,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ht(l,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Me(l,"is",a);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=x1.get(u)||u,Me(l,u,a))}}function Qc(l,t,u,a,e,n){switch(u){case"style":Ri(l,a,n);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(u=a.__html,u!=null){if(e.children!=null)throw Error(o(60));l.innerHTML=u}}break;case"children":typeof a=="string"?Ju(l,a):(typeof a=="number"||typeof a=="bigint")&&Ju(l,""+a);break;case"onScroll":a!=null&&j("scroll",l);break;case"onScrollEnd":a!=null&&j("scrollend",l);break;case"onClick":a!=null&&(l.onclick=Nt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML" Line truncated
@@ -1,4 +1,4 @@
var Es=Object.defineProperty;var bs=(e,t,n)=>t in e?Es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mt=(e,t,n)=>bs(e,typeof t!="symbol"?t+"":t,n);import{r as ir,a as y,g as Ss,b as Ps}from"./react-vendor-l-BBvuKH.js";const Rs=/\{[^{}]+\}/g,Os=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function xs(){return Math.random().toString(36).slice(2,11)}function Fa(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:o,headers:s,requestInitExt:c=void 0,...u}={...e};c=Os()?c:void 0,t=Tr(t);const f=[];async function a(l,p){const{baseUrl:h,fetch:m=r,Request:d=n,headers:g,params:_={},parseAs:E="json",querySerializer:b,bodySerializer:w=o??Ns,body:v,...R}=p||{};let S=t;h&&(S=Tr(h)??t);let C=typeof i=="function"?i:Mr(i);b&&(C=typeof b=="function"?b:Mr({...typeof i=="object"?i:{},...b}));const O=v===void 0?void 0:w(v,Lr(s,g,_.header)),q=Lr(O===void 0||O instanceof FormData?{}:{"Content-Type":"application/json"},s,g,_.header),F={redirect:"follow",...u,...R,body:O,headers:q};let M,N,I=new n(Cs(l,{baseUrl:S,params:_,querySerializer:C}),F),A;for(const L in R)L in I||(I[L]=R[L]);if(f.length){M=xs(),N=Object.freeze({baseUrl:S,fetch:m,parseAs:E,querySerializer:C,bodySerializer:w});for(const L of f)if(L&&typeof L=="object"&&typeof L.onRequest=="function"){const W=await L.onRequest({request:I,schemaPath:l,params:_,options:N,id:M});if(W)if(W instanceof n)I=W;else if(W instanceof Response){A=W;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!A){try{A=await m(I,c)}catch(L){let W=L;if(f.length)for(let te=f.length-1;te>=0;te--){const be=f[te];if(be&&typeof be=="object"&&typeof be.onError=="function"){const Z=await be.onError({request:I,error:W,schemaPath:l,params:_,options:N,id:M});if(Z){if(Z instanceof Response){W=void 0,A=Z;break}if(Z instanceof Error){W=Z;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(W)throw W}if(f.length)for(let L=f.length-1;L>=0;L--){const W=f[L];if(W&&typeof W=="object"&&typeof W.onResponse=="function"){const te=await W.onResponse({request:I,response:A,schemaPath:l,params:_,options:N,id:M});if(te){if(!(te instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");A=te}}}}if(A.status===204||I.method==="HEAD"||A.headers.get("Content-Length")==="0")return A.ok?{data:void 0,response:A}:{error:void 0,response:A};if(A.ok)return E==="stream"?{data:A.body,response:A}:{data:await A[E](),response:A};let B=await A.text();try{B=JSON.parse(B)}catch{}return{error:B,response:A}}return{request(l,p,h){return a(p,{...h,method:l.toUpperCase()})},GET(l,p){return a(l,{...p,method:"GET"})},PUT(l,p){return a(l,{...p,method:"PUT"})},POST(l,p){return a(l,{...p,method:"POST"})},DELETE(l,p){return a(l,{...p,method:"DELETE"})},OPTIONS(l,p){return a(l,{...p,method:"OPTIONS"})},HEAD(l,p){return a(l,{...p,method:"HEAD"})},PATCH(l,p){return a(l,{...p,method:"PATCH"})},TRACE(l,p){return a(l,{...p,method:"TRACE"})},use(...l){for(const p of l)if(p){if(typeof p!="object"||!("onRequest"in p||"onResponse"in p||"onError"in p))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");f.push(p)}},eject(...l){for(const p of l){const h=f.indexOf(p);h!==-1&&f.splice(h,1)}}}}function Ut(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function Mi(e,t,n){if(!t||typeof t!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const c in t)r.push(c,n.allowReserved===!0?t[c]:encodeURIComponent(t[c]));const s=r.join(",");switch(n.style){case"form":return`${e}=${s}`;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return s}}for(const s in t){const c=n.style==="deepObject"?`${e}[${s}]`:s;r.push(Ut(c,t[s],n))}const o=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${o}`:o}function Li(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",s=(n.allowReserved===!0?t:t.map(c=>encodeURIComponent(c))).join(o);switch(n.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return`${e}=${s}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const o of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?o:encodeURIComponent(o)):i.push(Ut(e,o,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function Mr(e){return function(n){const r=[];if(n&&typeof n=="object")for(const i in n){const o=n[i];if(o!Line truncated
var Es=Object.defineProperty;var bs=(e,t,n)=>t in e?Es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mt=(e,t,n)=>bs(e,typeof t!="symbol"?t+"":t,n);import{r as ir,a as y,g as Ss,b as Ps}from"./react-vendor-Bf9ELcll.js";const Rs=/\{[^{}]+\}/g,Os=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function xs(){return Math.random().toString(36).slice(2,11)}function Fa(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:o,headers:s,requestInitExt:c=void 0,...u}={...e};c=Os()?c:void 0,t=Tr(t);const f=[];async function a(l,p){const{baseUrl:h,fetch:m=r,Request:d=n,headers:g,params:_={},parseAs:E="json",querySerializer:b,bodySerializer:w=o??Ns,body:v,...R}=p||{};let S=t;h&&(S=Tr(h)??t);let C=typeof i=="function"?i:Mr(i);b&&(C=typeof b=="function"?b:Mr({...typeof i=="object"?i:{},...b}));const O=v===void 0?void 0:w(v,Lr(s,g,_.header)),q=Lr(O===void 0||O instanceof FormData?{}:{"Content-Type":"application/json"},s,g,_.header),F={redirect:"follow",...u,...R,body:O,headers:q};let M,N,I=new n(Cs(l,{baseUrl:S,params:_,querySerializer:C}),F),A;for(const L in R)L in I||(I[L]=R[L]);if(f.length){M=xs(),N=Object.freeze({baseUrl:S,fetch:m,parseAs:E,querySerializer:C,bodySerializer:w});for(const L of f)if(L&&typeof L=="object"&&typeof L.onRequest=="function"){const W=await L.onRequest({request:I,schemaPath:l,params:_,options:N,id:M});if(W)if(W instanceof n)I=W;else if(W instanceof Response){A=W;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!A){try{A=await m(I,c)}catch(L){let W=L;if(f.length)for(let te=f.length-1;te>=0;te--){const be=f[te];if(be&&typeof be=="object"&&typeof be.onError=="function"){const Z=await be.onError({request:I,error:W,schemaPath:l,params:_,options:N,id:M});if(Z){if(Z instanceof Response){W=void 0,A=Z;break}if(Z instanceof Error){W=Z;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(W)throw W}if(f.length)for(let L=f.length-1;L>=0;L--){const W=f[L];if(W&&typeof W=="object"&&typeof W.onResponse=="function"){const te=await W.onResponse({request:I,response:A,schemaPath:l,params:_,options:N,id:M});if(te){if(!(te instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");A=te}}}}if(A.status===204||I.method==="HEAD"||A.headers.get("Content-Length")==="0")return A.ok?{data:void 0,response:A}:{error:void 0,response:A};if(A.ok)return E==="stream"?{data:A.body,response:A}:{data:await A[E](),response:A};let B=await A.text();try{B=JSON.parse(B)}catch{}return{error:B,response:A}}return{request(l,p,h){return a(p,{...h,method:l.toUpperCase()})},GET(l,p){return a(l,{...p,method:"GET"})},PUT(l,p){return a(l,{...p,method:"PUT"})},POST(l,p){return a(l,{...p,method:"POST"})},DELETE(l,p){return a(l,{...p,method:"DELETE"})},OPTIONS(l,p){return a(l,{...p,method:"OPTIONS"})},HEAD(l,p){return a(l,{...p,method:"HEAD"})},PATCH(l,p){return a(l,{...p,method:"PATCH"})},TRACE(l,p){return a(l,{...p,method:"TRACE"})},use(...l){for(const p of l)if(p){if(typeof p!="object"||!("onRequest"in p||"onResponse"in p||"onError"in p))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");f.push(p)}},eject(...l){for(const p of l){const h=f.indexOf(p);h!==-1&&f.splice(h,1)}}}}function Ut(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function Mi(e,t,n){if(!t||typeof t!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const c in t)r.push(c,n.allowReserved===!0?t[c]:encodeURIComponent(t[c]));const s=r.join(",");switch(n.style){case"form":return`${e}=${s}`;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return s}}for(const s in t){const c=n.style==="deepObject"?`${e}[${s}]`:s;r.push(Ut(c,t[s],n))}const o=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${o}`:o}function Li(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",s=(n.allowReserved===!0?t:t.map(c=>encodeURIComponent(c))).join(o);switch(n.style){case"simple":return s;case"label":return`.${s}`;case"matrix":return`;${e}=${s}`;default:return`${e}=${s}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const o of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?o:encodeURIComponent(o)):i.push(Ut(e,o,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function Mr(e){return function(n){const r=[];if(n&&typeof n=="object")for(const i in n){const o=n[i];if(o!Line truncated
* @license React
* use-sync-external-store-shim.production.js
*
+5 -5
View File
@@ -6,12 +6,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ydisks闲鱼助手 - 自动发货与管家系统</title>
<meta name="description" content="Ydisks闲鱼助手 - 自动回复、自动发货、订单管理、AI智能议价一体化解决方案" />
<script type="module" crossorigin src="/static/assets/index-2BJ5Kkse.js"></script>
<link rel="modulepreload" crossorigin href="/static/assets/react-vendor-l-BBvuKH.js">
<link rel="modulepreload" crossorigin href="/static/assets/vendor-cRYyTeIw.js">
<link rel="modulepreload" crossorigin href="/static/assets/icons-vendor-CIGXYOCp.js">
<script type="module" crossorigin src="/static/assets/index-BcKVxEYs.js"></script>
<link rel="modulepreload" crossorigin href="/static/assets/react-vendor-Bf9ELcll.js">
<link rel="modulepreload" crossorigin href="/static/assets/vendor-BE-_xUHH.js">
<link rel="modulepreload" crossorigin href="/static/assets/icons-vendor-B5fJPoU1.js">
<link rel="stylesheet" crossorigin href="/static/assets/vendor-DUblxfbA.css">
<link rel="stylesheet" crossorigin href="/static/assets/index-6EQ70kIK.css">
<link rel="stylesheet" crossorigin href="/static/assets/index-ITqHo9y-.css">
</head>
<body>
<div id="root"></div>