Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

build(web): 入口给 chunk 的导出保留源码名,chunk 哈希只随自身内容变化

longmeidaode0c478faffa
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 6c56ba418..a192014ab 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -49,6 +49,9 @@ export default defineConfig({
// chunk 与入口同前缀、平铺在 `web/dist/`:服务端只认这一种形态,名字里没有路径分隔符。
chunkFileNames: 'peach-app.[name]-[hash].js',
codeSplitting: { groups: [{ name: 'main', tags: ['$initial'] }] },
+ // 入口给 chunk 的导出用源码里的名字:压缩成单字母的话,入口里任何改动都会让导出名整体错位,
+ // 每个 chunk 的内容与哈希跟着变,一次小改动换掉 `web/dist/` 里全部 chunk。
+ minifyInternalExports: false,
assetFileNames: 'peach-app.[ext]',
},
},
diff --git a/web/dist/peach-app.activity-page-C4wPG0cW.js b/web/dist/peach-app.activity-page-C4wPG0cW.js
deleted file mode 100644
index 0fb33e46b..000000000
--- a/web/dist/peach-app.activity-page-C4wPG0cW.js
+++ /dev/null
@@ -1,373 +0,0 @@
-(function() {
- try {
- var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "bb93b80f-2b78-4d32-8341-6b8a062829a6", e._sentryDebugIdIdentifier = "sentry-dbid-bb93b80f-2b78-4d32-8341-6b8a062829a6");
- } catch {}
-})();
-import { As as e, Ba as t, Bo as n, Bs as r, Cs as i, Ds as a, Es as o, Fs as s, Gl as c, Is as l, Ls as u, Ms as d, Ns as f, Os as p, Ps as m, Ro as ee, Ss as h, Ts as te, Ul as g, Va as _, Vs as v, Wa as y, Wl as b, X as x, Yo as S, au as C, cu as w, fs as T, hn as E, iu as D, js as O, ks as k, oo as ne, pu as A, ro as j, so as M, su as N, uu as P, ws as F, xa as I, xs as re, za as L, zs as R } from "./peach-app.js";
-import { t as z } from "./peach-app.code-block-De9b0xOF.js";
-import { t as B } from "./peach-app.page-BYr6f5ud.js";
-import { n as V, t as H } from "./peach-app.error-excerpt-5tEehQuQ.js";
-//#region src/react/activity/background-issues.tsx
-var U = /* @__PURE__ */ A(P(), 1), W = w(), G = ["background-issues"];
-function K() {
- let e = (0, U.useId)(), t = C({
- queryKey: G,
- queryFn: ({ signal: e }) => g("/api/background-issues", e),
- refetchInterval: 3e4
- }).data?.issues || [];
- return t.length ? /* @__PURE__ */ (0, W.jsxs)("section", {
- "aria-labelledby": e,
- className: "flex min-w-0 flex-col gap-3",
- children: [/* @__PURE__ */ (0, W.jsx)("h3", {
- id: e,
- className: "text-title-2-medium text-text-primary",
- children: "需要处理"
- }), /* @__PURE__ */ (0, W.jsx)("ul", {
- className: "flex min-w-0 flex-col gap-3",
- children: t.map((e) => /* @__PURE__ */ (0, W.jsx)("li", { children: /* @__PURE__ */ (0, W.jsx)(q, { issue: e }) }, e.key))
- })]
- }) : null;
-}
-function q({ issue: e }) {
- let t = N(), r = D({
- mutationFn: () => b(e.retry, {}),
- onSuccess: () => {
- t.invalidateQueries({ queryKey: G });
- }
- }), i = e.since ? `自 ${m(e.since)} 起` : `发现于 ${m(e.noticed_at)}`;
- return /* @__PURE__ */ (0, W.jsx)(M, {
- tone: "error",
- title: e.title,
- action: /* @__PURE__ */ (0, W.jsxs)("div", {
- className: "flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, W.jsx)(y, {
- href: e.href,
- size: "small",
- trailingIcon: n,
- children: e.link_label
- }), e.retry ? /* @__PURE__ */ (0, W.jsx)(T, {
- variant: "secondary",
- size: "small",
- disabled: !e.retry_available,
- ...j(r.isPending),
- onClick: () => r.mutate(),
- children: "立即重试"
- }) : null]
- }),
- children: r.error ? `${i}\n没有重试:${c(r.error)}` : i
- });
-}
-//#endregion
-//#region src/react/activity/activity-page.tsx
-var J = {
- succeeded: "lime",
- failed: "rose",
- cancelled: "neutral",
- interrupted: "yellow",
- running: "blue",
- pending: "neutral"
-};
-function Y({ run: e }) {
- let t = e.status === "succeeded" && k(e);
- return /* @__PURE__ */ (0, W.jsx)(E, {
- color: t ? "yellow" : J[e.status] ?? "neutral",
- children: t ? "发现问题" : R(e.status)
- });
-}
-function ie({ rows: e }) {
- return /* @__PURE__ */ (0, W.jsx)("ul", {
- className: "flex min-w-0 flex-col",
- children: e.map((e) => {
- let t = a(e);
- return /* @__PURE__ */ (0, W.jsxs)("li", {
- "data-status": e.status,
- "data-followup-key": e.followup_key,
- className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 border-t border-separator-border px-5 py-2.5",
- children: [
- /* @__PURE__ */ (0, W.jsx)("span", {
- className: "min-w-0 break-words text-caption-1-regular text-text-primary",
- children: e.task_label
- }),
- /* @__PURE__ */ (0, W.jsx)(Y, { run: e }),
- t ? /* @__PURE__ */ (0, W.jsx)("span", {
- className: "min-w-0 break-words text-caption-1-regular text-text-secondary",
- children: t
- }) : null,
- /* @__PURE__ */ (0, W.jsx)("div", {
- className: "w-full min-w-0",
- children: /* @__PURE__ */ (0, W.jsx)(I, {
- summary: "技术详情",
- contentClassName: "pb-2.5",
- children: /* @__PURE__ */ (0, W.jsx)(z, {
- code: JSON.stringify(e.result_summary, null, 2),
- language: "json",
- label: `${e.task_label}技术详情`
- })
- })
- })
- ]
- }, e.id);
- })
- });
-}
-function X({ run: t, meta: n, children: r, footer: i, followups: a }) {
- return /* @__PURE__ */ (0, W.jsxs)("li", {
- id: `run-${t.id}`,
- "data-status": t.status,
- "data-task-key": t.task_key,
- "data-run-id": t.id,
- className: _({
- padding: "none",
- bordered: "line",
- className: t.status === "failed" ? "flex flex-col border-border-error-default" : "flex flex-col"
- }),
- children: [
- /* @__PURE__ */ (0, W.jsxs)("div", {
- className: "flex flex-col gap-1.5 px-5 pt-5 pb-4",
- children: [
- /* @__PURE__ */ (0, W.jsxs)("div", {
- className: "flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, W.jsx)("strong", {
- className: "min-w-0 break-words text-title-1-medium text-text-primary",
- children: t.task_label
- }), /* @__PURE__ */ (0, W.jsx)(Y, { run: t })]
- }),
- /* @__PURE__ */ (0, W.jsx)("p", {
- className: "text-caption-1-regular text-text-secondary",
- children: n
- }),
- r
- ]
- }),
- a?.length ? /* @__PURE__ */ (0, W.jsx)("div", {
- className: "border-t border-separator-border px-5 py-2.5",
- children: /* @__PURE__ */ (0, W.jsx)(I, {
- summary: `任务明细 · ${a.length} 项`,
- contentClassName: "pb-2.5",
- defaultOpen: a.some((t) => e(t)),
- children: /* @__PURE__ */ (0, W.jsx)(ie, { rows: a })
- })
- }) : null,
- Object.keys(t.result_summary || {}).length ? /* @__PURE__ */ (0, W.jsx)("div", {
- className: "border-t border-separator-border px-5 py-2.5",
- children: /* @__PURE__ */ (0, W.jsx)(I, {
- summary: "技术详情",
- contentClassName: "pb-2.5",
- children: /* @__PURE__ */ (0, W.jsx)(z, {
- code: JSON.stringify(t.result_summary, null, 2),
- language: "json",
- label: `${t.task_label}技术详情`
- })
- })
- }) : null,
- i ? /* @__PURE__ */ (0, W.jsx)("div", {
- className: "flex min-h-14 flex-col justify-center rounded-b-2xl border-t border-separator-border bg-card-footer px-5 py-3",
- children: /* @__PURE__ */ (0, W.jsx)(V, {
- text: i,
- className: "text-caption-1-regular text-text-secondary"
- })
- }) : null
- ]
- });
-}
-function ae({ run: e, followups: n }) {
- let r = e.progress_total || 0, a = e.progress_current || 0, o = e.progress_label || "正在进行", s = i(e.elapsed_seconds), c = [h[e.trigger] || e.trigger, s && `已跑 ${s}`].filter(Boolean).join(" · ");
- return /* @__PURE__ */ (0, W.jsx)(X, {
- run: e,
- meta: c,
- followups: n,
- children: r > 0 ? /* @__PURE__ */ (0, W.jsxs)("div", {
- className: "flex flex-col gap-1.5",
- children: [/* @__PURE__ */ (0, W.jsx)(L, {
- label: o,
- value: Math.min(a, r),
- max: r
- }), /* @__PURE__ */ (0, W.jsxs)("p", {
- className: "text-caption-1-regular text-text-secondary wrap-anywhere",
- children: [
- o,
- " · ",
- u(a, r),
- " 项"
- ]
- })]
- }) : /* @__PURE__ */ (0, W.jsx)(t, { label: o })
- });
-}
-function Z({ run: e, followups: t, runs: a, latest: o }) {
- let s = r(e.result_summary).filter((t) => t !== e.error), c = v(e), u = l(e, o), d = i(e.elapsed_seconds), f = a && a.length > 1 ? a[a.length - 1] : void 0, p = (f ? [
- h[e.trigger] || e.trigger,
- `近 ${a.length} 轮`,
- `${m(f.finished_at)} – ${m(e.finished_at)}`
- ] : [
- h[e.trigger] || e.trigger,
- m(e.finished_at),
- d && `用时 ${d}`
- ]).filter(Boolean).join(" · ");
- return /* @__PURE__ */ (0, W.jsxs)(X, {
- run: e,
- meta: p,
- footer: e.error,
- followups: t,
- children: [
- s.length ? /* @__PURE__ */ (0, W.jsx)("ul", {
- className: "list-disc space-y-1 pl-5 text-caption-1-regular text-text-secondary wrap-anywhere",
- children: s.map((e, t) => /* @__PURE__ */ (0, W.jsx)("li", { children: e }, t))
- }) : null,
- c.length ? /* @__PURE__ */ (0, W.jsx)(I, {
- summary: `问题详情 · ${c.length} 项`,
- contentClassName: "pt-2",
- children: /* @__PURE__ */ (0, W.jsx)(H, {
- label: "任务问题详情",
- children: /* @__PURE__ */ (0, W.jsx)("ul", {
- className: "flex min-w-0 flex-col gap-3",
- "data-task-issues": "",
- children: c.map((e, t) => /* @__PURE__ */ (0, W.jsxs)("li", {
- className: "flex min-w-0 flex-col gap-1 text-body-2-regular wrap-anywhere",
- children: [/* @__PURE__ */ (0, W.jsx)("p", {
- className: "text-body-regular text-text-primary",
- children: [
- e.label,
- e.provider,
- e.kind
- ].filter(Boolean).join(" · ")
- }), /* @__PURE__ */ (0, W.jsx)(V, {
- text: e.error,
- className: "text-text-primary"
- })]
- }, `${e.source}-${t}`))
- })
- })
- }) : k(e) && ["follow-check", "feed-check"].includes(e.task_key) ? /* @__PURE__ */ (0, W.jsx)("p", {
- className: "text-body-2-regular text-text-secondary",
- children: "未取得本轮逐项详情,可到来源列表查看检查结果。"
- }) : null,
- u ? /* @__PURE__ */ (0, W.jsx)(y, {
- href: u.href,
- size: "small",
- trailingIcon: n,
- className: "self-start",
- children: u.label
- }) : null
- ]
- });
-}
-function Q({ title: e, children: t }) {
- let n = (0, U.useId)();
- return /* @__PURE__ */ (0, W.jsxs)("section", {
- "aria-labelledby": n,
- className: "flex min-w-0 flex-col gap-3",
- children: [/* @__PURE__ */ (0, W.jsx)("h3", {
- id: n,
- className: "text-title-2-medium text-text-primary",
- children: e
- }), t]
- });
-}
-function $({ live: e = !1, children: t }) {
- return /* @__PURE__ */ (0, W.jsx)("ul", {
- "aria-live": e ? "polite" : void 0,
- className: "flex min-w-0 flex-col gap-3",
- children: t
- });
-}
-function oe() {
- let t = C({
- queryKey: re,
- queryFn: ({ signal: e }) => te(e),
- refetchInterval: (e) => s(e.state.data)
- }), n = t.data, r = n?.finished, [i, a] = (0, U.useState)([]), [l, u] = (0, U.useState)(!1), [m, h] = (0, U.useState)(r);
- r !== m && (h(r), i.length && m && a(f(i, m)));
- let g = D({
- mutationFn: ({ oldest: e }) => F(e),
- onSuccess: (e, { shown: t }) => {
- a((n) => f(n, t, e.finished || [])), u(!!e.finished_has_more);
- }
- }), _ = t.error ? c(t.error) : "";
- if (!n) return /* @__PURE__ */ (0, W.jsx)(B, { children: /* @__PURE__ */ (0, W.jsx)(M, {
- tone: "error",
- children: _ || "读取任务中心失败"
- }) });
- let v = f(n.finished || [], i), y = [
- ...n.running || [],
- ...n.skipped || [],
- ...v
- ], b = p(y), w = new Set(y.map((e) => e.id)), E = (e) => e.filter((e) => !(e.followup_key && e.parent_run_id != null && w.has(e.parent_run_id))), k = E(v), A = k[k.length - 1], N = !!A && (i.length ? l : !!n.finished_has_more), P = () => {
- !g.isPending && A && g.mutate({
- oldest: A,
- shown: v
- });
- }, I = k.filter((t) => b.get(t.id)?.some(e)), L = E(n.running || []), R = E(n.skipped || []), z = k.filter((e) => !I.includes(e) && !R.some((t) => t.id === e.id)), V = o(z, (e) => O(e) && !b.get(e.id)?.length), H = d(y), G = !L.length && !I.length && !R.length && !z.length;
- return /* @__PURE__ */ (0, W.jsxs)(B, { children: [
- _ ? /* @__PURE__ */ (0, W.jsx)(M, {
- tone: "error",
- children: _
- }) : null,
- n.available === !1 ? /* @__PURE__ */ (0, W.jsx)(M, {
- tone: "warning",
- children: n.message || "数据库尚未准备好任务记录表"
- }) : null,
- /* @__PURE__ */ (0, W.jsx)(K, {}),
- G ? /* @__PURE__ */ (0, W.jsx)(ne, {
- icon: S,
- title: "还没有任务记录",
- children: "扫描、追更检查、批量操作和命令行批处理跑起来之后,这里会显示它们的进度与结果。"
- }) : /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [
- /* @__PURE__ */ (0, W.jsx)(Q, {
- title: "正在进行",
- children: L.length || I.length ? /* @__PURE__ */ (0, W.jsxs)($, {
- live: !0,
- children: [L.map((e) => /* @__PURE__ */ (0, W.jsx)(ae, {
- run: e,
- followups: b.get(e.id)
- }, e.id)), I.map((e) => /* @__PURE__ */ (0, W.jsx)(Z, {
- run: e,
- latest: H.has(e.id),
- followups: b.get(e.id)
- }, e.id))]
- }) : /* @__PURE__ */ (0, W.jsx)(M, {
- tone: "neutral",
- children: "没有任务在跑。"
- })
- }),
- R.length ? /* @__PURE__ */ (0, W.jsx)(Q, {
- title: "本次未执行",
- children: /* @__PURE__ */ (0, W.jsx)($, { children: R.map((e) => /* @__PURE__ */ (0, W.jsx)(Z, {
- run: e,
- latest: H.has(e.id),
- followups: b.get(e.id)
- }, e.id)) })
- }) : null,
- z.length || N ? /* @__PURE__ */ (0, W.jsxs)(Q, {
- title: "最近完成",
- children: [
- z.length ? /* @__PURE__ */ (0, W.jsx)($, { children: V.map(({ run: e, runs: t }) => /* @__PURE__ */ (0, W.jsx)(Z, {
- run: e,
- runs: t,
- latest: H.has(e.id),
- followups: b.get(e.id)
- }, e.id)) }) : null,
- g.error ? /* @__PURE__ */ (0, W.jsx)(M, {
- tone: "error",
- children: c(g.error)
- }) : null,
- N ? /* @__PURE__ */ (0, W.jsx)(T, {
- variant: "secondary",
- size: "small",
- leadingIcon: ee,
- className: "self-start",
- ...j(g.isPending),
- onClick: P,
- children: "加载更早"
- }) : null
- ]
- }) : null
- ] }),
- /* @__PURE__ */ (0, W.jsx)(x, {})
- ] });
-}
-//#endregion
-export { oe as ActivityPage };
-
-//# debugId=bb93b80f-2b78-4d32-8341-6b8a062829a6
\ No newline at end of file
diff --git a/web/dist/peach-app.activity-page-ClyZLUeQ.js b/web/dist/peach-app.activity-page-ClyZLUeQ.js
new file mode 100644
index 000000000..81ccf6da7
--- /dev/null
+++ b/web/dist/peach-app.activity-page-ClyZLUeQ.js
@@ -0,0 +1,373 @@
+(function() {
+ try {
+ var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "cd935c10-0d1c-4516-b106-7e429c6ec869", e._sentryDebugIdIdentifier = "sentry-dbid-cd935c10-0d1c-4516-b106-7e429c6ec869");
+ } catch {}
+})();
+import { Button as e, Chip as t, Disclosure as n, DownloadsPanel as r, EmptyState as i, LinkButton as a, LoadingDots as o, Note as s, Progress as c, TASKS_KEY as l, TRIGGER_LABELS as u, __toESM as d, apiGet as f, apiSend as p, busyProps as m, cardClass as h, elapsedText as g, errorMessage as _, f1 as v, fetchEarlier as y, fetchTasks as b, foldRoutine as x, followupDetail as S, groupFollowups as C, hasResultProblems as w, i2 as T, isActive as E, isRoutine as D, latestOfKind as ee, mergeFinished as O, momentText as k, pollInterval as A, problemDestination as j, progressText as M, require_jsx_runtime as N, require_react as P, statusLabel as F, summaryItems as I, taskIssues as L, uo as R, useMutation as z, useQuery as B, useQueryClient as V } from "./peach-app.js";
+import { CodeBlock as H } from "./peach-app.code-block-CuHUqiH3.js";
+import { Page as U } from "./peach-app.page-Irl_Wogd.js";
+import { ErrorDetails as W, ErrorExcerpt as G } from "./peach-app.error-excerpt-GIDhsLJp.js";
+//#region src/react/activity/background-issues.tsx
+var K = /* @__PURE__ */ d(P(), 1), q = N(), J = ["background-issues"];
+function te() {
+ let e = (0, K.useId)(), t = B({
+ queryKey: J,
+ queryFn: ({ signal: e }) => f("/api/background-issues", e),
+ refetchInterval: 3e4
+ }).data?.issues || [];
+ return t.length ? /* @__PURE__ */ (0, q.jsxs)("section", {
+ "aria-labelledby": e,
+ className: "flex min-w-0 flex-col gap-3",
+ children: [/* @__PURE__ */ (0, q.jsx)("h3", {
+ id: e,
+ className: "text-title-2-medium text-text-primary",
+ children: "需要处理"
+ }), /* @__PURE__ */ (0, q.jsx)("ul", {
+ className: "flex min-w-0 flex-col gap-3",
+ children: t.map((e) => /* @__PURE__ */ (0, q.jsx)("li", { children: /* @__PURE__ */ (0, q.jsx)(ne, { issue: e }) }, e.key))
+ })]
+ }) : null;
+}
+function ne({ issue: t }) {
+ let n = V(), r = z({
+ mutationFn: () => p(t.retry, {}),
+ onSuccess: () => {
+ n.invalidateQueries({ queryKey: J });
+ }
+ }), i = t.since ? `自 ${k(t.since)} 起` : `发现于 ${k(t.noticed_at)}`;
+ return /* @__PURE__ */ (0, q.jsx)(s, {
+ tone: "error",
+ title: t.title,
+ action: /* @__PURE__ */ (0, q.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-2",
+ children: [/* @__PURE__ */ (0, q.jsx)(a, {
+ href: t.href,
+ size: "small",
+ trailingIcon: T,
+ children: t.link_label
+ }), t.retry ? /* @__PURE__ */ (0, q.jsx)(e, {
+ variant: "secondary",
+ size: "small",
+ disabled: !t.retry_available,
+ ...m(r.isPending),
+ onClick: () => r.mutate(),
+ children: "立即重试"
+ }) : null]
+ }),
+ children: r.error ? `${i}\n没有重试:${_(r.error)}` : i
+ });
+}
+//#endregion
+//#region src/react/activity/activity-page.tsx
+var re = {
+ succeeded: "lime",
+ failed: "rose",
+ cancelled: "neutral",
+ interrupted: "yellow",
+ running: "blue",
+ pending: "neutral"
+};
+function Y({ run: e }) {
+ let n = e.status === "succeeded" && w(e);
+ return /* @__PURE__ */ (0, q.jsx)(t, {
+ color: n ? "yellow" : re[e.status] ?? "neutral",
+ children: n ? "发现问题" : F(e.status)
+ });
+}
+function ie({ rows: e }) {
+ return /* @__PURE__ */ (0, q.jsx)("ul", {
+ className: "flex min-w-0 flex-col",
+ children: e.map((e) => {
+ let t = S(e);
+ return /* @__PURE__ */ (0, q.jsxs)("li", {
+ "data-status": e.status,
+ "data-followup-key": e.followup_key,
+ className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 border-t border-separator-border px-5 py-2.5",
+ children: [
+ /* @__PURE__ */ (0, q.jsx)("span", {
+ className: "min-w-0 break-words text-caption-1-regular text-text-primary",
+ children: e.task_label
+ }),
+ /* @__PURE__ */ (0, q.jsx)(Y, { run: e }),
+ t ? /* @__PURE__ */ (0, q.jsx)("span", {
+ className: "min-w-0 break-words text-caption-1-regular text-text-secondary",
+ children: t
+ }) : null,
+ /* @__PURE__ */ (0, q.jsx)("div", {
+ className: "w-full min-w-0",
+ children: /* @__PURE__ */ (0, q.jsx)(n, {
+ summary: "技术详情",
+ contentClassName: "pb-2.5",
+ children: /* @__PURE__ */ (0, q.jsx)(H, {
+ code: JSON.stringify(e.result_summary, null, 2),
+ language: "json",
+ label: `${e.task_label}技术详情`
+ })
+ })
+ })
+ ]
+ }, e.id);
+ })
+ });
+}
+function X({ run: e, meta: t, children: r, footer: i, followups: a }) {
+ return /* @__PURE__ */ (0, q.jsxs)("li", {
+ id: `run-${e.id}`,
+ "data-status": e.status,
+ "data-task-key": e.task_key,
+ "data-run-id": e.id,
+ className: h({
+ padding: "none",
+ bordered: "line",
+ className: e.status === "failed" ? "flex flex-col border-border-error-default" : "flex flex-col"
+ }),
+ children: [
+ /* @__PURE__ */ (0, q.jsxs)("div", {
+ className: "flex flex-col gap-1.5 px-5 pt-5 pb-4",
+ children: [
+ /* @__PURE__ */ (0, q.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-2",
+ children: [/* @__PURE__ */ (0, q.jsx)("strong", {
+ className: "min-w-0 break-words text-title-1-medium text-text-primary",
+ children: e.task_label
+ }), /* @__PURE__ */ (0, q.jsx)(Y, { run: e })]
+ }),
+ /* @__PURE__ */ (0, q.jsx)("p", {
+ className: "text-caption-1-regular text-text-secondary",
+ children: t
+ }),
+ r
+ ]
+ }),
+ a?.length ? /* @__PURE__ */ (0, q.jsx)("div", {
+ className: "border-t border-separator-border px-5 py-2.5",
+ children: /* @__PURE__ */ (0, q.jsx)(n, {
+ summary: `任务明细 · ${a.length} 项`,
+ contentClassName: "pb-2.5",
+ defaultOpen: a.some((e) => E(e)),
+ children: /* @__PURE__ */ (0, q.jsx)(ie, { rows: a })
+ })
+ }) : null,
+ Object.keys(e.result_summary || {}).length ? /* @__PURE__ */ (0, q.jsx)("div", {
+ className: "border-t border-separator-border px-5 py-2.5",
+ children: /* @__PURE__ */ (0, q.jsx)(n, {
+ summary: "技术详情",
+ contentClassName: "pb-2.5",
+ children: /* @__PURE__ */ (0, q.jsx)(H, {
+ code: JSON.stringify(e.result_summary, null, 2),
+ language: "json",
+ label: `${e.task_label}技术详情`
+ })
+ })
+ }) : null,
+ i ? /* @__PURE__ */ (0, q.jsx)("div", {
+ className: "flex min-h-14 flex-col justify-center rounded-b-2xl border-t border-separator-border bg-card-footer px-5 py-3",
+ children: /* @__PURE__ */ (0, q.jsx)(G, {
+ text: i,
+ className: "text-caption-1-regular text-text-secondary"
+ })
+ }) : null
+ ]
+ });
+}
+function ae({ run: e, followups: t }) {
+ let n = e.progress_total || 0, r = e.progress_current || 0, i = e.progress_label || "正在进行", a = g(e.elapsed_seconds), s = [u[e.trigger] || e.trigger, a && `已跑 ${a}`].filter(Boolean).join(" · ");
+ return /* @__PURE__ */ (0, q.jsx)(X, {
+ run: e,
+ meta: s,
+ followups: t,
+ children: n > 0 ? /* @__PURE__ */ (0, q.jsxs)("div", {
+ className: "flex flex-col gap-1.5",
+ children: [/* @__PURE__ */ (0, q.jsx)(c, {
+ label: i,
+ value: Math.min(r, n),
+ max: n
+ }), /* @__PURE__ */ (0, q.jsxs)("p", {
+ className: "text-caption-1-regular text-text-secondary wrap-anywhere",
+ children: [
+ i,
+ " · ",
+ M(r, n),
+ " 项"
+ ]
+ })]
+ }) : /* @__PURE__ */ (0, q.jsx)(o, { label: i })
+ });
+}
+function Z({ run: e, followups: t, runs: r, latest: i }) {
+ let o = I(e.result_summary).filter((t) => t !== e.error), s = L(e), c = j(e, i), l = g(e.elapsed_seconds), d = r && r.length > 1 ? r[r.length - 1] : void 0, f = (d ? [
+ u[e.trigger] || e.trigger,
+ `近 ${r.length} 轮`,
+ `${k(d.finished_at)} – ${k(e.finished_at)}`
+ ] : [
+ u[e.trigger] || e.trigger,
+ k(e.finished_at),
+ l && `用时 ${l}`
+ ]).filter(Boolean).join(" · ");
+ return /* @__PURE__ */ (0, q.jsxs)(X, {
+ run: e,
+ meta: f,
+ footer: e.error,
+ followups: t,
+ children: [
+ o.length ? /* @__PURE__ */ (0, q.jsx)("ul", {
+ className: "list-disc space-y-1 pl-5 text-caption-1-regular text-text-secondary wrap-anywhere",
+ children: o.map((e, t) => /* @__PURE__ */ (0, q.jsx)("li", { children: e }, t))
+ }) : null,
+ s.length ? /* @__PURE__ */ (0, q.jsx)(n, {
+ summary: `问题详情 · ${s.length} 项`,
+ contentClassName: "pt-2",
+ children: /* @__PURE__ */ (0, q.jsx)(W, {
+ label: "任务问题详情",
+ children: /* @__PURE__ */ (0, q.jsx)("ul", {
+ className: "flex min-w-0 flex-col gap-3",
+ "data-task-issues": "",
+ children: s.map((e, t) => /* @__PURE__ */ (0, q.jsxs)("li", {
+ className: "flex min-w-0 flex-col gap-1 text-body-2-regular wrap-anywhere",
+ children: [/* @__PURE__ */ (0, q.jsx)("p", {
+ className: "text-body-regular text-text-primary",
+ children: [
+ e.label,
+ e.provider,
+ e.kind
+ ].filter(Boolean).join(" · ")
+ }), /* @__PURE__ */ (0, q.jsx)(G, {
+ text: e.error,
+ className: "text-text-primary"
+ })]
+ }, `${e.source}-${t}`))
+ })
+ })
+ }) : w(e) && ["follow-check", "feed-check"].includes(e.task_key) ? /* @__PURE__ */ (0, q.jsx)("p", {
+ className: "text-body-2-regular text-text-secondary",
+ children: "未取得本轮逐项详情,可到来源列表查看检查结果。"
+ }) : null,
+ c ? /* @__PURE__ */ (0, q.jsx)(a, {
+ href: c.href,
+ size: "small",
+ trailingIcon: T,
+ className: "self-start",
+ children: c.label
+ }) : null
+ ]
+ });
+}
+function Q({ title: e, children: t }) {
+ let n = (0, K.useId)();
+ return /* @__PURE__ */ (0, q.jsxs)("section", {
+ "aria-labelledby": n,
+ className: "flex min-w-0 flex-col gap-3",
+ children: [/* @__PURE__ */ (0, q.jsx)("h3", {
+ id: n,
+ className: "text-title-2-medium text-text-primary",
+ children: e
+ }), t]
+ });
+}
+function $({ live: e = !1, children: t }) {
+ return /* @__PURE__ */ (0, q.jsx)("ul", {
+ "aria-live": e ? "polite" : void 0,
+ className: "flex min-w-0 flex-col gap-3",
+ children: t
+ });
+}
+function oe() {
+ let t = B({
+ queryKey: l,
+ queryFn: ({ signal: e }) => b(e),
+ refetchInterval: (e) => A(e.state.data)
+ }), n = t.data, a = n?.finished, [o, c] = (0, K.useState)([]), [u, d] = (0, K.useState)(!1), [f, p] = (0, K.useState)(a);
+ a !== f && (p(a), o.length && f && c(O(o, f)));
+ let h = z({
+ mutationFn: ({ oldest: e }) => y(e),
+ onSuccess: (e, { shown: t }) => {
+ c((n) => O(n, t, e.finished || [])), d(!!e.finished_has_more);
+ }
+ }), g = t.error ? _(t.error) : "";
+ if (!n) return /* @__PURE__ */ (0, q.jsx)(U, { children: /* @__PURE__ */ (0, q.jsx)(s, {
+ tone: "error",
+ children: g || "读取任务中心失败"
+ }) });
+ let S = O(n.finished || [], o), w = [
+ ...n.running || [],
+ ...n.skipped || [],
+ ...S
+ ], T = C(w), k = new Set(w.map((e) => e.id)), j = (e) => e.filter((e) => !(e.followup_key && e.parent_run_id != null && k.has(e.parent_run_id))), M = j(S), N = M[M.length - 1], P = !!N && (o.length ? u : !!n.finished_has_more), F = () => {
+ !h.isPending && N && h.mutate({
+ oldest: N,
+ shown: S
+ });
+ }, I = M.filter((e) => T.get(e.id)?.some(E)), L = j(n.running || []), V = j(n.skipped || []), H = M.filter((e) => !I.includes(e) && !V.some((t) => t.id === e.id)), W = x(H, (e) => D(e) && !T.get(e.id)?.length), G = ee(w), J = !L.length && !I.length && !V.length && !H.length;
+ return /* @__PURE__ */ (0, q.jsxs)(U, { children: [
+ g ? /* @__PURE__ */ (0, q.jsx)(s, {
+ tone: "error",
+ children: g
+ }) : null,
+ n.available === !1 ? /* @__PURE__ */ (0, q.jsx)(s, {
+ tone: "warning",
+ children: n.message || "数据库尚未准备好任务记录表"
+ }) : null,
+ /* @__PURE__ */ (0, q.jsx)(te, {}),
+ J ? /* @__PURE__ */ (0, q.jsx)(i, {
+ icon: R,
+ title: "还没有任务记录",
+ children: "扫描、追更检查、批量操作和命令行批处理跑起来之后,这里会显示它们的进度与结果。"
+ }) : /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [
+ /* @__PURE__ */ (0, q.jsx)(Q, {
+ title: "正在进行",
+ children: L.length || I.length ? /* @__PURE__ */ (0, q.jsxs)($, {
+ live: !0,
+ children: [L.map((e) => /* @__PURE__ */ (0, q.jsx)(ae, {
+ run: e,
+ followups: T.get(e.id)
+ }, e.id)), I.map((e) => /* @__PURE__ */ (0, q.jsx)(Z, {
+ run: e,
+ latest: G.has(e.id),
+ followups: T.get(e.id)
+ }, e.id))]
+ }) : /* @__PURE__ */ (0, q.jsx)(s, {
+ tone: "neutral",
+ children: "没有任务在跑。"
+ })
+ }),
+ V.length ? /* @__PURE__ */ (0, q.jsx)(Q, {
+ title: "本次未执行",
+ children: /* @__PURE__ */ (0, q.jsx)($, { children: V.map((e) => /* @__PURE__ */ (0, q.jsx)(Z, {
+ run: e,
+ latest: G.has(e.id),
+ followups: T.get(e.id)
+ }, e.id)) })
+ }) : null,
+ H.length || P ? /* @__PURE__ */ (0, q.jsxs)(Q, {
+ title: "最近完成",
+ children: [
+ H.length ? /* @__PURE__ */ (0, q.jsx)($, { children: W.map(({ run: e, runs: t }) => /* @__PURE__ */ (0, q.jsx)(Z, {
+ run: e,
+ runs: t,
+ latest: G.has(e.id),
+ followups: T.get(e.id)
+ }, e.id)) }) : null,
+ h.error ? /* @__PURE__ */ (0, q.jsx)(s, {
+ tone: "error",
+ children: _(h.error)
+ }) : null,
+ P ? /* @__PURE__ */ (0, q.jsx)(e, {
+ variant: "secondary",
+ size: "small",
+ leadingIcon: v,
+ className: "self-start",
+ ...m(h.isPending),
+ onClick: F,
+ children: "加载更早"
+ }) : null
+ ]
+ }) : null
+ ] }),
+ /* @__PURE__ */ (0, q.jsx)(r, {})
+ ] });
+}
+//#endregion
+export { oe as ActivityPage };
+
+//# debugId=cd935c10-0d1c-4516-b106-7e429c6ec869
\ No newline at end of file
diff --git a/web/dist/peach-app.code-block-De9b0xOF.js b/web/dist/peach-app.code-block-CuHUqiH3.js
similarity index 65%
rename from web/dist/peach-app.code-block-De9b0xOF.js
rename to web/dist/peach-app.code-block-CuHUqiH3.js
index 73d29ab3c..be92c2d10 100644
--- a/web/dist/peach-app.code-block-De9b0xOF.js
+++ b/web/dist/peach-app.code-block-CuHUqiH3.js
@@ -1,26 +1,26 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "6bd418e4-bdbb-4d7e-9c83-560d8bbc4b23", e._sentryDebugIdIdentifier = "sentry-dbid-6bd418e4-bdbb-4d7e-9c83-560d8bbc4b23");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "4ea303b0-591f-40ff-9a9a-dd95b540d85a", e._sentryDebugIdIdentifier = "sentry-dbid-4ea303b0-591f-40ff-9a9a-dd95b540d85a");
} catch {}
})();
-import { Us as e, Va as t, Ya as n, cu as r, fs as i, pu as a, uu as o } from "./peach-app.js";
+import { Button as e, __toESM as t, cardClass as n, cx as r, require_jsx_runtime as i, require_react as a, useOverlayScrollbar as o } from "./peach-app.js";
//#region src/react/components/code-block.tsx
-var s = /* @__PURE__ */ a(o(), 1), c = r();
-function l({ code: r, language: a, label: o, maxCharacters: l, bounded: u = !0, copyLabel: d, onCopy: f }) {
- let p = n(), [m, h] = (0, s.useState)(""), [g, _] = (0, s.useState)(!1);
+var s = /* @__PURE__ */ t(a(), 1), c = i();
+function l({ code: t, language: i, label: a, maxCharacters: l, bounded: u = !0, copyLabel: d, onCopy: f }) {
+ let p = o(), [m, h] = (0, s.useState)(""), [g, _] = (0, s.useState)(!1);
(0, s.useEffect)(() => {
h(""), _(!1);
- }, [r]);
- let v = l !== void 0 && r.length > l, y = async () => {
+ }, [t]);
+ let v = l !== void 0 && t.length > l, y = async () => {
try {
- await navigator.clipboard.writeText(r), _(!1), h("已复制"), f?.();
+ await navigator.clipboard.writeText(t), _(!1), h("已复制"), f?.();
} catch {
_(!0), h("复制失败,请选中文本复制。");
}
};
return /* @__PURE__ */ (0, c.jsxs)("div", {
- className: e(t({
+ className: r(n({
bordered: "soft",
radius: "plain",
padding: "none"
@@ -31,8 +31,8 @@ function l({ code: r, language: a, label: o, maxCharacters: l, bounded: u = !0,
className: "flex min-w-0 items-center justify-between gap-3 border-b border-separator-border px-3 py-2",
children: [/* @__PURE__ */ (0, c.jsx)("span", {
className: "text-caption-1-medium text-text-secondary",
- children: a.toUpperCase()
- }), /* @__PURE__ */ (0, c.jsx)(i, {
+ children: i.toUpperCase()
+ }), /* @__PURE__ */ (0, c.jsx)(e, {
variant: "secondary",
size: "small",
onClick: () => void y(),
@@ -44,9 +44,9 @@ function l({ code: r, language: a, label: o, maxCharacters: l, bounded: u = !0,
children: /* @__PURE__ */ (0, c.jsx)("pre", {
ref: p,
tabIndex: 0,
- "aria-label": o,
- className: e("m-0 overflow-auto overscroll-contain p-3 font-mono text-caption-1-regular whitespace-pre text-text-primary", u && "max-h-80"),
- children: /* @__PURE__ */ (0, c.jsx)("code", { children: l === void 0 ? r : r.slice(0, l) })
+ "aria-label": a,
+ className: r("m-0 overflow-auto overscroll-contain p-3 font-mono text-caption-1-regular whitespace-pre text-text-primary", u && "max-h-80"),
+ children: /* @__PURE__ */ (0, c.jsx)("code", { children: l === void 0 ? t : t.slice(0, l) })
})
}),
m ? /* @__PURE__ */ (0, c.jsx)("p", {
@@ -58,6 +58,6 @@ function l({ code: r, language: a, label: o, maxCharacters: l, bounded: u = !0,
});
}
//#endregion
-export { l as t };
+export { l as CodeBlock };
-//# debugId=6bd418e4-bdbb-4d7e-9c83-560d8bbc4b23
\ No newline at end of file
+//# debugId=4ea303b0-591f-40ff-9a9a-dd95b540d85a
\ No newline at end of file
diff --git a/web/dist/peach-app.configuration-page-D8DOj79Y.js b/web/dist/peach-app.configuration-page-BcGpLlXe.js
similarity index 55%
rename from web/dist/peach-app.configuration-page-D8DOj79Y.js
rename to web/dist/peach-app.configuration-page-BcGpLlXe.js
index 5faa53308..fdfeffeca 100644
--- a/web/dist/peach-app.configuration-page-D8DOj79Y.js
+++ b/web/dist/peach-app.configuration-page-BcGpLlXe.js
@@ -1,16 +1,16 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f6e2087e-7d61-4ffe-b8ff-08e1af977d0d", e._sentryDebugIdIdentifier = "sentry-dbid-f6e2087e-7d61-4ffe-b8ff-08e1af977d0d");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "203c1fbd-d0cd-4d75-bbdd-a7c59c81838b", e._sentryDebugIdIdentifier = "sentry-dbid-203c1fbd-d0cd-4d75-bbdd-a7c59c81838b");
} catch {}
})();
-import { $s as e, Aa as t, Ac as n, Ba as r, Ca as i, Da as a, Ea as o, Fo as s, Ga as c, Gl as l, Gs as u, Gt as d, Ha as f, Hl as p, Hs as m, Il as h, Ja as g, Ka as _, Ks as v, Kt as y, Li as b, Ma as x, Na as S, Nc as C, Oa as w, Pa as T, Ps as E, Q as D, Qs as O, Sa as k, Sc as A, Sl as ee, Ta as j, Tc as M, Ul as N, Us as P, Va as F, Wa as I, Wl as L, Ws as te, Xa as ne, Xo as re, Yc as ie, Z as R, Zl as ae, _a as z, _r as oe, _t as se, aa as ce, ar as le, at as ue, au as B, ba as de, bo as fe, br as pe, cr as me, cs as he, ct as ge, cu as _e, do as ve, dr as ye, ds as be, dt as xe, el as Se, eo as Ce, eu as we, fa as Te, fo as Ee, fr as De, fs as V, ft as Oe, ga as H, gr as ke, gt as Ae, hn as je, hr as Me, ir as Ne, iu as Pe, ja as U, ka as W, lo as G, lr as Fe, ls as Ie, lt as Le, ma as Re, mo as ze, mr as Be, nc as Ve, oa as He, oo as Ue, or as We, os as Ge, ot as Ke, pa as qe, peachHistory as Je, po as Ye, pr as Xe, ps as Ze, pt as Qe, pu as $e, ro as K, rr as et, ru as tt, so as q, sr as nt, ss as rt, st as it, t as at, tc as ot, ur as st, us as ct, ut as lt, uu as ut, va as dt, vr as ft, wa as J, xa as Y, xr as pt, ya as X, yr as mt, za as ht } from "./peach-app.js";
-import { t as gt } from "./peach-app.code-block-De9b0xOF.js";
-import { a as _t, c as vt, d as yt, l as bt, n as xt, o as St, r as Ct, s as wt, t as Tt, u as Et } from "./peach-app.folder-rows-C8zyfdZi.js";
-import { t as Dt } from "./peach-app.connection-status-Pa6aDai7.js";
-import { r as Ot } from "./peach-app.source-view-DaRl5mr9.js";
+import { $2ec61d1d4f780267$export$a8a3e93435678ff9 as e, $3a442827418ebe87$export$eb2fcfdbd7ba97d4 as t, $542a13ca2fa5b484$export$5b6b19405a83ff9d as n, $72abaeab4d80592f$export$78efe591171d7d45 as r, $bd263d78e9bf3c56$export$f5c9f3c2c4054eec as i, $ea3928288112382f$export$439d29a4e110a164 as a, $f2ff30fde7b014be$export$3ddf2d174ce01153 as o, $fe21c36db05242bb$export$a98f0dcb43a68a25 as s, $fe21c36db05242bb$export$d7b12c4107be0d61 as c, ACCENT_CHOICES as l, ApiError as u, Button as d, ButtonLink as f, CLOUD_LOCATIONS as p, CLOUD_PROXY_HELP as m, CONFIGURATION_KEY as h, CONFIGURATION_URL as g, CREDENTIAL_STATE as _, Checkbox as v, Chip as y, Disclosure as b, EmptyState as x, ErrorText as S, ExternalLink as C, FEED_SCHEDULE_KEY as w, FOLLOW_CREDENTIALS_KEY as T, FOLLOW_INITIAL_RANGE_OPTIONS as E, FOLLOW_SCHEDULE_KEY as ee, Fact as D, FactList as O, FieldLabel as k, Footer as A, Help as j, HintText as te, Input as M, LIBRARY_FOLDER_HELP as ne, LIBRARY_PROCESSING_KEY as re, Label as ie, LinkButton as ae, LoadingDots as oe, M6 as se, MEDIA_PROCESSING_KEY as ce, MEDIA_PROCESSING_URL as le, MEDIA_SOURCE_ICONS as ue, MENU_POPOVER_SURFACE as de, Note as N, PICK_FOLDER_URL as fe, POLICY_COLUMNS as pe, POLICY_COVER_NOTE as me, POLICY_MATRIX as he, POLICY_SUMMARY as ge, PathLine as _e, PillTabList as ve, Progress as ye, Rows as P, SEGMENT as be, SEGMENTED_TRACK as xe, SETTINGS_KEY as Se, SETTINGS_URL as Ce, Section as F, SegmentedRadioGroup as we, Select as Te, Select$1 as I, SelectItem as L, SettingsCard as Ee, SettingsRow as R, SiteLabel as De, SourceLabel as z, SourceMark as B, Stack as V, StatusLabel as H, Switch as U, THUMBNAIL_JOBS_KEY as Oe, TextField as ke, TextFieldContext as Ae, __toESM as je, apiGet as W, apiSend as G, appSettingsStore as Me, boundedPreference as Ne, busyProps as K, cardClass as Pe, cn as Fe, confirmModal as Ie, credentialDone as Le, cx as Re, errorMessage as q, fetchConfiguration as ze, fetchCredentials as Be, fetchFeedSchedule as Ve, fetchFollowSchedule as He, fetchMediaProcessing as Ue, fetchSettings as We, fetchThumbnailJobs as Ge, fmtSize as Ke, momentText as qe, overlayHost as Je, peachHistory$1 as Ye, previewLibraryColor as Xe, providerIcon as Ze, queryClient as J, randomId as Qe, rememberMediaShape as $e, rememberSectionHeight as et, rememberedSectionHeight as tt, require_jsx_runtime as nt, require_react as rt, saveCredential as it, schedulePollInterval as at, settingsPath as ot, shellNavigate as st, sortCx as ct, sourceDefaultCost as lt, useAction as Y, useLibraryTints as ut, useMutation as dt, useQuery as X, useRunSchedule as ft, useSaveFollowSchedule as pt, useSaveSettings as mt, useSaveThumbnailMode as ht } from "./peach-app.js";
+import { CodeBlock as gt } from "./peach-app.code-block-CuHUqiH3.js";
+import { FolderField as _t, FolderFieldLine as vt, FolderRow as yt, MEDIA_SOURCES as bt, MediaReadPolicy as xt, MediaReadPolicyHelp as St, SourceSelect as Ct, isCloudSource as wt, sourceMark as Tt, useFolderRows as Et } from "./peach-app.folder-rows-C5-6TcQS.js";
+import { ConnectionStatus as Dt } from "./peach-app.connection-status-BP0ylxDH.js";
+import { SourceIcon as Ot } from "./peach-app.source-view-Bk_L5GHG.js";
//#region src/react/settings/configuration-panel.ts
-var Z = /* @__PURE__ */ $e(ut(), 1), kt = "flex flex-col gap-6";
+var Z = /* @__PURE__ */ je(rt(), 1), kt = "flex flex-col gap-6";
function Q(e) {
return e ? {
className: e.active ? `${kt} ui-board-group-active` : kt,
@@ -25,7 +25,7 @@ function Q(e) {
function At() {
let e = (0, Z.useRef)(null), [t, n] = (0, Z.useState)(0), [r, i] = (0, Z.useState)("checking");
return (0, Z.useEffect)(() => {
- let t = u(), n = !1, r = () => e.current?.contentWindow?.postMessage({
+ let t = Qe(), n = !1, r = () => e.current?.contentWindow?.postMessage({
type: "peach-userscript:probe",
nonce: t
}, window.location.origin), a = (r) => {
@@ -52,14 +52,14 @@ function At() {
}
//#endregion
//#region src/react/settings/userscript-status.tsx
-var $ = _e();
+var $ = nt();
function jt(e, t) {
let n = e.split(".").map(Number), r = t.split(".").map(Number);
for (let e = 0; e < 3; e++) if (n[e] !== r[e]) return n[e] > r[e];
return !0;
}
function Mt({ enabled: e, release: t }) {
- let { frame: n, attempt: r, status: a, retry: o } = At(), s = typeof a == "object", c = s && !jt(a.version, t.minimum_version), l = a === "checking" ? "progress" : a === "missing" ? "neutral" : c || !a.paired ? "warning" : "success", u = a === "checking" ? "检测中" : a === "missing" ? "未检测到" : c ? "需更新" : a.paired ? "已连接" : "待配对";
+ let { frame: n, attempt: r, status: i, retry: a } = At(), o = typeof i == "object", s = o && !jt(i.version, t.minimum_version), c = i === "checking" ? "progress" : i === "missing" ? "neutral" : s || !i.paired ? "warning" : "success", l = i === "checking" ? "检测中" : i === "missing" ? "未检测到" : s ? "需更新" : i.paired ? "已连接" : "待配对";
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)("iframe", {
ref: n,
title: "Peach 用户脚本检测",
@@ -68,7 +68,7 @@ function Mt({ enabled: e, release: t }) {
}, r), /* @__PURE__ */ (0, $.jsxs)("div", {
"aria-live": "polite",
"data-userscript-status": "",
- className: F({
+ className: Pe({
variant: "raised",
bordered: "line",
className: "flex flex-col gap-3"
@@ -80,38 +80,38 @@ function Mt({ enabled: e, release: t }) {
className: "text-body-medium text-text-primary",
children: "Peach 用户脚本"
}), /* @__PURE__ */ (0, $.jsx)(Dt, {
- tone: l,
- children: u
+ tone: c,
+ children: l
})]
}),
- s ? /* @__PURE__ */ (0, $.jsxs)("p", {
+ o ? /* @__PURE__ */ (0, $.jsxs)("p", {
className: "text-body-regular text-text-secondary",
- children: ["用户脚本 v", a.version]
+ children: ["用户脚本 v", i.version]
}) : null,
/* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-wrap items-center justify-between gap-3",
children: [/* @__PURE__ */ (0, $.jsx)("span", {
className: "text-body-regular text-text-secondary",
children: "浏览器添加"
- }), /* @__PURE__ */ (0, $.jsx)(y, {
+ }), /* @__PURE__ */ (0, $.jsx)(H, {
tone: e ? "success" : "neutral",
children: e ? "已启用" : "未启用"
})]
}),
/* @__PURE__ */ (0, $.jsx)("p", {
className: "text-caption-1-regular text-text-secondary",
- children: a === "checking" ? "正在检测当前浏览器的用户脚本。" : a === "missing" ? "安装或启用脚本后重新检测;旧版脚本需要更新后才能检测。" : c ? `请更新至 v${t.minimum_version} 或更高版本。` : a.paired ? e ? "可在支持的站点直接加入 Peach 馆藏。" : "启用浏览器添加后,可在支持的站点直接加入 Peach 馆藏。" : "生成令牌后复制配对信息,在用户脚本设置中粘贴并保存。"
+ children: i === "checking" ? "正在检测当前浏览器的用户脚本。" : i === "missing" ? "安装或启用脚本后重新检测;旧版脚本需要更新后才能检测。" : s ? `请更新至 v${t.minimum_version} 或更高版本。` : i.paired ? e ? "可在支持的站点直接加入 Peach 馆藏。" : "启用浏览器添加后,可在支持的站点直接加入 Peach 馆藏。" : "生成令牌后复制配对信息,在用户脚本设置中粘贴并保存。"
}),
/* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
- children: [a === "missing" || c ? /* @__PURE__ */ (0, $.jsx)(i, {
+ children: [i === "missing" || s ? /* @__PURE__ */ (0, $.jsx)(C, {
href: t.install_url,
- children: c ? "更新用户脚本" : "安装 Peach 用户脚本"
- }) : null, /* @__PURE__ */ (0, $.jsx)(V, {
+ children: s ? "更新用户脚本" : "安装 Peach 用户脚本"
+ }) : null, /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
type: "button",
- ...K(a === "checking"),
- onClick: o,
+ ...K(i === "checking"),
+ onClick: a,
children: "重新检测"
})]
})
@@ -122,109 +122,109 @@ function Mt({ enabled: e, release: t }) {
//#region src/react/settings/jav-browser-settings.tsx
var Nt = "/api/configuration/jav-browser";
function Pt({ receipt: e, refreshKey: t }) {
- let n = B({
+ let n = X({
queryKey: ["jav-browser-settings", t],
- queryFn: ({ signal: e }) => N(Nt, e),
+ queryFn: ({ signal: e }) => W(Nt, e),
refetchOnMount: "always",
refetchOnWindowFocus: "always"
});
- return n.error && !n.data ? /* @__PURE__ */ (0, $.jsx)(k, { children: l(n.error) }) : n.isFetching && !n.data ? /* @__PURE__ */ (0, $.jsx)(r, { label: "正在读取浏览器添加设置" }) : n.data ? /* @__PURE__ */ (0, $.jsx)(Ft, {
+ return n.error && !n.data ? /* @__PURE__ */ (0, $.jsx)(S, { children: q(n.error) }) : n.isFetching && !n.data ? /* @__PURE__ */ (0, $.jsx)(oe, { label: "正在读取浏览器添加设置" }) : n.data ? /* @__PURE__ */ (0, $.jsx)(Ft, {
initial: n.data,
receipt: e
}) : null;
}
-function Ft({ initial: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e), [s, c] = (0, Z.useState)(e.provider), [l, u] = (0, Z.useState)(""), d = f();
+function Ft({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(e.provider), [o, s] = (0, Z.useState)(""), c = Y();
(0, Z.useEffect)(() => {
- i(e), c((t) => e.providers.some((e) => e.key === t) ? t : e.provider), e.enabled || u("");
+ r(e), a((t) => e.providers.some((e) => e.key === t) ? t : e.provider), e.enabled || s("");
}, [e]);
- let p = (e) => {
- d.run(e, (t) => L(Nt, {
+ let l = (e) => {
+ c.run(e, (t) => G(Nt, {
action: e,
- provider: s
- }, "POST", t), (t) => {
- let { token: r = "", ...a } = t;
- i(a), c(a.provider), u(r), n(e === "disable" ? "已关闭浏览器添加" : "已生成专用令牌");
+ provider: i
+ }, "POST", t), (n) => {
+ let { token: i = "", ...o } = n;
+ r(o), a(o.provider), s(i), t(e === "disable" ? "已关闭浏览器添加" : "已生成专用令牌");
});
- }, m = r.providers.some((e) => e.key === s && e.configured && e.target);
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ }, u = n.providers.some((e) => e.key === i && e.configured && e.target);
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "浏览器添加 JAV",
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [
/* @__PURE__ */ (0, $.jsx)(Mt, {
- enabled: r.enabled,
- release: r.userscript
+ enabled: n.enabled,
+ release: n.userscript
}),
/* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-col gap-1",
- children: [/* @__PURE__ */ (0, $.jsx)(o, { children: "浏览器添加的下载渠道" }), /* @__PURE__ */ (0, $.jsx)(H, {
+ children: [/* @__PURE__ */ (0, $.jsx)(k, { children: "浏览器添加的下载渠道" }), /* @__PURE__ */ (0, $.jsx)(I, {
"aria-label": "浏览器添加的下载渠道",
- selectedKey: s || null,
+ selectedKey: i || null,
placeholder: "暂无可用渠道",
onSelectionChange: (e) => {
- e !== null && c(String(e));
+ e !== null && a(String(e));
},
- isDisabled: !r.providers.length || !!d.busy,
- children: r.providers.map((e) => /* @__PURE__ */ (0, $.jsx)(z, {
+ isDisabled: !n.providers.length || !!c.busy,
+ children: n.providers.map((e) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e.key,
textValue: e.label,
- children: /* @__PURE__ */ (0, $.jsx)(X, {
+ children: /* @__PURE__ */ (0, $.jsx)(z, {
source: e.key,
label: e.label
})
}, e.key))
})]
}),
- m ? null : /* @__PURE__ */ (0, $.jsx)(w, { children: "请在媒体库中添加支持云下载的网盘,并配置账号与目标目录。" }),
- r.problems?.map((e) => /* @__PURE__ */ (0, $.jsx)(w, { children: e }, e)),
- r.enabled && r.active_provider && !r.providers.some((e) => e.key === r.active_provider) ? /* @__PURE__ */ (0, $.jsx)(w, { children: "已启用的下载渠道不可用,请选择渠道并更新令牌。" }) : null,
- /* @__PURE__ */ (0, $.jsx)(G, {
+ u ? null : /* @__PURE__ */ (0, $.jsx)(j, { children: "请在媒体库中添加支持云下载的网盘,并配置账号与目标目录。" }),
+ n.problems?.map((e) => /* @__PURE__ */ (0, $.jsx)(j, { children: e }, e)),
+ n.enabled && n.active_provider && !n.providers.some((e) => e.key === n.active_provider) ? /* @__PURE__ */ (0, $.jsx)(j, { children: "已启用的下载渠道不可用,请选择渠道并更新令牌。" }) : null,
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "Peach 地址",
value: window.location.origin,
isReadOnly: !0,
autoComplete: "off"
}),
- l ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
- /* @__PURE__ */ (0, $.jsx)(G, {
+ o ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "浏览器添加专用令牌",
type: "password",
- value: l,
+ value: o,
isReadOnly: !0,
autoComplete: "new-password"
}),
- /* @__PURE__ */ (0, $.jsx)("div", { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)("div", { children: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
type: "button",
onClick: () => {
- d.run("copy", async () => navigator.clipboard.writeText(JSON.stringify({
+ c.run("copy", async () => navigator.clipboard.writeText(JSON.stringify({
peach_pairing: 1,
base: window.location.origin,
- token: l
- })), () => n("已复制配对信息"));
+ token: o
+ })), () => t("已复制配对信息"));
},
- ...K(d.busy === "copy"),
+ ...K(c.busy === "copy"),
children: "复制配对信息"
}) }),
- /* @__PURE__ */ (0, $.jsx)(w, { children: "在用户脚本设置的「Peach 地址」中粘贴配对信息,即可填好地址与令牌。" })
+ /* @__PURE__ */ (0, $.jsx)(j, { children: "在用户脚本设置的「Peach 地址」中粘贴配对信息,即可填好地址与令牌。" })
] }) : null,
- d.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: d.error }) : null
- ] }), /* @__PURE__ */ (0, $.jsxs)(a, { children: [r.enabled ? /* @__PURE__ */ (0, $.jsx)(V, {
+ c.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: c.error }) : null
+ ] }), /* @__PURE__ */ (0, $.jsxs)(A, { children: [n.enabled ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
type: "button",
- disabled: !!d.busy,
- onClick: () => p("disable"),
+ disabled: !!c.busy,
+ onClick: () => l("disable"),
children: "关闭浏览器添加"
- }) : null, /* @__PURE__ */ (0, $.jsx)(V, {
+ }) : null, /* @__PURE__ */ (0, $.jsx)(d, {
type: "button",
- disabled: !r.available || !m || !!d.busy,
- onClick: () => p(r.enabled ? "rotate" : "enable"),
- ...K(d.busy === "enable" || d.busy === "rotate"),
- children: r.enabled ? "更新渠道与令牌" : "启用并生成令牌"
+ disabled: !n.available || !u || !!c.busy,
+ onClick: () => l(n.enabled ? "rotate" : "enable"),
+ ...K(c.busy === "enable" || c.busy === "rotate"),
+ children: n.enabled ? "更新渠道与令牌" : "启用并生成令牌"
})] })]
});
}
//#endregion
//#region src/react/settings/download-settings.tsx
-var It = "/api/configuration/downloads", Lt = "/api/configuration/downloads/check", Rt = "/api/configuration/downloads/folder", zt = "/api/configuration/downloads/pikpak/login", Bt = "/api/configuration/downloads/pikpak/logout", Vt = "/api/configuration/downloads/pikpak/browser-login", Ht = 2e3, Ut = de("pikpak");
+var It = "/api/configuration/downloads", Lt = "/api/configuration/downloads/check", Rt = "/api/configuration/downloads/folder", zt = "/api/configuration/downloads/pikpak/login", Bt = "/api/configuration/downloads/pikpak/logout", Vt = "/api/configuration/downloads/pikpak/browser-login", Ht = 2e3, Ut = Ze("pikpak");
function Wt({ initial: e, receipt: t, panel: n }) {
return /* @__PURE__ */ (0, $.jsx)("div", {
...Q(n),
@@ -243,7 +243,7 @@ function Gt({ initial: e, receipt: t }) {
pikpak_roots: e.pikpak_roots
}));
}, [e.media_sources, e.pikpak_roots]);
- let o = n.media_sources ?? [], s = o.includes("pikpak"), c = o.some((e) => we.includes(e)), l = s && (n.pikpak.logged_in || !!i.trim());
+ let o = n.media_sources ?? [], s = o.includes("pikpak"), c = o.some((e) => p.includes(e)), l = s && (n.pikpak.logged_in || !!i.trim());
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
c ? /* @__PURE__ */ (0, $.jsx)(Kt, {
state: n,
@@ -269,28 +269,28 @@ function Gt({ initial: e, receipt: t }) {
})
] });
}
-function Kt({ state: e, settle: n, receipt: i, pikpakAccount: s }) {
- let [c, u] = (0, Z.useState)(e.config), [d, p] = (0, Z.useState)(""), [m, h] = (0, Z.useState)(String(e.config.wait_hours)), [g, _] = (0, Z.useState)(null), [v, y] = (0, Z.useState)(""), [b, S] = (0, Z.useState)(qt), [C, T] = (0, Z.useState)(""), [E, D] = (0, Z.useState)(!1), O = f(), A = e.media_sources ?? [], ee = A.includes("115"), j = A.includes("pikpak"), M = (e) => c.targets[e] ?? "", P = (e, t) => u({
- ...c,
+function Kt({ state: e, settle: t, receipt: n, pikpakAccount: r }) {
+ let [i, a] = (0, Z.useState)(e.config), [o, s] = (0, Z.useState)(""), [c, l] = (0, Z.useState)(String(e.config.wait_hours)), [u, f] = (0, Z.useState)(null), [p, m] = (0, Z.useState)(""), [h, g] = (0, Z.useState)(qt), [_, v] = (0, Z.useState)(""), [y, b] = (0, Z.useState)(!1), x = Y(), C = e.media_sources ?? [], w = C.includes("115"), T = C.includes("pikpak"), E = (e) => i.targets[e] ?? "", ee = (e, t) => a({
+ ...i,
targets: {
- ...c.targets,
+ ...i.targets,
[e]: t
}
- }), F = ee && !(!b.target || b.target.exists || M("115") !== b.target.path), I = (e, t, n = "") => {
- let r = t.target ? e.suggested_target : null, i = !!(r && n && r.path === n), a = t.root ? e.suggested_pikpak_root : "";
- u((n) => ({
+ }), D = w && !(!h.target || h.target.exists || E("115") !== h.target.path), O = (e, t, n = "") => {
+ let r = t.target ? e.suggested_target : null, i = !!(r && n && r.path === n), o = t.root ? e.suggested_pikpak_root : "";
+ a((n) => ({
...n,
clouddrive_address: t.address && e.address ? e.address : n.clouddrive_address,
targets: r && !i ? {
...n.targets,
115: r.path
} : n.targets,
- pikpak_root: a || n.pikpak_root
- })), _(e), y(t.address ? e.address : ""), S({
+ pikpak_root: o || n.pikpak_root
+ })), f(e), m(t.address ? e.address : ""), g({
target: r,
- root: a,
+ root: o,
saved: i
- }), D(!1), T("");
+ }), b(!1), v("");
};
return (0, Z.useEffect)(() => {
if (!e.available || !e.config.clouddrive_address || !e.token_set) return;
@@ -299,56 +299,56 @@ function Kt({ state: e, settle: n, receipt: i, pikpakAccount: s }) {
target: !e.config.targets[115],
root: !e.config.pikpak_root
};
- O.run("auto", (e) => N(Lt, e), (e) => I(e, t), (e) => T(l(e)));
- }, []), /* @__PURE__ */ (0, $.jsxs)(t, {
+ x.run("auto", (e) => W(Lt, e), (e) => O(e, t), (e) => v(q(e)));
+ }, []), /* @__PURE__ */ (0, $.jsxs)(F, {
title: "云下载",
onSubmit: (e) => {
- if (e.preventDefault(), F) {
- D(!0);
+ if (e.preventDefault(), D) {
+ b(!0);
return;
}
- let t = !M("115").trim(), r = {
- ...c,
- wait_hours: m,
- token: d,
- pikpak_account: s
+ let u = !E("115").trim(), d = {
+ ...i,
+ wait_hours: c,
+ token: o,
+ pikpak_account: r
};
- O.run("save", (e) => L(It, r, "POST", e), (e) => {
- let { report: r, ...a } = e;
- n(a), u(a.config), h(String(a.config.wait_hours)), p(""), r ? I(r, {
- address: !a.config.clouddrive_address,
- target: t,
- root: !a.config.pikpak_root
- }, a.config.targets[115] ?? "") : (_(null), y(""), S(qt), D(!1), T("")), i("已保存配置");
- }, (e) => T(l(e)));
+ x.run("save", (e) => G(It, d, "POST", e), (e) => {
+ let { report: r, ...i } = e;
+ t(i), a(i.config), l(String(i.config.wait_hours)), s(""), r ? O(r, {
+ address: !i.config.clouddrive_address,
+ target: u,
+ root: !i.config.pikpak_root
+ }, i.config.targets[115] ?? "") : (f(null), m(""), g(qt), b(!1), v("")), n("已保存配置");
+ }, (e) => v(q(e)));
},
children: [
- /* @__PURE__ */ (0, $.jsxs)(x, { children: [
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsxs)(V, { children: [
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "CloudDrive2 地址",
placeholder: "留空自动查找",
autoComplete: "off",
maxLength: 200,
- value: c.clouddrive_address,
+ value: i.clouddrive_address,
isDisabled: !e.available,
- onChange: (e) => u({
- ...c,
+ onChange: (e) => a({
+ ...i,
clouddrive_address: e
})
}),
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "CloudDrive2 API 令牌",
type: "password",
autoComplete: "off",
maxLength: 400,
placeholder: e.token_set ? "已保存,留空不改" : "在 CloudDrive2「设置 → API 令牌」中生成",
hint: "需要离线任务权限。",
- value: d,
+ value: o,
isDisabled: !e.available,
- onChange: p
+ onChange: s
}),
- ee ? /* @__PURE__ */ (0, $.jsx)(G, {
- label: /* @__PURE__ */ (0, $.jsx)(X, {
+ w ? /* @__PURE__ */ (0, $.jsx)(M, {
+ label: /* @__PURE__ */ (0, $.jsx)(z, {
source: "115",
label: "115 目标目录"
}),
@@ -356,14 +356,14 @@ function Kt({ state: e, settle: n, receipt: i, pikpakAccount: s }) {
autoComplete: "off",
maxLength: 300,
validationBehavior: "aria",
- isInvalid: F,
- hint: F ? E ? "先新建这个目录,或填写已有目录。" : "这个目录不存在。" : "应位于自动入库的云端路径前缀内。",
- value: M("115"),
+ isInvalid: D,
+ hint: D ? y ? "先新建这个目录,或填写已有目录。" : "这个目录不存在。" : "应位于自动入库的云端路径前缀内。",
+ value: E("115"),
isDisabled: !e.available,
- onChange: (e) => P("115", e)
+ onChange: (e) => ee("115", e)
}) : null,
- j ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(G, {
- label: /* @__PURE__ */ (0, $.jsx)(X, {
+ T ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(M, {
+ label: /* @__PURE__ */ (0, $.jsx)(z, {
source: "pikpak",
label: "PikPak 目标目录"
}),
@@ -371,97 +371,97 @@ function Kt({ state: e, settle: n, receipt: i, pikpakAccount: s }) {
autoComplete: "off",
maxLength: 300,
hint: "目录要已经存在。",
- value: M("pikpak"),
+ value: E("pikpak"),
isDisabled: !e.available,
- onChange: (e) => P("pikpak", e)
+ onChange: (e) => ee("pikpak", e)
}), /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-col gap-1",
- children: [/* @__PURE__ */ (0, $.jsx)(o, { children: /* @__PURE__ */ (0, $.jsx)(X, {
+ children: [/* @__PURE__ */ (0, $.jsx)(k, { children: /* @__PURE__ */ (0, $.jsx)(z, {
source: "pikpak",
label: "PikPak 根目录对应的媒体目录"
- }) }), e.pikpak_roots.length ? /* @__PURE__ */ (0, $.jsx)(H, {
+ }) }), e.pikpak_roots.length ? /* @__PURE__ */ (0, $.jsx)(I, {
"aria-label": "PikPak 根目录对应的媒体目录",
- selectedKey: c.pikpak_root || null,
+ selectedKey: i.pikpak_root || null,
isDisabled: !e.available,
placeholder: "检查时根据媒体库目录选择",
- onSelectionChange: (e) => u({
- ...c,
+ onSelectionChange: (e) => a({
+ ...i,
pikpak_root: e === null ? "" : String(e)
}),
- children: e.pikpak_roots.map((e) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: e.pikpak_roots.map((e) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
children: e
}, e))
- }) : /* @__PURE__ */ (0, $.jsx)(w, { children: "先在「媒体库与入库」添加 PikPak 挂载文件夹。" })]
+ }) : /* @__PURE__ */ (0, $.jsx)(j, { children: "先在「媒体库与入库」添加 PikPak 挂载文件夹。" })]
})] }) : null,
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "等待上限(小时)",
type: "number",
inputMode: "numeric",
autoComplete: "off",
hint: `超时标为停滞;可填 1–${e.max_wait_hours} 小时。`,
- value: m,
+ value: c,
isDisabled: !e.available,
- onChange: h
+ onChange: l
})
] }),
- O.busy === "auto" ? /* @__PURE__ */ (0, $.jsx)(x, {
+ x.busy === "auto" ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(r, { label: "正在检查 CloudDrive2" })
+ children: /* @__PURE__ */ (0, $.jsx)(oe, { label: "正在检查 CloudDrive2" })
}) : null,
- g ? /* @__PURE__ */ (0, $.jsx)(Jt, {
- report: g,
- detected: v,
- suggested: b,
+ u ? /* @__PURE__ */ (0, $.jsx)(Jt, {
+ report: u,
+ detected: p,
+ suggested: h,
create: e.available ? (e) => {
let t = {
- clouddrive_address: c.clouddrive_address,
- token: d,
+ clouddrive_address: i.clouddrive_address,
+ token: o,
path: e,
- pikpak_root: c.pikpak_root,
- pikpak_account: s
+ pikpak_root: i.pikpak_root,
+ pikpak_account: r
};
- O.run("folder", (e) => L(Rt, t, "POST", e), (t) => {
- _(t), S((t) => ({
+ x.run("folder", (e) => G(Rt, t, "POST", e), (t) => {
+ f(t), g((t) => ({
...t,
target: {
path: e,
exists: !0
}
- })), D(!1), T(""), i("已新建目录");
- }, (e) => T(l(e)));
+ })), b(!1), v(""), n("已新建目录");
+ }, (e) => v(q(e)));
} : void 0,
- creating: O.busy === "folder"
+ creating: x.busy === "folder"
}) : null,
- C || O.error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ _ || x.error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: C || O.error })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: _ || x.error })
}) : null,
- /* @__PURE__ */ (0, $.jsxs)(a, {
+ /* @__PURE__ */ (0, $.jsxs)(A, {
status: e.available ? void 0 : "云下载只在允许修改数据库的设备上可用。",
- children: [/* @__PURE__ */ (0, $.jsx)(V, {
+ children: [/* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
onClick: () => {
let e = {
- address: !c.clouddrive_address.trim(),
- target: !M("115").trim(),
- root: !c.pikpak_root
+ address: !i.clouddrive_address.trim(),
+ target: !E("115").trim(),
+ root: !i.pikpak_root
}, t = {
- clouddrive_address: c.clouddrive_address,
- token: d,
- target: M("115"),
- pikpak_root: c.pikpak_root,
- pikpak_account: s
+ clouddrive_address: i.clouddrive_address,
+ token: o,
+ target: E("115"),
+ pikpak_root: i.pikpak_root,
+ pikpak_account: r
};
- O.run("check", (e) => L(Lt, t, "POST", e), (t) => I(t, e), (e) => T(l(e)));
+ x.run("check", (e) => G(Lt, t, "POST", e), (t) => O(t, e), (e) => v(q(e)));
},
disabled: !e.available,
- ...K(O.busy === "check"),
+ ...K(x.busy === "check"),
children: "检查连接"
- }), /* @__PURE__ */ (0, $.jsx)(V, {
+ }), /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
disabled: !e.available,
- ...K(O.busy === "save"),
+ ...K(x.busy === "save"),
children: "保存配置"
})]
})
@@ -475,26 +475,26 @@ var qt = {
};
function Jt({ report: e, detected: t, suggested: n, create: r, creating: i }) {
let a = n.target, o = !!(t || a || n.root || e.permissions.length || e.folder || e.quota);
- return !o && !e.problems.length ? null : /* @__PURE__ */ (0, $.jsxs)(x, {
+ return !o && !e.problems.length ? null : /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
- children: [o ? /* @__PURE__ */ (0, $.jsxs)(j, { children: [
- t ? /* @__PURE__ */ (0, $.jsx)(J, {
+ children: [o ? /* @__PURE__ */ (0, $.jsxs)(O, { children: [
+ t ? /* @__PURE__ */ (0, $.jsx)(D, {
term: "CloudDrive2 地址",
children: `探测到 ${t},保存配置后生效`
}) : null,
- a?.exists ? /* @__PURE__ */ (0, $.jsx)(J, {
- term: /* @__PURE__ */ (0, $.jsx)(X, {
+ a?.exists ? /* @__PURE__ */ (0, $.jsx)(D, {
+ term: /* @__PURE__ */ (0, $.jsx)(z, {
source: "115",
label: "115 目标目录"
}),
children: n.saved ? `已根据媒体库目录填入 ${a.path}` : `根据媒体库目录填入 ${a.path},保存配置后生效`
}) : null,
- a && !a.exists ? /* @__PURE__ */ (0, $.jsxs)(J, {
- term: /* @__PURE__ */ (0, $.jsx)(X, {
+ a && !a.exists ? /* @__PURE__ */ (0, $.jsxs)(D, {
+ term: /* @__PURE__ */ (0, $.jsx)(z, {
source: "115",
label: "115 目标目录"
}),
- children: [`${a.path} 不存在`, r ? /* @__PURE__ */ (0, $.jsx)(V, {
+ children: [`${a.path} 不存在`, r ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
size: "small",
onClick: () => r(a.path),
@@ -502,171 +502,171 @@ function Jt({ report: e, detected: t, suggested: n, create: r, creating: i }) {
children: "新建这个目录"
}) : null]
}) : null,
- n.root ? /* @__PURE__ */ (0, $.jsx)(J, {
- term: /* @__PURE__ */ (0, $.jsx)(X, {
+ n.root ? /* @__PURE__ */ (0, $.jsx)(D, {
+ term: /* @__PURE__ */ (0, $.jsx)(z, {
source: "pikpak",
label: "PikPak 根目录"
}),
children: `根据媒体库目录填入 ${n.root},保存配置后生效`
}) : null,
- e.permissions.length ? /* @__PURE__ */ (0, $.jsx)(J, {
+ e.permissions.length ? /* @__PURE__ */ (0, $.jsx)(D, {
term: "离线权限",
- children: e.missing.length ? e.missing.map((e) => /* @__PURE__ */ (0, $.jsx)(je, {
+ children: e.missing.length ? e.missing.map((e) => /* @__PURE__ */ (0, $.jsx)(y, {
variant: "caption",
color: "yellow",
children: `缺 ${e}`
- }, e)) : /* @__PURE__ */ (0, $.jsx)(je, {
+ }, e)) : /* @__PURE__ */ (0, $.jsx)(y, {
variant: "caption",
color: "lime",
children: "齐全"
})
}) : null,
- e.folder ? /* @__PURE__ */ (0, $.jsx)(J, {
+ e.folder ? /* @__PURE__ */ (0, $.jsx)(D, {
term: "目标目录",
children: e.folder.can_offline ? `${e.folder.path} 可以离线下载` : `${e.folder.path} 不支持离线下载`
}) : null,
- e.quota ? /* @__PURE__ */ (0, $.jsx)(J, {
- term: /* @__PURE__ */ (0, $.jsx)(X, {
+ e.quota ? /* @__PURE__ */ (0, $.jsx)(D, {
+ term: /* @__PURE__ */ (0, $.jsx)(z, {
source: "115",
label: "115 离线配额"
}),
children: `本月还剩 ${e.quota.left} 条,共 ${e.quota.total} 条`
}) : null
- ] }) : null, e.problems.map((e) => /* @__PURE__ */ (0, $.jsx)(k, { children: e }, e))]
+ ] }) : null, e.problems.map((e) => /* @__PURE__ */ (0, $.jsx)(S, { children: e }, e))]
});
}
-function Yt({ state: e, settle: n, receipt: o, username: s, setUsername: c }) {
- let [u, d] = (0, Z.useState)(""), [p, m] = (0, Z.useState)(!1), [h, g] = (0, Z.useState)(""), [_, v] = (0, Z.useState)(""), [b, S] = (0, Z.useState)(""), C = f(), T = e.pikpak, E = e.pikpak_browser, D = E.state === "waiting";
+function Yt({ state: e, settle: t, receipt: n, username: r, setUsername: i }) {
+ let [a, o] = (0, Z.useState)(""), [s, c] = (0, Z.useState)(!1), [l, u] = (0, Z.useState)(""), [f, p] = (0, Z.useState)(""), [m, h] = (0, Z.useState)(""), g = Y(), _ = e.pikpak, y = e.pikpak_browser, b = y.state === "waiting";
(0, Z.useEffect)(() => {
- if (!D) return;
- let e = new AbortController(), t, r = async () => {
+ if (!b) return;
+ let e = new AbortController(), r, i = async () => {
try {
- let t = await N(Vt, e.signal);
- if (e.signal.aborted || (n(t), t.pikpak_browser.state === "done" ? o("已登录 PikPak") : t.pikpak_browser.state !== "waiting" && S(t.pikpak_browser.message), t.pikpak_browser.state !== "waiting")) return;
+ let r = await W(Vt, e.signal);
+ if (e.signal.aborted || (t(r), r.pikpak_browser.state === "done" ? n("已登录 PikPak") : r.pikpak_browser.state !== "waiting" && h(r.pikpak_browser.message), r.pikpak_browser.state !== "waiting")) return;
} catch (t) {
if (e.signal.aborted) return;
- v(l(t));
+ p(q(t));
}
- t = setTimeout(r, Ht);
+ r = setTimeout(i, Ht);
};
- return t = setTimeout(r, Ht), () => {
- e.abort(), clearTimeout(t);
+ return r = setTimeout(i, Ht), () => {
+ e.abort(), clearTimeout(r);
};
- }, [D]);
- let O = () => {
- S(""), C.run("browser", (e) => L(Vt, {}, "POST", e), (e) => {
- n(e), v("");
- }, (e) => v(l(e)));
- }, A = () => {
- C.run("cancel", (e) => L(`${Vt}/cancel`, {}, "POST", e), (e) => {
- n(e), v(""), S(e.pikpak_browser.message);
- }, (e) => v(l(e)));
- }, ee = (e) => {
- if (e.preventDefault(), T.logged_in) return;
- let t = {
- username: s,
- password: u,
- remember: p
+ }, [b]);
+ let x = () => {
+ h(""), g.run("browser", (e) => G(Vt, {}, "POST", e), (e) => {
+ t(e), p("");
+ }, (e) => p(q(e)));
+ }, w = () => {
+ g.run("cancel", (e) => G(`${Vt}/cancel`, {}, "POST", e), (e) => {
+ t(e), p(""), h(e.pikpak_browser.message);
+ }, (e) => p(q(e)));
+ }, T = (e) => {
+ if (e.preventDefault(), _.logged_in) return;
+ let i = {
+ username: r,
+ password: a,
+ remember: s
};
- C.run("login", (e) => L(zt, t, "POST", e), (e) => {
- n(e.settings), v(""), e.ok ? (g(""), d(""), o("已登录 PikPak")) : g(e.captcha_url ?? "");
- }, (e) => v(l(e)));
- }, M = () => {
- C.run("logout", (e) => L(Bt, {}, "POST", e), (e) => {
- n(e), v(""), o("已登出 PikPak");
- }, (e) => v(l(e)));
- }, P = /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
- /* @__PURE__ */ (0, $.jsx)(G, {
+ g.run("login", (e) => G(zt, i, "POST", e), (e) => {
+ t(e.settings), p(""), e.ok ? (u(""), o(""), n("已登录 PikPak")) : u(e.captcha_url ?? "");
+ }, (e) => p(q(e)));
+ }, E = () => {
+ g.run("logout", (e) => G(Bt, {}, "POST", e), (e) => {
+ t(e), p(""), n("已登出 PikPak");
+ }, (e) => p(q(e)));
+ }, ee = /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "账号",
placeholder: "邮箱或手机号",
autoComplete: "username",
maxLength: 200,
- value: s,
+ value: r,
isDisabled: !e.available,
- onChange: c
+ onChange: i
}),
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "密码",
type: "password",
autoComplete: "current-password",
maxLength: 200,
- value: u,
+ value: a,
isDisabled: !e.available,
- onChange: d
+ onChange: o
}),
- /* @__PURE__ */ (0, $.jsx)(ne, {
- isSelected: p,
+ /* @__PURE__ */ (0, $.jsx)(v, {
+ isSelected: s,
isDisabled: !e.available,
- onChange: m,
+ onChange: c,
children: "保存密码,登录过期时自动重新登录"
}),
- h ? /* @__PURE__ */ (0, $.jsx)(q, {
+ l ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "warning",
title: "需要人机验证",
extra: /* @__PURE__ */ (0, $.jsx)("div", {
className: "pt-2",
- children: /* @__PURE__ */ (0, $.jsx)(i, {
- href: h,
+ children: /* @__PURE__ */ (0, $.jsx)(C, {
+ href: l,
children: "打开 PikPak 验证页"
})
}),
children: "在浏览器里完成验证后,回到这里再点一次「登录」。"
}) : null
- ] }), F = /* @__PURE__ */ (0, $.jsx)(V, {
+ ] }), k = /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
variant: "primary",
- disabled: !e.available || D,
- ...K(C.busy === "login"),
+ disabled: !e.available || b,
+ ...K(g.busy === "login"),
children: "登录"
- }), I = E.state === "timeout" || E.state === "failed";
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ }), te = y.state === "timeout" || y.state === "failed";
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "PikPak 账号",
icon: /* @__PURE__ */ (0, $.jsx)(Ut, {}),
- onSubmit: ee,
- aside: /* @__PURE__ */ (0, $.jsx)(y, {
- tone: T.logged_in ? "success" : D ? "progress" : I ? "error" : "neutral",
- children: T.logged_in ? "已登录" : D ? "等待登录" : I ? "登录未完成" : "待登录"
+ onSubmit: T,
+ aside: /* @__PURE__ */ (0, $.jsx)(H, {
+ tone: _.logged_in ? "success" : b ? "progress" : te ? "error" : "neutral",
+ children: _.logged_in ? "已登录" : b ? "等待登录" : te ? "登录未完成" : "待登录"
}),
children: [
- T.logged_in ? /* @__PURE__ */ (0, $.jsxs)(j, { children: [/* @__PURE__ */ (0, $.jsx)(J, {
+ _.logged_in ? /* @__PURE__ */ (0, $.jsxs)(O, { children: [/* @__PURE__ */ (0, $.jsx)(D, {
term: "账号",
- children: T.username || "已登录"
- }), T.method === "browser" ? /* @__PURE__ */ (0, $.jsx)(J, {
+ children: _.username || "已登录"
+ }), _.method === "browser" ? /* @__PURE__ */ (0, $.jsx)(D, {
term: "登录方式",
children: "浏览器登录,由 Peach 续期"
- }) : /* @__PURE__ */ (0, $.jsx)(J, {
+ }) : /* @__PURE__ */ (0, $.jsx)(D, {
term: "密码",
- children: T.remember ? "已保存,登录过期时自动重新登录" : "未保存,登录过期后需要回到这里重新登录"
- })] }) : /* @__PURE__ */ (0, $.jsxs)(x, { children: [b ? I ? /* @__PURE__ */ (0, $.jsx)(k, { children: b }) : /* @__PURE__ */ (0, $.jsx)(w, {
+ children: _.remember ? "已保存,登录过期时自动重新登录" : "未保存,登录过期后需要回到这里重新登录"
+ })] }) : /* @__PURE__ */ (0, $.jsxs)(V, { children: [m ? te ? /* @__PURE__ */ (0, $.jsx)(S, { children: m }) : /* @__PURE__ */ (0, $.jsx)(j, {
role: "status",
- children: b
- }) : null, P] }),
- _ || C.error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ children: m
+ }) : null, ee] }),
+ f || g.error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: _ || C.error })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: f || g.error })
}) : null,
- /* @__PURE__ */ (0, $.jsx)(a, {
- status: !T.logged_in && D ? /* @__PURE__ */ (0, $.jsx)(r, { label: E.message || "等你在浏览器窗口里登录 PikPak" }) : null,
- children: T.logged_in ? /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(A, {
+ status: !_.logged_in && b ? /* @__PURE__ */ (0, $.jsx)(oe, { label: y.message || "等你在浏览器窗口里登录 PikPak" }) : null,
+ children: _.logged_in ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- onClick: M,
+ onClick: E,
disabled: !e.available,
- ...K(C.busy === "logout"),
+ ...K(g.busy === "logout"),
children: "登出"
- }) : /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [E.available ? D ? /* @__PURE__ */ (0, $.jsx)(V, {
+ }) : /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [y.available ? b ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
type: "button",
- onClick: A,
- ...K(C.busy === "cancel"),
+ onClick: w,
+ ...K(g.busy === "cancel"),
children: "取消"
- }) : /* @__PURE__ */ (0, $.jsx)(V, {
+ }) : /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
type: "button",
- onClick: O,
+ onClick: x,
disabled: !e.available,
- ...K(C.busy === "browser"),
+ ...K(g.busy === "browser"),
children: "用浏览器登录"
- }) : null, F] })
+ }) : null, k] })
})
]
});
@@ -674,15 +674,15 @@ function Yt({ state: e, settle: n, receipt: o, username: s, setUsername: c }) {
//#endregion
//#region src/react/settings/library-sharing-settings.tsx
function Xt({ initial: e, receipt: t }) {
- let [n, r] = (0, Z.useState)(e), [i, o] = (0, Z.useState)(null), [s, c] = (0, Z.useState)(!1), [l, u] = (0, Z.useState)(!1), d = (0, Z.useMemo)(() => i ? JSON.stringify(i.data, null, 2) : "", [i]), p = f(), m = (e) => void p.run("save", (t) => L("/api/configuration/library-sharing", {
+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(null), [o, s] = (0, Z.useState)(!1), [c, l] = (0, Z.useState)(!1), u = (0, Z.useMemo)(() => i ? JSON.stringify(i.data, null, 2) : "", [i]), f = Y(), p = (e) => void f.run("save", (t) => G("/api/configuration/library-sharing", {
enabled: e,
schema: n.schema,
- consent: l,
+ consent: c,
preview_token: i?.token
}, "POST", t), (e) => {
- r(e), o(null), u(!1), c(!1), t("已保存馆藏与口味上传选项");
- }), h = () => {
- let e = URL.createObjectURL(new Blob([d], { type: "application/json" })), t = document.createElement("a");
+ r(e), a(null), l(!1), s(!1), t("已保存馆藏与口味上传选项");
+ }), m = () => {
+ let e = URL.createObjectURL(new Blob([u], { type: "application/json" })), t = document.createElement("a");
t.href = e, t.download = "peach-library-taste-preview.json", document.body.append(t);
try {
t.click();
@@ -691,54 +691,54 @@ function Xt({ initial: e, receipt: t }) {
}
};
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
- /* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "上传馆藏与口味明细",
description: n.notice,
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "上传馆藏与口味明细",
isSelected: n.enabled,
- onChange: (e) => e ? c(!0) : m(!1),
- ...K(p.busy === "save")
+ onChange: (e) => e ? s(!0) : p(!1),
+ ...K(f.busy === "save")
})
}) }),
- n.available ? null : /* @__PURE__ */ (0, $.jsx)(x, {
+ n.available ? null : /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
children: /* @__PURE__ */ (0, $.jsx)("span", {
className: "self-start",
- children: /* @__PURE__ */ (0, $.jsx)(y, { children: "上传服务未配置" })
+ children: /* @__PURE__ */ (0, $.jsx)(H, { children: "上传服务未配置" })
})
}),
- n.enabled && n.last_attempt?.status === "failed" ? /* @__PURE__ */ (0, $.jsxs)(x, {
+ n.enabled && n.last_attempt?.status === "failed" ? /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
children: [/* @__PURE__ */ (0, $.jsx)("span", {
className: "self-start",
- children: /* @__PURE__ */ (0, $.jsx)(y, {
+ children: /* @__PURE__ */ (0, $.jsx)(H, {
tone: n.last_attempt.attempted ? "error" : "warning",
children: n.last_attempt.attempted ? "上传失败" : "待重新准备"
})
- }), /* @__PURE__ */ (0, $.jsx)(k, { children: n.last_attempt.attempted ? "馆藏与口味上传失败,本周不再发送。" : "馆藏与口味上传未完成,将自动重新准备。" })]
+ }), /* @__PURE__ */ (0, $.jsx)(S, { children: n.last_attempt.attempted ? "馆藏与口味上传失败,本周不再发送。" : "馆藏与口味上传未完成,将自动重新准备。" })]
}) : null,
- n.enabled && n.last_attempt?.status === "waiting-data" ? /* @__PURE__ */ (0, $.jsxs)(x, {
+ n.enabled && n.last_attempt?.status === "waiting-data" ? /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
children: [/* @__PURE__ */ (0, $.jsx)("span", {
className: "self-start",
- children: /* @__PURE__ */ (0, $.jsx)(y, { children: "等待数据" })
- }), /* @__PURE__ */ (0, $.jsx)(w, { children: "等待可分析的馆藏或偏好数据。" })]
+ children: /* @__PURE__ */ (0, $.jsx)(H, { children: "等待数据" })
+ }), /* @__PURE__ */ (0, $.jsx)(j, { children: "等待可分析的馆藏或偏好数据。" })]
}) : null,
- n.enabled && n.last_attempt?.status === "unknown" ? /* @__PURE__ */ (0, $.jsxs)(x, {
+ n.enabled && n.last_attempt?.status === "unknown" ? /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
children: [/* @__PURE__ */ (0, $.jsx)("span", {
className: "self-start",
- children: /* @__PURE__ */ (0, $.jsx)(y, {
+ children: /* @__PURE__ */ (0, $.jsx)(H, {
tone: "warning",
children: "结果未取得"
})
- }), /* @__PURE__ */ (0, $.jsx)(w, { children: "未取得上传结果,本周不再发送。" })]
+ }), /* @__PURE__ */ (0, $.jsx)(j, { children: "未取得上传结果,本周不再发送。" })]
}) : null,
- i ? /* @__PURE__ */ (0, $.jsxs)(x, {
+ i ? /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
children: [
- /* @__PURE__ */ (0, $.jsxs)(w, { children: [
+ /* @__PURE__ */ (0, $.jsxs)(j, { children: [
"当前预览包含 ",
i.data.library.length,
" 部有编号作品、",
@@ -747,56 +747,56 @@ function Xt({ initial: e, receipt: t }) {
(i.bytes / 1024).toFixed(1),
" KiB。不含账号、设备、文件路径和浏览器历史记录等个人数据。"
] }),
- /* @__PURE__ */ (0, $.jsx)(Y, {
+ /* @__PURE__ */ (0, $.jsx)(b, {
summary: "上传数据预览",
defaultOpen: !0,
children: /* @__PURE__ */ (0, $.jsx)(gt, {
- code: d,
+ code: u,
language: "json",
label: "馆藏与口味上传预览",
maxCharacters: 24e3
})
}),
- d.length > 24e3 ? /* @__PURE__ */ (0, $.jsx)(w, { children: "显示前 24,000 个字符,下载可查看完整内容。" }) : null,
- /* @__PURE__ */ (0, $.jsx)(V, {
+ u.length > 24e3 ? /* @__PURE__ */ (0, $.jsx)(j, { children: "显示前 24,000 个字符,下载可查看完整内容。" }) : null,
+ /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- onClick: h,
+ onClick: m,
children: "下载完整预览"
}),
- n.enabled ? null : /* @__PURE__ */ (0, $.jsx)(ne, {
- isSelected: l,
- onChange: u,
+ n.enabled ? null : /* @__PURE__ */ (0, $.jsx)(v, {
+ isSelected: c,
+ onChange: l,
children: "我已查看上传预览,同意上传馆藏与口味明细"
})
]
}) : null,
- p.error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ f.error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: p.error })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: f.error })
}) : null,
- /* @__PURE__ */ (0, $.jsxs)(a, { children: [
- s && !n.enabled ? /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsxs)(A, { children: [
+ o && !n.enabled ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
onClick: () => {
- c(!1), o(null), u(!1);
+ s(!1), a(null), l(!1);
},
children: "取消"
}) : null,
- /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
onClick: () => {
- c(!0), p.run("preview", (e) => N("/api/configuration/library-sharing/preview", e), (e) => {
- o(e), u(!1);
+ s(!0), f.run("preview", (e) => W("/api/configuration/library-sharing/preview", e), (e) => {
+ a(e), l(!1);
});
},
- ...K(p.busy === "preview"),
+ ...K(f.busy === "preview"),
children: "预览上传内容"
}),
- !n.enabled && i ? /* @__PURE__ */ (0, $.jsx)(V, {
+ !n.enabled && i ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "primary",
- disabled: !l,
- onClick: () => m(!0),
- ...K(p.busy === "save"),
+ disabled: !c,
+ onClick: () => p(!0),
+ ...K(f.busy === "save"),
children: "同意并开启上传"
}) : null
] })
@@ -805,10 +805,10 @@ function Xt({ initial: e, receipt: t }) {
//#endregion
//#region src/react/settings/remote-reporting-settings.tsx
function Zt({ value: e, onChange: t, busy: n = !1 }) {
- return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "发送版本统计与错误诊断(推荐)",
description: "上传版本、系统信息、故障类型、代码位置与发生次数。",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "发送版本统计与错误诊断(推荐)",
isSelected: e.usage && e.errors,
onChange: (n) => t({
@@ -818,141 +818,141 @@ function Zt({ value: e, onChange: t, busy: n = !1 }) {
}),
...K(n)
})
- }) }), e.available ? null : /* @__PURE__ */ (0, $.jsx)(x, {
+ }) }), e.available ? null : /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
children: /* @__PURE__ */ (0, $.jsx)("span", {
className: "self-start",
- children: /* @__PURE__ */ (0, $.jsx)(y, { children: "上传服务未配置" })
+ children: /* @__PURE__ */ (0, $.jsx)(H, { children: "上传服务未配置" })
})
})] });
}
function Qt({ initial: e, receipt: t }) {
- let [n, r] = (0, Z.useState)(e), i = f();
+ let [n, r] = (0, Z.useState)(e), i = Y();
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(Zt, {
value: n,
busy: i.busy === "save",
onChange: (e) => {
- i.run("save", (t) => L("/api/configuration/remote-reporting", {
+ i.run("save", (t) => G("/api/configuration/remote-reporting", {
usage: e.usage,
errors: e.errors
}, "POST", t), (e) => {
r(e), t("已保存诊断选项");
});
}
- }), i.error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ }), i.error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: i.error })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: i.error })
}) : null] });
}
//#endregion
//#region src/react/settings/storage-settings.tsx
-var $t = "/api/configuration/storage", en = 1500, tn = 864e5, nn = (e) => e instanceof p && e.body?.errors?.target || l(e);
+var $t = "/api/configuration/storage", en = 1500, tn = 864e5, nn = (e) => e instanceof u && e.body?.errors?.target || q(e);
function rn(e) {
if (e.free_bytes === null || e.total_bytes === null) return "未取得";
- let t = `${ae(e.free_bytes)} 可用,共 ${ae(e.total_bytes)}`;
+ let t = `${Ke(e.free_bytes)} 可用,共 ${Ke(e.total_bytes)}`;
return e.system_drive ? `${t}(系统盘)` : t;
}
-function an({ initial: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e), [o, s] = (0, Z.useState)(""), c = f(), l = r.job.state !== "idle", u = (0, Z.useRef)(l);
+function an({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(""), o = Y(), s = n.job.state !== "idle", c = (0, Z.useRef)(s);
(0, Z.useEffect)(() => {
- if (!l) return;
+ if (!s) return;
let e = new AbortController(), t = setTimeout(() => {
- N($t, e.signal).then(i, () => {
- e.signal.aborted || i((e) => ({ ...e }));
+ W($t, e.signal).then(r, () => {
+ e.signal.aborted || r((e) => ({ ...e }));
});
}, en);
return () => {
e.abort(), clearTimeout(t);
};
- }, [r]), (0, Z.useEffect)(() => {
- l ? u.current = !0 : u.current && (u.current = !1, r.job.error || n(r.job.message || "已统计占用空间"));
- }, [l]);
- let p = () => void c.run("measure", (e) => L(`${$t}/measure`, {}, "POST", e), i), m = (e) => void A({
+ }, [n]), (0, Z.useEffect)(() => {
+ s ? c.current = !0 : c.current && (c.current = !1, n.job.error || t(n.job.message || "已统计占用空间"));
+ }, [s]);
+ let l = () => void o.run("measure", (e) => G(`${$t}/measure`, {}, "POST", e), r), u = (e) => void Ie({
title: `清理${e.label}`,
- body: `将删除 ${ae(e.reclaimable)} 的${e.label},${e.description}。`,
+ body: `将删除 ${Ke(e.reclaimable)} 的${e.label},${e.description}。`,
confirmLabel: `清理${e.label}`,
danger: e.key === "backups",
- onConfirm: async () => i(await L(`${$t}/clean`, { category: e.key }))
- }), h = () => void c.run("relocate", async (e) => {
- let t = (await L(pt, { initial: r.data_root }, "POST", e)).path;
+ onConfirm: async () => r(await G(`${$t}/clean`, { category: e.key }))
+ }), f = () => void o.run("relocate", async (e) => {
+ let t = (await G(fe, { initial: n.data_root }, "POST", e)).path;
if (!t) return;
- let n = r.usage ? ae(r.usage.total_bytes) : "";
- await A({
+ let r = n.usage ? Ke(n.usage.total_bytes) : "";
+ await Ie({
title: "迁移数据目录",
- body: `将 ${n} 数据从 ${r.data_root} 移到 ${t}。迁移期间 Peach 会退出,完成后自动重新打开;原位置的数据在新位置核对无误后删除。`,
+ body: `将 ${r} 数据从 ${n.data_root} 移到 ${t}。迁移期间 Peach 会退出,完成后自动重新打开;原位置的数据在新位置核对无误后删除。`,
confirmLabel: "迁移数据目录",
onConfirm: async () => {
try {
- s((await L(`${$t}/relocate`, { target: t })).message);
+ a((await G(`${$t}/relocate`, { target: t })).message);
} catch (e) {
throw Error(nn(e));
}
}
});
- }, () => void 0), g = r.usage, _ = r.relocation.last, v = _ && (_.state === "error" || (_.notes?.length ?? 0) > 0 || Date.now() - _.finished_at * 1e3 < tn), y = o || (r.job.state === "measuring" ? "正在统计占用空间…" : r.job.state === "cleaning" ? "正在清理…" : g ? `共 ${ae(g.total_bytes)},${g.total_files.toLocaleString()} 个文件` : ""), b = l || !!o;
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ }, () => void 0), p = n.usage, m = n.relocation.last, h = m && (m.state === "error" || (m.notes?.length ?? 0) > 0 || Date.now() - m.finished_at * 1e3 < tn), g = i || (n.job.state === "measuring" ? "正在统计占用空间…" : n.job.state === "cleaning" ? "正在清理…" : p ? `共 ${Ke(p.total_bytes)},${p.total_files.toLocaleString()} 个文件` : ""), _ = s || !!i;
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
id: "storageSettings",
title: "存储空间",
children: [
- /* @__PURE__ */ (0, $.jsxs)(j, { children: [/* @__PURE__ */ (0, $.jsx)(J, {
+ /* @__PURE__ */ (0, $.jsxs)(O, { children: [/* @__PURE__ */ (0, $.jsx)(D, {
term: "数据目录",
- children: /* @__PURE__ */ (0, $.jsx)(d, {
- path: r.data_root,
+ children: /* @__PURE__ */ (0, $.jsx)(_e, {
+ path: n.data_root,
className: "text-body-regular text-text-primary",
- onRevealed: n
+ onRevealed: t
})
- }), /* @__PURE__ */ (0, $.jsx)(J, {
+ }), /* @__PURE__ */ (0, $.jsx)(D, {
term: "所在磁盘",
- children: rn(r)
+ children: rn(n)
})] }),
- g ? /* @__PURE__ */ (0, $.jsx)(W, { children: g.categories.map((e) => /* @__PURE__ */ (0, $.jsx)(T, {
+ p ? /* @__PURE__ */ (0, $.jsx)(P, { children: p.categories.map((e) => /* @__PURE__ */ (0, $.jsx)(R, {
label: e.label,
description: e.cleanable && e.description ? e.description : void 0,
children: /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex shrink-0 items-center gap-3",
children: [/* @__PURE__ */ (0, $.jsx)("span", {
className: "text-body-regular text-text-secondary tabular-nums",
- children: ae(e.bytes)
+ children: Ke(e.bytes)
}), e.cleanable && e.reclaimable > 0 ? (() => {
- let t = r.job.state === "cleaning" && r.job.category === e.key;
- return /* @__PURE__ */ (0, $.jsxs)(V, {
+ let t = n.job.state === "cleaning" && n.job.category === e.key;
+ return /* @__PURE__ */ (0, $.jsxs)(d, {
variant: "secondary",
- disabled: b && !t,
+ disabled: _ && !t,
...K(t),
- onClick: () => m(e),
- children: ["清理 ", ae(e.reclaimable)]
+ onClick: () => u(e),
+ children: ["清理 ", Ke(e.reclaimable)]
});
})() : null]
})
- }, e.key)) }) : /* @__PURE__ */ (0, $.jsx)(x, {
+ }, e.key)) }) : /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(w, { children: "统计后显示各类数据的占用,并可清理缓存与旧备份。" })
+ children: /* @__PURE__ */ (0, $.jsx)(j, { children: "统计后显示各类数据的占用,并可清理缓存与旧备份。" })
}),
- !r.relocation.available || r.job.error || c.error || v ? /* @__PURE__ */ (0, $.jsxs)(x, {
+ !n.relocation.available || n.job.error || o.error || h ? /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
children: [
- r.relocation.available ? null : /* @__PURE__ */ (0, $.jsx)(w, { children: r.relocation.message }),
- r.job.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: r.job.message }) : null,
- c.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: c.error }) : null,
- v && _ ? _.state === "error" ? /* @__PURE__ */ (0, $.jsx)(k, { children: _.message }) : /* @__PURE__ */ (0, $.jsx)(w, { children: [_.message, ..._.notes ?? []].join(";") }) : null
+ n.relocation.available ? null : /* @__PURE__ */ (0, $.jsx)(j, { children: n.relocation.message }),
+ n.job.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: n.job.message }) : null,
+ o.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: o.error }) : null,
+ h && m ? m.state === "error" ? /* @__PURE__ */ (0, $.jsx)(S, { children: m.message }) : /* @__PURE__ */ (0, $.jsx)(j, { children: [m.message, ...m.notes ?? []].join(";") }) : null
]
}) : null,
- /* @__PURE__ */ (0, $.jsxs)(a, {
- status: y ? /* @__PURE__ */ (0, $.jsx)("p", {
- role: o ? "status" : void 0,
- children: y
+ /* @__PURE__ */ (0, $.jsxs)(A, {
+ status: g ? /* @__PURE__ */ (0, $.jsx)("p", {
+ role: i ? "status" : void 0,
+ children: g
}) : null,
- children: [/* @__PURE__ */ (0, $.jsx)(V, {
+ children: [/* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- disabled: b || !r.relocation.available || !g,
- onClick: h,
- ...K(c.busy === "relocate"),
+ disabled: _ || !n.relocation.available || !p,
+ onClick: f,
+ ...K(o.busy === "relocate"),
children: "更改位置"
- }), /* @__PURE__ */ (0, $.jsx)(V, {
- disabled: !!o || r.job.state === "cleaning",
- onClick: p,
- ...K(c.busy === "measure" || r.job.state === "measuring"),
- children: g ? "重新统计" : "统计占用"
+ }), /* @__PURE__ */ (0, $.jsx)(d, {
+ disabled: !!i || n.job.state === "cleaning",
+ onClick: l,
+ ...K(o.busy === "measure" || n.job.state === "measuring"),
+ children: p ? "重新统计" : "统计占用"
})]
})
]
@@ -965,178 +965,178 @@ var on = [
["24", "每天"],
["168", "每周"]
];
-function sn({ data: e, receipt: n, reopenTutorial: r, panel: i }) {
+function sn({ data: e, receipt: t, reopenTutorial: n, panel: r }) {
return /* @__PURE__ */ (0, $.jsxs)("div", {
- ...Q(i),
+ ...Q(r),
children: [
e.storage ? /* @__PURE__ */ (0, $.jsx)(an, {
initial: e.storage,
- receipt: n
+ receipt: t
}) : null,
- e.remote_reporting || e.library_sharing ? /* @__PURE__ */ (0, $.jsxs)(t, {
+ e.remote_reporting || e.library_sharing ? /* @__PURE__ */ (0, $.jsxs)(F, {
id: "librarySharing",
title: "数据上传",
children: [e.remote_reporting ? /* @__PURE__ */ (0, $.jsx)(Qt, {
initial: e.remote_reporting,
- receipt: n
+ receipt: t
}) : null, e.library_sharing ? /* @__PURE__ */ (0, $.jsx)("div", {
className: "border-t border-separator-border",
children: /* @__PURE__ */ (0, $.jsx)(Xt, {
initial: e.library_sharing,
- receipt: n
+ receipt: t
})
}) : null]
}) : null,
/* @__PURE__ */ (0, $.jsx)(un, { facts: e.facts }),
/* @__PURE__ */ (0, $.jsx)(cn, {
- receipt: n,
- reopenTutorial: r
+ receipt: t,
+ reopenTutorial: n
}),
e.uninstall ? /* @__PURE__ */ (0, $.jsx)(dn, {
uninstall: e.uninstall,
- receipt: n
+ receipt: t
}) : null
]
});
}
function cn({ receipt: e, reopenTutorial: t }) {
- let n = f();
+ let n = Y();
return /* @__PURE__ */ (0, $.jsx)("section", {
"aria-label": "安装教程",
className: "w-full",
- children: /* @__PURE__ */ (0, $.jsxs)(S, { children: [/* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ children: /* @__PURE__ */ (0, $.jsxs)(Ee, { children: [/* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "安装教程",
- children: /* @__PURE__ */ (0, $.jsx)(V, {
+ children: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
onClick: () => void n.run("reopen", () => t(), () => e("已重新打开安装教程")),
...K(n.busy === "reopen"),
children: "重新打开教程"
})
- }) }), n.error ? /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsx)(k, { children: n.error }) }) : null] })
+ }) }), n.error ? /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsx)(S, { children: n.error }) }) : null] })
});
}
-function ln({ initial: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e.mode), [o, s] = (0, Z.useState)(e.interval_hours), c = f(e.error), l = (t) => {
- t.preventDefault(), e.available && c.run("save", (e) => L("/api/configuration/automatic-updates", {
- mode: r,
- interval_hours: o
- }, "POST", e), () => n("已保存配置"));
- }, u = e.available ? e.download_available ? "下载完成后在这里确认重启安装。" : void 0 : "自动更新需要由托盘管理的服务。";
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+function ln({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e.mode), [i, a] = (0, Z.useState)(e.interval_hours), o = Y(e.error), s = (r) => {
+ r.preventDefault(), e.available && o.run("save", (e) => G("/api/configuration/automatic-updates", {
+ mode: n,
+ interval_hours: i
+ }, "POST", e), () => t("已保存配置"));
+ }, c = e.available ? e.download_available ? "下载完成后在这里确认重启安装。" : void 0 : "自动更新需要由托盘管理的服务。";
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
id: "automaticUpdates",
title: "自动更新",
- onSubmit: l,
+ onSubmit: s,
children: [
- /* @__PURE__ */ (0, $.jsxs)(W, { children: [
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsxs)(P, { children: [
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "自动检查新版本",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "自动检查新版本",
- isSelected: r !== "off",
+ isSelected: n !== "off",
isDisabled: !e.available,
- onChange: (e) => i(e ? "check" : "off")
+ onChange: (e) => r(e ? "check" : "off")
})
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "自动下载更新",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "自动下载更新",
- isSelected: r === "download",
- isDisabled: !e.available || !e.download_available || r === "off",
- onChange: (e) => i(e ? "download" : "check")
+ isSelected: n === "download",
+ isDisabled: !e.available || !e.download_available || n === "off",
+ onChange: (e) => r(e ? "download" : "check")
})
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "检查频率",
- description: u,
- children: /* @__PURE__ */ (0, $.jsx)(H, {
+ description: c,
+ children: /* @__PURE__ */ (0, $.jsx)(I, {
"aria-label": "检查频率",
- selectedKey: String(o),
+ selectedKey: String(i),
isDisabled: !e.available,
onSelectionChange: (e) => {
- e !== null && s(Number(e));
+ e !== null && a(Number(e));
},
- children: on.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: on.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
children: t
}, e))
})
})
] }),
- c.error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ o.error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: c.error })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: o.error })
}) : null,
- /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
disabled: !e.available,
- ...K(c.busy === "save"),
+ ...K(o.busy === "save"),
children: "保存配置"
}) })
]
});
}
function un({ facts: e }) {
- return /* @__PURE__ */ (0, $.jsx)(t, {
+ return /* @__PURE__ */ (0, $.jsx)(F, {
title: "运行信息",
- children: /* @__PURE__ */ (0, $.jsx)(j, { children: e.map((e) => /* @__PURE__ */ (0, $.jsxs)(J, {
+ children: /* @__PURE__ */ (0, $.jsx)(O, { children: e.map((e) => /* @__PURE__ */ (0, $.jsxs)(D, {
term: e.term,
- children: [e.value, e.download_url ? /* @__PURE__ */ (0, $.jsx)(i, {
+ children: [e.value, e.download_url ? /* @__PURE__ */ (0, $.jsx)(C, {
href: e.download_url,
children: e.download_label
}) : null]
}, e.term)) })
});
}
-function dn({ uninstall: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(!1), [o, s] = (0, Z.useState)(""), c = () => void A({
+function dn({ uninstall: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(!1), [i, a] = (0, Z.useState)(""), o = () => void Ie({
title: "卸载 Peach",
danger: !0,
- body: r ? "将退出 Peach,移除程序、开机自启、桌面图标、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序、开机自启和桌面图标。设置、本地数据库、观看记录与缓存保留。",
+ body: n ? "将退出 Peach,移除程序、开机自启、桌面图标、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序、开机自启和桌面图标。设置、本地数据库、观看记录与缓存保留。",
confirmLabel: "卸载 Peach",
onConfirm: async () => {
- let e = await L("/api/configuration/uninstall", {
- delete_data: r,
+ let e = await G("/api/configuration/uninstall", {
+ delete_data: n,
confirmation: "卸载 Peach"
});
- s(e.message);
+ a(e.message);
}
- }), l = o || e.message, u = [.../* @__PURE__ */ new Set([e.data_root, ...e.directories])];
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ }), s = i || e.message, c = [.../* @__PURE__ */ new Set([e.data_root, ...e.directories])];
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
id: "uninstallPeach",
title: "卸载 Peach",
children: [
- e.available ? /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsx)(w, { children: "卸载移除 Peach 程序本身,原始媒体文件保留。" }) }) : null,
- /* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ e.available ? /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsx)(j, { children: "卸载移除 Peach 程序本身,原始媒体文件保留。" }) }) : null,
+ /* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "完全卸载",
description: "同时删除设置、本地数据库、观看记录、凭据和缓存",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "完全卸载",
- isSelected: r,
- isDisabled: !e.full_available || !!o,
- onChange: i
+ isSelected: n,
+ isDisabled: !e.full_available || !!i,
+ onChange: r
})
}) }),
- /* @__PURE__ */ (0, $.jsx)(x, {
+ /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(Y, {
+ children: /* @__PURE__ */ (0, $.jsx)(b, {
summary: "数据目录",
- children: u.map((e) => /* @__PURE__ */ (0, $.jsx)(d, {
+ children: c.map((e) => /* @__PURE__ */ (0, $.jsx)(_e, {
path: e,
className: "text-body-2-regular text-text-secondary",
- onRevealed: n
+ onRevealed: t
}, e))
})
}),
- /* @__PURE__ */ (0, $.jsx)(a, {
- status: l ? /* @__PURE__ */ (0, $.jsx)("p", {
- role: o ? "status" : void 0,
- children: l
+ /* @__PURE__ */ (0, $.jsx)(A, {
+ status: s ? /* @__PURE__ */ (0, $.jsx)("p", {
+ role: i ? "status" : void 0,
+ children: s
}) : null,
- children: /* @__PURE__ */ (0, $.jsx)(V, {
+ children: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "danger",
- disabled: !e.available || !!o,
- onClick: c,
+ disabled: !e.available || !!i,
+ onClick: o,
children: "卸载 Peach"
})
})
@@ -1157,136 +1157,136 @@ var fn = /* @__PURE__ */ new Set([
75,
90
], mn = 120;
-function hn({ initial: e, initialJob: n }) {
- let [r, o] = (0, Z.useState)(e), [s, c] = (0, Z.useState)(n || {
+function hn({ initial: e, initialJob: t }) {
+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(t || {
state: "idle",
progress: 0
- }), [u, d] = (0, Z.useState)(""), p = f(), m = (0, Z.useRef)(!1), h = (0, Z.useRef)(!0), g = fn.has(s.state);
- (0, Z.useEffect)(() => (h.current = !0, () => {
- h.current = !1;
+ }), [o, s] = (0, Z.useState)(""), c = Y(), l = (0, Z.useRef)(!1), u = (0, Z.useRef)(!0), f = fn.has(i.state);
+ (0, Z.useEffect)(() => (u.current = !0, () => {
+ u.current = !1;
}), []);
- let _ = async () => {
- let e = await L("/api/configuration/update-restart", {});
- h.current && c(e);
- }, v = () => void A({
+ let p = async () => {
+ let e = await G("/api/configuration/update-restart", {});
+ u.current && a(e);
+ }, m = () => void Ie({
title: "更新已准备好",
- body: `Peach ${s.version || ""} 将在重启后安装。`,
+ body: `Peach ${i.version || ""} 将在重启后安装。`,
confirmLabel: "立即重启",
cancelLabel: "稍后",
- onConfirm: _
+ onConfirm: p
});
(0, Z.useEffect)(() => {
- s.state !== "ready" || m.current || (m.current = !0, v());
- }, [s.state]), (0, Z.useEffect)(() => {
- let e = new AbortController(), t = fn.has(s.state) ? 1e3 : 3e4, n, r = 0, i = async () => {
+ i.state !== "ready" || l.current || (l.current = !0, m());
+ }, [i.state]), (0, Z.useEffect)(() => {
+ let e = new AbortController(), t = fn.has(i.state) ? 1e3 : 3e4, n, o = 0, c = async () => {
try {
- let t = await N("/api/configuration/update-status", e.signal);
+ let t = await W("/api/configuration/update-status", e.signal);
if (e.signal.aborted) return;
- c(t), r = 0, t.state === "complete" && o((e) => ({
+ a(t), o = 0, t.state === "complete" && r((e) => ({
...e,
current_version: t.version || e.current_version,
state: "current",
message: "已是最新测试版。"
}));
- let n = await N("/api/configuration/automatic-updates", e.signal);
- !e.signal.aborted && n.result && o(n.result);
+ let n = await W("/api/configuration/automatic-updates", e.signal);
+ !e.signal.aborted && n.result && r(n.result);
} catch {
- r += 1, r >= mn && !e.signal.aborted && d("尚未连接到 Peach,请检查托盘后刷新页面。");
+ o += 1, o >= mn && !e.signal.aborted && s("尚未连接到 Peach,请检查托盘后刷新页面。");
}
- !e.signal.aborted && r < mn && (n = setTimeout(i, t));
+ !e.signal.aborted && o < mn && (n = setTimeout(c, t));
};
- return n = setTimeout(i, t), () => {
+ return n = setTimeout(c, t), () => {
e.abort(), clearTimeout(n);
};
- }, [s.state]);
- let b = () => {
- g || (m.current = !1, d(""), p.run("download", (e) => L("/api/configuration/update", {}, "POST", e), c));
- }, S = () => void p.run("check", (e) => N("/api/configuration/updates", e), o, (t) => {
- o({
+ }, [i.state]);
+ let h = () => {
+ f || (l.current = !1, s(""), c.run("download", (e) => G("/api/configuration/update", {}, "POST", e), a));
+ }, g = () => void c.run("check", (e) => W("/api/configuration/updates", e), r, (t) => {
+ r({
...e,
state: "error"
- }), p.setError(l(t));
- }), C = p.error || u, T = s.state === "downloading" && s.total ? `${((s.downloaded || 0) / 1048576).toFixed(1)} / ${(s.total / 1048576).toFixed(1)} MB` : `${s.progress}%`;
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ }), c.setError(q(t));
+ }), _ = c.error || o, v = i.state === "downloading" && i.total ? `${((i.downloaded || 0) / 1048576).toFixed(1)} / ${(i.total / 1048576).toFixed(1)} MB` : `${i.progress}%`;
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "检查更新",
- aside: /* @__PURE__ */ (0, $.jsx)(y, {
- tone: C || r.state === "error" || s.state === "error" ? "error" : g ? "progress" : r.state === "available" ? "warning" : r.state === "unchecked" ? "neutral" : "success",
- children: C || r.state === "error" || s.state === "error" ? "检查未完成" : g ? "准备更新中" : s.state === "ready" ? "可安装" : r.state === "available" ? "有可用更新" : r.state === "unchecked" ? "尚未检查" : "检查完成"
+ aside: /* @__PURE__ */ (0, $.jsx)(H, {
+ tone: _ || n.state === "error" || i.state === "error" ? "error" : f ? "progress" : n.state === "available" ? "warning" : n.state === "unchecked" ? "neutral" : "success",
+ children: _ || n.state === "error" || i.state === "error" ? "检查未完成" : f ? "准备更新中" : i.state === "ready" ? "可安装" : n.state === "available" ? "有可用更新" : n.state === "unchecked" ? "尚未检查" : "检查完成"
}),
children: [
- /* @__PURE__ */ (0, $.jsxs)(j, { children: [
- /* @__PURE__ */ (0, $.jsx)(J, {
+ /* @__PURE__ */ (0, $.jsxs)(O, { children: [
+ /* @__PURE__ */ (0, $.jsx)(D, {
term: "当前版本",
- children: r.current_version
+ children: n.current_version
}),
- /* @__PURE__ */ (0, $.jsx)(J, {
+ /* @__PURE__ */ (0, $.jsx)(D, {
term: "安装方式",
- children: r.installation
+ children: n.installation
}),
- /* @__PURE__ */ (0, $.jsx)(J, {
+ /* @__PURE__ */ (0, $.jsx)(D, {
term: "更新通道",
- children: r.channel
+ children: n.channel
}),
- /* @__PURE__ */ (0, $.jsx)(J, {
+ /* @__PURE__ */ (0, $.jsx)(D, {
term: "最新版本",
- children: r.latest_version || "未取得"
+ children: n.latest_version || "未取得"
}),
- r.package_kind ? /* @__PURE__ */ (0, $.jsxs)(J, {
+ n.package_kind ? /* @__PURE__ */ (0, $.jsxs)(D, {
term: "下载内容",
- children: [r.package_kind === "update" ? "应用更新包" : "应用与工具", r.asset_size ? ` · ${(r.asset_size / 1048576).toFixed(1)} MB` : ""]
+ children: [n.package_kind === "update" ? "应用更新包" : "应用与工具", n.asset_size ? ` · ${(n.asset_size / 1048576).toFixed(1)} MB` : ""]
}) : null
] }),
- r.package_kind === "update" ? /* @__PURE__ */ (0, $.jsx)(w, { children: "应用更新包复用已安装工具;工具缺失、损坏或版本变化时会另行下载所需工具包。" }) : r.package_kind === "full" ? /* @__PURE__ */ (0, $.jsx)(w, { children: "本次更新包含媒体工具。" }) : null,
- r.state === "unchecked" && !r.checked_at && !C && s.state === "idle" ? null : /* @__PURE__ */ (0, $.jsxs)(x, {
+ n.package_kind === "update" ? /* @__PURE__ */ (0, $.jsx)(j, { children: "应用更新包复用已安装工具;工具缺失、损坏或版本变化时会另行下载所需工具包。" }) : n.package_kind === "full" ? /* @__PURE__ */ (0, $.jsx)(j, { children: "本次更新包含媒体工具。" }) : null,
+ n.state === "unchecked" && !n.checked_at && !_ && i.state === "idle" ? null : /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
children: [
- r.checked_at ? /* @__PURE__ */ (0, $.jsxs)(w, { children: ["检查于 ", (/* @__PURE__ */ new Date(r.checked_at * 1e3)).toLocaleString()] }) : null,
- r.state === "available" && !C ? /* @__PURE__ */ (0, $.jsx)(q, {
+ n.checked_at ? /* @__PURE__ */ (0, $.jsxs)(j, { children: ["检查于 ", (/* @__PURE__ */ new Date(n.checked_at * 1e3)).toLocaleString()] }) : null,
+ n.state === "available" && !_ ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "info",
title: "有可用更新",
- children: r.message
- }) : C || r.state === "error" ? /* @__PURE__ */ (0, $.jsx)(k, { children: C || r.message }) : r.state === "unchecked" ? null : /* @__PURE__ */ (0, $.jsx)(w, {
+ children: n.message
+ }) : _ || n.state === "error" ? /* @__PURE__ */ (0, $.jsx)(S, { children: _ || n.message }) : n.state === "unchecked" ? null : /* @__PURE__ */ (0, $.jsx)(j, {
role: "status",
- children: r.message
+ children: n.message
}),
- s.state === "error" ? /* @__PURE__ */ (0, $.jsx)(k, { children: s.message }) : null,
- s.state !== "idle" && s.state !== "error" ? /* @__PURE__ */ (0, $.jsxs)("div", {
+ i.state === "error" ? /* @__PURE__ */ (0, $.jsx)(S, { children: i.message }) : null,
+ i.state !== "idle" && i.state !== "error" ? /* @__PURE__ */ (0, $.jsxs)("div", {
"aria-live": "polite",
className: "flex flex-col gap-2",
children: [
- /* @__PURE__ */ (0, $.jsx)(ht, {
+ /* @__PURE__ */ (0, $.jsx)(ye, {
label: "更新准备进度",
- value: s.progress,
+ value: i.progress,
stops: pn
}),
- /* @__PURE__ */ (0, $.jsxs)(w, { children: ["下载 → 校验 → 解压 → 准备安装 · ", s.message] }),
- /* @__PURE__ */ (0, $.jsx)(w, { children: T })
+ /* @__PURE__ */ (0, $.jsxs)(j, { children: ["下载 → 校验 → 解压 → 准备安装 · ", i.message] }),
+ /* @__PURE__ */ (0, $.jsx)(j, { children: v })
]
}) : null
]
}),
- /* @__PURE__ */ (0, $.jsxs)(a, {
- status: /* @__PURE__ */ (0, $.jsx)(i, {
- href: r.release_url,
+ /* @__PURE__ */ (0, $.jsxs)(A, {
+ status: /* @__PURE__ */ (0, $.jsx)(C, {
+ href: n.release_url,
children: "查看发布页"
}),
children: [
- /* @__PURE__ */ (0, $.jsx)(V, {
- variant: s.state === "ready" || r.state === "available" && r.installation === "独立测试包" ? "secondary" : "primary",
- disabled: g,
- onClick: S,
- ...K(p.busy === "check"),
+ /* @__PURE__ */ (0, $.jsx)(d, {
+ variant: i.state === "ready" || n.state === "available" && n.installation === "独立测试包" ? "secondary" : "primary",
+ disabled: f,
+ onClick: g,
+ ...K(c.busy === "check"),
children: "检查更新"
}),
- r.state === "available" && r.installation === "独立测试包" && s.state !== "ready" ? /* @__PURE__ */ (0, $.jsx)(V, {
+ n.state === "available" && n.installation === "独立测试包" && i.state !== "ready" ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "primary",
- onClick: b,
- ...K(g || p.busy === "download"),
+ onClick: h,
+ ...K(f || c.busy === "download"),
children: "下载并安装"
}) : null,
- s.state === "ready" ? /* @__PURE__ */ (0, $.jsx)(V, {
+ i.state === "ready" ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "primary",
- onClick: v,
+ onClick: m,
children: "重启安装"
}) : null
]
@@ -1315,56 +1315,56 @@ function gn({ data: e, receipt: t, panel: n }) {
]
});
}
-function _n({ startup: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e.enabled), [o, s] = (0, Z.useState)(e.silent), [c, l] = (0, Z.useState)(e.desktop), u = f(), d = e.available && !e.desktop_message;
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+function _n({ startup: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e.enabled), [i, a] = (0, Z.useState)(e.silent), [o, s] = (0, Z.useState)(e.desktop), c = Y(), l = e.available && !e.desktop_message;
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "开机自启",
- onSubmit: (t) => {
- t.preventDefault(), e.available && u.run("save", (e) => L("/api/configuration/startup", {
- enabled: r,
- silent: o,
- desktop: c
- }, "POST", e), () => n("已保存配置"));
+ onSubmit: (r) => {
+ r.preventDefault(), e.available && c.run("save", (e) => G("/api/configuration/startup", {
+ enabled: n,
+ silent: i,
+ desktop: o
+ }, "POST", e), () => t("已保存配置"));
},
children: [
- /* @__PURE__ */ (0, $.jsxs)(W, { children: [
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsxs)(P, { children: [
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "开机后启动 Peach",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "开机后启动 Peach",
- isSelected: r,
+ isSelected: n,
isDisabled: !e.available,
- onChange: i
+ onChange: r
})
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "只启动托盘,不打开网页",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "只启动托盘,不打开网页",
- isSelected: o,
- isDisabled: !e.available || !r,
- onChange: s
+ isSelected: i,
+ isDisabled: !e.available || !n,
+ onChange: a
})
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "在桌面创建快捷方式",
description: e.desktop_message || void 0,
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "在桌面创建快捷方式",
- isSelected: c,
- isDisabled: !d,
- onChange: l
+ isSelected: o,
+ isDisabled: !l,
+ onChange: s
})
})
] }),
- e.message || u.error ? /* @__PURE__ */ (0, $.jsxs)(x, {
+ e.message || c.error ? /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
- children: [e.message ? /* @__PURE__ */ (0, $.jsx)(w, { children: e.message }) : null, u.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: u.error }) : null]
+ children: [e.message ? /* @__PURE__ */ (0, $.jsx)(j, { children: e.message }) : null, c.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: c.error }) : null]
}) : null,
- /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
disabled: !e.available,
- ...K(u.busy === "save"),
+ ...K(c.busy === "save"),
children: "保存配置"
}) })
]
@@ -1399,15 +1399,15 @@ var vn = 8e3, yn = [
function xn() {
return /* @__PURE__ */ (0, $.jsx)("div", {
className: "@container flex flex-col gap-3",
- children: /* @__PURE__ */ (0, $.jsxs)(Y, {
+ children: /* @__PURE__ */ (0, $.jsxs)(b, {
summary: "CloudDrive 设置帮助",
children: [
- /* @__PURE__ */ (0, $.jsxs)(w, { children: ["先将 CloudDrive2 或 OpenList 中的网盘挂载为本机文件夹,再在这里选择。", /* @__PURE__ */ (0, $.jsx)(i, {
+ /* @__PURE__ */ (0, $.jsxs)(j, { children: ["先将 CloudDrive2 或 OpenList 中的网盘挂载为本机文件夹,再在这里选择。", /* @__PURE__ */ (0, $.jsx)(C, {
href: "https://www.clouddrive2.com/help.html",
children: "挂载帮助"
})] }),
- /* @__PURE__ */ (0, $.jsx)(w, { children: "缓存按所在硬盘和可用内存选起步值,再根据播放表现调整。" }),
- /* @__PURE__ */ (0, $.jsx)(w, { children: "文件操作需要挂载工具和网盘账号授予写入权限。光鸭云盘的上传、建文件夹、改名和移动需要 CloudDrive2 v1.1.0 或更高版本,删除和复制暂不支持。" }),
+ /* @__PURE__ */ (0, $.jsx)(j, { children: "缓存按所在硬盘和可用内存选起步值,再根据播放表现调整。" }),
+ /* @__PURE__ */ (0, $.jsx)(j, { children: "文件操作需要挂载工具和网盘账号授予写入权限。光鸭云盘的上传、建文件夹、改名和移动需要 CloudDrive2 v1.1.0 或更高版本,删除和复制暂不支持。" }),
/* @__PURE__ */ (0, $.jsx)("ul", {
"aria-label": "按缓存所在硬盘分档",
className: "flex flex-col gap-2",
@@ -1439,7 +1439,7 @@ function xn() {
/* @__PURE__ */ (0, $.jsx)("li", { children: "Buffer Cache 占内存,磁盘缓存和文件夹缓存占硬盘,改一个管不住另外两个。" })
]
}),
- /* @__PURE__ */ (0, $.jsx)(w, { children: /* @__PURE__ */ (0, $.jsx)(i, {
+ /* @__PURE__ */ (0, $.jsx)(j, { children: /* @__PURE__ */ (0, $.jsx)(C, {
href: "https://github.com/peach-mitao/peach/blob/master/docs/CLOUDDRIVE.md",
children: "完整配置与调优说明"
}) })
@@ -1456,113 +1456,113 @@ var Sn = "/api/configuration/cloud-proxies", Cn = [
["socks5", "SOCKS5 代理"]
];
function wn({ receipt: e }) {
- let [n, r] = (0, Z.useState)(null), [i, s] = (0, Z.useState)(!0), c = (0, Z.useRef)(/* @__PURE__ */ new Set()), l = (0, Z.useRef)(/* @__PURE__ */ new Set()), [u, d] = (0, Z.useState)(!1), p = (0, Z.useRef)(() => void 0), m = f(), h = () => {
- l.current.size || m.run("refresh", (e) => N(Sn, e), (e) => {
- c.current.clear(), r(e), s(!1);
+ let [t, n] = (0, Z.useState)(null), [r, i] = (0, Z.useState)(!0), a = (0, Z.useRef)(/* @__PURE__ */ new Set()), o = (0, Z.useRef)(/* @__PURE__ */ new Set()), [s, c] = (0, Z.useState)(!1), l = (0, Z.useRef)(() => void 0), u = Y(), f = () => {
+ o.current.size || u.run("refresh", (e) => W(Sn, e), (e) => {
+ a.current.clear(), n(e), i(!1);
}, (e) => {
- s(!1), m.setError(e instanceof Error ? e.message : "无法读取网盘代理");
+ i(!1), u.setError(e instanceof Error ? e.message : "无法读取网盘代理");
});
};
- p.current = h, (0, Z.useEffect)(() => {
- p.current();
+ l.current = f, (0, Z.useEffect)(() => {
+ l.current();
let e = () => {
- c.current.size || p.current();
+ a.current.size || l.current();
};
return window.addEventListener("focus", e), () => window.removeEventListener("focus", e);
}, []);
- let g = (0, Z.useRef)(null);
+ let p = (0, Z.useRef)(null);
return (0, Z.useLayoutEffect)(() => {
- !i && g.current && it("cloud-proxy", g.current.offsetHeight);
- }, [i, n]), /* @__PURE__ */ (0, $.jsxs)(t, {
+ !r && p.current && et("cloud-proxy", p.current.offsetHeight);
+ }, [r, t]), /* @__PURE__ */ (0, $.jsxs)(F, {
title: "CloudDrive 代理",
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [/* @__PURE__ */ (0, $.jsx)(w, { children: ue }), /* @__PURE__ */ (0, $.jsxs)("div", {
- ref: g,
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [/* @__PURE__ */ (0, $.jsx)(j, { children: m }), /* @__PURE__ */ (0, $.jsxs)("div", {
+ ref: p,
className: "flex min-w-0 flex-col gap-4",
children: [
- i ? /* @__PURE__ */ (0, $.jsx)("div", {
+ r ? /* @__PURE__ */ (0, $.jsx)("div", {
"data-skeleton": !0,
"aria-busy": "true",
"aria-label": "正在读取网盘代理",
children: /* @__PURE__ */ (0, $.jsx)("div", {
className: "h-(--remembered-h) w-full rounded-2lg bg-background-tertiary-default",
- style: { "--remembered-h": `${ge("cloud-proxy", 96)}px` }
+ style: { "--remembered-h": `${tt("cloud-proxy", 96)}px` }
})
}) : null,
- m.error ? /* @__PURE__ */ (0, $.jsxs)(q, {
+ u.error ? /* @__PURE__ */ (0, $.jsxs)(N, {
tone: "error",
title: "没有读取配置",
children: [
- m.error,
+ u.error,
" ",
- /* @__PURE__ */ (0, $.jsx)(I, {
+ /* @__PURE__ */ (0, $.jsx)(ae, {
href: "/settings/downloads",
size: "small",
children: "下载设置"
})
]
}) : null,
- n?.configured === !1 ? /* @__PURE__ */ (0, $.jsxs)(w, { children: ["填写 CloudDrive2 地址和 API 令牌后,在这里设置各网盘账号的代理。 ", /* @__PURE__ */ (0, $.jsx)(I, {
+ t?.configured === !1 ? /* @__PURE__ */ (0, $.jsxs)(j, { children: ["填写 CloudDrive2 地址和 API 令牌后,在这里设置各网盘账号的代理。 ", /* @__PURE__ */ (0, $.jsx)(ae, {
href: "/settings/downloads",
size: "small",
children: "下载设置"
- })] }) : n?.accounts.length === 0 && !n.unlinked?.length ? /* @__PURE__ */ (0, $.jsx)(w, { children: "还没有使用 CloudDrive 的媒体库。" }) : null,
- n?.unlinked?.map((e) => /* @__PURE__ */ (0, $.jsxs)("div", {
+ })] }) : t?.accounts.length === 0 && !t.unlinked?.length ? /* @__PURE__ */ (0, $.jsx)(j, { children: "还没有使用 CloudDrive 的媒体库。" }) : null,
+ t?.unlinked?.map((e) => /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex min-w-0 flex-col gap-1",
- children: [/* @__PURE__ */ (0, $.jsx)(o, { children: /* @__PURE__ */ (0, $.jsxs)("span", {
+ children: [/* @__PURE__ */ (0, $.jsx)(k, { children: /* @__PURE__ */ (0, $.jsxs)("span", {
className: "inline-flex items-center gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(U, { mark: Et(e.location) }), e.name]
- }) }), /* @__PURE__ */ (0, $.jsx)(w, { children: "尚未匹配 CloudDrive 账号" })]
+ children: [/* @__PURE__ */ (0, $.jsx)(B, { mark: Tt(e.location) }), e.name]
+ }) }), /* @__PURE__ */ (0, $.jsx)(j, { children: "尚未匹配 CloudDrive 账号" })]
}, e.root)),
- n?.accounts.map((t) => /* @__PURE__ */ (0, $.jsx)(Tn, {
+ t?.accounts.map((t) => /* @__PURE__ */ (0, $.jsx)(Tn, {
initial: t,
receipt: e,
- onDirty: () => c.current.add(t.id),
+ onDirty: () => a.current.add(t.id),
onSaving: (e) => {
- e ? l.current.add(t.id) : l.current.delete(t.id), d(!!l.current.size);
+ e ? o.current.add(t.id) : o.current.delete(t.id), c(!!o.current.size);
},
onSaved: (e) => {
- c.current.delete(e.id), r((t) => t && {
+ a.current.delete(e.id), n((t) => t && {
...t,
accounts: t.accounts.map((t) => t.id === e.id ? e : t)
});
}
}, t.id + t.revision))
]
- })] }), /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ })] }), /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- disabled: u,
- onClick: h,
- ...K(m.busy === "refresh"),
+ disabled: s,
+ onClick: f,
+ ...K(u.busy === "refresh"),
children: "重新读取"
}) })]
});
}
function Tn({ initial: e, receipt: t, onDirty: n, onSaved: r, onSaving: i }) {
- let [a, s] = (0, Z.useState)(e), [c, l] = (0, Z.useState)([]), u = a.libraries?.map((e) => e.name).join("、") || a.name, d = f(), p = (e, t) => {
- s((n) => ({
+ let [a, o] = (0, Z.useState)(e), [s, c] = (0, Z.useState)([]), l = a.libraries?.map((e) => e.name).join("、") || a.name, u = Y(), f = (e, t) => {
+ o((n) => ({
...n,
[e]: t
- })), l((t) => t.includes(e) ? t : [...t, e]), n();
+ })), c((t) => t.includes(e) ? t : [...t, e]), n();
};
return /* @__PURE__ */ (0, $.jsxs)("form", {
- "aria-label": `${u} 代理`,
+ "aria-label": `${l} 代理`,
onSubmit: (e) => {
- e.preventDefault(), i(!0), d.run("save", (e) => L(Sn, {
+ e.preventDefault(), i(!0), u.run("save", (e) => G(Sn, {
id: a.id,
revision: a.revision,
- ...c.includes("api") ? { api: a.api } : {},
- ...c.includes("data") ? { data: a.data } : {}
+ ...s.includes("api") ? { api: a.api } : {},
+ ...s.includes("data") ? { data: a.data } : {}
}, "POST", e), (e) => {
- s(e), l([]), r(e), t("已保存 CloudDrive 代理");
+ o(e), c([]), r(e), t("已保存 CloudDrive 代理");
}).finally(() => i(!1));
},
className: "flex min-w-0 flex-col gap-4 border-t border-separator-border pt-4",
children: [
- /* @__PURE__ */ (0, $.jsx)(o, { children: /* @__PURE__ */ (0, $.jsxs)("span", {
+ /* @__PURE__ */ (0, $.jsx)(k, { children: /* @__PURE__ */ (0, $.jsxs)("span", {
className: "inline-flex items-center gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(U, { mark: Et(a.libraries?.[0]?.location || (a.cloud === "115open" ? "115" : a.cloud.toLowerCase())) }), u]
+ children: [/* @__PURE__ */ (0, $.jsx)(B, { mark: Tt(a.libraries?.[0]?.location || (a.cloud === "115open" ? "115" : a.cloud.toLowerCase())) }), l]
}) }),
- /* @__PURE__ */ (0, $.jsxs)(w, { children: [
+ /* @__PURE__ */ (0, $.jsxs)(j, { children: [
a.name,
" · ",
a.path
@@ -1570,27 +1570,27 @@ function Tn({ initial: e, receipt: t, onDirty: n, onSaved: r, onSaving: i }) {
/* @__PURE__ */ (0, $.jsx)(En, {
label: "数据代理",
value: a.data,
- disabled: !a.writable || !!d.busy,
- onChange: (e) => p("data", e)
+ disabled: !a.writable || !!u.busy,
+ onChange: (e) => f("data", e)
}),
/* @__PURE__ */ (0, $.jsx)(En, {
label: "API 代理",
value: a.api,
- disabled: !a.writable || !!d.busy,
- onChange: (e) => p("api", e)
+ disabled: !a.writable || !!u.busy,
+ onChange: (e) => f("api", e)
}),
- a.writable ? null : /* @__PURE__ */ (0, $.jsx)(w, { children: "API 令牌需要“修改云盘”权限才能保存。" }),
- d.error ? /* @__PURE__ */ (0, $.jsx)(q, {
+ a.writable ? null : /* @__PURE__ */ (0, $.jsx)(j, { children: "API 令牌需要“修改云盘”权限才能保存。" }),
+ u.error ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: "没有保存",
- children: d.error
+ children: u.error
}) : null,
/* @__PURE__ */ (0, $.jsx)("div", {
className: "flex justify-end",
- children: /* @__PURE__ */ (0, $.jsx)(V, {
+ children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- disabled: !a.writable || !c.length,
- ...K(d.busy === "save"),
+ disabled: !a.writable || !s.length,
+ ...K(u.busy === "save"),
children: "保存配置"
})
})
@@ -1602,8 +1602,8 @@ function En({ label: e, value: t, disabled: n, onChange: r }) {
return /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex min-w-0 flex-col gap-3",
children: [
- /* @__PURE__ */ (0, $.jsx)(o, { children: e }),
- /* @__PURE__ */ (0, $.jsxs)(H, {
+ /* @__PURE__ */ (0, $.jsx)(k, { children: e }),
+ /* @__PURE__ */ (0, $.jsxs)(I, {
"aria-label": e,
selectedKey: t.mode,
isDisabled: n,
@@ -1613,17 +1613,17 @@ function En({ label: e, value: t, disabled: n, onChange: r }) {
mode: String(e)
});
},
- children: [t.mode === "unknown" ? /* @__PURE__ */ (0, $.jsx)(z, {
+ children: [t.mode === "unknown" ? /* @__PURE__ */ (0, $.jsx)(L, {
id: "unknown",
children: "无法识别的代理类型"
- }) : null, Cn.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(z, {
+ }) : null, Cn.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
children: t
}, e))]
}),
i ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-wrap gap-3",
- children: [/* @__PURE__ */ (0, $.jsx)(G, {
+ children: [/* @__PURE__ */ (0, $.jsx)(M, {
className: "min-w-40 flex-1",
label: `${e}地址`,
value: t.host,
@@ -1633,7 +1633,7 @@ function En({ label: e, value: t, disabled: n, onChange: r }) {
...t,
host: e
})
- }), /* @__PURE__ */ (0, $.jsx)(G, {
+ }), /* @__PURE__ */ (0, $.jsx)(M, {
className: "w-full sm:w-28",
label: `${e}端口`,
value: t.port ? String(t.port) : "",
@@ -1644,10 +1644,10 @@ function En({ label: e, value: t, disabled: n, onChange: r }) {
port: Number(e)
})
})]
- }), /* @__PURE__ */ (0, $.jsxs)(Y, {
+ }), /* @__PURE__ */ (0, $.jsxs)(b, {
summary: "代理认证",
children: [
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: `${e}用户名`,
value: t.username,
autoComplete: "off",
@@ -1657,7 +1657,7 @@ function En({ label: e, value: t, disabled: n, onChange: r }) {
username: e
})
}),
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: `${e}密码`,
type: "password",
value: t.password || "",
@@ -1669,7 +1669,7 @@ function En({ label: e, value: t, disabled: n, onChange: r }) {
password: e
})
}),
- t.password_set ? /* @__PURE__ */ (0, $.jsx)(ne, {
+ t.password_set ? /* @__PURE__ */ (0, $.jsx)(v, {
isSelected: !!t.clear_password,
isDisabled: n,
onChange: (e) => r({
@@ -1730,65 +1730,65 @@ var Dn = [
["tags", "主题"]
];
function On(e) {
- let t = e === "local" ? "" : M[e];
+ let t = e === "local" ? "" : ue[e];
return t ? [t, "自动识别"] : ["hard-drive", "默认"];
}
var kn = "auto";
-function An({ value: e, label: t, kind: n = "local", onChange: r }) {
- let i = (0, Z.useRef)(null), [a, o] = (0, Z.useState)(!1), [s, c] = (0, Z.useState)(e), [l, u] = On(n);
- return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(V, {
- ref: i,
+function An({ value: t, label: r, kind: i = "local", onChange: a }) {
+ let l = (0, Z.useRef)(null), [u, f] = (0, Z.useState)(!1), [p, m] = (0, Z.useState)(t), [h, g] = On(i);
+ return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(d, {
+ ref: l,
variant: "secondary",
className: "self-start",
- "aria-label": t,
+ "aria-label": r,
"aria-haspopup": "dialog",
- "aria-expanded": a,
+ "aria-expanded": u,
onClick: () => {
- c(e), o(!0);
+ m(t), f(!0);
},
children: /* @__PURE__ */ (0, $.jsxs)("span", {
"data-icon-choice": !0,
className: "flex items-center gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(U, { mark: e || l }), ((e) => e && Dn.find(([t]) => t === e)?.[1] || u)(e)]
+ children: [/* @__PURE__ */ (0, $.jsx)(B, { mark: t || h }), ((e) => e && Dn.find(([t]) => t === e)?.[1] || g)(t)]
})
- }), /* @__PURE__ */ (0, $.jsx)(Ie, {
- triggerRef: i,
- isOpen: a,
- onOpenChange: o,
+ }), /* @__PURE__ */ (0, $.jsx)(n, {
+ triggerRef: l,
+ isOpen: u,
+ onOpenChange: f,
placement: "bottom start",
offset: 4,
- className: Ce,
- children: /* @__PURE__ */ (0, $.jsxs)(he, {
- "aria-label": `${t}可选图标`,
+ className: de,
+ children: /* @__PURE__ */ (0, $.jsxs)(o, {
+ "aria-label": `${r}可选图标`,
className: "flex w-72 flex-col gap-3 outline-none",
children: [
- /* @__PURE__ */ (0, $.jsx)(be, {
+ /* @__PURE__ */ (0, $.jsx)(e, {
slot: "title",
className: "px-1 text-body-medium text-text-primary",
children: "选择媒体库图标"
}),
- /* @__PURE__ */ (0, $.jsx)(Ge, {
+ /* @__PURE__ */ (0, $.jsx)(s, {
"aria-label": "可选图标",
- value: s || kn,
- onChange: (e) => c(e === kn ? "" : e),
+ value: p || kn,
+ onChange: (e) => m(e === kn ? "" : e),
className: "inline-grid grid-cols-7 gap-1",
- children: Dn.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(rt, {
+ children: Dn.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(c, {
value: e || kn,
- "aria-label": e ? t : u,
+ "aria-label": e ? t : g,
className: "flex h-10 cursor-pointer items-center justify-center rounded-lg text-foreground-icon-secondary outline-none hover:bg-dropdown-item-hover-background focus-visible:ring-2 focus-visible:ring-border-focus-ring data-selected:bg-dropdown-item-hover-background data-selected:text-text-primary",
- children: /* @__PURE__ */ (0, $.jsx)(U, { mark: e || l })
+ children: /* @__PURE__ */ (0, $.jsx)(B, { mark: e || h })
}, e || kn))
}),
/* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex justify-end gap-2 border-t border-separator-border pt-2.5",
- children: [/* @__PURE__ */ (0, $.jsx)(V, {
+ children: [/* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- onClick: () => o(!1),
+ onClick: () => f(!1),
children: "取消"
- }), /* @__PURE__ */ (0, $.jsx)(V, {
- disabled: s === e,
+ }), /* @__PURE__ */ (0, $.jsx)(d, {
+ disabled: p === t,
onClick: () => {
- r(s), o(!1);
+ a(p), f(!1);
},
children: "应用"
})]
@@ -1832,18 +1832,18 @@ function Pn() {
return /* @__PURE__ */ (0, $.jsxs)("div", {
"data-policy-legend": "",
className: "flex flex-col gap-1",
- children: [/* @__PURE__ */ (0, $.jsx)(w, { children: Qe }), /* @__PURE__ */ (0, $.jsxs)(Y, {
+ children: [/* @__PURE__ */ (0, $.jsx)(j, { children: ge }), /* @__PURE__ */ (0, $.jsxs)(b, {
summary: "三种处理方式对比",
children: [/* @__PURE__ */ (0, $.jsxs)("table", {
"data-policy-matrix": "",
className: "text-body-2-regular",
children: [/* @__PURE__ */ (0, $.jsx)("thead", { children: /* @__PURE__ */ (0, $.jsxs)("tr", { children: [/* @__PURE__ */ (0, $.jsx)("th", {
scope: "col",
- children: /* @__PURE__ */ (0, $.jsx)(Ve, { children: "步骤" })
- }), lt.map((e) => /* @__PURE__ */ (0, $.jsx)("th", {
+ children: /* @__PURE__ */ (0, $.jsx)(a, { children: "步骤" })
+ }), pe.map((e) => /* @__PURE__ */ (0, $.jsx)("th", {
scope: "col",
children: e
- }, e))] }) }), /* @__PURE__ */ (0, $.jsx)("tbody", { children: Oe.map(([e, ...t]) => /* @__PURE__ */ (0, $.jsxs)("tr", { children: [/* @__PURE__ */ (0, $.jsx)("th", {
+ }, e))] }) }), /* @__PURE__ */ (0, $.jsx)("tbody", { children: he.map(([e, ...t]) => /* @__PURE__ */ (0, $.jsxs)("tr", { children: [/* @__PURE__ */ (0, $.jsx)("th", {
scope: "row",
children: e
}), t.map((e, t) => /* @__PURE__ */ (0, $.jsx)("td", {
@@ -1855,13 +1855,13 @@ function Pn() {
"aria-label": "不做",
children: "—"
}) : e
- }, lt[t]))] }, e)) })]
- }), /* @__PURE__ */ (0, $.jsx)(w, { children: xe })]
+ }, pe[t]))] }, e)) })]
+ }), /* @__PURE__ */ (0, $.jsx)(j, { children: me })]
})]
});
}
function Fn({ name: e, value: t, onChange: n }) {
- return /* @__PURE__ */ (0, $.jsx)(b, {
+ return /* @__PURE__ */ (0, $.jsx)(Te, {
className: "w-full",
"aria-label": `${e} 处理方式`,
selectedKey: t,
@@ -1871,7 +1871,7 @@ function Fn({ name: e, value: t, onChange: n }) {
children: Nn.find(([e]) => e === t)?.[1]
}),
onSelectionChange: (e) => n(String(e)),
- children: Nn.map(([e, t, n]) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: Nn.map(([e, t, n]) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
textValue: t,
children: /* @__PURE__ */ (0, $.jsxs)("span", {
@@ -1885,14 +1885,14 @@ function Fn({ name: e, value: t, onChange: n }) {
});
}
function In({ name: e, value: t, onChange: n }) {
- return /* @__PURE__ */ (0, $.jsx)(Y, {
+ return /* @__PURE__ */ (0, $.jsx)(b, {
defaultOpen: !0,
summary: `${e} 的处理步骤(${t.length}/${jn.length})`,
children: /* @__PURE__ */ (0, $.jsx)("div", {
className: "flex flex-wrap gap-x-6 gap-y-2",
role: "group",
"aria-label": `${e} 处理步骤`,
- children: jn.map(([e, r]) => /* @__PURE__ */ (0, $.jsx)(ne, {
+ children: jn.map(([e, r]) => /* @__PURE__ */ (0, $.jsx)(v, {
isSelected: t.includes(e),
onChange: (r) => n(r ? [...t, e] : t.filter((t) => t !== e)),
children: r
@@ -1900,48 +1900,48 @@ function In({ name: e, value: t, onChange: n }) {
})
});
}
-function Ln({ id: e, name: t, value: n, onChange: r }) {
- let i = (0, Z.useRef)(null), [a, o] = (0, Z.useState)(!1), s = v.find(([e]) => e === n)?.[1] || "无颜色", c = (t) => {
- r(t), ce(e, t), o(!1);
+function Ln({ id: e, name: t, value: i, onChange: a }) {
+ let s = (0, Z.useRef)(null), [c, u] = (0, Z.useState)(!1), d = l.find(([e]) => e === i)?.[1] || "无颜色", f = (t) => {
+ a(t), Xe(e, t), u(!1);
};
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsxs)("button", {
- ref: i,
+ ref: s,
type: "button",
"data-glow-chip": "",
"data-library-color-trigger": "",
"aria-haspopup": "dialog",
- "aria-expanded": a,
- "aria-label": `${t || "未命名媒体库"} 来源色:${s}`,
- title: s,
- onClick: () => o(!0),
+ "aria-expanded": c,
+ "aria-label": `${t || "未命名媒体库"} 来源色:${d}`,
+ title: d,
+ onClick: () => u(!0),
children: [
/* @__PURE__ */ (0, $.jsx)("span", {
"aria-hidden": !0,
className: "text-text-tertiary",
children: "来源色"
}),
- n ? /* @__PURE__ */ (0, $.jsx)("span", {
+ i ? /* @__PURE__ */ (0, $.jsx)("span", {
"data-glow-ball": "",
"aria-hidden": "true",
- "data-accent-ball": n
+ "data-accent-ball": i
}) : /* @__PURE__ */ (0, $.jsx)("span", {
"data-glow-ball": "",
"data-library-none": "",
"aria-hidden": "true"
}),
- /* @__PURE__ */ (0, $.jsx)("span", { children: s })
+ /* @__PURE__ */ (0, $.jsx)("span", { children: d })
]
- }), /* @__PURE__ */ (0, $.jsx)(ot, {
- getContainer: () => D(i.current),
- children: /* @__PURE__ */ (0, $.jsx)(Ie, {
- triggerRef: i,
- isOpen: a,
- onOpenChange: o,
+ }), /* @__PURE__ */ (0, $.jsx)(r, {
+ getContainer: () => Je(s.current),
+ children: /* @__PURE__ */ (0, $.jsx)(n, {
+ triggerRef: s,
+ isOpen: c,
+ onOpenChange: u,
placement: "bottom start",
offset: 8,
containerPadding: 12,
- className: Ce,
- children: /* @__PURE__ */ (0, $.jsxs)(he, {
+ className: de,
+ children: /* @__PURE__ */ (0, $.jsxs)(o, {
"aria-label": `${t || "未命名媒体库"} 来源色`,
className: "outline-none",
children: [/* @__PURE__ */ (0, $.jsx)("p", {
@@ -1954,22 +1954,22 @@ function Ln({ id: e, name: t, value: n, onChange: r }) {
children: [/* @__PURE__ */ (0, $.jsx)("button", {
type: "button",
"data-glow-chip": "",
- "aria-pressed": !n,
+ "aria-pressed": !i,
title: "无颜色",
"aria-label": "无颜色",
- onClick: () => c(""),
+ onClick: () => f(""),
children: /* @__PURE__ */ (0, $.jsx)("span", {
"data-glow-ball": "",
"data-library-none": "",
"aria-hidden": "true"
})
- }), v.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)("button", {
+ }), l.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)("button", {
type: "button",
"data-glow-chip": "",
- "aria-pressed": e === n,
+ "aria-pressed": e === i,
title: t,
"aria-label": t,
- onClick: () => c(e),
+ onClick: () => f(e),
children: /* @__PURE__ */ (0, $.jsx)("span", {
"data-glow-ball": "",
"aria-hidden": "true",
@@ -1984,177 +1984,177 @@ function Ln({ id: e, name: t, value: n, onChange: r }) {
//#endregion
//#region src/react/settings/push-discovery-settings.tsx
var Rn = "/api/configuration/push-discovery", zn = "/api/configuration/push-discovery/secret";
-function Bn({ initial: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e), [s, c] = (0, Z.useState)(e.prefixes), [u, d] = (0, Z.useState)(""), p = f(), m = r.media_roots, [h, g] = (0, Z.useState)(e), _ = (e, t) => {
- i(e), g(e), c(e.prefixes), d(""), n(t);
- }, v = (e, t) => c((n) => n.map((n, r) => r === e ? {
+function Bn({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(e.prefixes), [o, s] = (0, Z.useState)(""), c = Y(), l = n.media_roots, [u, f] = (0, Z.useState)(e), p = (e, n) => {
+ r(e), f(e), a(e.prefixes), s(""), t(n);
+ }, m = (e, t) => a((n) => n.map((n, r) => r === e ? {
...n,
...t
- } : n)), S = (e) => {
+ } : n)), h = (e) => {
e.preventDefault();
let t = {
- enabled: r.enabled,
- watch_local: r.watch_local,
- cloud: r.cloud,
- prefixes: s
+ enabled: n.enabled,
+ watch_local: n.watch_local,
+ cloud: n.cloud,
+ prefixes: i
};
- p.run("save", (e) => L(Rn, t, "POST", e), (e) => _(e, "已保存配置"), (e) => d(l(e)));
- }, C = () => {
- p.run("secret", (e) => L(zn, {}, "POST", e), (e) => _(e, "已更换共享密钥"), (e) => d(l(e)));
- }, E = `已入库 ${h.queue.ingested} 个文件` + (h.queue.failed ? `,${h.queue.failed} 个入库失败` : "") + (h.queue.pending ? `,队列里还有 ${h.queue.pending} 条` : ""), D = h.local_running ? `正在监视 ${h.local_roots.join("、")}` : h.local_message || "没有运行";
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ c.run("save", (e) => G(Rn, t, "POST", e), (e) => p(e, "已保存配置"), (e) => s(q(e)));
+ }, g = () => {
+ c.run("secret", (e) => G(zn, {}, "POST", e), (e) => p(e, "已更换共享密钥"), (e) => s(q(e)));
+ }, _ = `已入库 ${u.queue.ingested} 个文件` + (u.queue.failed ? `,${u.queue.failed} 个入库失败` : "") + (u.queue.pending ? `,队列里还有 ${u.queue.pending} 条` : ""), v = u.local_running ? `正在监视 ${u.local_roots.join("、")}` : u.local_message || "没有运行";
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
id: "pushDiscovery",
title: "自动发现新文件",
- onSubmit: S,
+ onSubmit: h,
children: [
- /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsxs)("div", {
+ /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
children: [/* @__PURE__ */ (0, $.jsx)("span", {
className: "text-body-regular text-text-secondary",
children: "本机监视"
- }), /* @__PURE__ */ (0, $.jsx)(y, {
- tone: !h.enabled || !h.watch_local ? "neutral" : h.local_running ? "progress" : "warning",
- children: !h.enabled || !h.watch_local ? "未启用" : h.local_running ? "运行中" : "未运行"
+ }), /* @__PURE__ */ (0, $.jsx)(H, {
+ tone: !u.enabled || !u.watch_local ? "neutral" : u.local_running ? "progress" : "warning",
+ children: !u.enabled || !u.watch_local ? "未启用" : u.local_running ? "运行中" : "未运行"
})]
}) }),
- /* @__PURE__ */ (0, $.jsxs)(W, { children: [
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsxs)(P, { children: [
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "发现新文件后自动入库",
- description: h.enabled ? E : void 0,
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ description: u.enabled ? _ : void 0,
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "发现新文件后自动入库",
- isSelected: r.enabled,
- isDisabled: !r.available,
- onChange: (e) => i({
- ...r,
+ isSelected: n.enabled,
+ isDisabled: !n.available,
+ onChange: (e) => r({
+ ...n,
enabled: e
})
})
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "监视本机文件夹",
- description: h.enabled && h.watch_local ? D : void 0,
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ description: u.enabled && u.watch_local ? v : void 0,
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "监视本机文件夹",
- isSelected: r.watch_local,
- isDisabled: !r.available || !r.enabled,
- onChange: (e) => i({
- ...r,
+ isSelected: n.watch_local,
+ isDisabled: !n.available || !n.enabled,
+ onChange: (e) => r({
+ ...n,
watch_local: e
})
})
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "接收 CloudDrive2 通知",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "接收 CloudDrive2 通知",
- isSelected: r.cloud,
- isDisabled: !r.available || !r.enabled,
- onChange: (e) => i({
- ...r,
+ isSelected: n.cloud,
+ isDisabled: !n.available || !n.enabled,
+ onChange: (e) => r({
+ ...n,
cloud: e
})
})
}),
- h.enabled && h.cloud ? /* @__PURE__ */ (0, $.jsx)(T, {
+ u.enabled && u.cloud ? /* @__PURE__ */ (0, $.jsx)(R, {
label: "Webhook 配置",
- description: h.config_toml ? "贴进 CloudDrive2「设置 → Webhooks」,需要会员;更换密钥后要重贴。" : h.origin ? "还没有共享密钥,保存配置后生成。" : "要先有 CloudDrive2 能访问的局域网地址才能生成。"
+ description: u.config_toml ? "贴进 CloudDrive2「设置 → Webhooks」,需要会员;更换密钥后要重贴。" : u.origin ? "还没有共享密钥,保存配置后生成。" : "要先有 CloudDrive2 能访问的局域网地址才能生成。"
}) : null
] }),
- h.enabled && h.queue.last_error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ u.enabled && u.queue.last_error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(q, {
+ children: /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: "最近一次入库失败",
- children: h.queue.last_error
+ children: u.queue.last_error
})
}) : null,
- h.enabled && h.cloud && h.config_toml ? /* @__PURE__ */ (0, $.jsx)(x, {
+ u.enabled && u.cloud && u.config_toml ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
children: /* @__PURE__ */ (0, $.jsx)("div", {
className: "flex flex-col gap-3",
- children: /* @__PURE__ */ (0, $.jsxs)(Y, {
+ children: /* @__PURE__ */ (0, $.jsxs)(b, {
summary: "查看配置",
children: [/* @__PURE__ */ (0, $.jsx)(gt, {
- code: h.config_toml,
+ code: u.config_toml,
language: "toml",
label: "CloudDrive2 配置",
bounded: !1,
copyLabel: "复制配置",
- onCopy: () => n("已复制 CloudDrive2 配置")
- }), /* @__PURE__ */ (0, $.jsx)(w, { children: "Windows 桌面版粘贴后显示「无效」时,把这段存成 .toml 文件,放进 %LOCALAPPDATA%\\CloudDrive.WinUI\\webhooks\\ 目录。" })]
+ onCopy: () => t("已复制 CloudDrive2 配置")
+ }), /* @__PURE__ */ (0, $.jsx)(j, { children: "Windows 桌面版粘贴后显示「无效」时,把这段存成 .toml 文件,放进 %LOCALAPPDATA%\\CloudDrive.WinUI\\webhooks\\ 目录。" })]
})
})
}) : null,
- r.enabled && r.cloud ? /* @__PURE__ */ (0, $.jsx)(x, {
+ n.enabled && n.cloud ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
children: /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-col gap-3",
children: [
- /* @__PURE__ */ (0, $.jsx)(o, { children: "云端路径前缀" }),
+ /* @__PURE__ */ (0, $.jsx)(k, { children: "云端路径前缀" }),
/* @__PURE__ */ (0, $.jsx)("div", {
role: "group",
"aria-label": "云端路径前缀",
className: "flex flex-col gap-3",
- children: s.map((e, t) => /* @__PURE__ */ (0, $.jsxs)("div", {
+ children: i.map((e, t) => /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex items-start gap-2",
children: [
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
className: "min-w-0 flex-1",
"aria-label": `云端路径前缀 ${t + 1}`,
placeholder: "/115",
autoComplete: "off",
maxLength: 200,
value: e.prefix,
- onChange: (e) => v(t, { prefix: e })
+ onChange: (e) => m(t, { prefix: e })
}),
- /* @__PURE__ */ (0, $.jsx)(b, {
+ /* @__PURE__ */ (0, $.jsx)(Te, {
"aria-label": `前缀 ${t + 1} 对应的媒体根`,
prefix: "对应目录",
selectedKey: e.root,
onSelectionChange: (e) => {
- e !== null && v(t, { root: String(e) });
+ e !== null && m(t, { root: String(e) });
},
- children: m.map((e) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: l.map((e) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
children: e
}, e))
}),
- /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(d, {
variant: "danger",
iconOnly: !0,
- leadingIcon: fe,
+ leadingIcon: se,
"aria-label": "移除这一条",
- onClick: () => c((e) => e.filter((e, n) => n !== t))
+ onClick: () => a((e) => e.filter((e, n) => n !== t))
})
]
}, t))
}),
- /* @__PURE__ */ (0, $.jsx)("div", { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)("div", { children: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- onClick: () => c((e) => [...e, {
+ onClick: () => a((e) => [...e, {
prefix: "",
- root: m[0] ?? ""
+ root: l[0] ?? ""
}]),
children: "添加前缀"
}) })
]
})
}) : null,
- u || p.error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ o || c.error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: u || p.error })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: o || c.error })
}) : null,
- /* @__PURE__ */ (0, $.jsxs)(a, { children: [h.enabled && h.cloud && h.config_toml ? /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsxs)(A, { children: [u.enabled && u.cloud && u.config_toml ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- onClick: C,
- disabled: !r.available,
- ...K(p.busy === "secret"),
+ onClick: g,
+ disabled: !n.available,
+ ...K(c.busy === "secret"),
children: "更换密钥"
- }) : null, /* @__PURE__ */ (0, $.jsx)(V, {
+ }) : null, /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- disabled: !r.available,
- ...K(p.busy === "save"),
+ disabled: !n.available,
+ ...K(c.busy === "save"),
children: "保存配置"
})] })
]
@@ -2162,7 +2162,7 @@ function Bn({ initial: e, receipt: n }) {
}
//#endregion
//#region src/react/settings/media-settings.tsx
-var Vn = (e) => _t.find(([t]) => t === e)?.[1] ?? e, Hn = (e) => e.library_icon || On(e.location)[0], Un = async (e) => (await L(pt, { initial: e })).path, Wn = (e) => ({
+var Vn = (e) => bt.find(([t]) => t === e)?.[1] ?? e, Hn = (e) => e.library_icon || On(e.location)[0], Un = async (e) => (await G(fe, { initial: e })).path, Wn = (e) => ({
library_id: e.library_id,
library: e.library,
library_icon: e.library_icon,
@@ -2173,7 +2173,7 @@ var Vn = (e) => _t.find(([t]) => t === e)?.[1] ?? e, Hn = (e) => e.library_icon
path: e,
location: "local",
root: "",
- library_id: u(),
+ library_id: Qe(),
library: "",
library_icon: "",
library_color: "",
@@ -2182,7 +2182,7 @@ var Vn = (e) => _t.find(([t]) => t === e)?.[1] ?? e, Hn = (e) => e.library_icon
cost: "free"
});
function qn(e) {
- let t = e.media_sources?.filter((e) => _t.some(([t]) => t === e.location));
+ let t = e.media_sources?.filter((e) => bt.some(([t]) => t === e.location));
return t?.length ? t.map((e) => ({
path: e.path,
location: e.location,
@@ -2193,18 +2193,18 @@ function qn(e) {
library_policy: e.library_policy || "auto",
library_stages: e.library_stages || "",
root_id: e.root_id,
- library_id: e.library_id || u(),
- cost: e.cost ?? tt(e.location)
+ library_id: e.library_id || Qe(),
+ cost: e.cost ?? lt(e.location)
})) : (e.media_dirs.length ? e.media_dirs : [""]).map((e) => Kn(e));
}
-var Jn = (e) => !(e instanceof p) || e.status !== 400 ? null : e.body?.errors ?? null;
+var Jn = (e) => !(e instanceof u) || e.status !== 400 ? null : e.body?.errors ?? null;
function Yn({ data: e, receipt: t, panel: n }) {
- let r = !!e.media_sources?.some((e) => bt(e.location));
+ let r = !!e.media_sources?.some((e) => wt(e.location));
(0, Z.useEffect)(() => {
if (!e.editable) return;
let t = /* @__PURE__ */ new Map();
for (let n of qn(e)) t.set(n.library_id, (t.get(n.library_id) ?? 0) + 1);
- Ke({
+ $e({
folders: [...t.values()],
cloud: r,
discovery: !!e.push_discovery
@@ -2212,14 +2212,14 @@ function Yn({ data: e, receipt: t, panel: n }) {
}, [e, r]);
let i = (0, Z.useRef)(null);
return (0, Z.useLayoutEffect)(() => {
- i.current && it("push-discovery", i.current.offsetHeight);
+ i.current && et("push-discovery", i.current.offsetHeight);
}), /* @__PURE__ */ (0, $.jsxs)("div", {
...Q(n),
children: [
e.editable ? /* @__PURE__ */ (0, $.jsx)(Xn, {
data: e,
receipt: t
- }) : /* @__PURE__ */ (0, $.jsx)(q, {
+ }) : /* @__PURE__ */ (0, $.jsx)(N, {
tone: "neutral",
title: "只读",
children: e.notice
@@ -2236,74 +2236,74 @@ function Yn({ data: e, receipt: t, panel: n }) {
]
});
}
-function Xn({ data: e, receipt: n }) {
- let { rows: r, edit: o, add: s, remove: c, errors: d, setErrors: p, picking: m, pick: h, inputRef: g } = yt({
+function Xn({ data: e, receipt: t }) {
+ let { rows: n, edit: r, add: i, remove: a, errors: o, setErrors: s, picking: c, pick: l, inputRef: u } = Et({
initial: () => qn(e),
blank: () => Kn(),
pickFolder: Un,
- describe: l
- }), [_, v] = (0, Z.useState)(!1), [y, b] = (0, Z.useState)(!1), [S, C] = (0, Z.useState)(""), [T, E] = (0, Z.useState)(null), D = (0, Z.useRef)(e.revision), O = f();
- He();
- let k = (e, t) => {
- r.forEach((n, i) => {
- n.library_id === r[e].library_id && o(i, t);
+ describe: q
+ }), [f, p] = (0, Z.useState)(!1), [m, h] = (0, Z.useState)(!1), [_, y] = (0, Z.useState)(""), [b, x] = (0, Z.useState)(null), S = (0, Z.useRef)(e.revision), w = Y();
+ ut();
+ let T = (e, t) => {
+ n.forEach((i, a) => {
+ i.library_id === n[e].library_id && r(a, t);
});
- }, A = [...r.reduce((e, t) => e.has(t.library_id) ? e : e.set(t.library_id, t), /* @__PURE__ */ new Map()).values()], [ee, j] = (0, Z.useState)(null);
+ }, E = [...n.reduce((e, t) => e.has(t.library_id) ? e : e.set(t.library_id, t), /* @__PURE__ */ new Map()).values()], [ee, D] = (0, Z.useState)(null);
(0, Z.useEffect)(() => {
if (!ee) return;
let e = document.querySelector(`[data-library-key="${CSS.escape(ee)}"] [data-library-head] input`);
- e?.scrollIntoView({ block: "center" }), e?.focus(), j(null);
+ e?.scrollIntoView({ block: "center" }), e?.focus(), D(null);
}, [ee]);
- let M = (e, t) => {
- let n = r.find((e) => e.library_id === t);
- if (n) {
- o(e, Wn(n));
+ let O = (e, t) => {
+ let i = n.find((e) => e.library_id === t);
+ if (i) {
+ r(e, Wn(i));
return;
}
- let i = u();
- o(e, {
- library_id: i,
+ let a = Qe();
+ r(e, {
+ library_id: a,
library: "",
library_icon: "",
library_color: "",
library_policy: "auto",
library_stages: ""
- }), j(i);
+ }), D(a);
};
(0, Z.useEffect)(() => {
- if (!T) return;
- let e = setTimeout(() => location.assign(T.url), vn);
+ if (!b) return;
+ let e = setTimeout(() => location.assign(b.url), vn);
return () => clearTimeout(e);
- }, [T]);
- let N = (t) => {
- t.preventDefault();
- let i = r.findIndex((e) => !e.cost);
+ }, [b]);
+ let k = (r) => {
+ r.preventDefault();
+ let i = n.findIndex((e) => !e.cost);
if (i >= 0) {
- b(!0);
- let e = t.currentTarget;
+ h(!0);
+ let e = r.currentTarget;
requestAnimationFrame(() => e.querySelector(`[data-media-read-policy="${i}"] button`)?.focus());
- } else C(""), O.run("save", (t) => L(pe, {
- revision: D.current,
- media_dirs: r.map((e) => e.path),
- ...e.media_sources ? { media_sources: r } : {},
+ } else y(""), w.run("save", (t) => G(g, {
+ revision: S.current,
+ media_dirs: n.map((e) => e.path),
+ ...e.media_sources ? { media_sources: n } : {},
port: String(e.port),
- scan_now: _
+ scan_now: f
}, "POST", t), (e) => {
- D.current = e.revision, p([]), n("已保存配置"), E(e);
+ S.current = e.revision, s([]), t("已保存配置"), x(e);
}, (e) => {
let t = Jn(e);
- p(t?.media_dirs ?? []), (!t || t.port) && C(t?.port || l(e));
+ s(t?.media_dirs ?? []), (!t || t.port) && y(t?.port || q(e));
});
};
- if (T) return /* @__PURE__ */ (0, $.jsx)(t, {
+ if (b) return /* @__PURE__ */ (0, $.jsx)(F, {
title: "媒体库与目录",
- children: /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsxs)(q, {
+ children: /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsxs)(N, {
tone: "success",
title: "配置已保存",
children: [
"Peach 正在重新启动。稍后自动跳转,或点击",
- /* @__PURE__ */ (0, $.jsx)(I, {
- href: T.url,
+ /* @__PURE__ */ (0, $.jsx)(ae, {
+ href: b.url,
size: "small",
children: "进入馆藏"
}),
@@ -2311,25 +2311,25 @@ function Xn({ data: e, receipt: n }) {
]
}) })
});
- let P = (t) => e.media_sources?.find((e) => e.root_id === t.root_id && e.path === t.path), te = r.some((e) => bt(e.location)), re = te ? (e.mount_dependencies ?? []).filter((e) => !e.available) : [];
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ let te = (t) => e.media_sources?.find((e) => e.root_id === t.root_id && e.path === t.path), re = n.some((e) => wt(e.location)), ie = re ? (e.mount_dependencies ?? []).filter((e) => !e.available) : [];
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "媒体库与目录",
- onSubmit: N,
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [
+ onSubmit: k,
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [
/* @__PURE__ */ (0, $.jsx)(Pn, {}),
/* @__PURE__ */ (0, $.jsx)("div", {
role: "group",
"aria-label": "媒体库与目录",
className: "flex flex-col gap-4",
- children: A.map((e) => {
- let t = r.findIndex((t) => t.library_id === e.library_id), n = r.map((e, t) => ({
+ children: E.map((e) => {
+ let t = n.findIndex((t) => t.library_id === e.library_id), s = n.map((e, t) => ({
row: e,
index: t
- })).filter(({ row: t }) => t.library_id === e.library_id), i = e.library_policy, a = e.library || "未命名媒体库";
+ })).filter(({ row: t }) => t.library_id === e.library_id), f = e.library_policy, p = e.library || "未命名媒体库";
return /* @__PURE__ */ (0, $.jsxs)("div", {
"data-library-block": "",
"data-library-key": e.library_id,
- className: F({
+ className: Pe({
variant: "raised",
padding: "none",
className: "flex flex-col p-2"
@@ -2340,126 +2340,126 @@ function Xn({ data: e, receipt: n }) {
"data-library-head": "",
children: [
/* @__PURE__ */ (0, $.jsx)(An, {
- label: `${a} 图标`,
+ label: `${p} 图标`,
value: e.library_icon,
kind: e.location,
- onChange: (e) => k(t, { library_icon: e })
+ onChange: (e) => T(t, { library_icon: e })
}),
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
className: "w-full",
- "aria-label": `${a} 名称`,
+ "aria-label": `${p} 名称`,
maxLength: 80,
placeholder: "媒体库名称",
value: e.library,
- onChange: (e) => k(t, { library: e })
+ onChange: (e) => T(t, { library: e })
}),
/* @__PURE__ */ (0, $.jsx)(Ln, {
id: e.library_id,
name: e.library,
value: e.library_color,
- onChange: (e) => k(t, { library_color: e })
+ onChange: (e) => T(t, { library_color: e })
}),
/* @__PURE__ */ (0, $.jsx)(Fn, {
- name: a,
- value: i,
- onChange: (n) => k(t, {
+ name: p,
+ value: f,
+ onChange: (n) => T(t, {
library_policy: n,
library_stages: n === "custom" ? e.library_stages || Mn.join(",") : ""
})
})
]
}),
- i === "custom" ? /* @__PURE__ */ (0, $.jsx)(In, {
- name: a,
+ f === "custom" ? /* @__PURE__ */ (0, $.jsx)(In, {
+ name: p,
value: Gn(e),
- onChange: (e) => k(t, { library_stages: Mn.filter((t) => e.includes(t)).join(",") })
+ onChange: (e) => T(t, { library_stages: Mn.filter((t) => e.includes(t)).join(",") })
}) : null,
/* @__PURE__ */ (0, $.jsxs)("div", {
"data-library-folders": "",
role: "group",
- "aria-label": `${a} 的文件夹`,
- children: [n.map(({ row: t, index: i }) => /* @__PURE__ */ (0, $.jsx)(Ct, {
+ "aria-label": `${p} 的文件夹`,
+ children: [s.map(({ row: t, index: i }) => /* @__PURE__ */ (0, $.jsx)(yt, {
label: `媒体目录 ${i + 1}`,
path: t.path,
- onPath: (e) => o(i, { path: e }),
- error: d[i],
- inputRef: g(i),
- picking: m === i,
- onPick: () => void h(i),
- onRemove: r.length > 1 ? () => c(i) : void 0,
- status: P(t) ? /* @__PURE__ */ (0, $.jsx)(Zn, { online: P(t)?.online }) : null,
- children: /* @__PURE__ */ (0, $.jsxs)(xt, { children: [
- /* @__PURE__ */ (0, $.jsx)(vt, {
+ onPath: (e) => r(i, { path: e }),
+ error: o[i],
+ inputRef: u(i),
+ picking: c === i,
+ onPick: () => void l(i),
+ onRemove: n.length > 1 ? () => a(i) : void 0,
+ status: te(t) ? /* @__PURE__ */ (0, $.jsx)(Zn, { online: te(t)?.online }) : null,
+ children: /* @__PURE__ */ (0, $.jsxs)(vt, { children: [
+ /* @__PURE__ */ (0, $.jsx)(Ct, {
index: i,
value: t.location,
- onChange: (e) => o(i, {
+ onChange: (e) => r(i, {
location: e,
cost: e === "local" ? "free" : ""
})
}),
- /* @__PURE__ */ (0, $.jsx)(St, {
+ /* @__PURE__ */ (0, $.jsx)(xt, {
index: i,
cost: t.cost,
- onChange: (e) => o(i, { cost: e }),
- error: y && !t.cost ? "请选择媒体读取策略" : void 0
+ onChange: (e) => r(i, { cost: e }),
+ error: m && !t.cost ? "请选择媒体读取策略" : void 0
}),
- t.root_id && !P(t) ? /* @__PURE__ */ (0, $.jsx)(Tt, {
+ t.root_id && !te(t) ? /* @__PURE__ */ (0, $.jsx)(_t, {
label: "变更方式",
className: "w-full @lg:w-auto @lg:flex-1",
- children: /* @__PURE__ */ (0, $.jsxs)(H, {
+ children: /* @__PURE__ */ (0, $.jsxs)(I, {
className: "w-full",
"aria-label": `目录变更方式 ${i + 1}`,
placeholder: "选择目录变更方式",
selectedKey: t.change_mode || null,
onSelectionChange: (e) => {
- e === "add" ? o(i, {
+ e === "add" ? r(i, {
root_id: void 0,
root: "",
change_mode: ""
- }) : o(i, { change_mode: "relocate" });
+ }) : r(i, { change_mode: "relocate" });
},
- children: [/* @__PURE__ */ (0, $.jsx)(z, {
+ children: [/* @__PURE__ */ (0, $.jsx)(L, {
id: "relocate",
children: "重定位此目录,保留文件记录"
- }), /* @__PURE__ */ (0, $.jsx)(z, {
+ }), /* @__PURE__ */ (0, $.jsx)(L, {
id: "add",
children: "添加另一目录"
})]
})
}) : null,
- A.length > 1 ? /* @__PURE__ */ (0, $.jsx)(Tt, {
+ E.length > 1 ? /* @__PURE__ */ (0, $.jsx)(_t, {
label: "移到媒体库",
className: "w-full @lg:w-48",
- children: /* @__PURE__ */ (0, $.jsxs)(H, {
+ children: /* @__PURE__ */ (0, $.jsxs)(I, {
className: "w-full",
"aria-label": `目录所属媒体库 ${i + 1}`,
selectedKey: t.library_id,
renderValue: /* @__PURE__ */ (0, $.jsxs)("span", {
className: "flex min-w-0 items-center gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(U, { mark: Hn(e) }), /* @__PURE__ */ (0, $.jsx)("span", {
+ children: [/* @__PURE__ */ (0, $.jsx)(B, { mark: Hn(e) }), /* @__PURE__ */ (0, $.jsx)("span", {
className: "truncate",
- children: a
+ children: p
})]
}),
onSelectionChange: (e) => {
- e && M(i, String(e));
+ e && O(i, String(e));
},
- children: [A.map((e) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: [E.map((e) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e.library_id,
textValue: e.library || "未命名媒体库",
children: /* @__PURE__ */ (0, $.jsxs)("span", {
className: "flex min-w-0 items-center gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(U, { mark: Hn(e) }), /* @__PURE__ */ (0, $.jsx)("span", {
+ children: [/* @__PURE__ */ (0, $.jsx)(B, { mark: Hn(e) }), /* @__PURE__ */ (0, $.jsx)("span", {
className: "truncate",
children: e.library || "未命名媒体库"
})]
})
- }, e.library_id)), n.length > 1 ? /* @__PURE__ */ (0, $.jsx)(z, {
+ }, e.library_id)), s.length > 1 ? /* @__PURE__ */ (0, $.jsx)(L, {
id: "new",
textValue: "新建媒体库",
children: /* @__PURE__ */ (0, $.jsxs)("span", {
className: "flex min-w-0 items-center gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(U, { mark: "plus" }), /* @__PURE__ */ (0, $.jsx)("span", { children: "新建媒体库" })]
+ children: [/* @__PURE__ */ (0, $.jsx)(B, { mark: "plus" }), /* @__PURE__ */ (0, $.jsx)("span", { children: "新建媒体库" })]
})
}) : null]
})
@@ -2467,11 +2467,11 @@ function Xn({ data: e, receipt: n }) {
] })
}, i)), /* @__PURE__ */ (0, $.jsx)("div", {
className: "flex",
- children: /* @__PURE__ */ (0, $.jsx)(V, {
+ children: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- "aria-label": `给 ${a} 添加文件夹`,
+ "aria-label": `给 ${p} 添加文件夹`,
onClick: () => {
- s(), o(r.length, {
+ i(), r(n.length, {
...Wn(e),
location: e.location,
cost: e.cost
@@ -2485,38 +2485,38 @@ function Xn({ data: e, receipt: n }) {
}, e.library_id);
})
}),
- /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
className: "self-start",
- onClick: s,
+ onClick: i,
children: "添加媒体库"
}),
- /* @__PURE__ */ (0, $.jsx)(w, { children: Le }),
- te ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(wt, {}), /* @__PURE__ */ (0, $.jsx)(xn, {})] }) : null,
- re.map((e) => /* @__PURE__ */ (0, $.jsxs)(w, { children: [
+ /* @__PURE__ */ (0, $.jsx)(j, { children: ne }),
+ re ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(St, {}), /* @__PURE__ */ (0, $.jsx)(xn, {})] }) : null,
+ ie.map((e) => /* @__PURE__ */ (0, $.jsxs)(j, { children: [
"未检测到 ",
e.name,
"。",
- /* @__PURE__ */ (0, $.jsxs)(i, {
+ /* @__PURE__ */ (0, $.jsxs)(C, {
href: e.download_url,
children: ["下载 ", e.name]
})
] }, e.name)),
- /* @__PURE__ */ (0, $.jsx)(ne, {
- isSelected: _,
- onChange: v,
+ /* @__PURE__ */ (0, $.jsx)(v, {
+ isSelected: f,
+ onChange: p,
children: "保存后扫描并补全资料"
}),
- S ? /* @__PURE__ */ (0, $.jsx)(q, {
+ _ ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: "没有保存",
- children: S
+ children: _
}) : null
- ] }), /* @__PURE__ */ (0, $.jsx)(a, {
+ ] }), /* @__PURE__ */ (0, $.jsx)(A, {
status: "保存后 Peach 会重新启动。",
- children: /* @__PURE__ */ (0, $.jsx)(V, {
+ children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(O.busy === "save"),
+ ...K(w.busy === "save"),
children: "保存配置"
})
})]
@@ -2526,22 +2526,22 @@ function Zn({ online: e }) {
return /* @__PURE__ */ (0, $.jsx)(Dt, { online: e });
}
function Qn({ data: e }) {
- let n = e.media_sources, r = f();
- return n ? /* @__PURE__ */ (0, $.jsxs)(t, {
+ let t = e.media_sources, n = Y();
+ return t ? /* @__PURE__ */ (0, $.jsxs)(F, {
title: "挂载状态",
children: [
- /* @__PURE__ */ (0, $.jsx)(j, { children: n.map((e, t) => /* @__PURE__ */ (0, $.jsxs)(J, {
- term: /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(U, { mark: Et(e.location) }), Vn(e.location)] }),
+ /* @__PURE__ */ (0, $.jsx)(O, { children: t.map((e, t) => /* @__PURE__ */ (0, $.jsxs)(D, {
+ term: /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(B, { mark: Tt(e.location) }), Vn(e.location)] }),
children: [e.path || "未配置挂载点", /* @__PURE__ */ (0, $.jsx)(Zn, { online: e.online })]
}, t)) }),
- r.error ? /* @__PURE__ */ (0, $.jsx)(x, {
+ n.error ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: r.error })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: n.error })
}) : null,
- /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
- onClick: () => void r.run("refresh", (e) => se(e), (e) => h.setQueryData(Ae, e)),
- ...K(r.busy === "refresh"),
+ onClick: () => void n.run("refresh", (e) => ze(e), (e) => J.setQueryData(h, e)),
+ ...K(n.busy === "refresh"),
children: "刷新挂载状态"
}) })
]
@@ -2555,141 +2555,141 @@ var $n = [
["coarse", "每 30 秒一张"]
];
function er({ epoch: e = 0, disabled: t = !1 }) {
- let n = B({
- queryKey: Fe,
- queryFn: ({ signal: e }) => Be(e),
+ let n = X({
+ queryKey: Oe,
+ queryFn: ({ signal: e }) => Ge(e),
refetchOnMount: "always"
- }), r = mt(), i = r.reset;
+ }), r = ht(), i = r.reset;
(0, Z.useEffect)(() => {
i();
}, [e, i]);
let a = n.data, o = r.error || n.error;
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
- /* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "时间轴预览",
description: "按所选间隔抽帧,仅处理本机磁盘上的视频。",
children: /* @__PURE__ */ (0, $.jsx)("div", {
id: "videoThumbnailSetting",
- children: /* @__PURE__ */ (0, $.jsx)(H, {
+ children: /* @__PURE__ */ (0, $.jsx)(I, {
"aria-label": "缩略图采集间隔",
selectedKey: a?.mode || "off",
isDisabled: t || !a || n.isFetching || r.isPending,
onSelectionChange: (e) => {
e !== null && r.mutate(String(e));
},
- children: $n.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: $n.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
children: t
}, e))
})
})
}) }),
- r.isPending || a?.status === "running" ? /* @__PURE__ */ (0, $.jsx)(x, {
+ r.isPending || a?.status === "running" ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(w, {
+ children: /* @__PURE__ */ (0, $.jsx)(j, {
role: "status",
children: r.isPending ? "正在保存…" : "正在采集,进度在活动页查看。"
})
}) : null,
- o ? /* @__PURE__ */ (0, $.jsx)(x, {
+ o ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: l(o) })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: q(o) })
}) : null
] });
}
function tr({ receipt: e }) {
- let n = O();
- (0, Z.useSyncExternalStore)(n.subscribe, n.version);
- let r = B({
- queryKey: nt,
- queryFn: ({ signal: e }) => Xe(e),
+ let t = Me();
+ (0, Z.useSyncExternalStore)(t.subscribe, t.version);
+ let n = X({
+ queryKey: Se,
+ queryFn: ({ signal: e }) => We(e),
refetchOnMount: "always"
- }), i = ft(), a = r.data?.followInitialDays ?? n.value.followInitialDays, o = i.error || r.error;
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ }), r = mt(), i = n.data?.followInitialDays ?? t.value.followInitialDays, a = r.error || n.error;
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "关注采集",
- children: [/* @__PURE__ */ (0, $.jsxs)(W, { children: [
+ children: [/* @__PURE__ */ (0, $.jsxs)(P, { children: [
/* @__PURE__ */ (0, $.jsx)(nr, {}),
/* @__PURE__ */ (0, $.jsx)(rr, {}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "首次采集范围",
children: /* @__PURE__ */ (0, $.jsx)("div", {
id: "followInitialDaysSetting",
- children: /* @__PURE__ */ (0, $.jsx)(H, {
+ children: /* @__PURE__ */ (0, $.jsx)(I, {
"aria-label": "首次采集范围",
- selectedKey: String(a),
- isDisabled: r.isFetching || i.isPending,
- onSelectionChange: (t) => {
- t !== null && i.mutate({ followInitialDays: Number(t) }, { onSuccess: (t) => {
- typeof t.followInitialDays == "number" && (n.value.followInitialDays = t.followInitialDays), n.save(), e("已保存首次采集范围");
+ selectedKey: String(i),
+ isDisabled: n.isFetching || r.isPending,
+ onSelectionChange: (n) => {
+ n !== null && r.mutate({ followInitialDays: Number(n) }, { onSuccess: (n) => {
+ typeof n.followInitialDays == "number" && (t.value.followInitialDays = n.followInitialDays), t.save(), e("已保存首次采集范围");
} });
},
- children: at.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: E.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
children: t
}, e))
})
})
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "头像刷新",
children: "每 3 个月"
}),
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "favicon 刷新",
children: "每年"
})
- ] }), o ? /* @__PURE__ */ (0, $.jsx)(x, {
+ ] }), a ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: l(o) })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: q(a) })
}) : null]
});
}
function nr() {
- let t = B({
- queryKey: Ne,
- queryFn: ({ signal: e }) => ye(e),
+ let e = X({
+ queryKey: ee,
+ queryFn: ({ signal: e }) => He(e),
refetchOnMount: "always",
- refetchInterval: (e) => Me(e.state.data)
- }), n = oe(), r = t.data, i = (0, Z.useRef)(e(Number(localStorage.getItem("peach.number.followScheduleSetting")), 15, 10080, 60)), [a, o] = (0, Z.useState)("60"), [s, c] = (0, Z.useState)(!1);
+ refetchInterval: (e) => at(e.state.data)
+ }), t = pt(), n = e.data, r = (0, Z.useRef)(Ne(Number(localStorage.getItem("peach.number.followScheduleSetting")), 15, 10080, 60)), [i, a] = (0, Z.useState)("60"), [o, s] = (0, Z.useState)(!1);
(0, Z.useEffect)(() => {
- r?.enabled && (i.current = r.interval_minutes, o(String(r.interval_minutes)));
- }, [r]);
- let u = !r?.available || t.isFetching || n.isPending, d = () => {
- let e = Number(a);
- !Number.isInteger(e) || e < 15 || e > 10080 ? c(!0) : (c(!1), r?.enabled && !u && e !== r.interval_minutes && (i.current = e, localStorage.setItem("peach.number.followScheduleSetting", String(e)), n.mutate(e)));
- }, f = n.error || t.error;
+ n?.enabled && (r.current = n.interval_minutes, a(String(n.interval_minutes)));
+ }, [n]);
+ let c = !n?.available || e.isFetching || t.isPending, l = () => {
+ let e = Number(i);
+ !Number.isInteger(e) || e < 15 || e > 10080 ? s(!0) : (s(!1), n?.enabled && !c && e !== n.interval_minutes && (r.current = e, localStorage.setItem("peach.number.followScheduleSetting", String(e)), t.mutate(e)));
+ }, u = t.error || e.error;
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "自动检查更新",
children: /* @__PURE__ */ (0, $.jsxs)("div", {
id: "followScheduleSetting",
className: "flex min-w-0 flex-wrap items-center justify-end gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(R, {
+ children: [/* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "自动检查更新",
- isSelected: r?.enabled === !0,
- isDisabled: u,
+ isSelected: n?.enabled === !0,
+ isDisabled: c,
onChange: (e) => {
- localStorage.setItem("peach.number.followScheduleSetting", String(i.current)), n.mutate(e ? i.current : 0);
+ localStorage.setItem("peach.number.followScheduleSetting", String(r.current)), t.mutate(e ? r.current : 0);
}
- }), r?.enabled ? /* @__PURE__ */ (0, $.jsxs)("div", {
+ }), n?.enabled ? /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex items-center gap-2",
- children: [/* @__PURE__ */ (0, $.jsx)(G, {
+ children: [/* @__PURE__ */ (0, $.jsx)(M, {
type: "number",
inputMode: "numeric",
name: "follow-interval",
autoComplete: "off",
"aria-label": "自动检查间隔",
className: "w-24",
- value: a,
+ value: i,
onChange: (e) => {
- o(e), c(!1);
+ a(e), s(!1);
},
- onBlur: d,
+ onBlur: l,
onKeyDown: (e) => {
- e.key === "Enter" && (e.preventDefault(), d());
+ e.key === "Enter" && (e.preventDefault(), l());
},
- isDisabled: u,
- isInvalid: s
+ isDisabled: c,
+ isInvalid: o
}), /* @__PURE__ */ (0, $.jsx)("span", {
className: "text-body-2-regular text-text-secondary",
children: "分钟"
@@ -2697,37 +2697,37 @@ function nr() {
}) : null]
})
}),
- s ? /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsx)(k, { children: "请输入 15–10080 的整数(分钟)。" }) }) : null,
- n.isPending || r?.running ? /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsx)(w, {
+ o ? /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsx)(S, { children: "请输入 15–10080 的整数(分钟)。" }) }) : null,
+ t.isPending || n?.running ? /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsx)(j, {
role: "status",
- children: n.isPending ? "正在保存…" : "正在检查来源更新…"
+ children: t.isPending ? "正在保存…" : "正在检查来源更新…"
}) }) : null,
/* @__PURE__ */ (0, $.jsx)(ir, {
kind: "follow",
- status: r,
+ status: n,
title: "上次自动检查失败"
}),
- f ? /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsx)(k, { children: l(f) }) }) : null
+ u ? /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsx)(S, { children: q(u) }) }) : null
] });
}
function rr() {
- let e = B({
- queryKey: et,
- queryFn: ({ signal: e }) => st(e),
+ let e = X({
+ queryKey: w,
+ queryFn: ({ signal: e }) => Ve(e),
refetchOnMount: "always",
- refetchInterval: (e) => Me(e.state.data)
+ refetchInterval: (e) => at(e.state.data)
}).data;
if (!e) return null;
let t = e.interval_minutes, n = t % 60 ? `每 ${t} 分钟` : `每 ${t / 60} 小时`;
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
- /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(R, {
label: "订阅源拉取",
children: /* @__PURE__ */ (0, $.jsx)("span", {
id: "feedScheduleSetting",
children: e.available ? e.enabled ? n : "已关闭" : "只在写入端可用"
})
}),
- e.running ? /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsx)(w, {
+ e.running ? /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsx)(j, {
role: "status",
children: "正在拉取订阅源…"
}) }) : null,
@@ -2739,17 +2739,17 @@ function rr() {
] });
}
function ir({ kind: e, status: t, title: n }) {
- let r = ke(e);
+ let r = ft(e);
if (!t?.enabled || t.running || !t.last_error) return null;
- let i = t.consecutive_failures ?? 0, a = E(t.next_run_at), o = [i > 1 ? `已连续失败 ${i} 次` : "", a ? `下一轮 ${a}` : ""].filter(Boolean).join(","), s = [
+ let i = t.consecutive_failures ?? 0, a = qe(t.next_run_at), o = [i > 1 ? `已连续失败 ${i} 次` : "", a ? `下一轮 ${a}` : ""].filter(Boolean).join(","), s = [
t.last_error,
o,
- r.error ? `没有重试:${l(r.error)}` : ""
+ r.error ? `没有重试:${q(r.error)}` : ""
].filter(Boolean).join("\n");
- return /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsx)(q, {
+ return /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: n,
- action: /* @__PURE__ */ (0, $.jsx)(V, {
+ action: /* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
size: "small",
disabled: !t.available,
@@ -2763,113 +2763,113 @@ function ir({ kind: e, status: t, title: n }) {
//#endregion
//#region src/react/settings/media-processing-settings.tsx
function ar({ receipt: e }) {
- let n = B({
- queryKey: le,
- queryFn: ({ signal: e }) => De(e)
- }), r = f(), i = r.error || (n.error ? l(n.error) : ""), a = !n.data || n.isFetching || !!r.busy;
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ let t = X({
+ queryKey: ce,
+ queryFn: ({ signal: e }) => Ue(e)
+ }), n = Y(), r = n.error || (t.error ? q(t.error) : ""), i = !t.data || t.isFetching || !!n.busy;
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "视频预览",
children: [
- /* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "生成视频预览",
description: "为本地视频生成九宫格与时间轴预览;关闭后仍按入库规则探测时长与分辨率。",
- children: /* @__PURE__ */ (0, $.jsx)(R, {
+ children: /* @__PURE__ */ (0, $.jsx)(U, {
"aria-label": "生成视频预览",
- isSelected: !!n.data && !n.data.metadata_only,
- isDisabled: a,
- onChange: (t) => void r.run("save", (e) => L(We, { metadata_only: !t }, "POST", e), (t) => {
- h.setQueryData(le, t), h.invalidateQueries({ queryKey: Fe }), h.invalidateQueries({ queryKey: c }), e(t.metadata_only ? "已关闭视频预览生成" : "已开启视频预览生成");
+ isSelected: !!t.data && !t.data.metadata_only,
+ isDisabled: i,
+ onChange: (t) => void n.run("save", (e) => G(le, { metadata_only: !t }, "POST", e), (t) => {
+ J.setQueryData(ce, t), J.invalidateQueries({ queryKey: Oe }), J.invalidateQueries({ queryKey: re }), e(t.metadata_only ? "已关闭视频预览生成" : "已开启视频预览生成");
})
})
}) }),
- /* @__PURE__ */ (0, $.jsx)(er, { disabled: !n.data || n.data.metadata_only || !!r.busy }),
- /* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(er, { disabled: !t.data || t.data.metadata_only || !!n.busy }),
+ /* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "抽帧解码方式",
description: "用于生成封面、九宫格和时间轴。",
children: /* @__PURE__ */ (0, $.jsx)("div", {
id: "previewAccelerationSetting",
- children: /* @__PURE__ */ (0, $.jsxs)(H, {
+ children: /* @__PURE__ */ (0, $.jsxs)(I, {
"aria-label": "抽帧解码方式",
- selectedKey: n.data?.preview_acceleration || "auto",
- isDisabled: a,
+ selectedKey: t.data?.preview_acceleration || "auto",
+ isDisabled: i,
onSelectionChange: (t) => {
- t !== null && r.run("preview_acceleration", (e) => L(We, { preview_acceleration: String(t) }, "POST", e), (t) => {
- h.setQueryData(le, t), e("已保存抽帧解码方式");
+ t !== null && n.run("preview_acceleration", (e) => G(le, { preview_acceleration: String(t) }, "POST", e), (t) => {
+ J.setQueryData(ce, t), e("已保存抽帧解码方式");
});
},
- children: [/* @__PURE__ */ (0, $.jsx)(z, {
+ children: [/* @__PURE__ */ (0, $.jsx)(L, {
id: "auto",
children: "自动(硬件优先)"
- }), /* @__PURE__ */ (0, $.jsx)(z, {
+ }), /* @__PURE__ */ (0, $.jsx)(L, {
id: "software",
children: "软件解码"
})]
})
})
}) }),
- r.busy ? /* @__PURE__ */ (0, $.jsx)(x, {
+ n.busy ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(w, {
+ children: /* @__PURE__ */ (0, $.jsx)(j, {
role: "status",
children: "正在保存…"
})
}) : null,
- i ? /* @__PURE__ */ (0, $.jsx)(x, {
+ r ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: i })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: r })
}) : null
]
});
}
function or({ receipt: e }) {
- let n = B({
- queryKey: le,
- queryFn: ({ signal: e }) => De(e)
- }), r = f(), i = r.error || (n.error ? l(n.error) : "");
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ let t = X({
+ queryKey: ce,
+ queryFn: ({ signal: e }) => Ue(e)
+ }), n = Y(), r = n.error || (t.error ? q(t.error) : "");
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "视频播放",
children: [
- /* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "转码方式",
description: "用于播放时的视频转码。",
children: /* @__PURE__ */ (0, $.jsx)("div", {
id: "playbackAccelerationSetting",
- children: /* @__PURE__ */ (0, $.jsxs)(H, {
+ children: /* @__PURE__ */ (0, $.jsxs)(I, {
"aria-label": "转码方式",
- selectedKey: n.data?.playback_acceleration || "auto",
- isDisabled: !n.data || n.isFetching || !!r.busy,
+ selectedKey: t.data?.playback_acceleration || "auto",
+ isDisabled: !t.data || t.isFetching || !!n.busy,
onSelectionChange: (t) => {
- t !== null && r.run("playback_acceleration", (e) => L(We, { playback_acceleration: String(t) }, "POST", e), (t) => {
- h.setQueryData(le, t), e("已保存转码方式");
+ t !== null && n.run("playback_acceleration", (e) => G(le, { playback_acceleration: String(t) }, "POST", e), (t) => {
+ J.setQueryData(ce, t), e("已保存转码方式");
});
},
- children: [/* @__PURE__ */ (0, $.jsx)(z, {
+ children: [/* @__PURE__ */ (0, $.jsx)(L, {
id: "auto",
children: "自动(硬件优先)"
- }), /* @__PURE__ */ (0, $.jsx)(z, {
+ }), /* @__PURE__ */ (0, $.jsx)(L, {
id: "software",
children: "软件编解码"
})]
})
})
}) }),
- r.busy ? /* @__PURE__ */ (0, $.jsx)(x, {
+ n.busy ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(w, {
+ children: /* @__PURE__ */ (0, $.jsx)(j, {
role: "status",
children: "正在保存…"
})
}) : null,
- i ? /* @__PURE__ */ (0, $.jsx)(x, {
+ r ? /* @__PURE__ */ (0, $.jsx)(V, {
divided: !0,
- children: /* @__PURE__ */ (0, $.jsx)(k, { children: i })
+ children: /* @__PURE__ */ (0, $.jsx)(S, { children: r })
}) : null
]
});
}
//#endregion
//#region src/react/boardui/components/base/textarea/textarea.tsx
-var sr = te({
+var sr = ct({
field: [
"relative flex w-full flex-col",
"rounded-2lg",
@@ -2897,39 +2897,39 @@ var sr = te({
footer: "flex w-full items-start justify-between gap-3",
count: "ms-auto shrink-0 pt-px text-caption-1-medium text-text-tertiary tabular-nums"
}), cr = 20;
-function lr({ size: e, rows: t = 3, autoResize: n = !1, maxRows: r, resize: i = "vertical", fieldClassName: a, className: o, ref: s, groupRef: c, onInput: l, ...u }) {
- let d = (0, Z.useContext)(Ee), f = e ?? d.size ?? "medium", p = (0, Z.useRef)(null), m = (e) => {
- p.current = e, typeof s == "function" ? s(e) : s && (s.current = e);
- }, h = () => {
- let e = p.current;
+function lr({ size: e, rows: n = 3, autoResize: r = !1, maxRows: a, resize: o = "vertical", fieldClassName: s, className: c, ref: l, groupRef: u, onInput: d, ...f }) {
+ let p = (0, Z.useContext)(Ae), m = e ?? p.size ?? "medium", h = (0, Z.useRef)(null), g = (e) => {
+ h.current = e, typeof l == "function" ? l(e) : l && (l.current = e);
+ }, _ = () => {
+ let e = h.current;
if (!e) return;
- if (!n) {
+ if (!r) {
e.style.height = "", e.style.maxHeight = "", e.style.overflowY = "";
return;
}
- let i = parseFloat(window.getComputedStyle(e).lineHeight) || cr, a = r ? r * i : Infinity;
+ let t = parseFloat(window.getComputedStyle(e).lineHeight) || cr, i = a ? a * t : Infinity;
e.style.height = "0px";
- let o = Math.max(e.scrollHeight, t * i);
- e.style.height = `${Math.min(o, a)}px`, e.style.maxHeight = r ? `${a}px` : "", e.style.overflowY = o > a ? "auto" : "hidden";
+ let o = Math.max(e.scrollHeight, n * t);
+ e.style.height = `${Math.min(o, i)}px`, e.style.maxHeight = a ? `${i}px` : "", e.style.overflowY = o > i ? "auto" : "hidden";
};
- return (0, Z.useLayoutEffect)(h), /* @__PURE__ */ (0, $.jsx)(ct, {
- ref: c,
- className: ({ isFocusWithin: e, isHovered: t, isDisabled: n, isInvalid: r }) => P(sr.field, sr.fieldSize[f], t && !e && !n && !r && "ring-border-button-hover", e && !n && !r && "ring-border-button-active", n && "bg-input-disabled-background text-input-disabled-foreground", r && "bg-background-tertiary-error text-foreground-icon-error", d.fieldClassName, a),
- children: /* @__PURE__ */ (0, $.jsx)(re, {
- ref: m,
- rows: t,
- ...u,
+ return (0, Z.useLayoutEffect)(_), /* @__PURE__ */ (0, $.jsx)(t, {
+ ref: u,
+ className: ({ isFocusWithin: e, isHovered: t, isDisabled: n, isInvalid: r }) => Re(sr.field, sr.fieldSize[m], t && !e && !n && !r && "ring-border-button-hover", e && !n && !r && "ring-border-button-active", n && "bg-input-disabled-background text-input-disabled-foreground", r && "bg-background-tertiary-error text-foreground-icon-error", p.fieldClassName, s),
+ children: /* @__PURE__ */ (0, $.jsx)(i, {
+ ref: g,
+ rows: n,
+ ...f,
onInput: (e) => {
- h(), l?.(e);
+ _(), d?.(e);
},
- className: P(sr.textarea, sr.resize[n ? "none" : i], d.inputClassName, o)
+ className: Re(sr.textarea, sr.resize[r ? "none" : o], p.inputClassName, c)
})
});
}
lr.displayName = "TextareaBase";
function ur({ label: e, hint: t, tooltip: n, placeholder: r, rows: i, autoResize: a, maxRows: o, resize: s, maxLength: c, showCount: l = !1, fieldClassName: u, ref: d, groupRef: f, className: p, value: m, defaultValue: h, onChange: g, ..._ }) {
let [v, y] = (0, Z.useState)(() => (h ?? "").length), b = m === void 0 ? v : m.length;
- return /* @__PURE__ */ (0, $.jsx)(ve, {
+ return /* @__PURE__ */ (0, $.jsx)(ke, {
..._,
value: m,
defaultValue: h,
@@ -2939,7 +2939,7 @@ function ur({ label: e, hint: t, tooltip: n, placeholder: r, rows: i, autoResize
className: p,
"aria-label": _["aria-label"] ?? (!e && typeof r == "string" ? r : void 0),
children: ({ isRequired: p, isInvalid: m }) => /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
- e && /* @__PURE__ */ (0, $.jsx)(ze, {
+ e && /* @__PURE__ */ (0, $.jsx)(ie, {
isRequired: p,
isInvalid: m,
tooltip: n,
@@ -2958,11 +2958,11 @@ function ur({ label: e, hint: t, tooltip: n, placeholder: r, rows: i, autoResize
}),
(t || l) && /* @__PURE__ */ (0, $.jsxs)("div", {
className: sr.footer,
- children: [t && /* @__PURE__ */ (0, $.jsx)(Ye, {
+ children: [t && /* @__PURE__ */ (0, $.jsx)(te, {
isInvalid: m,
children: t
}), l && /* @__PURE__ */ (0, $.jsx)("span", {
- className: P(sr.count, m && "text-text-error-primary"),
+ className: Re(sr.count, m && "text-text-error-primary"),
children: c ? `${b}/${c}` : b
})]
})
@@ -2974,20 +2974,20 @@ ur.displayName = "Textarea";
//#region src/react/settings/code-pattern-settings.tsx
var dr = "^\\+{3}\\s*(?<code>FC2-PPV-\\d+)\n\\[(?<code>[A-Z]+-\\d+)\\]";
function fr({ receipt: e }) {
- let n = B({
- queryKey: nt,
- queryFn: ({ signal: e }) => Xe(e)
- }), [r, i] = (0, Z.useState)(null), o = f(), s = r ?? (n.data?.codePatterns ?? []).join("\n"), c = o.error || (n.error ? l(n.error) : "");
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ let t = X({
+ queryKey: Se,
+ queryFn: ({ signal: e }) => We(e)
+ }), [n, r] = (0, Z.useState)(null), i = Y(), a = n ?? (t.data?.codePatterns ?? []).join("\n"), o = i.error || (t.error ? q(t.error) : "");
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "番号识别规则",
onSubmit: (t) => {
t.preventDefault();
- let n = s.split("\n").map((e) => e.trim()).filter(Boolean);
- o.run("save", (e) => L(me, { codePatterns: n }, "POST", e), (t) => {
- h.setQueryData(nt, t), i(null), e("已保存配置");
+ let n = a.split("\n").map((e) => e.trim()).filter(Boolean);
+ i.run("save", (e) => G(Ce, { codePatterns: n }, "POST", e), (t) => {
+ J.setQueryData(Se, t), r(null), e("已保存配置");
});
},
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [/* @__PURE__ */ (0, $.jsx)(w, { children: "内置规则认不出番号时,按这里的规则从文件名里取。每行一条正则表达式,番号写在 (?<code>…) 里,没有命名组就取第一个括号。规则在下一次处理时对还没有番号的视频生效。" }), /* @__PURE__ */ (0, $.jsx)(ur, {
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [/* @__PURE__ */ (0, $.jsx)(j, { children: "内置规则认不出番号时,按这里的规则从文件名里取。每行一条正则表达式,番号写在 (?<code>…) 里,没有命名组就取第一个括号。规则在下一次处理时对还没有番号的视频生效。" }), /* @__PURE__ */ (0, $.jsx)(ur, {
id: "codePatternSetting",
"aria-label": "番号识别规则",
rows: 3,
@@ -2996,14 +2996,14 @@ function fr({ receipt: e }) {
spellCheck: "false",
autoComplete: "off",
placeholder: dr,
- value: s,
- isDisabled: !n.data,
- isInvalid: !!c,
- hint: c || void 0,
- onChange: i
- })] }), /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ value: a,
+ isDisabled: !t.data,
+ isInvalid: !!o,
+ hint: o || void 0,
+ onChange: r
+ })] }), /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(o.busy === "save"),
+ ...K(i.busy === "save"),
children: "保存配置"
}) })]
});
@@ -3011,7 +3011,7 @@ function fr({ receipt: e }) {
//#endregion
//#region src/react/settings/password-pair.tsx
function pr({ label: e, password: t, confirmation: n, onPassword: r, onConfirmation: i, disabled: a = !1, passwordError: o, passwordHint: s, confirmationError: c, confirmationInvalid: l = !1 }) {
- return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(G, {
+ return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(M, {
id: "access-password",
type: "password",
label: e,
@@ -3024,7 +3024,7 @@ function pr({ label: e, password: t, confirmation: n, onPassword: r, onConfirmat
validationBehavior: "aria",
isInvalid: !a && !!o,
hint: a ? s : o || s
- }), /* @__PURE__ */ (0, $.jsx)(G, {
+ }), /* @__PURE__ */ (0, $.jsx)(M, {
id: "access-confirm",
type: "password",
label: "确认访问密码",
@@ -3046,132 +3046,132 @@ var mr = {
locked: "访问设置无法读取,请在本机检查配置文件。",
password: "已设置密码。新设备需要登录,登录时勾选「保持登录」可保持 30 天。"
};
-function hr({ initial: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e), [o, s] = (0, Z.useState)(""), [c, u] = (0, Z.useState)(""), [d, m] = (0, Z.useState)(""), [h, g] = (0, Z.useState)(!1), [_, v] = (0, Z.useState)({}), y = (0, Z.useRef)(null), b = f(), S = (e) => {
+function hr({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(""), [o, s] = (0, Z.useState)(""), [c, l] = (0, Z.useState)(""), [f, p] = (0, Z.useState)(!1), [m, h] = (0, Z.useState)({}), g = (0, Z.useRef)(null), _ = Y(), y = (e) => {
e.preventDefault();
- let t = {};
- r.mode === "password" && !o && (t.current_password = "请输入当前访问密码"), h || ((c.length < 8 || c.length > 256) && (t.password = "访问密码需为 8–256 个字符"), c !== d && (t.confirmation = "两次输入的密码不一致")), v(t), Object.keys(t).length ? requestAnimationFrame(() => y.current?.querySelector("input[aria-invalid=\"true\"]")?.focus()) : b.run("save", (e) => L("/api/configuration/access", {
- revision: r.revision,
- action: h ? "disable" : "set",
- confirm_disable: h,
- current_password: o,
- password: h ? "" : c,
- confirmation: h ? "" : d
+ let d = {};
+ n.mode === "password" && !i && (d.current_password = "请输入当前访问密码"), f || ((o.length < 8 || o.length > 256) && (d.password = "访问密码需为 8–256 个字符"), o !== c && (d.confirmation = "两次输入的密码不一致")), h(d), Object.keys(d).length ? requestAnimationFrame(() => g.current?.querySelector("input[aria-invalid=\"true\"]")?.focus()) : _.run("save", (e) => G("/api/configuration/access", {
+ revision: n.revision,
+ action: f ? "disable" : "set",
+ confirm_disable: f,
+ current_password: i,
+ password: f ? "" : o,
+ confirmation: f ? "" : c
}, "POST", e), (e) => {
- i(e), s(""), u(""), m(""), g(!1), v({}), n(e.mode === "open" ? "已关闭访问密码" : "已保存配置");
+ r(e), a(""), s(""), l(""), p(!1), h({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存配置");
}, (e) => {
- let t = e instanceof p ? e.body : null, n = t?.errors || t?.detail?.errors;
- n ? v(n) : b.setError(l(e));
+ let t = e instanceof u ? e.body : null, n = t?.errors || t?.detail?.errors;
+ n ? h(n) : _.setError(q(e));
});
- }, C = mr[r.mode], T = r.mode !== "locked";
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ }, b = mr[n.mode], x = n.mode !== "locked";
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "访问密码",
- onSubmit: S,
+ onSubmit: y,
children: [/* @__PURE__ */ (0, $.jsx)("div", {
- ref: y,
- children: /* @__PURE__ */ (0, $.jsxs)(x, { children: [
- C ? /* @__PURE__ */ (0, $.jsx)(w, { children: C }) : null,
- r.mode === "open" ? /* @__PURE__ */ (0, $.jsx)(q, {
+ ref: g,
+ children: /* @__PURE__ */ (0, $.jsxs)(V, { children: [
+ b ? /* @__PURE__ */ (0, $.jsx)(j, { children: b }) : null,
+ n.mode === "open" ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "warning",
title: "未设置访问密码",
children: "能连接到 Peach 的设备打开地址就能看馆藏,不需要登录。"
}) : null,
- r.mode === "password" || r.mode === "legacy" ? /* @__PURE__ */ (0, $.jsx)(ne, {
- isSelected: h,
- onChange: g,
+ n.mode === "password" || n.mode === "legacy" ? /* @__PURE__ */ (0, $.jsx)(v, {
+ isSelected: f,
+ onChange: p,
children: "关闭访问密码"
}) : null,
- r.mode === "password" ? /* @__PURE__ */ (0, $.jsx)(G, {
+ n.mode === "password" ? /* @__PURE__ */ (0, $.jsx)(M, {
id: "access-current",
type: "password",
label: "当前访问密码",
autoComplete: "current-password",
maxLength: 256,
- value: o,
- onChange: s,
+ value: i,
+ onChange: a,
isRequired: !0,
validationBehavior: "aria",
- isInvalid: !!_.current_password,
- hint: _.current_password
+ isInvalid: !!m.current_password,
+ hint: m.current_password
}) : null,
- T ? /* @__PURE__ */ (0, $.jsx)(pr, {
- label: r.mode === "password" ? "新访问密码" : "设置访问密码",
- password: c,
- confirmation: d,
- onPassword: u,
- onConfirmation: m,
- disabled: h,
- passwordError: _.password,
- confirmationError: _.confirmation,
- passwordHint: h ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"
+ x ? /* @__PURE__ */ (0, $.jsx)(pr, {
+ label: n.mode === "password" ? "新访问密码" : "设置访问密码",
+ password: o,
+ confirmation: c,
+ onPassword: s,
+ onConfirmation: l,
+ disabled: f,
+ passwordError: m.password,
+ confirmationError: m.confirmation,
+ passwordHint: f ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"
}) : null,
- h ? /* @__PURE__ */ (0, $.jsx)(q, {
+ f ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "warning",
title: "访问范围",
children: "保存后,能连接到 Peach 的设备将直接访问馆藏。"
}) : null,
- b.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: b.error }) : null
+ _.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: _.error }) : null
] })
- }), T ? /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ }), x ? /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(b.busy === "save"),
+ ...K(_.busy === "save"),
children: "保存配置"
}) }) : null]
});
}
//#endregion
//#region src/react/settings/port-settings.tsx
-function gr({ data: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(String(e.port)), [o, s] = (0, Z.useState)(""), [c, u] = (0, Z.useState)(null), d = f();
+function gr({ data: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(String(e.port)), [i, a] = (0, Z.useState)(""), [o, s] = (0, Z.useState)(null), c = Y();
return (0, Z.useEffect)(() => {
- if (!c) return;
- let e = setTimeout(() => location.assign(c.url), vn);
+ if (!o) return;
+ let e = setTimeout(() => location.assign(o.url), vn);
return () => clearTimeout(e);
- }, [c]), c ? /* @__PURE__ */ (0, $.jsx)(t, {
+ }, [o]), o ? /* @__PURE__ */ (0, $.jsx)(F, {
title: "本机访问端口",
- children: /* @__PURE__ */ (0, $.jsx)(x, { children: /* @__PURE__ */ (0, $.jsxs)(q, {
+ children: /* @__PURE__ */ (0, $.jsx)(V, { children: /* @__PURE__ */ (0, $.jsxs)(N, {
tone: "success",
title: "配置已保存",
- children: ["Peach 正在重新启动。", /* @__PURE__ */ (0, $.jsx)(I, {
- href: c.url,
+ children: ["Peach 正在重新启动。", /* @__PURE__ */ (0, $.jsx)(ae, {
+ href: o.url,
size: "small",
children: "进入馆藏"
})]
}) })
- }) : /* @__PURE__ */ (0, $.jsxs)(t, {
+ }) : /* @__PURE__ */ (0, $.jsxs)(F, {
title: "本机访问端口",
- onSubmit: (t) => {
- t.preventDefault(), s(""), d.run("save", (t) => L(pe, {
+ onSubmit: (r) => {
+ r.preventDefault(), a(""), c.run("save", (t) => G(g, {
revision: e.revision,
media_dirs: e.media_dirs,
...e.media_sources ? { media_sources: e.media_sources } : {},
- port: r,
+ port: n,
scan_now: !1
}, "POST", t), (e) => {
- u(e), n("已保存配置");
+ s(e), t("已保存配置");
}, (e) => {
- let t = e instanceof p && e.status === 400 ? e.body?.errors : null;
- t?.port ? s(t.port) : d.setError(l(e));
+ let t = e instanceof u && e.status === 400 ? e.body?.errors : null;
+ t?.port ? a(t.port) : c.setError(q(e));
});
},
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [/* @__PURE__ */ (0, $.jsx)(G, {
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [/* @__PURE__ */ (0, $.jsx)(M, {
id: "configPort",
label: "端口",
inputMode: "numeric",
- value: r,
- onChange: i,
+ value: n,
+ onChange: r,
validationBehavior: "aria",
- isInvalid: !!o,
- hint: o || void 0
- }), d.error ? /* @__PURE__ */ (0, $.jsx)(q, {
+ isInvalid: !!i,
+ hint: i || void 0
+ }), c.error ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: "没有保存",
- children: d.error
- }) : null] }), /* @__PURE__ */ (0, $.jsx)(a, {
+ children: c.error
+ }) : null] }), /* @__PURE__ */ (0, $.jsx)(A, {
status: "保存后 Peach 会重启,并跳转到新地址。",
- children: /* @__PURE__ */ (0, $.jsx)(V, {
+ children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(d.busy === "save"),
+ ...K(c.busy === "save"),
children: "保存配置"
})
})]
@@ -3183,110 +3183,110 @@ var _r = 2e3, vr = [["quick", "临时链接"], ["named", "命名隧道"]], yr =
quick: "临时预览用,地址随机,重启后会变。启动前要先设置访问密码。",
named: "使用你在 Cloudflare 绑定的固定域名。启动前要先设置访问密码。"
};
-function br({ revision: e, initial: n, receipt: r }) {
- let [o, s] = (0, Z.useState)(n), [c, u] = (0, Z.useState)(e), [d, m] = (0, Z.useState)(n.mode), [g, _] = (0, Z.useState)(n.hostname), [v, b] = (0, Z.useState)(""), [S, C] = (0, Z.useState)({}), T = f(), E = o.state === "starting" || o.state === "running", D = o.named_available && d === "named";
+function br({ revision: e, initial: t, receipt: n }) {
+ let [r, i] = (0, Z.useState)(t), [a, o] = (0, Z.useState)(e), [s, l] = (0, Z.useState)(t.mode), [f, p] = (0, Z.useState)(t.hostname), [m, g] = (0, Z.useState)(""), [_, v] = (0, Z.useState)({}), y = Y(), b = r.state === "starting" || r.state === "running", x = r.named_available && s === "named";
(0, Z.useEffect)(() => {
- if (o.state !== "starting") return;
+ if (r.state !== "starting") return;
let e = new AbortController(), t = window.setInterval(() => {
- se(e.signal).then((t) => {
- !e.signal.aborted && t.tunnel && (h.setQueryData(Ae, t), s(t.tunnel), u(t.revision));
+ ze(e.signal).then((t) => {
+ !e.signal.aborted && t.tunnel && (J.setQueryData(h, t), i(t.tunnel), o(t.revision));
}).catch(() => void 0);
}, _r);
return () => {
e.abort(), window.clearInterval(t);
};
- }, [o.state]);
- let O = (e, t, n) => {
- C({}), T.run(e, (e) => L("/api/configuration/tunnel", {
- revision: c,
+ }, [r.state]);
+ let w = (e, t, n) => {
+ v({}), y.run(e, (e) => G("/api/configuration/tunnel", {
+ revision: a,
enabled: t,
- mode: d,
- hostname: g,
- token: v
+ mode: s,
+ hostname: f,
+ token: m
}, "POST", e), (e) => {
- s(e), u(e.revision), m(e.mode), _(e.hostname), b(""), n(e);
+ i(e), o(e.revision), l(e.mode), p(e.hostname), g(""), n(e);
}, (e) => {
- let t = e instanceof p ? e.body : null, n = t?.errors || t?.detail?.errors;
- n ? C(n) : T.setError(l(e));
+ let t = e instanceof u ? e.body : null, n = t?.errors || t?.detail?.errors;
+ n ? v(n) : y.setError(q(e));
});
};
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
id: "tunnel",
title: "Cloudflare 公网入口",
onSubmit: (e) => {
- e.preventDefault(), O("save", E, () => r("已保存配置"));
+ e.preventDefault(), w("save", b, () => n("已保存配置"));
},
- aside: /* @__PURE__ */ (0, $.jsx)(y, {
- tone: o.error ? "error" : E ? "progress" : "neutral",
- children: o.error ? "连接失败" : o.state === "running" ? "运行中" : o.state === "starting" ? "连接中" : "已停止"
+ aside: /* @__PURE__ */ (0, $.jsx)(H, {
+ tone: r.error ? "error" : b ? "progress" : "neutral",
+ children: r.error ? "连接失败" : r.state === "running" ? "运行中" : r.state === "starting" ? "连接中" : "已停止"
}),
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [
- o.named_available ? /* @__PURE__ */ (0, $.jsx)(Re, {
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [
+ r.named_available ? /* @__PURE__ */ (0, $.jsx)(we, {
"aria-label": "公网入口的形态(二选一)",
- value: d,
- isDisabled: E,
- onChange: (e) => m(e),
- className: qe,
- children: vr.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(rt, {
+ value: s,
+ isDisabled: b,
+ onChange: (e) => l(e),
+ className: xe,
+ children: vr.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(c, {
value: e,
- className: Te,
+ className: be,
children: t
}, e))
}) : null,
- /* @__PURE__ */ (0, $.jsx)(w, { children: yr[D ? "named" : "quick"] }),
- D ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(j, { children: yr[x ? "named" : "quick"] }),
+ x ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(M, {
id: "tunnel-hostname",
label: "公开主机名",
autoComplete: "off",
maxLength: 253,
- value: g,
- onChange: _,
- isDisabled: E,
+ value: f,
+ onChange: p,
+ isDisabled: b,
validationBehavior: "aria",
- isInvalid: !!S.hostname,
- hint: S.hostname || "Cloudflare Zero Trust 里指向这台电脑的主机名。"
- }), /* @__PURE__ */ (0, $.jsx)(G, {
+ isInvalid: !!_.hostname,
+ hint: _.hostname || "Cloudflare Zero Trust 里指向这台电脑的主机名。"
+ }), /* @__PURE__ */ (0, $.jsx)(M, {
id: "tunnel-token",
type: "password",
label: "隧道令牌",
autoComplete: "off",
maxLength: 2048,
- value: v,
- onChange: b,
- isDisabled: E,
+ value: m,
+ onChange: g,
+ isDisabled: b,
validationBehavior: "aria",
- hint: o.token_set ? "已保存,留空不改。" : "在 Cloudflare Zero Trust 的隧道详情页复制。"
+ hint: r.token_set ? "已保存,留空不改。" : "在 Cloudflare Zero Trust 的隧道详情页复制。"
})] }) : null,
- o.available ? null : /* @__PURE__ */ (0, $.jsx)(q, {
+ r.available ? null : /* @__PURE__ */ (0, $.jsx)(N, {
tone: "warning",
title: "找不到 cloudflared",
children: "安装官方 cloudflared,或用设置文件的 tunnel.binary 与 PEACH_CLOUDFLARED 指定路径。"
}),
- o.state === "running" && o.url ? /* @__PURE__ */ (0, $.jsx)(q, {
+ r.state === "running" && r.url ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "info",
title: "公网地址",
- children: /* @__PURE__ */ (0, $.jsx)(i, {
- href: o.url,
- children: o.url
+ children: /* @__PURE__ */ (0, $.jsx)(C, {
+ href: r.url,
+ children: r.url
})
}) : null,
- o.state === "starting" ? /* @__PURE__ */ (0, $.jsx)(q, {
+ r.state === "starting" ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "info",
title: "正在连接",
children: "正在等待 cloudflared 连上 Cloudflare 边缘。"
}) : null,
- o.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: o.error }) : null,
- T.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: T.error }) : null
- ] }), /* @__PURE__ */ (0, $.jsxs)(a, {
- status: o.enabled ? "Peach 重启后自动恢复。" : void 0,
- children: [/* @__PURE__ */ (0, $.jsx)(V, {
- variant: o.named_available ? "secondary" : "primary",
- onClick: () => O("toggle", !E, (e) => r(e.enabled ? "公网入口已启动" : "公网入口已停止")),
- ...K(T.busy === "toggle"),
- children: E ? "停止公网入口" : "启动公网入口"
- }), o.named_available ? /* @__PURE__ */ (0, $.jsx)(V, {
+ r.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: r.error }) : null,
+ y.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: y.error }) : null
+ ] }), /* @__PURE__ */ (0, $.jsxs)(A, {
+ status: r.enabled ? "Peach 重启后自动恢复。" : void 0,
+ children: [/* @__PURE__ */ (0, $.jsx)(d, {
+ variant: r.named_available ? "secondary" : "primary",
+ onClick: () => w("toggle", !b, (e) => n(e.enabled ? "公网入口已启动" : "公网入口已停止")),
+ ...K(y.busy === "toggle"),
+ children: b ? "停止公网入口" : "启动公网入口"
+ }), r.named_available ? /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(T.busy === "save"),
+ ...K(y.busy === "save"),
children: "保存配置"
}) : null]
})]
@@ -3323,57 +3323,57 @@ function Sr({ data: e, receipt: t, panel: n }) {
]
});
}
-function Cr({ initial: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e), [o, s] = (0, Z.useState)(e.mode), [c, l] = (0, Z.useState)(""), u = f();
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+function Cr({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(e.mode), [o, s] = (0, Z.useState)(""), c = Y();
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
id: "peachProxy",
title: "Peach 代理",
onSubmit: (e) => {
- e.preventDefault(), u.run("save", (e) => L("/api/configuration/peach-proxy", {
- mode: o,
- proxy: c
+ e.preventDefault(), c.run("save", (e) => G("/api/configuration/peach-proxy", {
+ mode: i,
+ proxy: o
}, "POST", e), (e) => {
- i(e), l(""), n("已保存配置");
+ r(e), s(""), t("已保存配置");
});
},
children: [
- /* @__PURE__ */ (0, $.jsx)(W, { children: /* @__PURE__ */ (0, $.jsx)(T, {
+ /* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {
label: "连接方式",
- children: /* @__PURE__ */ (0, $.jsx)(H, {
+ children: /* @__PURE__ */ (0, $.jsx)(I, {
"aria-label": "连接方式",
- selectedKey: o,
+ selectedKey: i,
onSelectionChange: (e) => {
- e !== null && s(String(e));
+ e !== null && a(String(e));
},
- children: xr.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(z, {
+ children: xr.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(L, {
id: e,
children: t
}, e))
})
}) }),
- o === "proxy" || r.needs_selection || u.error ? /* @__PURE__ */ (0, $.jsxs)(x, {
+ i === "proxy" || n.needs_selection || c.error ? /* @__PURE__ */ (0, $.jsxs)(V, {
divided: !0,
children: [
- o === "proxy" ? /* @__PURE__ */ (0, $.jsx)(G, {
+ i === "proxy" ? /* @__PURE__ */ (0, $.jsx)(M, {
id: "peachProxyAddress",
type: "password",
label: "代理地址",
autoComplete: "off",
- value: c,
- onChange: l,
- placeholder: r.proxy_saved ? "已保存,留空保留" : "http://127.0.0.1:7890"
+ value: o,
+ onChange: s,
+ placeholder: n.proxy_saved ? "已保存,留空保留" : "http://127.0.0.1:7890"
}) : null,
- r.needs_selection ? /* @__PURE__ */ (0, $.jsx)(q, {
+ n.needs_selection ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "warning",
title: "需要选择连接方式",
children: "已有来源的代理地址不同,请选择公共连接方式。"
}) : null,
- u.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: u.error }) : null
+ c.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: c.error }) : null
]
}) : null,
- /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(u.busy === "save"),
+ ...K(c.busy === "save"),
children: "保存配置"
}) })
]
@@ -3386,43 +3386,43 @@ function Er(e, t) {
return (e.shared_fields || []).includes(t) ? "来自共享,留空表示不改" : e.fields.includes(t) ? "已保存,留空表示不改" : "未填写";
}
function Dr({ row: e }) {
- if (ie(e)) return /* @__PURE__ */ (0, $.jsx)(je, {
+ if (Le(e)) return /* @__PURE__ */ (0, $.jsx)(y, {
variant: "caption",
color: "lime",
children: "已配置"
});
let t = e.requirement === "required" ? "yellow" : e.requirement === "blocked" ? "rose" : "neutral";
- return /* @__PURE__ */ (0, $.jsx)(je, {
+ return /* @__PURE__ */ (0, $.jsx)(y, {
variant: "caption",
color: t,
- children: n[e.requirement] || ""
+ children: _[e.requirement] || ""
});
}
function Or({ row: e, readOnly: t, toast: n }) {
- let [r, a] = (0, Z.useState)({}), [o, s] = (0, Z.useState)(""), c = ie(e), u = Pe({
- mutationFn: (t) => ee(e.provider, t),
+ let [r, i] = (0, Z.useState)({}), [a, o] = (0, Z.useState)(""), s = Le(e), c = dt({
+ mutationFn: (t) => it(e.provider, t),
onSuccess: (e, t) => {
- e.note ? s(e.note) : (s(""), a({}), h.invalidateQueries({
- queryKey: C,
+ e.note ? o(e.note) : (o(""), i({}), J.invalidateQueries({
+ queryKey: T,
exact: !0
}), n(Object.keys(t).length ? "已保存来源凭据" : "已清除来源凭据"));
},
- onError: (e) => s(l(e))
- }), f = () => {
+ onError: (e) => o(q(e))
+ }), l = () => {
let e = Object.fromEntries(Object.entries(r).map(([e, t]) => [e, t.trim()]).filter(([, e]) => e));
- Object.keys(e).length ? u.mutate(e) : s("没有填写内容");
+ Object.keys(e).length ? c.mutate(e) : o("没有填写内容");
};
return /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-col gap-3",
children: [
- /* @__PURE__ */ (0, $.jsxs)(w, { children: [e.why, e.where ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [" ", /* @__PURE__ */ (0, $.jsx)(i, {
+ /* @__PURE__ */ (0, $.jsxs)(j, { children: [e.why, e.where ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [" ", /* @__PURE__ */ (0, $.jsx)(C, {
href: e.where,
children: "获取凭据"
})] }) : null] }),
- e.howto ? /* @__PURE__ */ (0, $.jsx)(w, { children: e.howto }) : null,
+ e.howto ? /* @__PURE__ */ (0, $.jsx)(j, { children: e.howto }) : null,
/* @__PURE__ */ (0, $.jsx)("div", {
className: "flex w-full flex-col gap-3",
- children: (e.needs || []).map((n) => /* @__PURE__ */ (0, $.jsx)(G, {
+ children: (e.needs || []).map((n) => /* @__PURE__ */ (0, $.jsx)(M, {
type: "password",
label: n,
placeholder: Er(e, n),
@@ -3430,7 +3430,7 @@ function Or({ row: e, readOnly: t, toast: n }) {
spellCheck: "false",
isDisabled: t,
value: r[n] || "",
- onChange: (e) => a({
+ onChange: (e) => i({
...r,
[n]: e
}),
@@ -3439,31 +3439,31 @@ function Or({ row: e, readOnly: t, toast: n }) {
}),
/* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
- children: [c ? /* @__PURE__ */ (0, $.jsx)(V, {
+ children: [s ? /* @__PURE__ */ (0, $.jsx)(d, {
variant: "danger",
disabled: t,
- ...K(u.isPending),
- onClick: () => void A({
+ ...K(c.isPending),
+ onClick: () => void Ie({
title: "清除来源凭据",
body: wr,
confirmLabel: "清除来源凭据",
danger: !0,
- onConfirm: () => u.mutateAsync({})
+ onConfirm: () => c.mutateAsync({})
}),
children: "清除"
- }) : null, /* @__PURE__ */ (0, $.jsx)(V, {
+ }) : null, /* @__PURE__ */ (0, $.jsx)(d, {
variant: "primary",
disabled: t,
- ...K(u.isPending),
- onClick: f,
+ ...K(c.isPending),
+ onClick: l,
children: "保存配置"
})]
}),
- o ? /* @__PURE__ */ (0, $.jsx)(k, { children: o }) : null,
- (e.shared_fields || []).length ? /* @__PURE__ */ (0, $.jsx)(w, { children: `${e.shared_fields.join("、")} 使用共享副本中的登录信息,本机没有单独保存。清除时,本机和共享副本中的登录信息都会删除。` }) : null,
- e.path ? /* @__PURE__ */ (0, $.jsx)(Y, {
+ a ? /* @__PURE__ */ (0, $.jsx)(S, { children: a }) : null,
+ (e.shared_fields || []).length ? /* @__PURE__ */ (0, $.jsx)(j, { children: `${e.shared_fields.join("、")} 使用共享副本中的登录信息,本机没有单独保存。清除时,本机和共享副本中的登录信息都会删除。` }) : null,
+ e.path ? /* @__PURE__ */ (0, $.jsx)(b, {
summary: "凭据文件",
- children: /* @__PURE__ */ (0, $.jsx)(d, {
+ children: /* @__PURE__ */ (0, $.jsx)(_e, {
path: e.path,
className: "font-mono text-caption-1-regular text-text-tertiary",
onRevealed: n
@@ -3485,7 +3485,7 @@ function kr({ row: e, readOnly: t, toast: n }) {
children: e.provider_label
}),
/* @__PURE__ */ (0, $.jsx)(Dr, { row: e }),
- e.missing.map((e) => /* @__PURE__ */ (0, $.jsx)(je, {
+ e.missing.map((e) => /* @__PURE__ */ (0, $.jsx)(y, {
variant: "caption",
color: "rose",
children: `缺 ${e}`
@@ -3494,21 +3494,21 @@ function kr({ row: e, readOnly: t, toast: n }) {
});
return e.requirement === "none" || e.requirement === "blocked" ? /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-wrap items-center gap-3 border-b border-separator-border px-6 py-5 last:border-b-0 max-sm:px-4",
- children: [r, e.requirement === "blocked" ? /* @__PURE__ */ (0, $.jsx)(w, { children: e.why }) : null]
+ children: [r, e.requirement === "blocked" ? /* @__PURE__ */ (0, $.jsx)(j, { children: e.why }) : null]
}) : /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-col gap-2 border-b border-separator-border px-6 py-5 last:border-b-0 max-sm:px-4",
children: [
r,
- /* @__PURE__ */ (0, $.jsx)(Y, {
- summary: ie(e) ? "修改凭据" : "填写凭据",
- defaultOpen: e.requirement === "required" && !ie(e),
+ /* @__PURE__ */ (0, $.jsx)(b, {
+ summary: Le(e) ? "修改凭据" : "填写凭据",
+ defaultOpen: e.requirement === "required" && !Le(e),
children: /* @__PURE__ */ (0, $.jsx)(Or, {
row: e,
readOnly: t,
toast: n
})
}),
- e.world_readable ? /* @__PURE__ */ (0, $.jsx)(q, {
+ e.world_readable ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: "凭据文件权限过宽",
children: Tr
@@ -3516,29 +3516,29 @@ function kr({ row: e, readOnly: t, toast: n }) {
]
});
}
-function Ar({ data: e, readOnly: n, toast: r, embedded: i = !1 }) {
- let a = e.providers || [], o = a.filter((e) => e.requirement === "required" && !ie(e));
- if (!a.length) return /* @__PURE__ */ (0, $.jsx)(Ue, {
+function Ar({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {
+ let i = e.providers || [], a = i.filter((e) => e.requirement === "required" && !Le(e));
+ if (!i.length) return /* @__PURE__ */ (0, $.jsx)(x, {
size: "compact",
- icon: s,
+ icon: Fe,
title: "没有可配置的来源",
children: "已接入的站点及其凭据状态会显示在这里。"
});
- let c = o.length ? /* @__PURE__ */ (0, $.jsx)("span", {
+ let o = a.length ? /* @__PURE__ */ (0, $.jsx)("span", {
className: "text-body-2-regular text-text-error-primary",
- children: `${o.length} 个待配置`
- }) : null, l = /* @__PURE__ */ (0, $.jsx)($.Fragment, { children: [
+ children: `${a.length} 个待配置`
+ }) : null, s = /* @__PURE__ */ (0, $.jsx)($.Fragment, { children: [
{
title: "可配置凭据",
- rows: a.filter((e) => e.requirement !== "none" && e.requirement !== "blocked")
+ rows: i.filter((e) => e.requirement !== "none" && e.requirement !== "blocked")
},
{
title: "不需要凭据",
- rows: a.filter((e) => e.requirement === "none")
+ rows: i.filter((e) => e.requirement === "none")
},
{
title: "暂不支持",
- rows: a.filter((e) => e.requirement === "blocked")
+ rows: i.filter((e) => e.requirement === "blocked")
}
].filter((e) => e.rows.length).map((e) => /* @__PURE__ */ (0, $.jsxs)("section", {
"aria-label": e.title,
@@ -3547,24 +3547,24 @@ function Ar({ data: e, readOnly: n, toast: r, embedded: i = !1 }) {
className: "text-body-medium text-text-secondary",
children: e.title
}), /* @__PURE__ */ (0, $.jsx)("div", {
- className: F({
+ className: Pe({
variant: "outlined",
padding: "none",
className: "flex flex-col overflow-hidden"
}),
children: e.rows.map((e) => /* @__PURE__ */ (0, $.jsx)(kr, {
row: e,
- readOnly: n,
- toast: r
+ readOnly: t,
+ toast: n
}, e.provider))
})]
}, e.title)) });
- return i ? /* @__PURE__ */ (0, $.jsx)(t, {
+ return r ? /* @__PURE__ */ (0, $.jsx)(F, {
title: "来源凭据",
- aside: c || void 0,
- children: /* @__PURE__ */ (0, $.jsx)(x, { children: l })
+ aside: o || void 0,
+ children: /* @__PURE__ */ (0, $.jsx)(V, { children: s })
}) : /* @__PURE__ */ (0, $.jsxs)("div", {
- className: F({
+ className: Pe({
padding: "none",
className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
}),
@@ -3573,8 +3573,8 @@ function Ar({ data: e, readOnly: n, toast: r, embedded: i = !1 }) {
children: [/* @__PURE__ */ (0, $.jsx)("h3", {
className: "mr-auto text-title-2-medium text-text-primary",
children: "来源凭据"
- }), c]
- }), l]
+ }), o]
+ }), s]
});
}
//#endregion
@@ -3582,25 +3582,25 @@ function Ar({ data: e, readOnly: n, toast: r, embedded: i = !1 }) {
var jr = "JavDB 或 MISSAV 打不开时,填一个能打开的镜像域名。", Mr = "只填域名,留空用默认地址";
//#endregion
//#region src/react/settings/entry-links-settings.tsx
-function Nr({ initial: e, receipt: n }) {
- let [r, i] = (0, Z.useState)(e.sites), o = f(), s = (e, t) => i((n) => n.map((n) => n.key === e ? {
+function Nr({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e.sites), i = Y(), a = (e, t) => r((n) => n.map((n) => n.key === e ? {
...n,
host: t
} : n));
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "作品资料站点",
onSubmit: (e) => {
e.preventDefault();
- let t = { sites: Object.fromEntries(r.map((e) => [e.key, { host: e.host }])) };
- o.run("save", (e) => L("/api/configuration/entry-links", t, "POST", e), (e) => {
- i(e.sites), n("已保存配置");
+ let a = { sites: Object.fromEntries(n.map((e) => [e.key, { host: e.host }])) };
+ i.run("save", (e) => G("/api/configuration/entry-links", a, "POST", e), (e) => {
+ r(e.sites), t("已保存配置");
});
},
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [
- /* @__PURE__ */ (0, $.jsx)(w, { children: jr }),
- r.map((e) => /* @__PURE__ */ (0, $.jsx)(G, {
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [
+ /* @__PURE__ */ (0, $.jsx)(j, { children: jr }),
+ n.map((e) => /* @__PURE__ */ (0, $.jsx)(M, {
id: `entry-link-${e.key}`,
- label: /* @__PURE__ */ (0, $.jsx)(dt, {
+ label: /* @__PURE__ */ (0, $.jsx)(De, {
site: e.key,
label: `${e.label} 地址`
}),
@@ -3608,14 +3608,14 @@ function Nr({ initial: e, receipt: n }) {
maxLength: 100,
value: e.host,
placeholder: e.default_host,
- onChange: (t) => s(e.key, t),
+ onChange: (t) => a(e.key, t),
validationBehavior: "aria",
hint: Mr
}, e.key)),
- o.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: o.error }) : null
- ] }), /* @__PURE__ */ (0, $.jsx)(a, { children: /* @__PURE__ */ (0, $.jsx)(V, {
+ i.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: i.error }) : null
+ ] }), /* @__PURE__ */ (0, $.jsx)(A, { children: /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(o.busy === "save"),
+ ...K(i.busy === "save"),
children: "保存配置"
}) })]
});
@@ -3624,12 +3624,12 @@ function Nr({ initial: e, receipt: n }) {
//#region src/react/settings/indexer-settings.tsx
var Pr = "/api/configuration/indexers";
function Fr({ receipt: e }) {
- let t = B({
+ let t = X({
queryKey: ["indexers"],
- queryFn: ({ signal: e }) => N(Pr, e),
+ queryFn: ({ signal: e }) => W(Pr, e),
refetchOnMount: "always"
});
- return t.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: l(t.error) }) : t.isFetching ? /* @__PURE__ */ (0, $.jsx)(r, { label: "正在读取资源搜索设置" }) : t.data ? /* @__PURE__ */ (0, $.jsx)(Rr, {
+ return t.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: q(t.error) }) : t.isFetching ? /* @__PURE__ */ (0, $.jsx)(oe, { label: "正在读取资源搜索设置" }) : t.data ? /* @__PURE__ */ (0, $.jsx)(Rr, {
initial: t.data,
receipt: e
}) : null;
@@ -3658,33 +3658,33 @@ function Lr({ row: e, index: t }) {
})]
});
}
-function Rr({ initial: e, receipt: n }) {
- let [r, o] = (0, Z.useState)(e.indexers), s = f(), c = (e, t) => o((n) => n.map((n) => n.key === e ? {
+function Rr({ initial: e, receipt: t }) {
+ let [n, r] = (0, Z.useState)(e.indexers), i = Y(), a = (e, t) => r((n) => n.map((n) => n.key === e ? {
...n,
...t
} : n));
- return /* @__PURE__ */ (0, $.jsxs)(t, {
+ return /* @__PURE__ */ (0, $.jsxs)(F, {
title: "资源搜索",
onSubmit: (e) => {
- e.preventDefault(), s.run("save", (e) => L(Pr, { indexers: r }, "POST", e), (e) => {
- o(e.indexers), n("已保存索引器");
+ e.preventDefault(), i.run("save", (e) => G(Pr, { indexers: n }, "POST", e), (e) => {
+ r(e.indexers), t("已保存索引器");
});
},
- children: [/* @__PURE__ */ (0, $.jsxs)(x, { children: [
- /* @__PURE__ */ (0, $.jsx)(Y, {
+ children: [/* @__PURE__ */ (0, $.jsxs)(V, { children: [
+ /* @__PURE__ */ (0, $.jsx)(b, {
summary: "索引器连接帮助",
- children: /* @__PURE__ */ (0, $.jsxs)(w, { children: [
+ children: /* @__PURE__ */ (0, $.jsxs)(j, { children: [
"填写 Prowlarr 或 Jackett 提供的 Torznab 地址和 API key。",
" ",
- /* @__PURE__ */ (0, $.jsx)(i, {
+ /* @__PURE__ */ (0, $.jsx)(C, {
href: "https://github.com/peach-mitao/peach/blob/master/docs/RESOURCE_SEARCH.md",
children: "详细配置说明"
})
] })
}),
- r.map((e, t) => /* @__PURE__ */ (0, $.jsx)("div", {
+ n.map((e, t) => /* @__PURE__ */ (0, $.jsx)("div", {
className: "min-w-0 border-t border-separator-border pt-2",
- children: /* @__PURE__ */ (0, $.jsx)(Y, {
+ children: /* @__PURE__ */ (0, $.jsx)(b, {
defaultOpen: !e.url,
summary: /* @__PURE__ */ (0, $.jsx)(Lr, {
row: e,
@@ -3693,56 +3693,56 @@ function Rr({ initial: e, receipt: n }) {
children: /* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex min-w-0 flex-col gap-4",
children: [
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "名称",
"aria-label": `索引器 ${t + 1} 名称`,
value: e.name,
maxLength: 80,
- isDisabled: !!s.busy,
- onChange: (t) => c(e.key, { name: t })
+ isDisabled: !!i.busy,
+ onChange: (t) => a(e.key, { name: t })
}),
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "Torznab 地址",
"aria-label": `索引器 ${t + 1} Torznab 地址`,
value: e.url,
type: "url",
autoComplete: "off",
placeholder: "索引器提供的 API 地址",
- isDisabled: !!s.busy,
- onChange: (t) => c(e.key, { url: t })
+ isDisabled: !!i.busy,
+ onChange: (t) => a(e.key, { url: t })
}),
- /* @__PURE__ */ (0, $.jsx)(G, {
+ /* @__PURE__ */ (0, $.jsx)(M, {
label: "API key",
"aria-label": `索引器 ${t + 1} API key`,
type: "password",
autoComplete: "new-password",
value: e.api_key || "",
placeholder: e.api_key_set ? "已保存,留空不改" : void 0,
- isDisabled: !!s.busy,
- onChange: (t) => c(e.key, { api_key: t })
+ isDisabled: !!i.busy,
+ onChange: (t) => a(e.key, { api_key: t })
}),
/* @__PURE__ */ (0, $.jsxs)("div", {
className: "flex flex-wrap items-center gap-x-6 gap-y-2",
children: [
- /* @__PURE__ */ (0, $.jsx)(ne, {
+ /* @__PURE__ */ (0, $.jsx)(v, {
isSelected: e.enabled,
- isDisabled: !!s.busy,
- onChange: (t) => c(e.key, { enabled: t }),
+ isDisabled: !!i.busy,
+ onChange: (t) => a(e.key, { enabled: t }),
children: "启用"
}),
- e.api_key_set ? /* @__PURE__ */ (0, $.jsx)(ne, {
+ e.api_key_set ? /* @__PURE__ */ (0, $.jsx)(v, {
isSelected: !!e.clear_api_key,
- isDisabled: !!s.busy,
- onChange: (t) => c(e.key, { clear_api_key: t }),
+ isDisabled: !!i.busy,
+ onChange: (t) => a(e.key, { clear_api_key: t }),
children: "清除已保存的 API key"
}) : null,
- /* @__PURE__ */ (0, $.jsx)(V, {
+ /* @__PURE__ */ (0, $.jsx)(d, {
variant: "danger",
type: "button",
size: "small",
- disabled: !!s.busy,
+ disabled: !!i.busy,
"aria-label": `移除索引器 ${t + 1}`,
- onClick: () => o(r.filter((t) => t.key !== e.key)),
+ onClick: () => r(n.filter((t) => t.key !== e.key)),
children: "移除"
})
]
@@ -3751,22 +3751,22 @@ function Rr({ initial: e, receipt: n }) {
})
})
}, e.key)),
- s.error ? /* @__PURE__ */ (0, $.jsx)(k, { children: s.error }) : null
- ] }), /* @__PURE__ */ (0, $.jsxs)(a, { children: [/* @__PURE__ */ (0, $.jsx)(V, {
+ i.error ? /* @__PURE__ */ (0, $.jsx)(S, { children: i.error }) : null
+ ] }), /* @__PURE__ */ (0, $.jsxs)(A, { children: [/* @__PURE__ */ (0, $.jsx)(d, {
variant: "secondary",
type: "button",
- disabled: !!s.busy || r.length >= e.max_indexers,
- onClick: () => o([...r, {
- key: u(),
+ disabled: !!i.busy || n.length >= e.max_indexers,
+ onClick: () => r([...n, {
+ key: Qe(),
name: "",
url: "",
enabled: !0,
api_key_set: !1
}]),
children: "添加索引器"
- }), /* @__PURE__ */ (0, $.jsx)(V, {
+ }), /* @__PURE__ */ (0, $.jsx)(d, {
type: "submit",
- ...K(s.busy === "save"),
+ ...K(i.busy === "save"),
children: "保存配置"
})] })]
});
@@ -3774,30 +3774,30 @@ function Rr({ initial: e, receipt: n }) {
//#endregion
//#region src/react/settings/source-settings.tsx
function zr({ data: e, receipt: t, panel: n }) {
- let i = B({
- queryKey: C,
- queryFn: ({ signal: e }) => Se(e),
+ let r = X({
+ queryKey: T,
+ queryFn: ({ signal: e }) => Be(e),
enabled: n?.active !== !1,
refetchOnMount: "always"
});
return /* @__PURE__ */ (0, $.jsxs)("div", {
...Q(n),
children: [
- /* @__PURE__ */ (0, $.jsx)("div", { children: /* @__PURE__ */ (0, $.jsx)(Ze, {
+ /* @__PURE__ */ (0, $.jsx)("div", { children: /* @__PURE__ */ (0, $.jsx)(f, {
href: "/sources",
variant: "secondary",
children: "采集来源与登录状态"
}) }),
- i.data ? /* @__PURE__ */ (0, $.jsx)(Ar, {
- data: i.data,
+ r.data ? /* @__PURE__ */ (0, $.jsx)(Ar, {
+ data: r.data,
readOnly: !!e.ledger_read_only,
toast: t,
embedded: !0
- }) : i.error ? /* @__PURE__ */ (0, $.jsx)(q, {
+ }) : r.error ? /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: "来源凭据未取得",
- children: l(i.error)
- }) : n?.active === !1 ? null : /* @__PURE__ */ (0, $.jsx)(r, { label: "正在读取来源凭据" }),
+ children: q(r.error)
+ }) : n?.active === !1 ? null : /* @__PURE__ */ (0, $.jsx)(oe, { label: "正在读取来源凭据" }),
/* @__PURE__ */ (0, $.jsx)(tr, { receipt: t }),
/* @__PURE__ */ (0, $.jsx)(Fr, { receipt: t }),
e.entry_links ? /* @__PURE__ */ (0, $.jsx)(Nr, {
@@ -3810,9 +3810,9 @@ function zr({ data: e, receipt: t, panel: n }) {
//#endregion
//#region src/react/settings/configuration-page.tsx
function Br({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r }) {
- let i = B({
- queryKey: Ae,
- queryFn: ({ signal: e }) => se(e)
+ let i = X({
+ queryKey: h,
+ queryFn: ({ signal: e }) => ze(e)
}), a = i.data;
return a ? /* @__PURE__ */ (0, $.jsx)(Hr, {
data: a,
@@ -3822,10 +3822,10 @@ function Br({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r })
diagnostics: r
}) : /* @__PURE__ */ (0, $.jsx)("div", {
className: "ui-configpage",
- children: /* @__PURE__ */ (0, $.jsx)(q, {
+ children: /* @__PURE__ */ (0, $.jsx)(N, {
tone: "error",
title: "配置读取失败",
- children: i.error ? l(i.error) : "未取得配置,请刷新页面重试。"
+ children: i.error ? q(i.error) : "未取得配置,请刷新页面重试。"
})
});
}
@@ -3845,25 +3845,25 @@ function Hr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i
window.scrollTo(0, Math.max(0, window.scrollY + t.getBoundingClientRect().top - r));
}, [o]);
let u = (e) => {
- s(e), _(g(e), {
+ s(e), st(ot(e), {
replace: !0,
- state: Je.navigation.location.state
+ state: Ye.navigation.location.state
});
}, [d, f] = (0, Z.useState)(() => matchMedia("(max-width:900px)").matches);
(0, Z.useEffect)(() => {
let e = matchMedia("(max-width:900px)"), t = () => f(e.matches);
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
}, []);
- let p = (0, Z.useRef)([]), h = {
+ let p = (0, Z.useRef)([]), m = {
data: e,
receipt: t
- }, v = !!(e.peach_proxy || e.access || e.tunnel || e.editable && e.port_editable !== !1), y = e.downloads, b = [
+ }, h = !!(e.peach_proxy || e.access || e.tunnel || e.editable && e.port_editable !== !1), g = e.downloads, _ = [
{
title: "媒体库与入库",
body: (e) => /* @__PURE__ */ (0, $.jsxs)("div", {
...Q(e),
children: [
- /* @__PURE__ */ (0, $.jsx)(Yn, { ...h }),
+ /* @__PURE__ */ (0, $.jsx)(Yn, { ...m }),
/* @__PURE__ */ (0, $.jsx)(fr, { receipt: t }),
/* @__PURE__ */ (0, $.jsx)(ar, { receipt: t })
]
@@ -3872,22 +3872,22 @@ function Hr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i
{
title: "来源与订阅",
body: (e) => /* @__PURE__ */ (0, $.jsx)(zr, {
- ...h,
+ ...m,
panel: e
})
},
- ...y ? [{
+ ...g ? [{
title: "下载渠道",
body: (e) => /* @__PURE__ */ (0, $.jsx)(Wt, {
- initial: y,
+ initial: g,
receipt: t,
panel: e
})
}] : [],
- ...v ? [{
+ ...h ? [{
title: "网络与访问",
body: (e) => /* @__PURE__ */ (0, $.jsx)(Sr, {
- ...h,
+ ...m,
panel: e
})
}] : [],
@@ -3896,10 +3896,10 @@ function Hr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i
body: (e) => /* @__PURE__ */ (0, $.jsxs)("div", {
...Q(e),
children: [
- /* @__PURE__ */ (0, $.jsx)(gn, { ...h }),
+ /* @__PURE__ */ (0, $.jsx)(gn, { ...m }),
/* @__PURE__ */ (0, $.jsx)(or, { receipt: t }),
/* @__PURE__ */ (0, $.jsx)(sn, {
- ...h,
+ ...m,
reopenTutorial: n
})
]
@@ -3912,19 +3912,19 @@ function Hr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i
children: e.active ? i : null
})
}
- ], x = Math.max(0, b.findIndex((e) => e.title === o)), S = (e, t) => {
- let n = b.length - 1, r;
+ ], v = Math.max(0, _.findIndex((e) => e.title === o)), y = (e, t) => {
+ let n = _.length - 1, r;
if (e.key === "ArrowRight" || e.key === "ArrowDown") r = t === n ? 0 : t + 1;
else if (e.key === "ArrowLeft" || e.key === "ArrowUp") r = t === 0 ? n : t - 1;
else if (e.key === "Home") r = 0;
else if (e.key === "End") r = n;
else return;
- e.preventDefault(), u(b[r].title), p.current[r]?.focus();
+ e.preventDefault(), u(_[r].title), p.current[r]?.focus();
};
return /* @__PURE__ */ (0, $.jsxs)("div", {
ref: c,
className: "ui-configpage",
- children: [/* @__PURE__ */ (0, $.jsx)(m, {
+ children: [/* @__PURE__ */ (0, $.jsx)(ve, {
className: "ui-board-local-nav",
role: "tablist",
"aria-label": "配置分区",
@@ -3932,7 +3932,7 @@ function Hr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i
"data-section-items": "",
"data-pill-nav": "",
"aria-orientation": d ? "horizontal" : "vertical",
- children: b.map(({ title: e }, t) => /* @__PURE__ */ (0, $.jsx)("button", {
+ children: _.map(({ title: e }, t) => /* @__PURE__ */ (0, $.jsx)("button", {
ref: (e) => {
p.current[t] = e;
},
@@ -3940,26 +3940,26 @@ function Hr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i
role: "tab",
id: `${a}-tab-${t}`,
"aria-controls": `${a}-panel-${t}-0`,
- "aria-selected": t === x,
- "data-pill-selected": t === x ? "" : void 0,
+ "aria-selected": t === v,
+ "data-pill-selected": t === v ? "" : void 0,
"data-pill-variant": "gray",
- tabIndex: t === x ? 0 : -1,
+ tabIndex: t === v ? 0 : -1,
onClick: () => u(e),
- onKeyDown: (e) => S(e, t),
+ onKeyDown: (e) => y(e, t),
children: e
}, e))
- }), b.map(({ title: e, body: t }, n) => /* @__PURE__ */ (0, $.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)("h2", {
+ }), _.map(({ title: e, body: t }, n) => /* @__PURE__ */ (0, $.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)("h2", {
className: "ui-configgroup",
children: e
}), t({
index: n,
id: `${a}-panel-${n}-0`,
labelledBy: `${a}-tab-${n}`,
- active: n === x
+ active: n === v
})] }, e))]
});
}
//#endregion
export { Br as ConfigurationPage };
-//# debugId=f6e2087e-7d61-4ffe-b8ff-08e1af977d0d
\ No newline at end of file
+//# debugId=203c1fbd-d0cd-4d75-bbdd-a7c59c81838b
\ No newline at end of file
diff --git a/web/dist/peach-app.connection-status-Pa6aDai7.js b/web/dist/peach-app.connection-status-BP0ylxDH.js
similarity index 84%
rename from web/dist/peach-app.connection-status-Pa6aDai7.js
rename to web/dist/peach-app.connection-status-BP0ylxDH.js
index cf02a4eaa..8ddabdeb8 100644
--- a/web/dist/peach-app.connection-status-Pa6aDai7.js
+++ b/web/dist/peach-app.connection-status-BP0ylxDH.js
@@ -1,12 +1,12 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "a1249e59-a8fc-43da-9cbd-e2f7e55934b1", e._sentryDebugIdIdentifier = "sentry-dbid-a1249e59-a8fc-43da-9cbd-e2f7e55934b1");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "923ff459-a6a5-4c91-8bdc-7904555ea4f5", e._sentryDebugIdIdentifier = "sentry-dbid-923ff459-a6a5-4c91-8bdc-7904555ea4f5");
} catch {}
})();
-import { Us as e, Ws as t, cu as n } from "./peach-app.js";
+import { cx as e, require_jsx_runtime as t, sortCx as n } from "./peach-app.js";
//#region src/react/boardui/components/base/badges/status-dot.tsx
-var r = n(), i = t({
+var r = t(), i = n({
base: "inline-flex size-3 shrink-0 items-center justify-center rounded-full",
halo: {
green: "bg-status-dot-green-halo",
@@ -47,6 +47,6 @@ function s({ online: t, tone: n, children: i }) {
});
}
//#endregion
-export { s as t };
+export { s as ConnectionStatus };
-//# debugId=a1249e59-a8fc-43da-9cbd-e2f7e55934b1
\ No newline at end of file
+//# debugId=923ff459-a6a5-4c91-8bdc-7904555ea4f5
\ No newline at end of file
diff --git a/web/dist/peach-app.createPaginatedRowModel-Cb5ojTIu.js b/web/dist/peach-app.createPaginatedRowModel-DKa1ysea.js
similarity index 76%
rename from web/dist/peach-app.createPaginatedRowModel-Cb5ojTIu.js
rename to web/dist/peach-app.createPaginatedRowModel-DKa1ysea.js
index 8bf837455..fef8deb9d 100644
--- a/web/dist/peach-app.createPaginatedRowModel-Cb5ojTIu.js
+++ b/web/dist/peach-app.createPaginatedRowModel-DKa1ysea.js
@@ -1,10 +1,10 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "c2cd8a96-f733-48f4-9393-d6b33a85c822", e._sentryDebugIdIdentifier = "sentry-dbid-c2cd8a96-f733-48f4-9393-d6b33a85c822");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "af9818fa-f789-428f-ac24-fa4d47de4752", e._sentryDebugIdIdentifier = "sentry-dbid-af9818fa-f789-428f-ac24-fa4d47de4752");
} catch {}
})();
-import { Ki as e, Zi as t, ea as n } from "./peach-app.js";
+import { expandRowModel as e, getDefaultPaginationState as t, tableMemo as n } from "./peach-app.js";
//#region node_modules/@tanstack/table-core/dist/features/row-pagination/createPaginatedRowModel.js
function r() {
return (e) => {
@@ -25,7 +25,7 @@ function r() {
function i(n) {
let r = n.getPrePaginatedRowModel(), i = n.atoms.pagination?.get();
if (!r.rows.length) return r;
- let { pageSize: a, pageIndex: o } = i ?? e(), { rows: s, flatRows: c, rowsById: l } = r, u = s;
+ let { pageSize: a, pageIndex: o } = i ?? t(), { rows: s, flatRows: c, rowsById: l } = r, u = s;
if (a !== Infinity || o !== 0) {
let e = a * o, t = e + a;
u = s.slice(e, t);
@@ -35,7 +35,7 @@ function i(n) {
rows: u,
flatRows: c,
rowsById: l
- } : t(n, {
+ } : e(n, {
rows: u,
flatRows: c,
rowsById: l
@@ -46,6 +46,6 @@ function i(n) {
return d.rows.forEach(p), d;
}
//#endregion
-export { r as t };
+export { r as createPaginatedRowModel };
-//# debugId=c2cd8a96-f733-48f4-9393-d6b33a85c822
\ No newline at end of file
+//# debugId=af9818fa-f789-428f-ac24-fa4d47de4752
\ No newline at end of file
diff --git a/web/dist/peach-app.data-cleanup-page-CgcWJcPi.js b/web/dist/peach-app.data-cleanup-page-DPCNx1GU.js
similarity index 56%
rename from web/dist/peach-app.data-cleanup-page-CgcWJcPi.js
rename to web/dist/peach-app.data-cleanup-page-DPCNx1GU.js
index 887cbcd34..87bfd52dd 100644
--- a/web/dist/peach-app.data-cleanup-page-CgcWJcPi.js
+++ b/web/dist/peach-app.data-cleanup-page-DPCNx1GU.js
@@ -1,108 +1,108 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "810dbbe5-3cfe-44de-b6e1-f15115c45e2f", e._sentryDebugIdIdentifier = "sentry-dbid-810dbbe5-3cfe-44de-b6e1-f15115c45e2f");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "15bf6027-b413-4089-9e63-65d88f7bddc5", e._sentryDebugIdIdentifier = "sentry-dbid-15bf6027-b413-4089-9e63-65d88f7bddc5");
} catch {}
})();
-import { $n as e, An as t, Ar as n, Bn as r, Cn as i, Cr as a, Dn as o, Do as s, Dr as c, En as l, Er as u, Fl as d, Fn as f, Gl as p, Gn as m, Ha as h, Hn as g, Il as _, In as v, Jl as y, Jn as b, Jt as ee, Kl as x, Kn as S, Kt as C, Li as w, Ln as T, Mn as E, Mr as te, Nn as D, Oc as O, On as k, Or as A, Pl as ne, Pn as j, Qn as re, Ra as M, Rn as ie, Sc as N, Sn as ae, Sr as P, Tc as oe, Ti as F, Tn as I, Tr as L, Un as se, Vn as R, Wl as z, Wn as B, Wt as ce, Xn as le, Xt as ue, Yl as de, Yn as fe, Yt as pe, Zl as me, Zn as he, Zt as V, _a as ge, _i as _e, _n as H, au as U, bn as ve, bs as ye, ci as be, cu as xe, di as Se, er as Ce, fi as we, fs as W, gi as Te, gn as Ee, hi as De, hn as Oe, io as G, iu as ke, ja as Ae, jn as je, jr as Me, kn as Ne, kr as Pe, li as Fe, lo as Ie, mi as Le, mn as K, nr as Re, nu as ze, pi as Be, pu as Ve, ql as He, qn as Ue, qt as We, ro as q, so as J, tr as Ge, uu as Ke, vi as qe, vn as Je, wn as Ye, wr as Xe, xn as Ze, yi as Qe, yn as $e, za as et, zn as tt } from "./peach-app.js";
-import { t as nt } from "./peach-app.page-BYr6f5ud.js";
-import { n as rt } from "./peach-app.error-excerpt-5tEehQuQ.js";
-import { n as Y, o as X, t as it } from "./peach-app.stat-card-8t4QGU2C.js";
-import { t as at } from "./peach-app.data-table-BCsefVBk.js";
-import { n as ot } from "./peach-app.site-mark-C-FsZf9f.js";
-import { t as st } from "./peach-app.legacy-avatar-CV1xk6vD.js";
-import { i as ct } from "./peach-app.folder-rows-C8zyfdZi.js";
-import { t as lt } from "./peach-app.connection-status-Pa6aDai7.js";
+import { Button as e, Chip as t, DIRECTORY_TEMPLATE_ERROR as n, DUPLICATES_KEY as r, Fieldset as i, FieldsetTitle as a, IDLE_REPAIR as o, IconButton as s, Input as c, JUNK_KEY as l, LINKS_KEY as u, LINK_CHECK_KEY as d, LINK_KINDS as f, LINK_PRUNE_KEY as p, LOC as m, LibraryProcessingCard as h, MEDIA_REPAIR_KEY as g, MEDIA_REPAIR_URL as _, MEDIA_SOURCES_KEY as v, MEDIA_SOURCE_ICONS as y, Note as b, ORGANIZE_KEY as x, ORPHAN_RECORDS_KEY as S, Progress as C, QUALITY_GOALS_KEY as w, REPAIR_CARD_TEXT as T, REPAIR_LIBRARIES_KEY as E, RESOURCE_APPLY_KEY as D, RESOURCE_SCAN_KEY as O, RESULT_PANEL as ee, RESULT_SECTION as k, REVIEW_COUNTS_KEY as A, SOURCE_LABELS as j, Select as te, SelectItem as ne, SourceMark as M, StatusLabel as N, TRASH_KEY as re, TaskProgress as P, Wt as F, __toESM as ie, apiSend as ae, applyConfirmText as I, applyLeftovers as L, applyPlanText as R, applyText as oe, attachOrphan as se, baseName as z, busyProps as B, candidateText as ce, checkLine as le, confirmModal as V, entityFaceImg as ue, entityPath as de, errorMessage as H, esc as fe, fetchDuplicates as pe, fetchJunkSummary as me, fetchLinkCheck as U, fetchLinkPrune as he, fetchLinkStats as W, fetchMediaRepair as ge, fetchMediaSources as _e, fetchOrganize as ve, fetchOrganizeExample as ye, fetchOrphanRecords as be, fetchQualityGoals as xe, fetchRepairLibraries as Se, fetchResourceApply as Ce, fetchResourceScan as we, fetchReviewCounts as Te, fetchTrashSummary as Ee, firstGrapheme as De, fmtSize as Oe, hasChanges as ke, hasResourceRoots as Ae, junkBreakdown as je, missingToolText as Me, organizeOutcome as Ne, pickOrganizeFolder as Pe, planSummary as Fe, previewOrganize as Ie, pruneText as Le, purgeCount as Re, purgeOrphan as ze, queryClient as G, recordsText as Be, rememberTemplates as Ve, require_jsx_runtime as He, require_react as Ue, reviewSummary as We, scanLine as Ge, sourceMeta as Ke, spriteGlyph as K, startLinkCheck as qe, startLinkPrune as Je, startOrganize as Ye, startResourceApply as Xe, startResourceScan as Ze, statusLine as Qe, useAction as $e, useBackgroundJob as q, useMutation as et, useQuery as J, withOrganizeJob as tt } from "./peach-app.js";
+import { Page as nt } from "./peach-app.page-Irl_Wogd.js";
+import { ErrorExcerpt as rt } from "./peach-app.error-excerpt-GIDhsLJp.js";
+import { PLAIN_STAT_STRIP as it, PlainStat as Y, plainStatClass as X } from "./peach-app.stat-card-Q_AB9v0S.js";
+import { DataTable as at } from "./peach-app.data-table-CI9MJhw_.js";
+import { SiteMark as ot } from "./peach-app.site-mark-Cjd7g2Ii.js";
+import { LEGACY_AVATAR_IMG as st } from "./peach-app.legacy-avatar-CtPLcaNX.js";
+import { FolderSearchIcon as ct } from "./peach-app.folder-rows-C5-6TcQS.js";
+import { ConnectionStatus as lt } from "./peach-app.connection-status-BP0ylxDH.js";
//#region src/react/media-repair/media-repair-card.tsx
-var Z = /* @__PURE__ */ Ve(Ke(), 1), Q = xe(), ut = (e) => oe[e] || e, dt = (e) => _.setQueryData(we, e);
-function ft({ toast: e = () => {} }) {
- let t = K({
- queryKey: we,
- queryFn: ({ signal: e }) => De(e),
- start: (e) => z(Be, {
+var Z = /* @__PURE__ */ ie(Ue(), 1), Q = He(), ut = (e) => y[e] || e, dt = (e) => G.setQueryData(g, e);
+function ft({ toast: t = () => {} }) {
+ let n = q({
+ queryKey: g,
+ queryFn: ({ signal: e }) => ge(e),
+ start: (e) => ae(_, {
library: e,
restart: !0
}),
- onFinish: (t) => {
- t.status === "complete" && !t.failed && !t.missing_tool && e(t.repaired ? `已修复 ${t.repaired.toLocaleString()} 部视频` : "已检查媒体库,没有需要修复的视频");
+ onFinish: (e) => {
+ e.status === "complete" && !e.failed && !e.missing_tool && t(e.repaired ? `已修复 ${e.repaired.toLocaleString()} 部视频` : "已检查媒体库,没有需要修复的视频");
}
- }), n = U({
- queryKey: Le,
- queryFn: ({ signal: e }) => Te(e)
- }), [r, i] = (0, Z.useState)(""), a = h(), o = t.job ?? Se, s = n.data ?? [], c = o.status === "running", l = s.find((e) => e.id === (c ? o.library : r)) ?? s.find((e) => e.id === o.library) ?? s[0], u = () => {
- l && N({
- title: `修复媒体库「${l.name}」`,
- body: "缺时间戳表的片子另存一份修好的头,原文件不动;缺索引的片子重建后替换原文件,坏原件改名成同目录的隐藏文件(.文件名.peach-original)留着。" + (l.metered ? "这个库在计费来源上,每修一部都要把片子完整拉一遍。" : ""),
+ }), r = J({
+ queryKey: E,
+ queryFn: ({ signal: e }) => Se(e)
+ }), [s, c] = (0, Z.useState)(""), l = $e(), u = n.job ?? o, d = r.data ?? [], f = u.status === "running", p = d.find((e) => e.id === (f ? u.library : s)) ?? d.find((e) => e.id === u.library) ?? d[0], m = () => {
+ p && V({
+ title: `修复媒体库「${p.name}」`,
+ body: "缺时间戳表的片子另存一份修好的头,原文件不动;缺索引的片子重建后替换原文件,坏原件改名成同目录的隐藏文件(.文件名.peach-original)留着。" + (p.metered ? "这个库在计费来源上,每修一部都要把片子完整拉一遍。" : ""),
confirmLabel: "修复媒体库",
onConfirm: async () => {
- await t.start.mutateAsync(l.id);
+ await n.start.mutateAsync(p.id);
}
});
- }, d = () => void a.run("stop", (e) => z(Be, { stop: !0 }, "POST", e), dt), f = t.outcome, p = qe(c ? o : f ?? Se), m = a.error || f?.error || (t.query.error ? "读不到媒体修复的状态" : "");
+ }, h = () => void l.run("stop", (e) => ae(_, { stop: !0 }, "POST", e), dt), v = n.outcome, y = Qe(f ? u : v ?? o), x = l.error || v?.error || (n.query.error ? "读不到媒体修复的状态" : "");
return /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "flex flex-col gap-4",
- children: [/* @__PURE__ */ (0, Q.jsx)(We, {
+ children: [/* @__PURE__ */ (0, Q.jsx)(i, {
layout: "split",
label: "媒体修复",
- footer: /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(w, {
+ footer: /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(te, {
"aria-label": "媒体库",
prefix: "媒体库",
className: "w-48",
- selectedKey: l?.id ?? null,
- isDisabled: c || !s.length,
+ selectedKey: p?.id ?? null,
+ isDisabled: f || !d.length,
onSelectionChange: (e) => {
- e !== null && i(String(e));
+ e !== null && c(String(e));
},
- children: s.map((e) => /* @__PURE__ */ (0, Q.jsxs)(ge, {
+ children: d.map((e) => /* @__PURE__ */ (0, Q.jsxs)(ne, {
id: e.id,
textValue: e.name,
- children: [/* @__PURE__ */ (0, Q.jsx)(Ae, { mark: ut(e.icon) }), e.name]
+ children: [/* @__PURE__ */ (0, Q.jsx)(M, { mark: ut(e.icon) }), e.name]
}, e.id))
- }), c ? /* @__PURE__ */ (0, Q.jsx)(W, {
- onClick: d,
- ...q(a.busy === "stop"),
+ }), f ? /* @__PURE__ */ (0, Q.jsx)(e, {
+ onClick: h,
+ ...B(l.busy === "stop"),
children: "停止"
- }) : /* @__PURE__ */ (0, Q.jsx)(W, {
- onClick: u,
- disabled: !l,
+ }) : /* @__PURE__ */ (0, Q.jsx)(e, {
+ onClick: m,
+ disabled: !p,
children: "开始修复"
})] }),
children: /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "flex flex-col gap-2",
children: [
- /* @__PURE__ */ (0, Q.jsx)(ee, { children: "媒体修复" }),
+ /* @__PURE__ */ (0, Q.jsx)(a, { children: "媒体修复" }),
/* @__PURE__ */ (0, Q.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
- children: V
+ children: T
}),
- c && o.total ? /* @__PURE__ */ (0, Q.jsx)(et, {
+ f && u.total ? /* @__PURE__ */ (0, Q.jsx)(C, {
label: "修复进度",
- value: o.checked,
- max: o.total
+ value: u.checked,
+ max: u.total
}) : null,
- p ? /* @__PURE__ */ (0, Q.jsx)("p", {
+ y ? /* @__PURE__ */ (0, Q.jsx)("p", {
role: "status",
className: "text-caption-1-regular text-text-secondary",
- children: p
+ children: y
}) : null
]
})
}), /* @__PURE__ */ (0, Q.jsxs)("div", {
"aria-live": "polite",
className: "flex flex-col gap-4 empty:hidden",
- children: [f?.status === "complete" && f.missing_tool ? /* @__PURE__ */ (0, Q.jsx)(J, {
+ children: [v?.status === "complete" && v.missing_tool ? /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "warning",
title: "缺少 untrunc",
- action: /* @__PURE__ */ (0, Q.jsx)(W, {
+ action: /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "ghost",
size: "small",
- onClick: t.dismiss,
+ onClick: n.dismiss,
children: "关闭提示"
}),
- children: _e(f)
- }) : null, m ? /* @__PURE__ */ (0, Q.jsx)(J, {
+ children: Me(v)
+ }) : null, x ? /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
- children: m
+ children: x
}) : null]
})]
});
@@ -137,7 +137,7 @@ function pt({ className: e }) {
}
//#endregion
//#region src/react/data-cleanup/link-manager.tsx
-var mt = G("rotate-cw"), ht = "站点返回 404 或 410,确认这个地址不存在。", gt = "站点拒绝程序访问或一次临时故障都会落在这里。链接保留,可勾选后单独重试。", _t = "删除前会逐条重验一次;此操作不可撤销。", vt = "暂时无法读取进度,正在重新连接…", yt = (e) => Number(e || 0).toLocaleString();
+var mt = K("rotate-cw"), ht = "站点返回 404 或 410,确认这个地址不存在。", gt = "站点拒绝程序访问或一次临时故障都会落在这里。链接保留,可勾选后单独重试。", _t = "删除前会逐条重验一次;此操作不可撤销。", vt = "暂时无法读取进度,正在重新连接…", yt = (e) => Number(e || 0).toLocaleString();
function bt({ label: e, value: t, note: n }) {
return /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "flex min-w-0 flex-col gap-0.5",
@@ -157,10 +157,10 @@ function bt({ label: e, value: t, note: n }) {
]
});
}
-function xt({ title: e, items: t, hint: n, picked: r, onPick: i, children: a, footer: o, confirmed: c = !1 }) {
+function xt({ title: e, items: t, hint: n, picked: r, onPick: i, children: a, footer: o, confirmed: s = !1 }) {
return t.length ? /* @__PURE__ */ (0, Q.jsx)("div", {
- className: ue,
- "data-link-results": c ? "gone" : "unclear",
+ className: k,
+ "data-link-results": s ? "gone" : "unclear",
children: /* @__PURE__ */ (0, Q.jsx)(at, {
label: e,
items: t,
@@ -173,13 +173,13 @@ function xt({ title: e, items: t, hint: n, picked: r, onPick: i, children: a, fo
value: (e) => e.entity,
render: (e) => /* @__PURE__ */ (0, Q.jsxs)("a", {
className: "flex min-w-24 items-center gap-2 text-text-secondary hover:text-text-primary hover:underline",
- href: e.entity_id && e.entity_kind ? He(e.entity_kind, e.entity, e.entity_id) : void 0,
+ href: e.entity_id && e.entity_kind ? de(e.entity_kind, e.entity, e.entity_id) : void 0,
"data-link-identity": "",
children: [/* @__PURE__ */ (0, Q.jsx)("span", {
"data-link-avatar": "",
className: `relative flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full bg-background-quaternary-default text-caption-1-medium text-text-primary ${st}`,
"aria-hidden": !0,
- dangerouslySetInnerHTML: { __html: `<span>${y(de(e.entity))}</span>` + O({
+ dangerouslySetInnerHTML: { __html: `<span>${fe(De(e.entity))}</span>` + ue({
kind: e.entity_kind,
id: e.entity_id,
hasImage: e.face?.has_image,
@@ -198,8 +198,8 @@ function xt({ title: e, items: t, hint: n, picked: r, onPick: i, children: a, fo
id: "kind",
label: "类型",
width: 128,
- value: (e) => Xe[e.link_kind] || e.link_kind,
- render: (e) => Xe[e.link_kind] || e.link_kind
+ value: (e) => f[e.link_kind] || e.link_kind,
+ render: (e) => f[e.link_kind] || e.link_kind
},
{
id: "label",
@@ -223,16 +223,16 @@ function xt({ title: e, items: t, hint: n, picked: r, onPick: i, children: a, fo
value: (e) => e.note,
render: (e) => /* @__PURE__ */ (0, Q.jsx)("div", {
className: "min-w-0 w-full",
- "data-link-result": c ? "gone" : "unclear",
- children: /^(?:HTTP\s+)?[1-5]\d{2}$/.test(e.note.trim()) ? /* @__PURE__ */ (0, Q.jsx)(C, {
- tone: c || /^(?:HTTP\s+)?5\d{2}$/.test(e.note.trim()) ? "error" : "warning",
+ "data-link-result": s ? "gone" : "unclear",
+ children: /^(?:HTTP\s+)?[1-5]\d{2}$/.test(e.note.trim()) ? /* @__PURE__ */ (0, Q.jsx)(N, {
+ tone: s || /^(?:HTTP\s+)?5\d{2}$/.test(e.note.trim()) ? "error" : "warning",
"data-link-code": "",
children: e.note.trim()
}) : /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "flex flex-col items-start gap-1",
- children: [/* @__PURE__ */ (0, Q.jsx)(C, {
- tone: c ? "error" : "warning",
- children: c ? "地址已失效" : "未取得结论"
+ children: [/* @__PURE__ */ (0, Q.jsx)(N, {
+ tone: s ? "error" : "warning",
+ children: s ? "地址已失效" : "未取得结论"
}), /* @__PURE__ */ (0, Q.jsx)(rt, {
text: e.note,
className: "tabular-nums text-text-secondary"
@@ -260,7 +260,7 @@ function xt({ title: e, items: t, hint: n, picked: r, onPick: i, children: a, fo
className: "min-w-0 truncate",
children: e.url
}),
- /* @__PURE__ */ (0, Q.jsx)(s, {
+ /* @__PURE__ */ (0, Q.jsx)(F, {
"aria-hidden": !0,
className: "size-(--icon-inline) shrink-0"
})
@@ -281,145 +281,145 @@ function xt({ title: e, items: t, hint: n, picked: r, onPick: i, children: a, fo
}) : null;
}
function St() {
- let e = U({
- queryKey: P,
- queryFn: ({ signal: e }) => Pe(e)
- }), [t, r] = (0, Z.useState)([]), [i, o] = (0, Z.useState)([]), l = K({
- queryKey: L,
- queryFn: ({ signal: e }) => A(e),
- start: te,
+ let n = J({
+ queryKey: u,
+ queryFn: ({ signal: e }) => W(e)
+ }), [r, o] = (0, Z.useState)([]), [s, c] = (0, Z.useState)([]), l = q({
+ queryKey: p,
+ queryFn: ({ signal: e }) => he(e),
+ start: Je,
onFinish: () => {
- _.invalidateQueries({
- queryKey: P,
+ G.invalidateQueries({
+ queryKey: u,
exact: !0
- }), _.invalidateQueries({
- queryKey: a,
+ }), G.invalidateQueries({
+ queryKey: d,
exact: !0
});
}
- }), d = K({
- queryKey: a,
- queryFn: ({ signal: e }) => c(e),
- start: Me,
+ }), m = q({
+ queryKey: d,
+ queryFn: ({ signal: e }) => U(e),
+ start: qe,
onStarted: () => {
- l.dismiss(), r([]), o([]);
+ l.dismiss(), o([]), c([]);
}
- }), f = d.job, m = f?.check_id ?? "";
+ }), h = m.job, g = h?.check_id ?? "";
(0, Z.useEffect)(() => {
- r([]), o([]);
- }, [m]);
- let h = d.running || d.start.isPending, g = l.running || l.start.isPending, v = f?.status === "complete", y = f?.gone ?? [], b = f?.unclear ?? [], x = v ? b : [], S = y.filter((e) => i.includes(e.id)).map((e) => e.id), C = x.filter((e) => t.includes(e.id)).map((e) => e.id), w = e.data, T = (w?.top_hosts ?? []).slice(0, 3), E = (e) => {
- h || e && !e.length || d.start.mutate(e ? {
+ o([]), c([]);
+ }, [g]);
+ let _ = m.running || m.start.isPending, v = l.running || l.start.isPending, y = h?.status === "complete", x = h?.gone ?? [], S = h?.unclear ?? [], C = y ? S : [], w = x.filter((e) => s.includes(e.id)).map((e) => e.id), T = C.filter((e) => r.includes(e.id)).map((e) => e.id), E = n.data, D = (E?.top_hosts ?? []).slice(0, 3), O = (e) => {
+ _ || e && !e.length || m.start.mutate(e ? {
retry: e,
- checkId: m
+ checkId: g
} : {});
- }, D = (e) => {
- !g && y.length && N({
+ }, A = (e) => {
+ !v && x.length && V({
title: "删除失效链接",
- body: `将删除 ${e?.length ?? y.length} 条失效链接。删除前会再次检查,删除后无法恢复。`,
+ body: `将删除 ${e?.length ?? x.length} 条失效链接。删除前会再次检查,删除后无法恢复。`,
confirmLabel: "删除失效链接",
danger: !0,
onConfirm: () => l.start.mutateAsync({
- checkId: m,
+ checkId: g,
ids: e
})
});
- }, O = l.outcome, k = d.start.error ?? l.start.error, ne = null, j = null;
- if (O?.status === "failed") j = /* @__PURE__ */ (0, Q.jsx)(J, {
+ }, j = l.outcome, te = m.start.error ?? l.start.error, ne = null, M = null;
+ if (j?.status === "failed") M = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "链接清理未完成",
- children: O.error || "请查看任务记录,核对已处理的链接。"
+ children: j.error || "请查看任务记录,核对已处理的链接。"
});
- else if (O && !y.length && !b.length) j = /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (j && !x.length && !S.length) M = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "success",
title: "完成",
- children: n(O)
+ children: Le(j)
});
- else if (k) j = /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (te) M = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "检查失败",
- children: p(k)
+ children: H(te)
});
- else if (d.query.isError && f) j = /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (m.query.isError && h) M = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "neutral",
title: "任务状态",
children: vt
});
- else if (f?.status === "failed") j = /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (h?.status === "failed") M = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "检查失败",
- children: f.error || "检查失败"
+ children: h.error || "检查失败"
});
- else if (f && f.status !== "idle") {
- ne = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [f.status === "running" ? /* @__PURE__ */ (0, Q.jsx)(M, {
+ else if (h && h.status !== "idle") {
+ ne = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [h.status === "running" ? /* @__PURE__ */ (0, Q.jsx)(P, {
embedded: !0,
- label: u(f),
- value: Math.min(f.checked || 0, f.total || 0),
- total: f.total
- }) : null, g ? /* @__PURE__ */ (0, Q.jsx)(M, {
+ label: le(h),
+ value: Math.min(h.checked || 0, h.total || 0),
+ total: h.total
+ }) : null, v ? /* @__PURE__ */ (0, Q.jsx)(P, {
embedded: !0,
label: l.job?.message || "正在重验并删除失效链接",
value: Math.min(l.job?.checked || 0, l.job?.total || 0),
total: l.job?.total
}) : null] });
- let e = `立即重试所选(${C.length})`;
- j = v || y.length || b.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: pe,
+ let t = `立即重试所选(${T.length})`;
+ M = y || x.length || S.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
+ className: ee,
children: [
- O?.status === "complete" ? /* @__PURE__ */ (0, Q.jsx)(J, {
+ j?.status === "complete" ? /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "success",
title: "完成",
- children: n(O)
+ children: Le(j)
}) : null,
/* @__PURE__ */ (0, Q.jsx)(xt, {
title: "地址已失效",
- items: y,
+ items: x,
hint: ht,
- picked: i,
- onPick: o,
+ picked: s,
+ onPick: c,
confirmed: !0,
- footer: v && y.length ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)("p", {
+ footer: y && x.length ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)("p", {
className: "mr-auto min-w-0 text-caption-1-regular text-text-secondary",
children: _t
- }), /* @__PURE__ */ (0, Q.jsx)(W, {
+ }), /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "danger",
- ...q(g),
- onClick: () => D(),
- children: `删除 ${y.length} 条失效链接`
+ ...B(v),
+ onClick: () => A(),
+ children: `删除 ${x.length} 条失效链接`
})] }) : null,
- children: /* @__PURE__ */ (0, Q.jsx)(W, {
+ children: /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "danger",
size: "small",
- disabled: !v || !S.length,
- ...q(g),
- onClick: () => D(S),
- children: `删除所选(${S.length})`
+ disabled: !y || !w.length,
+ ...B(v),
+ onClick: () => A(w),
+ children: `删除所选(${w.length})`
})
}),
/* @__PURE__ */ (0, Q.jsx)(xt, {
title: "本次未访问成功",
- items: b,
+ items: S,
hint: gt,
- picked: t,
- onPick: r,
- footer: x.length ? /* @__PURE__ */ (0, Q.jsx)(W, {
+ picked: r,
+ onPick: o,
+ footer: C.length ? /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "primary",
leadingIcon: mt,
- ...q(h),
- onClick: () => E(x.map((e) => e.id)),
- children: `立即重试全部(${x.length})`
+ ...B(_),
+ onClick: () => O(C.map((e) => e.id)),
+ children: `立即重试全部(${C.length})`
}) : null,
- children: x.length ? /* @__PURE__ */ (0, Q.jsx)(Q.Fragment, { children: /* @__PURE__ */ (0, Q.jsx)(W, {
+ children: C.length ? /* @__PURE__ */ (0, Q.jsx)(Q.Fragment, { children: /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "secondary",
leadingIcon: mt,
- disabled: !C.length,
- ...q(h),
- onClick: () => E(C),
- children: e
+ disabled: !T.length,
+ ...B(_),
+ onClick: () => O(T),
+ children: t
}) }) : null
}),
- v && !y.length && !b.length ? /* @__PURE__ */ (0, Q.jsx)("p", {
- className: `${ue} text-body-regular text-notification-success-foreground`,
+ y && !x.length && !S.length ? /* @__PURE__ */ (0, Q.jsx)("p", {
+ className: `${k} text-body-regular text-notification-success-foreground`,
children: "全部链接均可访问。"
}) : null
]
@@ -429,44 +429,44 @@ function St() {
id: "link-manager",
"aria-labelledby": "link-manager-title",
className: "flex scroll-mt-20 flex-col gap-4",
- children: [/* @__PURE__ */ (0, Q.jsxs)(We, {
+ children: [/* @__PURE__ */ (0, Q.jsxs)(i, {
layout: "stack",
labelledBy: "link-manager-title",
- footer: /* @__PURE__ */ (0, Q.jsx)(W, {
+ footer: /* @__PURE__ */ (0, Q.jsx)(e, {
"data-link-check": "",
leadingIcon: pt,
- ...q(h),
- onClick: () => E(),
- children: h ? "检查中" : v ? "重新检查" : "检查死链"
+ ...B(_),
+ onClick: () => O(),
+ children: _ ? "检查中" : y ? "重新检查" : "检查死链"
}),
children: [
- /* @__PURE__ */ (0, Q.jsx)(ee, {
+ /* @__PURE__ */ (0, Q.jsx)(a, {
id: "link-manager-title",
gap: "small",
children: "链接管理"
}),
- e.isError ? /* @__PURE__ */ (0, Q.jsx)(J, {
+ n.isError ? /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "链接统计读取失败",
- children: p(e.error)
- }) : w ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
+ children: H(n.error)
+ }) : E ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
className: "link-stat-grid mt-4 gap-x-8 gap-y-3",
children: [/* @__PURE__ */ (0, Q.jsx)(bt, {
label: "链接总数",
- value: yt(w.total),
- note: `分布在 ${yt(w.entities)} 个女优、厂牌与系列`
- }), Object.entries(w.by_kind ?? {}).map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(bt, {
- label: Xe[e] || e,
+ value: yt(E.total),
+ note: `分布在 ${yt(E.entities)} 个女优、厂牌与系列`
+ }), Object.entries(E.by_kind ?? {}).map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(bt, {
+ label: f[e] || e,
value: yt(t)
}, e))]
- }), T.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
+ }), D.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "mt-4 flex min-w-0 flex-col gap-0.5",
children: [/* @__PURE__ */ (0, Q.jsx)("span", {
className: "text-caption-1-regular text-text-secondary",
children: "主要站点"
}), /* @__PURE__ */ (0, Q.jsx)("div", {
className: "flex min-w-0 flex-wrap gap-x-5 gap-y-2",
- children: T.map(([e, t]) => /* @__PURE__ */ (0, Q.jsxs)("span", {
+ children: D.map(([e, n]) => /* @__PURE__ */ (0, Q.jsxs)("span", {
"data-top-host": "",
className: "inline-flex min-w-0 max-w-full items-center gap-1.5",
children: [/* @__PURE__ */ (0, Q.jsxs)("a", {
@@ -475,22 +475,22 @@ function St() {
rel: "noopener noreferrer",
className: "inline-flex min-w-0 items-center gap-1.5 text-body-2-medium text-text-primary",
children: [
- /* @__PURE__ */ (0, Q.jsx)(ot, { linkId: w.top_host_link_ids?.[e] }),
+ /* @__PURE__ */ (0, Q.jsx)(ot, { linkId: E.top_host_link_ids?.[e] }),
/* @__PURE__ */ (0, Q.jsx)("span", {
className: "min-w-0 wrap-anywhere",
children: e
}),
- /* @__PURE__ */ (0, Q.jsx)(s, {
+ /* @__PURE__ */ (0, Q.jsx)(F, {
"aria-hidden": !0,
className: "size-(--icon-inline) shrink-0"
})
]
- }), /* @__PURE__ */ (0, Q.jsx)(Oe, {
+ }), /* @__PURE__ */ (0, Q.jsx)(t, {
variant: "caption",
color: "neutral",
children: /* @__PURE__ */ (0, Q.jsx)("span", {
className: "tabular-nums",
- children: yt(t)
+ children: yt(n)
})
})]
}, e))
@@ -505,7 +505,7 @@ function St() {
}), /* @__PURE__ */ (0, Q.jsx)("div", {
"aria-live": "polite",
className: "empty:hidden",
- children: j
+ children: M
})]
});
}
@@ -522,7 +522,7 @@ function Et({ plan: e }) {
"data-middle-truncate": !0,
title: e.current_path,
className: "min-w-0 truncate",
- children: Ue(e.current_path)
+ children: z(e.current_path)
}),
/* @__PURE__ */ (0, Q.jsx)("span", {
"aria-hidden": !0,
@@ -532,7 +532,7 @@ function Et({ plan: e }) {
"data-middle-truncate": !0,
title: e.target_path,
className: "min-w-0 truncate text-text-primary",
- children: Ue(e.target_path)
+ children: z(e.target_path)
})
]
}, e.current_path))
@@ -541,102 +541,102 @@ function Et({ plan: e }) {
children: "只列出前 8 行,完整计划在计划 CSV 里。"
}) : null] });
}
-function Dt({ toast: t, failure: n }) {
- let r = U({
- queryKey: S,
- queryFn: ({ signal: e }) => b(e)
- }), i = r.data, a = i?.locations ?? [], [o, s] = (0, Z.useState)(""), c = a.some((e) => e.location === o) ? o : a[0]?.location ?? "", l = i?.templates?.[c], [u, d] = (0, Z.useState)(null), f = u?.location === c ? u : {
- location: c,
- file: l?.file ?? "",
- dir: l?.dir ?? ""
- }, h = (e) => {
- d({
- ...f,
+function Dt({ toast: t, failure: r }) {
+ let o = J({
+ queryKey: x,
+ queryFn: ({ signal: e }) => ve(e)
+ }), l = o.data, u = l?.locations ?? [], [d, f] = (0, Z.useState)(""), p = u.some((e) => e.location === d) ? d : u[0]?.location ?? "", h = l?.templates?.[p], [g, _] = (0, Z.useState)(null), v = g?.location === p ? g : {
+ location: p,
+ file: h?.file ?? "",
+ dir: h?.dir ?? ""
+ }, S = (e) => {
+ _({
+ ...v,
...e
- }), P.reset();
- }, [g, v] = (0, Z.useState)({
+ }), I.reset();
+ }, [C, w] = (0, Z.useState)({
location: "",
path: ""
- }), y = g.location === c ? g.path : "", C = (0, Z.useRef)({
- location: c,
- path: y
+ }), T = C.location === p ? C.path : "", E = (0, Z.useRef)({
+ location: p,
+ path: T
});
- C.current = {
- location: c,
- path: y
+ E.current = {
+ location: p,
+ path: T
};
- let [T, E] = (0, Z.useState)(null), te = (0, Z.useRef)(null), D = (0, Z.useRef)(null), O = (0, Z.useRef)(null), k = U({
+ let [D, O] = (0, Z.useState)(null), ee = (0, Z.useRef)(null), k = (0, Z.useRef)(null), A = (0, Z.useRef)(null), j = J({
queryKey: [
"organize-example",
- f.file,
- f.dir
+ v.file,
+ v.dir
],
- queryFn: ({ signal: e }) => fe(f.file, f.dir, e),
- enabled: !!i
- }), [A, ne] = (0, Z.useState)("file"), j = (0, Z.useRef)(!1), ie = (0, Z.useRef)(null);
+ queryFn: ({ signal: e }) => ye(v.file, v.dir, e),
+ enabled: !!l
+ }), [N, re] = (0, Z.useState)("file"), F = (0, Z.useRef)(!1), ie = (0, Z.useRef)(null);
(0, Z.useLayoutEffect)(() => {
let e = ie.current;
if (!e) return;
ie.current = null;
- let t = (e.field === "file" ? te : D).current;
+ let t = (e.field === "file" ? ee : k).current;
t?.focus(), t?.setSelectionRange(e.caret, e.caret);
});
let ae = () => ({
- location: c,
- path: y.trim(),
- file_template: f.file.trim(),
- dir_template: f.dir.trim()
- }), P = ke({
- mutationFn: e,
+ location: p,
+ path: T.trim(),
+ file_template: v.file.trim(),
+ dir_template: v.dir.trim()
+ }), I = et({
+ mutationFn: Ie,
onError: (e) => {
- let t = /整理路径/.test(p(e)) ? "path" : m.test(p(e)) ? "dir" : "file";
- E(t), (t === "path" ? O : t === "dir" ? D : te).current?.focus();
+ let t = /整理路径/.test(H(e)) ? "path" : n.test(H(e)) ? "dir" : "file";
+ O(t), (t === "path" ? A : t === "dir" ? k : ee).current?.focus();
}
- }), F = ke({
- mutationFn: ({ initial: e }) => he(e),
+ }), L = et({
+ mutationFn: ({ initial: e }) => Pe(e),
onSuccess: (e, t) => {
- e.path && t.location === C.current.location && t.path === C.current.path && (v({
+ e.path && t.location === E.current.location && t.path === E.current.path && (w({
location: t.location,
path: e.path
- }), E(null), P.reset(), O.current?.focus());
+ }), O(null), I.reset(), A.current?.focus());
}
- }), I = K({
- queryKey: S,
- queryFn: ({ signal: e }) => b(e),
- start: Ge,
+ }), R = q({
+ queryKey: x,
+ queryFn: ({ signal: e }) => ve(e),
+ start: Ye,
jobOf: (e) => e,
- withJob: Re,
- onStarted: () => P.reset(),
+ withJob: tt,
+ onStarted: () => I.reset(),
onFinish: (e) => {
- if (_.invalidateQueries({
- queryKey: S,
+ if (G.invalidateQueries({
+ queryKey: x,
exact: !0
}), e.status !== "complete") return;
- let { text: r, failed: i } = le(e);
- i ? n("整理文件", /* @__PURE__ */ Error(`${i} 行未能处理`)) : t(r.replace(/。$/, ""));
+ let { text: n, failed: i } = Ne(e);
+ i ? r("整理文件", /* @__PURE__ */ Error(`${i} 行未能处理`)) : t(n.replace(/。$/, ""));
}
- }), L = I.running || I.start.isPending, se = JSON.stringify(P.variables) === JSON.stringify(ae()), R = se ? P.data : void 0, z = Number(R?.counts?.change || 0), B = x[c] || c, ce = (e) => {
- h(e), E(null), P.reset();
- }, ue = (e) => {
- let t = (A === "file" ? te : D).current, n = f[A], r = j.current ? t?.selectionStart ?? n.length : n.length, i = j.current ? t?.selectionEnd ?? r : r, a = `{${e}}`;
+ }), oe = R.running || R.start.isPending, se = JSON.stringify(I.variables) === JSON.stringify(ae()), z = se ? I.data : void 0, ce = Number(z?.counts?.change || 0), le = m[p] || p, ue = (e) => {
+ S(e), O(null), I.reset();
+ }, de = (e) => {
+ let t = (N === "file" ? ee : k).current, n = v[N], r = F.current ? t?.selectionStart ?? n.length : n.length, i = F.current ? t?.selectionEnd ?? r : r, a = `{${e}}`;
ie.current = {
- field: A,
+ field: N,
caret: r + a.length
- }, ce({ [A]: n.slice(0, r) + a + n.slice(i) });
- }, de = () => {
- P.isPending || L || !c || (I.dismiss(), I.start.reset(), E(null), P.mutate(ae()));
+ }, ue({ [N]: n.slice(0, r) + a + n.slice(i) });
+ }, fe = () => {
+ I.isPending || oe || !p || (R.dismiss(), R.start.reset(), O(null), I.mutate(ae()));
}, pe = () => {
- let e = P.variables;
- e && R && z && N({
+ let e = I.variables;
+ e && z && ce && V({
title: "整理文件",
- body: Ct(B, e.path),
+ body: Ct(le, e.path),
confirmLabel: "整理文件",
onConfirm: async () => {
- await I.start.mutateAsync({
+ await R.start.mutateAsync({
kind: "apply",
request: e
- }), Ce({
- ...i?.templates ?? {},
+ }), Ve({
+ ...l?.templates ?? {},
[e.location]: {
file: e.file_template,
dir: e.dir_template
@@ -644,75 +644,75 @@ function Dt({ toast: t, failure: n }) {
});
}
});
- }, me = () => void N({
+ }, me = () => void V({
title: "回滚上一批整理",
body: wt,
confirmLabel: "回滚整理",
- onConfirm: () => I.start.mutateAsync({ kind: "rollback" })
- }), V = null, _e = !!z && !L && !I.outcome, H = I.job, ve = I.outcome;
- if (H?.status === "running") {
- let e = H.message || H.stage || "正在整理文件";
- V = /* @__PURE__ */ (0, Q.jsx)(M, {
+ onConfirm: () => R.start.mutateAsync({ kind: "rollback" })
+ }), U = null, he = !!ce && !oe && !R.outcome, W = R.job, ge = R.outcome;
+ if (W?.status === "running") {
+ let e = W.message || W.stage || "正在整理文件";
+ U = /* @__PURE__ */ (0, Q.jsx)(P, {
embedded: !0,
label: e,
- value: Math.min(H.checked || 0, H.total || 0),
- total: H.total
+ value: Math.min(W.checked || 0, W.total || 0),
+ total: W.total
});
- } else if (ve?.status === "failed") V = /* @__PURE__ */ (0, Q.jsx)(J, {
+ } else if (ge?.status === "failed") U = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "文件整理未完成",
- children: ve.error || "请查看任务记录,核对已处理的文件。"
+ children: ge.error || "请查看任务记录,核对已处理的文件。"
});
- else if (ve) {
- let { text: e, failed: t } = le(ve);
- V = /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (ge) {
+ let { text: e, failed: t } = Ne(ge);
+ U = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: t ? "warning" : "success",
title: t ? "部分完成" : "整理结果",
children: e
});
- } else I.start.isError ? V = /* @__PURE__ */ (0, Q.jsx)(J, {
+ } else R.start.isError ? U = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "整理失败",
- children: p(I.start.error)
- }) : P.isPending ? V = /* @__PURE__ */ (0, Q.jsx)(M, {
+ children: H(R.start.error)
+ }) : I.isPending ? U = /* @__PURE__ */ (0, Q.jsx)(P, {
embedded: !0,
label: "正在核对整理计划"
- }) : P.isError && se ? V = /* @__PURE__ */ (0, Q.jsx)(J, {
+ }) : I.isError && se ? U = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "整理预览失败",
- children: p(P.error)
- }) : R && (V = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(J, {
+ children: H(I.error)
+ }) : z && (U = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(b, {
tone: "neutral",
title: "预览结果",
- children: re(R)
- }), z ? /* @__PURE__ */ (0, Q.jsx)(Et, { plan: R }) : null] }));
- return /* @__PURE__ */ (0, Q.jsxs)(We, {
+ children: Fe(z)
+ }), ce ? /* @__PURE__ */ (0, Q.jsx)(Et, { plan: z }) : null] }));
+ return /* @__PURE__ */ (0, Q.jsxs)(i, {
layout: "stack",
id: "organize",
labelledBy: "cleanup-organize-title",
attributes: { "data-cleanup-organize": "" },
footer: /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [
- i?.last_batch ? /* @__PURE__ */ (0, Q.jsx)(W, {
+ l?.last_batch ? /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "secondary",
- ...q(L),
+ ...B(oe),
onClick: me,
children: "回滚上一批"
}) : null,
- /* @__PURE__ */ (0, Q.jsx)(W, {
- variant: _e ? "secondary" : "primary",
- disabled: !a.length || L,
- ...q(P.isPending),
- onClick: de,
+ /* @__PURE__ */ (0, Q.jsx)(e, {
+ variant: he ? "secondary" : "primary",
+ disabled: !u.length || oe,
+ ...B(I.isPending),
+ onClick: fe,
children: "预览"
}),
- _e ? /* @__PURE__ */ (0, Q.jsx)(W, {
+ he ? /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "primary",
onClick: pe,
children: "执行整理"
}) : null
] }),
children: [
- /* @__PURE__ */ (0, Q.jsx)(ee, {
+ /* @__PURE__ */ (0, Q.jsx)(a, {
id: "cleanup-organize-title",
gap: "medium",
children: "整理"
@@ -721,12 +721,12 @@ function Dt({ toast: t, failure: n }) {
className: "text-body-regular text-text-secondary",
children: "清理文件名中的特殊符号与乱码,也可按模板改名并归入目录。先预览,确认后执行;执行过的一批可以整批退回。"
}),
- r.isError ? /* @__PURE__ */ (0, Q.jsx)("div", {
+ o.isError ? /* @__PURE__ */ (0, Q.jsx)("div", {
className: "mt-3",
- children: /* @__PURE__ */ (0, Q.jsx)(J, {
+ children: /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "整理配置读取失败",
- children: p(r.error)
+ children: H(o.error)
})
}) : null,
/* @__PURE__ */ (0, Q.jsxs)("div", {
@@ -735,48 +735,48 @@ function Dt({ toast: t, failure: n }) {
/* @__PURE__ */ (0, Q.jsxs)("div", {
"data-organize-scope": !0,
className: "flex min-w-0 flex-wrap items-start gap-2",
- children: [a.length ? /* @__PURE__ */ (0, Q.jsx)(w, {
+ children: [u.length ? /* @__PURE__ */ (0, Q.jsx)(te, {
"aria-label": "整理哪个来源",
prefix: "来源",
className: "w-fit min-w-25",
- selectedKey: c || null,
+ selectedKey: p || null,
onSelectionChange: (e) => {
- e !== null && (s(String(e)), v({
+ e !== null && (f(String(e)), w({
location: String(e),
path: ""
- }), E(null), P.reset(), F.reset(), j.current = !1);
+ }), O(null), I.reset(), L.reset(), F.current = !1);
},
- children: a.map((e) => /* @__PURE__ */ (0, Q.jsxs)(ge, {
+ children: u.map((e) => /* @__PURE__ */ (0, Q.jsxs)(ne, {
id: e.location,
- textValue: x[e.location] || e.location,
- children: [/* @__PURE__ */ (0, Q.jsx)(Ae, { mark: oe[e.location] || "database" }), x[e.location] || e.location]
+ textValue: m[e.location] || e.location,
+ children: [/* @__PURE__ */ (0, Q.jsx)(M, { mark: y[e.location] || "database" }), m[e.location] || e.location]
}, e.location))
}) : null, /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "flex min-w-0 basis-64 flex-1 items-start gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(Ie, {
+ children: [/* @__PURE__ */ (0, Q.jsx)(c, {
"aria-label": "整理路径",
className: "min-w-0 flex-1",
placeholder: "留空整理整个来源",
name: "organize-path",
autoComplete: "off",
spellCheck: "false",
- value: y,
- ref: O,
- isInvalid: T === "path",
+ value: T,
+ ref: A,
+ isInvalid: D === "path",
onChange: (e) => {
- v({
- location: c,
+ w({
+ location: p,
path: e
- }), E(null), P.reset(), F.reset();
+ }), O(null), I.reset(), L.reset();
}
- }), /* @__PURE__ */ (0, Q.jsx)(ye, {
+ }), /* @__PURE__ */ (0, Q.jsx)(s, {
icon: ct,
"aria-label": "选择整理路径",
- ...q(F.isPending),
- onClick: () => F.mutate({
- initial: y || a.find((e) => e.location === c)?.roots[0] || "",
- location: c,
- path: y
+ ...B(L.isPending),
+ onClick: () => L.mutate({
+ initial: T || u.find((e) => e.location === p)?.roots[0] || "",
+ location: p,
+ path: T
})
})]
})]
@@ -785,36 +785,36 @@ function Dt({ toast: t, failure: n }) {
className: "text-caption-1-regular text-text-secondary",
children: "指定路径时包含子目录,目录模板以该路径为起点。模板均留空时只清理文件名。"
}),
- F.isError ? /* @__PURE__ */ (0, Q.jsxs)(J, {
+ L.isError ? /* @__PURE__ */ (0, Q.jsxs)(b, {
tone: "error",
title: "目录选择失败",
- children: [p(F.error), ";也可直接输入路径。"]
+ children: [H(L.error), ";也可直接输入路径。"]
}) : null,
- /* @__PURE__ */ (0, Q.jsx)(Ie, {
+ /* @__PURE__ */ (0, Q.jsx)(c, {
label: "文件名模板",
placeholder: "{code}[ {title}]",
- value: f.file,
- ref: te,
+ value: v.file,
+ ref: ee,
spellCheck: "false",
- isInvalid: T === "file",
+ isInvalid: D === "file",
onFocus: () => {
- ne("file"), j.current = !0;
+ re("file"), F.current = !0;
},
- onChange: (e) => ce({ file: e })
+ onChange: (e) => ue({ file: e })
}),
- /* @__PURE__ */ (0, Q.jsx)(Ie, {
+ /* @__PURE__ */ (0, Q.jsx)(c, {
label: "目录模板",
placeholder: "留空表示原地改名",
- value: f.dir,
- ref: D,
+ value: v.dir,
+ ref: k,
spellCheck: "false",
- isInvalid: T === "dir",
+ isInvalid: D === "dir",
onFocus: () => {
- ne("dir"), j.current = !0;
+ re("dir"), F.current = !0;
},
- onChange: (e) => ce({ dir: e })
+ onChange: (e) => ue({ dir: e })
}),
- i?.presets?.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
+ l?.presets?.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "flex flex-col gap-2",
role: "group",
"aria-label": "套用模板",
@@ -823,35 +823,35 @@ function Dt({ toast: t, failure: n }) {
children: "套用模板"
}), /* @__PURE__ */ (0, Q.jsx)("div", {
className: "flex flex-wrap gap-2",
- children: i.presets.map((e) => /* @__PURE__ */ (0, Q.jsx)(W, {
+ children: l.presets.map((t) => /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "secondary",
size: "small",
- title: e.example || e.label,
+ title: t.example || t.label,
className: "max-w-full [&>span]:min-w-0 [&>span]:shrink",
onClick: () => {
- ce({
- file: e.file,
- dir: e.dir
- }), j.current = !1;
+ ue({
+ file: t.file,
+ dir: t.dir
+ }), F.current = !1;
},
children: /* @__PURE__ */ (0, Q.jsx)("span", {
className: "truncate",
- children: e.label
+ children: t.label
})
- }, e.label))
+ }, t.label))
})]
}) : null,
/* @__PURE__ */ (0, Q.jsxs)("p", {
"aria-live": "polite",
- "aria-busy": k.isFetching,
+ "aria-busy": j.isFetching,
"data-organize-example": "",
className: "text-caption-1-regular text-text-secondary",
children: ["路径示例:", /* @__PURE__ */ (0, Q.jsx)("code", {
className: "wrap-anywhere",
- children: k.data?.example || k.data?.error || (k.isError ? p(k.error) : "正在预览…")
+ children: j.data?.example || j.data?.error || (j.isError ? H(j.error) : "正在预览…")
})]
}),
- i?.placeholders?.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
+ l?.placeholders?.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
className: "flex flex-col gap-2",
role: "group",
"aria-label": "插入参数",
@@ -864,24 +864,24 @@ function Dt({ toast: t, failure: n }) {
children: "插入参数"
}),
"(到",
- A === "file" ? "文件名模板" : "目录模板",
+ N === "file" ? "文件名模板" : "目录模板",
")"
]
}), /* @__PURE__ */ (0, Q.jsx)("div", {
className: "flex flex-wrap gap-1",
- children: i.placeholders.map((e) => /* @__PURE__ */ (0, Q.jsx)(W, {
+ children: l.placeholders.map((t) => /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "ghost",
size: "small",
- "aria-label": `${e.label} {${e.key}}`,
- onClick: () => ue(e.key),
+ "aria-label": `${t.label} {${t.key}}`,
+ onClick: () => de(t.key),
children: /* @__PURE__ */ (0, Q.jsxs)("span", {
className: "inline-flex flex-wrap items-center gap-x-1.5",
- children: [/* @__PURE__ */ (0, Q.jsx)("code", { children: `{${e.key}}` }), /* @__PURE__ */ (0, Q.jsx)("span", {
+ children: [/* @__PURE__ */ (0, Q.jsx)("code", { children: `{${t.key}}` }), /* @__PURE__ */ (0, Q.jsx)("span", {
className: "text-text-secondary",
- children: e.label
+ children: t.label
})]
})
- }, e.key))
+ }, t.key))
})]
}) : null,
/* @__PURE__ */ (0, Q.jsx)("p", {
@@ -893,34 +893,34 @@ function Dt({ toast: t, failure: n }) {
/* @__PURE__ */ (0, Q.jsx)("div", {
"aria-live": "polite",
className: "mt-3 flex flex-col gap-2 empty:hidden",
- children: V
+ children: U
})
]
});
}
//#endregion
//#region src/react/data-cleanup/orphan-records-card.tsx
-var Ot = G("play"), kt = () => _.invalidateQueries({
- queryKey: tt,
+var Ot = K("play"), kt = () => G.invalidateQueries({
+ queryKey: S,
exact: !0
});
-function At({ item: e, toast: t }) {
- let [n, i] = (0, Z.useState)(e.candidates[0]?.id ?? null), a = ke({
- mutationFn: () => r(e.id, Number(n)),
+function At({ item: t, toast: n }) {
+ let [r, i] = (0, Z.useState)(t.candidates[0]?.id ?? null), a = et({
+ mutationFn: () => se(t.id, Number(r)),
onSuccess: () => {
- let r = e.candidates.find((e) => e.id === n);
- t(`已将「${e.name}」的个人记录转移到「${r?.name ?? "所选文件"}」`), kt();
+ let e = t.candidates.find((e) => e.id === r);
+ n(`已将「${t.name}」的个人记录转移到「${e?.name ?? "所选文件"}」`), kt();
},
- onError: (e) => t(p(e))
- }), o = ke({
- mutationFn: () => se(e.id),
- onSuccess: (n) => {
- t(n.blocked.length ? `「${e.name}」的文件已恢复,记录未删除;下次扫描后恢复为在库状态` : `已删除「${e.name}」的作品记录及个人记录`), kt();
+ onError: (e) => n(H(e))
+ }), o = et({
+ mutationFn: () => ze(t.id),
+ onSuccess: (e) => {
+ n(e.blocked.length ? `「${t.name}」的文件已恢复,记录未删除;下次扫描后恢复为在库状态` : `已删除「${t.name}」的作品记录及个人记录`), kt();
}
}), s = () => {
- N({
+ V({
title: "删除记录",
- body: `将删除「${e.name}」的作品记录${B(e.records) ? `及其个人记录(${B(e.records)})` : ""}。此操作不可撤销。`,
+ body: `将删除「${t.name}」的作品记录${Be(t.records) ? `及其个人记录(${Be(t.records)})` : ""}。此操作不可撤销。`,
confirmLabel: "删除记录",
danger: !0,
onConfirm: () => o.mutateAsync()
@@ -929,32 +929,32 @@ function At({ item: e, toast: t }) {
return /* @__PURE__ */ (0, Q.jsxs)("span", {
className: "flex min-w-0 flex-wrap items-center gap-2",
children: [
- /* @__PURE__ */ (0, Q.jsx)(W, {
+ /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "danger",
size: "small",
- ...q(c),
+ ...B(c),
onClick: s,
children: "删除记录"
}),
- e.candidates.length ? /* @__PURE__ */ (0, Q.jsx)(w, {
- "aria-label": `选择接收 ${e.name} 个人记录的文件`,
+ t.candidates.length ? /* @__PURE__ */ (0, Q.jsx)(te, {
+ "aria-label": `选择接收 ${t.name} 个人记录的文件`,
prefix: "接收",
className: "w-52",
- selectedKey: n,
+ selectedKey: r,
onSelectionChange: (e) => {
e !== null && i(Number(e));
},
- children: e.candidates.map((e) => /* @__PURE__ */ (0, Q.jsx)(ge, {
+ children: t.candidates.map((e) => /* @__PURE__ */ (0, Q.jsx)(ne, {
id: e.id,
- textValue: R(e),
- children: R(e)
+ textValue: ce(e),
+ children: ce(e)
}, e.id))
}) : null,
- e.candidates.length ? /* @__PURE__ */ (0, Q.jsx)(W, {
+ t.candidates.length ? /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "primary",
size: "small",
- disabled: n === null,
- ...q(c),
+ disabled: r === null,
+ ...B(c),
onClick: () => a.mutate(),
children: "转移记录"
}) : null
@@ -984,28 +984,28 @@ function jt({ item: e }) {
children: e.name
}), /* @__PURE__ */ (0, Q.jsx)("small", {
className: "truncate text-caption-1-regular text-text-secondary",
- children: [e.code, x[e.location] || e.location].filter(Boolean).join(" · ")
+ children: [e.code, m[e.location] || e.location].filter(Boolean).join(" · ")
})]
})]
});
}
-function Mt({ toast: e }) {
- let [t, n] = (0, Z.useState)([]), r = U({
- queryKey: tt,
- queryFn: ({ signal: e }) => g(e)
- }), i = r.data?.items ?? [], a = ke({
- mutationFn: (e) => se(e),
- onSuccess: (t) => {
- e(`已删除 ${t.purged} 条作品记录及其个人记录${t.blocked.length ? `;${t.blocked.length} 条文件已恢复,记录未删除` : ""}`), n([]), kt();
+function Mt({ toast: t }) {
+ let [n, r] = (0, Z.useState)([]), o = J({
+ queryKey: S,
+ queryFn: ({ signal: e }) => be(e)
+ }), s = o.data?.items ?? [], c = et({
+ mutationFn: (e) => ze(e),
+ onSuccess: (e) => {
+ t(`已删除 ${e.purged} 条作品记录及其个人记录${e.blocked.length ? `;${e.blocked.length} 条文件已恢复,记录未删除` : ""}`), r([]), kt();
}
- }), o = (e) => void N({
+ }), l = (e) => void V({
title: "删除所选记录",
body: `将删除以下 ${e.length} 条作品记录及其全部个人记录。此操作不可撤销。`,
items: e.map((e) => e.name),
confirmLabel: "删除所选记录",
danger: !0,
- onConfirm: () => a.mutateAsync(e.map((e) => e.id))
- }), s = [
+ onConfirm: () => c.mutateAsync(e.map((e) => e.id))
+ }), u = [
{
id: "item",
label: "作品",
@@ -1019,65 +1019,65 @@ function Mt({ toast: e }) {
label: "个人记录",
width: 176,
min: 144,
- value: (e) => B(e.records),
+ value: (e) => Be(e.records),
render: (e) => /* @__PURE__ */ (0, Q.jsx)("span", {
className: "block min-w-0 whitespace-normal wrap-anywhere",
- children: B(e.records) || "无"
+ children: Be(e.records) || "无"
})
},
{
id: "target",
label: "操作",
- width: i.some((e) => e.candidates.length) ? 360 : 128,
+ width: s.some((e) => e.candidates.length) ? 360 : 128,
min: 128,
value: (e) => e.candidates.length,
- render: (t) => /* @__PURE__ */ (0, Q.jsx)(At, {
- item: t,
- toast: e
+ render: (e) => /* @__PURE__ */ (0, Q.jsx)(At, {
+ item: e,
+ toast: t
})
}
];
- return !r.isError && !i.length ? null : /* @__PURE__ */ (0, Q.jsx)("section", {
+ return !o.isError && !s.length ? null : /* @__PURE__ */ (0, Q.jsx)("section", {
id: "orphan-records",
"aria-labelledby": "orphan-records-title",
className: "flex scroll-mt-20 flex-col gap-4",
- children: r.isError ? /* @__PURE__ */ (0, Q.jsxs)(We, {
+ children: o.isError ? /* @__PURE__ */ (0, Q.jsxs)(i, {
layout: "stack",
labelledBy: "orphan-records-title",
- children: [/* @__PURE__ */ (0, Q.jsx)(ee, {
+ children: [/* @__PURE__ */ (0, Q.jsx)(a, {
id: "orphan-records-title",
children: "文件已丢失的记录"
- }), /* @__PURE__ */ (0, Q.jsx)(J, {
+ }), /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "读取文件已丢失的记录失败",
- children: p(r.error)
+ children: H(o.error)
})]
}) : /* @__PURE__ */ (0, Q.jsx)(at, {
label: "文件已消失的作品",
- items: i,
- columns: s,
+ items: s,
+ columns: u,
title: "文件已丢失的记录",
titleId: "orphan-records-title",
unit: "条作品",
description: "这些作品的源文件已删除,喜欢、稍后看、播放列表与观看历史仍保留。选择替代文件后,这些记录会转移到该文件,旧作品记录随之删除。",
rowId: (e) => String(e.id),
rowLabel: (e) => e.name,
- selected: t,
- onSelected: n,
- actions: (e) => /* @__PURE__ */ (0, Q.jsx)(W, {
+ selected: n,
+ onSelected: r,
+ actions: (t) => /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "danger",
size: "small",
- disabled: !e.length,
- ...q(a.isPending),
- onClick: () => o(e),
- children: `删除所选记录(${e.length})`
+ disabled: !t.length,
+ ...B(c.isPending),
+ onClick: () => l(t),
+ children: `删除所选记录(${t.length})`
})
})
});
}
//#endregion
//#region src/react/data-cleanup/resource-sync-card.tsx
-var Nt = G("git-compare"), Pt = G("rotate-cw"), Ft = "暂时无法读取进度,正在重新连接…", It = "清理失效条目", Lt = "inline-grid w-full grid-flow-col auto-cols-fr gap-4 max-plain-stat-pair:grid-flow-row max-plain-stat-pair:grid-cols-2 max-plain-stat-single:grid-cols-1", $ = (e) => Number(e || 0).toLocaleString();
+var Nt = K("git-compare"), Pt = K("rotate-cw"), Ft = "暂时无法读取进度,正在重新连接…", It = "清理失效条目", Lt = "inline-grid w-full grid-flow-col auto-cols-fr gap-4 max-plain-stat-pair:grid-flow-row max-plain-stat-pair:grid-cols-2 max-plain-stat-single:grid-cols-1", $ = (e) => Number(e || 0).toLocaleString();
function Rt({ scan: e, partial: t = !1 }) {
let n = e.cache ?? {
files: 0,
@@ -1088,18 +1088,18 @@ function Rt({ scan: e, partial: t = !1 }) {
children: (e.sources ?? []).map((e) => /* @__PURE__ */ (0, Q.jsxs)("article", {
className: X(),
children: [/* @__PURE__ */ (0, Q.jsx)(Y, {
- label: ze[e.location] || "媒体来源",
- mark: /* @__PURE__ */ (0, Q.jsx)(Ae, { mark: oe[e.location] ?? "database" }),
+ label: j[e.location] || "媒体来源",
+ mark: /* @__PURE__ */ (0, Q.jsx)(M, { mark: y[e.location] ?? "database" }),
aside: /* @__PURE__ */ (0, Q.jsx)(lt, {
online: e.online,
children: e.online ? "可访问" : "离线"
}),
figure: e.online ? `${$(e.missing)} 项` : "—",
- meta: e.online ? v(e) : `${v(e)} · 本次已跳过`,
+ meta: e.online ? Ke(e) : `${Ke(e)} · 本次已跳过`,
wrapMeta: !0
}), e.online && e.unreadable > 0 ? /* @__PURE__ */ (0, Q.jsx)("span", {
className: "self-start",
- children: /* @__PURE__ */ (0, Q.jsxs)(C, {
+ children: /* @__PURE__ */ (0, Q.jsxs)(N, {
tone: "warning",
children: [$(e.unreadable), " 个目录未读取"]
})
@@ -1112,7 +1112,7 @@ function Rt({ scan: e, partial: t = !1 }) {
className: X(),
children: /* @__PURE__ */ (0, Q.jsx)(Y, {
label: "待永久删除",
- figure: `${$(j(e))} 项`,
+ figure: `${$(Re(e))} 项`,
meta: "文件已不在盘上,含回收站"
})
}),
@@ -1137,130 +1137,130 @@ function Rt({ scan: e, partial: t = !1 }) {
children: /* @__PURE__ */ (0, Q.jsx)(Y, {
label: "可清理的缓存",
figure: `${$(n.files)} 个`,
- meta: n.files ? me(n.bytes) : ""
+ meta: n.files ? Oe(n.bytes) : ""
})
})
]
})] });
}
-function zt({ toast: e }) {
- let n = K({
- queryKey: Ye,
- queryFn: ({ signal: e }) => t(e),
- start: T,
- onFinish: (t) => {
- if (_.invalidateQueries({
- queryKey: Je,
+function zt({ toast: t }) {
+ let n = q({
+ queryKey: D,
+ queryFn: ({ signal: e }) => Ce(e),
+ start: Xe,
+ onFinish: (e) => {
+ if (G.invalidateQueries({
+ queryKey: re,
exact: !0
- }), _.invalidateQueries({
- queryKey: I,
+ }), G.invalidateQueries({
+ queryKey: O,
exact: !0
- }), t.status !== "complete") return;
- let { done: n, left: r } = o(t);
- r ? e(`已完成 ${$(n)} 项,${$(r)} 项没有处理`, { warning: !0 }) : e("已清理失效条目");
+ }), e.status !== "complete") return;
+ let { done: n, left: r } = L(e);
+ r ? t(`已完成 ${$(n)} 项,${$(r)} 项没有处理`, { warning: !0 }) : t("已清理失效条目");
}
- }), r = K({
- queryKey: I,
- queryFn: ({ signal: e }) => je(e),
- start: ie,
+ }), r = q({
+ queryKey: O,
+ queryFn: ({ signal: e }) => we(e),
+ start: Ze,
onStarted: () => n.dismiss()
- }), i = r.job, a = r.running || r.start.isPending, s = n.running || n.start.isPending, c = i?.status === "complete" || i?.status === "failed", u = a ? "扫描中" : c ? "重新扫描" : "检查文件", d = (e) => void N({
+ }), o = r.job, s = r.running || r.start.isPending, c = n.running || n.start.isPending, l = o?.status === "complete" || o?.status === "failed", u = s ? "扫描中" : l ? "重新扫描" : "检查文件", d = (e) => void V({
title: It,
- body: l(e),
+ body: I(e),
confirmLabel: It,
danger: !0,
onConfirm: () => n.start.mutateAsync(e.scan_id || "")
- }), m = n.outcome, h = (e) => {
- let t = o(e).left > 0;
- return /* @__PURE__ */ (0, Q.jsx)(J, {
+ }), f = n.outcome, p = (e) => {
+ let t = L(e).left > 0;
+ return /* @__PURE__ */ (0, Q.jsx)(b, {
tone: t ? "warning" : "success",
title: t ? "部分完成" : "清理结果",
- children: Ne(e, me)
+ children: oe(e, Oe)
});
- }, g = null, v = null;
- if (m?.status === "failed") v = /* @__PURE__ */ (0, Q.jsx)(J, {
+ }, m = null, h = null;
+ if (f?.status === "failed") h = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "资源清理未完成",
- children: m.error || "请查看任务记录,核对已处理的文件。"
+ children: f.error || "请查看任务记录,核对已处理的文件。"
});
- else if (m) v = h(m);
- else if (n.running) g = /* @__PURE__ */ (0, Q.jsx)(M, {
+ else if (f) h = p(f);
+ else if (n.running) m = /* @__PURE__ */ (0, Q.jsx)(P, {
embedded: !0,
label: n.job?.message || "正在复核并清理失效条目"
});
- else if (r.start.isError) v = /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (r.start.isError) h = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "扫描失败",
- children: p(r.start.error)
+ children: H(r.start.error)
});
- else if (r.query.isError && i) v = /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (r.query.isError && o) h = /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "neutral",
title: "任务状态",
children: Ft
});
- else if (i?.status === "running") {
- let e = f(i);
- g = /* @__PURE__ */ (0, Q.jsx)(M, {
+ else if (o?.status === "running") {
+ let e = Ge(o);
+ m = /* @__PURE__ */ (0, Q.jsx)(P, {
embedded: !0,
label: e,
- value: i.completed_sources,
- total: i.total_sources
- }), i.sources?.length && (v = /* @__PURE__ */ (0, Q.jsx)(Rt, {
- scan: i,
+ value: o.completed_sources,
+ total: o.total_sources
+ }), o.sources?.length && (h = /* @__PURE__ */ (0, Q.jsx)(Rt, {
+ scan: o,
partial: !0
}));
- } else if (i?.status === "failed") v = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [i.sources?.length ? /* @__PURE__ */ (0, Q.jsx)(Rt, {
- scan: i,
+ } else if (o?.status === "failed") h = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [o.sources?.length ? /* @__PURE__ */ (0, Q.jsx)(Rt, {
+ scan: o,
partial: !0
- }) : null, /* @__PURE__ */ (0, Q.jsx)(J, {
+ }) : null, /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "扫描失败",
- children: i.error || "后台扫描失败"
+ children: o.error || "后台扫描失败"
})] });
- else if (i?.status === "complete" && i.applied) v = n.job?.status === "complete" ? h(n.job) : /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (o?.status === "complete" && o.applied) h = n.job?.status === "complete" ? p(n.job) : /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "neutral",
title: "清理结果",
children: "这次检查的结果已经清理,重新扫描可再核对。"
});
- else if (i?.status === "complete") {
- let e = E(i);
- v = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Rt, { scan: i }), e ? /* @__PURE__ */ (0, Q.jsx)(J, {
+ else if (o?.status === "complete") {
+ let t = ke(o);
+ h = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Rt, { scan: o }), t ? /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "neutral",
title: "清理内容",
- action: /* @__PURE__ */ (0, Q.jsx)(W, {
+ action: /* @__PURE__ */ (0, Q.jsx)(e, {
variant: "danger",
- ...q(s),
- onClick: () => d(i),
- children: s ? "正在复核并清理…" : It
+ ...B(c),
+ onClick: () => d(o),
+ children: c ? "正在复核并清理…" : It
}),
- children: k(i)
+ children: R(o)
}) : /* @__PURE__ */ (0, Q.jsx)("p", {
className: "mr-auto text-body-regular text-notification-success-foreground",
children: "已检查可访问的来源,没有待清理的记录、空文件夹或缓存。"
})] });
}
- return n.start.isError && !m && (v = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [v, /* @__PURE__ */ (0, Q.jsx)(J, {
+ return n.start.isError && !f && (h = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [h, /* @__PURE__ */ (0, Q.jsx)(b, {
tone: "error",
title: "清理失败",
- children: p(n.start.error)
+ children: H(n.start.error)
})] })), /* @__PURE__ */ (0, Q.jsxs)("section", {
id: "resource-sync",
"aria-labelledby": "resource-sync-title",
className: "flex scroll-mt-20 flex-col gap-4",
- children: [/* @__PURE__ */ (0, Q.jsxs)(We, {
+ children: [/* @__PURE__ */ (0, Q.jsxs)(i, {
layout: "split",
labelledBy: "resource-sync-title",
- footer: /* @__PURE__ */ (0, Q.jsx)(W, {
+ footer: /* @__PURE__ */ (0, Q.jsx)(e, {
"data-resource-scan": !0,
- leadingIcon: c && !a ? Pt : Nt,
- ...q(a),
+ leadingIcon: l && !s ? Pt : Nt,
+ ...B(s),
onClick: () => {
- a || r.start.mutate();
+ s || r.start.mutate();
},
children: u
}),
children: [
- /* @__PURE__ */ (0, Q.jsx)(ee, {
+ /* @__PURE__ */ (0, Q.jsx)(a, {
id: "resource-sync-title",
gap: "small",
children: "资源同步"
@@ -1272,13 +1272,13 @@ function zt({ toast: e }) {
/* @__PURE__ */ (0, Q.jsx)("div", {
"aria-live": "polite",
className: "mt-4 empty:hidden",
- children: g
+ children: m
})
]
}), /* @__PURE__ */ (0, Q.jsx)("div", {
"aria-live": "polite",
className: "flex flex-col gap-4 empty:hidden",
- children: v
+ children: h
})]
});
}
@@ -1301,36 +1301,36 @@ function Vt({ section: e, label: t, icon: n, value: r, open: i }) {
})
});
}
-var Ht = G("square-check-big"), Ut = G("sparkles"), Wt = G("file-stack"), Gt = G("file-archive"), Kt = G("trash"), qt = [
- H,
- be,
- Qe
+var Ht = K("square-check-big"), Ut = K("sparkles"), Wt = K("file-stack"), Gt = K("file-archive"), Kt = K("trash"), qt = [
+ A,
+ w,
+ r
], Jt = () => {
- for (let e of qt) _.invalidateQueries({
+ for (let e of qt) G.invalidateQueries({
queryKey: e,
exact: !0
});
};
function Yt({ toast: e, failure: t, open: n }) {
- let r = U({
- queryKey: H,
- queryFn: ({ signal: e }) => ve(e)
- }), a = U({
- queryKey: be,
- queryFn: ({ signal: e }) => Fe(e)
- }), o = U({
- queryKey: Qe,
- queryFn: ({ signal: e }) => F(e)
- }), s = U({
- queryKey: Ee,
- queryFn: ({ signal: e }) => $e(e)
- }), c = U({
- queryKey: Je,
- queryFn: ({ signal: e }) => Ze(e)
- }), l = U({
- queryKey: ne,
- queryFn: ({ signal: e }) => d(e)
- }), u = (t) => e(t);
+ let i = J({
+ queryKey: A,
+ queryFn: ({ signal: e }) => Te(e)
+ }), a = J({
+ queryKey: w,
+ queryFn: ({ signal: e }) => xe(e)
+ }), o = J({
+ queryKey: r,
+ queryFn: ({ signal: e }) => pe(e)
+ }), s = J({
+ queryKey: l,
+ queryFn: ({ signal: e }) => me(e)
+ }), c = J({
+ queryKey: re,
+ queryFn: ({ signal: e }) => Ee(e)
+ }), u = J({
+ queryKey: v,
+ queryFn: ({ signal: e }) => _e(e)
+ }), d = (t) => e(t);
return /* @__PURE__ */ (0, Q.jsxs)(nt, { children: [
/* @__PURE__ */ (0, Q.jsxs)("div", {
className: it,
@@ -1340,7 +1340,7 @@ function Yt({ toast: e, failure: t, open: n }) {
label: "人工复核",
icon: Ht,
open: n,
- value: Bt(r, i)
+ value: Bt(i, We)
}),
/* @__PURE__ */ (0, Q.jsx)(Vt, {
section: "quality",
@@ -1356,7 +1356,7 @@ function Yt({ toast: e, failure: t, open: n }) {
open: n,
value: Bt(o, (e) => Number(e.total || 0) ? {
figure: `${Number(e.total).toLocaleString()} 组 · ${Number(e.files || 0).toLocaleString()} 个文件`,
- meta: `可回收 ${me(e.reclaimable || 0)}`
+ meta: `可回收 ${Oe(e.reclaimable || 0)}`
} : { figure: "没有重复内容" })
}),
/* @__PURE__ */ (0, Q.jsx)(Vt, {
@@ -1366,7 +1366,7 @@ function Yt({ toast: e, failure: t, open: n }) {
open: n,
value: Bt(s, (e) => ({
figure: `${Number(e.pending_total || 0).toLocaleString()} 个待判断`,
- meta: ae(e)
+ meta: je(e)
}))
}),
/* @__PURE__ */ (0, Q.jsx)(Vt, {
@@ -1376,7 +1376,7 @@ function Yt({ toast: e, failure: t, open: n }) {
open: n,
value: Bt(c, (e) => ({
figure: `${Number(e.total || 0).toLocaleString()} 项在回收站`,
- meta: e.total ? `占用 ${me(e.bytes || 0)}` : ""
+ meta: e.total ? `占用 ${Oe(e.bytes || 0)}` : ""
}))
})
]
@@ -1387,28 +1387,28 @@ function Yt({ toast: e, failure: t, open: n }) {
/* @__PURE__ */ (0, Q.jsx)("div", {
id: "libraryProcessing",
className: "scroll-mt-20",
- children: /* @__PURE__ */ (0, Q.jsx)(ce, {
- toast: u,
+ children: /* @__PURE__ */ (0, Q.jsx)(h, {
+ toast: d,
monitor: !0,
onComplete: Jt
})
}),
/* @__PURE__ */ (0, Q.jsx)("div", {
id: "mediaRepair",
- children: /* @__PURE__ */ (0, Q.jsx)(ft, { toast: u })
+ children: /* @__PURE__ */ (0, Q.jsx)(ft, { toast: d })
}),
/* @__PURE__ */ (0, Q.jsx)(Dt, {
- toast: u,
+ toast: d,
failure: t
})
]
}),
/* @__PURE__ */ (0, Q.jsx)(St, {}),
- /* @__PURE__ */ (0, Q.jsx)(Mt, { toast: u }),
- D(l.data) ? /* @__PURE__ */ (0, Q.jsx)(zt, { toast: e }) : null
+ /* @__PURE__ */ (0, Q.jsx)(Mt, { toast: d }),
+ Ae(u.data) ? /* @__PURE__ */ (0, Q.jsx)(zt, { toast: e }) : null
] });
}
//#endregion
export { Yt as DataCleanupPage };
-//# debugId=810dbbe5-3cfe-44de-b6e1-f15115c45e2f
\ No newline at end of file
+//# debugId=15bf6027-b413-4089-9e63-65d88f7bddc5
\ No newline at end of file
diff --git a/web/dist/peach-app.data-table-BCsefVBk.js b/web/dist/peach-app.data-table-CI9MJhw_.js
similarity index 62%
rename from web/dist/peach-app.data-table-BCsefVBk.js
rename to web/dist/peach-app.data-table-CI9MJhw_.js
index b6915bd6e..4d1841a49 100644
--- a/web/dist/peach-app.data-table-BCsefVBk.js
+++ b/web/dist/peach-app.data-table-CI9MJhw_.js
@@ -1,22 +1,22 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "74a05bab-3494-45f9-ba22-a1fde6a6c540", e._sentryDebugIdIdentifier = "sentry-dbid-74a05bab-3494-45f9-ba22-a1fde6a6c540");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "021f7b59-d6d4-46a2-932a-369d52f583a9", e._sentryDebugIdIdentifier = "sentry-dbid-021f7b59-d6d4-46a2-932a-369d52f583a9");
} catch {}
})();
-import { t as e } from "./peach-app.createPaginatedRowModel-Cb5ojTIu.js";
-import { n as t, t as n } from "./peach-app.use-table-selection-KrR-g6fk.js";
-import { Ai as r, Bi as i, Fi as a, Gi as o, Ji as s, Mi as c, Ni as l, Pi as u, Ri as d, Va as f, Vi as p, Wi as m, Xa as h, Yi as g, as as _, cu as v, ec as y, fs as b, is as x, ji as S, na as C, ns as w, pu as T, qi as E, rs as D, to as O, ts as k, uu as A, zi as j } from "./peach-app.js";
+import { createPaginatedRowModel as e } from "./peach-app.createPaginatedRowModel-DKa1ysea.js";
+import { createSortedRowModel as t, useTableSelection as n } from "./peach-app.use-table-selection-Bi_E2zbh.js";
+import { $76d00c5a4edb230a$export$76ccd210b9029917 as r, $76d00c5a4edb230a$export$816b5d811295e6bc as i, $76d00c5a4edb230a$export$b59bdbef9ce70de2 as a, $76d00c5a4edb230a$export$f6f0c3fe4ec306ea as o, $76d00c5a4edb230a$export$f850895b287ef28e as s, Button as c, Checkbox as l, ChevronSortDown as u, DataTableFooter as d, DataTableFrame as f, DataTableSort as p, SelectionDock as m, Table as h, TableColumnControls as g, TableColumnResizer as _, TableSelectionHeader as v, __toESM as y, cardClass as b, columnVisibilityFeature as x, createColumnHelper as S, flexRender as C, require_jsx_runtime as w, require_react as T, rowPaginationFeature as E, rowSelectionFeature as D, rowSortingFeature as O, tableFeatures as k, useTable as A, useTablePreferences as j } from "./peach-app.js";
//#region src/react/components/data-table.tsx
-var M = /* @__PURE__ */ T(A(), 1), N = v(), P = s({
- rowSortingFeature: p,
- rowSelectionFeature: m,
- rowPaginationFeature: o,
- columnVisibilityFeature: E,
+var M = /* @__PURE__ */ y(T(), 1), N = w(), P = k({
+ rowSortingFeature: O,
+ rowSelectionFeature: D,
+ rowPaginationFeature: E,
+ columnVisibilityFeature: x,
sortedRowModel: t(),
paginatedRowModel: e()
});
-function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m, onSelected: v, actions: T, title: E = e, titleId: A, description: F, footerActions: I, panel: L = !0, unit: R = "条记录" }) {
+function F({ label: e, items: t, columns: y, rowId: x, rowLabel: w, selected: T, onSelected: E, actions: D, title: O = e, titleId: k, description: F, footerActions: I, panel: L = !0, unit: R = "条记录" }) {
let [z, B] = (0, M.useState)([]), V = (0, M.useMemo)(() => [{
id: "select",
label: "选择",
@@ -24,30 +24,30 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
min: 48,
max: 48,
required: !0
- }, ...o.map((e, t) => ({
+ }, ...y.map((e, t) => ({
...e,
width: e.width ?? (t === 0 ? 320 : 160),
min: e.min ?? (t === 0 ? 320 : 96),
flex: e.flex ?? t === 0,
required: t === 0
- }))], [o]), H = l(`data:${e}`, V), [U, W] = (0, M.useState)({
+ }))], [y]), H = j(`data:${e}`, V), [U, W] = (0, M.useState)({
pageIndex: 0,
pageSize: 20
- }), G = n(() => v([])), K = Math.max(1, Math.ceil(t.length / U.pageSize)), q = Math.min(U.pageIndex, K - 1), J = Object.fromEntries(m.map((e) => [e, !0])), Y = (0, M.useMemo)(() => {
- let t = g();
+ }), G = n(() => E([])), K = Math.max(1, Math.ceil(t.length / U.pageSize)), q = Math.min(U.pageIndex, K - 1), J = Object.fromEntries(T.map((e) => [e, !0])), Y = (0, M.useMemo)(() => {
+ let t = S();
return t.columns([t.display({
id: "select",
- header: ({ table: t }) => /* @__PURE__ */ (0, N.jsx)(r, {
+ header: ({ table: t }) => /* @__PURE__ */ (0, N.jsx)(v, {
table: t,
label: `全选${e}`
}),
- cell: ({ row: e }) => /* @__PURE__ */ (0, N.jsx)(h, {
+ cell: ({ row: e }) => /* @__PURE__ */ (0, N.jsx)(l, {
slot: null,
- "aria-label": `选择 ${p(e.original)}`,
+ "aria-label": `选择 ${w(e.original)}`,
isSelected: e.getIsSelected(),
onChange: (t) => e.toggleSelected(t)
})
- }), ...o.map((e) => t.accessor((t) => e.value?.(t) ?? "", {
+ }), ...y.map((e) => t.accessor((t) => e.value?.(t) ?? "", {
id: e.id,
header: e.label,
enableSorting: !!e.value,
@@ -58,14 +58,14 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
cell: ({ row: t }) => e.render(t.original)
}))]);
}, [
- o,
+ y,
e,
- p
- ]), X = i({
+ w
+ ]), X = A({
features: P,
data: t,
columns: Y,
- getRowId: s,
+ getRowId: x,
state: {
sorting: z,
rowSelection: J,
@@ -86,12 +86,12 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
enableRowSelection: !0,
onRowSelectionChange: (e) => {
let n = typeof e == "function" ? e(J) : e;
- Object.values(n).some(Boolean) && G(), v(t.filter((e) => n[s(e)]).map(s));
+ Object.values(n).some(Boolean) && G(), E(t.filter((e) => n[x(e)]).map(x));
}
}), Z = X.getSelectedRowModel().rows.map((e) => e.original);
return /* @__PURE__ */ (0, N.jsxs)("div", {
"data-data-table-panel": L || void 0,
- className: L ? f({
+ className: L ? b({
padding: "none",
bordered: "line",
className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
@@ -104,21 +104,21 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
children: [/* @__PURE__ */ (0, N.jsxs)("div", {
"data-toolbar-heading": "",
children: [/* @__PURE__ */ (0, N.jsx)("h3", {
- id: A,
+ id: k,
className: "text-title-2-medium text-text-primary",
- children: E
+ children: O
}), /* @__PURE__ */ (0, N.jsx)("span", {
className: "text-body-2-regular tabular-nums text-text-secondary",
children: `${t.length.toLocaleString()} ${R}`
})]
}), /* @__PURE__ */ (0, N.jsxs)("div", {
"data-toolbar-actions": "",
- children: [/* @__PURE__ */ (0, N.jsx)(S, {
+ children: [/* @__PURE__ */ (0, N.jsx)(g, {
preferences: H,
label: e
- }), /* @__PURE__ */ (0, N.jsx)(a, {
+ }), /* @__PURE__ */ (0, N.jsx)(p, {
label: e,
- options: o.filter((e) => e.value).map((e) => ({
+ options: y.filter((e) => e.value).map((e) => ({
id: e.id,
label: e.label
})),
@@ -136,22 +136,22 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
className: "text-body-2-regular text-text-secondary",
children: F
}) : null,
- /* @__PURE__ */ (0, N.jsxs)(y, {
+ /* @__PURE__ */ (0, N.jsxs)(m, {
label: `${e}批量操作`,
visible: Z.length > 0,
count: `已选 ${Z.length.toLocaleString()} ${R}`,
- children: [T(Z, () => v([])), /* @__PURE__ */ (0, N.jsx)(b, {
+ children: [D(Z, () => E([])), /* @__PURE__ */ (0, N.jsx)(c, {
variant: "ghost",
size: "small",
- onClick: () => v([]),
+ onClick: () => E([]),
children: "取消选择"
})]
}),
- /* @__PURE__ */ (0, N.jsx)(d, {
+ /* @__PURE__ */ (0, N.jsx)(f, {
follow: !0,
preferences: H,
onRowClick: (e) => X.getRow(e)?.toggleSelected(),
- children: /* @__PURE__ */ (0, N.jsxs)(j, {
+ children: /* @__PURE__ */ (0, N.jsxs)(h, {
"aria-label": e,
size: "sm",
sortDescriptor: z[0] ? {
@@ -159,9 +159,9 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
direction: z[0].desc ? "descending" : "ascending"
} : void 0,
onSortChange: (e) => X.getColumn(String(e.column))?.toggleSorting(e.direction === "descending"),
- children: [/* @__PURE__ */ (0, N.jsxs)(_, { children: [X.getHeaderGroups()[0].headers.map((e) => /* @__PURE__ */ (0, N.jsx)(w, {
+ children: [/* @__PURE__ */ (0, N.jsxs)(s, { children: [X.getHeaderGroups()[0].headers.map((e) => /* @__PURE__ */ (0, N.jsx)(i, {
id: e.id,
- isRowHeader: e.id === o[0].id,
+ isRowHeader: e.id === y[0].id,
allowsSorting: e.column.getCanSort(),
...H.columnProps(e.id),
children: ({ sortDirection: t }) => /* @__PURE__ */ (0, N.jsxs)(N.Fragment, { children: [/* @__PURE__ */ (0, N.jsxs)("span", {
@@ -169,29 +169,29 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
children: [C(e.column.columnDef.header, e.getContext()), e.column.getCanSort() ? /* @__PURE__ */ (0, N.jsx)("span", {
"data-sort-indicator": !0,
"data-direction": t || void 0,
- children: /* @__PURE__ */ (0, N.jsx)(O, {})
+ children: /* @__PURE__ */ (0, N.jsx)(u, {})
}) : null]
- }), /* @__PURE__ */ (0, N.jsx)(c, {
+ }), /* @__PURE__ */ (0, N.jsx)(_, {
preferences: H,
id: e.id
})] })
- }, e.id)), /* @__PURE__ */ (0, N.jsx)(w, {
+ }, e.id)), /* @__PURE__ */ (0, N.jsx)(i, {
id: "remaining-space",
"aria-label": "行空白区域",
"data-table-space": "",
width: H.spaceWidth,
minWidth: 0
- })] }), /* @__PURE__ */ (0, N.jsx)(k, {
+ })] }), /* @__PURE__ */ (0, N.jsx)(r, {
renderEmptyState: () => "没有记录",
- children: X.getRowModel().rows.map((e) => /* @__PURE__ */ (0, N.jsxs)(D, {
+ children: X.getRowModel().rows.map((e) => /* @__PURE__ */ (0, N.jsxs)(a, {
id: e.id,
"data-board-selected": e.getIsSelected() || void 0,
- children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, N.jsx)(x, { children: C(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, N.jsx)(x, { "data-table-space": "" })]
+ children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, N.jsx)(o, { children: C(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, N.jsx)(o, { "data-table-space": "" })]
}, e.id))
})]
})
}),
- /* @__PURE__ */ (0, N.jsx)(u, {
+ /* @__PURE__ */ (0, N.jsx)(d, {
label: e,
total: t.length,
pagination: {
@@ -209,6 +209,6 @@ function F({ label: e, items: t, columns: o, rowId: s, rowLabel: p, selected: m,
});
}
//#endregion
-export { F as t };
+export { F as DataTable };
-//# debugId=74a05bab-3494-45f9-ba22-a1fde6a6c540
\ No newline at end of file
+//# debugId=021f7b59-d6d4-46a2-932a-369d52f583a9
\ No newline at end of file
diff --git a/web/dist/peach-app.diagnostics-page-DyimXTyD.js b/web/dist/peach-app.diagnostics-page-bdA2qUuj.js
similarity index 60%
rename from web/dist/peach-app.diagnostics-page-DyimXTyD.js
rename to web/dist/peach-app.diagnostics-page-bdA2qUuj.js
index f78b42f47..9c3fc5830 100644
--- a/web/dist/peach-app.diagnostics-page-DyimXTyD.js
+++ b/web/dist/peach-app.diagnostics-page-bdA2qUuj.js
@@ -1,15 +1,15 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "155d273a-7626-4b0f-9396-3ab50cbeb9c8", e._sentryDebugIdIdentifier = "sentry-dbid-155d273a-7626-4b0f-9396-3ab50cbeb9c8");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7758d390-dffc-4ab0-9994-26e45a337074", e._sentryDebugIdIdentifier = "sentry-dbid-7758d390-dffc-4ab0-9994-26e45a337074");
} catch {}
})();
-import { Aa as e, Fa as t, Gl as n, Ha as r, Ja as i, Jo as a, Kl as o, Ma as s, Na as c, Ta as l, Us as u, Wa as d, Xl as f, Zl as p, au as m, cu as h, dn as g, fn as _, fs as v, hn as y, mt as b, oo as x, ps as S, pu as C, qa as w, ro as T, so as E, uu as D, wa as O, xa as k } from "./peach-app.js";
-import { n as A } from "./peach-app.error-excerpt-5tEehQuQ.js";
-import { t as j } from "./peach-app.data-table-BCsefVBk.js";
-import { n as M } from "./peach-app.site-mark-C-FsZf9f.js";
+import { Button as e, ButtonLink as t, Chip as n, DIAGNOSTICS_KEY as r, Disclosure as i, EmptyState as a, Fact as o, FactList as s, LOC as c, LinkButton as l, Note as u, Section as d, SettingsCard as f, SettingsSectionLabel as p, Stack as m, __toESM as h, busyProps as g, configurationSection as _, cx as v, diagnosticsSkeleton as y, errorMessage as b, fetchDiagnostics as x, fmtDur as S, fmtSize as C, require_jsx_runtime as w, require_react as T, settingsPath as E, tl as D, useAction as O, useQuery as k } from "./peach-app.js";
+import { ErrorExcerpt as A } from "./peach-app.error-excerpt-GIDhsLJp.js";
+import { DataTable as j } from "./peach-app.data-table-CI9MJhw_.js";
+import { SiteMark as M } from "./peach-app.site-mark-Cjd7g2Ii.js";
//#region src/react/diagnostics/health-list.tsx
-var N = /* @__PURE__ */ C(D(), 1), P = h(), F = (e) => e.title || e.name || e.code || `作品 #${e.id}`, I = (e) => [[
+var N = /* @__PURE__ */ h(T(), 1), P = w(), F = (e) => e.title || e.name || e.code || `作品 #${e.id}`, I = (e) => [[
"作品",
"番号",
"文件名",
@@ -21,23 +21,23 @@ var N = /* @__PURE__ */ C(D(), 1), P = h(), F = (e) => e.title || e.name || e.co
F(e),
e.code ?? "",
e.name,
- o[e.location] || e.location,
+ c[e.location] || e.location,
e.path,
e.duration ?? "",
e.size ?? ""
])].map((e) => e.map((e) => String(e ?? "").replace(/[\t\r\n]+/g, " ")).join(" ")).join("\n");
-function L({ group: e, openItem: t, receipt: n }) {
- let i = r(), [c, l] = (0, N.useState)([]), u = (e) => void i.run("copy", () => navigator.clipboard.writeText(I(e)), () => n("已复制清单")), m = [
+function L({ group: t, openItem: n, receipt: r }) {
+ let o = O(), [s, d] = (0, N.useState)([]), f = (e) => void o.run("copy", () => navigator.clipboard.writeText(I(e)), () => r("已复制清单")), p = [
{
id: "title",
label: "作品",
value: F,
render: (e) => /* @__PURE__ */ (0, P.jsxs)("span", {
className: "flex min-w-0 flex-col gap-1",
- children: [/* @__PURE__ */ (0, P.jsx)(d, {
+ children: [/* @__PURE__ */ (0, P.jsx)(l, {
variant: "primary",
className: "justify-start whitespace-normal text-left",
- onClick: () => t(e.id),
+ onClick: () => n(e.id),
children: F(e)
}), e.name && e.name !== F(e) ? /* @__PURE__ */ (0, P.jsx)("span", {
"data-middle-truncate": !0,
@@ -61,8 +61,8 @@ function L({ group: e, openItem: t, receipt: n }) {
id: "location",
label: "媒体库",
width: 128,
- value: (e) => o[e.location] || e.location,
- render: (e) => o[e.location] || e.location || "未取得"
+ value: (e) => c[e.location] || e.location,
+ render: (e) => c[e.location] || e.location || "未取得"
},
{
id: "path",
@@ -82,66 +82,66 @@ function L({ group: e, openItem: t, receipt: n }) {
label: "时长",
width: 112,
value: (e) => e.duration ?? 0,
- render: (e) => e.duration && e.duration > 0 ? f(e.duration) : "未取得"
+ render: (e) => e.duration && e.duration > 0 ? S(e.duration) : "未取得"
},
{
id: "size",
label: "大小",
width: 112,
value: (e) => e.size ?? 0,
- render: (e) => e.size === null ? "未取得" : p(e.size)
+ render: (e) => e.size === null ? "未取得" : C(e.size)
}
];
- return /* @__PURE__ */ (0, P.jsx)(k, {
- summary: `${e.label} · ${e.count === null ? "未取得" : `${e.count.toLocaleString()} 项`}`,
- children: e.count === null ? /* @__PURE__ */ (0, P.jsx)(E, {
+ return /* @__PURE__ */ (0, P.jsx)(i, {
+ summary: `${t.label} · ${t.count === null ? "未取得" : `${t.count.toLocaleString()} 项`}`,
+ children: t.count === null ? /* @__PURE__ */ (0, P.jsx)(u, {
tone: "neutral",
children: "清单未取得,请重新检查。"
- }) : e.items.length ? /* @__PURE__ */ (0, P.jsxs)(s, { children: [
+ }) : t.items.length ? /* @__PURE__ */ (0, P.jsxs)(m, { children: [
/* @__PURE__ */ (0, P.jsxs)("div", {
className: "flex flex-wrap items-center justify-between gap-2",
- children: [e.truncated ? /* @__PURE__ */ (0, P.jsxs)("span", {
+ children: [t.truncated ? /* @__PURE__ */ (0, P.jsxs)("span", {
className: "text-body-2-regular text-text-secondary",
children: [
"已载入 ",
- e.items.length.toLocaleString(),
+ t.items.length.toLocaleString(),
" / ",
- e.count.toLocaleString(),
+ t.count.toLocaleString(),
" 项"
]
- }) : null, /* @__PURE__ */ (0, P.jsx)(v, {
+ }) : null, /* @__PURE__ */ (0, P.jsx)(e, {
size: "small",
variant: "secondary",
- ...T(i.busy === "copy"),
- onClick: () => u(e.items),
+ ...g(o.busy === "copy"),
+ onClick: () => f(t.items),
children: "复制当前清单"
})]
}),
- i.error ? /* @__PURE__ */ (0, P.jsx)(E, {
+ o.error ? /* @__PURE__ */ (0, P.jsx)(u, {
tone: "error",
- children: i.error
+ children: o.error
}) : null,
/* @__PURE__ */ (0, P.jsx)(j, {
- label: e.label,
+ label: t.label,
title: "作品清单",
unit: "部作品",
panel: !1,
- items: e.items,
- columns: m,
+ items: t.items,
+ columns: p,
rowId: (e) => String(e.id),
rowLabel: F,
- selected: c,
- onSelected: l,
- actions: (e) => /* @__PURE__ */ (0, P.jsx)(v, {
+ selected: s,
+ onSelected: d,
+ actions: (t) => /* @__PURE__ */ (0, P.jsx)(e, {
size: "small",
variant: "secondary",
- ...T(i.busy === "copy"),
- onClick: () => u(e),
+ ...g(o.busy === "copy"),
+ onClick: () => f(t),
children: "复制所选"
})
})
- ] }) : /* @__PURE__ */ (0, P.jsx)(x, {
- icon: a,
+ ] }) : /* @__PURE__ */ (0, P.jsx)(a, {
+ icon: D,
title: "清单为空",
size: "compact",
children: "没有需要处理的作品。"
@@ -171,7 +171,7 @@ var R = {
["后台任务", ["tasks"]]
], V = (e) => new Date(e).toLocaleString();
function H({ status: e }) {
- return /* @__PURE__ */ (0, P.jsx)(y, {
+ return /* @__PURE__ */ (0, P.jsx)(n, {
variant: "caption",
"data-diagnostic-status": e,
color: e === "failed" ? "rose" : e === "ok" ? "lime" : e === "warning" || e === "stale" ? "yellow" : "neutral",
@@ -179,12 +179,12 @@ function H({ status: e }) {
});
}
function U() {
- let e = r();
+ let t = O();
return /* @__PURE__ */ (0, P.jsxs)("div", {
className: "flex flex-col items-end gap-2",
- children: [/* @__PURE__ */ (0, P.jsx)(v, {
+ children: [/* @__PURE__ */ (0, P.jsx)(e, {
variant: "secondary",
- onClick: () => void e.run("download", async () => {
+ onClick: () => void t.run("download", async () => {
let e = await fetch("/api/diagnostics/bundle", { credentials: "same-origin" });
if (!e.ok) throw Error(`诊断报告下载失败(HTTP ${e.status})`);
let t = URL.createObjectURL(await e.blob()), n = document.createElement("a");
@@ -195,84 +195,84 @@ function U() {
n.remove(), setTimeout(() => URL.revokeObjectURL(t), 1e3);
}
}, () => {}),
- ...T(e.busy === "download"),
+ ...g(t.busy === "download"),
children: "下载诊断报告"
- }), e.error ? /* @__PURE__ */ (0, P.jsx)(E, {
+ }), t.error ? /* @__PURE__ */ (0, P.jsx)(u, {
tone: "error",
- children: e.error
+ children: t.error
}) : null]
});
}
-function W({ name: e, check: t, compact: n = !1 }) {
- let r = t.target === "/settings/library" && (e === "security" || e === "port") ? i("网络与访问") : t.target, a = n ? "h4" : "h3";
+function W({ name: e, check: n, compact: r = !1 }) {
+ let i = n.target === "/settings/library" && (e === "security" || e === "port") ? E("网络与访问") : n.target, a = r ? "h4" : "h3";
return /* @__PURE__ */ (0, P.jsxs)("div", {
"data-diagnostic-check": e,
- className: u("flex flex-col gap-4 border-b border-separator-border pr-3 last:border-b-0 sm:flex-row sm:items-center sm:justify-between", n ? "py-3" : "py-5"),
+ className: v("flex flex-col gap-4 border-b border-separator-border pr-3 last:border-b-0 sm:flex-row sm:items-center sm:justify-between", r ? "py-3" : "py-5"),
children: [/* @__PURE__ */ (0, P.jsxs)("div", {
- className: u("flex min-w-0 flex-1 flex-col", n ? "gap-1" : "gap-2"),
+ className: v("flex min-w-0 flex-1 flex-col", r ? "gap-1" : "gap-2"),
children: [
/* @__PURE__ */ (0, P.jsxs)("div", {
className: "flex flex-wrap items-center gap-3",
children: [/* @__PURE__ */ (0, P.jsx)(a, {
- className: u("text-text-primary", n ? "text-body-2-medium" : "text-body-medium"),
- children: t.label
- }), /* @__PURE__ */ (0, P.jsx)(H, { status: t.status })]
+ className: v("text-text-primary", r ? "text-body-2-medium" : "text-body-medium"),
+ children: n.label
+ }), /* @__PURE__ */ (0, P.jsx)(H, { status: n.status })]
}),
/* @__PURE__ */ (0, P.jsx)("p", {
"data-check-reason": !0,
- className: u("text-body-2-regular break-words", n ? "text-text-secondary" : "text-text-primary"),
- children: t.reason
+ className: v("text-body-2-regular break-words", r ? "text-text-secondary" : "text-text-primary"),
+ children: n.reason
}),
- t.action ? /* @__PURE__ */ (0, P.jsxs)("p", {
+ n.action ? /* @__PURE__ */ (0, P.jsxs)("p", {
className: "text-body-2-regular text-text-secondary",
- children: ["处理建议:", t.action]
+ children: ["处理建议:", n.action]
}) : null
]
- }), r ? /* @__PURE__ */ (0, P.jsx)("div", {
+ }), i ? /* @__PURE__ */ (0, P.jsx)("div", {
className: "shrink-0 self-end sm:self-auto",
- children: /* @__PURE__ */ (0, P.jsx)(S, {
+ children: /* @__PURE__ */ (0, P.jsx)(t, {
size: "small",
variant: "secondary",
- href: r,
- children: r.startsWith("/settings/") ? `打开${w(r)}` : z[r] ?? "打开相关页面"
+ href: i,
+ children: i.startsWith("/settings/") ? `打开${_(i)}` : z[i] ?? "打开相关页面"
})
}) : null]
});
}
-function G(i) {
- let a = m({
- queryKey: g,
- queryFn: ({ signal: e }) => _(e),
+function G(n) {
+ let a = k({
+ queryKey: r,
+ queryFn: ({ signal: e }) => x(e),
staleTime: 1e4
- }), o = r(), [u, d] = (0, N.useState)(""), f = () => void o.run("refresh", async () => {
+ }), c = O(), [l, h] = (0, N.useState)(""), _ = () => void c.run("refresh", async () => {
let e = await a.refetch();
if (e.error) throw e.error;
return e.data;
- }, () => d(""), (e) => d(n(e))), p = a.data;
- if (!p && a.isPending) return /* @__PURE__ */ (0, P.jsx)("div", {
+ }, () => h(""), (e) => h(b(e))), v = a.data;
+ if (!v && a.isPending) return /* @__PURE__ */ (0, P.jsx)("div", {
role: "status",
"aria-label": "正在读取系统诊断",
- dangerouslySetInnerHTML: { __html: b() }
+ dangerouslySetInnerHTML: { __html: y() }
});
- if (!p) return /* @__PURE__ */ (0, P.jsxs)("div", {
+ if (!v) return /* @__PURE__ */ (0, P.jsxs)("div", {
className: "ui-configpage",
- children: [/* @__PURE__ */ (0, P.jsx)(U, {}), /* @__PURE__ */ (0, P.jsx)(E, {
+ children: [/* @__PURE__ */ (0, P.jsx)(U, {}), /* @__PURE__ */ (0, P.jsx)(u, {
tone: "error",
title: "诊断读取失败",
- action: /* @__PURE__ */ (0, P.jsx)(v, {
+ action: /* @__PURE__ */ (0, P.jsx)(e, {
variant: "secondary",
- onClick: f,
- ...T(o.busy === "refresh"),
+ onClick: _,
+ ...g(c.busy === "refresh"),
children: "重新检查"
}),
- children: a.error ? n(a.error) : "诊断报告未取得。"
+ children: a.error ? b(a.error) : "诊断报告未取得。"
})]
});
- let h = Object.entries(p.checks).filter(([, e]) => [
+ let S = Object.entries(v.checks).filter(([, e]) => [
"warning",
"failed",
"unknown"
- ].includes(e.status)), y = Object.entries(p.checks).filter(([, e]) => ![
+ ].includes(e.status)), C = Object.entries(v.checks).filter(([, e]) => ![
"warning",
"failed",
"unknown"
@@ -282,41 +282,41 @@ function G(i) {
children: [
/* @__PURE__ */ (0, P.jsxs)("div", {
className: "flex flex-wrap justify-end gap-2",
- children: [/* @__PURE__ */ (0, P.jsx)(U, {}), /* @__PURE__ */ (0, P.jsx)(v, {
+ children: [/* @__PURE__ */ (0, P.jsx)(U, {}), /* @__PURE__ */ (0, P.jsx)(e, {
variant: "secondary",
- onClick: f,
- ...T(o.busy === "refresh"),
+ onClick: _,
+ ...g(c.busy === "refresh"),
children: "重新检查"
})]
}),
- u ? /* @__PURE__ */ (0, P.jsx)(E, {
+ l ? /* @__PURE__ */ (0, P.jsx)(u, {
tone: "error",
- children: u
+ children: l
}) : null,
- h.length ? /* @__PURE__ */ (0, P.jsx)(e, {
- title: `需要关注 · ${h.length} 项`,
- children: h.map(([e, t]) => /* @__PURE__ */ (0, P.jsx)(W, {
+ S.length ? /* @__PURE__ */ (0, P.jsx)(d, {
+ title: `需要关注 · ${S.length} 项`,
+ children: S.map(([e, t]) => /* @__PURE__ */ (0, P.jsx)(W, {
name: e,
check: t
}, e))
}) : null,
- /* @__PURE__ */ (0, P.jsx)(e, {
+ /* @__PURE__ */ (0, P.jsx)(d, {
title: "库健康",
- children: /* @__PURE__ */ (0, P.jsxs)(s, { children: [p.library.issue_at ? /* @__PURE__ */ (0, P.jsxs)("p", {
+ children: /* @__PURE__ */ (0, P.jsxs)(m, { children: [v.library.issue_at ? /* @__PURE__ */ (0, P.jsxs)("p", {
className: "text-body-2-regular text-text-secondary",
- children: ["处理记录 · ", V(p.library.issue_at)]
- }) : null, Object.entries(p.library.groups).map(([e, t]) => /* @__PURE__ */ (0, P.jsx)(L, {
+ children: ["处理记录 · ", V(v.library.issue_at)]
+ }) : null, Object.entries(v.library.groups).map(([e, t]) => /* @__PURE__ */ (0, P.jsx)(L, {
group: t,
- ...i
+ ...n
}, e))] })
}),
- y.length ? /* @__PURE__ */ (0, P.jsx)("section", {
+ C.length ? /* @__PURE__ */ (0, P.jsx)("section", {
"aria-label": "系统检查",
- children: /* @__PURE__ */ (0, P.jsx)(k, {
- summary: `其他检查 · ${y.length} 项`,
+ children: /* @__PURE__ */ (0, P.jsx)(i, {
+ summary: `其他检查 · ${C.length} 项`,
contentClassName: "gap-5",
children: B.map(([e, t]) => {
- let n = y.filter(([e]) => t.some((t) => t === e));
+ let n = C.filter(([e]) => t.some((t) => t === e));
return n.length ? /* @__PURE__ */ (0, P.jsxs)("section", {
"aria-label": e,
"data-diagnostic-group": "",
@@ -327,7 +327,7 @@ function G(i) {
className: "text-caption-1-regular text-text-secondary",
children: [n.length, " 项"]
})]
- }), /* @__PURE__ */ (0, P.jsx)(c, { children: n.map(([e, t]) => /* @__PURE__ */ (0, P.jsx)(W, {
+ }), /* @__PURE__ */ (0, P.jsx)(f, { children: n.map(([e, t]) => /* @__PURE__ */ (0, P.jsx)(W, {
name: e,
check: t,
compact: !0
@@ -340,10 +340,10 @@ function G(i) {
"aria-label": "来源会话",
className: "flex min-w-0 flex-col gap-3",
children: [
- /* @__PURE__ */ (0, P.jsx)(t, { children: "来源会话" }),
- p.sources.map((e) => /* @__PURE__ */ (0, P.jsx)("article", {
+ /* @__PURE__ */ (0, P.jsx)(p, { children: "来源会话" }),
+ v.sources.map((e) => /* @__PURE__ */ (0, P.jsx)("article", {
"data-diagnostic-source": e.source,
- children: /* @__PURE__ */ (0, P.jsx)(c, { children: /* @__PURE__ */ (0, P.jsxs)(s, { children: [
+ children: /* @__PURE__ */ (0, P.jsx)(f, { children: /* @__PURE__ */ (0, P.jsxs)(m, { children: [
/* @__PURE__ */ (0, P.jsxs)("div", {
className: "flex flex-wrap items-center justify-between gap-2",
children: [/* @__PURE__ */ (0, P.jsxs)("h3", {
@@ -355,23 +355,23 @@ function G(i) {
text: e.reason,
className: "text-body-regular text-text-primary"
}),
- /* @__PURE__ */ (0, P.jsxs)(l, { children: [
- /* @__PURE__ */ (0, P.jsx)(O, {
+ /* @__PURE__ */ (0, P.jsxs)(s, { children: [
+ /* @__PURE__ */ (0, P.jsx)(o, {
term: "上次解析成功",
children: e.last_success_at ? V(e.last_success_at) : "尚无成功记录"
}),
- e.last_check_at ? /* @__PURE__ */ (0, P.jsxs)(O, {
+ e.last_check_at ? /* @__PURE__ */ (0, P.jsxs)(o, {
term: "上次检查",
children: [V(e.last_check_at), e.elapsed_s !== void 0 && e.elapsed_s !== null ? ` · ${e.elapsed_s.toFixed(2)} 秒` : ""]
}) : null,
- /* @__PURE__ */ (0, P.jsx)(O, {
+ /* @__PURE__ */ (0, P.jsx)(o, {
term: "暂停访问至",
children: e.cooldown_until ? V(e.cooldown_until) : "未暂停"
})
] })
] }) })
}, e.source)),
- /* @__PURE__ */ (0, P.jsx)("div", { children: /* @__PURE__ */ (0, P.jsx)(S, {
+ /* @__PURE__ */ (0, P.jsx)("div", { children: /* @__PURE__ */ (0, P.jsx)(t, {
size: "small",
variant: "secondary",
href: "/sources",
@@ -385,4 +385,4 @@ function G(i) {
//#endregion
export { G as DiagnosticsPage };
-//# debugId=155d273a-7626-4b0f-9396-3ab50cbeb9c8
\ No newline at end of file
+//# debugId=7758d390-dffc-4ab0-9994-26e45a337074
\ No newline at end of file
diff --git a/web/dist/peach-app.duplicates-page-DO3ps9hg.js b/web/dist/peach-app.duplicates-page-CoHPntSW.js
similarity index 55%
rename from web/dist/peach-app.duplicates-page-DO3ps9hg.js
rename to web/dist/peach-app.duplicates-page-CoHPntSW.js
index bef46b970..58925e14f 100644
--- a/web/dist/peach-app.duplicates-page-DO3ps9hg.js
+++ b/web/dist/peach-app.duplicates-page-CoHPntSW.js
@@ -1,21 +1,21 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7e1ca464-f0af-43d2-8afb-762fd9f399ee", e._sentryDebugIdIdentifier = "sentry-dbid-7e1ca464-f0af-43d2-8afb-762fd9f399ee");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e9524c2e-c088-4029-98fa-5058e1908bb7", e._sentryDebugIdIdentifier = "sentry-dbid-e9524c2e-c088-4029-98fa-5058e1908bb7");
} catch {}
})();
-import { Ci as e, Di as t, Ei as n, Fl as r, Gl as i, Il as a, Kl as o, Oi as s, Pl as c, Sc as l, Si as u, Tc as d, Ti as f, Va as p, Xl as m, Zl as h, au as g, bi as _, cu as v, fs as y, io as b, iu as x, ja as S, ki as C, ms as w, oo as T, pu as E, ro as D, so as O, un as k, uu as A, vn as j, vs as M, wi as N, xi as P, ya as F, yi as I } from "./peach-app.js";
+import { Button as e, CollectionSummary as t, DUPLICATES_KEY as n, EmptyState as r, FilterGlass as i, GlassPill as a, KEEP_LABELS as o, LOC as s, MEDIA_SOURCES_KEY as c, MEDIA_SOURCE_ICONS as l, Note as u, SourceLabel as d, SourceMark as f, TRASH_KEY as p, __toESM as m, batchOperate as h, bulkCloudPreferences as g, busyProps as _, cardClass as v, cloudLocations as y, confirmModal as b, distinctName as x, duplicateVictims as S, errorMessage as C, fetchDuplicates as w, fetchMediaSources as T, fmtDur as E, fmtSize as D, mixedCloudPreferences as O, queryClient as k, require_jsx_runtime as A, require_react as j, sharedNamePrefix as M, spriteGlyph as N, useMutation as P, useQuery as F, victimBytes as I } from "./peach-app.js";
//#region src/react/duplicates/duplicates-page.tsx
-var L = /* @__PURE__ */ E(A(), 1), R = v(), z = b("play"), B = b("file-stack"), V = p({
+var L = /* @__PURE__ */ m(j(), 1), R = A(), z = N("play"), B = N("file-stack"), V = v({
padding: "none",
radius: "surface",
className: "mb-6 overflow-hidden dark:bg-background-primary-default"
}), H = "rounded-sm px-1.5 py-px text-caption-1-regular leading-5", U = "rounded-sm px-2 py-0.5 text-caption-1-regular leading-5", W = "font-mono text-caption-1-regular leading-5 text-text-secondary", G = () => {
- a.invalidateQueries({
- queryKey: I,
+ k.invalidateQueries({
+ queryKey: n,
exact: !0
- }), a.invalidateQueries({
- queryKey: j,
+ }), k.invalidateQueries({
+ queryKey: p,
exact: !0
});
};
@@ -28,21 +28,21 @@ function K(e) {
children: e.evidence === "same_code_short_copy" ? "同番号短版本" : "时长推断"
});
}
-function q({ file: t, prefix: n, openItem: r }) {
- let i = () => r(t.id), a = o[t.location] || t.location || t.drive;
+function q({ file: e, prefix: t, openItem: n }) {
+ let r = () => n(e.id), i = s[e.location] || e.location || e.drive;
return /* @__PURE__ */ (0, R.jsxs)("div", {
className: "duplicate-row items-center gap-3 border-t border-separator-border px-5 py-4 max-compact:p-4",
children: [
/* @__PURE__ */ (0, R.jsxs)("button", {
type: "button",
- onClick: i,
- "aria-label": `预览 ${t.name}`,
+ onClick: r,
+ "aria-label": `预览 ${e.name}`,
className: "relative row-span-2 inline-grid aspect-16/10 w-full cursor-pointer place-items-center overflow-hidden rounded-2lg bg-background-tertiary-default text-text-secondary",
children: [/* @__PURE__ */ (0, R.jsx)(z, {
"aria-hidden": !0,
className: "size-6"
}), /* @__PURE__ */ (0, R.jsx)("img", {
- src: `/thumb?id=${t.id}&c=4`,
+ src: `/thumb?id=${e.id}&c=4`,
alt: "",
loading: "lazy",
onError: (e) => e.currentTarget.remove(),
@@ -53,18 +53,18 @@ function q({ file: t, prefix: n, openItem: r }) {
className: "flex min-w-0 items-center gap-2 max-duplicate-narrow:col-start-2 max-duplicate-narrow:-col-end-1",
children: [/* @__PURE__ */ (0, R.jsx)("button", {
type: "button",
- onClick: i,
- title: t.name,
+ onClick: r,
+ title: e.name,
"data-middle-truncate": !0,
"data-middle-truncate-within": !0,
className: "min-w-0 shrink cursor-pointer truncate text-left text-body-regular hover:text-text-secondary",
- children: e(t.name, n)
- }), t.is_largest || t.is_longest ? /* @__PURE__ */ (0, R.jsxs)("span", {
+ children: x(e.name, t)
+ }), e.is_largest || e.is_longest ? /* @__PURE__ */ (0, R.jsxs)("span", {
className: "flex flex-none gap-1",
- children: [t.is_largest ? /* @__PURE__ */ (0, R.jsx)("i", {
+ children: [e.is_largest ? /* @__PURE__ */ (0, R.jsx)("i", {
className: `${H} not-italic bg-background-primary-hover text-text-secondary`,
children: "最大"
- }) : null, t.is_longest ? /* @__PURE__ */ (0, R.jsx)("i", {
+ }) : null, e.is_longest ? /* @__PURE__ */ (0, R.jsx)("i", {
className: `${H} not-italic bg-(--keep)/22 text-(--keep)`,
children: "最长"
}) : null]
@@ -72,206 +72,206 @@ function q({ file: t, prefix: n, openItem: r }) {
}),
/* @__PURE__ */ (0, R.jsxs)("span", {
className: `${W} flex min-w-0 items-center gap-1.5`,
- children: [/* @__PURE__ */ (0, R.jsx)(S, { mark: d[t.location] || "database" }), /* @__PURE__ */ (0, R.jsx)("span", {
- title: a,
+ children: [/* @__PURE__ */ (0, R.jsx)(f, { mark: l[e.location] || "database" }), /* @__PURE__ */ (0, R.jsx)("span", {
+ title: i,
className: "min-w-0 truncate",
- children: a
+ children: i
})]
}),
/* @__PURE__ */ (0, R.jsx)("span", {
className: W,
- children: h(t.size || 0)
+ children: D(e.size || 0)
}),
/* @__PURE__ */ (0, R.jsx)("span", {
className: W,
- children: m(t.duration)
+ children: E(e.duration)
}),
/* @__PURE__ */ (0, R.jsx)("span", {
className: `${W} col-start-2 -col-end-1 min-w-0 pt-0.5 wrap-anywhere max-duplicate-narrow:col-span-full`,
- children: t.path ?? ""
+ children: e.path ?? ""
})
]
});
}
-function J({ openItem: e, toast: a, failure: d }) {
- let p = g({
- queryKey: I,
- queryFn: ({ signal: e }) => f(e)
- }), m = g({
+function J({ openItem: l, toast: f, failure: p }) {
+ let m = F({
+ queryKey: n,
+ queryFn: ({ signal: e }) => w(e)
+ }), v = F({
queryKey: c,
- queryFn: ({ signal: e }) => r(e)
- }), [v, b] = (0, L.useState)(""), S = x({
- mutationFn: (e) => P(e, "dispose"),
+ queryFn: ({ signal: e }) => T(e)
+ }), [x, E] = (0, L.useState)(""), k = P({
+ mutationFn: (e) => h(e, "dispose"),
onSuccess: (e, t) => {
- G(), a(`已把 ${t.length} 项移入回收站`, { undo: async () => {
+ G(), f(`已把 ${t.length} 项移入回收站`, { undo: async () => {
try {
- await P(t, "restore");
+ await h(t, "restore");
} catch (e) {
- d("撤销移入回收站", e);
+ p("撤销移入回收站", e);
} finally {
G();
}
} });
},
- onSettled: () => b("")
- }), E = p.data;
- if (!E) return /* @__PURE__ */ (0, R.jsx)("div", {
+ onSettled: () => E("")
+ }), A = m.data;
+ if (!A) return /* @__PURE__ */ (0, R.jsx)("div", {
className: "mx-auto w-full max-w-board",
- children: /* @__PURE__ */ (0, R.jsx)(O, {
+ children: /* @__PURE__ */ (0, R.jsx)(u, {
tone: "error",
title: "重复文件读取失败",
- children: p.error ? i(p.error) : "未取得重复文件列表,请刷新页面重试。"
+ children: m.error ? C(m.error) : "未取得重复文件列表,请刷新页面重试。"
})
});
- let A = E.groups ?? [], j = C(m.data), z = ({ groups: e, keep: t, key: n }) => {
- if (S.isPending) return;
- let r = N(e, t);
- r.length && l({
+ let j = A.groups ?? [], N = y(v.data), z = ({ groups: e, keep: t, key: n }) => {
+ if (k.isPending) return;
+ let r = S(e, t);
+ r.length && b({
title: "移入回收站",
- body: `将把 ${r.length} 个重复文件的馆藏记录移入回收站,每组保留${_[t] ?? _.largest}。文件共 ${h(s(e, r))},记录可从回收站还原。`,
+ body: `将把 ${r.length} 个重复文件的馆藏记录移入回收站,每组保留${o[t] ?? o.largest}。文件共 ${D(I(e, r))},记录可从回收站还原。`,
confirmLabel: "移入回收站",
- onConfirm: () => (b(n), S.mutateAsync(r))
+ onConfirm: () => (E(n), k.mutateAsync(r))
});
- }, H = (e) => D(v === e && S.isPending);
+ }, H = (e) => _(x === e && k.isPending);
return /* @__PURE__ */ (0, R.jsxs)("div", {
className: "mx-auto w-full max-w-board pb-10.5",
children: [
- /* @__PURE__ */ (0, R.jsx)(k, {
+ /* @__PURE__ */ (0, R.jsx)(t, {
label: "重复内容",
- figure: `${Number(E.total || 0).toLocaleString()} 组`,
- detail: `${Number(E.files || 0).toLocaleString()} 个文件 · 可回收 ${h(E.reclaimable)}`
+ figure: `${Number(A.total || 0).toLocaleString()} 组`,
+ detail: `${Number(A.files || 0).toLocaleString()} 个文件 · 可回收 ${D(A.reclaimable)}`
}),
- A.length ? /* @__PURE__ */ (0, R.jsxs)(w, {
+ j.length ? /* @__PURE__ */ (0, R.jsxs)(i, {
title: "批量保留",
children: [
- /* @__PURE__ */ (0, R.jsx)(M, {
- busy: v === "all:largest",
+ /* @__PURE__ */ (0, R.jsx)(a, {
+ busy: x === "all:largest",
onPress: () => z({
- groups: A,
+ groups: j,
keep: "largest",
key: "all:largest"
}),
children: "全部保留最大"
}),
- /* @__PURE__ */ (0, R.jsx)(M, {
- busy: v === "all:longest",
+ /* @__PURE__ */ (0, R.jsx)(a, {
+ busy: x === "all:longest",
onPress: () => z({
- groups: A,
+ groups: j,
keep: "longest",
key: "all:longest"
}),
children: "全部保留最长"
}),
- u(A, j).map((e) => /* @__PURE__ */ (0, R.jsx)(M, {
- busy: v === `all:${e}`,
+ g(j, N).map((e) => /* @__PURE__ */ (0, R.jsx)(a, {
+ busy: x === `all:${e}`,
onPress: () => z({
- groups: A,
+ groups: j,
keep: e,
key: `all:${e}`
}),
- children: /* @__PURE__ */ (0, R.jsx)(F, {
+ children: /* @__PURE__ */ (0, R.jsx)(d, {
source: e,
- label: `全部优先 ${o[e] || e}`
+ label: `全部优先 ${s[e] || e}`
})
}, e))
]
}) : null,
- S.isError ? /* @__PURE__ */ (0, R.jsx)("div", {
+ k.isError ? /* @__PURE__ */ (0, R.jsx)("div", {
className: "mb-5",
- children: /* @__PURE__ */ (0, R.jsx)(O, {
+ children: /* @__PURE__ */ (0, R.jsx)(u, {
tone: "error",
title: "移入回收站失败",
- children: i(S.error)
+ children: C(k.error)
})
}) : null,
- A.length ? A.map((r, i) => {
- let a = [r], s = t(r.files.map((e) => e.name)), c = (e) => `${i}:${e}`;
+ j.length ? j.map((t, n) => {
+ let r = [t], i = M(t.files.map((e) => e.name)), a = (e) => `${n}:${e}`;
return /* @__PURE__ */ (0, R.jsxs)("section", {
- "aria-label": r.code,
+ "aria-label": t.code,
className: V,
children: [/* @__PURE__ */ (0, R.jsxs)("div", {
className: "flex flex-wrap items-center gap-3 bg-background-tertiary-default p-5 max-compact:p-4 dark:bg-background-secondary-default",
children: [
/* @__PURE__ */ (0, R.jsx)("b", {
className: "text-title-2-medium text-text-primary",
- children: r.code
+ children: t.code
}),
/* @__PURE__ */ (0, R.jsx)("span", {
className: "font-mono text-caption-1-regular leading-5 text-text-primary",
- children: `${Number(r.count || 0).toLocaleString()} 个 · 可回收 ${h(r.reclaimable)}`
+ children: `${Number(t.count || 0).toLocaleString()} 个 · 可回收 ${D(t.reclaimable)}`
}),
- K(r),
- r.cross_drive ? /* @__PURE__ */ (0, R.jsx)("span", {
+ K(t),
+ t.cross_drive ? /* @__PURE__ */ (0, R.jsx)("span", {
className: `${U} text-text-secondary`,
- children: `跨盘 ${r.drives.join(" ")}`
+ children: `跨盘 ${t.drives.join(" ")}`
}) : null,
/* @__PURE__ */ (0, R.jsxs)("span", {
className: "ml-auto flex flex-wrap gap-2 max-compact:ml-0 max-compact:w-full",
children: [
- /* @__PURE__ */ (0, R.jsx)(y, {
+ /* @__PURE__ */ (0, R.jsx)(e, {
variant: "secondary",
size: "small",
- ...H(c("largest")),
+ ...H(a("largest")),
onClick: () => z({
- groups: a,
+ groups: r,
keep: "largest",
- key: c("largest")
+ key: a("largest")
}),
children: "留最大"
}),
- /* @__PURE__ */ (0, R.jsx)(y, {
+ /* @__PURE__ */ (0, R.jsx)(e, {
variant: "secondary",
size: "small",
- ...H(c("longest")),
+ ...H(a("longest")),
onClick: () => z({
- groups: a,
+ groups: r,
keep: "longest",
- key: c("longest")
+ key: a("longest")
}),
children: "留最长"
}),
- n(r.files, j).map((e) => /* @__PURE__ */ (0, R.jsx)(y, {
+ O(t.files, N).map((t) => /* @__PURE__ */ (0, R.jsx)(e, {
variant: "secondary",
size: "small",
- ...H(c(e)),
+ ...H(a(t)),
onClick: () => z({
- groups: a,
- keep: e,
- key: c(e)
+ groups: r,
+ keep: t,
+ key: a(t)
}),
- children: /* @__PURE__ */ (0, R.jsx)(F, {
- source: e,
- label: `留 ${o[e] || e}`
+ children: /* @__PURE__ */ (0, R.jsx)(d, {
+ source: t,
+ label: `留 ${s[t] || t}`
})
- }, e)),
- /* @__PURE__ */ (0, R.jsx)(y, {
+ }, t)),
+ /* @__PURE__ */ (0, R.jsx)(e, {
variant: "danger",
size: "small",
- ...H(c("all")),
+ ...H(a("all")),
onClick: () => z({
- groups: a,
+ groups: r,
keep: "all",
- key: c("all")
+ key: a("all")
}),
children: "整组回收"
})
]
})
]
- }), /* @__PURE__ */ (0, R.jsx)("div", { children: r.files.map((t) => /* @__PURE__ */ (0, R.jsx)(q, {
- file: t,
- prefix: s,
- openItem: e
- }, t.id)) })]
- }, `${r.code}-${i}`);
- }) : /* @__PURE__ */ (0, R.jsx)(T, {
+ }), /* @__PURE__ */ (0, R.jsx)("div", { children: t.files.map((e) => /* @__PURE__ */ (0, R.jsx)(q, {
+ file: e,
+ prefix: i,
+ openItem: l
+ }, e.id)) })]
+ }, `${t.code}-${n}`);
+ }) : /* @__PURE__ */ (0, R.jsx)(r, {
icon: B,
title: "没有找到重复文件",
children: "所有来源之间没有检测到内容相同的文件。扫描新来源后,这里会自动更新。"
}),
- A.length > 0 && E.total > A.length ? /* @__PURE__ */ (0, R.jsx)("p", {
+ j.length > 0 && A.total > j.length ? /* @__PURE__ */ (0, R.jsx)("p", {
className: "text-center text-caption-1-regular text-text-secondary",
- children: `显示可回收最多的前 ${A.length.toLocaleString()} 组,共 ${Number(E.total).toLocaleString()} 组;处理掉这些后,其余的会补上来。`
+ children: `显示可回收最多的前 ${j.length.toLocaleString()} 组,共 ${Number(A.total).toLocaleString()} 组;处理掉这些后,其余的会补上来。`
}) : null
]
});
@@ -279,4 +279,4 @@ function J({ openItem: e, toast: a, failure: d }) {
//#endregion
export { J as DuplicatesPage };
-//# debugId=7e1ca464-f0af-43d2-8afb-762fd9f399ee
\ No newline at end of file
+//# debugId=e9524c2e-c088-4029-98fa-5058e1908bb7
\ No newline at end of file
diff --git a/web/dist/peach-app.error-excerpt-5tEehQuQ.js b/web/dist/peach-app.error-excerpt-GIDhsLJp.js
similarity index 59%
rename from web/dist/peach-app.error-excerpt-5tEehQuQ.js
rename to web/dist/peach-app.error-excerpt-GIDhsLJp.js
index dd5d00da0..f727e1146 100644
--- a/web/dist/peach-app.error-excerpt-5tEehQuQ.js
+++ b/web/dist/peach-app.error-excerpt-GIDhsLJp.js
@@ -1,27 +1,27 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "8650f95b-cc6b-434f-8052-2a2b3e310c2c", e._sentryDebugIdIdentifier = "sentry-dbid-8650f95b-cc6b-434f-8052-2a2b3e310c2c");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "144295ae-2a64-43c4-9bec-6cf5c77a21d1", e._sentryDebugIdIdentifier = "sentry-dbid-144295ae-2a64-43c4-9bec-6cf5c77a21d1");
} catch {}
})();
-import { Rs as e, Va as t, Ya as n, cu as r, fs as i, pu as a, uu as o } from "./peach-app.js";
+import { Button as e, __toESM as t, cardClass as n, readableErrorHeadline as r, require_jsx_runtime as i, require_react as a, useOverlayScrollbar as o } from "./peach-app.js";
//#region src/react/activity/error-excerpt.tsx
-var s = /* @__PURE__ */ a(o(), 1), c = r();
-function l({ children: e, label: r, id: i }) {
- let a = n();
+var s = /* @__PURE__ */ t(a(), 1), c = i();
+function l({ children: e, label: t, id: r }) {
+ let i = o();
return /* @__PURE__ */ (0, c.jsx)("div", {
"data-error-details": "",
- className: t({
+ className: n({
bordered: "soft",
radius: "surface",
padding: "none",
className: "relative w-full min-w-0 overflow-hidden bg-background-tertiary-default"
}),
children: /* @__PURE__ */ (0, c.jsx)("div", {
- ref: a,
- id: i,
+ ref: i,
+ id: r,
role: "region",
- "aria-label": r,
+ "aria-label": t,
tabIndex: 0,
className: "max-h-80 overflow-y-auto overscroll-contain p-3 text-body-2-regular whitespace-pre-line wrap-anywhere text-text-primary",
children: e
@@ -29,32 +29,32 @@ function l({ children: e, label: r, id: i }) {
});
}
function u({ text: t, className: n = "" }) {
- let [r, a] = (0, s.useState)(!1), o = (0, s.useId)(), u = String(t || "").trim(), d = e(u);
+ let [i, a] = (0, s.useState)(!1), o = (0, s.useId)(), u = String(t || "").trim(), d = r(u);
if (!d) return null;
let f = d !== u;
return /* @__PURE__ */ (0, c.jsxs)("div", {
"data-error-excerpt": "",
className: `flex min-w-0 max-w-full flex-col items-start gap-1 ${n}`,
- children: [r ? /* @__PURE__ */ (0, c.jsx)(l, {
+ children: [i ? /* @__PURE__ */ (0, c.jsx)(l, {
id: o,
label: "完整错误详情",
children: u
}) : /* @__PURE__ */ (0, c.jsx)("p", {
className: "w-full wrap-anywhere",
children: d
- }), f ? /* @__PURE__ */ (0, c.jsx)(i, {
+ }), f ? /* @__PURE__ */ (0, c.jsx)(e, {
variant: "ghost",
size: "small",
"data-error-details-toggle": "",
className: "-ml-2",
- "aria-expanded": r,
- "aria-controls": r ? o : void 0,
- onClick: () => a(!r),
- children: r ? "收起详情" : "查看详情"
+ "aria-expanded": i,
+ "aria-controls": i ? o : void 0,
+ onClick: () => a(!i),
+ children: i ? "收起详情" : "查看详情"
}) : null]
});
}
//#endregion
-export { u as n, l as t };
+export { l as ErrorDetails, u as ErrorExcerpt };
-//# debugId=8650f95b-cc6b-434f-8052-2a2b3e310c2c
\ No newline at end of file
+//# debugId=144295ae-2a64-43c4-9bec-6cf5c77a21d1
\ No newline at end of file
diff --git a/web/dist/peach-app.expandable-ranking-BW8Gp_lx.js b/web/dist/peach-app.expandable-ranking-CyDn34Ar.js
similarity index 96%
rename from web/dist/peach-app.expandable-ranking-BW8Gp_lx.js
rename to web/dist/peach-app.expandable-ranking-CyDn34Ar.js
index c3db40c93..f22caa0f1 100644
--- a/web/dist/peach-app.expandable-ranking-BW8Gp_lx.js
+++ b/web/dist/peach-app.expandable-ranking-CyDn34Ar.js
@@ -1,26 +1,26 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "ca720218-6459-44ae-b9ac-b08a5aaedf22", e._sentryDebugIdIdentifier = "sentry-dbid-ca720218-6459-44ae-b9ac-b08a5aaedf22");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "1d145860-18b0-4d5f-a44a-69dd60a675da", e._sentryDebugIdIdentifier = "sentry-dbid-1d145860-18b0-4d5f-a44a-69dd60a675da");
} catch {}
})();
-import { E as e, Ro as t, T as n, Us as r, Va as i, _c as a, ac as o, bc as s, cc as c, cu as l, dc as u, du as d, fc as f, fu as p, gc as m, hc as h, ic as g, lc as _, lu as v, mc as y, oc as b, pc as x, pu as S, rc as C, sc as w, ta as T, uc as E, uu as D, vc as O, yc as k } from "./peach-app.js";
+import { MotionConfigContext as e, WithPromise as t, __commonJSMin as n, __exportAll as r, __toESM as i, asNumber as a, calcGeneratorVelocity as o, cancelFrame as s, cardClass as c, clsx as l, collectMotionValues as u, cx as d, f1 as f, frame as p, interpolate as m, isMotionValue as h, max as g, min as _, motion as v, motionValue as y, require_jsx_runtime as b, require_react as x, require_react_dom as S, require_with_selector as C, resolveStartTime as w, spring as T, time as E, useConstant as D, useIsomorphicLayoutEffect as O, useReducedMotion as k } from "./peach-app.js";
//#region node_modules/motion-dom/dist/es/utils/transform.mjs
function A(...e) {
- let t = !Array.isArray(e[0]), n = t ? 0 : -1, r = e[0 + n], i = e[1 + n], a = e[2 + n], o = e[3 + n], s = y(i, a, o);
+ let t = !Array.isArray(e[0]), n = t ? 0 : -1, r = e[0 + n], i = e[1 + n], a = e[2 + n], o = e[3 + n], s = m(i, a, o);
return t ? s(r) : s;
}
//#endregion
//#region node_modules/motion-dom/dist/es/animation/FollowAnimation.mjs
var j = /* @__PURE__ */ new Set(), M = ({ timestamp: e }) => {
j.forEach((t) => t.tick(e));
-}, N = class extends u {
+}, N = class extends t {
constructor(e) {
super(), this.state = "idle", this.startTime = 0, this.currentTime = 0, this.started = !1, this.hasNextTarget = !1, this.nextTarget = 0, this.stop = () => {
this.state !== "idle" && (this.teardown(), this.options.onStop?.());
}, this.options = e, this.factory = e.type, this.generator = this.factory(e);
let { driver: t } = e;
- t && (this.driver = t((e) => this.tick(e))), this.startTime = this.now(), this.state = "running", this.driver ? this.driver.start() : (j.size || a.update(M, !0), j.add(this));
+ t && (this.driver = t((e) => this.tick(e))), this.startTime = this.now(), this.state = "running", this.driver ? this.driver.start() : (j.size || p.update(M, !0), j.add(this));
}
setTarget(e, t) {
this.nextTarget = e, this.nextVelocity = t, this.hasNextTarget = !0;
@@ -31,7 +31,7 @@ var j = /* @__PURE__ */ new Set(), M = ({ timestamp: e }) => {
}
tick(e) {
let { options: t, hasNextTarget: n } = this, { delay: r = 0, onUpdate: i, onPlay: a } = t;
- this.started || (this.startTime = f(this.startTime, e));
+ this.started || (this.startTime = w(this.startTime, e));
let o = Math.round(e - this.startTime) - r, s = this.currentTime = Math.max(0, o), c = this.generator.next(s), l = o < 0 ? t.keyframes[0] : c.value;
if (n) {
this.hasNextTarget = !1;
@@ -41,50 +41,50 @@ var j = /* @__PURE__ */ new Set(), M = ({ timestamp: e }) => {
(n || !this.started) && (this.started = !0, a?.()), this.state === "running" && (i?.(l), c.done && o >= 0 && !n && !this.hasNextTarget && this.state === "running" && (this.notifyFinished(), this.teardown(), this.state = "finished", t.onComplete?.()));
}
getGeneratorVelocity() {
- return x(this.generator, this.currentTime, this.options.velocity);
+ return o(this.generator, this.currentTime, this.options.velocity);
}
now() {
- return this.driver ? this.driver.now() : O.now();
+ return this.driver ? this.driver.now() : E.now();
}
teardown() {
- this.state = "idle", this.driver ? this.driver.stop() : (j.delete(this), j.size || m(M));
+ this.state = "idle", this.driver ? this.driver.stop() : (j.delete(this), j.size || s(M));
}
};
//#endregion
//#region node_modules/motion-dom/dist/es/value/utils/follow.mjs
function ee(e, t, n) {
- let r = e.get(), i = null, a, o = typeof r == "string" ? r.replace(/[\d.-]/g, "") : void 0, s = (e) => a(o ? e + o : e), l = () => e.events.animationStart?.notify(), u = () => {
+ let r = e.get(), i = null, o, s = typeof r == "string" ? r.replace(/[\d.-]/g, "") : void 0, c = (e) => o(s ? e + s : e), l = () => e.events.animationStart?.notify(), u = () => {
i &&= (i.stop(), null), e.animation = void 0;
};
if (e.attach((t, r) => {
- a = r;
- let o = w(t);
+ o = r;
+ let s = a(t);
if (i?.state === "running") {
- i.setTarget(o, n.velocity);
+ i.setTarget(s, n.velocity);
return;
}
- let c = w(e.get()), d = i ? i.getGeneratorVelocity() : e.getVelocity();
- if (u(), c === o) return;
- let f = i = new N({
- keyframes: [c, o],
- velocity: d,
+ let d = a(e.get()), f = i ? i.getGeneratorVelocity() : e.getVelocity();
+ if (u(), d === s) return;
+ let p = i = new N({
+ keyframes: [d, s],
+ velocity: f,
restDelta: .001,
restSpeed: .01,
...n,
- onUpdate: s,
+ onUpdate: c,
onPlay: l
});
- e.animation = f, f.then(() => {
- i === f && (i = null, e.animation = void 0, e.events.animationComplete?.notify());
+ e.animation = p, p.then(() => {
+ i === p && (i = null, e.animation = void 0, e.events.animationComplete?.notify());
});
- }, u), c(t)) {
+ }, u), h(t)) {
let r = n.skipInitialAnimation === !0, i = (t) => {
- r ? (r = !1, e.jump(te(t, o), !1)) : e.set(te(t, o));
- }, a = t.on("change", i), s = t.get();
- w(s) - w(e.get()) && i(s);
- let c = e.on("destroy", a);
+ r ? (r = !1, e.jump(te(t, s), !1)) : e.set(te(t, s));
+ }, o = t.on("change", i), c = t.get();
+ a(c) - a(e.get()) && i(c);
+ let l = e.on("destroy", o);
return () => {
- a(), c(), u();
+ o(), l(), u();
};
}
return u;
@@ -97,12 +97,12 @@ function te(e, t) {
function ne(e, t, n) {
return ee(e, t, {
...n,
- type: h
+ type: T
});
}
//#endregion
//#region node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs
-var P = /* @__PURE__ */ S(D(), 1);
+var P = /* @__PURE__ */ i(x(), 1);
function re(e, t, n) {
(0, P.useInsertionEffect)(() => e.on(t, n), [
e,
@@ -112,31 +112,31 @@ function re(e, t, n) {
}
//#endregion
//#region node_modules/framer-motion/dist/es/value/use-motion-value.mjs
-function ie(e) {
- let t = s(() => E(e)), { isStatic: n } = (0, P.useContext)(b);
- if (n) {
- let [, n] = (0, P.useState)(e);
- (0, P.useEffect)(() => t.on("change", n), []);
+function ie(t) {
+ let n = D(() => y(t)), { isStatic: r } = (0, P.useContext)(e);
+ if (r) {
+ let [, e] = (0, P.useState)(t);
+ (0, P.useEffect)(() => n.on("change", e), []);
}
- return t;
+ return n;
}
//#endregion
//#region node_modules/framer-motion/dist/es/value/use-combine-values.mjs
function ae(e, t) {
let n = ie(t()), r = () => n.set(t());
- return r(), k(() => {
- let t = () => a.preRender(r, !1, !0), n = e.map((e) => e.on("change", t));
+ return r(), O(() => {
+ let t = () => p.preRender(r, !1, !0), n = e.map((e) => e.on("change", t));
return r(), () => {
- n.forEach((e) => e()), m(r);
+ n.forEach((e) => e()), s(r);
};
}), n;
}
//#endregion
//#region node_modules/framer-motion/dist/es/value/use-computed.mjs
function oe(e) {
- _.current = [], e();
- let t = ae(_.current, e);
- return _.current = void 0, t;
+ u.current = [], e();
+ let t = ae(u.current, e);
+ return u.current = void 0, t;
}
//#endregion
//#region node_modules/framer-motion/dist/es/value/use-transform.mjs
@@ -165,7 +165,7 @@ function se(e, t, n, r) {
return a;
}
function ce(e, t) {
- let n = s(() => []);
+ let n = D(() => []);
return ae(e, () => {
n.length = 0;
let r = e.length;
@@ -174,17 +174,17 @@ function ce(e, t) {
});
}
function le(e, t, n, r) {
- let i = s(() => Object.keys(n)), a = s(() => ({}));
+ let i = D(() => Object.keys(n)), a = D(() => ({}));
for (let o of i) a[o] = se(e, t, n[o], r);
return a;
}
//#endregion
//#region node_modules/framer-motion/dist/es/value/use-follow-value.mjs
-function ue(e, t, n) {
- let { isStatic: r } = (0, P.useContext)(b), i = () => c(e) ? e.get() : e;
- if (r) return se(i);
- let a = ie(i());
- return (0, P.useInsertionEffect)(() => n(a, e, t), [a, JSON.stringify(t)]), a;
+function ue(t, n, r) {
+ let { isStatic: i } = (0, P.useContext)(e), a = () => h(t) ? t.get() : t;
+ if (i) return se(a);
+ let o = ie(a());
+ return (0, P.useInsertionEffect)(() => r(o, t, n), [o, JSON.stringify(n)]), o;
}
//#endregion
//#region node_modules/framer-motion/dist/es/value/use-spring.mjs
@@ -330,12 +330,12 @@ function je(e, t, n) {
}
//#endregion
//#region node_modules/d3-array/src/quantile.js
-function Me(t, r, i) {
- if (t = Float64Array.from(ge(t, i)), a = t.length) {
- if ((r = +r) <= 0 || a < 2) return n(t);
- if (r >= 1) return e(t);
- var a, o = (a - 1) * r, s = Math.floor(o), c = e(Ae(t, s).subarray(0, s + 1));
- return c + (n(t.subarray(s + 1)) - c) * (o - s);
+function Me(e, t, n) {
+ if (e = Float64Array.from(ge(e, n)), r = e.length) {
+ if ((t = +t) <= 0 || r < 2) return _(e);
+ if (t >= 1) return g(e);
+ var r, i = (r - 1) * t, a = Math.floor(i), o = g(Ae(e, a).subarray(0, a + 1));
+ return o + (_(e.subarray(a + 1)) - o) * (i - a);
}
}
function Ne(e, t, n = he) {
@@ -355,7 +355,7 @@ function Pe(e, t, n) {
}
//#endregion
//#region node_modules/recharts/es6/util/excludeEventProps.js
-var Fe = /* @__PURE__ */ S(v()), Ie = /* @__PURE__ */ "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".split(".");
+var Fe = /* @__PURE__ */ i(S()), Ie = /* @__PURE__ */ "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".split(".");
function Le(e) {
return typeof e == "string" && Ie.includes(e);
}
@@ -432,21 +432,21 @@ function Je(e, t) {
return n;
}
var Ye = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
- var n = e.children, r = e.width, i = e.height, a = e.viewBox, o = e.className, s = e.style, c = e.title, l = e.desc, u = qe(e, Ge), d = a || {
+ var n = e.children, r = e.width, i = e.height, a = e.viewBox, o = e.className, s = e.style, c = e.title, u = e.desc, d = qe(e, Ge), f = a || {
width: r,
height: i,
x: 0,
y: 0
- }, f = C("recharts-surface", o);
- return /*#__PURE__*/ P.createElement("svg", Ke({}, Ue(u), {
- className: f,
+ }, p = l("recharts-surface", o);
+ return /*#__PURE__*/ P.createElement("svg", Ke({}, Ue(d), {
+ className: p,
width: r,
height: i,
style: s,
- viewBox: `${d.x} ${d.y} ${d.width} ${d.height}`,
+ viewBox: `${f.x} ${f.y} ${f.width} ${f.height}`,
ref: t
- }), /*#__PURE__*/ P.createElement("title", null, c), /*#__PURE__*/ P.createElement("desc", null, l), n);
-}), Xe = T(), Ze = ["children", "className"];
+ }), /*#__PURE__*/ P.createElement("title", null, c), /*#__PURE__*/ P.createElement("desc", null, u), n);
+}), Xe = C(), Ze = ["children", "className"];
function Qe() {
return Qe = Object.assign ? Object.assign.bind() : function(e) {
for (var t = 1; t < arguments.length; t++) {
@@ -475,7 +475,7 @@ function et(e, t) {
return n;
}
var F = /*#__PURE__*/ P.forwardRef((e, t) => {
- var n = e.children, r = e.className, i = $e(e, Ze), a = C("recharts-layer", r);
+ var n = e.children, r = e.className, i = $e(e, Ze), a = l("recharts-layer", r);
return /*#__PURE__*/ P.createElement("g", Qe({ className: a }, Ue(i), { ref: t }), n);
});
//#endregion
@@ -1565,14 +1565,14 @@ var hr = {
sizeType: o
}), c = "circle";
typeof n == "string" && (c = n);
- var l = () => {
+ var u = () => {
var e = _r(c), t = Tn().type(e).size(vr(i, o, c))();
if (t !== null) return t;
- }, u = s.className, d = s.cx, f = s.cy, p = Ue(s);
- return I(d) && I(f) && I(i) ? /*#__PURE__*/ P.createElement("path", sr({}, p, {
- className: C("recharts-symbols", u),
- transform: `translate(${d}, ${f})`,
- d: l()
+ }, d = s.className, f = s.cx, p = s.cy, m = Ue(s);
+ return I(f) && I(p) && I(i) ? /*#__PURE__*/ P.createElement("path", sr({}, m, {
+ className: l("recharts-symbols", d),
+ transform: `translate(${f}, ${p})`,
+ d: u()
})) : null;
};
br.registerSymbol = yr;
@@ -1757,34 +1757,34 @@ function Vr(e) {
y: 0,
width: Lr,
height: Lr
- }, l = {
+ }, u = {
display: r === "horizontal" ? "inline-block" : "block",
marginRight: 10,
whiteSpace: "nowrap"
- }, u = {
+ }, d = {
display: "inline-block",
verticalAlign: "middle",
marginRight: 4
};
return t.map((t, r) => {
- var d = t.formatter || i, f = C({
+ var f = t.formatter || i, p = l({
"recharts-legend-item": !0,
[`legend-item-${r}`]: !0,
inactive: t.inactive
});
if (t.type === "none") return null;
- var p = typeof s == "object" ? Nr({}, s) : {};
- p.color = t.inactive ? a : p.color || t.color, p.whiteSpace ??= "normal", p.overflowWrap ??= "break-word";
- var m = d ? d(t.value, t, r) : t.value;
+ var m = typeof s == "object" ? Nr({}, s) : {};
+ m.color = t.inactive ? a : m.color || t.color, m.whiteSpace ??= "normal", m.overflowWrap ??= "break-word";
+ var h = f ? f(t.value, t, r) : t.value;
return /*#__PURE__*/ P.createElement("li", jr({
- className: f,
- style: l,
+ className: p,
+ style: u,
key: `legend-item-${r}`
}, wr(e, t, r)), /*#__PURE__*/ P.createElement(Ye, {
width: n,
height: n,
viewBox: c,
- style: u,
+ style: d,
"aria-label": t.value == null ? "legend icon" : `${t.value} legend icon`
}, /*#__PURE__*/ P.createElement(Br, {
data: t,
@@ -1792,8 +1792,8 @@ function Vr(e) {
inactiveColor: a
})), /*#__PURE__*/ P.createElement("span", {
className: "recharts-legend-item-text",
- style: p
- }, m));
+ style: m
+ }, h));
});
}
var Hr = (e) => {
@@ -4180,12 +4180,12 @@ function pu(e) {
return fu(i) ? /*#__PURE__*/ P.createElement(du.Provider, { value: i }, t) : null;
}
var mu = () => (0, P.useContext)(du), hu = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
- var n = e.aspect, r = e.initialDimension, i = r === void 0 ? Hl.initialDimension : r, a = e.width, o = e.height, s = e.minWidth, c = s === void 0 ? Hl.minWidth : s, l = e.minHeight, u = e.maxHeight, d = e.children, f = e.debounce, p = f === void 0 ? Hl.debounce : f, m = e.id, h = e.className, g = e.onResize, _ = e.style, v = _ === void 0 ? {} : _, y = lu(e, Xl), b = (0, P.useRef)(null), x = (0, P.useRef)();
- x.current = g, (0, P.useImperativeHandle)(t, () => b.current);
- var S = ru((0, P.useState)({
+ var n = e.aspect, r = e.initialDimension, i = r === void 0 ? Hl.initialDimension : r, a = e.width, o = e.height, s = e.minWidth, c = s === void 0 ? Hl.minWidth : s, u = e.minHeight, d = e.maxHeight, f = e.children, p = e.debounce, m = p === void 0 ? Hl.debounce : p, h = e.id, g = e.className, _ = e.onResize, v = e.style, y = v === void 0 ? {} : v, b = lu(e, Xl), x = (0, P.useRef)(null), S = (0, P.useRef)();
+ S.current = _, (0, P.useImperativeHandle)(t, () => x.current);
+ var C = ru((0, P.useState)({
containerWidth: i.width,
containerHeight: i.height
- }), 2), w = S[0], T = S[1], E = (0, P.useCallback)((e, t) => {
+ }), 2), w = C[0], T = C[1], E = (0, P.useCallback)((e, t) => {
T((n) => {
var r = Math.round(e), i = Math.round(t);
return n.containerWidth === r && n.containerHeight === i ? n : {
@@ -4195,49 +4195,49 @@ var mu = () => (0, P.useContext)(du), hu = /*#__PURE__*/ (0, P.forwardRef)((e, t
});
}, []);
(0, P.useEffect)(() => {
- if (b.current == null || typeof ResizeObserver > "u") return Tt;
+ if (x.current == null || typeof ResizeObserver > "u") return Tt;
var e = (e) => {
var t, n = e[0];
if (n != null) {
var r = n.contentRect, i = r.width, a = r.height;
- E(i, a), (t = x.current) == null || t.call(x, i, a);
+ E(i, a), (t = S.current) == null || t.call(S, i, a);
}
};
- p > 0 && (e = Bl(e, p, {
+ m > 0 && (e = Bl(e, m, {
trailing: !0,
leading: !1
}));
- var t = new ResizeObserver(e), n = b.current.getBoundingClientRect(), r = n.width, i = n.height;
- return E(r, i), t.observe(b.current), () => {
+ var t = new ResizeObserver(e), n = x.current.getBoundingClientRect(), r = n.width, i = n.height;
+ return E(r, i), t.observe(x.current), () => {
t.disconnect();
};
- }, [E, p]);
+ }, [E, m]);
var D = w.containerWidth, O = w.containerHeight;
Vl(!n || n > 0, "The aspect(%s) must be greater than zero.", n);
var k = Ul(D, O, {
width: a,
height: o,
aspect: n,
- maxHeight: u
+ maxHeight: d
}), A = k.calculatedWidth, j = k.calculatedHeight;
- return Vl(D < 0 || O < 0 || A != null && A > 0 || j != null && j > 0, "The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.", A, j, a, o, c, l, n), /*#__PURE__*/ P.createElement("div", Zl({
- id: m ? `${m}` : void 0,
- className: C("recharts-responsive-container", h),
- style: $l($l({}, v), {}, {
+ return Vl(D < 0 || O < 0 || A != null && A > 0 || j != null && j > 0, "The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.", A, j, a, o, c, u, n), /*#__PURE__*/ P.createElement("div", Zl({
+ id: h ? `${h}` : void 0,
+ className: l("recharts-responsive-container", g),
+ style: $l($l({}, y), {}, {
width: a,
height: o,
minWidth: c,
- minHeight: l,
- maxHeight: u
+ minHeight: u,
+ maxHeight: d
}),
- ref: b
- }, y), /*#__PURE__*/ P.createElement("div", { style: Jl({
+ ref: x
+ }, b), /*#__PURE__*/ P.createElement("div", { style: Jl({
width: a,
height: o
}) }, /*#__PURE__*/ P.createElement(pu, {
width: A,
height: j
- }, d)));
+ }, f)));
}), gu = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
var n = mu();
if (Vc(n.width) && Vc(n.height)) return e.children;
@@ -4339,11 +4339,11 @@ var mu = () => (0, P.useContext)(du), hu = /*#__PURE__*/ (0, P.forwardRef)((e, t
prepare: W()
}
}
-}), Au = ku.actions, ju = Au.setLegendSize, Mu = Au.setLegendSettings, Nu = Au.addLegendPayload, Pu = Au.replaceLegendPayload, Fu = Au.removeLegendPayload, Iu = ku.reducer, Lu = /* @__PURE__ */ d(((e) => {
- var t = D();
+}), Au = ku.actions, ju = Au.setLegendSize, Mu = Au.setLegendSettings, Nu = Au.addLegendPayload, Pu = Au.replaceLegendPayload, Fu = Au.removeLegendPayload, Iu = ku.reducer, Lu = /* @__PURE__ */ n(((e) => {
+ var t = x();
t.useSyncExternalStore, t.useRef, t.useEffect, t.useMemo, t.useDebugValue;
}));
-(/* @__PURE__ */ d(((e, t) => {
+(/* @__PURE__ */ n(((e, t) => {
t.exports = Lu();
})))();
function Ru(e) {
@@ -4874,12 +4874,12 @@ function Gd(e, t) {
return t == null ? e : Ta(e, t);
}
var Kd = (e) => {
- var t = e.separator, n = t === void 0 ? Wd.separator : t, r = e.contentStyle, i = e.itemStyle, a = e.labelStyle, o = a === void 0 ? Wd.labelStyle : a, s = e.payload, c = e.formatter, l = e.itemSorter, u = e.wrapperClassName, d = e.labelClassName, f = e.label, p = e.labelFormatter, m = e.accessibilityLayer, h = m === void 0 ? Wd.accessibilityLayer : m, g = () => {
+ var t = e.separator, n = t === void 0 ? Wd.separator : t, r = e.contentStyle, i = e.itemStyle, a = e.labelStyle, o = a === void 0 ? Wd.labelStyle : a, s = e.payload, c = e.formatter, u = e.itemSorter, d = e.wrapperClassName, f = e.labelClassName, p = e.label, m = e.labelFormatter, h = e.accessibilityLayer, g = h === void 0 ? Wd.accessibilityLayer : h, _ = () => {
if (s && s.length) {
var e = {
padding: 0,
margin: 0
- }, t = Gd(s, l).map((e, t) => {
+ }, t = Gd(s, u).map((e, t) => {
if (!e || e.type === "none") return null;
var r = e.formatter || c || Ud, a = e.value, o = e.name, l = a, u = o;
if (r) {
@@ -4903,23 +4903,23 @@ var Kd = (e) => {
}, t);
}
return null;
- }, _ = Nd(Nd({}, Wd.contentStyle), r), v = Nd({ margin: 0 }, o), y = !R(f), b = y ? f : "", x = C("recharts-default-tooltip", u), S = C("recharts-tooltip-label", d);
- y && p && s != null && (b = p(f, s));
- var w = h ? {
+ }, v = Nd(Nd({}, Wd.contentStyle), r), y = Nd({ margin: 0 }, o), b = !R(p), x = b ? p : "", S = l("recharts-default-tooltip", d), C = l("recharts-tooltip-label", f);
+ b && m && s != null && (x = m(p, s));
+ var w = g ? {
role: "status",
"aria-live": "assertive"
} : {};
return /*#__PURE__*/ P.createElement("div", jd({
- className: x,
- style: _
- }, w), /*#__PURE__*/ P.createElement("p", {
className: S,
style: v
- }, /*#__PURE__*/ P.isValidElement(b) ? b : `${b}`), g());
+ }, w), /*#__PURE__*/ P.createElement("p", {
+ className: C,
+ style: y
+ }, /*#__PURE__*/ P.isValidElement(x) ? x : `${x}`), _());
}, qd = "recharts-tooltip-wrapper", Jd = { visibility: "hidden" };
function Yd(e) {
var t = e.coordinate, n = e.translateX, r = e.translateY;
- return C(qd, {
+ return l(qd, {
[`${qd}-right`]: I(n) && t && I(t.x) && n >= t.x,
[`${qd}-left`]: I(n) && t && I(t.x) && n < t.x,
[`${qd}-bottom`]: I(r) && t && I(t.y) && r >= t.y,
@@ -5277,7 +5277,7 @@ var kf = {
connectNulls: e.connectNulls
}, s = n && n.length ? If(o) : r;
return /*#__PURE__*/ P.createElement("path", Cf({}, Ve(e), Sr(e), {
- className: C("recharts-curve", t),
+ className: l("recharts-curve", t),
d: s === null ? void 0 : s,
ref: i
}));
@@ -5361,17 +5361,17 @@ function Kf(e, t) {
return n;
}
var qf = (e, t, n, r, i, a) => `M${e},${i}v${r}M${a},${t}h${n}`, Jf = (e) => {
- var t = e.x, n = t === void 0 ? 0 : t, r = e.y, i = r === void 0 ? 0 : r, a = e.top, o = a === void 0 ? 0 : a, s = e.left, c = s === void 0 ? 0 : s, l = e.width, u = l === void 0 ? 0 : l, d = e.height, f = d === void 0 ? 0 : d, p = e.className, m = Gf(e, Rf), h = Vf({
+ var t = e.x, n = t === void 0 ? 0 : t, r = e.y, i = r === void 0 ? 0 : r, a = e.top, o = a === void 0 ? 0 : a, s = e.left, c = s === void 0 ? 0 : s, u = e.width, d = u === void 0 ? 0 : u, f = e.height, p = f === void 0 ? 0 : f, m = e.className, h = Gf(e, Rf), g = Vf({
x: n,
y: i,
top: o,
left: c,
- width: u,
- height: f
- }, m);
- return !I(n) || !I(i) || !I(u) || !I(f) || !I(o) || !I(c) ? null : /*#__PURE__*/ P.createElement("path", zf({}, Ue(h), {
- className: C("recharts-cross", p),
- d: qf(n, i, u, f, o, c)
+ width: d,
+ height: p
+ }, h);
+ return !I(n) || !I(i) || !I(d) || !I(p) || !I(o) || !I(c) ? null : /*#__PURE__*/ P.createElement("path", zf({}, Ue(g), {
+ className: l("recharts-cross", m),
+ d: qf(n, i, d, p, o, c)
}));
};
//#endregion
@@ -5899,22 +5899,22 @@ var am = (e, t, n, r, i) => {
e && a(e);
} catch {}
}, []);
- var o = t.x, s = t.y, c = t.width, l = t.height, u = t.radius, d = t.className, f = t.animationEasing, p = t.animationDuration, m = t.animationBegin, h = t.isAnimationActive, g = t.isUpdateAnimationActive, _ = (0, P.useRef)(c), v = (0, P.useRef)(l), y = (0, P.useRef)(o), b = (0, P.useRef)(s), x = kp((0, P.useMemo)(() => ({
+ var o = t.x, s = t.y, c = t.width, u = t.height, d = t.radius, f = t.className, p = t.animationEasing, m = t.animationDuration, h = t.animationBegin, g = t.isAnimationActive, _ = t.isUpdateAnimationActive, v = (0, P.useRef)(c), y = (0, P.useRef)(u), b = (0, P.useRef)(o), x = (0, P.useRef)(s), S = kp((0, P.useMemo)(() => ({
x: o,
y: s,
width: c,
- height: l,
- radius: u
+ height: u,
+ radius: d
}), [
o,
s,
c,
- l,
- u
+ u,
+ d
]), "rectangle-");
- if (o !== +o || s !== +s || c !== +c || l !== +l || c === 0 || l === 0) return null;
- var S = C("recharts-rectangle", d);
- if (!g) {
+ if (o !== +o || s !== +s || c !== +c || u !== +u || c === 0 || u === 0) return null;
+ var C = l("recharts-rectangle", f);
+ if (!_) {
var w = Ue(t);
w.radius;
var T = Xp(w, Mp);
@@ -5922,34 +5922,34 @@ var am = (e, t, n, r, i) => {
x: ft(o),
y: ft(s),
width: ft(c),
- height: ft(l),
- radius: typeof u == "number" ? u : void 0,
- className: S,
- d: am(o, s, c, l, u)
+ height: ft(u),
+ radius: typeof d == "number" ? d : void 0,
+ className: C,
+ d: am(o, s, c, u, d)
}));
}
- var E = _.current, D = v.current, O = y.current, k = b.current, A = `0px ${i === -1 ? 1 : i}px`, j = `${i}px ${i}px`, M = jp(["strokeDasharray"], p, typeof f == "string" ? f : om.animationEasing);
+ var E = v.current, D = y.current, O = b.current, k = x.current, A = `0px ${i === -1 ? 1 : i}px`, j = `${i}px ${i}px`, M = jp(["strokeDasharray"], m, typeof p == "string" ? p : om.animationEasing);
return /*#__PURE__*/ P.createElement(Op, {
- animationId: x,
- key: x,
+ animationId: S,
+ key: S,
canBegin: i > 0,
- duration: p,
- easing: f,
- isActive: g,
- begin: m
+ duration: m,
+ easing: p,
+ isActive: _,
+ begin: h
}, (e) => {
- var r = L(E, c, e), i = L(D, l, e), a = L(O, o, e), d = L(k, s, e);
- n.current && (_.current = r, v.current = i, y.current = a, b.current = d);
- var f = h ? e > 0 ? {
+ var r = L(E, c, e), i = L(D, u, e), a = L(O, o, e), l = L(k, s, e);
+ n.current && (v.current = r, y.current = i, b.current = a, x.current = l);
+ var f = g ? e > 0 ? {
transition: M,
strokeDasharray: j
} : { strokeDasharray: A } : { strokeDasharray: j }, p = Ue(t);
p.radius;
var m = Xp(p, Np);
return /*#__PURE__*/ P.createElement("path", Yp({}, m, {
- radius: typeof u == "number" ? u : void 0,
- className: S,
- d: am(a, d, r, i, u),
+ radius: typeof d == "number" ? d : void 0,
+ className: C,
+ d: am(a, l, r, i, d),
ref: n,
style: Gp(Gp({}, f), t.style)
}));
@@ -6248,29 +6248,29 @@ var Nm = (e, t) => mt(t - e) * Math.min(Math.abs(t - e), 359.999), Pm = (e) => {
forceCornerRadius: !1,
cornerIsExternal: !1
}, Rm = (e) => {
- var t = Ar(e, Lm), n = t.cx, r = t.cy, i = t.innerRadius, a = t.outerRadius, o = t.cornerRadius, s = t.forceCornerRadius, c = t.cornerIsExternal, l = t.startAngle, u = t.endAngle, d = t.className;
- if (a < i || l === u) return null;
- var f = C("recharts-sector", d), p = a - i, m = bt(o, p, 0, !0), h = m > 0 && Math.abs(l - u) < 360 ? Im({
+ var t = Ar(e, Lm), n = t.cx, r = t.cy, i = t.innerRadius, a = t.outerRadius, o = t.cornerRadius, s = t.forceCornerRadius, c = t.cornerIsExternal, u = t.startAngle, d = t.endAngle, f = t.className;
+ if (a < i || u === d) return null;
+ var p = l("recharts-sector", f), m = a - i, h = bt(o, m, 0, !0), g = h > 0 && Math.abs(u - d) < 360 ? Im({
cx: n,
cy: r,
innerRadius: i,
outerRadius: a,
- cornerRadius: Math.min(m, p / 2),
+ cornerRadius: Math.min(h, m / 2),
forceCornerRadius: s,
cornerIsExternal: c,
- startAngle: l,
- endAngle: u
+ startAngle: u,
+ endAngle: d
}) : Fm({
cx: n,
cy: r,
innerRadius: i,
outerRadius: a,
- startAngle: l,
- endAngle: u
+ startAngle: u,
+ endAngle: d
});
return /*#__PURE__*/ P.createElement("path", jm({}, Ue(t), {
- className: f,
- d: h
+ className: p,
+ d: g
}));
};
//#endregion
@@ -6448,7 +6448,7 @@ function ah(e, t, n) {
}
//#endregion
//#region node_modules/recharts/es6/util/scale/util/arithmetic.js
-var J = /* @__PURE__ */ S((/* @__PURE__ */ d(((e, t) => {
+var J = /* @__PURE__ */ i((/* @__PURE__ */ n(((e, t) => {
(function(e) {
var n = 1e9, r = {
precision: 20,
@@ -9326,7 +9326,7 @@ function px() {
}
//#endregion
//#region node_modules/victory-vendor/es/d3-scale.js
-var mx = /* @__PURE__ */ p({
+var mx = /* @__PURE__ */ r({
scaleBand: () => hg,
scaleDiverging: () => lx,
scaleDivergingLog: () => ux,
@@ -11148,34 +11148,34 @@ function xE(e) {
return /*#__PURE__*/ (0, P.isValidElement)(t) ? /*#__PURE__*/ (0, P.cloneElement)(t, r) : /*#__PURE__*/ (0, P.createElement)(n, r);
}
function SE(e) {
- var t = e.coordinate, n = e.payload, r = e.index, i = e.offset, a = e.tooltipAxisBandSize, o = e.layout, s = e.cursor, c = e.tooltipEventType, l = e.chartName, u = t, d = n, f = r;
- if (!s || !u || l !== "ScatterChart" && c !== "axis") return null;
- var p, m, h;
- if (l === "ScatterChart") p = u, m = Jf, h = Y.cursorLine;
- else if (l === "BarChart") p = Yf(o, u, i, a), m = sm, h = Y.cursorRectangle;
- else if (o === "radial" && xr(u)) {
- var g = Cm(u), _ = g.cx, v = g.cy, y = g.radius;
- p = {
- cx: _,
- cy: v,
- startAngle: g.startAngle,
- endAngle: g.endAngle,
- innerRadius: y,
- outerRadius: y
- }, m = Rm, h = Y.cursorLine;
- } else p = { points: zm(o, u, i) }, m = Lf, h = Y.cursorLine;
- var b = typeof s == "object" && "className" in s ? s.className : void 0, x = _E(_E(_E(_E({
+ var t = e.coordinate, n = e.payload, r = e.index, i = e.offset, a = e.tooltipAxisBandSize, o = e.layout, s = e.cursor, c = e.tooltipEventType, u = e.chartName, d = t, f = n, p = r;
+ if (!s || !d || u !== "ScatterChart" && c !== "axis") return null;
+ var m, h, g;
+ if (u === "ScatterChart") m = d, h = Jf, g = Y.cursorLine;
+ else if (u === "BarChart") m = Yf(o, d, i, a), h = sm, g = Y.cursorRectangle;
+ else if (o === "radial" && xr(d)) {
+ var _ = Cm(d), v = _.cx, y = _.cy, b = _.radius;
+ m = {
+ cx: v,
+ cy: y,
+ startAngle: _.startAngle,
+ endAngle: _.endAngle,
+ innerRadius: b,
+ outerRadius: b
+ }, h = Rm, g = Y.cursorLine;
+ } else m = { points: zm(o, d, i) }, h = Lf, g = Y.cursorLine;
+ var x = typeof s == "object" && "className" in s ? s.className : void 0, S = _E(_E(_E(_E({
stroke: "#ccc",
pointerEvents: "none"
- }, i), p), He(s)), {}, {
- payload: d,
- payloadIndex: f,
- className: C("recharts-tooltip-cursor", b)
+ }, i), m), He(s)), {}, {
+ payload: f,
+ payloadIndex: p,
+ className: l("recharts-tooltip-cursor", x)
});
- return /*#__PURE__*/ P.createElement(mE, { zIndex: e.zIndex ?? h }, /*#__PURE__*/ P.createElement(xE, {
+ return /*#__PURE__*/ P.createElement(mE, { zIndex: e.zIndex ?? g }, /*#__PURE__*/ P.createElement(xE, {
cursor: s,
- cursorComp: m,
- cursorProps: x
+ cursorComp: h,
+ cursorProps: S
}));
}
function CE(e) {
@@ -11189,7 +11189,7 @@ function CE(e) {
}
//#endregion
//#region node_modules/recharts/es6/context/tooltipPortalContext.js
-var wE = /*#__PURE__*/ (0, P.createContext)(null), TE = () => (0, P.useContext)(wE), EE = (/* @__PURE__ */ S((/* @__PURE__ */ d(((e, t) => {
+var wE = /*#__PURE__*/ (0, P.createContext)(null), TE = () => (0, P.useContext)(wE), EE = (/* @__PURE__ */ i((/* @__PURE__ */ n(((e, t) => {
var n = Object.prototype.hasOwnProperty, r = "~";
function i() {}
Object.create && (i.prototype = Object.create(null), new i().__proto__ || (r = !1));
@@ -12160,51 +12160,51 @@ var vO = (e, t, n, r) => e.reduce((e, i) => {
x: 0,
y: 0
}, DO = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
- var n = Ar(e, EO), r = n.x, i = n.y, a = n.lineHeight, o = n.capHeight, s = n.fill, c = n.scaleToFit, l = n.textAnchor, u = n.verticalAnchor, d = oO(n, rO), f = (0, P.useMemo)(() => wO({
- breakAll: d.breakAll,
- children: d.children,
- maxLines: d.maxLines,
+ var n = Ar(e, EO), r = n.x, i = n.y, a = n.lineHeight, o = n.capHeight, s = n.fill, c = n.scaleToFit, u = n.textAnchor, d = n.verticalAnchor, f = oO(n, rO), p = (0, P.useMemo)(() => wO({
+ breakAll: f.breakAll,
+ children: f.children,
+ maxLines: f.maxLines,
scaleToFit: c,
- style: d.style,
- width: d.width
+ style: f.style,
+ width: f.width
}), [
- d.breakAll,
- d.children,
- d.maxLines,
+ f.breakAll,
+ f.children,
+ f.maxLines,
c,
- d.style,
- d.width
- ]), p = d.dx, m = d.dy, h = d.angle, g = d.className, _ = d.breakAll, v = oO(d, iO);
- if (!_t(r) || !_t(i) || f.length === 0) return null;
- var y = Number(r) + (I(p) ? p : 0), b = Number(i) + (I(m) ? m : 0);
- if (!G(y) || !G(b)) return null;
- var x;
- switch (u) {
+ f.style,
+ f.width
+ ]), m = f.dx, h = f.dy, g = f.angle, _ = f.className, v = f.breakAll, y = oO(f, iO);
+ if (!_t(r) || !_t(i) || p.length === 0) return null;
+ var b = Number(r) + (I(m) ? m : 0), x = Number(i) + (I(h) ? h : 0);
+ if (!G(b) || !G(x)) return null;
+ var S;
+ switch (d) {
case "start":
- x = nO(`calc(${o})`);
+ S = nO(`calc(${o})`);
break;
case "middle":
- x = nO(`calc(${(f.length - 1) / 2} * -${a} + (${o} / 2))`);
+ S = nO(`calc(${(p.length - 1) / 2} * -${a} + (${o} / 2))`);
break;
- default: x = nO(`calc(${f.length - 1} * -${a})`);
+ default: S = nO(`calc(${p.length - 1} * -${a})`);
}
- var S = [], w = f[0];
+ var C = [], w = p[0];
if (c && w != null) {
- var T = w.width, E = d.width;
- S.push(`scale(${I(E) && I(T) ? E / T : 1})`);
+ var T = w.width, E = f.width;
+ C.push(`scale(${I(E) && I(T) ? E / T : 1})`);
}
- return h && S.push(`rotate(${h}, ${y}, ${b})`), S.length && (v.transform = S.join(" ")), /*#__PURE__*/ P.createElement("text", aO({}, Ue(v), {
+ return g && C.push(`rotate(${g}, ${b}, ${x})`), C.length && (y.transform = C.join(" ")), /*#__PURE__*/ P.createElement("text", aO({}, Ue(y), {
ref: t,
- x: y,
- y: b,
- className: C("recharts-text", g),
- textAnchor: l,
+ x: b,
+ y: x,
+ className: l("recharts-text", _),
+ textAnchor: u,
fill: s.includes("url") ? TO : s
- }), f.map((e, t) => {
- var n = e.words.join(_ ? "" : " ");
+ }), p.map((e, t) => {
+ var n = e.words.join(v ? "" : " ");
return /*#__PURE__*/ P.createElement("tspan", {
- x: y,
- dy: t === 0 ? x : a,
+ x: b,
+ dy: t === 0 ? S : a,
key: `${n}-${t}`
}, n);
}));
@@ -12329,30 +12329,30 @@ var RO = /*#__PURE__*/ (0, P.createContext)(null), zO = (e) => {
var t = e.value, n = e.formatter, r = R(e.children) ? t : e.children;
return typeof n == "function" ? n(r) : r;
}, GO = (e) => e != null && typeof e == "function", KO = (e, t) => mt(t - e) * Math.min(Math.abs(t - e), 360), qO = (e, t, n, r, i) => {
- var a = e.offset, o = e.className, s = i.cx, c = i.cy, l = i.innerRadius, u = i.outerRadius, d = i.startAngle, f = i.endAngle, p = i.clockWise, m = (l + u) / 2, h = KO(d, f), g = h >= 0 ? 1 : -1, _, v;
+ var a = e.offset, o = e.className, s = i.cx, c = i.cy, u = i.innerRadius, d = i.outerRadius, f = i.startAngle, p = i.endAngle, m = i.clockWise, h = (u + d) / 2, g = KO(f, p), _ = g >= 0 ? 1 : -1, v, y;
switch (t) {
case "insideStart":
- _ = d + g * a, v = p;
+ v = f + _ * a, y = m;
break;
case "insideEnd":
- _ = f - g * a, v = !p;
+ v = p - _ * a, y = !m;
break;
case "end":
- _ = f + g * a, v = p;
+ v = p + _ * a, y = m;
break;
default: throw Error(`Unsupported position ${t}`);
}
- v = h <= 0 ? v : !v;
- var y = gm(s, c, m, _), b = gm(s, c, m, _ + (v ? 1 : -1) * 359), x = `M${y.x},${y.y}
- A${m},${m},0,1,${+!v},
- ${b.x},${b.y}`, S = R(e.id) ? yt("recharts-radial-line-") : e.id;
+ y = g <= 0 ? y : !y;
+ var b = gm(s, c, h, v), x = gm(s, c, h, v + (y ? 1 : -1) * 359), S = `M${b.x},${b.y}
+ A${h},${h},0,1,${+!y},
+ ${x.x},${x.y}`, C = R(e.id) ? yt("recharts-radial-line-") : e.id;
return /*#__PURE__*/ P.createElement("text", LO({}, r, {
dominantBaseline: "central",
- className: C("recharts-radial-bar-label", o)
+ className: l("recharts-radial-bar-label", o)
}), /*#__PURE__*/ P.createElement("defs", null, /*#__PURE__*/ P.createElement("path", {
- id: S,
- d: x
- })), /*#__PURE__*/ P.createElement("textPath", { xlinkHref: `#${S}` }, n));
+ id: C,
+ d: S
+ })), /*#__PURE__*/ P.createElement("textPath", { xlinkHref: `#${C}` }, n));
}, JO = (e, t, n) => {
var r = e.cx, i = e.cy, a = e.innerRadius, o = e.outerRadius, s = (e.startAngle + e.endAngle) / 2;
if (n === "outside") {
@@ -12409,44 +12409,44 @@ function ZO(e) {
};
}
function QO(e) {
- var t = Ar(e, XO), n = t.viewBox, r = t.parentViewBox, i = t.position, a = t.value, o = t.children, s = t.content, c = t.className, l = c === void 0 ? "" : c, u = t.textBreakAll, d = t.labelRef, f = UO(), p = BO(), m = n == null ? i === "center" ? p : f ?? p : YO(n) ? n : Et(n), h, g, _ = ZO(m);
- if (!m || R(a) && R(o) && !/*#__PURE__*/ (0, P.isValidElement)(s) && typeof s != "function") return null;
- var v = YO(m) && (i === "insideStart" || i === "insideEnd" || i === "end");
- if (YO(m)) v || (g = JO(m, t.offset, t.position));
- else if (_) {
- var y = Mt({
- viewBox: _,
+ var t = Ar(e, XO), n = t.viewBox, r = t.parentViewBox, i = t.position, a = t.value, o = t.children, s = t.content, c = t.className, u = c === void 0 ? "" : c, d = t.textBreakAll, f = t.labelRef, p = UO(), m = BO(), h = n == null ? i === "center" ? m : p ?? m : YO(n) ? n : Et(n), g, _, v = ZO(h);
+ if (!h || R(a) && R(o) && !/*#__PURE__*/ (0, P.isValidElement)(s) && typeof s != "function") return null;
+ var y = YO(h) && (i === "insideStart" || i === "insideEnd" || i === "end");
+ if (YO(h)) y || (_ = JO(h, t.offset, t.position));
+ else if (v) {
+ var b = Mt({
+ viewBox: v,
position: i,
offset: t.offset,
parentViewBox: YO(r) ? void 0 : r,
clamp: !0
});
- g = NO(NO({
- x: y.x,
- y: y.y,
- textAnchor: y.horizontalAnchor,
- verticalAnchor: y.verticalAnchor
- }, y.width === void 0 ? {} : { width: y.width }), y.height === void 0 ? {} : { height: y.height });
- }
- var b = NO(NO(NO(NO({}, g?.x === void 0 ? {} : { x: g.x }), g?.y === void 0 ? {} : { y: g.y }), t), {}, { viewBox: m });
+ _ = NO(NO({
+ x: b.x,
+ y: b.y,
+ textAnchor: b.horizontalAnchor,
+ verticalAnchor: b.verticalAnchor
+ }, b.width === void 0 ? {} : { width: b.width }), b.height === void 0 ? {} : { height: b.height });
+ }
+ var x = NO(NO(NO(NO({}, _?.x === void 0 ? {} : { x: _.x }), _?.y === void 0 ? {} : { y: _.y }), t), {}, { viewBox: h });
if (/*#__PURE__*/ (0, P.isValidElement)(s)) {
- b.labelRef;
- var x = AO(b, OO);
- return /*#__PURE__*/ (0, P.cloneElement)(s, x);
+ x.labelRef;
+ var S = AO(x, OO);
+ return /*#__PURE__*/ (0, P.cloneElement)(s, S);
}
if (typeof s == "function") {
- b.content;
- var S = AO(b, kO);
- if (h = /*#__PURE__*/ (0, P.createElement)(s, S), /*#__PURE__*/ (0, P.isValidElement)(h)) return h;
- } else h = WO(t);
+ x.content;
+ var C = AO(x, kO);
+ if (g = /*#__PURE__*/ (0, P.createElement)(s, C), /*#__PURE__*/ (0, P.isValidElement)(g)) return g;
+ } else g = WO(t);
var w = Ue(t);
- return v && YO(m) ? qO(t, i, h, w, m) : g == null ? null : /*#__PURE__*/ P.createElement(mE, { zIndex: t.zIndex }, /*#__PURE__*/ P.createElement(DO, LO({
- ref: d,
- className: C("recharts-label", l)
- }, w, g, {
- textAnchor: gO(w.textAnchor) ? w.textAnchor : g.textAnchor,
- breakAll: u
- }), h));
+ return y && YO(h) ? qO(t, i, g, w, h) : _ == null ? null : /*#__PURE__*/ P.createElement(mE, { zIndex: t.zIndex }, /*#__PURE__*/ P.createElement(DO, LO({
+ ref: f,
+ className: l("recharts-label", u)
+ }, w, _, {
+ textAnchor: gO(w.textAnchor) ? w.textAnchor : _.textAnchor,
+ breakAll: d
+ }), g));
}
QO.displayName = "Label";
var $O = (e, t, n) => {
@@ -12610,7 +12610,7 @@ var Sk = (e) => e != null && e.x === +e.x && e.y === +e.y, Ck = function() {
}, Ek = (e) => {
var t = e.points, n = e.className, r = e.baseLinePoints, i = e.connectNulls, a = yk(e, gk);
if (!t || !t.length) return null;
- var o = C("recharts-polygon", n);
+ var o = l("recharts-polygon", n);
if (r && r.length) {
var s = a.stroke && a.stroke !== "none", c = Tk(t, r, i);
return /*#__PURE__*/ P.createElement("g", { className: o }, /*#__PURE__*/ P.createElement("path", vk({}, Ue(a), {
@@ -12625,11 +12625,11 @@ var Sk = (e) => e != null && e.x === +e.x && e.y === +e.y, Ck = function() {
d: wk(r, i)
})) : null);
}
- var l = wk(t, i);
+ var u = wk(t, i);
return /*#__PURE__*/ P.createElement("path", vk({}, Ue(a), {
- fill: l.slice(-1) === "Z" ? a.fill : "none",
+ fill: u.slice(-1) === "Z" ? a.fill : "none",
className: o,
- d: l
+ d: u
}));
};
//#endregion
@@ -12644,7 +12644,7 @@ function Dk() {
}, Dk.apply(null, arguments);
}
var Ok = (e) => {
- var t = e.cx, n = e.cy, r = e.r, i = e.className, a = C("recharts-dot", i);
+ var t = e.cx, n = e.cy, r = e.r, i = e.className, a = l("recharts-dot", i);
return I(t) && I(n) && I(r) ? /*#__PURE__*/ P.createElement("circle", Dk({}, Ve(e), Sr(e), {
className: a,
cx: t,
@@ -12896,28 +12896,28 @@ var fA = (e, t) => {
}, _A = (e) => {
var t = e.tick, n = e.tickLine, r = e.tickFormatter, i = e.stroke, a = e.ticks, o = Ve(e);
o.ref;
- var s = oA(o, $k), c = He(t), l = nA(nA({}, s), {}, { fill: "none" }, Ve(n)), u = a.map((a, o) => {
- var u = fA(a, e), d = pA(a, e.orientation), f = mA(a), p = nA(nA(nA({}, s), {}, {
- textAnchor: d,
- verticalAnchor: f,
+ var s = oA(o, $k), c = He(t), u = nA(nA({}, s), {}, { fill: "none" }, Ve(n)), d = a.map((a, o) => {
+ var d = fA(a, e), f = pA(a, e.orientation), p = mA(a), m = nA(nA(nA({}, s), {}, {
+ textAnchor: f,
+ verticalAnchor: p,
stroke: "none",
fill: i
}, c), {}, {
index: o,
payload: a,
- x: u.x2,
- y: u.y2
+ x: d.x2,
+ y: d.y2
});
return /*#__PURE__*/ P.createElement(F, eA({
- className: C("recharts-polar-angle-axis-tick", Zk(t)),
+ className: l("recharts-polar-angle-axis-tick", Zk(t)),
key: `tick-${a.coordinate}`
- }, wr(e, a, o)), n && /*#__PURE__*/ P.createElement("line", eA({ className: "recharts-polar-angle-axis-tick-line" }, l, u)), /*#__PURE__*/ P.createElement(gA, {
+ }, wr(e, a, o)), n && /*#__PURE__*/ P.createElement("line", eA({ className: "recharts-polar-angle-axis-tick-line" }, u, d)), /*#__PURE__*/ P.createElement(gA, {
tick: t,
- tickProps: p,
+ tickProps: m,
value: r ? r(a.value, o) : a.value
}));
});
- return /*#__PURE__*/ P.createElement(F, { className: "recharts-polar-angle-axis-ticks" }, u);
+ return /*#__PURE__*/ P.createElement(F, { className: "recharts-polar-angle-axis-ticks" }, d);
}, vA = (e) => {
var t = e.angleAxisId, n = V($h), r = V((e) => zk(e, "angleAxis", t)), i = Fl(), a = V((e) => Hk(e, "angleAxis", t, i));
if (n == null || !a || !a.length || r == null) return null;
@@ -12925,7 +12925,7 @@ var fA = (e, t) => {
radius: n.outerRadius,
ticks: a
});
- return /*#__PURE__*/ P.createElement(mE, { zIndex: o.zIndex }, /*#__PURE__*/ P.createElement(F, { className: C("recharts-polar-angle-axis", uA, o.className) }, /*#__PURE__*/ P.createElement(hA, o), /*#__PURE__*/ P.createElement(_A, o)));
+ return /*#__PURE__*/ P.createElement(mE, { zIndex: o.zIndex }, /*#__PURE__*/ P.createElement(F, { className: l("recharts-polar-angle-axis", uA, o.className) }, /*#__PURE__*/ P.createElement(hA, o), /*#__PURE__*/ P.createElement(_A, o)));
};
function yA(e) {
var t = Ar(e, Mh);
@@ -12951,7 +12951,7 @@ function yA(e) {
yA.displayName = "PolarAngleAxis";
//#endregion
//#region node_modules/react-is/cjs/react-is.production.js
-var bA = /* @__PURE__ */ d(((e) => {
+var bA = /* @__PURE__ */ n(((e) => {
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.consumer"), s = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), p = Symbol.for("react.view_transition");
function m(e) {
if (typeof e == "object" && e) {
@@ -12980,7 +12980,7 @@ var bA = /* @__PURE__ */ d(((e) => {
e.isFragment = function(e) {
return m(e) === r;
};
-})), xA = (/* @__PURE__ */ d(((e, t) => {
+})), xA = (/* @__PURE__ */ n(((e, t) => {
t.exports = bA();
})))(), SA = (e) => typeof e == "string" ? e : e ? e.displayName || e.name || "Component" : "", CA = null, wA = null, TA = (e) => {
if (e === CA && Array.isArray(wA)) return wA;
@@ -13525,7 +13525,7 @@ function Wj(e) {
var t = e.option, n = e.dotProps, r = e.className;
if (/*#__PURE__*/ (0, P.isValidElement)(t)) return /*#__PURE__*/ (0, P.cloneElement)(t, n);
if (typeof t == "function") return t(n);
- var i = C(r, typeof t == "boolean" ? "" : t.className), a = n ?? {};
+ var i = l(r, typeof t == "boolean" ? "" : t.className), a = n ?? {};
a.points;
var o = Hj(a, Fj);
return /*#__PURE__*/ P.createElement(Ok, Vj({}, o, { className: i }));
@@ -14236,26 +14236,26 @@ function _N(e) {
})), null;
}
function vN(e) {
- var t = e.xAxisId, n = e.yAxisId, r = e.shape, i = e.className, a = e.ifOverflow, o = Fl(), s = iN(), c = V((e) => Rx(e, t)), l = V((e) => Vx(e, n)), u = V((e) => _C(e, "xAxis", t, o)), d = V((e) => _C(e, "yAxis", n, o)), f = _u();
- if (!s || !f || c == null || l == null || u == null || d == null) return null;
- var p = gN(u, d, f, e.position, c.orientation, l.orientation, e);
- if (!p) return null;
- var m = p[0], h = p[1];
- if (m == null || h == null) return null;
- var g = m.x, _ = m.y, v = h.x, y = h.y, b = sN(sN({ clipPath: a === "hidden" ? `url(#${s})` : void 0 }, Ue(e)), {}, {
- x1: g,
- y1: _,
- x2: v,
- y2: y
- }), x = HM({
- x1: g,
- y1: _,
- x2: v,
- y2: y
+ var t = e.xAxisId, n = e.yAxisId, r = e.shape, i = e.className, a = e.ifOverflow, o = Fl(), s = iN(), c = V((e) => Rx(e, t)), u = V((e) => Vx(e, n)), d = V((e) => _C(e, "xAxis", t, o)), f = V((e) => _C(e, "yAxis", n, o)), p = _u();
+ if (!s || !p || c == null || u == null || d == null || f == null) return null;
+ var m = gN(d, f, p, e.position, c.orientation, u.orientation, e);
+ if (!m) return null;
+ var h = m[0], g = m[1];
+ if (h == null || g == null) return null;
+ var _ = h.x, v = h.y, y = g.x, b = g.y, x = sN(sN({ clipPath: a === "hidden" ? `url(#${s})` : void 0 }, Ue(e)), {}, {
+ x1: _,
+ y1: v,
+ x2: y,
+ y2: b
+ }), S = HM({
+ x1: _,
+ y1: v,
+ x2: y,
+ y2: b
});
- return /*#__PURE__*/ P.createElement(mE, { zIndex: e.zIndex }, /*#__PURE__*/ P.createElement(F, { className: C("recharts-reference-line", i) }, fN(r, b), /*#__PURE__*/ P.createElement(zO, dN({}, x, {
- lowerWidth: x.width,
- upperWidth: x.width
+ return /*#__PURE__*/ P.createElement(mE, { zIndex: e.zIndex }, /*#__PURE__*/ P.createElement(F, { className: l("recharts-reference-line", i) }, fN(r, x), /*#__PURE__*/ P.createElement(zO, dN({}, S, {
+ lowerWidth: S.width,
+ upperWidth: S.width
}), /*#__PURE__*/ P.createElement(ek, { label: e.label }), e.children)));
}
var yN = {
@@ -14749,25 +14749,25 @@ var uP = {
function dP(e) {
var t = e.x, n = e.y, r = e.width, i = e.height, a = e.orientation, o = e.mirror, s = e.axisLine, c = e.otherSvgProps;
if (!s) return null;
- var l = oP(oP(oP({}, c), Ve(s)), {}, { fill: "none" });
+ var u = oP(oP(oP({}, c), Ve(s)), {}, { fill: "none" });
if (a === "top" || a === "bottom") {
- var u = +(a === "top" && !o || a === "bottom" && o);
- l = oP(oP({}, l), {}, {
+ var d = +(a === "top" && !o || a === "bottom" && o);
+ u = oP(oP({}, u), {}, {
x1: t,
- y1: n + u * i,
+ y1: n + d * i,
x2: t + r,
- y2: n + u * i
+ y2: n + d * i
});
} else {
- var d = +(a === "left" && !o || a === "right" && o);
- l = oP(oP({}, l), {}, {
- x1: t + d * r,
+ var f = +(a === "left" && !o || a === "right" && o);
+ u = oP(oP({}, u), {}, {
+ x1: t + f * r,
y1: n,
- x2: t + d * r,
+ x2: t + f * r,
y2: n + i
});
}
- return /*#__PURE__*/ P.createElement("line", iP({}, l, { className: C("recharts-cartesian-axis-line", lt(s, "className")) }));
+ return /*#__PURE__*/ P.createElement("line", iP({}, u, { className: l("recharts-cartesian-axis-line", lt(s, "className")) }));
}
function fP(e, t, n, r, i, a, o, s, c) {
var l, u, d, f, p, m, h = s ? -1 : 1, g = e.tickSize || o, _ = I(e.tickCoord) ? e.tickCoord : e.coordinate;
@@ -14812,12 +14812,12 @@ function mP(e, t) {
}
}
function hP(e) {
- var t = e.option, n = e.tickProps, r = e.value, i, a = C(n.className, "recharts-cartesian-axis-tick-value");
+ var t = e.option, n = e.tickProps, r = e.value, i, a = l(n.className, "recharts-cartesian-axis-tick-value");
if (/*#__PURE__*/ P.isValidElement(t)) i = /*#__PURE__*/ P.cloneElement(t, oP(oP({}, n), {}, { className: a }));
else if (typeof t == "function") i = t(oP(oP({}, n), {}, { className: a }));
else {
var o = "recharts-cartesian-axis-tick-value";
- typeof t != "boolean" && (o = C(o, Zk(t))), i = /*#__PURE__*/ P.createElement(DO, iP({}, n, { className: o }), r);
+ typeof t != "boolean" && (o = l(o, Zk(t))), i = /*#__PURE__*/ P.createElement(DO, iP({}, n, { className: o }), r);
}
return i;
}
@@ -14858,14 +14858,14 @@ function gP(e) {
]), null;
}
var _P = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
- var n = e.ticks, r = n === void 0 ? [] : n, i = e.tick, a = e.tickLine, o = e.stroke, s = e.tickFormatter, c = e.unit, l = e.padding, u = e.tickTextProps, d = e.orientation, f = e.mirror, p = e.x, m = e.y, h = e.width, g = e.height, _ = e.tickSize, v = e.tickMargin, y = e.fontSize, b = e.letterSpacing, x = e.getTicksConfig, S = e.events, w = e.axisType, T = e.axisId, E = VN(oP(oP({}, x), {}, { ticks: r }), y, b), D = Ve(x), O = He(i), k = gO(D.textAnchor) ? D.textAnchor : pP(d, f), A = mP(d, f), j = {};
+ var n = e.ticks, r = n === void 0 ? [] : n, i = e.tick, a = e.tickLine, o = e.stroke, s = e.tickFormatter, c = e.unit, u = e.padding, d = e.tickTextProps, f = e.orientation, p = e.mirror, m = e.x, h = e.y, g = e.width, _ = e.height, v = e.tickSize, y = e.tickMargin, b = e.fontSize, x = e.letterSpacing, S = e.getTicksConfig, C = e.events, w = e.axisType, T = e.axisId, E = VN(oP(oP({}, S), {}, { ticks: r }), b, x), D = Ve(S), O = He(i), k = gO(D.textAnchor) ? D.textAnchor : pP(f, p), A = mP(f, p), j = {};
typeof a == "object" && (j = a);
- var M = oP(oP({}, D), {}, { fill: "none" }, j), N = E.map((e) => oP({ entry: e }, fP(e, p, m, h, g, d, _, f, v))), ee = N.map((e) => {
+ var M = oP(oP({}, D), {}, { fill: "none" }, j), N = E.map((e) => oP({ entry: e }, fP(e, m, h, g, _, f, v, p, y))), ee = N.map((e) => {
var t = e.entry, n = e.line;
return /*#__PURE__*/ P.createElement(F, {
className: "recharts-cartesian-axis-tick",
key: `tick-${t.value}-${t.coordinate}-${t.tickCoord}`
- }, a && /*#__PURE__*/ P.createElement("line", iP({}, M, n, { className: C("recharts-cartesian-axis-tick-line", lt(a, "className")) })));
+ }, a && /*#__PURE__*/ P.createElement("line", iP({}, M, n, { className: l("recharts-cartesian-axis-tick-line", lt(a, "className")) })));
}), te = N.map((e, t) => {
var n = e.entry, r = e.tick, a = oP(oP({}, oP(oP(oP(oP({ verticalAnchor: A }, D), {}, {
textAnchor: k,
@@ -14876,12 +14876,12 @@ var _P = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
payload: n,
visibleTicksCount: E.length,
tickFormatter: s,
- padding: l
- }, u), {}, { angle: u?.angle ?? D.angle ?? 0 })), O);
+ padding: u
+ }, d), {}, { angle: d?.angle ?? D.angle ?? 0 })), O);
return /*#__PURE__*/ P.createElement(F, iP({
className: "recharts-cartesian-axis-tick-label",
key: `tick-label-${n.value}-${n.coordinate}-${n.tickCoord}`
- }, wr(S, n, t)), i && /*#__PURE__*/ P.createElement(hP, {
+ }, wr(C, n, t)), i && /*#__PURE__*/ P.createElement(hP, {
option: i,
tickProps: a,
value: `${typeof s == "function" ? s(n.value, t) : n.value}${c || ""}`
@@ -14896,35 +14896,35 @@ var _P = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
ref: t
}, te)), ee.length > 0 && /*#__PURE__*/ P.createElement("g", { className: `recharts-cartesian-axis-tick-lines recharts-${w}-tick-lines` }, ee));
}), vP = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
- var n = e.axisLine, r = e.width, i = e.height, a = e.className, o = e.hide, s = e.ticks, c = e.axisType, l = e.axisId, u = nP(e, YN), d = XN((0, P.useState)(""), 2), f = d[0], p = d[1], m = XN((0, P.useState)(""), 2), h = m[0], g = m[1], _ = (0, P.useRef)(null);
+ var n = e.axisLine, r = e.width, i = e.height, a = e.className, o = e.hide, s = e.ticks, c = e.axisType, u = e.axisId, d = nP(e, YN), f = XN((0, P.useState)(""), 2), p = f[0], m = f[1], h = XN((0, P.useState)(""), 2), g = h[0], _ = h[1], v = (0, P.useRef)(null);
(0, P.useImperativeHandle)(t, () => ({
getCalculatedWidth: () => HN({
- ticks: _.current,
+ ticks: v.current,
label: e.labelRef?.current,
labelGapWithTick: 5,
tickSize: e.tickSize,
tickMargin: e.tickMargin
}),
getCalculatedHeight: () => UN({
- ticks: _.current,
+ ticks: v.current,
label: e.labelRef?.current,
labelGapWithTick: 5,
tickSize: e.tickSize,
tickMargin: e.tickMargin
})
}));
- var v = (0, P.useCallback)((e) => {
+ var y = (0, P.useCallback)((e) => {
if (e) {
var t = e.getElementsByClassName("recharts-cartesian-axis-tick-value");
- _.current = t;
+ v.current = t;
var n = t[0];
if (n) {
var r = window.getComputedStyle(n), i = r.fontSize, a = r.letterSpacing;
- (i !== f || a !== h) && (p(i), g(a));
+ (i !== p || a !== g) && (m(i), _(a));
}
}
- }, [f, h]);
- return o || r != null && r <= 0 || i != null && i <= 0 ? null : /*#__PURE__*/ P.createElement(mE, { zIndex: e.zIndex }, /*#__PURE__*/ P.createElement(F, { className: C("recharts-cartesian-axis", a) }, /*#__PURE__*/ P.createElement(dP, {
+ }, [p, g]);
+ return o || r != null && r <= 0 || i != null && i <= 0 ? null : /*#__PURE__*/ P.createElement(mE, { zIndex: e.zIndex }, /*#__PURE__*/ P.createElement(F, { className: l("recharts-cartesian-axis", a) }, /*#__PURE__*/ P.createElement(dP, {
x: e.x,
y: e.y,
width: r,
@@ -14934,13 +14934,13 @@ var _P = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
axisLine: n,
otherSvgProps: Ve(e)
}), /*#__PURE__*/ P.createElement(_P, {
- ref: v,
+ ref: y,
axisType: c,
- events: u,
- fontSize: f,
+ events: d,
+ fontSize: p,
getTicksConfig: e,
height: e.height,
- letterSpacing: h,
+ letterSpacing: g,
mirror: e.mirror,
orientation: e.orientation,
padding: e.padding,
@@ -14956,7 +14956,7 @@ var _P = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
width: e.width,
x: e.x,
y: e.y,
- axisId: l
+ axisId: u
}), /*#__PURE__*/ P.createElement(zO, {
x: e.x,
y: e.y,
@@ -15788,18 +15788,18 @@ var HF = (e, t) => ({
errorVal: K(e.payload, t)
}), UF = class extends P.Component {
render() {
- var e = this.props, t = e.hide, n = e.dot, r = e.points, i = e.className, a = e.xAxisId, o = e.yAxisId, s = e.top, c = e.left, l = e.width, u = e.height, d = e.id, f = e.needClip, p = e.zIndex;
+ var e = this.props, t = e.hide, n = e.dot, r = e.points, i = e.className, a = e.xAxisId, o = e.yAxisId, s = e.top, c = e.left, u = e.width, d = e.height, f = e.id, p = e.needClip, m = e.zIndex;
if (t) return null;
- var m = C("recharts-line", i), h = d, g = bF(n), _ = g.r, v = g.strokeWidth, y = DA(n), b = _ * 2 + v, x = f ? `url(#clipPath-${y ? "" : "dots-"}${h})` : void 0;
- return /*#__PURE__*/ P.createElement(mE, { zIndex: p }, /*#__PURE__*/ P.createElement(F, { className: m }, f && /*#__PURE__*/ P.createElement("defs", null, /*#__PURE__*/ P.createElement(dF, {
- clipPathId: h,
+ var h = l("recharts-line", i), g = f, _ = bF(n), v = _.r, y = _.strokeWidth, b = DA(n), x = v * 2 + y, S = p ? `url(#clipPath-${b ? "" : "dots-"}${g})` : void 0;
+ return /*#__PURE__*/ P.createElement(mE, { zIndex: m }, /*#__PURE__*/ P.createElement(F, { className: h }, p && /*#__PURE__*/ P.createElement("defs", null, /*#__PURE__*/ P.createElement(dF, {
+ clipPathId: g,
xAxisId: a,
yAxisId: o
- }), !y && /*#__PURE__*/ P.createElement("clipPath", { id: `clipPath-dots-${h}` }, /*#__PURE__*/ P.createElement("rect", {
- x: c - b / 2,
- y: s - b / 2,
- width: l + b,
- height: u + b
+ }), !b && /*#__PURE__*/ P.createElement("clipPath", { id: `clipPath-dots-${g}` }, /*#__PURE__*/ P.createElement("rect", {
+ x: c - x / 2,
+ y: s - x / 2,
+ width: u + x,
+ height: d + x
}))), /*#__PURE__*/ P.createElement(lF, {
xAxisId: a,
yAxisId: o,
@@ -15808,13 +15808,13 @@ var HF = (e, t) => ({
errorBarOffset: 0
}, /*#__PURE__*/ P.createElement(VF, {
props: this.props,
- clipPathId: h
+ clipPathId: g
}))), /*#__PURE__*/ P.createElement(vM, {
activeDot: this.props.activeDot,
points: r,
mainColor: this.props.stroke,
itemDataKey: this.props.dataKey,
- clipPath: x
+ clipPath: S
}));
}
};
@@ -16331,34 +16331,34 @@ function PI(e) {
}
var FI = class extends P.PureComponent {
render() {
- var e = this.props, t = e.hide, n = e.dot, r = e.points, i = e.className, a = e.top, o = e.left, s = e.needClip, c = e.xAxisId, l = e.yAxisId, u = e.width, d = e.height, f = e.id, p = e.baseLine, m = e.zIndex;
+ var e = this.props, t = e.hide, n = e.dot, r = e.points, i = e.className, a = e.top, o = e.left, s = e.needClip, c = e.xAxisId, u = e.yAxisId, d = e.width, f = e.height, p = e.id, m = e.baseLine, h = e.zIndex;
if (t) return null;
- var h = C("recharts-area", i), g = f, _ = bF(n), v = _.r, y = _.strokeWidth, b = DA(n), x = v * 2 + y, S = s ? `url(#clipPath-${b ? "" : "dots-"}${g})` : void 0;
- return /*#__PURE__*/ P.createElement(mE, { zIndex: m }, /*#__PURE__*/ P.createElement(F, { className: h }, s && /*#__PURE__*/ P.createElement("defs", null, /*#__PURE__*/ P.createElement(dF, {
- clipPathId: g,
+ var g = l("recharts-area", i), _ = p, v = bF(n), y = v.r, b = v.strokeWidth, x = DA(n), S = y * 2 + b, C = s ? `url(#clipPath-${x ? "" : "dots-"}${_})` : void 0;
+ return /*#__PURE__*/ P.createElement(mE, { zIndex: h }, /*#__PURE__*/ P.createElement(F, { className: g }, s && /*#__PURE__*/ P.createElement("defs", null, /*#__PURE__*/ P.createElement(dF, {
+ clipPathId: _,
xAxisId: c,
- yAxisId: l
- }), !b && /*#__PURE__*/ P.createElement("clipPath", { id: `clipPath-dots-${g}` }, /*#__PURE__*/ P.createElement("rect", {
- x: o - x / 2,
- y: a - x / 2,
- width: u + x,
- height: d + x
+ yAxisId: u
+ }), !x && /*#__PURE__*/ P.createElement("clipPath", { id: `clipPath-dots-${_}` }, /*#__PURE__*/ P.createElement("rect", {
+ x: o - S / 2,
+ y: a - S / 2,
+ width: d + S,
+ height: f + S
}))), /*#__PURE__*/ P.createElement(PI, {
needClip: s,
- clipPathId: g,
+ clipPathId: _,
props: this.props
})), /*#__PURE__*/ P.createElement(vM, {
points: r,
mainColor: EI(this.props.stroke, this.props.fill),
itemDataKey: this.props.dataKey,
activeDot: this.props.activeDot,
- clipPath: S
- }), this.props.isRange && Array.isArray(p) && /*#__PURE__*/ P.createElement(vM, {
- points: p,
+ clipPath: C
+ }), this.props.isRange && Array.isArray(m) && /*#__PURE__*/ P.createElement(vM, {
+ points: m,
mainColor: EI(this.props.stroke, this.props.fill),
itemDataKey: this.props.dataKey,
activeDot: this.props.activeDot,
- clipPath: S
+ clipPath: C
}));
}
};
@@ -16991,19 +16991,19 @@ var HL = 0, UL = (e, t) => {
};
}, WL = class extends P.PureComponent {
render() {
- var e = this.props, t = e.hide, n = e.data, r = e.dataKey, i = e.className, a = e.xAxisId, o = e.yAxisId, s = e.needClip, c = e.background, l = e.id;
+ var e = this.props, t = e.hide, n = e.data, r = e.dataKey, i = e.className, a = e.xAxisId, o = e.yAxisId, s = e.needClip, c = e.background, u = e.id;
if (t || n == null) return null;
- var u = C("recharts-bar", i), d = l;
+ var d = l("recharts-bar", i), f = u;
return /*#__PURE__*/ P.createElement(F, {
- className: u,
- id: l
+ className: d,
+ id: u
}, s && /*#__PURE__*/ P.createElement("defs", null, /*#__PURE__*/ P.createElement(dF, {
- clipPathId: d,
+ clipPathId: f,
xAxisId: a,
yAxisId: o
})), /*#__PURE__*/ P.createElement(F, {
className: "recharts-bar-rectangles",
- clipPath: s ? `url(#clipPath-${d})` : void 0
+ clipPath: s ? `url(#clipPath-${f})` : void 0
}, /*#__PURE__*/ P.createElement(PL, {
data: n,
dataKey: r,
@@ -17279,42 +17279,42 @@ function pR(e) {
}, [t]), null;
}
var mR = (e) => {
- var t = e.xAxisId, n = e.className, r = e.height, i = e.label, a = (0, P.useRef)(null), o = (0, P.useRef)(null), s = V(Nl), c = Fl(), l = B(), u = "xAxis", d = V((e) => RC(e, u, t, c)), f = V((e) => TC(e, t)), p = V((e) => AC(e, t)), m = V((e) => Lx(e, t));
+ var t = e.xAxisId, n = e.className, r = e.height, i = e.label, a = (0, P.useRef)(null), o = (0, P.useRef)(null), s = V(Nl), c = Fl(), u = B(), d = "xAxis", f = V((e) => RC(e, d, t, c)), p = V((e) => TC(e, t)), m = V((e) => AC(e, t)), h = V((e) => Lx(e, t));
if ((0, P.useLayoutEffect)(() => {
- if (!(r !== "auto" || !f || GO(i) || /*#__PURE__*/ (0, P.isValidElement)(i) || m == null)) {
+ if (!(r !== "auto" || !p || GO(i) || /*#__PURE__*/ (0, P.isValidElement)(i) || h == null)) {
var e = a.current;
if (e) {
var n = e.getCalculatedHeight();
- Math.round(f.height) !== Math.round(n) && l(sM({
+ Math.round(p.height) !== Math.round(n) && u(sM({
id: t,
height: n
}));
}
}
}, [
- d,
f,
- l,
+ p,
+ u,
i,
t,
r,
- m
- ]), f == null || p == null || m == null) return null;
+ h
+ ]), p == null || m == null || h == null) return null;
e.dangerouslySetInnerHTML, e.ticks, e.scale;
- var h = dR(e, rR);
- m.id, m.scale;
- var g = dR(m, iR);
- return /*#__PURE__*/ P.createElement(yP, aR({}, h, g, {
+ var g = dR(e, rR);
+ h.id, h.scale;
+ var _ = dR(h, iR);
+ return /*#__PURE__*/ P.createElement(yP, aR({}, g, _, {
ref: a,
labelRef: o,
- x: p.x,
- y: p.y,
- width: f.width,
- height: f.height,
- className: C(`recharts-${u} ${u}`, n),
+ x: m.x,
+ y: m.y,
+ width: p.width,
+ height: p.height,
+ className: l(`recharts-${d} ${d}`, n),
viewBox: s,
- ticks: d,
- axisType: u,
+ ticks: f,
+ axisType: d,
axisId: t
}));
}, hR = {
@@ -17463,43 +17463,43 @@ function OR(e) {
}, [t]), null;
}
function kR(e) {
- var t = e.yAxisId, n = e.className, r = e.width, i = e.label, a = (0, P.useRef)(null), o = (0, P.useRef)(null), s = V(Nl), c = Fl(), l = B(), u = "yAxis", d = V((e) => MC(e, t)), f = V((e) => jC(e, t)), p = V((e) => RC(e, u, t, c)), m = V((e) => Bx(e, t));
+ var t = e.yAxisId, n = e.className, r = e.width, i = e.label, a = (0, P.useRef)(null), o = (0, P.useRef)(null), s = V(Nl), c = Fl(), u = B(), d = "yAxis", f = V((e) => MC(e, t)), p = V((e) => jC(e, t)), m = V((e) => RC(e, d, t, c)), h = V((e) => Bx(e, t));
if ((0, P.useLayoutEffect)(() => {
- if (!(r !== "auto" || !d || GO(i) || /*#__PURE__*/ (0, P.isValidElement)(i) || m == null)) {
+ if (!(r !== "auto" || !f || GO(i) || /*#__PURE__*/ (0, P.isValidElement)(i) || h == null)) {
var e = a.current;
if (e) {
var n = e.getCalculatedWidth();
- Math.round(d.width) !== Math.round(n) && l(oM({
+ Math.round(f.width) !== Math.round(n) && u(oM({
id: t,
width: n
}));
}
}
}, [
- p,
- d,
- l,
+ m,
+ f,
+ u,
i,
t,
r,
- m
- ]), d == null || f == null || m == null) return null;
+ h
+ ]), f == null || p == null || h == null) return null;
e.dangerouslySetInnerHTML, e.ticks, e.scale;
- var h = ER(e, vR);
- m.id, m.scale;
- var g = ER(m, yR);
- return /*#__PURE__*/ P.createElement(yP, bR({}, h, g, {
+ var g = ER(e, vR);
+ h.id, h.scale;
+ var _ = ER(h, yR);
+ return /*#__PURE__*/ P.createElement(yP, bR({}, g, _, {
ref: a,
labelRef: o,
- x: f.x,
- y: f.y,
+ x: p.x,
+ y: p.y,
tickTextProps: r === "auto" ? { width: void 0 } : { width: r },
- width: d.width,
- height: d.height,
- className: C(`recharts-${u} ${u}`, n),
+ width: f.width,
+ height: f.height,
+ className: l(`recharts-${d} ${d}`, n),
viewBox: s,
- ticks: p,
- axisType: u,
+ ticks: m,
+ axisType: d,
axisId: t
}));
}
@@ -18309,89 +18309,89 @@ function cB(e) {
return e ? iB : sB;
}
var lB = /*#__PURE__*/ (0, P.forwardRef)((e, t) => {
- var n = e.children, r = e.className, i = e.height, a = e.onClick, o = e.onContextMenu, s = e.onDoubleClick, c = e.onMouseDown, l = e.onMouseEnter, u = e.onMouseLeave, d = e.onMouseMove, f = e.onMouseUp, p = e.onTouchEnd, m = e.onTouchMove, h = e.onTouchStart, g = e.style, _ = e.width, v = e.responsive, y = e.dispatchTouchEvents, b = y === void 0 || y, x = (0, P.useRef)(null), S = B(), w = Xz((0, P.useState)(null), 2), T = w[0], E = w[1], D = Xz((0, P.useState)(null), 2), O = D[0], k = D[1], A = Uz(), j = mu(), M = j?.width > 0 ? j.width : _, N = j?.height > 0 ? j.height : i, ee = (0, P.useCallback)((e) => {
- A(e), typeof t == "function" && t(e), E(e), k(e), e != null && (x.current = e);
+ var n = e.children, r = e.className, i = e.height, a = e.onClick, o = e.onContextMenu, s = e.onDoubleClick, c = e.onMouseDown, u = e.onMouseEnter, d = e.onMouseLeave, f = e.onMouseMove, p = e.onMouseUp, m = e.onTouchEnd, h = e.onTouchMove, g = e.onTouchStart, _ = e.style, v = e.width, y = e.responsive, b = e.dispatchTouchEvents, x = b === void 0 || b, S = (0, P.useRef)(null), C = B(), w = Xz((0, P.useState)(null), 2), T = w[0], E = w[1], D = Xz((0, P.useState)(null), 2), O = D[0], k = D[1], A = Uz(), j = mu(), M = j?.width > 0 ? j.width : v, N = j?.height > 0 ? j.height : i, ee = (0, P.useCallback)((e) => {
+ A(e), typeof t == "function" && t(e), E(e), k(e), e != null && (S.current = e);
}, [
A,
t,
E,
k
]), te = (0, P.useCallback)((e) => {
- S(FR(e)), S(iz({
+ C(FR(e)), C(iz({
handler: a,
reactEvent: e
}));
- }, [S, a]), ne = (0, P.useCallback)((e) => {
- S(LR(e)), S(iz({
- handler: l,
- reactEvent: e
- }));
- }, [S, l]), re = (0, P.useCallback)((e) => {
- S(aw()), S(iz({
+ }, [C, a]), ne = (0, P.useCallback)((e) => {
+ C(LR(e)), C(iz({
handler: u,
reactEvent: e
}));
- }, [S, u]), ie = (0, P.useCallback)((e) => {
- S(LR(e)), S(iz({
+ }, [C, u]), re = (0, P.useCallback)((e) => {
+ C(aw()), C(iz({
handler: d,
reactEvent: e
}));
- }, [S, d]), ae = (0, P.useCallback)(() => {
- S(ZR());
- }, [S]), oe = (0, P.useCallback)(() => {
- S(QR());
- }, [S]), se = (0, P.useCallback)((e) => {
- S(XR(e.key));
- }, [S]), ce = (0, P.useCallback)((e) => {
- S(iz({
+ }, [C, d]), ie = (0, P.useCallback)((e) => {
+ C(LR(e)), C(iz({
+ handler: f,
+ reactEvent: e
+ }));
+ }, [C, f]), ae = (0, P.useCallback)(() => {
+ C(ZR());
+ }, [C]), oe = (0, P.useCallback)(() => {
+ C(QR());
+ }, [C]), se = (0, P.useCallback)((e) => {
+ C(XR(e.key));
+ }, [C]), ce = (0, P.useCallback)((e) => {
+ C(iz({
handler: o,
reactEvent: e
}));
- }, [S, o]), le = (0, P.useCallback)((e) => {
- S(iz({
+ }, [C, o]), le = (0, P.useCallback)((e) => {
+ C(iz({
handler: s,
reactEvent: e
}));
- }, [S, s]), ue = (0, P.useCallback)((e) => {
- S(iz({
+ }, [C, s]), ue = (0, P.useCallback)((e) => {
+ C(iz({
handler: c,
reactEvent: e
}));
- }, [S, c]), de = (0, P.useCallback)((e) => {
- S(iz({
- handler: f,
+ }, [C, c]), de = (0, P.useCallback)((e) => {
+ C(iz({
+ handler: p,
reactEvent: e
}));
- }, [S, f]), fe = (0, P.useCallback)((e) => {
- S(iz({
- handler: h,
+ }, [C, p]), fe = (0, P.useCallback)((e) => {
+ C(iz({
+ handler: g,
reactEvent: e
}));
- }, [S, h]), pe = (0, P.useCallback)((e) => {
- b && S(uz(e)), S(iz({
- handler: m,
+ }, [C, g]), pe = (0, P.useCallback)((e) => {
+ x && C(uz(e)), C(iz({
+ handler: h,
reactEvent: e
}));
}, [
- S,
- b,
- m
+ C,
+ x,
+ h
]), me = (0, P.useCallback)((e) => {
- S(iz({
- handler: p,
+ C(iz({
+ handler: m,
reactEvent: e
}));
- }, [S, p]), he = cB(v);
+ }, [C, m]), he = cB(y);
return /*#__PURE__*/ P.createElement(wE.Provider, { value: T }, /*#__PURE__*/ P.createElement(Ft.Provider, { value: O }, /*#__PURE__*/ P.createElement(he, {
- width: M ?? g?.width,
- height: N ?? g?.height,
- className: C("recharts-wrapper", r),
+ width: M ?? _?.width,
+ height: N ?? _?.height,
+ className: l("recharts-wrapper", r),
style: Gz({
position: "relative",
cursor: "default",
width: M,
height: N
- }, g),
+ }, _),
onClick: te,
onContextMenu: ce,
onDoubleClick: le,
@@ -18732,11 +18732,11 @@ var IB = MB({
//#endregion
//#region src/react/charts/cn.ts
function BB(...e) {
- return r(C(e));
+ return d(l(e));
}
//#endregion
//#region src/react/evilcharts/registry/ui/recharts-chart.tsx
-var $ = l(), VB = {
+var $ = b(), VB = {
light: "",
dark: ".dark"
}, HB = Object.keys(VB);
@@ -19013,7 +19013,7 @@ function dV({ range: e, totalPoints: t, containerRef: n, commit: r }) {
])
};
}
-function fV({ data: e, chartConfig: t, dataKeys: n, xDataKey: r, variant: i = "area", height: a = 56, className: o, stacked: s = !1, strokeVariant: c = "solid", connectNulls: l = !1, barRadius: u, startIndex: d, endIndex: f, defaultStartIndex: p = 0, defaultEndIndex: m, onChange: h, formatLabel: _, curveType: v = "monotone", minSpan: y = 2, showLabels: b = !0, skipStyle: x = !1 }) {
+function fV({ data: e, chartConfig: t, dataKeys: n, xDataKey: r, variant: i = "area", height: a = 56, className: o, stacked: s = !1, strokeVariant: c = "solid", connectNulls: l = !1, barRadius: u, startIndex: d, endIndex: f, defaultStartIndex: p = 0, defaultEndIndex: m, onChange: h, formatLabel: g, curveType: _ = "monotone", minSpan: y = 2, showLabels: b = !0, skipStyle: x = !1 }) {
let S = P.useRef(null), C = P.useMemo(() => n ?? Object.keys(t), [n, t]), w = e.length, T = P.useId().replace(/:/g, ""), E = d !== void 0 && f !== void 0, [D, O] = P.useState(() => ({
startIndex: Math.max(0, Math.min(p, w - 1)),
endIndex: Math.max(0, Math.min(m ?? w - 1, w - 1))
@@ -19085,11 +19085,11 @@ function fV({ data: e, chartConfig: t, dataKeys: n, xDataKey: r, variant: i = "a
let ge = (0, P.useCallback)((t) => {
if (!r) return String(t);
let n = e[t]?.[r];
- return _ ? _(n, t) : String(n ?? t);
+ return g ? g(n, t) : String(n ?? t);
}, [
e,
r,
- _
+ g
]);
return w === 0 ? null : /* @__PURE__ */ (0, $.jsxs)("div", {
ref: S,
@@ -19108,7 +19108,7 @@ function fV({ data: e, chartConfig: t, dataKeys: n, xDataKey: r, variant: i = "a
keys: C,
chartConfig: t,
variant: i,
- curveType: v,
+ curveType: _,
chartId: T,
stacked: s,
strokeVariant: c === "animated-dashed" ? "dashed" : c,
@@ -19116,15 +19116,15 @@ function fV({ data: e, chartConfig: t, dataKeys: n, xDataKey: r, variant: i = "a
barRadius: u
})
}),
- /* @__PURE__ */ (0, $.jsx)(g.div, {
+ /* @__PURE__ */ (0, $.jsx)(v.div, {
className: "bg-background/70 pointer-events-none absolute inset-y-0 left-0 rounded-l-md backdrop-blur-[2px]",
style: { width: fe }
}),
- /* @__PURE__ */ (0, $.jsx)(g.div, {
+ /* @__PURE__ */ (0, $.jsx)(v.div, {
className: "bg-background/70 pointer-events-none absolute inset-y-0 right-0 rounded-r-md backdrop-blur-[2px]",
style: { width: pe }
}),
- /* @__PURE__ */ (0, $.jsx)(g.div, {
+ /* @__PURE__ */ (0, $.jsx)(v.div, {
className: "absolute inset-y-0 cursor-grab touch-none rounded-sm border active:cursor-grabbing",
style: {
left: le,
@@ -19149,7 +19149,7 @@ function fV({ data: e, chartConfig: t, dataKeys: n, xDataKey: r, variant: i = "a
}
function pV({ side: e, position: t, label: n, bind: r }) {
let i = e === "left";
- return /* @__PURE__ */ (0, $.jsxs)(g.div, {
+ return /* @__PURE__ */ (0, $.jsxs)(v.div, {
className: "absolute inset-y-0 z-10",
style: { left: t },
children: [/* @__PURE__ */ (0, $.jsx)("div", {
@@ -19637,79 +19637,79 @@ function DV({ config: e, data: t, children: n, className: r, chartProps: i, stac
})
});
}
-function OV({ dataKey: e, variant: t = "default", radius: n, animationType: r, isClickable: i = !1, enableHoverHighlight: a = !1, glowing: s = !1, bufferBar: c = !1, barProps: l }) {
- let { config: u, isStacked: d, isHorizontal: f, isLoading: p, barRadius: m, animationType: h, introStartedAt: g, dataLength: _, selectedDataKey: v, selectDataKey: y, isMouseInChart: b } = EV(), x = (0, P.useId)().replace(/:/g, ""), S = o();
- if (p) return null;
- let C = n ?? m, w = v === e, T = S ? "none" : r ?? h, E = {
- id: x,
+function OV({ dataKey: e, variant: t = "default", radius: n, animationType: r, isClickable: i = !1, enableHoverHighlight: a = !1, glowing: o = !1, bufferBar: s = !1, barProps: c }) {
+ let { config: l, isStacked: u, isHorizontal: d, isLoading: f, barRadius: p, animationType: m, introStartedAt: h, dataLength: g, selectedDataKey: _, selectDataKey: v, isMouseInChart: y } = EV(), b = (0, P.useId)().replace(/:/g, ""), x = k();
+ if (f) return null;
+ let S = n ?? p, C = _ === e, w = x ? "none" : r ?? m, T = {
+ id: b,
dataKey: e,
variant: t,
- barRadius: C,
- glowing: s,
- bufferBar: c,
+ barRadius: S,
+ glowing: o,
+ bufferBar: s,
isClickable: i,
enableHoverHighlight: a,
- isMouseInChart: b,
- isHorizontal: f,
- introStartedAt: g,
- selectedDataKey: v,
- dataLength: _,
+ isMouseInChart: y,
+ isHorizontal: d,
+ introStartedAt: h,
+ selectedDataKey: _,
+ dataLength: g,
onClick: () => {
- i && y(w ? null : e);
+ i && v(C ? null : e);
}
};
return /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(YL, {
dataKey: e,
- stackId: d ? xV : void 0,
- fill: `url(#${x}-colors-${e})`,
- radius: C,
+ stackId: u ? xV : void 0,
+ fill: `url(#${b}-colors-${e})`,
+ radius: S,
isAnimationActive: !1,
style: i || a ? { cursor: "pointer" } : void 0,
shape: (e) => /* @__PURE__ */ (0, $.jsx)(PV, {
...e,
- ...E,
- animationType: T
+ ...T,
+ animationType: w
}),
activeBar: (e) => /* @__PURE__ */ (0, $.jsx)(PV, {
...e,
- ...E,
+ ...T,
animationType: "none"
}),
- ...l
+ ...c
}), /* @__PURE__ */ (0, $.jsxs)("defs", { children: [
/* @__PURE__ */ (0, $.jsx)(RV, {
- id: x,
+ id: b,
dataKey: e,
- config: u
+ config: l
}),
t === "hatched" && /* @__PURE__ */ (0, $.jsx)(zV, {
- id: x,
+ id: b,
dataKey: e
}),
t === "duotone" && /* @__PURE__ */ (0, $.jsx)(VV, {
- id: x,
+ id: b,
dataKey: e,
- config: u
+ config: l
}),
t === "duotone-reverse" && /* @__PURE__ */ (0, $.jsx)(HV, {
- id: x,
+ id: b,
dataKey: e,
- config: u
+ config: l
}),
t === "gradient" && /* @__PURE__ */ (0, $.jsx)(UV, {
- id: x,
+ id: b,
dataKey: e
}),
t === "stripped" && /* @__PURE__ */ (0, $.jsx)(WV, {
- id: x,
+ id: b,
dataKey: e
}),
- c && /* @__PURE__ */ (0, $.jsx)(BV, {
- id: x,
+ s && /* @__PURE__ */ (0, $.jsx)(BV, {
+ id: b,
dataKey: e
}),
- s && /* @__PURE__ */ (0, $.jsx)(GV, {
- id: x,
+ o && /* @__PURE__ */ (0, $.jsx)(GV, {
+ id: b,
dataKey: e
})
] })] });
@@ -19772,9 +19772,9 @@ function NV({ variant: e, align: t = "right", verticalAlign: n = "top", isClicka
});
}
var PV = (e) => {
- let { x: t = 0, y: n = 0, width: r = 0, height: i = 0, id: a, dataKey: o, variant: s, barRadius: c, glowing: l, bufferBar: u, isClickable: d, enableHoverHighlight: f, isMouseInChart: p, isHorizontal: m = !1, animationType: h = "none", introStartedAt: _ = 0, selectedDataKey: v, isActive: y, dataLength: b = 0, onClick: x } = e, S = typeof e.index == "number" ? e.index : -1, C = u && b > 0 && S === b - 1, w = s === "stripped", T = FV(h, S, b, m, _), E = C ? `url(#${a}-buffer-hatched-${o})` : IV(s, a, o), D = l ? `url(#${a}-bar-glow-${o})` : void 0, O = LV({
+ let { x: t = 0, y: n = 0, width: r = 0, height: i = 0, id: a, dataKey: o, variant: s, barRadius: c, glowing: l, bufferBar: u, isClickable: d, enableHoverHighlight: f, isMouseInChart: p, isHorizontal: m = !1, animationType: h = "none", introStartedAt: g = 0, selectedDataKey: _, isActive: y, dataLength: b = 0, onClick: x } = e, S = typeof e.index == "number" ? e.index : -1, C = u && b > 0 && S === b - 1, w = s === "stripped", T = FV(h, S, b, m, g), E = C ? `url(#${a}-buffer-hatched-${o})` : IV(s, a, o), D = l ? `url(#${a}-bar-glow-${o})` : void 0, O = LV({
isClickable: d,
- selectedDataKey: v,
+ selectedDataKey: _,
dataKey: o,
enableHoverHighlight: f,
isMouseInChart: p,
@@ -19809,7 +19809,7 @@ var PV = (e) => {
children: [/* @__PURE__ */ (0, $.jsx)(sm, {
...e,
fill: "transparent"
- }), T ? /* @__PURE__ */ (0, $.jsx)(g.g, {
+ }), T ? /* @__PURE__ */ (0, $.jsx)(v.g, {
initial: T.initial,
animate: T.animate,
transition: T.transition,
@@ -20247,7 +20247,7 @@ var JV = ({ chartId: e, onShimmerExit: t }) => /* @__PURE__ */ (0, $.jsxs)($.Fra
height: "1",
x: "0",
y: "0",
- children: /* @__PURE__ */ (0, $.jsx)(g.rect, {
+ children: /* @__PURE__ */ (0, $.jsx)(v.rect, {
y: "0",
width: "1",
height: "1",
@@ -20280,7 +20280,7 @@ var JV = ({ chartId: e, onShimmerExit: t }) => /* @__PURE__ */ (0, $.jsxs)($.Fra
DV.Bar = OV, DV.XAxis = kV, DV.YAxis = AV, DV.Grid = jV, DV.Tooltip = MV, DV.Legend = NV, DV.Brush = lV;
//#endregion
//#region src/react/charts/chart-card.tsx
-var XV = `${i({ radius: "chart" })} flex flex-col gap-4 max-sm:p-4`;
+var XV = `${c({ radius: "chart" })} flex flex-col gap-4 max-sm:p-4`;
function ZV({ title: e, children: t }) {
return /* @__PURE__ */ (0, $.jsxs)("section", {
className: XV,
@@ -20677,52 +20677,52 @@ function jH({ activity: e, title: t, dailyTitle: n, words: r, tone: i, empty: a
}
//#endregion
//#region src/react/components/expandable-ranking.tsx
-function MH({ children: e, className: n = "", previewCount: r = 10 }) {
- let i = (0, P.useId)(), a = (0, P.useRef)(null), [o, s] = (0, P.useState)(!1), [c, l] = (0, P.useState)(!1), u = P.Children.toArray(e), d = u.length > r;
+function MH({ children: e, className: t = "", previewCount: n = 10 }) {
+ let r = (0, P.useId)(), i = (0, P.useRef)(null), [a, o] = (0, P.useState)(!1), [s, c] = (0, P.useState)(!1), l = P.Children.toArray(e), u = l.length > n;
(0, P.useLayoutEffect)(() => {
- let e = a.current;
- if (!e || !d) return;
+ let e = i.current;
+ if (!e || !u) return;
let t = () => {
- let t = e.children[Math.min(r, e.children.length) - 1];
+ let t = e.children[Math.min(n, e.children.length) - 1];
t && e.offsetWidth && (e.style.setProperty("--ranking-collapsed-height", `${t.offsetTop - e.offsetTop + t.offsetHeight}px`), e.style.setProperty("--ranking-expanded-height", `${e.scrollHeight}px`));
};
t();
- let n = new ResizeObserver(t);
- return n.observe(e), () => n.disconnect();
+ let r = new ResizeObserver(t);
+ return r.observe(e), () => r.disconnect();
}, [
- d,
- r,
- u.length
+ u,
+ n,
+ l.length
]);
- let f = u.map((e, t) => !(0, P.isValidElement)(e) || t < r ? e : (0, P.cloneElement)(e, { inert: !o || void 0 }));
+ let d = l.map((e, t) => !(0, P.isValidElement)(e) || t < n ? e : (0, P.cloneElement)(e, { inert: !a || void 0 }));
return /* @__PURE__ */ (0, $.jsxs)("div", {
"data-expandable-ranking": !0,
- "data-expandable": d || void 0,
- "data-expanded": o || void 0,
- "data-animating": c || void 0,
+ "data-expandable": u || void 0,
+ "data-expanded": a || void 0,
+ "data-animating": s || void 0,
children: [/* @__PURE__ */ (0, $.jsx)("ol", {
- id: i,
- ref: a,
+ id: r,
+ ref: i,
"data-expandable-ranking-list": !0,
- className: n,
+ className: t,
onTransitionEnd: (e) => {
- e.target === a.current && e.propertyName === "max-height" && l(!1);
+ e.target === i.current && e.propertyName === "max-height" && c(!1);
},
- children: f
- }), d ? /* @__PURE__ */ (0, $.jsx)("button", {
+ children: d
+ }), u ? /* @__PURE__ */ (0, $.jsx)("button", {
type: "button",
"data-ranking-toggle": !0,
- "aria-controls": i,
- "aria-expanded": o,
- "aria-label": o ? "收起排名" : "展开更多排名",
+ "aria-controls": r,
+ "aria-expanded": a,
+ "aria-label": a ? "收起排名" : "展开更多排名",
onClick: () => {
- l(!0), s((e) => !e);
+ c(!0), o((e) => !e);
},
- children: /* @__PURE__ */ (0, $.jsx)(t, { "aria-hidden": !0 })
+ children: /* @__PURE__ */ (0, $.jsx)(f, { "aria-hidden": !0 })
}) : null]
});
}
//#endregion
-export { Kk as $, Gr as $t, FM as A, wh as At, aj as B, ll as Bt, KB as C, Wh as Ct, LB as D, Ch as Dt, BB as E, Y as Et, Kj as F, Rm as Ft, HA as G, K as Gt, QA as H, nl as Ht, Pj as I, gm as It, BA as J, H as Jt, VA as K, Jc as Kt, Cj as L, q as Lt, NM as M, Th as Mt, EM as N, Wm as Nt, IB as O, Sh as Ot, vM as P, Um as Pt, Zk as Q, qr as Qt, pj as R, Eu as Rt, tV as S, $h as St, ZB as T, Nh as Tt, ZA as U, el as Ut, ij as V, rl as Vt, WA as W, dl as Wt, EA as X, V as Xt, RA as Y, B as Yt, yA as Z, Yi as Zt, DV as _, yS as _t, vH as a, Tt as an, kk as at, iV as b, ng as bt, sH as c, Ve as cn, hk as ct, oH as d, tk as dt, Ar as en, qk as et, iH as f, DO as ft, cH as g, uT as gt, lH as h, mE as ht, yH as i, mt as in, Ak as it, PM as j, xh as jt, IM as k, Eh as kt, aH as l, He as ln, dk as lt, uH as m, AE as mt, jH as n, L as nn, Vk as nt, hH as o, F as on, Ek as ot, rH as p, mD as pt, zA as q, Zc as qt, gH as r, R as rn, Uk as rt, XV as s, Ue as sn, lk as st, MH as t, wr as tn, zk as tt, ZV as u, HO as ut, _V as v, gS as vt, qB as w, Fh as wt, rV as x, Uh as xt, cV as y, rg as yt, fj as z, Fl as zt };
+export { vM as ActivePoints, jH as ActivityHeat, pj as AnimatedItems, gH as BAR_DOMAIN, yH as BarCard, XV as CHART_CARD, sH as CHART_COLORS, lk as CartesianLabelListContextProvider, aH as CategoryTick, mD as Cell, _V as ChartBackground, KB as ChartContainer, ZV as ChartEmpty, oH as ChartHead, cV as ChartLegend, iV as ChartLegendContent, hH as ChartTip, rV as ChartTooltip, tV as ChartTooltipContent, Y as DefaultZIndexes, Kj as Dots, DV as EvilBarChart, MH as ExpandableRanking, hk as LabelListFromLabelProp, F as Layer, qB as LoadingIndicator, yA as PolarAngleAxis, LB as PolarChart, HO as PolarLabelContextProvider, tk as PolarLabelFromLabelProp, dk as PolarLabelListContextProvider, Ek as Polygon, Cj as RegisterGraphicalItemId, Rm as Sector, Pj as SetPolarGraphicalItem, WA as SetPolarLegendPayload, HA as SetTooltipEntrySettings, RA as Shape, DO as Text, mE as ZIndexLayer, wr as adaptEventsOfChild, Kk as addRadiusAxis, AE as arrayTooltipSearcher, vH as barLabel, iH as categoryAxisWidth, BB as cn, NM as combineAllBarPositions, FM as combineBarPosition, EM as combineBarSizeList, ng as combineDisplayedStackedData, yS as combineStackGroups, PM as combineStackedData, H as createSelector, IB as defaultPolarChartProps, Nh as defaultPolarRadiusAxisProps, EA as findAllByType, rH as fitLabel, Fh as getAxisTypeBasedOnLayout, ll as getBandSizeOfAxis, rl as getBaseValueOfBar, nl as getCateCoordinateOfBar, Zk as getClassNameFromUnknown, ZB as getColorsCount, el as getNormalizedStackId, dl as getTooltipNameProp, K as getValueByDataKey, IM as getZIndexFromUnknown, Gr as identity, L as interpolate, qr as isArrayLike, Jc as isCategoricalAxis, R as isNullish, rg as isStacked, Yi as iteratee, ij as matchAnimationItems, QA as matchAppend, ZA as matchByIndex, mt as mathSign, Tt as noop, gm as polarToCartesian, qk as removeRadiusAxis, Ar as resolveDefaultProps, uT as selectActiveTooltipIndex, Uh as selectAngleAxis, Ch as selectBarCategoryGap, Sh as selectBarGap, Wm as selectChartDataAndAlwaysIgnoreIndexes, Um as selectChartDataWithIndexes, q as selectChartLayout, zk as selectPolarAxisScale, Vk as selectPolarAxisTicks, Uk as selectPolarGraphicalItemAxisTicks, Ak as selectPolarItemsSettings, $h as selectPolarViewBox, Wh as selectRadiusAxis, Eh as selectReverseStackOrder, wh as selectRootBarSize, xh as selectRootMaxBarSize, Th as selectStackOffsetType, gS as selectTooltipAxis, kk as selectUnfilteredPolarItems, uH as sliceConfig, lH as sliceKey, Ue as svgPropertiesAndEvents, Ve as svgPropertiesNoEvents, He as svgPropertiesNoEventsFromUnknown, cH as tone, Zc as truncateByDomain, fj as useAnimationCallbacks, aj as useAnimationStartSnapshot, B as useAppDispatch, V as useAppSelector, Fl as useIsPanorama, VA as useMouseClickItemDispatch, zA as useMouseEnterItemDispatch, BA as useMouseLeaveItemDispatch, Eu as usePolarChartLayout };
-//# debugId=ca720218-6459-44ae-b9ac-b08a5aaedf22
\ No newline at end of file
+//# debugId=1d145860-18b0-4d5f-a44a-69dd60a675da
\ No newline at end of file
diff --git a/web/dist/peach-app.folder-rows-C8zyfdZi.js b/web/dist/peach-app.folder-rows-C5-6TcQS.js
similarity index 65%
rename from web/dist/peach-app.folder-rows-C8zyfdZi.js
rename to web/dist/peach-app.folder-rows-C5-6TcQS.js
index f9b36d8d7..d070eef97 100644
--- a/web/dist/peach-app.folder-rows-C8zyfdZi.js
+++ b/web/dist/peach-app.folder-rows-C5-6TcQS.js
@@ -1,12 +1,12 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "bcfa9843-8f0e-4105-99f2-40b95275bf31", e._sentryDebugIdIdentifier = "sentry-dbid-bcfa9843-8f0e-4105-99f2-40b95275bf31");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e9ac4b70-e2f6-4988-a25d-44d3287e31ad", e._sentryDebugIdIdentifier = "sentry-dbid-e9ac4b70-e2f6-4988-a25d-44d3287e31ad");
} catch {}
})();
-import { Oa as e, Sa as t, Tc as n, Us as r, _a as i, bo as a, bs as o, cu as s, eu as c, fs as l, ga as u, ja as d, lo as f, mo as p, pu as m, ro as h, tu as g, uu as _ } from "./peach-app.js";
+import { Button as e, CLOUD_LOCATIONS as t, ErrorText as n, Help as r, IconButton as i, Input as a, Label as o, M6 as s, MEDIA_SOURCE_ICONS as c, MEDIA_SOURCE_OPTIONS as l, Select$1 as u, SelectItem as d, SourceMark as f, __toESM as p, busyProps as m, cx as h, require_jsx_runtime as g, require_react as _ } from "./peach-app.js";
//#region src/react/settings/folder-rows.tsx
-var v = /* @__PURE__ */ m(_(), 1), y = s();
+var v = /* @__PURE__ */ p(_(), 1), y = g();
function b({ className: e }) {
return /* @__PURE__ */ (0, y.jsx)("svg", {
"aria-hidden": !0,
@@ -20,11 +20,11 @@ function b({ className: e }) {
children: /* @__PURE__ */ (0, y.jsx)("use", { href: "#i-folder-search" })
});
}
-var x = g, S = (e) => n[e] || "database", C = (e) => c.includes(e);
+var x = l, S = (e) => c[e] || "database", C = (e) => t.includes(e);
function w({ label: e, className: t, children: n }) {
return /* @__PURE__ */ (0, y.jsxs)("div", {
- className: r("flex min-w-0 flex-col gap-1", t),
- children: [/* @__PURE__ */ (0, y.jsx)(p, {
+ className: h("flex min-w-0 flex-col gap-1", t),
+ children: [/* @__PURE__ */ (0, y.jsx)(o, {
elementType: "span",
"aria-hidden": !0,
children: e
@@ -37,12 +37,12 @@ function T({ children: e }) {
children: e
});
}
-function E({ index: e, cost: n, error: r, onChange: a }) {
+function E({ index: e, cost: t, error: r, onChange: i }) {
return /* @__PURE__ */ (0, y.jsxs)("div", {
"data-media-read-policy": e,
className: "flex w-full flex-col gap-1 @lg:w-32",
children: [
- /* @__PURE__ */ (0, y.jsx)(p, {
+ /* @__PURE__ */ (0, y.jsx)(o, {
elementType: "span",
"aria-hidden": !0,
children: "读取策略"
@@ -53,24 +53,24 @@ function E({ index: e, cost: n, error: r, onChange: a }) {
isRequired: !0,
validationBehavior: "aria",
isInvalid: !!r,
- selectedKey: n || null,
+ selectedKey: t || null,
onSelectionChange: (e) => {
- (e === "free" || e === "metered") && a(e);
+ (e === "free" || e === "metered") && i(e);
},
- children: [/* @__PURE__ */ (0, y.jsx)(i, {
+ children: [/* @__PURE__ */ (0, y.jsx)(d, {
id: "free",
children: "正常读取"
- }), /* @__PURE__ */ (0, y.jsx)(i, {
+ }), /* @__PURE__ */ (0, y.jsx)(d, {
id: "metered",
children: "代理保护"
})]
}),
- r ? /* @__PURE__ */ (0, y.jsx)(t, { children: r }) : null
+ r ? /* @__PURE__ */ (0, y.jsx)(n, { children: r }) : null
]
});
}
function D() {
- return /* @__PURE__ */ (0, y.jsx)(e, { children: "读取策略选「代理保护」时,会限制自动读取视频。" });
+ return /* @__PURE__ */ (0, y.jsx)(r, { children: "读取策略选「代理保护」时,会限制自动读取视频。" });
}
function O({ initial: e, blank: t, pickFolder: n, describe: r, focusAfterPick: i = !1 }) {
let [a, o] = (0, v.useState)(e), [s, c] = (0, v.useState)([]), [l, u] = (0, v.useState)(null), [d, f] = (0, v.useState)(null), p = (0, v.useRef)(!1), m = (0, v.useRef)([]);
@@ -115,49 +115,49 @@ function O({ initial: e, blank: t, pickFolder: n, describe: r, focusAfterPick: i
}
};
}
-function k({ label: e, path: t, onPath: n, error: r, inputRef: i, picking: s, onPick: c, onRemove: u, status: d, children: p }) {
- let m = (0, v.useRef)(null), g = () => {
- let e = m.current;
+function k({ label: t, path: n, onPath: r, error: o, inputRef: c, picking: l, onPick: u, onRemove: d, status: f, children: p }) {
+ let h = (0, v.useRef)(null), g = () => {
+ let e = h.current;
e && e.ownerDocument.activeElement !== e && (e.scrollLeft = e.scrollWidth);
};
return (0, v.useLayoutEffect)(() => {
- m.current && (m.current.title = t), g();
- }, [t]), /* @__PURE__ */ (0, y.jsxs)("div", {
+ h.current && (h.current.title = n), g();
+ }, [n]), /* @__PURE__ */ (0, y.jsxs)("div", {
"data-folder-row": !0,
className: "@container flex flex-col gap-2 rounded-2lg border border-separator-border bg-background-primary-default p-3",
children: [/* @__PURE__ */ (0, y.jsxs)("div", {
className: "flex items-start gap-2",
children: [
- /* @__PURE__ */ (0, y.jsx)(f, {
+ /* @__PURE__ */ (0, y.jsx)(a, {
className: "min-w-0 flex-1",
- "aria-label": e,
+ "aria-label": t,
placeholder: "媒体目录路径",
- value: t,
- onChange: n,
+ value: n,
+ onChange: r,
ref: (e) => {
- m.current = e, i(e);
+ h.current = e, c(e);
},
onBlur: () => requestAnimationFrame(g),
validationBehavior: "aria",
- isInvalid: !!r,
- hint: r || void 0
+ isInvalid: !!o,
+ hint: o || void 0
}),
- d ? /* @__PURE__ */ (0, y.jsx)("div", {
+ f ? /* @__PURE__ */ (0, y.jsx)("div", {
className: "flex h-9 shrink-0 items-center",
- children: d
+ children: f
}) : null,
- /* @__PURE__ */ (0, y.jsx)(o, {
+ /* @__PURE__ */ (0, y.jsx)(i, {
icon: b,
"aria-label": "选择文件夹",
- onClick: c,
- ...h(s)
+ onClick: u,
+ ...m(l)
}),
- u ? /* @__PURE__ */ (0, y.jsx)(l, {
+ d ? /* @__PURE__ */ (0, y.jsx)(e, {
variant: "danger",
iconOnly: !0,
- leadingIcon: a,
+ leadingIcon: s,
"aria-label": "移除这个文件夹",
- onClick: u
+ onClick: d
}) : null
]
}), /* @__PURE__ */ (0, y.jsx)("div", {
@@ -177,15 +177,15 @@ function A({ index: e, value: t, onChange: n, options: r = x }) {
onSelectionChange: (e) => {
e !== null && n(String(e));
},
- children: r.map(([e, t]) => /* @__PURE__ */ (0, y.jsxs)(i, {
+ children: r.map(([e, t]) => /* @__PURE__ */ (0, y.jsxs)(d, {
id: e,
textValue: t,
- children: [/* @__PURE__ */ (0, y.jsx)(d, { mark: S(e) }), t]
+ children: [/* @__PURE__ */ (0, y.jsx)(f, { mark: S(e) }), t]
}, e))
})
});
}
//#endregion
-export { x as a, A as c, O as d, b as i, C as l, T as n, E as o, k as r, D as s, w as t, S as u };
+export { w as FolderField, T as FolderFieldLine, k as FolderRow, b as FolderSearchIcon, x as MEDIA_SOURCES, E as MediaReadPolicy, D as MediaReadPolicyHelp, A as SourceSelect, C as isCloudSource, S as sourceMark, O as useFolderRows };
-//# debugId=bcfa9843-8f0e-4105-99f2-40b95275bf31
\ No newline at end of file
+//# debugId=e9ac4b70-e2f6-4988-a25d-44d3287e31ad
\ No newline at end of file
diff --git a/web/dist/peach-app.follow-manage-page-CtU6__VA.js b/web/dist/peach-app.follow-manage-page-CtU6__VA.js
deleted file mode 100644
index 69f3a8040..000000000
--- a/web/dist/peach-app.follow-manage-page-CtU6__VA.js
+++ /dev/null
@@ -1,1905 +0,0 @@
-(function() {
- try {
- var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d24e1d7f-d204-4120-8c52-d8db621d5248", e._sentryDebugIdIdentifier = "sentry-dbid-d24e1d7f-d204-4120-8c52-d8db621d5248");
- } catch {}
-})();
-import { t as e } from "./peach-app.createPaginatedRowModel-Cb5ojTIu.js";
-import { n as t, t as n } from "./peach-app.use-table-selection-KrR-g6fk.js";
-import { $a as r, $o as i, Ai as a, Ba as o, Bi as s, Ca as c, Do as l, Ea as u, Ec as d, Fc as f, Fi as p, Gc as m, Gi as h, Gl as g, Ha as _, Il as v, Io as ee, Ji as y, Lc as b, Mi as x, Nc as S, Ni as te, Nl as C, Oa as w, Ol as T, Pc as E, Pi as D, Qa as O, Qc as k, Ql as A, Qo as j, Ra as ne, Rc as re, Ri as M, Sa as N, Sc as P, Us as F, Va as ie, Vi as I, Vl as L, Wi as R, Wo as ae, Xa as z, Yc as B, Yi as oe, Z as V, Zc as H, Zo as U, _l as W, al as se, ao as ce, as as le, au as G, bo as ue, cl as de, co as K, cs as fe, cu as pe, dl as q, ds as me, ec as he, el as ge, eo as _e, fl as ve, fs as J, go as ye, hl as be, hn as xe, ho as Se, il as Ce, is as we, iu as Te, jc as Ee, ji as De, kl as Oe, ko as ke, ll as Ae, lo as je, ls as Me, ml as Ne, mn as Pe, na as Fe, nc as Ie, nl as Le, ns as Re, ol as ze, oo as Be, ps as Ve, pu as He, qi as Ue, ro as Y, rs as We, sl as Ge, so as X, tl as Ke, to as qe, ts as Je, ul as Ye, uu as Xe, va as Ze, vl as Qe, wl as $e, wo as et, xl as tt, yl as nt, zi as rt, zl as it } from "./peach-app.js";
-import { t as at } from "./peach-app.page-BYr6f5ud.js";
-import { i as ot } from "./peach-app.stat-card-8t4QGU2C.js";
-import { t as st } from "./peach-app.legacy-avatar-CV1xk6vD.js";
-import { t as ct } from "./peach-app.pill-aria-tab-list-B1wzfuox.js";
-import { r as lt, t as ut } from "./peach-app.source-view-DaRl5mr9.js";
-import { t as dt } from "./peach-app.source-list-E8TH3X9X.js";
-//#region src/react/follow-manage/add-source.tsx
-var Z = /* @__PURE__ */ He(Xe(), 1), Q = pe(), ft = F(O, r, "text-body-2-medium"), pt = "粘贴来源链接,或输入创作者名、id…", mt = "查找中(首次按名字查要下载创作者索引,可能几十秒)", ht = "识别中", gt = "站内没有查到来源", _t = "/settings/subscriptions", vt = (e, t) => `${e}:${t.url}`;
-function yt({ field: e, menu: t, options: n, active: r, busy: i, onPick: a, onClose: s }) {
- return (0, Z.useEffect)(() => {
- t.current?.querySelector("[aria-current=\"true\"]")?.scrollIntoView({ block: "nearest" });
- }, [t, r]), /* @__PURE__ */ (0, Q.jsxs)(Me, {
- ref: t,
- triggerRef: e,
- isOpen: !0,
- isNonModal: !0,
- shouldFlip: !1,
- onOpenChange: (e) => {
- e || s();
- },
- placement: "bottom start",
- offset: 4,
- "aria-label": "来源建议",
- className: F(_e, "flex w-(--trigger-width) flex-col gap-1 overscroll-contain"),
- children: [i && !n.length ? /* @__PURE__ */ (0, Q.jsx)("div", {
- className: "px-2 py-1.5",
- children: /* @__PURE__ */ (0, Q.jsx)(o, { label: "正在查找建议" })
- }) : null, n.map((e, t) => /* @__PURE__ */ (0, Q.jsxs)(Z.Fragment, { children: [e.group === n[t - 1]?.group ? null : /* @__PURE__ */ (0, Q.jsx)("div", {
- className: "px-2 pt-1 text-caption-1-regular text-text-tertiary",
- children: e.group
- }), /* @__PURE__ */ (0, Q.jsxs)("button", {
- type: "button",
- "aria-current": t === r ? "true" : void 0,
- className: t === r ? F(ft, "bg-background-secondary-default") : ft,
- onMouseDown: (e) => e.preventDefault(),
- onClick: () => a(e.value),
- children: [
- /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "min-w-0 grow truncate text-left",
- children: e.value
- }),
- e.matched ? /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "shrink-0 text-caption-1-regular text-text-tertiary",
- children: e.matched
- }) : null,
- e.n ? /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "shrink-0 text-caption-1-regular tabular-nums text-text-tertiary",
- children: e.n.toLocaleString()
- }) : null
- ]
- })] }, `${e.group}-${e.value}`))]
- });
-}
-function bt({ credentials: e, hidden: t, onHidden: n }) {
- let r = (0, Z.useRef)(null), [i, a] = (0, Z.useState)(!1), o = (e.providers || []).filter((e) => e.followable), s = o.filter((e) => !t.has(e.provider_label)).length, c = s === o.length ? "全部来源" : `${s}/${o.length} 个来源`, l = (e, r) => {
- let i = new Set(t);
- r ? i.delete(e) : i.add(e), n(i);
- };
- return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(J, {
- ref: r,
- variant: "secondary",
- leadingIcon: Se,
- "aria-haspopup": "dialog",
- "aria-expanded": i,
- "aria-label": c,
- onClick: () => a(!0),
- children: c
- }), /* @__PURE__ */ (0, Q.jsx)(Me, {
- triggerRef: r,
- isOpen: i,
- onOpenChange: a,
- placement: "bottom end",
- offset: 4,
- className: _e,
- children: /* @__PURE__ */ (0, Q.jsxs)(fe, {
- "aria-label": "来源筛选",
- className: "flex w-64 flex-col gap-1 outline-none",
- children: [o.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex items-center gap-2 pb-1",
- children: [/* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "ghost",
- size: "small",
- onClick: () => n(/* @__PURE__ */ new Set()),
- children: "全选"
- }), /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "ghost",
- size: "small",
- onClick: () => n(new Set(o.map((e) => e.provider_label))),
- children: "全不选"
- })]
- }) : /* @__PURE__ */ (0, Q.jsx)(w, { children: "暂无可用来源" }), o.map((e) => {
- let n = e.requirement === "required" && (!e.present || (e.missing || []).length > 0);
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex items-center gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(z, {
- isSelected: !t.has(e.provider_label),
- onChange: (t) => l(e.provider_label, t),
- children: /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex min-w-0 items-center gap-1.5",
- children: [/* @__PURE__ */ (0, Q.jsx)(lt, { provider: e.provider }), e.provider_label]
- })
- }), n ? /* @__PURE__ */ (0, Q.jsx)(Ve, {
- variant: "ghost",
- size: "xs",
- className: "ml-auto",
- href: _t,
- onClick: () => a(!1),
- children: "打开凭据设置"
- }) : null]
- }, e.provider);
- })]
- })
- })] });
-}
-function xt({ row: e, at: t, hidden: n, unpicked: r, onPick: i }) {
- if (e.kind === "error") return /* @__PURE__ */ (0, Q.jsx)(X, {
- tone: "error",
- title: e.line,
- children: e.error || "查找失败"
- });
- let a = (e.candidates || []).filter((e) => !n.has(e.provider_label || "")), o = Object.entries(e.failures || {});
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: ie({
- variant: "outlined",
- padding: "none",
- className: "flex flex-col gap-2 p-4"
- }),
- children: [
- /* @__PURE__ */ (0, Q.jsx)("b", {
- className: "text-body-medium text-text-primary",
- children: e.line
- }),
- a.length ? a.map((e) => {
- let n = vt(t, e);
- return /* @__PURE__ */ (0, Q.jsx)(z, {
- isSelected: !e.known && !r.has(n),
- isDisabled: e.known,
- onChange: (e) => i(n, e),
- children: /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex min-w-0 flex-wrap items-center gap-1.5",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(lt, { provider: e.provider }),
- /* @__PURE__ */ (0, Q.jsx)("b", {
- className: "text-body-medium",
- children: e.provider_label
- }),
- /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "min-w-0 break-words",
- children: e.label
- }),
- /* @__PURE__ */ (0, Q.jsx)("small", {
- className: "text-caption-1-regular text-text-secondary",
- children: e.known ? "已经关注" : e.evidence
- })
- ]
- })
- }, n);
- }) : /* @__PURE__ */ (0, Q.jsx)(w, { children: gt }),
- (e.external_searches || []).map((e) => /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)("small", {
- className: "text-caption-1-regular text-text-secondary",
- children: e.evidence
- }), /* @__PURE__ */ (0, Q.jsx)(c, {
- href: e.url,
- children: `${e.label}:${e.query}`
- })]
- }, e.url)),
- o.length ? /* @__PURE__ */ (0, Q.jsx)(w, { children: o.map(([e, t]) => `${e}:${t}`).join(";") }) : null
- ]
- });
-}
-function St({ data: e, credentials: t, readOnly: n, toast: r }) {
- let [i, a] = (0, Z.useState)(""), [o, s] = (0, Z.useState)(!1), [c, l] = (0, Z.useState)(""), [d, p] = (0, Z.useState)(""), [m, h] = (0, Z.useState)(!1), [_, v] = (0, Z.useState)(null), [ee, y] = (0, Z.useState)(-1), b = (0, Z.useRef)(null), x = (0, Z.useRef)(null), [S, te] = (0, Z.useState)(/* @__PURE__ */ new Set()), [C, w] = (0, Z.useState)(/* @__PURE__ */ new Set()), [E, D] = (0, Z.useState)(""), [O, k] = (0, Z.useState)(0);
- (0, Z.useEffect)(() => {
- let e = i.trim();
- if (o || !e || e.includes("/")) {
- p("");
- return;
- }
- let t = setTimeout(() => p(e), 250);
- return () => clearTimeout(t);
- }, [i, o]);
- let A = G({
- queryKey: Ge(d),
- queryFn: ({ signal: e }) => se(d, e),
- enabled: d.length > 0 && m && !o && _ !== i
- }), j = (0, Z.useMemo)(() => (A.data?.groups || []).flatMap((e) => e.items.map((t) => ({
- value: t.value,
- matched: t.matched || "",
- n: t.n || 0,
- group: e.label
- }))), [A.data]), { job: M, running: N, outcome: P, start: F, dismiss: I } = Pe({
- queryKey: f,
- queryFn: ({ signal: e }) => Ce(e),
- start: (e) => Oe([e]),
- onStarted: () => w(/* @__PURE__ */ new Set()),
- onError: (e) => D(g(e)),
- onFinish: (e) => {
- e.status === "failed" && D(e.error || "查找失败");
- }
- }), L = (e) => {
- let t = e.trim();
- !t || n || o || N || F.isPending || (D(""), y(-1), l(t), a(t), p(""), v(t), F.mutate(t));
- }, R = A.isFetching, z = m && !o && _ !== i && (j.length > 0 || R), B = () => {
- y(-1), v(i);
- }, oe = (e) => {
- if (!(o || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229)) {
- if (e.key === "Escape" && z) B();
- else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
- if (!j.length) return;
- if (e.preventDefault(), !z) {
- v(null);
- return;
- }
- let t = e.key === "ArrowDown" ? 1 : -1;
- y((e) => {
- let n = e + t;
- return n < 0 ? j.length - 1 : n >= j.length ? 0 : n;
- });
- } else e.key === "Enter" && (e.preventDefault(), L(j[ee]?.value || i));
- }
- }, V = P?.results || [], H = V.flatMap((e, t) => (e.candidates || []).filter((e) => !e.known && !S.has(e.provider_label || "")).map((e) => ({
- candidate: e,
- key: vt(t, e)
- })).filter((e) => !C.has(e.key))), U = Te({
- mutationFn: async (e) => {
- let t = [], n = [];
- k(0);
- for (let r of e) {
- try {
- let e = await re(r.candidate);
- n.push(e.source);
- } catch (e) {
- t.push(`${r.candidate.label}:${g(e)}`);
- }
- k((e) => e + 1);
- }
- if (n.length) try {
- await T(n);
- } catch (e) {
- t.push(g(e));
- }
- return {
- failures: t,
- sources: n
- };
- },
- onSuccess: (e) => {
- W(), e.failures.length ? D(e.failures.join(";")) : (D(""), I(), r(`已添加 ${e.sources.length} 个关注来源`));
- },
- onError: (e) => D(g(e))
- }), ce = e.suggestions || [], le = !c.includes("/");
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: ie({
- padding: "none",
- className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
- }),
- children: [
- /* @__PURE__ */ (0, Q.jsx)("h3", {
- className: "text-title-2-medium text-text-primary",
- children: "添加关注"
- }),
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-end gap-2",
- children: [
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- ref: b,
- className: "min-w-64 grow",
- onFocus: () => h(!0),
- onBlur: (e) => {
- let t = e.relatedTarget;
- !e.currentTarget.contains(t) && !x.current?.contains(t) && h(!1);
- },
- children: [/* @__PURE__ */ (0, Q.jsx)(je, {
- "aria-label": "来源链接、名字或 id",
- placeholder: pt,
- value: i,
- leadingIcon: ae,
- enterKeyHint: "search",
- isDisabled: n,
- onChange: a,
- onCompositionStart: () => {
- s(!0), y(-1);
- },
- onCompositionEnd: (e) => {
- s(!1), a(e.currentTarget.value);
- },
- onKeyDown: oe
- }), z ? /* @__PURE__ */ (0, Q.jsx)(yt, {
- field: b,
- menu: x,
- options: j,
- active: ee,
- busy: R,
- onPick: L,
- onClose: B
- }) : null]
- }),
- /* @__PURE__ */ (0, Q.jsx)(bt, {
- credentials: t,
- hidden: S,
- onHidden: te
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "primary",
- disabled: n || !i.trim(),
- ...Y(N || F.isPending),
- onClick: () => L(i),
- children: "查找"
- })
- ]
- }),
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- "aria-live": "polite",
- className: "flex flex-col gap-3 empty:hidden",
- children: [N || F.isPending ? /* @__PURE__ */ (0, Q.jsx)(ne, {
- embedded: !0,
- label: M?.message || (M?.total ? `查找中:${M.checked || 0}/${M.total}` : le ? mt : ht),
- value: M?.checked,
- total: M?.total
- }) : null, E ? /* @__PURE__ */ (0, Q.jsx)(X, {
- tone: "error",
- title: "这一次没有完成",
- children: E
- }) : null]
- }),
- V.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-3",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(u, { children: "查找结果" }),
- V.map((e, t) => /* @__PURE__ */ (0, Q.jsx)(xt, {
- row: e,
- at: t,
- hidden: S,
- unpicked: C,
- onPick: (e, t) => {
- let n = new Set(C);
- t ? n.delete(e) : n.add(e), w(n);
- }
- }, `${e.line}-${t}`)),
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-center gap-2",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- onClick: () => I(),
- children: "关闭"
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "primary",
- size: "small",
- disabled: n || !H.length,
- ...Y(U.isPending),
- onClick: () => U.mutate(H),
- children: `添加选中(${H.length})`
- }),
- U.isPending ? /* @__PURE__ */ (0, Q.jsx)("span", {
- role: "status",
- className: "text-body-2-regular text-text-secondary",
- children: `添加中… ${O}/${H.length}`
- }) : null
- ]
- })
- ]
- }) : null,
- ce.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)("span", {
- className: "text-body-2-regular text-text-secondary",
- children: "猜你喜欢"
- }), ce.map((e) => /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- disabled: n,
- title: `浏览历史里出现 ${e.visits} 次${e.origin ? ` · ${e.origin}` : ""}`,
- onClick: () => L(e.name),
- children: e.name
- }, e.name))]
- }) : null
- ]
- });
-}
-//#endregion
-//#region src/react/follow-manage/alias-rename-dialog.tsx
-function Ct({ group: e, close: t, receipt: n }) {
- return /* @__PURE__ */ (0, Q.jsx)(K, {
- isOpen: !!e,
- onOpenChange: (e) => {
- e || t();
- },
- width: "form",
- label: "修改统一名称",
- children: e ? /* @__PURE__ */ (0, Q.jsx)(wt, {
- group: e,
- close: t,
- receipt: n
- }, e.canonical_key) : null
- });
-}
-function wt({ group: e, close: t, receipt: n }) {
- let [r, i] = (0, Z.useState)(e.canonical_name), a = _();
- return /* @__PURE__ */ (0, Q.jsxs)("form", {
- onSubmit: (i) => {
- i.preventDefault(), r.trim() && r.trim() !== e.canonical_name && a.run("rename", (t) => tt(e.canonical_key, r.trim(), t), () => {
- W(), n(`已把统一名称改为 ${r.trim()}`), t();
- });
- },
- className: "flex min-h-0 flex-col gap-4 p-5",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(me, {
- slot: "title",
- className: "text-title-2-semibold text-text-primary",
- children: "修改统一名称"
- }),
- /* @__PURE__ */ (0, Q.jsxs)("p", {
- className: "text-body-2-regular wrap-anywhere text-text-secondary",
- children: ["当前名称:", e.canonical_name]
- }),
- /* @__PURE__ */ (0, Q.jsx)(je, {
- "aria-label": "统一名称",
- autoFocus: !0,
- value: r,
- onChange: i
- }),
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(u, { children: "选择已有别名" }), /* @__PURE__ */ (0, Q.jsx)("div", {
- className: "flex flex-wrap gap-2",
- children: e.aliases.map((e) => /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- onClick: () => i(e.name),
- children: e.name
- }, e.key))
- })]
- }),
- /* @__PURE__ */ (0, Q.jsx)("p", {
- className: "text-body-2-regular text-text-secondary",
- children: "原名称保留为别名,关联档案和作品署名会同步更新。"
- }),
- a.error ? /* @__PURE__ */ (0, Q.jsx)(X, {
- tone: "error",
- children: a.error
- }) : null,
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap justify-end gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- onClick: t,
- children: "取消"
- }), /* @__PURE__ */ (0, Q.jsx)(J, {
- type: "submit",
- variant: "primary",
- disabled: !r.trim() || r.trim() === e.canonical_name,
- ...Y(!!a.busy),
- children: "修改统一名称"
- })]
- })
- ]
- });
-}
-//#endregion
-//#region src/react/follow-manage/alias-manager.tsx
-var Tt = (e) => `将移除别名「${e}」,对应来源恢复为独立创作者组。`, Et = y({
- rowSelectionFeature: R,
- rowSortingFeature: I,
- rowPaginationFeature: h,
- columnVisibilityFeature: Ue,
- sortedRowModel: t(),
- paginatedRowModel: e()
-}), Dt = Et, Ot = {
- id: "select",
- label: "选择",
- width: 48,
- min: 48,
- max: 48,
- required: !0
-}, kt = {
- id: "canonical",
- label: "统一名称",
- width: 280,
- min: 240,
- required: !0,
- flex: !0
-}, At = [
- Ot,
- kt,
- {
- id: "alias",
- label: "平台别名",
- width: 240
- },
- {
- id: "evidence",
- label: "依据",
- width: 320
- },
- {
- id: "actions",
- label: "操作",
- width: 112
- }
-], jt = [
- Ot,
- kt,
- {
- id: "aliases",
- label: "平台别名",
- width: 400
- },
- {
- id: "actions",
- label: "操作",
- width: 184,
- min: 168
- }
-], Mt = (e) => e.alias;
-function Nt(e, t, n) {
- let r = n ? `name:${n}` : "", i = r && e.find((e) => e.author_key === r) || e.find((e) => e.author_name === t || e.entity_name === t);
- return i ? e.filter((e) => e.author_key === i.author_key) : [];
-}
-function Pt({ sources: e, name: t, canonicalKey: n }) {
- return /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex items-center gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(ut, {
- group: Nt(e, t, n),
- name: t
- }), /* @__PURE__ */ (0, Q.jsx)("b", {
- className: "text-body-medium",
- children: t
- })]
- });
-}
-function Ft({ groups: e, suggestions: t, sources: r = [], readOnly: i, toast: o }) {
- let c = te("alias-suggestions", At), l = te("alias-saved", jt), [d, f] = (0, Z.useState)(null), [m, h] = (0, Z.useState)({}), [_, v] = (0, Z.useState)({}), ee = n(() => h({})), y = n(() => v({})), [S, C] = (0, Z.useState)([]), [w, T] = (0, Z.useState)([]), [E, O] = (0, Z.useState)({
- pageIndex: 0,
- pageSize: 20
- }), [k, A] = (0, Z.useState)({
- pageIndex: 0,
- pageSize: 20
- }), j = {
- ...E,
- pageIndex: Math.min(E.pageIndex, Math.max(0, Math.ceil(t.length / E.pageSize) - 1))
- }, ne = {
- ...k,
- pageIndex: Math.min(k.pageIndex, Math.max(0, Math.ceil(e.length / k.pageSize) - 1))
- }, [re, F] = (0, Z.useState)(""), [I, L] = (0, Z.useState)(""), [R, ae] = (0, Z.useState)(""), B = Te({
- mutationFn: async (e) => {
- let t = 0;
- for (let n of e) {
- try {
- await b(n.canonical, n.alias);
- } catch (n) {
- throw t && W(), Error(`${g(n)}(还有 ${e.length - t} 组没有合并)`);
- }
- t += 1;
- }
- return {
- done: t,
- items: e
- };
- },
- onSuccess: (e) => {
- F(""), h({}), W(), o(`已合并 ${e.done} 组创作者别名`);
- },
- onError: (e) => F(g(e))
- }), V = Te({
- mutationFn: (e) => b(e.canonical, e.alias),
- onSuccess: () => {
- F(""), L(""), ae(""), W(), o("已保存创作者别名");
- },
- onError: (e) => F(g(e))
- }), H = Te({
- mutationFn: async (e) => {
- let t = typeof e == "string" ? [e] : e, n = 0;
- try {
- for (let e of t) await Qe(e), n += 1;
- } catch (e) {
- throw Error(`${g(e)}(已移除 ${n} 个别名,还有 ${t.length - n} 个未移除)`);
- } finally {
- W();
- }
- },
- onSuccess: () => {
- F(""), v({}), o("已移除创作者别名");
- },
- onError: (e) => F(g(e))
- }), U = (e, t) => {
- e.length && P({
- title: t ? "合并全部创作者别名" : "合并所选创作者别名",
- body: `将合并以下 ${e.length} 组创作者:${e.map((e) => `「${e.alias}」归入「${e.canonical}」`).join(";")}。`,
- confirmLabel: t ? "合并全部别名" : "合并所选别名",
- onConfirm: () => B.mutateAsync(e)
- });
- }, se = (e) => void P({
- title: "移除创作者别名",
- body: Tt(e),
- confirmLabel: "移除创作者别名",
- onConfirm: () => H.mutateAsync(e)
- }), G = (0, Z.useRef)({
- sources: r,
- readOnly: i,
- merging: B.isPending,
- removing: H.isPending,
- merge: U,
- remove: se,
- rename: f
- });
- G.current = {
- sources: r,
- readOnly: i,
- merging: B.isPending,
- removing: H.isPending,
- merge: U,
- remove: se,
- rename: f
- };
- let ue = (0, Z.useMemo)(() => {
- let e = oe();
- return e.columns([
- e.display({
- id: "select",
- header: (e) => /* @__PURE__ */ (0, Q.jsx)(a, {
- table: e.table,
- label: "全选待合并别名"
- }),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)(z, {
- slot: null,
- isSelected: e.row.getIsSelected(),
- "aria-label": `选择别名 ${e.row.original.alias},归入 ${e.row.original.canonical}`,
- onChange: (t) => e.row.toggleSelected(t)
- })
- }),
- e.accessor("canonical", {
- header: "统一名称",
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)(Pt, {
- sources: G.current.sources,
- name: e.getValue()
- })
- }),
- e.accessor("alias", {
- header: "平台别名",
- cell: (e) => e.getValue()
- }),
- e.accessor("evidence", {
- header: "依据",
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "text-body-2-regular text-text-secondary",
- children: e.getValue()
- })
- }),
- e.display({
- id: "actions",
- header: "操作",
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- disabled: G.current.readOnly,
- ...Y(G.current.merging),
- onClick: () => G.current.merge([e.row.original], !1),
- children: "合并"
- })
- })
- ]);
- }, []), de = (0, Z.useMemo)(() => {
- let e = oe();
- return e.columns([
- e.display({
- id: "select",
- header: ({ table: e }) => /* @__PURE__ */ (0, Q.jsx)(a, {
- table: e,
- label: "全选已保存别名"
- }),
- cell: ({ row: e }) => /* @__PURE__ */ (0, Q.jsx)(z, {
- slot: null,
- "aria-label": `选择已保存别名 ${e.original.canonical_name}`,
- isSelected: e.getIsSelected(),
- onChange: (t) => e.toggleSelected(t)
- })
- }),
- e.accessor("canonical_name", {
- id: "canonical",
- header: "统一名称",
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)(Pt, {
- sources: G.current.sources,
- name: e.getValue(),
- canonicalKey: e.row.original.canonical_key
- })
- }),
- e.accessor("aliases", {
- header: "平台别名",
- sortFn: (e, t) => e.original.aliases.map((e) => e.name).join(" ").localeCompare(t.original.aliases.map((e) => e.name).join(" "), "zh-CN"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "flex flex-wrap items-center gap-1.5",
- children: e.getValue().map((e) => /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "inline-flex items-center gap-1 rounded-md bg-background-secondary-default px-1.5 py-1 text-caption-1-medium text-text-secondary",
- children: [e.name, /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "ghost",
- size: "xs",
- iconOnly: !0,
- leadingIcon: et,
- "aria-label": `移除别名 ${e.name}`,
- disabled: G.current.readOnly,
- ...Y(G.current.removing),
- onClick: () => G.current.remove(e.name)
- })]
- }, e.key))
- })
- }),
- e.display({
- id: "actions",
- header: "操作",
- cell: ({ row: e }) => /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- disabled: G.current.readOnly,
- "aria-label": `修改 ${e.original.canonical_name} 的统一名称`,
- onClick: () => G.current.rename(e.original),
- children: "修改统一名称"
- })
- })
- ]);
- }, []), K = s({
- features: Et,
- data: t,
- columns: ue,
- getRowId: Mt,
- state: {
- rowSelection: m,
- sorting: S,
- pagination: j,
- columnVisibility: c.visibility
- },
- onColumnVisibilityChange: c.change,
- onRowSelectionChange: (e) => {
- ee(), h(e);
- },
- onSortingChange: (e) => {
- C(e), O((e) => ({
- ...e,
- pageIndex: 0
- }));
- },
- onPaginationChange: O,
- enableRowSelection: !0
- }), fe = s({
- features: Dt,
- data: e,
- columns: de,
- getRowId: (e) => e.canonical_key,
- state: {
- rowSelection: _,
- sorting: w,
- pagination: ne,
- columnVisibility: l.visibility
- },
- onColumnVisibilityChange: l.change,
- onRowSelectionChange: (e) => {
- y(), v(e);
- },
- enableRowSelection: !0,
- onSortingChange: (e) => {
- T(e), A((e) => ({
- ...e,
- pageIndex: 0
- }));
- },
- onPaginationChange: A
- }), pe = K.getSelectedRowModel().rows.map((e) => e.original), q = fe.getSelectedRowModel().rows.flatMap((e) => e.original.aliases.map((e) => e.name)), me = Y(B.isPending);
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: ie({
- padding: "none",
- className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
- }),
- children: [
- /* @__PURE__ */ (0, Q.jsx)("h3", {
- className: "text-title-2-medium text-text-primary",
- children: "创作者别名"
- }),
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(u, { children: "手动添加别名" }), /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-end gap-2",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(je, {
- "aria-label": "统一名称",
- placeholder: "在 Peach 中统一显示的名称",
- value: I,
- onChange: L,
- isDisabled: i,
- className: "w-56"
- }),
- /* @__PURE__ */ (0, Q.jsx)(je, {
- "aria-label": "平台别名",
- placeholder: "平台别名",
- value: R,
- onChange: ae,
- isDisabled: i,
- className: "w-56"
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "primary",
- disabled: i || !I.trim() || !R.trim(),
- ...Y(V.isPending),
- onClick: () => V.mutate({
- canonical: I.trim(),
- alias: R.trim()
- }),
- children: "保存别名"
- })
- ]
- })]
- }),
- re ? /* @__PURE__ */ (0, Q.jsx)(N, { children: re }) : null,
- t.length ? /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-responsive-toolbar": "",
- children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-toolbar-heading": "",
- children: [/* @__PURE__ */ (0, Q.jsx)(u, { children: "待合并" }), /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "text-body-2-regular text-text-secondary",
- children: `${t.length} 组`
- })]
- }), /* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-toolbar-actions": "",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "primary",
- size: "small",
- disabled: i,
- ...me,
- onClick: () => U(t, !0),
- children: `全部合并(${t.length})`
- }),
- /* @__PURE__ */ (0, Q.jsx)(p, {
- label: "待合并创作者别名",
- sorting: S,
- options: [
- {
- id: "canonical",
- label: "统一名称"
- },
- {
- id: "alias",
- label: "平台别名"
- },
- {
- id: "evidence",
- label: "依据"
- }
- ],
- onChange: (e) => {
- C(e), O((e) => ({
- ...e,
- pageIndex: 0
- }));
- }
- }),
- /* @__PURE__ */ (0, Q.jsx)(De, {
- preferences: c,
- label: "待合并创作者别名"
- })
- ]
- })]
- }),
- /* @__PURE__ */ (0, Q.jsxs)(he, {
- label: "待合并别名批量操作",
- visible: pe.length > 0,
- count: `已选 ${pe.length} 组`,
- children: [/* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- disabled: i,
- ...me,
- onClick: () => U(pe, !1),
- children: `合并所选(${pe.length})`
- }), /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "ghost",
- size: "small",
- onClick: () => h({}),
- children: "取消选择"
- })]
- }),
- /* @__PURE__ */ (0, Q.jsx)(M, {
- follow: !0,
- preferences: c,
- onRowClick: (e) => K.getRow(e)?.toggleSelected(),
- children: /* @__PURE__ */ (0, Q.jsxs)(rt, {
- "aria-label": "待合并创作者别名",
- size: "sm",
- sortDescriptor: S[0] ? {
- column: S[0].id,
- direction: S[0].desc ? "descending" : "ascending"
- } : void 0,
- onSortChange: (e) => K.getColumn(String(e.column))?.toggleSorting(e.direction === "descending"),
- children: [/* @__PURE__ */ (0, Q.jsxs)(le, { children: [K.getHeaderGroups()[0].headers.map((e) => /* @__PURE__ */ (0, Q.jsx)(Re, {
- id: e.id,
- isRowHeader: e.column.id === "canonical",
- allowsSorting: e.column.getCanSort(),
- ...c.columnProps(e.id),
- children: ({ sortDirection: t }) => /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex items-center gap-0.5",
- children: [Fe(e.column.columnDef.header, e.getContext()), e.column.getCanSort() ? /* @__PURE__ */ (0, Q.jsx)("span", {
- "data-sort-indicator": !0,
- "data-direction": t || void 0,
- children: /* @__PURE__ */ (0, Q.jsx)(qe, {})
- }) : null]
- }), /* @__PURE__ */ (0, Q.jsx)(x, {
- preferences: c,
- id: e.id
- })] })
- }, e.id)), /* @__PURE__ */ (0, Q.jsx)(Re, {
- id: "remaining-space",
- "aria-label": "行空白区域",
- "data-table-space": "",
- width: c.spaceWidth,
- minWidth: 0
- })] }), /* @__PURE__ */ (0, Q.jsx)(Je, { children: K.getRowModel().rows.map((e) => /* @__PURE__ */ (0, Q.jsxs)(We, {
- id: e.id,
- "data-board-selected": e.getIsSelected() || void 0,
- children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, Q.jsx)(we, { children: Fe(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, Q.jsx)(we, { "data-table-space": "" })]
- }, e.id)) })]
- })
- }),
- /* @__PURE__ */ (0, Q.jsx)(D, {
- label: "待合并创作者别名",
- unit: "组",
- total: t.length,
- pagination: j,
- onChange: O
- })
- ]
- }) : null,
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-responsive-toolbar": "",
- children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-toolbar-heading": "",
- children: [/* @__PURE__ */ (0, Q.jsx)(u, { children: "已保存别名" }), /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "text-body-2-regular text-text-secondary",
- children: `${e.length} 组`
- })]
- }), /* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-toolbar-actions": "",
- children: [/* @__PURE__ */ (0, Q.jsx)(p, {
- label: "已保存创作者别名",
- sorting: w,
- options: [{
- id: "canonical",
- label: "统一名称"
- }, {
- id: "aliases",
- label: "平台别名"
- }],
- onChange: (e) => {
- T(e), A((e) => ({
- ...e,
- pageIndex: 0
- }));
- }
- }), /* @__PURE__ */ (0, Q.jsx)(De, {
- preferences: l,
- label: "已保存创作者别名"
- })]
- })]
- }),
- /* @__PURE__ */ (0, Q.jsxs)(he, {
- label: "已保存别名批量操作",
- visible: q.length > 0,
- count: `已选 ${q.length} 个别名`,
- children: [/* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- disabled: i,
- ...Y(H.isPending),
- onClick: () => void P({
- title: "移除所选创作者别名",
- body: `将移除以下 ${q.length} 个别名,对应来源恢复为独立创作者组。`,
- items: q,
- confirmLabel: "移除所选别名",
- onConfirm: () => H.mutateAsync(q)
- }),
- children: `移除所选别名(${q.length})`
- }), /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "ghost",
- size: "small",
- onClick: () => v({}),
- children: "取消选择"
- })]
- }),
- e.length ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(M, {
- follow: !0,
- preferences: l,
- onRowClick: (e) => fe.getRow(e)?.toggleSelected(),
- children: /* @__PURE__ */ (0, Q.jsxs)(rt, {
- "aria-label": "已保存创作者别名",
- size: "sm",
- sortDescriptor: w[0] ? {
- column: w[0].id,
- direction: w[0].desc ? "descending" : "ascending"
- } : void 0,
- onSortChange: (e) => fe.getColumn(String(e.column))?.toggleSorting(e.direction === "descending"),
- children: [/* @__PURE__ */ (0, Q.jsxs)(le, { children: [fe.getHeaderGroups()[0].headers.map((e) => /* @__PURE__ */ (0, Q.jsx)(Re, {
- id: e.id,
- isRowHeader: e.column.id === "canonical",
- allowsSorting: e.column.getCanSort(),
- ...l.columnProps(e.id),
- children: ({ sortDirection: t }) => /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex items-center gap-0.5",
- children: [Fe(e.column.columnDef.header, e.getContext()), e.column.getCanSort() ? /* @__PURE__ */ (0, Q.jsx)("span", {
- "data-sort-indicator": !0,
- "data-direction": t || void 0,
- children: /* @__PURE__ */ (0, Q.jsx)(qe, {})
- }) : null]
- }), /* @__PURE__ */ (0, Q.jsx)(x, {
- preferences: l,
- id: e.id
- })] })
- }, e.id)), /* @__PURE__ */ (0, Q.jsx)(Re, {
- id: "remaining-space",
- "aria-label": "行空白区域",
- "data-table-space": "",
- width: l.spaceWidth,
- minWidth: 0
- })] }), /* @__PURE__ */ (0, Q.jsx)(Je, { children: fe.getRowModel().rows.map((e) => /* @__PURE__ */ (0, Q.jsxs)(We, {
- id: e.id,
- "data-board-selected": e.getIsSelected() || void 0,
- children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, Q.jsx)(we, { children: Fe(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, Q.jsx)(we, { "data-table-space": "" })]
- }, e.id)) })]
- })
- }), /* @__PURE__ */ (0, Q.jsx)(D, {
- label: "已保存创作者别名",
- unit: "组",
- total: e.length,
- pagination: ne,
- onChange: A
- })] }) : /* @__PURE__ */ (0, Q.jsx)(Be, {
- size: "compact",
- icon: ke,
- title: "还没有保存创作者别名",
- actions: i ? void 0 : /* @__PURE__ */ (0, Q.jsx)(ce, {
- target: "input[aria-label=\"统一名称\"]",
- children: "添加别名"
- }),
- children: "填写统一名称,以及该创作者在其他平台使用的名字。"
- })
- ]
- }),
- /* @__PURE__ */ (0, Q.jsx)(Ct, {
- group: d,
- close: () => f(null),
- receipt: o
- })
- ]
- });
-}
-//#endregion
-//#region src/react/follow-manage/add-feed.tsx
-var It = "输入女优名,到 JavDB 找她的演员页";
-function Lt(e, t) {
- let n = /* @__PURE__ */ new Map();
- for (let r of e.candidates) t.has(r.id) && r.held_by && n.set(r.held_by.id, r.held_by.name);
- if (n.size > 1) return {
- text: `所勾的卡分属数据库里不同的人:${[...n.values()].join("、")},先去合并再订`,
- blocked: !0
- };
- let [r] = n.values();
- return r ? {
- text: `会登记到「${r}」名下`,
- blocked: !1
- } : e.known ? {
- text: `会登记到数据库里的「${e.known.name}」名下`,
- blocked: !1
- } : {
- text: `数据库里还没有「${e.q}」,会新建一位`,
- blocked: !1
- };
-}
-function Rt({ card: e, picked: t, onPick: n }) {
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(z, {
- isSelected: t,
- onChange: n,
- children: /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex min-w-0 flex-wrap items-center gap-1.5",
- children: [
- /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "min-w-0 break-words",
- children: e.names.join("、")
- }),
- e.record ? /* @__PURE__ */ (0, Q.jsx)(xe, {
- variant: "caption",
- color: "neutral",
- children: e.record
- }) : null,
- e.held_by ? /* @__PURE__ */ (0, Q.jsx)("small", {
- className: "text-caption-1-regular text-text-secondary",
- children: `已在「${e.held_by.name}」名下`
- }) : null
- ]
- })
- }), /* @__PURE__ */ (0, Q.jsx)(c, {
- href: e.url,
- children: e.id
- })]
- });
-}
-function zt({ readOnly: e, toast: t, onAdded: n }) {
- let [r, i] = (0, Z.useState)(""), [a, o] = (0, Z.useState)(null), [s, c] = (0, Z.useState)(/* @__PURE__ */ new Set()), l = _(), d = () => {
- let t = r.trim();
- t && !e && l.run("lookup", (e) => ve(t, e), (e) => {
- o(e), c(new Set(e.suggested));
- });
- }, f = (e) => {
- e.key === "Enter" && !e.nativeEvent.isComposing && (e.preventDefault(), d());
- }, p = () => {
- o(null), c(/* @__PURE__ */ new Set()), l.setError("");
- }, m = () => {
- a && l.run("follow", (e) => ze(a.q, [...s], e), (e) => {
- t(e.created ? `已新建「${e.entity_name}」并订阅她的新作` : `已订阅「${e.entity_name}」的新作`), i(""), p(), n();
- });
- }, h = a ? Lt(a, s) : null;
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: ie({
- padding: "none",
- className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
- }),
- children: [
- /* @__PURE__ */ (0, Q.jsx)("h3", {
- className: "text-title-2-medium text-text-primary",
- children: "添加 JAV 订阅"
- }),
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-end gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)("div", {
- className: "min-w-64 grow",
- children: /* @__PURE__ */ (0, Q.jsx)(je, {
- "aria-label": "女优名",
- placeholder: It,
- value: r,
- leadingIcon: ae,
- enterKeyHint: "search",
- isDisabled: e,
- onChange: i,
- onKeyDown: f
- })
- }), /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "primary",
- disabled: e || !r.trim(),
- ...Y(l.busy === "lookup"),
- onClick: d,
- children: "查找"
- })]
- }),
- l.error ? /* @__PURE__ */ (0, Q.jsx)(X, {
- tone: "error",
- title: "这一次没有完成",
- children: l.error
- }) : null,
- a ? /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-3",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(u, { children: "JavDB 上的演员卡" }),
- a.candidates.length ? a.candidates.map((e) => /* @__PURE__ */ (0, Q.jsx)(Rt, {
- card: e,
- picked: s.has(e.id),
- onPick: (t) => c((n) => {
- let r = new Set(n);
- return t ? r.add(e.id) : r.delete(e.id), r;
- })
- }, e.id)) : /* @__PURE__ */ (0, Q.jsx)(w, { children: "JavDB 上没有搜到这个名字。" }),
- a.candidates.length ? /* @__PURE__ */ (0, Q.jsx)(w, {
- role: "status",
- children: s.size ? h.text : "勾选她的演员卡;有碼与無碼两条记录都是她的话,两张都勾。"
- }) : null,
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- onClick: p,
- children: "关闭"
- }), a.candidates.length ? /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "primary",
- size: "small",
- disabled: e || !s.size || h.blocked,
- ...Y(l.busy === "follow"),
- onClick: m,
- children: `添加订阅(${s.size})`
- }) : null]
- })
- ]
- }) : null
- ]
- });
-}
-//#endregion
-//#region src/react/follow-manage/feed-sources.tsx
-var Bt = y({
- rowPaginationFeature: h,
- rowSelectionFeature: R,
- rowSortingFeature: I,
- columnVisibilityFeature: Ue,
- sortedRowModel: t(),
- paginatedRowModel: e()
-}), Vt = {
- select: "选择",
- name: "名称",
- kind: "类型",
- origin: "来源",
- status: "状态",
- interval: "频率",
- fetched: "上次拉取",
- fresh: "上次新增",
- actions: "操作"
-}, Ht = /* @__PURE__ */ new Set(["actions"]), Ut = Object.entries(Vt).map(([e, t]) => ({
- id: e,
- label: t,
- width: e === "select" ? 48 : e === "name" ? 300 : e === "actions" ? 208 : e === "fetched" ? 200 : 160,
- min: e === "select" ? 48 : e === "actions" ? 200 : e === "name" ? 300 : 112,
- max: e === "select" ? 48 : e === "name" ? 2e3 : 800,
- flex: e === "name",
- required: e === "select" || e === "name"
-})), Wt = () => v.invalidateQueries({
- queryKey: Ee,
- exact: !0
-}), $ = (e) => e.name || e.url;
-function Gt(e) {
- try {
- return new URL(e).hostname.replace(/^www\./, "");
- } catch {
- return e;
- }
-}
-function Kt({ source: e }) {
- return e.enabled ? e.last_error ? /* @__PURE__ */ (0, Q.jsx)(xe, {
- variant: "caption",
- color: "rose",
- children: "拉取失败"
- }) : e.last_fetched_at ? /* @__PURE__ */ (0, Q.jsx)(xe, {
- variant: "caption",
- color: "lime",
- children: "正常"
- }) : /* @__PURE__ */ (0, Q.jsx)(xe, {
- variant: "caption",
- color: "gray",
- children: "未检查"
- }) : /* @__PURE__ */ (0, Q.jsx)(xe, {
- variant: "caption",
- color: "gray",
- children: "已暂停"
- });
-}
-function qt({ source: e }) {
- let t = e.entity_id ? {
- id: e.entity_id,
- has_image: !!e.has_image,
- image_version: e.image_version,
- avatar_focus: e.avatar_focus
- } : null;
- return /* @__PURE__ */ (0, Q.jsx)("span", {
- "aria-hidden": !0,
- className: `relative inline-grid size-8 shrink-0 place-items-center overflow-hidden rounded-full bg-background-tertiary-default text-caption-1-semibold text-text-secondary ${st}`,
- dangerouslySetInnerHTML: { __html: d($(e), t, null, "performer") }
- });
-}
-var Jt = (e, t) => e.entity_id !== null && t.has(e.entity_id) && e.page_name && e.page_name !== e.name ? e.page_name : "";
-function Yt(e) {
- let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
- for (let { entity_id: r } of e) r !== null && (t.has(r) ? n.add(r) : t.add(r));
- return n;
-}
-function Xt(e, t) {
- let n = e.length === 1 ? e[0] : null;
- return P({
- title: n ? "移除订阅源" : `移除 ${e.length} 条订阅源`,
- body: n ? `将移除订阅源「${$(n)}」,之后不再拉取它的新作;已经拉到的新作保留。` : "将移除所选订阅源,之后不再拉取它们的新作;已经拉到的新作保留。",
- confirmLabel: n ? "移除订阅源" : "移除所选订阅源",
- danger: !0,
- onConfirm: t
- });
-}
-function Zt({ readOnly: e, toast: t }) {
- let n = G({
- queryKey: Ee,
- queryFn: ({ signal: e }) => Ke(e)
- }), r = _(), i = te("jav-feeds", Ut), o = n.data, c = (0, Z.useMemo)(() => o?.sources ?? [], [o]), [u, d] = (0, Z.useState)(/* @__PURE__ */ new Set()), [f, h] = (0, Z.useState)(1), [v, y] = (0, Z.useState)(20), [b, S] = (0, Z.useState)([]), T = be(c.length, v, f);
- (0, Z.useEffect)(() => {
- h((e) => Math.min(e, T.pages));
- }, [T.pages]), (0, Z.useEffect)(() => {
- d((e) => {
- let t = new Set(c.map((e) => e.id)), n = new Set([...e].filter((e) => t.has(e)));
- return n.size === e.size ? e : n;
- });
- }, [c]);
- let E = Te({
- mutationFn: async (e) => {
- let t = await A(e.ids, 4, async (t) => {
- e.action === "remove" ? await nt(t) : await $e(t, e.action === "enabled");
- });
- return {
- ...e,
- results: t
- };
- },
- onSuccess: (e) => {
- let n = e.results.filter((e) => !e.ok), i = e.ids.length - n.length;
- if (d(/* @__PURE__ */ new Set()), Wt(), e.action === "remove" && i && t(`已移除 ${i} 条订阅源`), n.length) {
- let e = n[0];
- r.setError(`${n.length} 条没有写入:${e.ok ? "" : g(e.error)}`);
- }
- },
- onError: (e) => r.setError(g(e))
- }), O = (0, Z.useMemo)(() => Yt(c), [c]), j = (0, Z.useRef)({
- readOnly: e,
- shared: O,
- busy: null,
- toggle: () => {},
- fetch: () => {},
- remove: () => {}
- });
- j.current = {
- readOnly: e,
- shared: O,
- busy: r.busy,
- toggle: (e, t) => void r.run(`enabled-${e.id}`, (n) => $e(e.id, t, n), () => void Wt()),
- fetch: (e) => void r.run(`check-${e.id}`, (t) => m(t, [e.id]), () => void Wt()),
- remove: (e) => void Xt([e], async () => {
- await nt(e.id), t(`已移除订阅源「${$(e)}」`), Wt();
- })
- };
- let ne = (0, Z.useMemo)(() => {
- let e = oe(), t = (e) => () => Vt[e] || e;
- return e.columns([
- e.display({
- id: "select",
- header: (e) => /* @__PURE__ */ (0, Q.jsx)(a, {
- table: e.table,
- label: "全选本页订阅源",
- page: !0
- }),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)(z, {
- slot: null,
- isSelected: e.row.getIsSelected(),
- onChange: (t) => e.row.toggleSelected(t),
- "aria-label": `选择 ${$(e.row.original)}`
- })
- }),
- e.accessor($, {
- id: "name",
- header: t("name"),
- cell: (e) => {
- let t = Jt(e.row.original, j.current.shared);
- return /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex items-center gap-2 whitespace-nowrap text-body-medium text-text-primary",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(qt, { source: e.row.original }),
- e.getValue(),
- t ? /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "text-body-2-regular text-text-secondary",
- title: `站上这一页挂在「${t}」名下`,
- children: t
- }) : null
- ]
- });
- }
- }),
- e.accessor((e) => e.kind_label, {
- id: "kind",
- header: t("kind"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "whitespace-nowrap",
- children: e.getValue()
- })
- }),
- e.accessor((e) => e.url, {
- id: "origin",
- header: t("origin"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsxs)("a", {
- href: e.getValue(),
- target: "_blank",
- rel: "noopener noreferrer",
- title: "打开来源页面",
- className: "text-text-primary underline-offset-2 hover:underline",
- children: [/* @__PURE__ */ (0, Q.jsx)(Ze, {
- site: e.row.original.kind.startsWith("javdb") ? "javdb" : Gt(e.getValue()),
- label: Gt(e.getValue())
- }), /* @__PURE__ */ (0, Q.jsx)(l, {
- "aria-hidden": !0,
- className: "size-(--icon-inline) shrink-0"
- })]
- })
- }),
- e.accessor((e) => e.last_error ? "拉取失败" : e.enabled ? "已启用" : "已暂停", {
- id: "status",
- header: t("status"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)(Kt, { source: e.row.original })
- }),
- e.accessor((e) => e.interval_minutes, {
- id: "interval",
- header: t("interval"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "whitespace-nowrap",
- children: k(e.getValue())
- })
- }),
- e.accessor((e) => e.last_fetched_at && Date.parse(e.last_fetched_at) || 0, {
- id: "fetched",
- header: t("fetched"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "whitespace-nowrap tabular-nums",
- children: e.row.original.last_fetched_at ? C(e.row.original.last_fetched_at) : "还没拉过"
- })
- }),
- e.accessor((e) => e.last_new_count, {
- id: "fresh",
- header: t("fresh"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "whitespace-nowrap tabular-nums",
- children: `${e.getValue()} 条`
- })
- }),
- e.display({
- id: "actions",
- header: t("actions"),
- cell: (e) => /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex items-center gap-1",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(V, {
- "aria-label": `启用 ${$(e.row.original)}`,
- isSelected: e.row.original.enabled,
- isDisabled: j.current.readOnly,
- onChange: (t) => j.current.toggle(e.row.original, t)
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- iconOnly: !0,
- leadingIcon: ee,
- "aria-label": `拉取 ${$(e.row.original)}`,
- disabled: j.current.readOnly,
- ...Y(j.current.busy === `check-${e.row.original.id}`),
- onClick: () => j.current.fetch(e.row.original)
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- iconOnly: !0,
- leadingIcon: ue,
- "aria-label": `移除 ${$(e.row.original)}`,
- disabled: j.current.readOnly,
- onClick: () => j.current.remove(e.row.original)
- })
- ]
- })
- })
- ]);
- }, []), re = (0, Z.useMemo)(() => Object.fromEntries([...u].map((e) => [String(e), !0])), [u]), P = s({
- features: Bt,
- data: c,
- columns: ne,
- getRowId: (e) => String(e.id),
- state: {
- rowSelection: re,
- sorting: b,
- pagination: {
- pageIndex: T.page - 1,
- pageSize: v
- },
- columnVisibility: i.visibility
- },
- onColumnVisibilityChange: i.change,
- onSortingChange: (e) => {
- S(e), h(1);
- },
- enableRowSelection: !0,
- onRowSelectionChange: (e) => {
- let t = typeof e == "function" ? e(re) : e;
- d(new Set(Object.entries(t).filter(([, e]) => e).map(([e]) => Number(e))));
- }
- });
- if (!o) return n.error ? /* @__PURE__ */ (0, Q.jsx)(X, {
- tone: "error",
- title: "打不开订阅源",
- children: g(n.error)
- }) : /* @__PURE__ */ (0, Q.jsx)(w, { children: "正在读订阅源。" });
- let F = () => void r.run("check", (e) => m(e), () => void Wt()), I = (e) => d((t) => {
- let n = new Set(t);
- return n.has(e) ? n.delete(e) : n.add(e), n;
- }), L = c.filter((e) => u.has(e.id)), R = c.filter((e) => e.last_error);
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-3",
- children: [/* @__PURE__ */ (0, Q.jsx)(zt, {
- readOnly: e,
- toast: t,
- onAdded: () => void Wt()
- }), /* @__PURE__ */ (0, Q.jsxs)("section", {
- "aria-label": "JAV 订阅列表",
- className: ie({
- padding: "none",
- className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
- }),
- children: [
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-responsive-toolbar": "",
- children: [/* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-toolbar-heading": "",
- children: [/* @__PURE__ */ (0, Q.jsx)("h3", {
- className: "text-title-2-medium text-text-primary",
- children: "JAV 订阅源"
- }), /* @__PURE__ */ (0, Q.jsx)("span", {
- className: "text-body-2-regular text-text-secondary",
- children: `${c.length.toLocaleString()} 个订阅源 · ${(Number(o.unread) || 0).toLocaleString()} 条未看`
- })]
- }), /* @__PURE__ */ (0, Q.jsxs)("div", {
- "data-toolbar-actions": "",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(J, {
- onClick: F,
- disabled: e,
- ...Y(r.busy === "check"),
- children: "立即拉取"
- }),
- /* @__PURE__ */ (0, Q.jsx)(De, {
- preferences: i,
- label: "JAV 订阅源"
- }),
- /* @__PURE__ */ (0, Q.jsx)(p, {
- label: "JAV 订阅源",
- sorting: b,
- onChange: (e) => {
- S(e), h(1);
- },
- options: [
- "name",
- "kind",
- "origin",
- "status",
- "interval",
- "fetched",
- "fresh"
- ].map((e) => ({
- id: e,
- label: Vt[e]
- }))
- })
- ]
- })]
- }),
- R.length || r.error ? /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: "flex flex-col gap-3",
- children: [R.length ? /* @__PURE__ */ (0, Q.jsx)(X, {
- tone: "error",
- title: `${R.length.toLocaleString()} 条订阅源拉取失败`,
- extra: /* @__PURE__ */ (0, Q.jsx)("ul", {
- className: "flex flex-col gap-0.5 text-body-2-regular",
- children: R.map((e) => /* @__PURE__ */ (0, Q.jsx)("li", {
- className: "min-w-0 truncate",
- title: e.last_error || "",
- children: `${$(e)}:${H(e.last_error || "") || "未说明原因"}`
- }, e.id))
- }),
- children: "这些订阅源这一轮没有取到新条目。"
- }) : null, r.error ? /* @__PURE__ */ (0, Q.jsx)(N, { children: r.error }) : null]
- }) : null,
- /* @__PURE__ */ (0, Q.jsxs)(he, {
- visible: L.length > 0,
- label: "订阅源批量操作",
- count: `已选 ${L.length} 条订阅源`,
- children: [
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- disabled: e,
- ...Y(E.isPending),
- onClick: () => E.mutate({
- ids: L.map((e) => e.id),
- action: "enabled"
- }),
- children: "启用"
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "secondary",
- size: "small",
- disabled: e,
- ...Y(E.isPending),
- onClick: () => E.mutate({
- ids: L.map((e) => e.id),
- action: "paused"
- }),
- children: "暂停"
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "danger",
- size: "small",
- disabled: e,
- ...Y(E.isPending),
- onClick: () => void Xt(L, () => E.mutateAsync({
- ids: L.map((e) => e.id),
- action: "remove"
- })),
- children: "移除"
- }),
- /* @__PURE__ */ (0, Q.jsx)(J, {
- variant: "ghost",
- size: "small",
- onClick: () => d(/* @__PURE__ */ new Set()),
- children: "取消选择"
- })
- ]
- }),
- c.length ? /* @__PURE__ */ (0, Q.jsx)(M, {
- follow: !0,
- preferences: i,
- onRowClick: (e) => I(Number(e)),
- children: /* @__PURE__ */ (0, Q.jsxs)(rt, {
- "aria-label": "JAV 订阅源",
- size: "sm",
- sortDescriptor: b[0] ? {
- column: b[0].id,
- direction: b[0].desc ? "descending" : "ascending"
- } : void 0,
- onSortChange: (e) => P.getColumn(String(e.column))?.toggleSorting(e.direction === "descending"),
- children: [/* @__PURE__ */ (0, Q.jsxs)(le, { children: [P.getHeaderGroups()[0].headers.map((e) => {
- let t = Fe(e.column.columnDef.header, e.getContext());
- return /* @__PURE__ */ (0, Q.jsx)(Re, {
- id: e.id,
- isRowHeader: e.column.id === "name",
- allowsSorting: e.column.getCanSort(),
- ...i.columnProps(e.id),
- children: ({ sortDirection: n }) => /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [Ht.has(e.column.id) ? /* @__PURE__ */ (0, Q.jsx)(Ie, { children: t }) : /* @__PURE__ */ (0, Q.jsxs)("span", {
- className: "flex items-center gap-0.5",
- children: [t, e.column.getCanSort() ? /* @__PURE__ */ (0, Q.jsx)("span", {
- "data-sort-indicator": !0,
- "data-direction": n || void 0,
- children: /* @__PURE__ */ (0, Q.jsx)(qe, {})
- }) : null]
- }), /* @__PURE__ */ (0, Q.jsx)(x, {
- preferences: i,
- id: e.id
- })] })
- }, e.id);
- }), /* @__PURE__ */ (0, Q.jsx)(Re, {
- id: "remaining-space",
- "aria-label": "行空白区域",
- "data-table-space": "",
- width: i.spaceWidth,
- minWidth: 0
- })] }), /* @__PURE__ */ (0, Q.jsx)(Je, { children: P.getRowModel().rows.map((e) => /* @__PURE__ */ (0, Q.jsxs)(We, {
- id: e.id,
- "data-follow-selected": e.getIsSelected() || void 0,
- children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, Q.jsx)(we, { children: Fe(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, Q.jsx)(we, { "data-table-space": "" })]
- }, e.id)) })]
- })
- }) : /* @__PURE__ */ (0, Q.jsx)(Be, {
- icon: ye,
- title: "还没有订阅源",
- size: "compact",
- actions: e ? void 0 : /* @__PURE__ */ (0, Q.jsx)(ce, {
- target: "input[aria-label=\"女优名\"]",
- children: "添加订阅"
- }),
- children: "在上面按女优名添加,或在人物页点「订阅新作」。"
- }),
- c.length ? /* @__PURE__ */ (0, Q.jsx)(D, {
- label: "JAV 订阅",
- total: T.total,
- unit: "个订阅源",
- pagination: {
- pageIndex: T.page - 1,
- pageSize: v
- },
- onChange: (e) => {
- y(e.pageSize), h(e.pageIndex + 1);
- }
- }) : null,
- /* @__PURE__ */ (0, Q.jsx)("footer", {
- className: "-mx-6 -mb-5 flex flex-wrap items-center gap-2 border-t border-separator-border rounded-b-2xl bg-card-footer px-6 py-4 max-sm:-mx-4 max-sm:px-4",
- children: /* @__PURE__ */ (0, Q.jsx)("span", {
- role: "status",
- className: "mr-auto text-body-2-regular text-text-secondary",
- children: `未看 ${(Number(o.unread) || 0).toLocaleString()} · 已启用 ${c.filter((e) => e.enabled).length.toLocaleString()} / ${c.length.toLocaleString()}`
- })
- })
- ]
- })]
- });
-}
-//#endregion
-//#region src/react/follow-manage/follow-manage-page.tsx
-var Qt = [
- ["list", "关注列表"],
- ["add", "添加关注"],
- ["feeds", "JAV 订阅源"]
-], $t = (e) => Qt.some(([t]) => t === e);
-function en({ term: e, figure: t, unit: n }) {
- return /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: ie({
- padding: "none",
- className: "flex flex-col gap-3 px-6 py-5 max-sm:gap-2 max-sm:p-4"
- }),
- children: [/* @__PURE__ */ (0, Q.jsx)("span", {
- className: "text-body-medium text-text-secondary",
- children: e
- }), /* @__PURE__ */ (0, Q.jsxs)("b", {
- "data-follow-reading": "",
- className: `flex min-w-0 flex-wrap items-baseline gap-x-1 tabular-nums text-text-primary ${t >= 1e6 ? "text-headline-medium" : t >= 1e5 ? "text-title-3-medium" : "text-title-1-medium"}`,
- children: [/* @__PURE__ */ (0, Q.jsx)("span", {
- className: "min-w-0 wrap-anywhere",
- children: t.toLocaleString()
- }), /* @__PURE__ */ (0, Q.jsx)("small", {
- className: "whitespace-nowrap text-body-2-regular text-text-secondary",
- children: ` ${n}`
- })]
- })]
- });
-}
-function tn(e) {
- let { route: t, savePreference: n, toast: r, openFollow: a, readOnly: o, readOnlyMessage: s, writerUrl: l } = e, [u, d] = (0, Z.useState)($t(e.tab) ? e.tab : "list"), [f, p] = (0, Z.useState)(Math.max(1, Math.floor(e.page) || 1)), [m, h] = (0, Z.useState)(() => L(e.sort, e.dir).sort), [g, _] = (0, Z.useState)(() => L(e.sort, e.dir).dir), [v, ee] = (0, Z.useState)(Ye(e.layout) ? e.layout : "default"), [y, b] = (0, Z.useState)(Ne(e.pageSize)), [x, te] = (0, Z.useState)(/* @__PURE__ */ new Set()), C = G({
- queryKey: E,
- queryFn: ({ signal: e }) => Le(e)
- }), w = G({
- queryKey: S,
- queryFn: ({ signal: e }) => ge(e)
- }), T = G({
- queryKey: Ee,
- queryFn: ({ signal: e }) => Ke(e)
- }), D = C.data || { sources: [] }, O = w.data || {
- root: "",
- providers: []
- }, k = D.sources;
- (0, Z.useEffect)(() => {
- te((e) => {
- let t = q(e, k);
- return t.size === e.size ? e : t;
- });
- }, [k]);
- let A = (e) => {
- let n = e.sort ?? m, r = e.dir ?? g;
- t({
- tab: e.tab ?? u,
- page: e.page ?? f,
- sort: n === "checked" ? "" : n,
- dir: r === it[n] ? "" : r
- });
- }, ne = de(k), re = k.filter(Ae).length, M = k.filter((e) => e.enabled).length, N = (O.providers || []).filter((e) => e.requirement === "required" && !B(e)).length, P = new Set((T.data?.sources || []).map((e) => e.entity_id ?? `source-${e.id}`)).size;
- return /* @__PURE__ */ (0, Q.jsxs)(at, { children: [
- o ? /* @__PURE__ */ (0, Q.jsx)(X, {
- tone: "warning",
- title: "本机只能浏览",
- extra: l ? /* @__PURE__ */ (0, Q.jsx)("p", {
- className: "text-body-2-regular",
- children: /* @__PURE__ */ (0, Q.jsx)(c, {
- href: l,
- children: "前往写入端管理关注"
- })
- }) : void 0,
- children: s
- }) : null,
- /* @__PURE__ */ (0, Q.jsxs)("div", {
- className: ot,
- "aria-label": "关注概览",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(en, {
- term: "关注创作者",
- figure: ne.length,
- unit: "位"
- }),
- /* @__PURE__ */ (0, Q.jsx)(en, {
- term: "启用来源",
- figure: M,
- unit: `/ ${k.length}`
- }),
- /* @__PURE__ */ (0, Q.jsx)(en, {
- term: "检查失败",
- figure: re,
- unit: "个来源"
- }),
- /* @__PURE__ */ (0, Q.jsx)(en, {
- term: "未看更新",
- figure: D.counts?.new || 0,
- unit: "条"
- }),
- /* @__PURE__ */ (0, Q.jsx)(en, {
- term: "JAV 订阅",
- figure: P,
- unit: "位"
- }),
- /* @__PURE__ */ (0, Q.jsx)(en, {
- term: "未看新作",
- figure: T.data?.unread || 0,
- unit: "条"
- })
- ]
- }),
- /* @__PURE__ */ (0, Q.jsxs)(i, {
- selectedKey: u,
- onSelectionChange: (e) => {
- let t = String(e);
- $t(t) && (d(t), A({ tab: t }));
- },
- className: "flex flex-col gap-6",
- children: [
- /* @__PURE__ */ (0, Q.jsx)(ct, {
- "aria-label": "关注管理区域",
- "data-section-nav": !0,
- "data-section-items": !0,
- className: "flex max-w-full flex-nowrap overflow-x-auto",
- children: Qt.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(j, {
- id: e,
- "data-pill-selected": u === e ? "" : void 0,
- "data-pill-variant": "gray",
- className: "cursor-pointer whitespace-nowrap",
- children: t
- }, e))
- }),
- /* @__PURE__ */ (0, Q.jsx)(U, {
- id: "list",
- className: "flex flex-col gap-4",
- children: /* @__PURE__ */ (0, Q.jsx)(dt, {
- data: D,
- sort: m,
- dir: g,
- page: f,
- layout: v,
- pageSize: y,
- selected: x,
- readOnly: o,
- toast: r,
- openFollow: a,
- onAdd: () => {
- d("add"), A({ tab: "add" });
- },
- onSort: (e, t) => {
- h(e), _(t), p(1), A({
- sort: e,
- dir: t,
- page: 1
- });
- },
- onPage: (e) => {
- p(e), A({ page: e });
- },
- onSelected: te,
- onLayout: (e) => {
- ee(e), p(1), n({ layout: e }), A({ page: 1 });
- },
- onPageSize: (e) => {
- b(e), p(1), n({ pageSize: e }), A({ page: 1 });
- }
- })
- }),
- /* @__PURE__ */ (0, Q.jsxs)(U, {
- id: "add",
- className: "flex flex-col gap-8",
- children: [/* @__PURE__ */ (0, Q.jsx)(St, {
- data: D,
- credentials: O,
- readOnly: o,
- toast: r
- }), /* @__PURE__ */ (0, Q.jsx)(Ft, {
- groups: D.author_aliases || [],
- readOnly: o,
- toast: r,
- suggestions: D.alias_suggestions || [],
- sources: D.sources
- })]
- }),
- /* @__PURE__ */ (0, Q.jsx)(U, {
- id: "feeds",
- className: "flex flex-col gap-4",
- children: /* @__PURE__ */ (0, Q.jsx)(Zt, {
- readOnly: o,
- toast: r
- })
- })
- ]
- }),
- /* @__PURE__ */ (0, Q.jsx)("div", { children: /* @__PURE__ */ (0, Q.jsxs)(Ve, {
- variant: "secondary",
- href: "/settings/subscriptions",
- children: ["来源与订阅设置", N ? `(${N})` : ""]
- }) })
- ] });
-}
-//#endregion
-export { tn as FollowManagePage };
-
-//# debugId=d24e1d7f-d204-4120-8c52-d8db621d5248
\ No newline at end of file
diff --git a/web/dist/peach-app.follow-manage-page-K8kzYRBb.js b/web/dist/peach-app.follow-manage-page-K8kzYRBb.js
new file mode 100644
index 000000000..555aa3221
--- /dev/null
+++ b/web/dist/peach-app.follow-manage-page-K8kzYRBb.js
@@ -0,0 +1,1905 @@
+(function() {
+ try {
+ var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b7e207ec-1afe-4be9-aa47-743c89380398", e._sentryDebugIdIdentifier = "sentry-dbid-b7e207ec-1afe-4be9-aa47-743c89380398");
+ } catch {}
+})();
+import { createPaginatedRowModel as e } from "./peach-app.createPaginatedRowModel-DKa1ysea.js";
+import { createSortedRowModel as t, useTableSelection as n } from "./peach-app.use-table-selection-Bi_E2zbh.js";
+import { $2ec61d1d4f780267$export$a8a3e93435678ff9 as r, $542a13ca2fa5b484$export$5b6b19405a83ff9d as i, $76d00c5a4edb230a$export$76ccd210b9029917 as a, $76d00c5a4edb230a$export$816b5d811295e6bc as o, $76d00c5a4edb230a$export$b59bdbef9ce70de2 as s, $76d00c5a4edb230a$export$f6f0c3fe4ec306ea as c, $76d00c5a4edb230a$export$f850895b287ef28e as l, $b4f18e3395fe64d7$export$3d96ec278d3efce4 as u, $b4f18e3395fe64d7$export$3e41faf802a29e71 as d, $b4f18e3395fe64d7$export$b2539bed5023c21c as f, $ea3928288112382f$export$439d29a4e110a164 as p, $f2ff30fde7b014be$export$3ddf2d174ce01153 as m, $l as h, Button as g, ButtonLink as _, Bx as v, Checkbox as y, ChevronSortDown as ee, Chip as b, DataTableFooter as te, DataTableFrame as x, DataTableSort as ne, EmptyFocusButton as S, EmptyState as C, ErrorText as re, ExternalLink as w, FEEDS_KEY as T, FOLLOW_CREDENTIALS_KEY as E, FOLLOW_MANAGE_KEY as D, FOLLOW_RESOLVE_KEY as O, FieldLabel as k, Help as A, Input as j, LoadingDots as M, M6 as N, MENU_ITEM as P, MENU_ITEM_INTERACTIVE as F, MENU_POPOVER_SURFACE as I, ModalFrame as L, Note as R, P7 as ie, SORT_DEFAULT_DIR as z, SelectionDock as ae, SiteLabel as B, Switch as oe, Table as se, TableColumnControls as ce, TableColumnResizer as le, TableSelectionHeader as ue, TaskProgress as V, Wt as de, Xf as fe, __toESM as pe, addAlias as me, addSource as he, avatarInner as H, busyProps as U, cardClass as W, checkFeeds as G, columnVisibilityFeature as ge, confirmModal as _e, createColumnHelper as ve, credentialDone as K, cx as ye, dZ as be, errorHeadline as q, errorMessage as J, feedIntervalText as xe, fetchCredentials as Se, fetchFeeds as Y, fetchFollow as Ce, fetchResolveJob as we, fetchSuggestions as Te, flexRender as Ee, followFeedByName as De, followSuggestKey as Oe, groupByAuthor as ke, isBroken as Ae, isLayout as je, keepSelected as Me, localTime as Ne, lookupFeedActor as Pe, mapLimit as Fe, pageSizeOf as Ie, pageWindow as Le, pv as Re, queryClient as ze, reloadFollowManage as Be, removeAlias as Ve, removeFeed as He, renameAliasGroup as Ue, require_jsx_runtime as We, require_react as Ge, resolveFollowSort as Ke, rowPaginationFeature as qe, rowSelectionFeature as Je, rowSortingFeature as Ye, setFeedEnabled as Xe, startCheck as Ze, startResolve as Qe, tableFeatures as $e, useAction as et, useBackgroundJob as tt, useMutation as nt, useQuery as rt, useTable as it, useTablePreferences as at } from "./peach-app.js";
+import { Page as ot } from "./peach-app.page-Irl_Wogd.js";
+import { STAT_STRIP_SIX as st } from "./peach-app.stat-card-Q_AB9v0S.js";
+import { LEGACY_AVATAR_IMG as ct } from "./peach-app.legacy-avatar-CtPLcaNX.js";
+import { PillAriaTabList as lt } from "./peach-app.pill-aria-tab-list-CJ47JigD.js";
+import { AuthorAvatar as ut, SourceIcon as dt } from "./peach-app.source-view-Bk_L5GHG.js";
+import { SourceList as ft } from "./peach-app.source-list-B2yIEqVl.js";
+//#region src/react/follow-manage/add-source.tsx
+var X = /* @__PURE__ */ pe(Ge(), 1), Z = We(), pt = ye(P, F, "text-body-2-medium"), mt = "粘贴来源链接,或输入创作者名、id…", ht = "查找中(首次按名字查要下载创作者索引,可能几十秒)", gt = "识别中", _t = "站内没有查到来源", vt = "/settings/subscriptions", yt = (e, t) => `${e}:${t.url}`;
+function bt({ field: e, menu: t, options: n, active: r, busy: a, onPick: o, onClose: s }) {
+ return (0, X.useEffect)(() => {
+ t.current?.querySelector("[aria-current=\"true\"]")?.scrollIntoView({ block: "nearest" });
+ }, [t, r]), /* @__PURE__ */ (0, Z.jsxs)(i, {
+ ref: t,
+ triggerRef: e,
+ isOpen: !0,
+ isNonModal: !0,
+ shouldFlip: !1,
+ onOpenChange: (e) => {
+ e || s();
+ },
+ placement: "bottom start",
+ offset: 4,
+ "aria-label": "来源建议",
+ className: ye(I, "flex w-(--trigger-width) flex-col gap-1 overscroll-contain"),
+ children: [a && !n.length ? /* @__PURE__ */ (0, Z.jsx)("div", {
+ className: "px-2 py-1.5",
+ children: /* @__PURE__ */ (0, Z.jsx)(M, { label: "正在查找建议" })
+ }) : null, n.map((e, t) => /* @__PURE__ */ (0, Z.jsxs)(X.Fragment, { children: [e.group === n[t - 1]?.group ? null : /* @__PURE__ */ (0, Z.jsx)("div", {
+ className: "px-2 pt-1 text-caption-1-regular text-text-tertiary",
+ children: e.group
+ }), /* @__PURE__ */ (0, Z.jsxs)("button", {
+ type: "button",
+ "aria-current": t === r ? "true" : void 0,
+ className: t === r ? ye(pt, "bg-background-secondary-default") : pt,
+ onMouseDown: (e) => e.preventDefault(),
+ onClick: () => o(e.value),
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "min-w-0 grow truncate text-left",
+ children: e.value
+ }),
+ e.matched ? /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "shrink-0 text-caption-1-regular text-text-tertiary",
+ children: e.matched
+ }) : null,
+ e.n ? /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "shrink-0 text-caption-1-regular tabular-nums text-text-tertiary",
+ children: e.n.toLocaleString()
+ }) : null
+ ]
+ })] }, `${e.group}-${e.value}`))]
+ });
+}
+function xt({ credentials: e, hidden: t, onHidden: n }) {
+ let r = (0, X.useRef)(null), [a, o] = (0, X.useState)(!1), s = (e.providers || []).filter((e) => e.followable), c = s.filter((e) => !t.has(e.provider_label)).length, l = c === s.length ? "全部来源" : `${c}/${s.length} 个来源`, u = (e, r) => {
+ let i = new Set(t);
+ r ? i.delete(e) : i.add(e), n(i);
+ };
+ return /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(g, {
+ ref: r,
+ variant: "secondary",
+ leadingIcon: h,
+ "aria-haspopup": "dialog",
+ "aria-expanded": a,
+ "aria-label": l,
+ onClick: () => o(!0),
+ children: l
+ }), /* @__PURE__ */ (0, Z.jsx)(i, {
+ triggerRef: r,
+ isOpen: a,
+ onOpenChange: o,
+ placement: "bottom end",
+ offset: 4,
+ className: I,
+ children: /* @__PURE__ */ (0, Z.jsxs)(m, {
+ "aria-label": "来源筛选",
+ className: "flex w-64 flex-col gap-1 outline-none",
+ children: [s.length ? /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex items-center gap-2 pb-1",
+ children: [/* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "ghost",
+ size: "small",
+ onClick: () => n(/* @__PURE__ */ new Set()),
+ children: "全选"
+ }), /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "ghost",
+ size: "small",
+ onClick: () => n(new Set(s.map((e) => e.provider_label))),
+ children: "全不选"
+ })]
+ }) : /* @__PURE__ */ (0, Z.jsx)(A, { children: "暂无可用来源" }), s.map((e) => {
+ let n = e.requirement === "required" && (!e.present || (e.missing || []).length > 0);
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex items-center gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)(y, {
+ isSelected: !t.has(e.provider_label),
+ onChange: (t) => u(e.provider_label, t),
+ children: /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex min-w-0 items-center gap-1.5",
+ children: [/* @__PURE__ */ (0, Z.jsx)(dt, { provider: e.provider }), e.provider_label]
+ })
+ }), n ? /* @__PURE__ */ (0, Z.jsx)(_, {
+ variant: "ghost",
+ size: "xs",
+ className: "ml-auto",
+ href: vt,
+ onClick: () => o(!1),
+ children: "打开凭据设置"
+ }) : null]
+ }, e.provider);
+ })]
+ })
+ })] });
+}
+function St({ row: e, at: t, hidden: n, unpicked: r, onPick: i }) {
+ if (e.kind === "error") return /* @__PURE__ */ (0, Z.jsx)(R, {
+ tone: "error",
+ title: e.line,
+ children: e.error || "查找失败"
+ });
+ let a = (e.candidates || []).filter((e) => !n.has(e.provider_label || "")), o = Object.entries(e.failures || {});
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: W({
+ variant: "outlined",
+ padding: "none",
+ className: "flex flex-col gap-2 p-4"
+ }),
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)("b", {
+ className: "text-body-medium text-text-primary",
+ children: e.line
+ }),
+ a.length ? a.map((e) => {
+ let n = yt(t, e);
+ return /* @__PURE__ */ (0, Z.jsx)(y, {
+ isSelected: !e.known && !r.has(n),
+ isDisabled: e.known,
+ onChange: (e) => i(n, e),
+ children: /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex min-w-0 flex-wrap items-center gap-1.5",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(dt, { provider: e.provider }),
+ /* @__PURE__ */ (0, Z.jsx)("b", {
+ className: "text-body-medium",
+ children: e.provider_label
+ }),
+ /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "min-w-0 break-words",
+ children: e.label
+ }),
+ /* @__PURE__ */ (0, Z.jsx)("small", {
+ className: "text-caption-1-regular text-text-secondary",
+ children: e.known ? "已经关注" : e.evidence
+ })
+ ]
+ })
+ }, n);
+ }) : /* @__PURE__ */ (0, Z.jsx)(A, { children: _t }),
+ (e.external_searches || []).map((e) => /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)("small", {
+ className: "text-caption-1-regular text-text-secondary",
+ children: e.evidence
+ }), /* @__PURE__ */ (0, Z.jsx)(w, {
+ href: e.url,
+ children: `${e.label}:${e.query}`
+ })]
+ }, e.url)),
+ o.length ? /* @__PURE__ */ (0, Z.jsx)(A, { children: o.map(([e, t]) => `${e}:${t}`).join(";") }) : null
+ ]
+ });
+}
+function Ct({ data: e, credentials: t, readOnly: n, toast: r }) {
+ let [i, a] = (0, X.useState)(""), [o, s] = (0, X.useState)(!1), [c, l] = (0, X.useState)(""), [u, d] = (0, X.useState)(""), [f, p] = (0, X.useState)(!1), [m, h] = (0, X.useState)(null), [_, v] = (0, X.useState)(-1), y = (0, X.useRef)(null), ee = (0, X.useRef)(null), [b, te] = (0, X.useState)(/* @__PURE__ */ new Set()), [x, ne] = (0, X.useState)(/* @__PURE__ */ new Set()), [S, C] = (0, X.useState)(""), [re, w] = (0, X.useState)(0);
+ (0, X.useEffect)(() => {
+ let e = i.trim();
+ if (o || !e || e.includes("/")) {
+ d("");
+ return;
+ }
+ let t = setTimeout(() => d(e), 250);
+ return () => clearTimeout(t);
+ }, [i, o]);
+ let T = rt({
+ queryKey: Oe(u),
+ queryFn: ({ signal: e }) => Te(u, e),
+ enabled: u.length > 0 && f && !o && m !== i
+ }), E = (0, X.useMemo)(() => (T.data?.groups || []).flatMap((e) => e.items.map((t) => ({
+ value: t.value,
+ matched: t.matched || "",
+ n: t.n || 0,
+ group: e.label
+ }))), [T.data]), { job: D, running: A, outcome: M, start: N, dismiss: P } = tt({
+ queryKey: O,
+ queryFn: ({ signal: e }) => we(e),
+ start: (e) => Qe([e]),
+ onStarted: () => ne(/* @__PURE__ */ new Set()),
+ onError: (e) => C(J(e)),
+ onFinish: (e) => {
+ e.status === "failed" && C(e.error || "查找失败");
+ }
+ }), F = (e) => {
+ let t = e.trim();
+ !t || n || o || A || N.isPending || (C(""), v(-1), l(t), a(t), d(""), h(t), N.mutate(t));
+ }, I = T.isFetching, L = f && !o && m !== i && (E.length > 0 || I), ie = () => {
+ v(-1), h(i);
+ }, z = (e) => {
+ if (!(o || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229)) {
+ if (e.key === "Escape" && L) ie();
+ else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
+ if (!E.length) return;
+ if (e.preventDefault(), !L) {
+ h(null);
+ return;
+ }
+ let t = e.key === "ArrowDown" ? 1 : -1;
+ v((e) => {
+ let n = e + t;
+ return n < 0 ? E.length - 1 : n >= E.length ? 0 : n;
+ });
+ } else e.key === "Enter" && (e.preventDefault(), F(E[_]?.value || i));
+ }
+ }, ae = M?.results || [], B = ae.flatMap((e, t) => (e.candidates || []).filter((e) => !e.known && !b.has(e.provider_label || "")).map((e) => ({
+ candidate: e,
+ key: yt(t, e)
+ })).filter((e) => !x.has(e.key))), oe = nt({
+ mutationFn: async (e) => {
+ let t = [], n = [];
+ w(0);
+ for (let r of e) {
+ try {
+ let e = await he(r.candidate);
+ n.push(e.source);
+ } catch (e) {
+ t.push(`${r.candidate.label}:${J(e)}`);
+ }
+ w((e) => e + 1);
+ }
+ if (n.length) try {
+ await Ze(n);
+ } catch (e) {
+ t.push(J(e));
+ }
+ return {
+ failures: t,
+ sources: n
+ };
+ },
+ onSuccess: (e) => {
+ Be(), e.failures.length ? C(e.failures.join(";")) : (C(""), P(), r(`已添加 ${e.sources.length} 个关注来源`));
+ },
+ onError: (e) => C(J(e))
+ }), se = e.suggestions || [], ce = !c.includes("/");
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: W({
+ padding: "none",
+ className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
+ }),
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)("h3", {
+ className: "text-title-2-medium text-text-primary",
+ children: "添加关注"
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-end gap-2",
+ children: [
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ ref: y,
+ className: "min-w-64 grow",
+ onFocus: () => p(!0),
+ onBlur: (e) => {
+ let t = e.relatedTarget;
+ !e.currentTarget.contains(t) && !ee.current?.contains(t) && p(!1);
+ },
+ children: [/* @__PURE__ */ (0, Z.jsx)(j, {
+ "aria-label": "来源链接、名字或 id",
+ placeholder: mt,
+ value: i,
+ leadingIcon: Re,
+ enterKeyHint: "search",
+ isDisabled: n,
+ onChange: a,
+ onCompositionStart: () => {
+ s(!0), v(-1);
+ },
+ onCompositionEnd: (e) => {
+ s(!1), a(e.currentTarget.value);
+ },
+ onKeyDown: z
+ }), L ? /* @__PURE__ */ (0, Z.jsx)(bt, {
+ field: y,
+ menu: ee,
+ options: E,
+ active: _,
+ busy: I,
+ onPick: F,
+ onClose: ie
+ }) : null]
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(xt, {
+ credentials: t,
+ hidden: b,
+ onHidden: te
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "primary",
+ disabled: n || !i.trim(),
+ ...U(A || N.isPending),
+ onClick: () => F(i),
+ children: "查找"
+ })
+ ]
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ "aria-live": "polite",
+ className: "flex flex-col gap-3 empty:hidden",
+ children: [A || N.isPending ? /* @__PURE__ */ (0, Z.jsx)(V, {
+ embedded: !0,
+ label: D?.message || (D?.total ? `查找中:${D.checked || 0}/${D.total}` : ce ? ht : gt),
+ value: D?.checked,
+ total: D?.total
+ }) : null, S ? /* @__PURE__ */ (0, Z.jsx)(R, {
+ tone: "error",
+ title: "这一次没有完成",
+ children: S
+ }) : null]
+ }),
+ ae.length ? /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-3",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(k, { children: "查找结果" }),
+ ae.map((e, t) => /* @__PURE__ */ (0, Z.jsx)(St, {
+ row: e,
+ at: t,
+ hidden: b,
+ unpicked: x,
+ onPick: (e, t) => {
+ let n = new Set(x);
+ t ? n.delete(e) : n.add(e), ne(n);
+ }
+ }, `${e.line}-${t}`)),
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-2",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ onClick: () => P(),
+ children: "关闭"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "primary",
+ size: "small",
+ disabled: n || !B.length,
+ ...U(oe.isPending),
+ onClick: () => oe.mutate(B),
+ children: `添加选中(${B.length})`
+ }),
+ oe.isPending ? /* @__PURE__ */ (0, Z.jsx)("span", {
+ role: "status",
+ className: "text-body-2-regular text-text-secondary",
+ children: `添加中… ${re}/${B.length}`
+ }) : null
+ ]
+ })
+ ]
+ }) : null,
+ se.length ? /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "text-body-2-regular text-text-secondary",
+ children: "猜你喜欢"
+ }), se.map((e) => /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ disabled: n,
+ title: `浏览历史里出现 ${e.visits} 次${e.origin ? ` · ${e.origin}` : ""}`,
+ onClick: () => F(e.name),
+ children: e.name
+ }, e.name))]
+ }) : null
+ ]
+ });
+}
+//#endregion
+//#region src/react/follow-manage/alias-rename-dialog.tsx
+function wt({ group: e, close: t, receipt: n }) {
+ return /* @__PURE__ */ (0, Z.jsx)(L, {
+ isOpen: !!e,
+ onOpenChange: (e) => {
+ e || t();
+ },
+ width: "form",
+ label: "修改统一名称",
+ children: e ? /* @__PURE__ */ (0, Z.jsx)(Tt, {
+ group: e,
+ close: t,
+ receipt: n
+ }, e.canonical_key) : null
+ });
+}
+function Tt({ group: e, close: t, receipt: n }) {
+ let [i, a] = (0, X.useState)(e.canonical_name), o = et();
+ return /* @__PURE__ */ (0, Z.jsxs)("form", {
+ onSubmit: (r) => {
+ r.preventDefault(), i.trim() && i.trim() !== e.canonical_name && o.run("rename", (t) => Ue(e.canonical_key, i.trim(), t), () => {
+ Be(), n(`已把统一名称改为 ${i.trim()}`), t();
+ });
+ },
+ className: "flex min-h-0 flex-col gap-4 p-5",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(r, {
+ slot: "title",
+ className: "text-title-2-semibold text-text-primary",
+ children: "修改统一名称"
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)("p", {
+ className: "text-body-2-regular wrap-anywhere text-text-secondary",
+ children: ["当前名称:", e.canonical_name]
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(j, {
+ "aria-label": "统一名称",
+ autoFocus: !0,
+ value: i,
+ onChange: a
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)(k, { children: "选择已有别名" }), /* @__PURE__ */ (0, Z.jsx)("div", {
+ className: "flex flex-wrap gap-2",
+ children: e.aliases.map((e) => /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ onClick: () => a(e.name),
+ children: e.name
+ }, e.key))
+ })]
+ }),
+ /* @__PURE__ */ (0, Z.jsx)("p", {
+ className: "text-body-2-regular text-text-secondary",
+ children: "原名称保留为别名,关联档案和作品署名会同步更新。"
+ }),
+ o.error ? /* @__PURE__ */ (0, Z.jsx)(R, {
+ tone: "error",
+ children: o.error
+ }) : null,
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap justify-end gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ onClick: t,
+ children: "取消"
+ }), /* @__PURE__ */ (0, Z.jsx)(g, {
+ type: "submit",
+ variant: "primary",
+ disabled: !i.trim() || i.trim() === e.canonical_name,
+ ...U(!!o.busy),
+ children: "修改统一名称"
+ })]
+ })
+ ]
+ });
+}
+//#endregion
+//#region src/react/follow-manage/alias-manager.tsx
+var Et = (e) => `将移除别名「${e}」,对应来源恢复为独立创作者组。`, Dt = $e({
+ rowSelectionFeature: Je,
+ rowSortingFeature: Ye,
+ rowPaginationFeature: qe,
+ columnVisibilityFeature: ge,
+ sortedRowModel: t(),
+ paginatedRowModel: e()
+}), Ot = Dt, kt = {
+ id: "select",
+ label: "选择",
+ width: 48,
+ min: 48,
+ max: 48,
+ required: !0
+}, At = {
+ id: "canonical",
+ label: "统一名称",
+ width: 280,
+ min: 240,
+ required: !0,
+ flex: !0
+}, jt = [
+ kt,
+ At,
+ {
+ id: "alias",
+ label: "平台别名",
+ width: 240
+ },
+ {
+ id: "evidence",
+ label: "依据",
+ width: 320
+ },
+ {
+ id: "actions",
+ label: "操作",
+ width: 112
+ }
+], Mt = [
+ kt,
+ At,
+ {
+ id: "aliases",
+ label: "平台别名",
+ width: 400
+ },
+ {
+ id: "actions",
+ label: "操作",
+ width: 184,
+ min: 168
+ }
+], Nt = (e) => e.alias;
+function Pt(e, t, n) {
+ let r = n ? `name:${n}` : "", i = r && e.find((e) => e.author_key === r) || e.find((e) => e.author_name === t || e.entity_name === t);
+ return i ? e.filter((e) => e.author_key === i.author_key) : [];
+}
+function Ft({ sources: e, name: t, canonicalKey: n }) {
+ return /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex items-center gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)(ut, {
+ group: Pt(e, t, n),
+ name: t
+ }), /* @__PURE__ */ (0, Z.jsx)("b", {
+ className: "text-body-medium",
+ children: t
+ })]
+ });
+}
+function It({ groups: e, suggestions: t, sources: r = [], readOnly: i, toast: u }) {
+ let d = at("alias-suggestions", jt), f = at("alias-saved", Mt), [p, m] = (0, X.useState)(null), [h, _] = (0, X.useState)({}), [v, b] = (0, X.useState)({}), w = n(() => _({})), T = n(() => b({})), [E, D] = (0, X.useState)([]), [O, A] = (0, X.useState)([]), [M, N] = (0, X.useState)({
+ pageIndex: 0,
+ pageSize: 20
+ }), [P, F] = (0, X.useState)({
+ pageIndex: 0,
+ pageSize: 20
+ }), I = {
+ ...M,
+ pageIndex: Math.min(M.pageIndex, Math.max(0, Math.ceil(t.length / M.pageSize) - 1))
+ }, L = {
+ ...P,
+ pageIndex: Math.min(P.pageIndex, Math.max(0, Math.ceil(e.length / P.pageSize) - 1))
+ }, [R, z] = (0, X.useState)(""), [B, oe] = (0, X.useState)(""), [V, de] = (0, X.useState)(""), pe = nt({
+ mutationFn: async (e) => {
+ let t = 0;
+ for (let n of e) {
+ try {
+ await me(n.canonical, n.alias);
+ } catch (n) {
+ throw t && Be(), Error(`${J(n)}(还有 ${e.length - t} 组没有合并)`);
+ }
+ t += 1;
+ }
+ return {
+ done: t,
+ items: e
+ };
+ },
+ onSuccess: (e) => {
+ z(""), _({}), Be(), u(`已合并 ${e.done} 组创作者别名`);
+ },
+ onError: (e) => z(J(e))
+ }), he = nt({
+ mutationFn: (e) => me(e.canonical, e.alias),
+ onSuccess: () => {
+ z(""), oe(""), de(""), Be(), u("已保存创作者别名");
+ },
+ onError: (e) => z(J(e))
+ }), H = nt({
+ mutationFn: async (e) => {
+ let t = typeof e == "string" ? [e] : e, n = 0;
+ try {
+ for (let e of t) await Ve(e), n += 1;
+ } catch (e) {
+ throw Error(`${J(e)}(已移除 ${n} 个别名,还有 ${t.length - n} 个未移除)`);
+ } finally {
+ Be();
+ }
+ },
+ onSuccess: () => {
+ z(""), b({}), u("已移除创作者别名");
+ },
+ onError: (e) => z(J(e))
+ }), G = (e, t) => {
+ e.length && _e({
+ title: t ? "合并全部创作者别名" : "合并所选创作者别名",
+ body: `将合并以下 ${e.length} 组创作者:${e.map((e) => `「${e.alias}」归入「${e.canonical}」`).join(";")}。`,
+ confirmLabel: t ? "合并全部别名" : "合并所选别名",
+ onConfirm: () => pe.mutateAsync(e)
+ });
+ }, ge = (e) => void _e({
+ title: "移除创作者别名",
+ body: Et(e),
+ confirmLabel: "移除创作者别名",
+ onConfirm: () => H.mutateAsync(e)
+ }), K = (0, X.useRef)({
+ sources: r,
+ readOnly: i,
+ merging: pe.isPending,
+ removing: H.isPending,
+ merge: G,
+ remove: ge,
+ rename: m
+ });
+ K.current = {
+ sources: r,
+ readOnly: i,
+ merging: pe.isPending,
+ removing: H.isPending,
+ merge: G,
+ remove: ge,
+ rename: m
+ };
+ let ye = (0, X.useMemo)(() => {
+ let e = ve();
+ return e.columns([
+ e.display({
+ id: "select",
+ header: (e) => /* @__PURE__ */ (0, Z.jsx)(ue, {
+ table: e.table,
+ label: "全选待合并别名"
+ }),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)(y, {
+ slot: null,
+ isSelected: e.row.getIsSelected(),
+ "aria-label": `选择别名 ${e.row.original.alias},归入 ${e.row.original.canonical}`,
+ onChange: (t) => e.row.toggleSelected(t)
+ })
+ }),
+ e.accessor("canonical", {
+ header: "统一名称",
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)(Ft, {
+ sources: K.current.sources,
+ name: e.getValue()
+ })
+ }),
+ e.accessor("alias", {
+ header: "平台别名",
+ cell: (e) => e.getValue()
+ }),
+ e.accessor("evidence", {
+ header: "依据",
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "text-body-2-regular text-text-secondary",
+ children: e.getValue()
+ })
+ }),
+ e.display({
+ id: "actions",
+ header: "操作",
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ disabled: K.current.readOnly,
+ ...U(K.current.merging),
+ onClick: () => K.current.merge([e.row.original], !1),
+ children: "合并"
+ })
+ })
+ ]);
+ }, []), be = (0, X.useMemo)(() => {
+ let e = ve();
+ return e.columns([
+ e.display({
+ id: "select",
+ header: ({ table: e }) => /* @__PURE__ */ (0, Z.jsx)(ue, {
+ table: e,
+ label: "全选已保存别名"
+ }),
+ cell: ({ row: e }) => /* @__PURE__ */ (0, Z.jsx)(y, {
+ slot: null,
+ "aria-label": `选择已保存别名 ${e.original.canonical_name}`,
+ isSelected: e.getIsSelected(),
+ onChange: (t) => e.toggleSelected(t)
+ })
+ }),
+ e.accessor("canonical_name", {
+ id: "canonical",
+ header: "统一名称",
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)(Ft, {
+ sources: K.current.sources,
+ name: e.getValue(),
+ canonicalKey: e.row.original.canonical_key
+ })
+ }),
+ e.accessor("aliases", {
+ header: "平台别名",
+ sortFn: (e, t) => e.original.aliases.map((e) => e.name).join(" ").localeCompare(t.original.aliases.map((e) => e.name).join(" "), "zh-CN"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "flex flex-wrap items-center gap-1.5",
+ children: e.getValue().map((e) => /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "inline-flex items-center gap-1 rounded-md bg-background-secondary-default px-1.5 py-1 text-caption-1-medium text-text-secondary",
+ children: [e.name, /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "ghost",
+ size: "xs",
+ iconOnly: !0,
+ leadingIcon: ie,
+ "aria-label": `移除别名 ${e.name}`,
+ disabled: K.current.readOnly,
+ ...U(K.current.removing),
+ onClick: () => K.current.remove(e.name)
+ })]
+ }, e.key))
+ })
+ }),
+ e.display({
+ id: "actions",
+ header: "操作",
+ cell: ({ row: e }) => /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ disabled: K.current.readOnly,
+ "aria-label": `修改 ${e.original.canonical_name} 的统一名称`,
+ onClick: () => K.current.rename(e.original),
+ children: "修改统一名称"
+ })
+ })
+ ]);
+ }, []), q = it({
+ features: Dt,
+ data: t,
+ columns: ye,
+ getRowId: Nt,
+ state: {
+ rowSelection: h,
+ sorting: E,
+ pagination: I,
+ columnVisibility: d.visibility
+ },
+ onColumnVisibilityChange: d.change,
+ onRowSelectionChange: (e) => {
+ w(), _(e);
+ },
+ onSortingChange: (e) => {
+ D(e), N((e) => ({
+ ...e,
+ pageIndex: 0
+ }));
+ },
+ onPaginationChange: N,
+ enableRowSelection: !0
+ }), xe = it({
+ features: Ot,
+ data: e,
+ columns: be,
+ getRowId: (e) => e.canonical_key,
+ state: {
+ rowSelection: v,
+ sorting: O,
+ pagination: L,
+ columnVisibility: f.visibility
+ },
+ onColumnVisibilityChange: f.change,
+ onRowSelectionChange: (e) => {
+ T(), b(e);
+ },
+ enableRowSelection: !0,
+ onSortingChange: (e) => {
+ A(e), F((e) => ({
+ ...e,
+ pageIndex: 0
+ }));
+ },
+ onPaginationChange: F
+ }), Se = q.getSelectedRowModel().rows.map((e) => e.original), Y = xe.getSelectedRowModel().rows.flatMap((e) => e.original.aliases.map((e) => e.name)), Ce = U(pe.isPending);
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: W({
+ padding: "none",
+ className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
+ }),
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)("h3", {
+ className: "text-title-2-medium text-text-primary",
+ children: "创作者别名"
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)(k, { children: "手动添加别名" }), /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-end gap-2",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(j, {
+ "aria-label": "统一名称",
+ placeholder: "在 Peach 中统一显示的名称",
+ value: B,
+ onChange: oe,
+ isDisabled: i,
+ className: "w-56"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(j, {
+ "aria-label": "平台别名",
+ placeholder: "平台别名",
+ value: V,
+ onChange: de,
+ isDisabled: i,
+ className: "w-56"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "primary",
+ disabled: i || !B.trim() || !V.trim(),
+ ...U(he.isPending),
+ onClick: () => he.mutate({
+ canonical: B.trim(),
+ alias: V.trim()
+ }),
+ children: "保存别名"
+ })
+ ]
+ })]
+ }),
+ R ? /* @__PURE__ */ (0, Z.jsx)(re, { children: R }) : null,
+ t.length ? /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-responsive-toolbar": "",
+ children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-toolbar-heading": "",
+ children: [/* @__PURE__ */ (0, Z.jsx)(k, { children: "待合并" }), /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "text-body-2-regular text-text-secondary",
+ children: `${t.length} 组`
+ })]
+ }), /* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-toolbar-actions": "",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "primary",
+ size: "small",
+ disabled: i,
+ ...Ce,
+ onClick: () => G(t, !0),
+ children: `全部合并(${t.length})`
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(ne, {
+ label: "待合并创作者别名",
+ sorting: E,
+ options: [
+ {
+ id: "canonical",
+ label: "统一名称"
+ },
+ {
+ id: "alias",
+ label: "平台别名"
+ },
+ {
+ id: "evidence",
+ label: "依据"
+ }
+ ],
+ onChange: (e) => {
+ D(e), N((e) => ({
+ ...e,
+ pageIndex: 0
+ }));
+ }
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(ce, {
+ preferences: d,
+ label: "待合并创作者别名"
+ })
+ ]
+ })]
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)(ae, {
+ label: "待合并别名批量操作",
+ visible: Se.length > 0,
+ count: `已选 ${Se.length} 组`,
+ children: [/* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ disabled: i,
+ ...Ce,
+ onClick: () => G(Se, !1),
+ children: `合并所选(${Se.length})`
+ }), /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "ghost",
+ size: "small",
+ onClick: () => _({}),
+ children: "取消选择"
+ })]
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(x, {
+ follow: !0,
+ preferences: d,
+ onRowClick: (e) => q.getRow(e)?.toggleSelected(),
+ children: /* @__PURE__ */ (0, Z.jsxs)(se, {
+ "aria-label": "待合并创作者别名",
+ size: "sm",
+ sortDescriptor: E[0] ? {
+ column: E[0].id,
+ direction: E[0].desc ? "descending" : "ascending"
+ } : void 0,
+ onSortChange: (e) => q.getColumn(String(e.column))?.toggleSorting(e.direction === "descending"),
+ children: [/* @__PURE__ */ (0, Z.jsxs)(l, { children: [q.getHeaderGroups()[0].headers.map((e) => /* @__PURE__ */ (0, Z.jsx)(o, {
+ id: e.id,
+ isRowHeader: e.column.id === "canonical",
+ allowsSorting: e.column.getCanSort(),
+ ...d.columnProps(e.id),
+ children: ({ sortDirection: t }) => /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex items-center gap-0.5",
+ children: [Ee(e.column.columnDef.header, e.getContext()), e.column.getCanSort() ? /* @__PURE__ */ (0, Z.jsx)("span", {
+ "data-sort-indicator": !0,
+ "data-direction": t || void 0,
+ children: /* @__PURE__ */ (0, Z.jsx)(ee, {})
+ }) : null]
+ }), /* @__PURE__ */ (0, Z.jsx)(le, {
+ preferences: d,
+ id: e.id
+ })] })
+ }, e.id)), /* @__PURE__ */ (0, Z.jsx)(o, {
+ id: "remaining-space",
+ "aria-label": "行空白区域",
+ "data-table-space": "",
+ width: d.spaceWidth,
+ minWidth: 0
+ })] }), /* @__PURE__ */ (0, Z.jsx)(a, { children: q.getRowModel().rows.map((e) => /* @__PURE__ */ (0, Z.jsxs)(s, {
+ id: e.id,
+ "data-board-selected": e.getIsSelected() || void 0,
+ children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, Z.jsx)(c, { children: Ee(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, Z.jsx)(c, { "data-table-space": "" })]
+ }, e.id)) })]
+ })
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(te, {
+ label: "待合并创作者别名",
+ unit: "组",
+ total: t.length,
+ pagination: I,
+ onChange: N
+ })
+ ]
+ }) : null,
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-responsive-toolbar": "",
+ children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-toolbar-heading": "",
+ children: [/* @__PURE__ */ (0, Z.jsx)(k, { children: "已保存别名" }), /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "text-body-2-regular text-text-secondary",
+ children: `${e.length} 组`
+ })]
+ }), /* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-toolbar-actions": "",
+ children: [/* @__PURE__ */ (0, Z.jsx)(ne, {
+ label: "已保存创作者别名",
+ sorting: O,
+ options: [{
+ id: "canonical",
+ label: "统一名称"
+ }, {
+ id: "aliases",
+ label: "平台别名"
+ }],
+ onChange: (e) => {
+ A(e), F((e) => ({
+ ...e,
+ pageIndex: 0
+ }));
+ }
+ }), /* @__PURE__ */ (0, Z.jsx)(ce, {
+ preferences: f,
+ label: "已保存创作者别名"
+ })]
+ })]
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)(ae, {
+ label: "已保存别名批量操作",
+ visible: Y.length > 0,
+ count: `已选 ${Y.length} 个别名`,
+ children: [/* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ disabled: i,
+ ...U(H.isPending),
+ onClick: () => void _e({
+ title: "移除所选创作者别名",
+ body: `将移除以下 ${Y.length} 个别名,对应来源恢复为独立创作者组。`,
+ items: Y,
+ confirmLabel: "移除所选别名",
+ onConfirm: () => H.mutateAsync(Y)
+ }),
+ children: `移除所选别名(${Y.length})`
+ }), /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "ghost",
+ size: "small",
+ onClick: () => b({}),
+ children: "取消选择"
+ })]
+ }),
+ e.length ? /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(x, {
+ follow: !0,
+ preferences: f,
+ onRowClick: (e) => xe.getRow(e)?.toggleSelected(),
+ children: /* @__PURE__ */ (0, Z.jsxs)(se, {
+ "aria-label": "已保存创作者别名",
+ size: "sm",
+ sortDescriptor: O[0] ? {
+ column: O[0].id,
+ direction: O[0].desc ? "descending" : "ascending"
+ } : void 0,
+ onSortChange: (e) => xe.getColumn(String(e.column))?.toggleSorting(e.direction === "descending"),
+ children: [/* @__PURE__ */ (0, Z.jsxs)(l, { children: [xe.getHeaderGroups()[0].headers.map((e) => /* @__PURE__ */ (0, Z.jsx)(o, {
+ id: e.id,
+ isRowHeader: e.column.id === "canonical",
+ allowsSorting: e.column.getCanSort(),
+ ...f.columnProps(e.id),
+ children: ({ sortDirection: t }) => /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex items-center gap-0.5",
+ children: [Ee(e.column.columnDef.header, e.getContext()), e.column.getCanSort() ? /* @__PURE__ */ (0, Z.jsx)("span", {
+ "data-sort-indicator": !0,
+ "data-direction": t || void 0,
+ children: /* @__PURE__ */ (0, Z.jsx)(ee, {})
+ }) : null]
+ }), /* @__PURE__ */ (0, Z.jsx)(le, {
+ preferences: f,
+ id: e.id
+ })] })
+ }, e.id)), /* @__PURE__ */ (0, Z.jsx)(o, {
+ id: "remaining-space",
+ "aria-label": "行空白区域",
+ "data-table-space": "",
+ width: f.spaceWidth,
+ minWidth: 0
+ })] }), /* @__PURE__ */ (0, Z.jsx)(a, { children: xe.getRowModel().rows.map((e) => /* @__PURE__ */ (0, Z.jsxs)(s, {
+ id: e.id,
+ "data-board-selected": e.getIsSelected() || void 0,
+ children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, Z.jsx)(c, { children: Ee(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, Z.jsx)(c, { "data-table-space": "" })]
+ }, e.id)) })]
+ })
+ }), /* @__PURE__ */ (0, Z.jsx)(te, {
+ label: "已保存创作者别名",
+ unit: "组",
+ total: e.length,
+ pagination: L,
+ onChange: F
+ })] }) : /* @__PURE__ */ (0, Z.jsx)(C, {
+ size: "compact",
+ icon: fe,
+ title: "还没有保存创作者别名",
+ actions: i ? void 0 : /* @__PURE__ */ (0, Z.jsx)(S, {
+ target: "input[aria-label=\"统一名称\"]",
+ children: "添加别名"
+ }),
+ children: "填写统一名称,以及该创作者在其他平台使用的名字。"
+ })
+ ]
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(wt, {
+ group: p,
+ close: () => m(null),
+ receipt: u
+ })
+ ]
+ });
+}
+//#endregion
+//#region src/react/follow-manage/add-feed.tsx
+var Lt = "输入女优名,到 JavDB 找她的演员页";
+function Rt(e, t) {
+ let n = /* @__PURE__ */ new Map();
+ for (let r of e.candidates) t.has(r.id) && r.held_by && n.set(r.held_by.id, r.held_by.name);
+ if (n.size > 1) return {
+ text: `所勾的卡分属数据库里不同的人:${[...n.values()].join("、")},先去合并再订`,
+ blocked: !0
+ };
+ let [r] = n.values();
+ return r ? {
+ text: `会登记到「${r}」名下`,
+ blocked: !1
+ } : e.known ? {
+ text: `会登记到数据库里的「${e.known.name}」名下`,
+ blocked: !1
+ } : {
+ text: `数据库里还没有「${e.q}」,会新建一位`,
+ blocked: !1
+ };
+}
+function zt({ card: e, picked: t, onPick: n }) {
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)(y, {
+ isSelected: t,
+ onChange: n,
+ children: /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex min-w-0 flex-wrap items-center gap-1.5",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "min-w-0 break-words",
+ children: e.names.join("、")
+ }),
+ e.record ? /* @__PURE__ */ (0, Z.jsx)(b, {
+ variant: "caption",
+ color: "neutral",
+ children: e.record
+ }) : null,
+ e.held_by ? /* @__PURE__ */ (0, Z.jsx)("small", {
+ className: "text-caption-1-regular text-text-secondary",
+ children: `已在「${e.held_by.name}」名下`
+ }) : null
+ ]
+ })
+ }), /* @__PURE__ */ (0, Z.jsx)(w, {
+ href: e.url,
+ children: e.id
+ })]
+ });
+}
+function Bt({ readOnly: e, toast: t, onAdded: n }) {
+ let [r, i] = (0, X.useState)(""), [a, o] = (0, X.useState)(null), [s, c] = (0, X.useState)(/* @__PURE__ */ new Set()), l = et(), u = () => {
+ let t = r.trim();
+ t && !e && l.run("lookup", (e) => Pe(t, e), (e) => {
+ o(e), c(new Set(e.suggested));
+ });
+ }, d = (e) => {
+ e.key === "Enter" && !e.nativeEvent.isComposing && (e.preventDefault(), u());
+ }, f = () => {
+ o(null), c(/* @__PURE__ */ new Set()), l.setError("");
+ }, p = () => {
+ a && l.run("follow", (e) => De(a.q, [...s], e), (e) => {
+ t(e.created ? `已新建「${e.entity_name}」并订阅她的新作` : `已订阅「${e.entity_name}」的新作`), i(""), f(), n();
+ });
+ }, m = a ? Rt(a, s) : null;
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: W({
+ padding: "none",
+ className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
+ }),
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)("h3", {
+ className: "text-title-2-medium text-text-primary",
+ children: "添加 JAV 订阅"
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-end gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)("div", {
+ className: "min-w-64 grow",
+ children: /* @__PURE__ */ (0, Z.jsx)(j, {
+ "aria-label": "女优名",
+ placeholder: Lt,
+ value: r,
+ leadingIcon: Re,
+ enterKeyHint: "search",
+ isDisabled: e,
+ onChange: i,
+ onKeyDown: d
+ })
+ }), /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "primary",
+ disabled: e || !r.trim(),
+ ...U(l.busy === "lookup"),
+ onClick: u,
+ children: "查找"
+ })]
+ }),
+ l.error ? /* @__PURE__ */ (0, Z.jsx)(R, {
+ tone: "error",
+ title: "这一次没有完成",
+ children: l.error
+ }) : null,
+ a ? /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-3",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(k, { children: "JavDB 上的演员卡" }),
+ a.candidates.length ? a.candidates.map((e) => /* @__PURE__ */ (0, Z.jsx)(zt, {
+ card: e,
+ picked: s.has(e.id),
+ onPick: (t) => c((n) => {
+ let r = new Set(n);
+ return t ? r.add(e.id) : r.delete(e.id), r;
+ })
+ }, e.id)) : /* @__PURE__ */ (0, Z.jsx)(A, { children: "JavDB 上没有搜到这个名字。" }),
+ a.candidates.length ? /* @__PURE__ */ (0, Z.jsx)(A, {
+ role: "status",
+ children: s.size ? m.text : "勾选她的演员卡;有碼与無碼两条记录都是她的话,两张都勾。"
+ }) : null,
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-2",
+ children: [/* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ onClick: f,
+ children: "关闭"
+ }), a.candidates.length ? /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "primary",
+ size: "small",
+ disabled: e || !s.size || m.blocked,
+ ...U(l.busy === "follow"),
+ onClick: p,
+ children: `添加订阅(${s.size})`
+ }) : null]
+ })
+ ]
+ }) : null
+ ]
+ });
+}
+//#endregion
+//#region src/react/follow-manage/feed-sources.tsx
+var Vt = $e({
+ rowPaginationFeature: qe,
+ rowSelectionFeature: Je,
+ rowSortingFeature: Ye,
+ columnVisibilityFeature: ge,
+ sortedRowModel: t(),
+ paginatedRowModel: e()
+}), Ht = {
+ select: "选择",
+ name: "名称",
+ kind: "类型",
+ origin: "来源",
+ status: "状态",
+ interval: "频率",
+ fetched: "上次拉取",
+ fresh: "上次新增",
+ actions: "操作"
+}, Ut = /* @__PURE__ */ new Set(["actions"]), Wt = Object.entries(Ht).map(([e, t]) => ({
+ id: e,
+ label: t,
+ width: e === "select" ? 48 : e === "name" ? 300 : e === "actions" ? 208 : e === "fetched" ? 200 : 160,
+ min: e === "select" ? 48 : e === "actions" ? 200 : e === "name" ? 300 : 112,
+ max: e === "select" ? 48 : e === "name" ? 2e3 : 800,
+ flex: e === "name",
+ required: e === "select" || e === "name"
+})), Gt = () => ze.invalidateQueries({
+ queryKey: T,
+ exact: !0
+}), Q = (e) => e.name || e.url;
+function Kt(e) {
+ try {
+ return new URL(e).hostname.replace(/^www\./, "");
+ } catch {
+ return e;
+ }
+}
+function qt({ source: e }) {
+ return e.enabled ? e.last_error ? /* @__PURE__ */ (0, Z.jsx)(b, {
+ variant: "caption",
+ color: "rose",
+ children: "拉取失败"
+ }) : e.last_fetched_at ? /* @__PURE__ */ (0, Z.jsx)(b, {
+ variant: "caption",
+ color: "lime",
+ children: "正常"
+ }) : /* @__PURE__ */ (0, Z.jsx)(b, {
+ variant: "caption",
+ color: "gray",
+ children: "未检查"
+ }) : /* @__PURE__ */ (0, Z.jsx)(b, {
+ variant: "caption",
+ color: "gray",
+ children: "已暂停"
+ });
+}
+function Jt({ source: e }) {
+ let t = e.entity_id ? {
+ id: e.entity_id,
+ has_image: !!e.has_image,
+ image_version: e.image_version,
+ avatar_focus: e.avatar_focus
+ } : null;
+ return /* @__PURE__ */ (0, Z.jsx)("span", {
+ "aria-hidden": !0,
+ className: `relative inline-grid size-8 shrink-0 place-items-center overflow-hidden rounded-full bg-background-tertiary-default text-caption-1-semibold text-text-secondary ${ct}`,
+ dangerouslySetInnerHTML: { __html: H(Q(e), t, null, "performer") }
+ });
+}
+var Yt = (e, t) => e.entity_id !== null && t.has(e.entity_id) && e.page_name && e.page_name !== e.name ? e.page_name : "";
+function Xt(e) {
+ let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
+ for (let { entity_id: r } of e) r !== null && (t.has(r) ? n.add(r) : t.add(r));
+ return n;
+}
+function Zt(e, t) {
+ let n = e.length === 1 ? e[0] : null;
+ return _e({
+ title: n ? "移除订阅源" : `移除 ${e.length} 条订阅源`,
+ body: n ? `将移除订阅源「${Q(n)}」,之后不再拉取它的新作;已经拉到的新作保留。` : "将移除所选订阅源,之后不再拉取它们的新作;已经拉到的新作保留。",
+ confirmLabel: n ? "移除订阅源" : "移除所选订阅源",
+ danger: !0,
+ onConfirm: t
+ });
+}
+function Qt({ readOnly: e, toast: t }) {
+ let n = rt({
+ queryKey: T,
+ queryFn: ({ signal: e }) => Y(e)
+ }), r = et(), i = at("jav-feeds", Wt), u = n.data, d = (0, X.useMemo)(() => u?.sources ?? [], [u]), [f, m] = (0, X.useState)(/* @__PURE__ */ new Set()), [h, _] = (0, X.useState)(1), [b, w] = (0, X.useState)(20), [E, D] = (0, X.useState)([]), O = Le(d.length, b, h);
+ (0, X.useEffect)(() => {
+ _((e) => Math.min(e, O.pages));
+ }, [O.pages]), (0, X.useEffect)(() => {
+ m((e) => {
+ let t = new Set(d.map((e) => e.id)), n = new Set([...e].filter((e) => t.has(e)));
+ return n.size === e.size ? e : n;
+ });
+ }, [d]);
+ let k = nt({
+ mutationFn: async (e) => {
+ let t = await Fe(e.ids, 4, async (t) => {
+ e.action === "remove" ? await He(t) : await Xe(t, e.action === "enabled");
+ });
+ return {
+ ...e,
+ results: t
+ };
+ },
+ onSuccess: (e) => {
+ let n = e.results.filter((e) => !e.ok), i = e.ids.length - n.length;
+ if (m(/* @__PURE__ */ new Set()), Gt(), e.action === "remove" && i && t(`已移除 ${i} 条订阅源`), n.length) {
+ let e = n[0];
+ r.setError(`${n.length} 条没有写入:${e.ok ? "" : J(e.error)}`);
+ }
+ },
+ onError: (e) => r.setError(J(e))
+ }), j = (0, X.useMemo)(() => Xt(d), [d]), M = (0, X.useRef)({
+ readOnly: e,
+ shared: j,
+ busy: null,
+ toggle: () => {},
+ fetch: () => {},
+ remove: () => {}
+ });
+ M.current = {
+ readOnly: e,
+ shared: j,
+ busy: r.busy,
+ toggle: (e, t) => void r.run(`enabled-${e.id}`, (n) => Xe(e.id, t, n), () => void Gt()),
+ fetch: (e) => void r.run(`check-${e.id}`, (t) => G(t, [e.id]), () => void Gt()),
+ remove: (e) => void Zt([e], async () => {
+ await He(e.id), t(`已移除订阅源「${Q(e)}」`), Gt();
+ })
+ };
+ let P = (0, X.useMemo)(() => {
+ let e = ve(), t = (e) => () => Ht[e] || e;
+ return e.columns([
+ e.display({
+ id: "select",
+ header: (e) => /* @__PURE__ */ (0, Z.jsx)(ue, {
+ table: e.table,
+ label: "全选本页订阅源",
+ page: !0
+ }),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)(y, {
+ slot: null,
+ isSelected: e.row.getIsSelected(),
+ onChange: (t) => e.row.toggleSelected(t),
+ "aria-label": `选择 ${Q(e.row.original)}`
+ })
+ }),
+ e.accessor(Q, {
+ id: "name",
+ header: t("name"),
+ cell: (e) => {
+ let t = Yt(e.row.original, M.current.shared);
+ return /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex items-center gap-2 whitespace-nowrap text-body-medium text-text-primary",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(Jt, { source: e.row.original }),
+ e.getValue(),
+ t ? /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "text-body-2-regular text-text-secondary",
+ title: `站上这一页挂在「${t}」名下`,
+ children: t
+ }) : null
+ ]
+ });
+ }
+ }),
+ e.accessor((e) => e.kind_label, {
+ id: "kind",
+ header: t("kind"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "whitespace-nowrap",
+ children: e.getValue()
+ })
+ }),
+ e.accessor((e) => e.url, {
+ id: "origin",
+ header: t("origin"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsxs)("a", {
+ href: e.getValue(),
+ target: "_blank",
+ rel: "noopener noreferrer",
+ title: "打开来源页面",
+ className: "text-text-primary underline-offset-2 hover:underline",
+ children: [/* @__PURE__ */ (0, Z.jsx)(B, {
+ site: e.row.original.kind.startsWith("javdb") ? "javdb" : Kt(e.getValue()),
+ label: Kt(e.getValue())
+ }), /* @__PURE__ */ (0, Z.jsx)(de, {
+ "aria-hidden": !0,
+ className: "size-(--icon-inline) shrink-0"
+ })]
+ })
+ }),
+ e.accessor((e) => e.last_error ? "拉取失败" : e.enabled ? "已启用" : "已暂停", {
+ id: "status",
+ header: t("status"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)(qt, { source: e.row.original })
+ }),
+ e.accessor((e) => e.interval_minutes, {
+ id: "interval",
+ header: t("interval"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "whitespace-nowrap",
+ children: xe(e.getValue())
+ })
+ }),
+ e.accessor((e) => e.last_fetched_at && Date.parse(e.last_fetched_at) || 0, {
+ id: "fetched",
+ header: t("fetched"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "whitespace-nowrap tabular-nums",
+ children: e.row.original.last_fetched_at ? Ne(e.row.original.last_fetched_at) : "还没拉过"
+ })
+ }),
+ e.accessor((e) => e.last_new_count, {
+ id: "fresh",
+ header: t("fresh"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "whitespace-nowrap tabular-nums",
+ children: `${e.getValue()} 条`
+ })
+ }),
+ e.display({
+ id: "actions",
+ header: t("actions"),
+ cell: (e) => /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex items-center gap-1",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(oe, {
+ "aria-label": `启用 ${Q(e.row.original)}`,
+ isSelected: e.row.original.enabled,
+ isDisabled: M.current.readOnly,
+ onChange: (t) => M.current.toggle(e.row.original, t)
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ iconOnly: !0,
+ leadingIcon: be,
+ "aria-label": `拉取 ${Q(e.row.original)}`,
+ disabled: M.current.readOnly,
+ ...U(M.current.busy === `check-${e.row.original.id}`),
+ onClick: () => M.current.fetch(e.row.original)
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ iconOnly: !0,
+ leadingIcon: N,
+ "aria-label": `移除 ${Q(e.row.original)}`,
+ disabled: M.current.readOnly,
+ onClick: () => M.current.remove(e.row.original)
+ })
+ ]
+ })
+ })
+ ]);
+ }, []), F = (0, X.useMemo)(() => Object.fromEntries([...f].map((e) => [String(e), !0])), [f]), I = it({
+ features: Vt,
+ data: d,
+ columns: P,
+ getRowId: (e) => String(e.id),
+ state: {
+ rowSelection: F,
+ sorting: E,
+ pagination: {
+ pageIndex: O.page - 1,
+ pageSize: b
+ },
+ columnVisibility: i.visibility
+ },
+ onColumnVisibilityChange: i.change,
+ onSortingChange: (e) => {
+ D(e), _(1);
+ },
+ enableRowSelection: !0,
+ onRowSelectionChange: (e) => {
+ let t = typeof e == "function" ? e(F) : e;
+ m(new Set(Object.entries(t).filter(([, e]) => e).map(([e]) => Number(e))));
+ }
+ });
+ if (!u) return n.error ? /* @__PURE__ */ (0, Z.jsx)(R, {
+ tone: "error",
+ title: "打不开订阅源",
+ children: J(n.error)
+ }) : /* @__PURE__ */ (0, Z.jsx)(A, { children: "正在读订阅源。" });
+ let L = () => void r.run("check", (e) => G(e), () => void Gt()), ie = (e) => m((t) => {
+ let n = new Set(t);
+ return n.has(e) ? n.delete(e) : n.add(e), n;
+ }), z = d.filter((e) => f.has(e.id)), V = d.filter((e) => e.last_error);
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-3",
+ children: [/* @__PURE__ */ (0, Z.jsx)(Bt, {
+ readOnly: e,
+ toast: t,
+ onAdded: () => void Gt()
+ }), /* @__PURE__ */ (0, Z.jsxs)("section", {
+ "aria-label": "JAV 订阅列表",
+ className: W({
+ padding: "none",
+ className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
+ }),
+ children: [
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-responsive-toolbar": "",
+ children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-toolbar-heading": "",
+ children: [/* @__PURE__ */ (0, Z.jsx)("h3", {
+ className: "text-title-2-medium text-text-primary",
+ children: "JAV 订阅源"
+ }), /* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "text-body-2-regular text-text-secondary",
+ children: `${d.length.toLocaleString()} 个订阅源 · ${(Number(u.unread) || 0).toLocaleString()} 条未看`
+ })]
+ }), /* @__PURE__ */ (0, Z.jsxs)("div", {
+ "data-toolbar-actions": "",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ onClick: L,
+ disabled: e,
+ ...U(r.busy === "check"),
+ children: "立即拉取"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(ce, {
+ preferences: i,
+ label: "JAV 订阅源"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(ne, {
+ label: "JAV 订阅源",
+ sorting: E,
+ onChange: (e) => {
+ D(e), _(1);
+ },
+ options: [
+ "name",
+ "kind",
+ "origin",
+ "status",
+ "interval",
+ "fetched",
+ "fresh"
+ ].map((e) => ({
+ id: e,
+ label: Ht[e]
+ }))
+ })
+ ]
+ })]
+ }),
+ V.length || r.error ? /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: "flex flex-col gap-3",
+ children: [V.length ? /* @__PURE__ */ (0, Z.jsx)(R, {
+ tone: "error",
+ title: `${V.length.toLocaleString()} 条订阅源拉取失败`,
+ extra: /* @__PURE__ */ (0, Z.jsx)("ul", {
+ className: "flex flex-col gap-0.5 text-body-2-regular",
+ children: V.map((e) => /* @__PURE__ */ (0, Z.jsx)("li", {
+ className: "min-w-0 truncate",
+ title: e.last_error || "",
+ children: `${Q(e)}:${q(e.last_error || "") || "未说明原因"}`
+ }, e.id))
+ }),
+ children: "这些订阅源这一轮没有取到新条目。"
+ }) : null, r.error ? /* @__PURE__ */ (0, Z.jsx)(re, { children: r.error }) : null]
+ }) : null,
+ /* @__PURE__ */ (0, Z.jsxs)(ae, {
+ visible: z.length > 0,
+ label: "订阅源批量操作",
+ count: `已选 ${z.length} 条订阅源`,
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ disabled: e,
+ ...U(k.isPending),
+ onClick: () => k.mutate({
+ ids: z.map((e) => e.id),
+ action: "enabled"
+ }),
+ children: "启用"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "secondary",
+ size: "small",
+ disabled: e,
+ ...U(k.isPending),
+ onClick: () => k.mutate({
+ ids: z.map((e) => e.id),
+ action: "paused"
+ }),
+ children: "暂停"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "danger",
+ size: "small",
+ disabled: e,
+ ...U(k.isPending),
+ onClick: () => void Zt(z, () => k.mutateAsync({
+ ids: z.map((e) => e.id),
+ action: "remove"
+ })),
+ children: "移除"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(g, {
+ variant: "ghost",
+ size: "small",
+ onClick: () => m(/* @__PURE__ */ new Set()),
+ children: "取消选择"
+ })
+ ]
+ }),
+ d.length ? /* @__PURE__ */ (0, Z.jsx)(x, {
+ follow: !0,
+ preferences: i,
+ onRowClick: (e) => ie(Number(e)),
+ children: /* @__PURE__ */ (0, Z.jsxs)(se, {
+ "aria-label": "JAV 订阅源",
+ size: "sm",
+ sortDescriptor: E[0] ? {
+ column: E[0].id,
+ direction: E[0].desc ? "descending" : "ascending"
+ } : void 0,
+ onSortChange: (e) => I.getColumn(String(e.column))?.toggleSorting(e.direction === "descending"),
+ children: [/* @__PURE__ */ (0, Z.jsxs)(l, { children: [I.getHeaderGroups()[0].headers.map((e) => {
+ let t = Ee(e.column.columnDef.header, e.getContext());
+ return /* @__PURE__ */ (0, Z.jsx)(o, {
+ id: e.id,
+ isRowHeader: e.column.id === "name",
+ allowsSorting: e.column.getCanSort(),
+ ...i.columnProps(e.id),
+ children: ({ sortDirection: n }) => /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [Ut.has(e.column.id) ? /* @__PURE__ */ (0, Z.jsx)(p, { children: t }) : /* @__PURE__ */ (0, Z.jsxs)("span", {
+ className: "flex items-center gap-0.5",
+ children: [t, e.column.getCanSort() ? /* @__PURE__ */ (0, Z.jsx)("span", {
+ "data-sort-indicator": !0,
+ "data-direction": n || void 0,
+ children: /* @__PURE__ */ (0, Z.jsx)(ee, {})
+ }) : null]
+ }), /* @__PURE__ */ (0, Z.jsx)(le, {
+ preferences: i,
+ id: e.id
+ })] })
+ }, e.id);
+ }), /* @__PURE__ */ (0, Z.jsx)(o, {
+ id: "remaining-space",
+ "aria-label": "行空白区域",
+ "data-table-space": "",
+ width: i.spaceWidth,
+ minWidth: 0
+ })] }), /* @__PURE__ */ (0, Z.jsx)(a, { children: I.getRowModel().rows.map((e) => /* @__PURE__ */ (0, Z.jsxs)(s, {
+ id: e.id,
+ "data-follow-selected": e.getIsSelected() || void 0,
+ children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, Z.jsx)(c, { children: Ee(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, Z.jsx)(c, { "data-table-space": "" })]
+ }, e.id)) })]
+ })
+ }) : /* @__PURE__ */ (0, Z.jsx)(C, {
+ icon: v,
+ title: "还没有订阅源",
+ size: "compact",
+ actions: e ? void 0 : /* @__PURE__ */ (0, Z.jsx)(S, {
+ target: "input[aria-label=\"女优名\"]",
+ children: "添加订阅"
+ }),
+ children: "在上面按女优名添加,或在人物页点「订阅新作」。"
+ }),
+ d.length ? /* @__PURE__ */ (0, Z.jsx)(te, {
+ label: "JAV 订阅",
+ total: O.total,
+ unit: "个订阅源",
+ pagination: {
+ pageIndex: O.page - 1,
+ pageSize: b
+ },
+ onChange: (e) => {
+ w(e.pageSize), _(e.pageIndex + 1);
+ }
+ }) : null,
+ /* @__PURE__ */ (0, Z.jsx)("footer", {
+ className: "-mx-6 -mb-5 flex flex-wrap items-center gap-2 border-t border-separator-border rounded-b-2xl bg-card-footer px-6 py-4 max-sm:-mx-4 max-sm:px-4",
+ children: /* @__PURE__ */ (0, Z.jsx)("span", {
+ role: "status",
+ className: "mr-auto text-body-2-regular text-text-secondary",
+ children: `未看 ${(Number(u.unread) || 0).toLocaleString()} · 已启用 ${d.filter((e) => e.enabled).length.toLocaleString()} / ${d.length.toLocaleString()}`
+ })
+ })
+ ]
+ })]
+ });
+}
+//#endregion
+//#region src/react/follow-manage/follow-manage-page.tsx
+var $t = [
+ ["list", "关注列表"],
+ ["add", "添加关注"],
+ ["feeds", "JAV 订阅源"]
+], en = (e) => $t.some(([t]) => t === e);
+function $({ term: e, figure: t, unit: n }) {
+ return /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: W({
+ padding: "none",
+ className: "flex flex-col gap-3 px-6 py-5 max-sm:gap-2 max-sm:p-4"
+ }),
+ children: [/* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "text-body-medium text-text-secondary",
+ children: e
+ }), /* @__PURE__ */ (0, Z.jsxs)("b", {
+ "data-follow-reading": "",
+ className: `flex min-w-0 flex-wrap items-baseline gap-x-1 tabular-nums text-text-primary ${t >= 1e6 ? "text-headline-medium" : t >= 1e5 ? "text-title-3-medium" : "text-title-1-medium"}`,
+ children: [/* @__PURE__ */ (0, Z.jsx)("span", {
+ className: "min-w-0 wrap-anywhere",
+ children: t.toLocaleString()
+ }), /* @__PURE__ */ (0, Z.jsx)("small", {
+ className: "whitespace-nowrap text-body-2-regular text-text-secondary",
+ children: ` ${n}`
+ })]
+ })]
+ });
+}
+function tn(e) {
+ let { route: t, savePreference: n, toast: r, openFollow: i, readOnly: a, readOnlyMessage: o, writerUrl: s } = e, [c, l] = (0, X.useState)(en(e.tab) ? e.tab : "list"), [p, m] = (0, X.useState)(Math.max(1, Math.floor(e.page) || 1)), [h, g] = (0, X.useState)(() => Ke(e.sort, e.dir).sort), [v, y] = (0, X.useState)(() => Ke(e.sort, e.dir).dir), [ee, b] = (0, X.useState)(je(e.layout) ? e.layout : "default"), [te, x] = (0, X.useState)(Ie(e.pageSize)), [ne, S] = (0, X.useState)(/* @__PURE__ */ new Set()), C = rt({
+ queryKey: D,
+ queryFn: ({ signal: e }) => Ce(e)
+ }), re = rt({
+ queryKey: E,
+ queryFn: ({ signal: e }) => Se(e)
+ }), O = rt({
+ queryKey: T,
+ queryFn: ({ signal: e }) => Y(e)
+ }), k = C.data || { sources: [] }, A = re.data || {
+ root: "",
+ providers: []
+ }, j = k.sources;
+ (0, X.useEffect)(() => {
+ S((e) => {
+ let t = Me(e, j);
+ return t.size === e.size ? e : t;
+ });
+ }, [j]);
+ let M = (e) => {
+ let n = e.sort ?? h, r = e.dir ?? v;
+ t({
+ tab: e.tab ?? c,
+ page: e.page ?? p,
+ sort: n === "checked" ? "" : n,
+ dir: r === z[n] ? "" : r
+ });
+ }, N = ke(j), P = j.filter(Ae).length, F = j.filter((e) => e.enabled).length, I = (A.providers || []).filter((e) => e.requirement === "required" && !K(e)).length, L = new Set((O.data?.sources || []).map((e) => e.entity_id ?? `source-${e.id}`)).size;
+ return /* @__PURE__ */ (0, Z.jsxs)(ot, { children: [
+ a ? /* @__PURE__ */ (0, Z.jsx)(R, {
+ tone: "warning",
+ title: "本机只能浏览",
+ extra: s ? /* @__PURE__ */ (0, Z.jsx)("p", {
+ className: "text-body-2-regular",
+ children: /* @__PURE__ */ (0, Z.jsx)(w, {
+ href: s,
+ children: "前往写入端管理关注"
+ })
+ }) : void 0,
+ children: o
+ }) : null,
+ /* @__PURE__ */ (0, Z.jsxs)("div", {
+ className: st,
+ "aria-label": "关注概览",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)($, {
+ term: "关注创作者",
+ figure: N.length,
+ unit: "位"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)($, {
+ term: "启用来源",
+ figure: F,
+ unit: `/ ${j.length}`
+ }),
+ /* @__PURE__ */ (0, Z.jsx)($, {
+ term: "检查失败",
+ figure: P,
+ unit: "个来源"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)($, {
+ term: "未看更新",
+ figure: k.counts?.new || 0,
+ unit: "条"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)($, {
+ term: "JAV 订阅",
+ figure: L,
+ unit: "位"
+ }),
+ /* @__PURE__ */ (0, Z.jsx)($, {
+ term: "未看新作",
+ figure: O.data?.unread || 0,
+ unit: "条"
+ })
+ ]
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)(f, {
+ selectedKey: c,
+ onSelectionChange: (e) => {
+ let t = String(e);
+ en(t) && (l(t), M({ tab: t }));
+ },
+ className: "flex flex-col gap-6",
+ children: [
+ /* @__PURE__ */ (0, Z.jsx)(lt, {
+ "aria-label": "关注管理区域",
+ "data-section-nav": !0,
+ "data-section-items": !0,
+ className: "flex max-w-full flex-nowrap overflow-x-auto",
+ children: $t.map(([e, t]) => /* @__PURE__ */ (0, Z.jsx)(d, {
+ id: e,
+ "data-pill-selected": c === e ? "" : void 0,
+ "data-pill-variant": "gray",
+ className: "cursor-pointer whitespace-nowrap",
+ children: t
+ }, e))
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(u, {
+ id: "list",
+ className: "flex flex-col gap-4",
+ children: /* @__PURE__ */ (0, Z.jsx)(ft, {
+ data: k,
+ sort: h,
+ dir: v,
+ page: p,
+ layout: ee,
+ pageSize: te,
+ selected: ne,
+ readOnly: a,
+ toast: r,
+ openFollow: i,
+ onAdd: () => {
+ l("add"), M({ tab: "add" });
+ },
+ onSort: (e, t) => {
+ g(e), y(t), m(1), M({
+ sort: e,
+ dir: t,
+ page: 1
+ });
+ },
+ onPage: (e) => {
+ m(e), M({ page: e });
+ },
+ onSelected: S,
+ onLayout: (e) => {
+ b(e), m(1), n({ layout: e }), M({ page: 1 });
+ },
+ onPageSize: (e) => {
+ x(e), m(1), n({ pageSize: e }), M({ page: 1 });
+ }
+ })
+ }),
+ /* @__PURE__ */ (0, Z.jsxs)(u, {
+ id: "add",
+ className: "flex flex-col gap-8",
+ children: [/* @__PURE__ */ (0, Z.jsx)(Ct, {
+ data: k,
+ credentials: A,
+ readOnly: a,
+ toast: r
+ }), /* @__PURE__ */ (0, Z.jsx)(It, {
+ groups: k.author_aliases || [],
+ readOnly: a,
+ toast: r,
+ suggestions: k.alias_suggestions || [],
+ sources: k.sources
+ })]
+ }),
+ /* @__PURE__ */ (0, Z.jsx)(u, {
+ id: "feeds",
+ className: "flex flex-col gap-4",
+ children: /* @__PURE__ */ (0, Z.jsx)(Qt, {
+ readOnly: a,
+ toast: r
+ })
+ })
+ ]
+ }),
+ /* @__PURE__ */ (0, Z.jsx)("div", { children: /* @__PURE__ */ (0, Z.jsxs)(_, {
+ variant: "secondary",
+ href: "/settings/subscriptions",
+ children: ["来源与订阅设置", I ? `(${I})` : ""]
+ }) })
+ ] });
+}
+//#endregion
+export { tn as FollowManagePage };
+
+//# debugId=b7e207ec-1afe-4be9-aa47-743c89380398
\ No newline at end of file
diff --git a/web/dist/peach-app.jav-page-_LyhfeJu.js b/web/dist/peach-app.jav-page-BylXQgrV.js
similarity index 57%
rename from web/dist/peach-app.jav-page-_LyhfeJu.js
rename to web/dist/peach-app.jav-page-BylXQgrV.js
index eea608df3..f04d1dafa 100644
--- a/web/dist/peach-app.jav-page-_LyhfeJu.js
+++ b/web/dist/peach-app.jav-page-BylXQgrV.js
@@ -1,24 +1,24 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "bf2b789d-c4be-451a-b7be-708b13e02049", e._sentryDebugIdIdentifier = "sentry-dbid-bf2b789d-c4be-451a-b7be-708b13e02049");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "20badbcf-9132-4b41-940d-efbdbbc086ee", e._sentryDebugIdIdentifier = "sentry-dbid-20badbcf-9132-4b41-940d-efbdbbc086ee");
} catch {}
})();
-import { $ as e, $t as t, Cc as n, Dc as r, Do as i, Ec as a, G as o, Gl as s, Go as c, Ha as l, Ii as u, J as d, Js as f, K as p, Ka as m, Oa as h, Qs as ee, Qt as g, Ra as te, Ul as ne, Va as _, Xs as v, Y as y, Ys as b, Zs as x, _o as S, _s as C, an as w, ao as T, au as E, bo as re, cn as D, cu as ie, en as ae, et as oe, fa as se, fs as O, gs as ce, hl as k, hn as le, hs as ue, in as de, io as A, it as fe, la as pe, ln as j, lo as M, ma as N, n as me, nn as P, no as he, nt as ge, on as F, oo as I, pa as L, peachHistory as R, pn as z, ps as B, pu as V, q as H, ql as _e, qs as ve, rn as ye, ro as U, rt as be, sa as xe, sn as W, so as G, ss as K, tn as q, tt as Se, ua as Ce, uu as we, vs as Te, xc as Ee } from "./peach-app.js";
-import { n as J } from "./peach-app.source-view-DaRl5mr9.js";
-import "./peach-app.source-list-E8TH3X9X.js";
+import { $fe21c36db05242bb$export$d7b12c4107be0d61 as e, ArtSlot as t, Button as n, ButtonLink as r, Chip as i, CloudDownloadDialog as a, DISCOVERY_SORTS as o, DOWNLOADS_KEY as s, DOWNLOADS_URL as c, E3 as l, EmptyFocusButton as u, EmptyState as d, FilterGlassRows as f, FilterIconButton as p, FilterPill as m, GlassPill as h, Help as g, Input as _, JAV_LAYOUTS as v, JAV_RECOMMENDATION_GRID as ee, JavHeader as y, LibraryShortcuts as te, M6 as b, Note as x, PHASES as S, Pagination as C, SEGMENT as w, SEGMENTED_TRACK as T, SegmentedRadioGroup as E, Segments as ne, SortKeys as re, SourceAvatar as ie, TaskProgress as ae, WANTS_KEY as oe, WantMagnets as D, Wt as se, __toESM as ce, addWant as le, apiGet as O, appSettingsStore as ue, avatarInner as k, busyProps as A, cachedMagnetStates as j, cardClass as M, cardRatio as de, coverUrl as fe, discoveryArtwork as pe, discoveryKey as me, discoveryScore as he, entityPath as ge, errorMessage as N, fetchDiscoveries as _e, fetchWants as ve, gridLayout as ye, invalidateWants as P, javContentSkeleton as be, javLayout as xe, javTagSkeleton as Se, pageWindow as F, peachHistory$1 as I, qE as L, recommendationScore as Ce, relayoutCovers as we, removeWants as R, require_jsx_runtime as z, require_react as B, resetWants as V, searchNote as H, shellNavigate as U, spriteGlyph as W, storeJavLayout as Te, useAction as G, useQuery as K, wantName as q, wireHorizontalScroller as Ee } from "./peach-app.js";
+import { ErrorLine as J } from "./peach-app.source-view-Bk_L5GHG.js";
+import "./peach-app.source-list-B2yIEqVl.js";
//#region src/react/jav/discovery-faces.tsx
-var Y = /* @__PURE__ */ V(we(), 1), X = ie();
+var Y = /* @__PURE__ */ ce(B(), 1), X = z();
function De({ item: e }) {
let t = e.performer_refs?.length ? e.performer_refs : [...new Set(e.performers.split(/[,,、;/]/).filter(Boolean))].map((e) => ({ name: e })), n = t.slice(0, 5).map((t, n) => {
- let r = { "--media-avatar-index": n }, i = t.source_avatar && t.source_actor_id && !t.has_image ? { children: /* @__PURE__ */ (0, X.jsx)(z, {
+ let r = { "--media-avatar-index": n }, i = t.source_avatar && t.source_actor_id && !t.has_image ? { children: /* @__PURE__ */ (0, X.jsx)(ie, {
code: e.code,
person: t
- }) } : { dangerouslySetInnerHTML: { __html: a(t.name, t, null) } };
+ }) } : { dangerouslySetInnerHTML: { __html: k(t.name, t, null) } };
return t.id ? /* @__PURE__ */ (0, X.jsx)("a", {
"data-media-avatar": "",
style: r,
- href: _e("performer", t.name, t.id),
+ href: ge("performer", t.name, t.id),
"aria-label": `打开女优页:${t.name}`,
...i
}, t.name) : /* @__PURE__ */ (0, X.jsx)("span", {
@@ -66,11 +66,11 @@ function ke({ want: e }) {
}) : null]
});
}
-function Ae({ want: e, readOnly: t, busy: n, onReset: r, onRemove: a, onCloudDownload: s, downloads: c, provider: l, toast: u }) {
+function Ae({ want: e, readOnly: t, busy: i, onReset: a, onRemove: o, onCloudDownload: s, downloads: c, provider: l, toast: u }) {
let [d, f] = (0, Y.useState)(""), p = e.link || d || (e.code ? `https://javdb.com/search?q=${encodeURIComponent(e.code)}&f=all` : "");
return /* @__PURE__ */ (0, X.jsxs)("li", {
"data-want-id": e.id,
- className: _({
+ className: M({
bordered: "soft",
className: "flex flex-col gap-4 max-sm:p-4"
}),
@@ -83,7 +83,7 @@ function Ae({ want: e, readOnly: t, busy: n, onReset: r, onRemove: a, onCloudDow
className: "flex min-w-0 flex-wrap items-baseline gap-x-2",
children: [/* @__PURE__ */ (0, X.jsx)("b", {
className: "min-w-0 text-headline-medium wrap-anywhere text-text-primary",
- children: j(e)
+ children: q(e)
}), e.code && e.title ? /* @__PURE__ */ (0, X.jsx)("span", {
className: "min-w-0 truncate text-body-2-regular text-text-secondary",
children: e.title
@@ -96,7 +96,7 @@ function Ae({ want: e, readOnly: t, busy: n, onReset: r, onRemove: a, onCloudDow
!e.code || e.phase === "unreleased" || e.phase === "acquired" ? /* @__PURE__ */ (0, X.jsx)("p", {
"data-want-note": "",
className: "text-caption-1-regular text-text-secondary",
- children: D(e)
+ children: H(e)
}) : null,
e.scrape_error ? /* @__PURE__ */ (0, X.jsx)(J, {
text: e.scrape_error,
@@ -106,34 +106,34 @@ function Ae({ want: e, readOnly: t, busy: n, onReset: r, onRemove: a, onCloudDow
/* @__PURE__ */ (0, X.jsxs)("div", {
className: "mt-1 flex flex-wrap items-center gap-2",
children: [
- p ? /* @__PURE__ */ (0, X.jsx)(B, {
+ p ? /* @__PURE__ */ (0, X.jsx)(r, {
"data-button-link": "",
variant: "secondary",
size: "small",
- trailingIcon: i,
+ trailingIcon: se,
href: p,
target: "_blank",
rel: "noopener noreferrer",
children: "来源页"
}) : null,
- /* @__PURE__ */ (0, X.jsx)(O, {
+ /* @__PURE__ */ (0, X.jsx)(n, {
variant: "secondary",
size: "small",
- leadingIcon: re,
+ leadingIcon: b,
disabled: t,
- ...U(n === `remove:${e.id}`),
- onClick: a,
+ ...A(i === `remove:${e.id}`),
+ onClick: o,
children: "移除"
}),
- e.phase === "given_up" ? /* @__PURE__ */ (0, X.jsx)(O, {
+ e.phase === "given_up" ? /* @__PURE__ */ (0, X.jsx)(n, {
variant: "secondary",
size: "small",
disabled: t,
- ...U(n === `reset:${e.id}`),
- onClick: r,
+ ...A(i === `reset:${e.id}`),
+ onClick: a,
children: "重新查找"
}) : null,
- e.phase === "searching" || e.phase === "given_up" ? /* @__PURE__ */ (0, X.jsx)(O, {
+ e.phase === "searching" || e.phase === "given_up" ? /* @__PURE__ */ (0, X.jsx)(n, {
variant: "secondary",
size: "small",
onClick: s,
@@ -143,7 +143,7 @@ function Ae({ want: e, readOnly: t, busy: n, onReset: r, onRemove: a, onCloudDow
})
]
})]
- }), e.code && (e.phase === "searching" || e.phase === "given_up") ? /* @__PURE__ */ (0, X.jsx)(o, {
+ }), e.code && (e.phase === "searching" || e.phase === "given_up") ? /* @__PURE__ */ (0, X.jsx)(D, {
want: e,
readOnly: t,
downloads: c,
@@ -153,49 +153,49 @@ function Ae({ want: e, readOnly: t, busy: n, onReset: r, onRemove: a, onCloudDow
}) : null]
});
}
-function je({ phase: e, label: t, rows: n, row: r }) {
- let [i, a] = (0, Y.useState)(1), [o, s] = (0, Y.useState)("all"), l = p(n), d = (e) => e.has_magnets ?? l.get(e.code || "") ?? !1, f = n.filter(d), m = e !== "searching" || o === "all" ? n : n.filter((e) => d(e) === (o === "available")), h = k(m.length, 20, i);
+function je({ phase: t, label: r, rows: i, row: a }) {
+ let [o, s] = (0, Y.useState)(1), [c, l] = (0, Y.useState)("all"), u = j(i), f = (e) => e.has_magnets ?? u.get(e.code || "") ?? !1, p = i.filter(f), m = t !== "searching" || c === "all" ? i : i.filter((e) => f(e) === (c === "available")), h = F(m.length, 20, o);
return /* @__PURE__ */ (0, X.jsxs)("section", {
- "aria-label": t,
- "data-want-phase": e,
+ "aria-label": r,
+ "data-want-phase": t,
className: "flex flex-col gap-4",
children: [
/* @__PURE__ */ (0, X.jsxs)("div", {
className: "flex flex-wrap items-center justify-between gap-3",
children: [/* @__PURE__ */ (0, X.jsxs)("h3", {
className: "flex items-baseline gap-2 text-title-2-medium text-text-primary",
- children: [t, /* @__PURE__ */ (0, X.jsx)("span", {
+ children: [r, /* @__PURE__ */ (0, X.jsx)("span", {
className: "text-body-2-regular tabular-nums text-text-secondary",
- children: n.length.toLocaleString()
+ children: i.length.toLocaleString()
})]
- }), e === "searching" ? /* @__PURE__ */ (0, X.jsx)(N, {
+ }), t === "searching" ? /* @__PURE__ */ (0, X.jsx)(E, {
name: "want-magnet-filter",
"aria-label": "待找磁链筛选",
orientation: "horizontal",
- value: o,
- className: L,
+ value: c,
+ className: T,
onChange: (e) => {
- s(e), a(1);
+ l(e), s(1);
},
- children: Oe.map(([e, t]) => /* @__PURE__ */ (0, X.jsxs)(K, {
- value: e,
- "aria-label": t,
- className: se,
- children: [t, /* @__PURE__ */ (0, X.jsx)("span", {
+ children: Oe.map(([t, n]) => /* @__PURE__ */ (0, X.jsxs)(e, {
+ value: t,
+ "aria-label": n,
+ className: w,
+ children: [n, /* @__PURE__ */ (0, X.jsx)("span", {
className: "text-caption-1-regular tabular-nums text-text-tertiary",
- children: (e === "all" ? n.length : e === "available" ? f.length : n.length - f.length).toLocaleString()
+ children: (t === "all" ? i.length : t === "available" ? p.length : i.length - p.length).toLocaleString()
})]
- }, e))
+ }, t))
}) : null]
}),
- m.length ? null : /* @__PURE__ */ (0, X.jsx)(I, {
+ m.length ? null : /* @__PURE__ */ (0, X.jsx)(d, {
size: "compact",
- icon: c,
+ icon: L,
title: "暂无符合条件的作品",
- actions: /* @__PURE__ */ (0, X.jsx)(O, {
+ actions: /* @__PURE__ */ (0, X.jsx)(n, {
size: "small",
onClick: () => {
- s("all"), a(1);
+ l("all"), s(1);
},
children: "查看全部"
}),
@@ -203,7 +203,7 @@ function je({ phase: e, label: t, rows: n, row: r }) {
}),
/* @__PURE__ */ (0, X.jsx)("ul", {
className: "flex flex-col gap-4",
- children: m.slice(h.start, h.end).map(r)
+ children: m.slice(h.start, h.end).map(a)
}),
h.pages > 1 ? /* @__PURE__ */ (0, X.jsxs)("div", {
"data-want-pager": "",
@@ -211,52 +211,52 @@ function je({ phase: e, label: t, rows: n, row: r }) {
children: [/* @__PURE__ */ (0, X.jsx)("span", {
className: "text-body-2-regular tabular-nums text-text-secondary",
children: `${(h.start + 1).toLocaleString()}–${h.end.toLocaleString()} / ${h.total.toLocaleString()} 条`
- }), /* @__PURE__ */ (0, X.jsx)(u, {
- label: `${t}分页`,
+ }), /* @__PURE__ */ (0, X.jsx)(C, {
+ label: `${r}分页`,
page: h.page,
pages: h.pages,
- onPage: a
+ onPage: s
})]
}) : null
]
});
}
-function Me({ readOnly: e, toast: t, query: n = "", clearQuery: r }) {
- let [i, a] = (0, Y.useState)(""), [o, u] = (0, Y.useState)(null), f = l(), p = E({
- queryKey: P,
- queryFn: ({ signal: e }) => de(e),
+function Me({ readOnly: e, toast: t, query: r = "", clearQuery: i }) {
+ let [o, l] = (0, Y.useState)(""), [f, p] = (0, Y.useState)(null), m = G(), h = K({
+ queryKey: oe,
+ queryFn: ({ signal: e }) => ve(e),
staleTime: 3e4,
refetchInterval: (e) => e.state.data?.scraping ? 3e3 : !1
- }), m = () => {
- let n = i.trim();
- n && !e && f.run("add", (e) => ye({ code: n }, e), (e) => {
- t(e.created ? `已加入想要:${j(e.want)}` : `${j(e.want)} 已经在想要里`), a(""), w();
+ }), v = () => {
+ let n = o.trim();
+ n && !e && m.run("add", (e) => le({ code: n }, e), (e) => {
+ t(e.created ? `已加入想要:${q(e.want)}` : `${q(e.want)} 已经在想要里`), l(""), P();
});
}, ee = (e) => {
- e.key === "Enter" && !e.nativeEvent.isComposing && (e.preventDefault(), m());
- }, g = (e) => {
- f.run(`remove:${e.id}`, (t) => F([e.id], t), () => {
- t(`已移除:${j(e)}`), w();
+ e.key === "Enter" && !e.nativeEvent.isComposing && (e.preventDefault(), v());
+ }, y = (e) => {
+ m.run(`remove:${e.id}`, (t) => R([e.id], t), () => {
+ t(`已移除:${q(e)}`), P();
});
}, te = (e) => {
- f.run(`reset:${e.id}`, (t) => W([e.id], t), () => {
- t(`${j(e)} 回到待找`), w();
+ m.run(`reset:${e.id}`, (t) => V([e.id], t), () => {
+ t(`${q(e)} 回到待找`), P();
});
- }, v = p.data, b = (v?.items || []).filter((e) => !n || [
+ }, b = h.data, C = (b?.items || []).filter((e) => !r || [
e.code,
e.title,
e.performers
- ].join(" ").toLocaleLowerCase().includes(n.toLocaleLowerCase())), x = E({
- queryKey: d,
- queryFn: ({ signal: e }) => ne(`${y}?limit=100`, e),
- enabled: b.some((e) => e.code && (e.phase === "searching" || e.phase === "given_up"))
- }), S = x.data?.providers.filter((e) => e.configured) || [], C = S[0]?.key || "";
+ ].join(" ").toLocaleLowerCase().includes(r.toLocaleLowerCase())), w = K({
+ queryKey: s,
+ queryFn: ({ signal: e }) => O(`${c}?limit=100`, e),
+ enabled: C.some((e) => e.code && (e.phase === "searching" || e.phase === "given_up"))
+ }), T = w.data?.providers.filter((e) => e.configured) || [], E = T[0]?.key || "";
return /* @__PURE__ */ (0, X.jsxs)("div", {
- "aria-busy": p.isPending,
+ "aria-busy": h.isPending,
className: "flex flex-col gap-8",
children: [
/* @__PURE__ */ (0, X.jsxs)("div", {
- className: _({
+ className: M({
padding: "none",
className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
}),
@@ -269,75 +269,75 @@ function Me({ readOnly: e, toast: t, query: n = "", clearQuery: r }) {
className: "flex flex-wrap items-end gap-2",
children: [/* @__PURE__ */ (0, X.jsx)("div", {
className: "min-w-64 grow max-sm:min-w-0",
- children: /* @__PURE__ */ (0, X.jsx)(M, {
+ children: /* @__PURE__ */ (0, X.jsx)(_, {
"aria-label": "番号",
placeholder: "输入番号,例如 SSIS-950",
- value: i,
+ value: o,
isDisabled: e,
- onChange: a,
+ onChange: l,
onKeyDown: ee
})
- }), /* @__PURE__ */ (0, X.jsx)(O, {
+ }), /* @__PURE__ */ (0, X.jsx)(n, {
variant: "primary",
- disabled: e || !i.trim(),
- ...U(f.busy === "add"),
- onClick: m,
+ disabled: e || !o.trim(),
+ ...A(m.busy === "add"),
+ onClick: v,
children: "添加"
})]
}),
- f.error ? /* @__PURE__ */ (0, X.jsx)(G, {
+ m.error ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "error",
title: "这一次没有完成",
- children: f.error
+ children: m.error
}) : null
]
}),
- p.error ? /* @__PURE__ */ (0, X.jsx)(G, {
+ h.error ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "error",
title: "想要清单读取失败",
- children: s(p.error)
+ children: N(h.error)
}) : null,
- p.isPending ? /* @__PURE__ */ (0, X.jsx)("div", {
+ h.isPending ? /* @__PURE__ */ (0, X.jsx)("div", {
role: "status",
"aria-label": "正在读取想要",
- dangerouslySetInnerHTML: { __html: oe("wants") }
+ dangerouslySetInnerHTML: { __html: be("wants") }
}) : null,
- v?.scraping ? /* @__PURE__ */ (0, X.jsx)(h, {
+ b?.scraping ? /* @__PURE__ */ (0, X.jsx)(g, {
role: "status",
children: "正在给刚加入的番号取资料与封面。"
}) : null,
- x.error ? /* @__PURE__ */ (0, X.jsx)(G, {
+ w.error ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "error",
title: "下载配置未取得",
- children: s(x.error)
+ children: N(w.error)
}) : null,
- x.data && !S.length ? /* @__PURE__ */ (0, X.jsxs)(G, {
+ w.data && !T.length ? /* @__PURE__ */ (0, X.jsxs)(x, {
tone: "neutral",
children: ["尚未配置下载渠道。", /* @__PURE__ */ (0, X.jsx)("a", {
href: "/settings/library?section=%E4%B8%8B%E8%BD%BD%E6%B8%A0%E9%81%93",
children: "下载渠道设置"
})]
}) : null,
- x.data && !x.data.available ? /* @__PURE__ */ (0, X.jsx)(G, {
+ w.data && !w.data.available ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "neutral",
children: "云下载只在允许修改数据库的设备上可用。"
}) : null,
- v && !b.length ? /* @__PURE__ */ (0, X.jsx)(I, {
+ b && !C.length ? /* @__PURE__ */ (0, X.jsx)(d, {
size: "compact",
- icon: c,
- title: n ? "没有符合条件的作品" : "还没有想要的作品",
- actions: n && r ? /* @__PURE__ */ (0, X.jsx)(O, {
+ icon: L,
+ title: r ? "没有符合条件的作品" : "还没有想要的作品",
+ actions: r && i ? /* @__PURE__ */ (0, X.jsx)(n, {
size: "small",
- onClick: r,
+ onClick: i,
children: "清除搜索"
- }) : !n && !e ? /* @__PURE__ */ (0, X.jsx)(T, {
+ }) : !r && !e ? /* @__PURE__ */ (0, X.jsx)(u, {
target: "input[aria-label=\"番号\"]",
children: "添加作品"
}) : void 0,
- children: n ? "试试其他番号、女优或标题。" : "输入番号,添加想看的作品。"
+ children: r ? "试试其他番号、女优或标题。" : "输入番号,添加想看的作品。"
}) : null,
- q.map(([n, r]) => {
- let i = b.filter((e) => e.phase === n);
+ S.map(([n, r]) => {
+ let i = C.filter((e) => e.phase === n);
return i.length ? /* @__PURE__ */ (0, X.jsx)(je, {
phase: n,
label: r,
@@ -345,13 +345,13 @@ function Me({ readOnly: e, toast: t, query: n = "", clearQuery: r }) {
row: (n) => /* @__PURE__ */ (0, X.jsx)(Ae, {
want: n,
readOnly: e,
- busy: f.busy,
- downloads: x.data,
- provider: C,
+ busy: m.busy,
+ downloads: w.data,
+ provider: E,
toast: t,
onReset: () => te(n),
- onRemove: () => g(n),
- onCloudDownload: () => u({
+ onRemove: () => y(n),
+ onCloudDownload: () => p({
code: n.code || "",
title: n.title || "",
origin: `wishlist:${n.id}`,
@@ -363,133 +363,133 @@ function Me({ readOnly: e, toast: t, query: n = "", clearQuery: r }) {
}, n.id)
}, n) : null;
}),
- /* @__PURE__ */ (0, X.jsx)(H, {
- prefill: o,
- close: () => u(null),
+ /* @__PURE__ */ (0, X.jsx)(a, {
+ prefill: f,
+ close: () => p(null),
receipt: t,
- provider: C
+ provider: E
})
]
});
}
//#endregion
//#region src/react/jav/jav-page.tsx
-var Ne = A("search"), Pe = A("x"), Fe = A("refresh-cw");
+var Ne = W("search"), Pe = W("x"), Fe = W("refresh-cw");
function $(e) {
let t = new URLSearchParams(location.search);
for (let [n, r] of Object.entries(e)) r ? t.set(n, r) : t.delete(n);
- m(location.pathname + (t.size ? `?${t}` : ""), {
+ U(location.pathname + (t.size ? `?${t}` : ""), {
replace: !0,
- state: R.navigation.location.state
+ state: I.navigation.location.state
});
}
function Ie({ tab: e, readOnly: t, navigate: n, receipt: r }) {
- let [i, a] = (0, Y.useState)(null), [o, s] = (0, Y.useState)(() => new URLSearchParams(location.search).get("q") || ""), c = (e) => {
- s(e), $({ q: e });
+ let [i, o] = (0, Y.useState)(null), [s, c] = (0, Y.useState)(() => new URLSearchParams(location.search).get("q") || ""), l = (e) => {
+ c(e), $({ q: e });
};
return /* @__PURE__ */ (0, X.jsxs)("div", {
className: "flex w-full flex-col gap-6",
children: [
- /* @__PURE__ */ (0, X.jsx)(me, {
+ /* @__PURE__ */ (0, X.jsx)(y, {
tab: e,
navigate: n,
- find: () => a({})
+ find: () => o({})
}),
/* @__PURE__ */ (0, X.jsx)("form", {
"aria-label": e === "discover" ? "筛选推荐" : "筛选想要",
onSubmit: (e) => {
e.preventDefault();
},
- children: /* @__PURE__ */ (0, X.jsx)(M, {
+ children: /* @__PURE__ */ (0, X.jsx)(_, {
type: "search",
"aria-label": e === "discover" ? "筛选推荐" : "筛选想要",
placeholder: "筛选番号、女优或标题",
leadingIcon: Ne,
- value: o,
- onChange: c,
+ value: s,
+ onChange: l,
enterKeyHint: "search"
})
}),
e === "discover" ? /* @__PURE__ */ (0, X.jsx)(Le, {
readOnly: t,
receipt: r,
- resource: a,
- query: o.trim(),
+ resource: o,
+ query: s.trim(),
navigate: n,
- clearText: () => c("")
+ clearText: () => l("")
}) : /* @__PURE__ */ (0, X.jsx)(Me, {
readOnly: t,
toast: r,
- query: o.trim(),
- clearQuery: () => c("")
+ query: s.trim(),
+ clearQuery: () => l("")
}),
- /* @__PURE__ */ (0, X.jsx)(H, {
+ /* @__PURE__ */ (0, X.jsx)(a, {
prefill: i,
- close: () => a(null),
+ close: () => o(null),
receipt: r
})
]
});
}
-function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clearText: p }) {
- let m = new URLSearchParams(location.search), [h, ne] = (0, Y.useState)(() => m.get("scope") === "library" ? "library" : "external"), [_, y] = (0, Y.useState)(() => m.get("tag") || ""), [T, re] = (0, Y.useState)(() => ge.some(([e]) => e === m.get("sort")) ? m.get("sort") : "taste"), [D, ie] = (0, Y.useState)(() => m.get("dir") === "asc"), se = (e) => {
- ne(e), $({ scope: e === "external" ? "" : e });
- }, k = (e) => {
- y(e), $({ tag: e });
- }, de = (e) => {
- re(e), $({ sort: e === "taste" ? "" : e });
- }, A = (e) => {
+function Le({ readOnly: e, receipt: a, resource: s, query: c, navigate: u, clearText: g }) {
+ let _ = new URLSearchParams(location.search), [y, b] = (0, Y.useState)(() => _.get("scope") === "library" ? "library" : "external"), [S, C] = (0, Y.useState)(() => _.get("tag") || ""), [w, T] = (0, Y.useState)(() => o.some(([e]) => e === _.get("sort")) ? _.get("sort") : "taste"), [E, ie] = (0, Y.useState)(() => _.get("dir") === "asc"), oe = (e) => {
+ b(e), $({ scope: e === "external" ? "" : e });
+ }, D = (e) => {
+ C(e), $({ tag: e });
+ }, ce = (e) => {
+ T(e), $({ sort: e === "taste" ? "" : e });
+ }, O = (e) => {
ie(e), $({ dir: e ? "asc" : "" });
- }, j = (0, Y.useRef)(null);
+ }, k = (0, Y.useRef)(null);
(0, Y.useEffect)(() => {
- let e = [...j.current?.querySelectorAll("[data-catalog-scroll],[data-catalog-tags],[data-filter-row=\"bottom\"]") || []].map((e) => n(e, { drag: !0 }));
+ let e = [...k.current?.querySelectorAll("[data-catalog-scroll],[data-catalog-tags],[data-filter-row=\"bottom\"]") || []].map((e) => Ee(e, { drag: !0 }));
return () => e.forEach((e) => e.destroy());
}, []);
- let M = ee();
- (0, Y.useSyncExternalStore)(M.subscribe, M.version, M.version);
- let N = v(), me = f(b({
+ let j = ue();
+ (0, Y.useSyncExternalStore)(j.subscribe, j.version, j.version);
+ let M = xe(), ve = de(ye({
active: !0,
home: !1,
portrait: !1
- })), P = (0, Y.useRef)({}), F = (0, Y.useRef)(!1), L = (0, Y.useRef)(!1), R = D ? "asc" : "desc", z = E({
- queryKey: t(h, T, R),
+ })), F = (0, Y.useRef)({}), I = (0, Y.useRef)(!1), L = (0, Y.useRef)(!1), R = E ? "asc" : "desc", z = K({
+ queryKey: me(y, w, R),
retry: !1,
refetchOnWindowFocus: !1,
queryFn: ({ signal: e }) => {
- let t = F.current, n = L.current;
- return F.current = !1, L.current = !1, ae(h, e, {
- sort: T,
+ let t = I.current, n = L.current;
+ return I.current = !1, L.current = !1, _e(y, e, {
+ sort: w,
direction: R,
- jobId: t ? void 0 : P.current[h],
+ jobId: t ? void 0 : F.current[y],
refreshMetadata: t,
cancelMetadata: n
});
},
refetchInterval: (e) => e.state.data?.metadata_job?.status === "running" && Math.max(1e3, e.state.data.poll_after_ms || 3e3)
- }), V = z.data?.metadata_job;
+ }), B = z.data?.metadata_job;
(0, Y.useEffect)(() => {
- V?.job_id && (P.current[h] = V.job_id);
- }, [h, V?.job_id]);
- let H = l(), W = l(), K = (e) => {
- W.run(e, async () => (L.current = e === "stop", F.current = e !== "stop", z.refetch({
+ B?.job_id && (F.current[y] = B.job_id);
+ }, [y, B?.job_id]);
+ let V = G(), H = G(), U = (e) => {
+ H.run(e, async () => (L.current = e === "stop", I.current = e !== "stop", z.refetch({
cancelRefetch: !0,
throwOnError: !0
})), () => {});
- }, q = z.data?.items || [], we = [...new Set(q.flatMap((e) => e.tags || []))], J = q.filter((e) => (!_ || e.tags?.includes(_)) && (!u || [
+ }, W = z.data?.items || [], q = [...new Set(W.flatMap((e) => e.tags || []))], J = W.filter((e) => (!S || e.tags?.includes(S)) && (!c || [
e.code,
e.title,
e.performers,
e.studio,
...e.tags || [],
...(e.performer_refs || []).map((e) => e.name)
- ].join(" ").toLocaleLowerCase().includes(u.toLocaleLowerCase()))), Z = z.isPending;
+ ].join(" ").toLocaleLowerCase().includes(c.toLocaleLowerCase()))), Z = z.isPending;
return /* @__PURE__ */ (0, X.jsxs)("section", {
- ref: j,
+ ref: k,
"aria-label": "为你推荐",
"aria-busy": Z,
className: "flex min-w-0 flex-col gap-4",
children: [
- /* @__PURE__ */ (0, X.jsx)(ue, {
+ /* @__PURE__ */ (0, X.jsx)(f, {
label: "发现筛选与排序",
topLabel: "发现范围与标签",
attrs: {
@@ -504,12 +504,12 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
"data-catalog-scroll": "",
children: [/* @__PURE__ */ (0, X.jsxs)("div", {
"data-catalog-views": "",
- children: [[["external", "库外发现"], ["library", "馆藏探索"]].map(([e, t]) => /* @__PURE__ */ (0, X.jsx)(C, {
+ children: [[["external", "库外发现"], ["library", "馆藏探索"]].map(([e, t]) => /* @__PURE__ */ (0, X.jsx)(m, {
"data-entity-tag": e,
"data-entity-press": "",
- pressed: h === e,
+ pressed: y === e,
onPress: () => {
- se(e), k("");
+ oe(e), D("");
},
children: t
}, e)), /* @__PURE__ */ (0, X.jsx)("span", {
@@ -519,14 +519,14 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
}), /* @__PURE__ */ (0, X.jsx)("div", {
"data-catalog-tags": "",
dangerouslySetInnerHTML: Z ? { __html: Se() } : void 0,
- children: Z ? null : we.map((e) => /* @__PURE__ */ (0, X.jsxs)(C, {
+ children: Z ? null : q.map((e) => /* @__PURE__ */ (0, X.jsxs)(m, {
"data-catalog-tag": e,
"data-entity-press": "",
- pressed: _ === e,
- onPress: () => k(_ === e ? "" : e),
+ pressed: S === e,
+ onPress: () => D(S === e ? "" : e),
children: [e, /* @__PURE__ */ (0, X.jsx)("span", {
"data-count-badge": "",
- children: q.filter((t) => t.tags?.includes(e)).length
+ children: W.filter((t) => t.tags?.includes(e)).length
})]
}, e))
})]
@@ -540,42 +540,42 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
className: "relative inline-block h-3.5 w-37.5 rounded-md align-middle skeleton-sheen"
}) : `${J.length} 部`
}),
- /* @__PURE__ */ (0, X.jsx)(he, { currentHref: () => location.pathname + location.search }),
- u || _ ? /* @__PURE__ */ (0, X.jsx)(Te, {
+ /* @__PURE__ */ (0, X.jsx)(te, { currentHref: () => location.pathname + location.search }),
+ c || S ? /* @__PURE__ */ (0, X.jsx)(h, {
onPress: () => {
- k(""), p();
+ D(""), g();
},
children: "清除筛选"
}) : null,
/* @__PURE__ */ (0, X.jsxs)("span", {
"data-entity-sorts": "",
children: [
- h === "external" ? /* @__PURE__ */ (0, X.jsx)(ce, {
+ y === "external" ? /* @__PURE__ */ (0, X.jsx)(p, {
"data-entity-batch": "",
"data-jav-metadata-update": "",
- label: V?.status === "running" ? "停止读取" : "更新资料",
+ label: B?.status === "running" ? "停止读取" : "更新资料",
disabled: Z,
"data-skeleton-action": Z ? "" : void 0,
- busy: !!W.busy,
- icon: V?.status === "running" ? Pe : Fe,
- onPress: () => K(V?.status === "running" ? "stop" : "update")
+ busy: !!H.busy,
+ icon: B?.status === "running" ? Pe : Fe,
+ onPress: () => U(B?.status === "running" ? "stop" : "update")
}) : null,
- /* @__PURE__ */ (0, X.jsx)(pe, {
+ /* @__PURE__ */ (0, X.jsx)(ne, {
label: "JAV 卡片版式",
- value: N,
- options: ve,
- onChange: x
+ value: M,
+ options: v,
+ onChange: Te
}),
- /* @__PURE__ */ (0, X.jsx)(Ce, {
- sorts: ge.map(([e, t, n]) => ({
+ /* @__PURE__ */ (0, X.jsx)(re, {
+ sorts: o.map(([e, t, n]) => ({
key: e,
label: t,
ariaLabel: n,
- pressed: e === T,
+ pressed: e === w,
dir: R
})),
onSort: (e) => {
- e === T ? A(!D) : (de(e), A(e === "code"));
+ e === w ? O(!E) : (ce(e), O(e === "code"));
}
})
]
@@ -585,108 +585,108 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
Z ? /* @__PURE__ */ (0, X.jsx)("div", {
role: "status",
"aria-label": "正在读取推荐",
- dangerouslySetInnerHTML: { __html: oe("discover", N) }
+ dangerouslySetInnerHTML: { __html: be("discover", M) }
}) : null,
- z.error ? /* @__PURE__ */ (0, X.jsx)(G, {
+ z.error ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "error",
title: "推荐未取得",
- children: s(z.error)
+ children: N(z.error)
}) : null,
- h === "external" && V?.status === "running" ? /* @__PURE__ */ (0, X.jsx)("div", {
+ y === "external" && B?.status === "running" ? /* @__PURE__ */ (0, X.jsx)("div", {
"data-jav-metadata": "",
className: "min-w-0",
- children: /* @__PURE__ */ (0, X.jsx)(te, {
+ children: /* @__PURE__ */ (0, X.jsx)(ae, {
embedded: !0,
- label: `正在读取作品资料 · ${V.completed} / ${V.total} 部`,
- value: V.completed,
- total: V.total
+ label: `正在读取作品资料 · ${B.completed} / ${B.total} 部`,
+ value: B.completed,
+ total: B.total
})
}) : null,
- V && V.status !== "running" && (V.status !== "complete" || V.failed > 0) ? /* @__PURE__ */ (0, X.jsx)(G, {
+ B && B.status !== "running" && (B.status !== "complete" || B.failed > 0) ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "neutral",
- action: /* @__PURE__ */ (0, X.jsx)(O, {
+ action: /* @__PURE__ */ (0, X.jsx)(n, {
variant: "secondary",
- ...U(W.busy === "retry"),
+ ...A(H.busy === "retry"),
"aria-label": "立即重试读取作品资料",
- onClick: () => K("retry"),
+ onClick: () => U("retry"),
children: "立即重试"
}),
- children: V.message || `作品资料 ${V.completed} / ${V.total} 部`
+ children: B.message || `作品资料 ${B.completed} / ${B.total} 部`
}) : null,
- W.error ? /* @__PURE__ */ (0, X.jsx)(G, {
+ H.error ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "error",
- children: W.error
+ children: H.error
}) : null,
- !Z && !z.error && !J.length ? /* @__PURE__ */ (0, X.jsx)(I, {
- icon: S,
- title: u || _ ? "没有符合条件的推荐" : "暂无匹配口味的作品",
- actions: /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(B, {
+ !Z && !z.error && !J.length ? /* @__PURE__ */ (0, X.jsx)(d, {
+ icon: l,
+ title: c || S ? "没有符合条件的推荐" : "暂无匹配口味的作品",
+ actions: /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(r, {
size: "small",
href: "/taste",
variant: "secondary",
children: "查看口味"
- }), u || _ ? /* @__PURE__ */ (0, X.jsx)(O, {
+ }), c || S ? /* @__PURE__ */ (0, X.jsx)(n, {
variant: "primary",
size: "small",
onClick: () => {
- p(), y(""), $({
+ g(), C(""), $({
q: "",
tag: ""
});
},
children: "清除筛选"
- }) : h === "library" ? /* @__PURE__ */ (0, X.jsx)(B, {
+ }) : y === "library" ? /* @__PURE__ */ (0, X.jsx)(r, {
variant: "primary",
size: "small",
href: "/",
children: "浏览馆藏"
- }) : /* @__PURE__ */ (0, X.jsx)(O, {
+ }) : /* @__PURE__ */ (0, X.jsx)(n, {
variant: "primary",
size: "small",
- onClick: () => c({}),
+ onClick: () => s({}),
children: "查找作品"
})] }),
- children: u || _ ? "清除筛选后查看其他作品。" : h === "library" ? "观看或标记作品后,可以探索少看的馆藏。" : "可以查找番号,或更新关注来源。"
+ children: c || S ? "清除筛选后查看其他作品。" : y === "library" ? "观看或标记作品后,可以探索少看的馆藏。" : "可以查找番号,或更新关注来源。"
}) : null,
- H.error ? /* @__PURE__ */ (0, X.jsx)(G, {
+ V.error ? /* @__PURE__ */ (0, X.jsx)(x, {
tone: "error",
- children: H.error
+ children: V.error
}) : null,
/* @__PURE__ */ (0, X.jsx)("div", {
"data-media-grid": "",
- className: e,
- style: { "--card-ratio": me },
- children: J.map((e) => {
- let t = e.performer_refs?.length ? e.performer_refs.map((e) => e.name).join("、") : e.performers, n = g(e, N, M.value.javImage), s = fe(e.taste_score ?? e.score), l = [
- s.label,
- `口味 ${be(e.taste_score ?? e.score)}`,
- z.data?.ranking_method === "mmr" && e.ranking_score != null ? `排序 ${be(e.ranking_score)}` : "",
- e.source_score == null ? "" : `来源评分 ${e.source_score.toFixed(1)} / 5`,
- ...e.reasons || []
+ className: ee,
+ style: { "--card-ratio": ve },
+ children: J.map((o) => {
+ let c = o.performer_refs?.length ? o.performer_refs.map((e) => e.name).join("、") : o.performers, l = pe(o, M, j.value.javImage), d = Ce(o.taste_score ?? o.score), f = [
+ d.label,
+ `口味 ${he(o.taste_score ?? o.score)}`,
+ z.data?.ranking_method === "mmr" && o.ranking_score != null ? `排序 ${he(o.ranking_score)}` : "",
+ o.source_score == null ? "" : `来源评分 ${o.source_score.toFixed(1)} / 5`,
+ ...o.reasons || []
].filter(Boolean).join(" · ");
return /* @__PURE__ */ (0, X.jsxs)("article", {
"data-media-card": "",
"data-jav-card": "",
- onClick: (t) => {
- t.target.closest("a,button,input") || d(e.asset_id ? `/assets/${e.asset_id}` : `/works/${encodeURIComponent(e.code)}`);
+ onClick: (e) => {
+ e.target.closest("a,button,input") || u(o.asset_id ? `/assets/${o.asset_id}` : `/works/${encodeURIComponent(o.code)}`);
},
children: [
/* @__PURE__ */ (0, X.jsx)("a", {
- href: e.asset_id ? `/assets/${e.asset_id}` : `/works/${encodeURIComponent(e.code)}`,
- "aria-label": `查看 ${e.code} 详情`,
+ href: o.asset_id ? `/assets/${o.asset_id}` : `/works/${encodeURIComponent(o.code)}`,
+ "aria-label": `查看 ${o.code} 详情`,
onClick: (e) => {
- !e.ctrlKey && !e.metaKey && !e.shiftKey && e.button === 0 && (e.preventDefault(), d(e.currentTarget.getAttribute("href")));
+ !e.ctrlKey && !e.metaKey && !e.shiftKey && e.button === 0 && (e.preventDefault(), u(e.currentTarget.getAttribute("href")));
},
"data-media-pic": "",
"data-jav-cover-box": "",
className: "relative inline-grid place-items-center overflow-hidden rounded-2lg bg-background-tertiary-default",
- children: n ? /* @__PURE__ */ (0, X.jsx)(xe, {
+ children: l ? /* @__PURE__ */ (0, X.jsx)(t, {
artwork: {
kind: "cover",
- html: n
+ html: l
},
- identity: g(e, "small", M.value.javImage),
- relayout: (e) => Ee(e, N)
+ identity: pe(o, "small", j.value.javImage),
+ relayout: (e) => we(e, M)
}) : /* @__PURE__ */ (0, X.jsx)("span", {
"data-media-nopic": "",
children: "无封面"
@@ -694,56 +694,56 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
}),
/* @__PURE__ */ (0, X.jsxs)("div", {
"data-media-meta": "",
- children: [/* @__PURE__ */ (0, X.jsx)(De, { item: e }), /* @__PURE__ */ (0, X.jsxs)("div", {
+ children: [/* @__PURE__ */ (0, X.jsx)(De, { item: o }), /* @__PURE__ */ (0, X.jsxs)("div", {
"data-media-text": "",
children: [
/* @__PURE__ */ (0, X.jsxs)("h3", {
"data-jav-title": "",
"data-media-title": "",
- title: `${e.code} · ${e.title || "标题未取得"}`,
+ title: `${o.code} · ${o.title || "标题未取得"}`,
children: [
- /* @__PURE__ */ (0, X.jsx)("b", { children: e.code }),
+ /* @__PURE__ */ (0, X.jsx)("b", { children: o.code }),
" ",
- e.title || "标题未取得"
+ o.title || "标题未取得"
]
}),
/* @__PURE__ */ (0, X.jsxs)("div", {
"data-media-byline": "",
children: [
- e.performer_refs?.[0]?.id ? /* @__PURE__ */ (0, X.jsxs)("a", {
+ o.performer_refs?.[0]?.id ? /* @__PURE__ */ (0, X.jsxs)("a", {
"data-media-who": "",
- href: _e("performer", e.performer_refs[0].name),
- title: t,
+ href: ge("performer", o.performer_refs[0].name),
+ title: c,
children: [/* @__PURE__ */ (0, X.jsx)("svg", {
viewBox: "0 0 24 24",
"aria-hidden": "true",
children: /* @__PURE__ */ (0, X.jsx)("use", { href: "#i-user-round" })
- }), /* @__PURE__ */ (0, X.jsx)("span", { children: e.performer_refs[0].name })]
+ }), /* @__PURE__ */ (0, X.jsx)("span", { children: o.performer_refs[0].name })]
}) : /* @__PURE__ */ (0, X.jsxs)("span", {
"data-media-who": "",
- title: t,
+ title: c,
children: [/* @__PURE__ */ (0, X.jsx)("svg", {
viewBox: "0 0 24 24",
"aria-hidden": "true",
children: /* @__PURE__ */ (0, X.jsx)("use", { href: "#i-user-round" })
- }), /* @__PURE__ */ (0, X.jsx)("span", { children: e.performer_refs?.[0]?.name || t })]
+ }), /* @__PURE__ */ (0, X.jsx)("span", { children: o.performer_refs?.[0]?.name || c })]
}),
- (e.performer_refs?.length || 0) > 1 ? /* @__PURE__ */ (0, X.jsxs)("span", {
+ (o.performer_refs?.length || 0) > 1 ? /* @__PURE__ */ (0, X.jsxs)("span", {
"data-media-who-more": "",
children: [
"等 ",
- e.performer_refs.length,
+ o.performer_refs.length,
" 人"
]
}) : null,
- e.release_date ? /* @__PURE__ */ (0, X.jsxs)("time", {
+ o.release_date ? /* @__PURE__ */ (0, X.jsxs)("time", {
"data-media-release": "",
- dateTime: e.release_date,
+ dateTime: o.release_date,
children: [/* @__PURE__ */ (0, X.jsx)("svg", {
viewBox: "0 0 24 24",
"aria-hidden": "true",
children: /* @__PURE__ */ (0, X.jsx)("use", { href: "#i-calendar" })
- }), e.release_date]
+ }), o.release_date]
}) : null
]
}),
@@ -753,18 +753,18 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
children: [/* @__PURE__ */ (0, X.jsx)("button", {
"data-jav-taste-score": "",
type: "button",
- title: l,
- "aria-label": `推荐分 ${s.score},${s.label}`,
+ title: f,
+ "aria-label": `推荐分 ${d.score},${d.label}`,
className: "rounded-md outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring",
- children: /* @__PURE__ */ (0, X.jsx)(le, {
- color: s.color,
- children: s.label
+ children: /* @__PURE__ */ (0, X.jsx)(i, {
+ color: d.color,
+ children: d.label
})
- }), (e.tags || []).slice(0, 4).map((e) => /* @__PURE__ */ (0, X.jsx)("button", {
+ }), (o.tags || []).slice(0, 4).map((e) => /* @__PURE__ */ (0, X.jsx)("button", {
type: "button",
"data-media-tag": "",
- "aria-pressed": _ === e,
- onClick: () => k(_ === e ? "" : e),
+ "aria-pressed": S === e,
+ onClick: () => D(S === e ? "" : e),
children: e
}, e))]
})
@@ -775,39 +775,39 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
"data-jav-actions": "",
className: "flex flex-wrap gap-2",
children: [
- e.link ? /* @__PURE__ */ (0, X.jsx)(B, {
+ o.link ? /* @__PURE__ */ (0, X.jsx)(r, {
"data-button-link": "",
variant: "secondary",
- trailingIcon: i,
- href: e.link,
+ trailingIcon: se,
+ href: o.link,
target: "_blank",
rel: "noopener noreferrer",
children: "作品来源"
}) : null,
- /* @__PURE__ */ (0, X.jsx)(O, {
+ /* @__PURE__ */ (0, X.jsx)(n, {
variant: "ghost",
- disabled: a || e.wanted || !!e.asset_id,
- ...U(H.busy === String(e.id)),
+ disabled: e || o.wanted || !!o.asset_id,
+ ...A(V.busy === String(o.id)),
onClick: () => {
- H.run(String(e.id), (t) => ye({ code: e.code }, t), () => {
- o("已加入想要"), w(), z.refetch();
+ V.run(String(o.id), (e) => le({ code: o.code }, e), () => {
+ a("已加入想要"), P(), z.refetch();
});
},
- children: e.asset_id ? "已入库" : e.wanted ? "已加入想要" : "想要"
+ children: o.asset_id ? "已入库" : o.wanted ? "已加入想要" : "想要"
}),
- /* @__PURE__ */ (0, X.jsx)(O, {
+ /* @__PURE__ */ (0, X.jsx)(n, {
variant: "secondary",
- onClick: () => c({
- ...e,
- cover: e.has_cover ? r(e, !0) : e.cover_url,
- origin: `${e.asset_id ? "asset" : "feed"}:${e.id}`
+ onClick: () => s({
+ ...o,
+ cover: o.has_cover ? fe(o, !0) : o.cover_url,
+ origin: `${o.asset_id ? "asset" : "feed"}:${o.id}`
}),
children: "查找资源"
})
]
})
]
- }, e.id);
+ }, o.id);
})
})
]
@@ -816,4 +816,4 @@ function Le({ readOnly: a, receipt: o, resource: c, query: u, navigate: d, clear
//#endregion
export { Ie as JavPage };
-//# debugId=bf2b789d-c4be-451a-b7be-708b13e02049
\ No newline at end of file
+//# debugId=20badbcf-9132-4b41-940d-efbdbbc086ee
\ No newline at end of file
diff --git a/web/dist/peach-app.js b/web/dist/peach-app.js
index 5ed8169db..e812a4c13 100644
--- a/web/dist/peach-app.js
+++ b/web/dist/peach-app.js
@@ -2,7 +2,7 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "a5cb144c-9cf3-4720-9ec3-b67c77c62f50", e._sentryDebugIdIdentifier = "sentry-dbid-a5cb144c-9cf3-4720-9ec3-b67c77c62f50");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "bddf95d6-e198-41bd-ac1b-11442666c9b9", e._sentryDebugIdIdentifier = "sentry-dbid-bddf95d6-e198-41bd-ac1b-11442666c9b9");
} catch {}
})();
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
@@ -74437,13 +74437,13 @@ async function b6(e, t) {
if (r.status === "rejected") throw r.reason;
if (n.status === "rejected") throw n.reason;
}
-var x6 = y6(() => import("./peach-app.jav-page-_LyhfeJu.js")), S6 = y6(() => import("./peach-app.stats-page-BDw9YdMH.js")), C6 = y6(() => import("./peach-app.taste-page-B4dCRjRy.js")), w6 = y6(() => import("./peach-app.review-page-9sUxvOT_.js")), T6 = y6(() => import("./peach-app.data-cleanup-page-CgcWJcPi.js")), E6 = y6(() => import("./peach-app.duplicates-page-DO3ps9hg.js")), D6 = y6(() => import("./peach-app.quality-goals-page-BuyOF0iS.js")), O6 = y6(() => import("./peach-app.scraping-page-BmS-S4ER.js")), k6 = y6(async () => {
- let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-D8DOj79Y.js"), import("./peach-app.diagnostics-page-DyimXTyD.js")]);
+var x6 = y6(() => import("./peach-app.jav-page-BylXQgrV.js")), S6 = y6(() => import("./peach-app.stats-page-Dl0lm7Yt.js")), C6 = y6(() => import("./peach-app.taste-page-ByDbTYiW.js")), w6 = y6(() => import("./peach-app.review-page-CPsgIxd6.js")), T6 = y6(() => import("./peach-app.data-cleanup-page-DPCNx1GU.js")), E6 = y6(() => import("./peach-app.duplicates-page-CoHPntSW.js")), D6 = y6(() => import("./peach-app.quality-goals-page-CjcBIXAC.js")), O6 = y6(() => import("./peach-app.scraping-page-DM0a_K9-.js")), k6 = y6(async () => {
+ let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-BcGpLlXe.js"), import("./peach-app.diagnostics-page-bdA2qUuj.js")]);
return {
ConfigurationPage: e,
DiagnosticsPage: t
};
-}), A6 = y6(() => import("./peach-app.activity-page-C4wPG0cW.js")), j6 = y6(() => import("./peach-app.follow-manage-page-CtU6__VA.js")), M6 = y6(() => import("./peach-app.playlists-page-DLLm0T2E.js"));
+}), A6 = y6(() => import("./peach-app.activity-page-ClyZLUeQ.js")), j6 = y6(() => import("./peach-app.follow-manage-page-K8kzYRBb.js")), M6 = y6(() => import("./peach-app.playlists-page-DKMNf-v5.js"));
function mke(e, t, n) {
if (e === "duplicates") {
n("/duplicates");
@@ -79644,6 +79644,6 @@ var $9 = document.getElementById("appRoot");
if (!$9) throw Error("主界面宿主缺失");
OMe($9);
//#endregion
-export { F0 as $, tV as $a, Br as $c, Sq as $i, cn as $l, Xve as $n, fde as $o, ove as $r, Ok as $s, Y$ as $t, xDe as A, Xme as Aa, _i as Ac, GY as Ai, br as Al, ZX as An, Xde as Ao, Ave as Ar, CF as As, C1 as At, EDe as B, IH as Ba, Mr as Bc, xY as Bi, Mn as Bl, cye as Bn, pz as Bo, bve as Br, FF as Bs, bCe as Bt, I3 as C, $me as Ca, Fs as Cc, z_e as Ci, Ir as Cl, Eye as Cn, Sz as Co, xX as Cr, TF as Cs, CCe as Ct, d3 as D, Qme as Da, ja as Dc, R_e as Di, gi as Dl, rZ as Dn, gz as Do, TX as Dr, wF as Ds, kCe as Dt, v3 as E, JH as Ea, La as Ec, tX as Ei, vr as El, bye as En, xz as Eo, jve as Er, xF as Es, SCe as Et, m3 as F, WH as Fa, cr as Fc, PY as Fi, Hn as Fl, vye as Fn, sfe as Fo, rve as Fr, fF as Fs, gCe as Ft, o4 as G, pH as Ga, ri as Gc, BJ as Gi, jn as Gl, tye as Gn, ffe as Go, _X as Gr, Bj as Gs, d1 as Gt, FDe as H, NH as Ha, Or as Hc, _Y as Hi, kn as Hl, GX as Hn, Wde as Ho, vve as Hr, rF as Hs, _Ce as Ht, TDe as I, HH as Ia, dr as Ic, NY as Ii, H as Il, xye as In, Tz as Io, dX as Ir, vF as Is, vCe as It, W2 as J, mV as Ja, mi as Jc, SJ as Ji, z as Jl, HX as Jn, efe as Jo, pX as Jr, wA as Js, c1 as Jt, jEe as K, $V as Ka, ui as Kc, NJ as Ki, wn as Kl, VX as Kn, mz as Ko, sve as Kr, RA as Ks, u1 as Kt, ODe as L, VH as La, Jr as Lc, MY as Li, Ln as Ll, hye as Ln, pfe as Lo, fX as Lr, EF as Ls, h1 as Lt, NDe as M, GH as Ma, sr as Mc, UY as Mi, Lr as Ml, _ye as Mn, hfe as Mo, kve as Mr, yF as Ms, g1 as Mt, jDe as N, UH as Na, or as Nc, RY as Ni, Gn as Nl, QX as Nn, mfe as No, ive as Nr, ble as Ns, v1 as Nt, _3 as O, KH as Oa, Ia as Oc, G_e as Oi, Ur as Ol, yye as On, bz as Oo, EX as Or, bF as Os, T1 as Ot, CDe as P, Yme as Pa, ar as Pc, FY as Pi, Vn as Pl, eZ as Pn, yz as Po, ave as Pr, NF as Ps, m1 as Pt, e2 as Q, eV as Qa, Sr as Qc, lq as Qi, Jt as Ql, rye as Qn, hde as Qo, wve as Qr, rA as Qs, ZSe as Qt, kDe as R, zH as Ra, qr as Rc, jY as Ri, Nn as Rl, mye as Rn, fz as Ro, dve as Rr, OF as Rs, yCe as Rt, dOe as S, qH as Sa, uc as Sc, U_e as Si, Zr as Sl, Dye as Sn, _fe as So, bX as Sr, wle as Ss, x1 as St, y3 as T, ehe as Ta, Mo as Tc, eX as Ti, Gr as Tl, JX as Tn, gfe as To, SX as Tr, pF as Ts, b1 as Tt, wDe as U, EH as Ua, pi as Uc, pY as Ui, B as Ul, lye as Un, wz as Uo, gve as Ur, eF as Us, mCe as Ut, g3 as V, FH as Va, kr as Vc, bY as Vi, In as Vl, pye as Vn, Vde as Vo, _ve as Vr, gF as Vs, pCe as Vt, h3 as W, wH as Wa, fi as Wc, sY as Wi, V as Wl, dye as Wn, Ez as Wo, Cve as Wr, tF as Ws, f1 as Wt, xEe as X, oV as Xa, ci as Xc, Bq as Xi, gn as Xl, iye as Xn, yde as Xo, hve as Xr, gA as Xs, rCe as Xt, U2 as Y, sV as Ya, vi as Yc, xJ as Yi, Sn as Yl, Jve as Yn, rfe as Yo, Tve as Yr, CA as Ys, nCe as Yt, L2 as Z, aV as Za, Cr as Zc, Rq as Zi, vn as Zl, Zve as Zn, gde as Zo, xve as Zr, TA as Zs, n1 as Zt, hOe as _, hU as _a, Xd as _c, X_e as _i, li as _l, iZ as _n, Kde as _o, Rve as _r, qF as _s, F1 as _t, lOe as a, GW as aa, Oy as ac, fve as ai, Hr as al, K$ as an, xfe as ao, lA as applyTheme, Mve as ar, JR as as, O0 as at, Ct as au, R3 as b, QH as ba, Wl as bc, V_e as bi, Kr as bl, cZ as bn, Jde as bo, OX as br, zF as bs, ECe as bt, rOe as c, EW as ca, ih as cc, cX as ci, jr as cl, JSe as cn, Iz as co, AX as cr, yR as cs, A0 as ct, E as cu, yOe as d, OU as da, Lf as dc, q_e as di, Fr as dl, c$ as dn, Mz as do, Pve as dr, DI as ds, kwe as dt, o as du, Cq as ea, Ck as ec, cve as ei, zr as el, X$ as en, $B as eo, $ve as er, sz as es, L0 as et, Vt as eu, bOe as f, CU as fa, Nf as fc, rX as fi, ii as fl, l$ as fn, jz as fo, Nve as fr, q as fs, Owe as ft, s as fu, mOe as g, mU as ga, Zd as gc, oX as gi, si as gl, aZ as gn, ufe as go, Bve as gr, UF as gs, P1 as gt, gOe as h, zhe as ha, gf as hc, aX as hi, Pr as hl, HZ as hn, tfe as ho, Vve as hr, GF as hs, R1 as ht, B3 as i, YW as ia, Iy as ic, mve as ii, Vr as il, U$ as in, Vz as io, FX as ir, rz as is, Vwe as it, wt as iu, p3 as j, XH as ja, lr as jc, HY as ji, Nr as jl, XX as jn, qde as jo, Ove as jr, SF as js, _1 as jt, f3 as k, Zme as ka, mr as kc, F_e as ki, Wr as kl, Sye as kn, Dz as ko, wX as kr, hF as ks, w1 as kt, L3 as l, sW as la, Nm as lc, lX as li, xr as ll, qSe as ln, Fz as lo, LX as lr, oR as ls, y0 as lt, S as lu, cOe as m, xU as ma, yf as mc, iX as mi, gr as ml, dQ as mn, kz as mo, Ive as mr, WF as ms, _0 as mt, $3 as n, kK as na, uw as nc, gX as ni, Rr as nl, H$ as nn, nB as no, eye as nr, YR as ns, N0 as nt, Ht as nu, tOe as o, qW as oa, Dv as oc, uve as oi, ai as ol, G$ as on, zz as oo, RX as or, ER as os, jwe as ot, ve as ou, uOe as p, SU as pa, Df as pc, QV as peachHistory, nX as pi, Qr as pl, GQ as pn, Az as po, us as popCount, zX as pr, eI as ps, v0 as pt, l as pu, X2 as q, uV as qa, di as qc, AJ as qi, tn as ql, nye as qn, Rde as qo, mX as qr, dA as qs, l1 as qt, _Oe as r, CG as ra, Ex as rc, hX as ri, $r as rl, W$ as rn, Uz as ro, IX as rr, tz as rs, Bwe as rt, Ut as ru, nOe as s, DW as sa, Kg as sc, S8 as showToast, yve as si, ur as sl, KSe as sn, Rz as so, PX as sr, DR as ss, Mwe as st, A as su, F8 as t, QK as ta, CT as tc, pve as ti, ei as tl, USe as tn, XB as to, Qve as tr, QR as ts, I0 as tt, zt as tu, iOe as u, uW as ua, Fm as uc, $_e as ui, hr as ul, R$ as un, Pz as uo, Fve as ur, BI as us, Dwe as ut, v as uu, sOe as v, ahe as va, Mu as vc, Y_e as vi, Yr as vl, sZ as vn, ife as vo, BX as vr, YF as vs, TCe as vt, z3 as w, the as wa, ts as wc, W_e as wi, ti as wl, YX as wn, hz as wo, Dve as wr, yle as ws, y1 as wt, fOe as x, YH as xa, Wc as xc, K_e as xi, Xr as xl, uZ as xn, Oz as xo, kX as xr, dF as xs, DCe as xt, oOe as y, $H as ya, Gl as yc, QY as yi, ni as yl, lZ as yn, Cz as yo, Hve as yr, VF as ys, S1 as yt, DDe as z, RH as za, Ar as zc, SY as zi, Pn as zl, WX as zn, Lde as zo, lve as zr, Ele as zs, hCe as zt };
+export { DI as $2ec61d1d4f780267$export$a8a3e93435678ff9, BI as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, oR as $542a13ca2fa5b484$export$5b6b19405a83ff9d, CT as $72abaeab4d80592f$export$78efe591171d7d45, QR as $76d00c5a4edb230a$export$76ccd210b9029917, YR as $76d00c5a4edb230a$export$816b5d811295e6bc, tz as $76d00c5a4edb230a$export$b59bdbef9ce70de2, rz as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, JR as $76d00c5a4edb230a$export$f850895b287ef28e, gde as $b4f18e3395fe64d7$export$3d96ec278d3efce4, hde as $b4f18e3395fe64d7$export$3e41faf802a29e71, fde as $b4f18e3395fe64d7$export$b2539bed5023c21c, sz as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, yde as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, uw as $ea3928288112382f$export$439d29a4e110a164, yR as $f2ff30fde7b014be$export$3ddf2d174ce01153, ER as $fe21c36db05242bb$export$a98f0dcb43a68a25, DR as $fe21c36db05242bb$export$d7b12c4107be0d61, tfe as $l, RA as ACCENT_CHOICES, TCe as AMANE_BRIDGE_CHECK_URL, S1 as AMANE_BRIDGE_KEY, ECe as AMANE_BRIDGE_REBUILD_URL, kn as ApiError, DW as ArtSlot, q as Button, eI as ButtonLink, ufe as Bx, Vt as CLOUD_LOCATIONS, O0 as CLOUD_PROXY_HELP, mr as COLUMN_SORT, P1 as CONFIGURATION_KEY, OX as CONFIGURATION_URL, DCe as COOKIE_TEXT_LIMIT, x1 as COVER_JOB_KEY, _i as CREDENTIAL_STATE, _1 as CUSTOM_SOURCES_KEY, g1 as CUSTOM_SOURCES_URL, oV as Checkbox, aV as CheckboxGlyph, XB as ChevronSortDown, HZ as Chip, X2 as CloudDownloadDialog, HH as CollapseChevron, VH as CollapseRegion, R$ as CollectionSummary, ive as DEFAULT_CATEGORY, Nn as DEFAULT_SORT, c$ as DIAGNOSTICS_KEY, tye as DIRECTORY_TEMPLATE_ERROR, N0 as DISCOVERY_SORTS, W2 as DOWNLOADS_KEY, U2 as DOWNLOADS_URL, QY as DUPLICATES_KEY, FY as DataTableFooter, jY as DataTableFrame, PY as DataTableSort, YH as Disclosure, xEe as DownloadsPanel, Kde as E3, ave as ENTITY_REVIEW_KINDS, ife as Ea, xfe as EmptyFocusButton, zz as EmptyState, qH as ErrorText, $me as ExternalLink, lr as FEEDS_KEY, IX as FEED_SCHEDULE_KEY, _Oe as FLOW_LABEL_X, B3 as FLOW_VIEWBOX, sr as FOLLOW_CHECK_KEY, or as FOLLOW_CREDENTIALS_KEY, F8 as FOLLOW_INITIAL_RANGE_OPTIONS, ar as FOLLOW_MANAGE_KEY, cr as FOLLOW_RESOLVE_KEY, FX as FOLLOW_SCHEDULE_KEY, the as Fact, ehe as FactList, JH as FieldLabel, l1 as Fieldset, c1 as FieldsetTitle, WF as FilterGlass, GF as FilterGlassRows, UF as FilterIconButton, qF as FilterPill, Qme as Footer, Cz as Gg, YF as GlassPill, KH as Help, Az as HintText, lOe as IDLE_POLL_MS, q_e as IDLE_REPAIR, zF as IconButton, Fz as Input, Pz as InputBase, dA as JAV_LAYOUTS, F0 as JAV_RECOMMENDATION_GRID, aZ as JUNK_KEY, $3 as JavHeader, V_e as KEEP_LABELS, dr as LAYOUTS, y0 as LIBRARY_FOLDER_HELP, pH as LIBRARY_PROCESSING_KEY, bX as LINKS_KEY, xX as LINK_CHECK_KEY, Dve as LINK_KINDS, SX as LINK_PRUNE_KEY, wn as LOC, kz as Label, f1 as LibraryProcessingCard, nB as LibraryShortcuts, wH as LinkButton, IH as LoadingDots, Jde as M6, Mve as MEDIA_PROCESSING_KEY, RX as MEDIA_PROCESSING_URL, rX as MEDIA_REPAIR_KEY, nX as MEDIA_REPAIR_URL, Vn as MEDIA_SOURCES_KEY, Mo as MEDIA_SOURCE_ICONS, zt as MEDIA_SOURCE_OPTIONS, eV as MENU_ITEM, tV as MENU_ITEM_INTERACTIVE, $B as MENU_POPOVER_SURFACE, EH as MenuDialog, CG as MixCard, Iz as ModalFrame, Dv as MotionConfigContext, Oz as NR, Rz as Note, _fe as OA, VX as ORGANIZE_KEY, WX as ORPHAN_RECORDS_KEY, Sz as OV, hz as P7, USe as PHASES, kX as PICK_FOLDER_URL, m1 as PLAYLISTS_KEY, Dwe as POLICY_COLUMNS, kwe as POLICY_COVER_NOTE, Owe as POLICY_MATRIX, v0 as POLICY_SUMMARY, NY as Pagination, d1 as PathLine, rF as PillTabList, RH as Progress, cX as QUALITY_GOALS_KEY, n1 as REPAIR_CARD_TEXT, iX as REPAIR_LIBRARIES_KEY, YX as RESOURCE_APPLY_KEY, JX as RESOURCE_SCAN_KEY, nCe as RESULT_PANEL, rCe as RESULT_SECTION, rve as REVIEW_CATEGORIES, iZ as REVIEW_COUNTS_KEY, dX as REVIEW_KEY, fX as REVIEW_LABELS, EW as RetryNote, gfe as Rf, Zme as Rows, CCe as SCRAPING_CHECK_URL, y1 as SCRAPING_COVER_URL, b1 as SCRAPING_KEY, SCe as SCRAPING_SETTINGS_URL, CU as SEGMENT, SU as SEGMENTED_TRACK, PX as SETTINGS_KEY, AX as SETTINGS_URL, Pn as SORT_DEFAULT_DIR, Mn as SORT_OPTIONS, Ht as SOURCE_LABELS, d3 as STATS_KEY, Xme as Section, xU as SegmentedRadioGroup, zhe as SegmentedTabList, sW as Segments, MY as Select, mU as Select$1, R1 as SelectField, hU as SelectItem, Ck as SelectionDock, UH as SettingsCard, Yme as SettingsRow, WH as SettingsSectionLabel, ahe as SiteLabel, OU as SortDirectionIcon, uW as SortKeys, GQ as SourceAvatar, $H as SourceLabel, XH as SourceMark, GH as Stack, u1 as StatusLabel, L2 as Switch, dF as TASKS_KEY, tOe as TASTE_REFRESH_KEY, nOe as TASTE_WINDOWS, LX as THUMBNAIL_JOBS_KEY, sZ as TRASH_KEY, wle as TRIGGER_LABELS, SY as Table, HY as TableColumnControls, UY as TableColumnResizer, GY as TableSelectionHeader, zH as TaskProgress, Mz as TextField, jz as TextFieldContext, xz as Un, H$ as WANTS_KEY, o4 as WantMagnets, Lf as WithPromise, gz as Wt, bz as Xc, Dz as Xf, Xde as Xt, qde as _8, o as __commonJSMin, s as __exportAll, l as __toESM, hfe as aB, Jr as addAlias, qr as addSource, W$ as addWant, B as apiGet, V as apiSend, rA as appSettingsStore, bye as applyConfirmText, rZ as applyLeftovers, yye as applyPlanText, Sye as applyText, lA as applyTheme, Kg as asNumber, cye as attachOrphan, Ar as authorAvatar, Mr as authorGroups, kr as authorInitial, Or as authorName, Bq as autoResetPageIndex, La as avatarInner, _3 as bandRows, nye as baseName, K_e as batchOperate, Ok as boundedPreference, U_e as bulkCloudPreferences, Uz as busyProps, mfe as cB, jEe as cachedMagnetStates, Df as calcGeneratorVelocity, dve as canApprove, Zd as cancelFrame, pye as candidateText, FH as cardClass, wA as cardRatio, yz as cc, pi as checkEvidenceGap, fi as checkFailures, ri as checkFeeds, jve as checkLine, ui as checkReceipt, di as checkSummary, kCe as checkText, mi as checkedText, YW as clickedBlank, F_e as cloudLocations, Ex as clsx, sfe as cn, Nm as collectMotionValues, AJ as columnVisibilityFeature, _Y as column_getCanSort, pY as column_getSortFn, lve as commonReviewSources, uV as configurationSection, rOe as configureTasteBrowser, uc as confirmModal, lq as copyInstancePropertiesWithoutMemos, ja as coverUrl, xJ as createColumnHelper, gCe as createPlaylist, vi as credentialDone, bve as currentReviewRow, eF as cx, Tz as dZ, _ve as decisionPayload, vve as decisionReceipt, gve as defaultChoice, vCe as deletePlaylist, _0 as diagnosticsSkeleton, ZSe as discoveryArtwork, Y$ as discoveryKey, Bwe as discoveryScore, z_e as distinctName, Cve as dropReviewRows, ci as dropSources, pfe as du, W_e as duplicateVictims, TF as elapsedText, Ia as entityFaceImg, tn as entityPath, Cr as errorHeadline, jn as errorMessage, z as esc, Rq as expandRowModel, fz as f1, Sr as feedIntervalText, T1 as fetchAmaneBridge, Br as fetchCheckJob, F1 as fetchConfiguration, w1 as fetchCoverJob, zr as fetchCredentials, v1 as fetchCustomSources, l$ as fetchDiagnostics, X$ as fetchDiscoveries, eX as fetchDuplicates, yle as fetchEarlier, Fve as fetchFeedSchedule, ei as fetchFeeds, Rr as fetchFollow, Pve as fetchFollowSchedule, lZ as fetchJunkSummary, TX as fetchLinkCheck, EX as fetchLinkPrune, wX as fetchLinkStats, Nve as fetchMediaProcessing, aX as fetchMediaRepair, Hn as fetchMediaSources, HX as fetchOrganize, Jve as fetchOrganizeExample, GX as fetchOrphanRecords, $r as fetchPending, h1 as fetchPlaylists, lX as fetchQualityGoals, oX as fetchRepairLibraries, Vr as fetchResolveJob, ZX as fetchResourceApply, XX as fetchResourceScan, _X as fetchReview, cZ as fetchReviewCounts, zX as fetchSettings, C1 as fetchSources, f3 as fetchStats, Hr as fetchSuggestions, pF as fetchTasks, L3 as fetchTaste, iOe as fetchTasteJob, Ive as fetchThumbnailJobs, uZ as fetchTrashSummary, U$ as fetchWants, sve as filterReviewRows, Sn as firstGrapheme, kK as flexRender, yOe as flowGraph, bOe as flowLabel, xDe as fmtCount, gn as fmtDur, vn as fmtSize, xF as foldRoutine, ai as followFeedByName, ur as followSuggestKey, wF as followupDetail, Xd as frame, Lde as g4, NJ as getDefaultPaginationState, CA as gridLayout, jr as groupByAuthor, bF as groupFollowups, mX as groupReviewRows, _ye as hasChanges, QX as hasResourceRoots, hF as hasResultProblems, uOe as historySpan, pz as i2, cOe as importTasteExport, yf as interpolate, K$ as invalidateWants, CF as isActive, xr as isBroken, hr as isLayout, ih as isMotionValue, pX as isReviewCategory, SF as isRoutine, L0 as javContentSkeleton, gA as javLayout, I0 as javTagSkeleton, Dye as junkBreakdown, yCe as keepPlaylist, ve as keepPreviousData, Fr as keepSelected, p3 as known, Vde as l7, yF as latestOfKind, NDe as lengthRows, Gn as localTime, ii as lookupFeedActor, Wde as m7, wz as mM, Jt as mapLimit, Qr as markItem, v3 as max, jDe as mediumRows, ble as mergeFinished, y3 as min, Tve as mirrorText, X_e as missingToolText, tX as mixedCloudPreferences, NF as momentText, Iy as motion, Fm as motionValue, iye as organizeOutcome, e2 as overlayHost, gr as pageSizeOf, Pr as pageWindow, Ln as paginationRange, si as patchSource, QV as peachHistory, QV as peachHistory$1, hve as pendingGenres, CDe as percentText, Zve as pickOrganizeFolder, rye as planSummary, m3 as playedFor, TDe as playedItemUrl, fF as pollInterval, us as popCount, hCe as posterUrl, GW as previewLibraryColor, Xve as previewOrganize, $_e as previewUrl, vF as problemDestination, EF as progressText, QH as providerIcon, Ave as pruneText, eZ as purgeCount, lye as purgeOrphan, Ez as pv, ffe as qE, H as queryClient, mz as r2, gOe as radarRows, ODe as radialArc, kDe as radialBarSize, DDe as radialCeiling, EDe as radialSlices, Bj as randomId, mOe as rankDetail, hOe as rankShares, g3 as reachedShare, OF as readableErrorHeadline, Vwe as recommendationScore, xve as recordGenre, dye as recordsText, bCe as recreatePlaylist, pCe as refreshPlaylists, Wc as relayoutCovers, li as reloadFollowManage, wve as reloadReview, jwe as rememberMediaShape, Mwe as rememberSectionHeight, $ve as rememberTemplates, A0 as rememberedSectionHeight, Yr as removeAlias, ni as removeFeed, Kr as removeSource, sOe as removeTasteSource, G$ as removeWants, Xr as renameAliasGroup, _Ce as renamePlaylist, FDe as replayRows, E as require_jsx_runtime, v as require_react, S as require_react_dom, QK as require_with_selector, KSe as resetWants, In as resolveFollowSort, Nf as resolveStartTime, mCe as resumeAssetId, ove as reviewGroupingOptions, Eye as reviewSummary, cve as reviewWindow, pve as rowEvidence, gX as rowFieldName, BJ as rowPaginationFeature, sY as rowSelectionFeature, bY as rowSortingFeature, hX as rowSubject, mve as rowTags, fve as rowTitle, Rde as s5, Zr as saveCredential, vye as scanLine, Vve as schedulePollInterval, JSe as searchNote, uve as selectReviewRange, Ir as selectionState, ti as setFeedEnabled, Gr as setSourceEnabled, mV as settingsPath, R_e as sharedNamePrefix, $V as shellNavigate, S8 as showToast, cn as siteMarkUrl, Sq as skipFirstRun, tF as sortCx, vr as sortLabel, Ut as sourceDefaultCost, gi as sourceIconUrl, xye as sourceMeta, ts as spinnerHtml, gf as spring, Vz as spriteGlyph, Ur as startCheck, Ove as startLinkCheck, kve as startLinkPrune, Qve as startOrganize, Wr as startResolve, hye as startResourceApply, mye as startResourceScan, oOe as startTasteRefresh, Ele as statusLabel, Y_e as statusLine, br as statusText, TA as storeJavLayout, yve as submitDecision, FF as summaryItems, SJ as tableFeatures, Cq as tableMemo, Nr as tableRows, gF as taskIssues, R3 as tasteDate, fOe as tasteDimensions, dOe as tasteHours, I3 as tasteKey, Mu as time, efe as tl, Lr as toggleGroup, z3 as topScores, rfe as uo, NH as useAction, dQ as useBackgroundJob, Wl as useConstant, VF as useHorizontalScroller, Gl as useIsomorphicLayoutEffect, qW as useLibraryTints, wt as useMutation, sV as useOverlayScrollbar, Ct as useQuery, A as useQueryClient, Oy as useReducedMotion, Bve as useRunSchedule, Rve as useSaveFollowSchedule, BX as useSaveSettings, Hve as useSaveThumbnailMode, xY as useTable, RY as useTablePreferences, G_e as victimBytes, qSe as wantName, wDe as watchNote, h3 as watchedShare, Fs as wireHorizontalScroller, eye as withOrganizeJob };
-//# debugId=a5cb144c-9cf3-4720-9ec3-b67c77c62f50
\ No newline at end of file
+//# debugId=bddf95d6-e198-41bd-ac1b-11442666c9b9
\ No newline at end of file
diff --git a/web/dist/peach-app.legacy-avatar-CV1xk6vD.js b/web/dist/peach-app.legacy-avatar-CtPLcaNX.js
similarity index 67%
rename from web/dist/peach-app.legacy-avatar-CV1xk6vD.js
rename to web/dist/peach-app.legacy-avatar-CtPLcaNX.js
index d7feba3da..d8f1f2b06 100644
--- a/web/dist/peach-app.legacy-avatar-CV1xk6vD.js
+++ b/web/dist/peach-app.legacy-avatar-CtPLcaNX.js
@@ -2,11 +2,11 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "6f228f41-0b0a-4e24-b2d0-0c477025698d", e._sentryDebugIdIdentifier = "sentry-dbid-6f228f41-0b0a-4e24-b2d0-0c477025698d");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "50ee3126-1d62-461b-80d7-faf0bf45fae7", e._sentryDebugIdIdentifier = "sentry-dbid-50ee3126-1d62-461b-80d7-faf0bf45fae7");
} catch {}
})();
var e = "[&_img]:absolute [&_img]:inset-0 [&_img]:size-full [&_img]:max-w-none [&_img]:max-h-none [&_img]:object-cover";
//#endregion
-export { e as t };
+export { e as LEGACY_AVATAR_IMG };
-//# debugId=6f228f41-0b0a-4e24-b2d0-0c477025698d
\ No newline at end of file
+//# debugId=50ee3126-1d62-461b-80d7-faf0bf45fae7
\ No newline at end of file
diff --git a/web/dist/peach-app.page-BYr6f5ud.js b/web/dist/peach-app.page-Irl_Wogd.js
similarity index 65%
rename from web/dist/peach-app.page-BYr6f5ud.js
rename to web/dist/peach-app.page-Irl_Wogd.js
index 7be3df9d6..3b165047f 100644
--- a/web/dist/peach-app.page-BYr6f5ud.js
+++ b/web/dist/peach-app.page-Irl_Wogd.js
@@ -1,10 +1,10 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b472ea20-7041-4802-aeaa-52cf4e5083a9", e._sentryDebugIdIdentifier = "sentry-dbid-b472ea20-7041-4802-aeaa-52cf4e5083a9");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "9cfdcf22-0388-4139-90eb-3626f6d70fb8", e._sentryDebugIdIdentifier = "sentry-dbid-9cfdcf22-0388-4139-90eb-3626f6d70fb8");
} catch {}
})();
-import { cu as e } from "./peach-app.js";
+import { require_jsx_runtime as e } from "./peach-app.js";
//#region src/react/components/page.tsx
var t = e();
function n({ children: e }) {
@@ -14,6 +14,6 @@ function n({ children: e }) {
});
}
//#endregion
-export { n as t };
+export { n as Page };
-//# debugId=b472ea20-7041-4802-aeaa-52cf4e5083a9
\ No newline at end of file
+//# debugId=9cfdcf22-0388-4139-90eb-3626f6d70fb8
\ No newline at end of file
diff --git a/web/dist/peach-app.pill-aria-tab-list-B1wzfuox.js b/web/dist/peach-app.pill-aria-tab-list-B1wzfuox.js
deleted file mode 100644
index 584654af3..000000000
--- a/web/dist/peach-app.pill-aria-tab-list-B1wzfuox.js
+++ /dev/null
@@ -1,21 +0,0 @@
-(function() {
- try {
- var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e890244b-a35e-4c10-9efc-6f1875c7f2cb", e._sentryDebugIdIdentifier = "sentry-dbid-e890244b-a35e-4c10-9efc-6f1875c7f2cb");
- } catch {}
-})();
-import { Hs as e, cu as t, es as n, pu as r, uu as i, ys as a } from "./peach-app.js";
-//#region src/react/components/pill-aria-tab-list.tsx
-var o = /* @__PURE__ */ r(i(), 1), s = t();
-function c({ scrollable: t = !0, ...r }) {
- let [i, c] = (0, o.useState)(null), l = a(c, t);
- return /* @__PURE__ */ (0, s.jsxs)(s.Fragment, { children: [/* @__PURE__ */ (0, s.jsx)(n, {
- ...r,
- ref: l,
- "data-pill-nav": ""
- }), /* @__PURE__ */ (0, s.jsx)(e, { container: i })] });
-}
-//#endregion
-export { c as t };
-
-//# debugId=e890244b-a35e-4c10-9efc-6f1875c7f2cb
\ No newline at end of file
diff --git a/web/dist/peach-app.pill-aria-tab-list-CJ47JigD.js b/web/dist/peach-app.pill-aria-tab-list-CJ47JigD.js
new file mode 100644
index 000000000..12cb6eb2b
--- /dev/null
+++ b/web/dist/peach-app.pill-aria-tab-list-CJ47JigD.js
@@ -0,0 +1,21 @@
+(function() {
+ try {
+ var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e349969a-e436-4cad-8405-40d25260f270", e._sentryDebugIdIdentifier = "sentry-dbid-e349969a-e436-4cad-8405-40d25260f270");
+ } catch {}
+})();
+import { $b4f18e3395fe64d7$export$e51a686c67fdaa2d as e, PillTabList as t, __toESM as n, require_jsx_runtime as r, require_react as i, useHorizontalScroller as a } from "./peach-app.js";
+//#region src/react/components/pill-aria-tab-list.tsx
+var o = /* @__PURE__ */ n(i(), 1), s = r();
+function c({ scrollable: n = !0, ...r }) {
+ let [i, c] = (0, o.useState)(null), l = a(c, n);
+ return /* @__PURE__ */ (0, s.jsxs)(s.Fragment, { children: [/* @__PURE__ */ (0, s.jsx)(e, {
+ ...r,
+ ref: l,
+ "data-pill-nav": ""
+ }), /* @__PURE__ */ (0, s.jsx)(t, { container: i })] });
+}
+//#endregion
+export { c as PillAriaTabList };
+
+//# debugId=e349969a-e436-4cad-8405-40d25260f270
\ No newline at end of file
diff --git a/web/dist/peach-app.playlists-page-DLLm0T2E.js b/web/dist/peach-app.playlists-page-DKMNf-v5.js
similarity index 52%
rename from web/dist/peach-app.playlists-page-DLLm0T2E.js
rename to web/dist/peach-app.playlists-page-DKMNf-v5.js
index 45568a708..daa86fd7a 100644
--- a/web/dist/peach-app.playlists-page-DLLm0T2E.js
+++ b/web/dist/peach-app.playlists-page-DKMNf-v5.js
@@ -1,154 +1,154 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "30308fed-6e40-4a3b-bbfa-ced315736e0d", e._sentryDebugIdIdentifier = "sentry-dbid-30308fed-6e40-4a3b-bbfa-ced315736e0d");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "5ef18b97-4bc8-4a19-b1a0-8238d3db0b3a", e._sentryDebugIdIdentifier = "sentry-dbid-5ef18b97-4bc8-4a19-b1a0-8238d3db0b3a");
} catch {}
})();
-import { $a as e, Bt as t, Ft as n, Gl as r, Ht as i, It as a, Lt as o, Pt as s, Qa as c, Rt as l, Sc as u, Ua as d, Us as f, Ut as p, Vt as m, ao as h, au as g, ca as _, co as v, cu as y, ds as b, eo as x, fs as S, io as C, iu as w, lo as T, ls as E, oo as D, pu as O, ra as k, ro as A, uu as j, zt as M } from "./peach-app.js";
+import { $2ec61d1d4f780267$export$a8a3e93435678ff9 as e, $542a13ca2fa5b484$export$5b6b19405a83ff9d as t, Button as n, EmptyFocusButton as r, EmptyState as i, Input as a, MENU_ITEM as o, MENU_ITEM_INTERACTIVE as s, MENU_POPOVER_SURFACE as c, MenuDialog as l, MixCard as u, ModalFrame as d, PLAYLISTS_KEY as f, RetryNote as p, __toESM as m, busyProps as h, confirmModal as g, createPlaylist as _, cx as v, deletePlaylist as y, errorMessage as b, fetchPlaylists as x, keepPlaylist as S, posterUrl as C, recreatePlaylist as w, refreshPlaylists as T, renamePlaylist as E, require_jsx_runtime as D, require_react as O, resumeAssetId as k, spriteGlyph as A, useMutation as j, useQuery as M } from "./peach-app.js";
//#region src/react/playlists/playlists-page.tsx
-var N = /* @__PURE__ */ O(j(), 1), P = y(), F = C("ellipsis"), I = C("pencil"), L = C("trash"), R = C("playlist"), z = f(c, e, "text-body-2-medium"), B = "播放列表名称不能为空", V = (e) => async () => {
+var N = /* @__PURE__ */ m(O(), 1), P = D(), F = A("ellipsis"), I = A("pencil"), L = A("trash"), R = A("playlist"), z = v(o, s, "text-body-2-medium"), B = "播放列表名称不能为空", V = (e) => async () => {
try {
await e();
} finally {
- m();
+ T();
}
};
function H({ toast: e }) {
- let [t, i] = (0, N.useState)(""), [o, s] = (0, N.useState)(""), c = w({
- mutationFn: (e) => n(e),
+ let [t, r] = (0, N.useState)(""), [i, o] = (0, N.useState)(""), s = j({
+ mutationFn: (e) => _(e),
onSuccess: (t) => {
- i(""), s(""), m(), e("已新建播放列表", { undo: V(() => a(t.playlist.id)) });
+ r(""), o(""), T(), e("已新建播放列表", { undo: V(() => y(t.playlist.id)) });
},
- onError: (e) => s(r(e) || "新建失败")
+ onError: (e) => o(b(e) || "新建失败")
});
return /* @__PURE__ */ (0, P.jsxs)("form", {
"data-playlist-create": "",
"aria-label": "新建播放列表",
onSubmit: (e) => {
- e.preventDefault(), !c.isPending && (t.trim() ? c.mutate(t) : s(B));
+ e.preventDefault(), !s.isPending && (t.trim() ? s.mutate(t) : o(B));
},
className: "flex flex-wrap items-end gap-2",
children: [/* @__PURE__ */ (0, P.jsx)("div", {
className: "min-w-50 max-w-80 flex-1 basis-50 max-board-narrow:min-w-0 max-board-narrow:max-w-none",
- children: /* @__PURE__ */ (0, P.jsx)(T, {
+ children: /* @__PURE__ */ (0, P.jsx)(a, {
label: "新播放列表",
placeholder: "输入名称",
maxLength: 80,
value: t,
onChange: (e) => {
- i(e), s("");
+ r(e), o("");
},
validationBehavior: "aria",
- isInvalid: !!o,
- hint: o || void 0
+ isInvalid: !!i,
+ hint: i || void 0
})
- }), /* @__PURE__ */ (0, P.jsx)(S, {
+ }), /* @__PURE__ */ (0, P.jsx)(n, {
type: "submit",
- ...A(c.isPending),
+ ...h(s.isPending),
children: "新建"
})]
});
}
-function U({ target: e, close: t, toast: n }) {
- let [a, o] = (0, N.useState)(""), [s, c] = (0, N.useState)(""), l = (0, N.useRef)(null);
+function U({ target: t, close: r, toast: i }) {
+ let [o, s] = (0, N.useState)(""), [c, l] = (0, N.useState)(""), u = (0, N.useRef)(null);
(0, N.useEffect)(() => {
- if (!e) return;
- o(e.name), c("");
- let t = requestAnimationFrame(() => {
- l.current?.focus(), l.current?.select();
+ if (!t) return;
+ s(t.name), l("");
+ let e = requestAnimationFrame(() => {
+ u.current?.focus(), u.current?.select();
});
- return () => cancelAnimationFrame(t);
- }, [e]);
- let u = w({
- mutationFn: ({ row: e, value: t }) => i(e.id, t),
- onSuccess: (e, { row: r }) => {
- t(), m(), n("已重命名播放列表", { undo: V(() => i(r.id, r.name)) });
+ return () => cancelAnimationFrame(e);
+ }, [t]);
+ let f = j({
+ mutationFn: ({ row: e, value: t }) => E(e.id, t),
+ onSuccess: (e, { row: t }) => {
+ r(), T(), i("已重命名播放列表", { undo: V(() => E(t.id, t.name)) });
},
- onError: (e) => c(r(e))
+ onError: (e) => l(b(e))
});
- return /* @__PURE__ */ (0, P.jsx)(v, {
- isOpen: !!e,
+ return /* @__PURE__ */ (0, P.jsx)(d, {
+ isOpen: !!t,
onOpenChange: (e) => {
- e || t();
+ e || r();
},
width: "form",
children: /* @__PURE__ */ (0, P.jsxs)("form", {
"data-playlist-rename": "",
- onSubmit: (t) => {
- if (t.preventDefault(), !e || u.isPending) return;
- let n = a.trim();
- n ? u.mutate({
- row: e,
+ onSubmit: (e) => {
+ if (e.preventDefault(), !t || f.isPending) return;
+ let n = o.trim();
+ n ? f.mutate({
+ row: t,
value: n
- }) : c(B);
+ }) : l(B);
},
className: "flex min-h-0 flex-col",
children: [/* @__PURE__ */ (0, P.jsxs)("div", {
className: "flex flex-col gap-4 p-5",
- children: [/* @__PURE__ */ (0, P.jsx)(b, {
+ children: [/* @__PURE__ */ (0, P.jsx)(e, {
slot: "title",
className: "text-title-2-semibold text-text-primary",
children: "编辑名称"
- }), /* @__PURE__ */ (0, P.jsx)(T, {
- ref: l,
+ }), /* @__PURE__ */ (0, P.jsx)(a, {
+ ref: u,
label: "名称",
placeholder: "输入名称",
maxLength: 80,
- value: a,
+ value: o,
onChange: (e) => {
- o(e), c("");
+ s(e), l("");
},
validationBehavior: "aria",
- isInvalid: !!s,
- hint: s || void 0
+ isInvalid: !!c,
+ hint: c || void 0
})]
}), /* @__PURE__ */ (0, P.jsxs)("div", {
className: "flex justify-between gap-4 p-3",
- children: [/* @__PURE__ */ (0, P.jsx)(S, {
+ children: [/* @__PURE__ */ (0, P.jsx)(n, {
variant: "secondary",
- onClick: t,
+ onClick: r,
children: "取消"
- }), /* @__PURE__ */ (0, P.jsx)(S, {
+ }), /* @__PURE__ */ (0, P.jsx)(n, {
type: "submit",
- ...A(u.isPending),
+ ...h(f.isPending),
children: "保存名称"
})]
})]
})
});
}
-function W({ name: e, onRename: t, onDelete: n }) {
- let r = (0, N.useRef)(null), [i, a] = (0, N.useState)(!1), o = (e) => {
- a(!1), e();
+function W({ name: e, onRename: n, onDelete: r }) {
+ let i = (0, N.useRef)(null), [a, o] = (0, N.useState)(!1), s = (e) => {
+ o(!1), e();
};
return /* @__PURE__ */ (0, P.jsxs)(P.Fragment, { children: [/* @__PURE__ */ (0, P.jsx)("button", {
- ref: r,
+ ref: i,
type: "button",
title: "更多操作",
"aria-label": `播放列表操作:${e}`,
"aria-haspopup": "dialog",
- "aria-expanded": i,
+ "aria-expanded": a,
"data-playlist-menu": "",
- onClick: () => a(!0),
+ onClick: () => o(!0),
className: "flex size-7.5 flex-none cursor-pointer items-center justify-center rounded-2lg text-foreground-icon-secondary outline-none transition-colors hover:bg-background-primary-hover hover:text-foreground-icon-primary aria-expanded:bg-background-primary-hover aria-expanded:text-foreground-icon-primary focus-visible:ring-2 focus-visible:ring-border-focus-ring",
children: /* @__PURE__ */ (0, P.jsx)(F, {
"aria-hidden": !0,
className: "size-4.5"
})
- }), /* @__PURE__ */ (0, P.jsx)(E, {
- triggerRef: r,
- isOpen: i,
- onOpenChange: a,
+ }), /* @__PURE__ */ (0, P.jsx)(t, {
+ triggerRef: i,
+ isOpen: a,
+ onOpenChange: o,
placement: "bottom end",
offset: 4,
- className: x,
- children: /* @__PURE__ */ (0, P.jsxs)(d, {
+ className: c,
+ children: /* @__PURE__ */ (0, P.jsxs)(l, {
"aria-label": `播放列表操作:${e}`,
className: "flex w-37.5 flex-col gap-0.5 outline-none",
children: [/* @__PURE__ */ (0, P.jsxs)("button", {
type: "button",
className: z,
- onClick: () => o(t),
+ onClick: () => s(n),
children: [/* @__PURE__ */ (0, P.jsx)(I, {
"aria-hidden": !0,
className: "size-(--icon-inline) shrink-0"
@@ -156,7 +156,7 @@ function W({ name: e, onRename: t, onDelete: n }) {
}), /* @__PURE__ */ (0, P.jsxs)("button", {
type: "button",
className: z,
- onClick: () => o(n),
+ onClick: () => s(r),
children: [/* @__PURE__ */ (0, P.jsx)(L, {
"aria-hidden": !0,
className: "size-(--icon-inline) shrink-0"
@@ -165,23 +165,23 @@ function W({ name: e, onRename: t, onDelete: n }) {
})
})] });
}
-function G({ openPlaylist: e, openEntity: n, canFlip: i, toast: c, revision: d }) {
- let f = g({
- queryKey: s,
- queryFn: ({ signal: e }) => o(e)
- }), [v, y] = (0, N.useState)(null), b = (0, N.useRef)(d);
+function G({ openPlaylist: e, openEntity: t, canFlip: n, toast: a, revision: o }) {
+ let s = M({
+ queryKey: f,
+ queryFn: ({ signal: e }) => x(e)
+ }), [c, l] = (0, N.useState)(null), d = (0, N.useRef)(o);
(0, N.useEffect)(() => {
- b.current !== d && (b.current = d, m());
- }, [d]);
- let x = f.data, S = x?.items ?? [], C = (e) => {
- u({
+ d.current !== o && (d.current = o, T());
+ }, [o]);
+ let m = s.data, h = m?.items ?? [], _ = (e) => {
+ g({
title: "删除播放列表",
body: "这个播放列表将被删除,视频文件保留。",
confirmLabel: "删除播放列表",
danger: !0,
onConfirm: async () => {
- let n = await l(e.id);
- await a(e.id), m(), c("已删除播放列表", n ? { undo: V(() => t(n)) } : void 0);
+ let t = await S(e.id);
+ await y(e.id), T(), a("已删除播放列表", t ? { undo: V(() => w(t)) } : void 0);
}
});
};
@@ -196,51 +196,51 @@ function G({ openPlaylist: e, openEntity: n, canFlip: i, toast: c, revision: d }
}), /* @__PURE__ */ (0, P.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: "保存 Mix,按自己的顺序继续播放。"
- })] }), /* @__PURE__ */ (0, P.jsx)(H, { toast: c })]
+ })] }), /* @__PURE__ */ (0, P.jsx)(H, { toast: a })]
}),
/* @__PURE__ */ (0, P.jsx)("div", {
className: "mx-auto w-full max-w-board",
- children: x ? S.length ? /* @__PURE__ */ (0, P.jsx)("div", {
+ children: m ? h.length ? /* @__PURE__ */ (0, P.jsx)("div", {
"data-playlist-grid": "",
className: "card-grid-cover gap-4.5",
- children: S.map((t) => {
- let r = p(t), a = t.name.trim() || "未命名播放列表";
- return /* @__PURE__ */ (0, P.jsx)(k, {
- "data-playlist-card": String(t.id),
+ children: h.map((r) => {
+ let i = k(r), a = r.name.trim() || "未命名播放列表";
+ return /* @__PURE__ */ (0, P.jsx)(u, {
+ "data-playlist-card": String(r.id),
name: a,
- caption: t.source_kind === "mix" ? "由 Mix 保存" : "手动播放列表",
- count: t.item_count,
- poster: t.preview_asset_id ? M(t.preview_asset_id) : null,
- flipImages: async () => (t.preview_ids || []).map(M),
- canFlip: i,
- faces: t.faces || [],
- onOpenEntity: n,
- ...r ? { onOpen: () => e(t.id, r) } : {},
+ caption: r.source_kind === "mix" ? "由 Mix 保存" : "手动播放列表",
+ count: r.item_count,
+ poster: r.preview_asset_id ? C(r.preview_asset_id) : null,
+ flipImages: async () => (r.preview_ids || []).map(C),
+ canFlip: n,
+ faces: r.faces || [],
+ onOpenEntity: t,
+ ...i ? { onOpen: () => e(r.id, i) } : {},
openLabel: `打开播放列表 ${a}`,
menu: /* @__PURE__ */ (0, P.jsx)(W, {
name: a,
- onRename: () => y(t),
- onDelete: () => C(t)
+ onRename: () => l(r),
+ onDelete: () => _(r)
})
- }, t.id);
+ }, r.id);
})
- }) : /* @__PURE__ */ (0, P.jsx)(D, {
+ }) : /* @__PURE__ */ (0, P.jsx)(i, {
icon: R,
title: "还没有播放列表",
- actions: /* @__PURE__ */ (0, P.jsx)(h, {
+ actions: /* @__PURE__ */ (0, P.jsx)(r, {
target: "[data-playlist-create] input",
children: "新建播放列表"
}),
children: "保存 Mix 或新建列表后,会在这里按自己的顺序继续播放。"
- }) : f.isError ? /* @__PURE__ */ (0, P.jsx)(_, {
- message: r(f.error) || "播放列表读取失败",
- onRetry: () => void f.refetch()
+ }) : s.isError ? /* @__PURE__ */ (0, P.jsx)(p, {
+ message: b(s.error) || "播放列表读取失败",
+ onRetry: () => void s.refetch()
}) : null
}),
/* @__PURE__ */ (0, P.jsx)(U, {
- target: v,
- close: () => y(null),
- toast: c
+ target: c,
+ close: () => l(null),
+ toast: a
})
]
});
@@ -248,4 +248,4 @@ function G({ openPlaylist: e, openEntity: n, canFlip: i, toast: c, revision: d }
//#endregion
export { G as PlaylistsPage };
-//# debugId=30308fed-6e40-4a3b-bbfa-ced315736e0d
\ No newline at end of file
+//# debugId=5ef18b97-4bc8-4a19-b1a0-8238d3db0b3a
\ No newline at end of file
diff --git a/web/dist/peach-app.quality-goals-page-BuyOF0iS.js b/web/dist/peach-app.quality-goals-page-CjcBIXAC.js
similarity index 52%
rename from web/dist/peach-app.quality-goals-page-BuyOF0iS.js
rename to web/dist/peach-app.quality-goals-page-CjcBIXAC.js
index 44e7dc9f0..dd8a3de2d 100644
--- a/web/dist/peach-app.quality-goals-page-BuyOF0iS.js
+++ b/web/dist/peach-app.quality-goals-page-CjcBIXAC.js
@@ -1,18 +1,18 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "809acbf1-2e83-4e43-91fe-883feddbd561", e._sentryDebugIdIdentifier = "sentry-dbid-809acbf1-2e83-4e43-91fe-883feddbd561");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b64f9c93-98fa-4f13-877f-4df4de721358", e._sentryDebugIdIdentifier = "sentry-dbid-b64f9c93-98fa-4f13-877f-4df4de721358");
} catch {}
})();
-import { Gl as e, Kl as t, So as n, Va as r, Xl as i, Zl as a, au as o, ci as s, cu as c, fs as l, li as u, oo as d, pu as f, q as p, so as m, ui as h, un as g, uu as _ } from "./peach-app.js";
-import { t as v } from "./peach-app.page-BYr6f5ud.js";
+import { Button as e, CloudDownloadDialog as t, CollectionSummary as n, EmptyState as r, LOC as i, Note as a, OA as o, QUALITY_GOALS_KEY as s, __toESM as c, cardClass as l, errorMessage as u, fetchQualityGoals as d, fmtDur as f, fmtSize as p, previewUrl as m, require_jsx_runtime as h, require_react as g, useQuery as _ } from "./peach-app.js";
+import { Page as v } from "./peach-app.page-Irl_Wogd.js";
//#region src/react/quality-goals/quality-goals-page.tsx
-var y = /* @__PURE__ */ f(_(), 1), b = c();
-function x({ item: e, openItem: n, searchResources: o, javTitleHtml: s, javDisplayName: c, srcBadge: u }) {
- let d = () => n(e.id);
+var y = /* @__PURE__ */ c(g(), 1), b = h();
+function x({ item: t, openItem: n, searchResources: r, javTitleHtml: a, javDisplayName: o, srcBadge: s }) {
+ let c = () => n(t.id);
return /* @__PURE__ */ (0, b.jsxs)("li", {
- "data-goal-id": e.id,
- className: r({
+ "data-goal-id": t.id,
+ className: l({
padding: "none",
bordered: "soft",
className: "flex flex-col gap-3 p-3"
@@ -21,14 +21,14 @@ function x({ item: e, openItem: n, searchResources: o, javTitleHtml: s, javDispl
className: "flex min-w-0 gap-4",
children: [/* @__PURE__ */ (0, b.jsxs)("button", {
type: "button",
- onClick: d,
- "aria-label": `打开 ${c(e)}`,
+ onClick: c,
+ "aria-label": `打开 ${o(t)}`,
className: "relative inline-grid w-card-cover shrink-0 self-start aspect-card-cover cursor-pointer place-items-center overflow-hidden rounded-2lg bg-background-tertiary-default",
children: [/* @__PURE__ */ (0, b.jsx)("span", {
className: "text-caption-1-regular text-text-secondary",
children: "暂无预览"
}), /* @__PURE__ */ (0, b.jsx)("img", {
- src: h(e),
+ src: m(t),
alt: "",
loading: "lazy",
onError: (e) => e.currentTarget.remove(),
@@ -41,10 +41,10 @@ function x({ item: e, openItem: n, searchResources: o, javTitleHtml: s, javDispl
className: "text-headline-medium text-text-primary",
children: /* @__PURE__ */ (0, b.jsx)("button", {
type: "button",
- onClick: d,
- title: c(e),
+ onClick: c,
+ title: o(t),
className: "line-clamp-2 w-full cursor-pointer text-left wrap-anywhere",
- dangerouslySetInnerHTML: { __html: s(e) }
+ dangerouslySetInnerHTML: { __html: a(t) }
})
}),
/* @__PURE__ */ (0, b.jsxs)("p", {
@@ -52,78 +52,78 @@ function x({ item: e, openItem: n, searchResources: o, javTitleHtml: s, javDispl
children: [
/* @__PURE__ */ (0, b.jsx)("span", {
className: "contents",
- dangerouslySetInnerHTML: { __html: u(e.location, e.cost) }
+ dangerouslySetInnerHTML: { __html: s(t.location, t.cost) }
}),
- /* @__PURE__ */ (0, b.jsx)("span", { children: t[e.location] ?? e.location }),
- /* @__PURE__ */ (0, b.jsx)("span", { children: i(e.duration) }),
- /* @__PURE__ */ (0, b.jsx)("span", { children: Number(e.size) > 0 ? a(Number(e.size)) : "大小未知" })
+ /* @__PURE__ */ (0, b.jsx)("span", { children: i[t.location] ?? t.location }),
+ /* @__PURE__ */ (0, b.jsx)("span", { children: f(t.duration) }),
+ /* @__PURE__ */ (0, b.jsx)("span", { children: Number(t.size) > 0 ? p(Number(t.size)) : "大小未知" })
]
}),
- e.reason ? /* @__PURE__ */ (0, b.jsx)("p", {
+ t.reason ? /* @__PURE__ */ (0, b.jsx)("p", {
className: "border-t border-separator-border pt-3 text-body-2-regular text-text-secondary wrap-anywhere",
- children: e.reason
+ children: t.reason
}) : null
]
})]
}), /* @__PURE__ */ (0, b.jsxs)("footer", {
className: "flex flex-wrap justify-end gap-2",
- children: [e.code ? /* @__PURE__ */ (0, b.jsx)(l, {
+ children: [t.code ? /* @__PURE__ */ (0, b.jsx)(e, {
variant: "secondary",
size: "small",
- onClick: () => o({
- code: e.code,
- title: c(e),
- origin: `asset:${e.id}`,
- searchReason: e.reason || "",
- duration: e.duration,
- cover: h(e)
+ onClick: () => r({
+ code: t.code,
+ title: o(t),
+ origin: `asset:${t.id}`,
+ searchReason: t.reason || "",
+ duration: t.duration,
+ cover: m(t)
}),
children: "查找资源"
- }) : null, /* @__PURE__ */ (0, b.jsx)(l, {
+ }) : null, /* @__PURE__ */ (0, b.jsx)(e, {
variant: "secondary",
size: "small",
- onClick: d,
+ onClick: c,
children: "查看版本"
})]
})]
});
}
-function S({ toast: t, ...r }) {
- let [i, a] = (0, y.useState)(null), c = o({
+function S({ toast: e, ...i }) {
+ let [c, l] = (0, y.useState)(null), f = _({
queryKey: s,
- queryFn: ({ signal: e }) => u(e)
- }), l = c.data;
- if (!l) return /* @__PURE__ */ (0, b.jsx)(v, { children: /* @__PURE__ */ (0, b.jsx)(m, {
+ queryFn: ({ signal: e }) => d(e)
+ }), p = f.data;
+ if (!p) return /* @__PURE__ */ (0, b.jsx)(v, { children: /* @__PURE__ */ (0, b.jsx)(a, {
tone: "error",
title: "高清版目标读取失败",
- children: c.error ? e(c.error) : "未取得高清版目标,请刷新页面重试。"
+ children: f.error ? u(f.error) : "未取得高清版目标,请刷新页面重试。"
}) });
- let f = l.items || [];
- return f.length ? /* @__PURE__ */ (0, b.jsxs)(v, { children: [
- /* @__PURE__ */ (0, b.jsx)(g, {
+ let m = p.items || [];
+ return m.length ? /* @__PURE__ */ (0, b.jsxs)(v, { children: [
+ /* @__PURE__ */ (0, b.jsx)(n, {
label: "待升级",
- figure: `${Number(l.total || 0).toLocaleString()} 部作品`,
+ figure: `${Number(p.total || 0).toLocaleString()} 部作品`,
flush: !0
}),
/* @__PURE__ */ (0, b.jsx)("ul", {
className: "card-grid-cover gap-5",
- children: f.map((e) => /* @__PURE__ */ (0, b.jsx)(x, {
+ children: m.map((e) => /* @__PURE__ */ (0, b.jsx)(x, {
item: e,
- ...r,
- searchResources: a
+ ...i,
+ searchResources: l
}, e.id))
}),
- Number(l.total || 0) > f.length ? /* @__PURE__ */ (0, b.jsx)("p", {
+ Number(p.total || 0) > m.length ? /* @__PURE__ */ (0, b.jsx)("p", {
className: "mt-6 text-center text-caption-1-regular text-text-secondary",
- children: `显示前 ${f.length.toLocaleString()} 部,共 ${Number(l.total).toLocaleString()} 部。`
+ children: `显示前 ${m.length.toLocaleString()} 部,共 ${Number(p.total).toLocaleString()} 部。`
}) : null,
- /* @__PURE__ */ (0, b.jsx)(p, {
- prefill: i,
- close: () => a(null),
- receipt: t
+ /* @__PURE__ */ (0, b.jsx)(t, {
+ prefill: c,
+ close: () => l(null),
+ receipt: e
})
- ] }) : /* @__PURE__ */ (0, b.jsx)(v, { children: /* @__PURE__ */ (0, b.jsx)(d, {
- icon: n,
+ ] }) : /* @__PURE__ */ (0, b.jsx)(v, { children: /* @__PURE__ */ (0, b.jsx)(r, {
+ icon: o,
title: "没有标记中的高清版目标",
children: "现有版本都已满足条件,或还没有加入追踪。"
}) });
@@ -131,4 +131,4 @@ function S({ toast: t, ...r }) {
//#endregion
export { S as QualityGoalsPage };
-//# debugId=809acbf1-2e83-4e43-91fe-883feddbd561
\ No newline at end of file
+//# debugId=b64f9c93-98fa-4f13-877f-4df4de721358
\ No newline at end of file
diff --git a/web/dist/peach-app.review-page-9sUxvOT_.js b/web/dist/peach-app.review-page-CPsgIxd6.js
similarity index 52%
rename from web/dist/peach-app.review-page-9sUxvOT_.js
rename to web/dist/peach-app.review-page-CPsgIxd6.js
index 13b97519d..f328b6c5b 100644
--- a/web/dist/peach-app.review-page-9sUxvOT_.js
+++ b/web/dist/peach-app.review-page-CPsgIxd6.js
@@ -1,109 +1,109 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "784a955c-ce4c-4fa1-99bd-9355f850ad34", e._sentryDebugIdIdentifier = "sentry-dbid-784a955c-ce4c-4fa1-99bd-9355f850ad34");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "5d38737a-8167-4a7a-b8b7-f256ab67572b", e._sentryDebugIdIdentifier = "sentry-dbid-5d38737a-8167-4a7a-b8b7-f256ab67572b");
} catch {}
})();
-import { $o as e, $r as t, Br as n, Ca as r, Do as i, Ec as a, Fr as o, Gl as s, Gr as c, Ho as l, Hr as u, Ir as ee, Jr as d, Kr as f, Li as p, Ll as m, Lr as te, Nr as h, Pr as g, Qo as _, Qr as v, Rr as ne, Ur as y, Va as b, Vo as x, Vr as S, Wr as C, Xa as re, Xr as w, Ya as T, Yr as E, Za as D, Zo as ie, Zr as ae, _a as O, ai as oe, au as se, cu as ce, do as le, ec as ue, ei as de, fs as k, hn as A, ii as j, iu as fe, nc as M, ni as pe, oi as me, oo as he, os as N, ps as ge, pu as P, qr as _e, ri as ve, ro as F, si as ye, so as be, ss as I, ti as xe, uo as Se, uu as Ce, vo as we, wc as L, yo as R, zr as z } from "./peach-app.js";
-import { t as Te } from "./peach-app.page-BYr6f5ud.js";
-import { t as B } from "./peach-app.legacy-avatar-CV1xk6vD.js";
-import { t as Ee } from "./peach-app.pill-aria-tab-list-B1wzfuox.js";
+import { $b4f18e3395fe64d7$export$3d96ec278d3efce4 as e, $b4f18e3395fe64d7$export$3e41faf802a29e71 as t, $b4f18e3395fe64d7$export$b2539bed5023c21c as n, $ea3928288112382f$export$439d29a4e110a164 as r, $fe21c36db05242bb$export$a98f0dcb43a68a25 as i, $fe21c36db05242bb$export$d7b12c4107be0d61 as a, Button as o, ButtonLink as s, Checkbox as c, CheckboxGlyph as l, Chip as u, DEFAULT_CATEGORY as d, ENTITY_REVIEW_KINDS as f, Ea as ee, EmptyState as p, ExternalLink as m, Gg as h, InputBase as g, Note as _, REVIEW_CATEGORIES as v, REVIEW_KEY as y, REVIEW_LABELS as te, Select as b, SelectItem as x, SelectionDock as S, TextField as C, Wt as w, __toESM as T, avatarInner as ne, busyProps as E, canApprove as re, cardClass as D, commonReviewSources as O, currentReviewRow as k, decisionPayload as A, decisionReceipt as j, defaultChoice as ie, dropReviewRows as ae, errorMessage as M, fetchReview as oe, filterReviewRows as se, groupReviewRows as ce, isReviewCategory as le, l7 as ue, m7 as de, mirrorText as fe, paginationRange as N, pendingGenres as pe, recordGenre as P, reloadReview as me, require_jsx_runtime as F, require_react as he, reviewGroupingOptions as ge, reviewWindow as _e, rowEvidence as ve, rowFieldName as ye, rowSubject as be, rowTags as xe, rowTitle as I, selectReviewRange as Se, spinnerHtml as L, submitDecision as Ce, useMutation as we, useOverlayScrollbar as R, useQuery as Te } from "./peach-app.js";
+import { Page as Ee } from "./peach-app.page-Irl_Wogd.js";
+import { LEGACY_AVATAR_IMG as z } from "./peach-app.legacy-avatar-CtPLcaNX.js";
+import { PillAriaTabList as De } from "./peach-app.pill-aria-tab-list-CJ47JigD.js";
//#region src/react/review/bulk-toolbar.tsx
-var V = /* @__PURE__ */ P(Ce(), 1), H = ce();
-function De(e) {
- let { groupOptions: t, groupBy: n, onGroupBy: r, groups: i, filter: a, onFilter: o, pageKeys: s, selected: c, onSelected: l, selectedRows: u, metadata: ee, approvable: d, busy: f, feedback: m, onUnifySource: te, onRun: h } = e, g = s.filter((e) => c.has(e)), _ = g.length > 0 && g.length === s.length, v = z(u), ne = ee && u.some((e) => (e.candidates?.length || 0) > 1), y = v.length ? "统一选择来源" : "所选项目无共同来源";
- return /* @__PURE__ */ (0, H.jsxs)(H.Fragment, { children: [/* @__PURE__ */ (0, H.jsxs)("div", {
+var B = /* @__PURE__ */ T(he(), 1), V = F();
+function Oe(e) {
+ let { groupOptions: t, groupBy: n, onGroupBy: r, groups: i, filter: a, onFilter: s, pageKeys: c, selected: l, onSelected: u, selectedRows: d, metadata: f, approvable: ee, busy: p, feedback: m, onUnifySource: h, onRun: g } = e, _ = c.filter((e) => l.has(e)), v = _.length > 0 && _.length === c.length, y = O(d), te = f && d.some((e) => (e.candidates?.length || 0) > 1), C = y.length ? "统一选择来源" : "所选项目无共同来源";
+ return /* @__PURE__ */ (0, V.jsxs)(V.Fragment, { children: [/* @__PURE__ */ (0, V.jsxs)("div", {
role: "group",
"aria-label": "复核筛选",
"data-review-filter": !0,
"data-glass-pane": "",
className: "sticky top-topbar z-10 flex flex-wrap items-center gap-2 p-3",
children: [
- /* @__PURE__ */ (0, H.jsx)(p, {
+ /* @__PURE__ */ (0, V.jsx)(b, {
"aria-label": "筛选分组方式",
size: "sm",
selectedKey: n,
onSelectionChange: (e) => {
e !== null && r(String(e));
},
- children: t.map(([e, t]) => /* @__PURE__ */ (0, H.jsx)(O, {
+ children: t.map(([e, t]) => /* @__PURE__ */ (0, V.jsx)(x, {
id: e,
children: t
}, e))
}),
- i.length > 1 ? /* @__PURE__ */ (0, H.jsxs)(p, {
+ i.length > 1 ? /* @__PURE__ */ (0, V.jsxs)(b, {
"aria-label": n === "field" ? "筛选字段分类" : "筛选当前分类",
size: "sm",
prefix: "分类",
selectedKey: a || "*",
onSelectionChange: (e) => {
- e !== null && o(String(e) === "*" ? "" : String(e));
+ e !== null && s(String(e) === "*" ? "" : String(e));
},
- children: [/* @__PURE__ */ (0, H.jsx)(O, {
+ children: [/* @__PURE__ */ (0, V.jsx)(x, {
id: "*",
children: "全部"
- }), i.map((e) => /* @__PURE__ */ (0, H.jsx)(O, {
+ }), i.map((e) => /* @__PURE__ */ (0, V.jsx)(x, {
id: e.key,
children: `${e.title} · ${e.rows.length}`
}, e.key))]
}) : null,
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
- leadingIcon: x,
- "aria-pressed": _,
- disabled: f || !s.length,
+ leadingIcon: ue,
+ "aria-pressed": v,
+ disabled: p || !c.length,
onClick: () => {
- let e = new Set(c);
- for (let t of s) _ ? e.delete(t) : e.add(t);
- l(e);
+ let e = new Set(l);
+ for (let t of c) v ? e.delete(t) : e.add(t);
+ u(e);
},
- children: _ ? "清空当前选择" : a ? "全选当前分类" : "全选本页"
+ children: v ? "清空当前选择" : a ? "全选当前分类" : "全选本页"
})
]
- }), /* @__PURE__ */ (0, H.jsxs)(ue, {
+ }), /* @__PURE__ */ (0, V.jsxs)(S, {
label: "复核所选项目",
- visible: c.size > 0,
- count: `已选 ${c.size} 项`,
+ visible: l.size > 0,
+ count: `已选 ${l.size} 项`,
children: [
- ne ? /* @__PURE__ */ (0, H.jsxs)(p, {
+ te ? /* @__PURE__ */ (0, V.jsxs)(b, {
"aria-label": "统一选择来源",
size: "sm",
selectedKey: "",
- isDisabled: f || !v.length,
+ isDisabled: p || !y.length,
onSelectionChange: (e) => {
- e !== null && e !== "" && te(String(e));
+ e !== null && e !== "" && h(String(e));
},
- children: [/* @__PURE__ */ (0, H.jsx)(O, {
+ children: [/* @__PURE__ */ (0, V.jsx)(x, {
id: "",
- children: y
- }), v.map((e) => /* @__PURE__ */ (0, H.jsx)(O, {
+ children: C
+ }), y.map((e) => /* @__PURE__ */ (0, V.jsx)(x, {
id: e,
children: e
}, e))]
}) : null,
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "danger",
size: "small",
- disabled: f || !c.size,
- onClick: () => h("rejected"),
+ disabled: p || !l.size,
+ onClick: () => g("rejected"),
children: "拒绝所选"
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "primary",
size: "small",
- disabled: f || !c.size || !d,
- onClick: () => h("approved"),
+ disabled: p || !l.size || !ee,
+ onClick: () => g("approved"),
children: "通过所选"
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "ghost",
size: "small",
- disabled: f,
- onClick: () => l(/* @__PURE__ */ new Set()),
+ disabled: p,
+ onClick: () => u(/* @__PURE__ */ new Set()),
children: "取消选择"
}),
- m ? /* @__PURE__ */ (0, H.jsx)("p", {
+ m ? /* @__PURE__ */ (0, V.jsx)("p", {
role: "status",
className: "w-full text-body-2-regular text-text-secondary",
children: m
@@ -113,7 +113,7 @@ function De(e) {
}
//#endregion
//#region src/react/review/candidate-form.tsx
-var U = {
+var H = {
title: "标题",
original_title: "原标题",
runtime: "来源时长",
@@ -123,21 +123,21 @@ var U = {
cover_url: "封面",
screenshot_urls: "截图",
trailer_url: "预告片"
-}, W = "reviewgenretags";
-function Oe({ tags: e }) {
- return e.length ? /* @__PURE__ */ (0, H.jsx)("datalist", {
- id: W,
- children: e.map((e) => /* @__PURE__ */ (0, H.jsx)("option", { value: e }, e))
+}, U = "reviewgenretags";
+function ke({ tags: e }) {
+ return e.length ? /* @__PURE__ */ (0, V.jsx)("datalist", {
+ id: U,
+ children: e.map((e) => /* @__PURE__ */ (0, V.jsx)("option", { value: e }, e))
}) : null;
}
-function G({ candidate: e, selectable: t = !1 }) {
+function W({ candidate: e, selectable: t = !1 }) {
let n = Object.entries(e.catalog_evidence || {}).filter(([, e]) => e && e.display_value), r = e.content_id || e.provider_id;
- return /* @__PURE__ */ (0, H.jsxs)("span", {
+ return /* @__PURE__ */ (0, V.jsxs)("span", {
className: "flex min-w-0 flex-1 flex-col",
- children: [/* @__PURE__ */ (0, H.jsxs)("span", {
+ children: [/* @__PURE__ */ (0, V.jsxs)("span", {
className: "relative flex min-w-0 flex-col gap-0.5 px-4 py-3 group-hover:bg-background-primary-hover group-data-selected:bg-background-primary-hover",
children: [
- /* @__PURE__ */ (0, H.jsxs)("b", {
+ /* @__PURE__ */ (0, V.jsxs)("b", {
className: "text-body-2-medium text-text-secondary",
children: [
e.source,
@@ -145,35 +145,35 @@ function G({ candidate: e, selectable: t = !1 }) {
r ? ` · ID ${r}` : ""
]
}),
- /* @__PURE__ */ (0, H.jsx)("span", {
+ /* @__PURE__ */ (0, V.jsx)("span", {
className: "text-body-medium break-words text-text-primary",
children: e.display_value || ""
}),
- (e.warnings || []).map((e) => /* @__PURE__ */ (0, H.jsx)("i", {
+ (e.warnings || []).map((e) => /* @__PURE__ */ (0, V.jsx)("i", {
className: "text-body-2-regular text-status-yellow-text",
children: e
}, e)),
- t ? /* @__PURE__ */ (0, H.jsx)("span", {
+ t ? /* @__PURE__ */ (0, V.jsx)("span", {
"aria-hidden": "true",
"data-candidate-choice": !0,
className: "absolute top-4 right-4 inline-grid size-4 place-items-center rounded-full border border-border-checkbox-default bg-background-primary-default group-hover:border-border-checkbox-hover group-data-selected:border-border-focus-ring group-data-selected:bg-accent-600",
- children: /* @__PURE__ */ (0, H.jsx)("span", { className: "size-1.5 rounded-full bg-text-white opacity-0 group-data-selected:opacity-100" })
+ children: /* @__PURE__ */ (0, V.jsx)("span", { className: "size-1.5 rounded-full bg-text-white opacity-0 group-data-selected:opacity-100" })
}) : null
]
- }), n.length ? /* @__PURE__ */ (0, H.jsx)("dl", {
+ }), n.length ? /* @__PURE__ */ (0, V.jsx)("dl", {
className: "flex flex-col gap-1 border-t border-separator-border bg-background-primary-default px-4 py-2.5",
- children: n.map(([e, t]) => /* @__PURE__ */ (0, H.jsxs)("div", {
+ children: n.map(([e, t]) => /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex min-w-0 flex-wrap gap-x-2",
children: [
- /* @__PURE__ */ (0, H.jsx)("dt", {
+ /* @__PURE__ */ (0, V.jsx)("dt", {
className: "text-body-2-regular text-text-secondary",
- children: U[e] || e
+ children: H[e] || e
}),
- /* @__PURE__ */ (0, H.jsx)("dd", {
+ /* @__PURE__ */ (0, V.jsx)("dd", {
className: "min-w-0 text-body-2-regular break-words text-text-primary",
children: t.display_value
}),
- (t.warnings || []).map((e) => /* @__PURE__ */ (0, H.jsx)("small", {
+ (t.warnings || []).map((e) => /* @__PURE__ */ (0, V.jsx)("small", {
className: "w-full text-caption-1-regular text-status-yellow-text",
children: e
}, e))
@@ -182,56 +182,56 @@ function G({ candidate: e, selectable: t = !1 }) {
}) : null]
});
}
-function K({ row: e, fieldName: t, value: n, onChange: r, locked: i }) {
- let a = e.candidates || [];
- return a.length ? a.length === 1 ? /* @__PURE__ */ (0, H.jsx)("div", {
+function G({ row: e, fieldName: t, value: n, onChange: r, locked: o }) {
+ let s = e.candidates || [];
+ return s.length ? s.length === 1 ? /* @__PURE__ */ (0, V.jsx)("div", {
className: "flex overflow-hidden rounded-surface border border-separator-border bg-background-secondary-default",
- children: /* @__PURE__ */ (0, H.jsx)(G, { candidate: a[0] })
- }) : /* @__PURE__ */ (0, H.jsx)(N, {
+ children: /* @__PURE__ */ (0, V.jsx)(W, { candidate: s[0] })
+ }) : /* @__PURE__ */ (0, V.jsx)(i, {
"aria-label": `${t || "资料"}的来源`,
value: n,
- isDisabled: i,
+ isDisabled: o,
onChange: r,
className: "flex flex-col gap-2",
- children: a.map((e) => /* @__PURE__ */ (0, H.jsx)(I, {
+ children: s.map((e) => /* @__PURE__ */ (0, V.jsx)(a, {
value: e.candidate_key,
className: "group flex cursor-pointer items-center gap-2 overflow-hidden rounded-surface border border-separator-border bg-background-secondary-default outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring data-selected:border-border-button-active data-disabled:cursor-not-allowed",
- children: /* @__PURE__ */ (0, H.jsx)(G, {
+ children: /* @__PURE__ */ (0, V.jsx)(W, {
candidate: e,
selectable: !0
})
}, e.candidate_key))
}) : null;
}
-function q({ genre: e, tags: t, locked: n, toast: r }) {
- let [i, a] = (0, V.useState)(""), [o, c] = (0, V.useState)(""), l = fe({
- mutationFn: (t) => ae(e, t),
+function K({ genre: e, tags: t, locked: n, toast: r }) {
+ let [i, a] = (0, B.useState)(""), [s, c] = (0, B.useState)(""), l = we({
+ mutationFn: (t) => P(e, t),
onSuccess: async (t, n) => {
- t.ok ? (r(n ? `已把「${e}」收录为标签「${n}」` : `已把「${e}」判为非内容标签`), await v()) : c(t.error || "服务端拒绝了这次收录");
+ t.ok ? (r(n ? `已把「${e}」收录为标签「${n}」` : `已把「${e}」判为非内容标签`), await me()) : c(t.error || "服务端拒绝了这次收录");
},
- onError: (e) => c(s(e))
+ onError: (e) => c(M(e))
}), u = () => {
let e = i.trim();
e ? (c(""), l.mutate(e)) : c("先给它一个中文标签");
};
- return /* @__PURE__ */ (0, H.jsxs)("div", {
+ return /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
children: [
- /* @__PURE__ */ (0, H.jsx)("b", {
+ /* @__PURE__ */ (0, V.jsx)("b", {
lang: "ja",
className: "text-body-medium text-text-primary",
children: e
}),
- /* @__PURE__ */ (0, H.jsx)(le, {
+ /* @__PURE__ */ (0, V.jsx)(C, {
"aria-label": `「${e}」收录成的中文标签`,
value: i,
onChange: a,
maxLength: 40,
isDisabled: n || l.isPending,
className: "min-w-40 flex-1",
- children: /* @__PURE__ */ (0, H.jsx)(Se, {
+ children: /* @__PURE__ */ (0, V.jsx)(g, {
size: "small",
- list: t.length ? W : void 0,
+ list: t.length ? U : void 0,
autoComplete: "off",
placeholder: "中文标签",
onKeyDown: (e) => {
@@ -239,14 +239,14 @@ function q({ genre: e, tags: t, locked: n, toast: r }) {
}
})
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
disabled: n || l.isPending,
onClick: u,
children: "收录"
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
disabled: n || l.isPending,
@@ -255,24 +255,24 @@ function q({ genre: e, tags: t, locked: n, toast: r }) {
},
children: "不是内容"
}),
- o ? /* @__PURE__ */ (0, H.jsx)("p", {
+ s ? /* @__PURE__ */ (0, V.jsx)("p", {
role: "status",
className: "w-full text-body-2-regular text-text-error-primary",
- children: o
+ children: s
}) : null
]
});
}
-function ke({ row: e, tags: t, locked: n, toast: r }) {
- let i = w(e);
- return i.length ? /* @__PURE__ */ (0, H.jsxs)("div", {
+function Ae({ row: e, tags: t, locked: n, toast: r }) {
+ let i = pe(e);
+ return i.length ? /* @__PURE__ */ (0, V.jsxs)("div", {
role: "group",
"aria-label": "未收录 genre",
className: "flex flex-col gap-2 rounded-surface border border-separator-border bg-background-primary-default px-4 py-3",
- children: [/* @__PURE__ */ (0, H.jsx)("h5", {
+ children: [/* @__PURE__ */ (0, V.jsx)("h5", {
className: "text-body-2-medium text-text-secondary",
children: `未收录 genre · ${i.length}`
- }), i.map((e) => /* @__PURE__ */ (0, H.jsx)(q, {
+ }), i.map((e) => /* @__PURE__ */ (0, V.jsx)(K, {
genre: e,
tags: t,
locked: n,
@@ -282,24 +282,24 @@ function ke({ row: e, tags: t, locked: n, toast: r }) {
}
//#endregion
//#region src/react/review/review-evidence.tsx
-var J = (e = "") => /^https?:\/\//i.test(e) ? e : "", Y = (e = "") => J(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");
-function Ae({ url: e }) {
- let t = Y(e || "");
- return /* @__PURE__ */ (0, H.jsx)(je, { source: t }, t);
+var q = (e = "") => /^https?:\/\//i.test(e) ? e : "", J = (e = "") => q(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");
+function je({ url: e }) {
+ let t = J(e || "");
+ return /* @__PURE__ */ (0, V.jsx)(Me, { source: t }, t);
}
-function je({ source: e }) {
- let [t, n] = (0, V.useState)("idle");
- return (0, V.useEffect)(() => {
+function Me({ source: e }) {
+ let [t, n] = (0, B.useState)("idle");
+ return (0, B.useEffect)(() => {
if (t !== "loading") return;
let e = setTimeout(() => n("failed"), 3e4);
return () => clearTimeout(e);
- }, [t]), /* @__PURE__ */ (0, H.jsxs)("div", {
+ }, [t]), /* @__PURE__ */ (0, V.jsxs)("div", {
className: "relative flex h-review-image items-center justify-center overflow-hidden rounded-surface bg-background-secondary-default",
- children: [t === "loading" ? /* @__PURE__ */ (0, H.jsxs)("span", {
+ children: [t === "loading" ? /* @__PURE__ */ (0, V.jsxs)("span", {
role: "status",
className: "absolute flex items-center gap-2 text-body-2-regular text-text-secondary",
- children: [/* @__PURE__ */ (0, H.jsx)("span", { dangerouslySetInnerHTML: { __html: L("正在加载图片") } }), "正在加载图片"]
- }) : null, e && (t === "loading" || t === "ready") ? /* @__PURE__ */ (0, H.jsx)("img", {
+ children: [/* @__PURE__ */ (0, V.jsx)("span", { dangerouslySetInnerHTML: { __html: L("正在加载图片") } }), "正在加载图片"]
+ }) : null, e && (t === "loading" || t === "ready") ? /* @__PURE__ */ (0, V.jsx)("img", {
src: e,
alt: "来源提供的备选图片",
referrerPolicy: "no-referrer",
@@ -307,217 +307,217 @@ function je({ source: e }) {
className: `size-full object-contain ${t === "loading" ? "invisible" : ""}`,
onLoad: () => n("ready"),
onError: () => n("failed")
- }) : e ? /* @__PURE__ */ (0, H.jsxs)("div", {
+ }) : e ? /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-col items-center gap-2",
- children: [t === "failed" ? /* @__PURE__ */ (0, H.jsx)("span", {
+ children: [t === "failed" ? /* @__PURE__ */ (0, V.jsx)("span", {
className: "text-body-2-regular text-text-secondary",
children: "未取得来源图片"
- }) : null, /* @__PURE__ */ (0, H.jsx)(k, {
+ }) : null, /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
"aria-label": t === "failed" ? "立即重试加载来源图片" : void 0,
onClick: () => n("loading"),
children: t === "failed" ? "立即重试" : "查看来源图片"
})]
- }) : /* @__PURE__ */ (0, H.jsx)("span", {
+ }) : /* @__PURE__ */ (0, V.jsx)("span", {
className: "text-body-2-regular text-text-secondary",
children: "未取得来源图片"
})]
});
}
-function X({ asset: e, openItem: t }) {
+function Y({ asset: e, openItem: t }) {
let n = e.name || "";
- return /* @__PURE__ */ (0, H.jsxs)("div", {
+ return /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex min-w-0 items-center gap-2.5 rounded-surface bg-background-secondary-default p-2",
- children: [/* @__PURE__ */ (0, H.jsxs)("button", {
+ children: [/* @__PURE__ */ (0, V.jsxs)("button", {
type: "button",
onClick: () => t(e.id),
className: "flex aspect-card-cover w-review-cover-narrow shrink-0 review-tight:w-review-cover cursor-pointer items-center justify-center overflow-hidden rounded-2lg bg-background-tertiary-default outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring",
- children: [e.preview_url ? /* @__PURE__ */ (0, H.jsx)("img", {
+ children: [e.preview_url ? /* @__PURE__ */ (0, V.jsx)("img", {
src: e.preview_url,
alt: "",
loading: "lazy",
className: "size-full object-cover"
- }) : /* @__PURE__ */ (0, H.jsx)("span", {
+ }) : /* @__PURE__ */ (0, V.jsx)("span", {
className: "text-caption-1-regular text-text-secondary",
children: "无封面"
- }), /* @__PURE__ */ (0, H.jsx)(M, { children: `打开原视频 ${n}` })]
- }), /* @__PURE__ */ (0, H.jsxs)("div", {
+ }), /* @__PURE__ */ (0, V.jsx)(r, { children: `打开原视频 ${n}` })]
+ }), /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex min-w-0 flex-col items-start gap-1",
- children: [/* @__PURE__ */ (0, H.jsx)("b", {
+ children: [/* @__PURE__ */ (0, V.jsx)("b", {
title: n,
className: "w-full truncate text-body-medium text-text-primary",
children: e.code || n || "原视频"
- }), /* @__PURE__ */ (0, H.jsx)(k, {
+ }), /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
- leadingIcon: R,
+ leadingIcon: h,
onClick: () => t(e.id),
children: "打开原视频"
})]
})]
});
}
-function Z({ kind: e, name: t, works: n, avatar: r, openEntity: i }) {
- return /* @__PURE__ */ (0, H.jsxs)("div", {
+function X({ kind: e, name: t, works: n, avatar: r, openEntity: i }) {
+ return /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex min-w-0 items-center gap-3",
- children: [/* @__PURE__ */ (0, H.jsx)("button", {
+ children: [/* @__PURE__ */ (0, V.jsx)("button", {
type: "button",
"aria-label": `打开创作者页:${t}`,
onClick: () => i(e, t),
- className: `relative inline-grid size-11 shrink-0 cursor-pointer place-items-center overflow-hidden rounded-full bg-background-secondary-default text-caption-1-medium text-text-secondary outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring ${B}`,
+ className: `relative inline-grid size-11 shrink-0 cursor-pointer place-items-center overflow-hidden rounded-full bg-background-secondary-default text-caption-1-medium text-text-secondary outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring ${z}`,
dangerouslySetInnerHTML: { __html: r }
- }), /* @__PURE__ */ (0, H.jsxs)("div", {
+ }), /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex min-w-0 flex-col items-start",
- children: [/* @__PURE__ */ (0, H.jsx)("button", {
+ children: [/* @__PURE__ */ (0, V.jsx)("button", {
type: "button",
onClick: () => i(e, t),
className: "max-w-full cursor-pointer truncate text-body-medium text-text-primary underline-offset-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-border-focus-ring",
children: t
- }), n ? /* @__PURE__ */ (0, H.jsx)("small", {
+ }), n ? /* @__PURE__ */ (0, V.jsx)("small", {
className: "tabular-nums text-body-2-regular text-text-secondary",
children: `${n.toLocaleString()} 部作品`
}) : null]
})]
});
}
-function Me({ row: e, openItem: t, openEntity: n, onReveal: r, revealing: a, note: o }) {
- let s = J(e.profile_url || ""), c = (e.preview_assets || []).slice(0, 6), l = Math.max(0, Number(e.video_count || e.videos || 0));
- return /* @__PURE__ */ (0, H.jsxs)("section", {
+function Ne({ row: e, openItem: t, openEntity: n, onReveal: r, revealing: i, note: a }) {
+ let c = q(e.profile_url || ""), l = (e.preview_assets || []).slice(0, 6), u = Math.max(0, Number(e.video_count || e.videos || 0));
+ return /* @__PURE__ */ (0, V.jsxs)("section", {
className: "flex flex-col gap-3",
children: [
- /* @__PURE__ */ (0, H.jsx)("h5", {
+ /* @__PURE__ */ (0, V.jsx)("h5", {
className: "text-body-medium text-text-primary",
children: `待确认人物:${e.babepedia_name || "未标注"}`
}),
- /* @__PURE__ */ (0, H.jsxs)("div", {
+ /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
- children: [s ? /* @__PURE__ */ (0, H.jsx)(ge, {
+ children: [c ? /* @__PURE__ */ (0, V.jsx)(s, {
variant: "secondary",
size: "small",
- trailingIcon: i,
- href: s,
+ trailingIcon: w,
+ href: c,
target: "_blank",
rel: "noopener noreferrer",
children: "来源资料"
- }) : null, /* @__PURE__ */ (0, H.jsx)(k, {
+ }) : null, /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
onClick: () => n("creator", e.creator || ""),
- children: `查看全部 ${l.toLocaleString()} 部作品`
+ children: `查看全部 ${u.toLocaleString()} 部作品`
})]
}),
- /* @__PURE__ */ (0, H.jsx)(Ae, { url: e.preview_url }),
- /* @__PURE__ */ (0, H.jsx)("p", {
+ /* @__PURE__ */ (0, V.jsx)(je, { url: e.preview_url }),
+ /* @__PURE__ */ (0, V.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: "通过后记录身份判断。"
}),
- c.length ? /* @__PURE__ */ (0, H.jsxs)(H.Fragment, { children: [/* @__PURE__ */ (0, H.jsx)("h5", {
+ l.length ? /* @__PURE__ */ (0, V.jsxs)(V.Fragment, { children: [/* @__PURE__ */ (0, V.jsx)("h5", {
className: "text-body-medium text-text-primary",
children: "本地作品样本"
- }), /* @__PURE__ */ (0, H.jsx)("ul", {
+ }), /* @__PURE__ */ (0, V.jsx)("ul", {
className: "flex flex-col gap-1",
- children: c.map((e) => /* @__PURE__ */ (0, H.jsxs)("li", {
+ children: l.map((e) => /* @__PURE__ */ (0, V.jsxs)("li", {
className: "flex min-w-0 items-center gap-2",
- children: [/* @__PURE__ */ (0, H.jsx)(k, {
+ children: [/* @__PURE__ */ (0, V.jsx)(o, {
variant: "ghost",
size: "small",
className: "min-w-0",
onClick: () => t(e.id),
- children: /* @__PURE__ */ (0, H.jsx)("span", {
+ children: /* @__PURE__ */ (0, V.jsx)("span", {
title: e.name,
className: "block max-w-full truncate",
children: e.name
})
- }), /* @__PURE__ */ (0, H.jsx)(k, {
+ }), /* @__PURE__ */ (0, V.jsx)(o, {
variant: "ghost",
size: "small",
"aria-label": `打开 ${e.name} 的文件位置`,
- ...F(a === e.id),
+ ...E(i === e.id),
onClick: () => r(e.id),
children: "文件位置"
})]
}, e.id))
- })] }) : /* @__PURE__ */ (0, H.jsx)("p", {
+ })] }) : /* @__PURE__ */ (0, V.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: "暂无本地作品样本,打开全部作品核对。"
}),
- o ? /* @__PURE__ */ (0, H.jsx)("p", {
+ a ? /* @__PURE__ */ (0, V.jsx)("p", {
role: "status",
className: "text-body-2-regular text-text-error-primary",
- children: o
+ children: a
}) : null
]
});
}
-function Ne({ assets: e, picked: t, onPicked: n, locked: r }) {
- let [i, a] = (0, V.useState)(null), o = new Set(t), s = (t, s) => {
- if (r) return;
- let c = new Set(o);
- if (s && i !== null) {
- let [n, r] = [Math.min(i, t), Math.max(i, t)];
- for (let t = n; t <= r; t++) c.add(e[t].id);
+function Z({ assets: e, picked: t, onPicked: n, locked: i }) {
+ let [a, s] = (0, B.useState)(null), c = new Set(t), u = (t, r) => {
+ if (i) return;
+ let o = new Set(c);
+ if (r && a !== null) {
+ let [n, r] = [Math.min(a, t), Math.max(a, t)];
+ for (let t = n; t <= r; t++) o.add(e[t].id);
} else {
let n = e[t].id;
- c.has(n) ? c.delete(n) : c.add(n);
+ o.has(n) ? o.delete(n) : o.add(n);
}
- a(t), n(e.filter((e) => c.has(e.id)).map((e) => e.id));
+ s(t), n(e.filter((e) => o.has(e.id)).map((e) => e.id));
};
- return /* @__PURE__ */ (0, H.jsxs)("div", {
+ return /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-col gap-2",
- children: [/* @__PURE__ */ (0, H.jsxs)("div", {
+ children: [/* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
children: [
- /* @__PURE__ */ (0, H.jsx)("span", {
+ /* @__PURE__ */ (0, V.jsx)("span", {
className: "tabular-nums text-body-2-regular text-text-secondary",
- children: `已选 ${o.size} / ${e.length}`
+ children: `已选 ${c.size} / ${e.length}`
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "ghost",
size: "small",
- disabled: r,
+ disabled: i,
onClick: () => n(e.map((e) => e.id)),
children: "全选"
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "ghost",
size: "small",
- disabled: r,
+ disabled: i,
onClick: () => n([]),
children: "清空"
})
]
- }), /* @__PURE__ */ (0, H.jsx)("div", {
+ }), /* @__PURE__ */ (0, V.jsx)("div", {
className: "review-asset-grid gap-1.5",
children: e.map((e, t) => {
- let n = o.has(e.id);
- return /* @__PURE__ */ (0, H.jsxs)("button", {
+ let n = c.has(e.id);
+ return /* @__PURE__ */ (0, V.jsxs)("button", {
type: "button",
"aria-pressed": n,
title: e.name,
- onClick: (e) => s(t, e.shiftKey),
+ onClick: (e) => u(t, e.shiftKey),
className: `relative aspect-card-cover cursor-pointer overflow-hidden rounded-surface bg-background-tertiary-default outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-border-focus-ring ${n ? "opacity-100 ring-2 ring-border-button-active ring-inset" : "opacity-50"}`,
children: [
- /* @__PURE__ */ (0, H.jsx)("img", {
+ /* @__PURE__ */ (0, V.jsx)("img", {
src: `/poster?id=${e.id}&c=4`,
alt: "",
loading: "lazy",
className: "size-full object-cover"
}),
- /* @__PURE__ */ (0, H.jsx)("span", {
+ /* @__PURE__ */ (0, V.jsx)("span", {
className: "absolute top-1 right-1",
- children: /* @__PURE__ */ (0, H.jsx)(D, {
+ children: /* @__PURE__ */ (0, V.jsx)(l, {
size: "sm",
state: {
isSelected: n,
isIndeterminate: !1,
isFocusVisible: !1,
- isDisabled: r,
+ isDisabled: i,
isHovered: !1
}
})
}),
- /* @__PURE__ */ (0, H.jsx)(M, { children: `${n ? "已选" : "未选"} ${e.name || e.id}` })
+ /* @__PURE__ */ (0, V.jsx)(r, { children: `${n ? "已选" : "未选"} ${e.name || e.id}` })
]
}, e.id);
})
@@ -526,206 +526,206 @@ function Ne({ assets: e, picked: t, onPicked: n, locked: r }) {
}
//#endregion
//#region src/react/review/review-card.tsx
-var Pe = b({
+var Pe = D({
variant: "outlined",
padding: "none",
className: "flex flex-col gap-4 px-5 pt-4"
}), Q = "flex min-h-6 min-w-0 items-center", $ = 2, Fe = (e) => e === "western_identity" ? "h-review-card-tall" : "h-review-card";
function Ie(e) {
- let { category: t, row: n, choice: r, onChoice: i, selected: o, onSelect: s, locked: c, busy: l, problem: u, genreTags: ee, onDecide: d, handlers: f } = e, p = (0, V.useRef)(!1), m = T(), te = T(), h = t === "metadata_fields", _ = g[t] || "", v = String(n.creator || "").trim(), y = !!_ && !!v, b = oe(t, n), x = pe(t, n), S = ve(t, n), C = xe(n), w = j(n), E = ne(t, n), D = n.comparison_assets || [], ie = n.preview_assets || [], ae = String(n.decision || "pending") !== "pending", O = D.length > 1 ? /* @__PURE__ */ (0, H.jsxs)("div", {
+ let { category: t, row: n, choice: r, onChoice: i, selected: a, onSelect: s, locked: l, busy: d, problem: m, genreTags: h, onDecide: g, handlers: _ } = e, v = (0, B.useRef)(!1), y = R(), te = R(), b = t === "metadata_fields", x = f[t] || "", S = String(n.creator || "").trim(), C = !!x && !!S, w = I(t, n), T = ye(t, n), D = be(t, n), O = ve(n), k = xe(n), A = re(t, n), j = n.comparison_assets || [], ie = n.preview_assets || [], ae = String(n.decision || "pending") !== "pending", M = j.length > 1 ? /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-col gap-3",
- children: [D.slice(0, $).map((e) => /* @__PURE__ */ (0, H.jsx)(X, {
+ children: [j.slice(0, $).map((e) => /* @__PURE__ */ (0, V.jsx)(Y, {
asset: e,
- openItem: f.openItem
- }, e.id)), D.length > $ ? /* @__PURE__ */ (0, H.jsx)("p", {
+ openItem: _.openItem
+ }, e.id)), j.length > $ ? /* @__PURE__ */ (0, V.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
- children: `另有 ${(D.length - $).toLocaleString()} 部对照作品`
+ children: `另有 ${(j.length - $).toLocaleString()} 部对照作品`
}) : null]
- }) : y ? /* @__PURE__ */ (0, H.jsx)(Z, {
- kind: _,
- name: v,
+ }) : C ? /* @__PURE__ */ (0, V.jsx)(X, {
+ kind: x,
+ name: S,
works: Number(n.video_count || n.videos || 0),
- openEntity: f.openEntity,
- avatar: a(v, n.entity_id ? {
+ openEntity: _.openEntity,
+ avatar: ne(S, n.entity_id ? {
id: n.entity_id,
has_image: !!n.has_image,
image_version: n.image_version,
avatar_focus: n.avatar_focus
- } : null, null, _)
- }) : n.asset_id ? /* @__PURE__ */ (0, H.jsx)(X, {
- openItem: f.openItem,
+ } : null, null, x)
+ }) : n.asset_id ? /* @__PURE__ */ (0, V.jsx)(Y, {
+ openItem: _.openItem,
asset: {
id: n.asset_id,
name: n.asset_name,
preview_url: n.asset_preview_url
}
- }) : null, se = h ? /* @__PURE__ */ (0, H.jsx)(K, {
+ }) : null, oe = b ? /* @__PURE__ */ (0, V.jsx)(G, {
row: n,
- fieldName: x,
+ fieldName: T,
value: r.candidateKey,
onChange: (e) => i({
...r,
candidateKey: e
}),
- locked: c
- }) : t === "creator_tags" ? ie.length ? /* @__PURE__ */ (0, H.jsx)(Ne, {
+ locked: l
+ }) : t === "creator_tags" ? ie.length ? /* @__PURE__ */ (0, V.jsx)(Z, {
assets: ie,
picked: r.assets,
- locked: c,
+ locked: l,
onPicked: (e) => i({
...r,
assets: e
})
- }) : /* @__PURE__ */ (0, H.jsx)(he, {
+ }) : /* @__PURE__ */ (0, V.jsx)(p, {
size: "compact",
- icon: we,
+ icon: ee,
title: "这批作品尚未抽帧",
children: `${n.video_count || ""} 条作品还没有可用预览;批准后仍会按所选资料写入标签。`
- }) : t === "fc2_similarity" ? null : t === "western_identity" ? /* @__PURE__ */ (0, H.jsx)(Me, {
+ }) : t === "fc2_similarity" ? null : t === "western_identity" ? /* @__PURE__ */ (0, V.jsx)(Ne, {
row: n,
- openItem: f.openItem,
- openEntity: f.openEntity,
- onReveal: f.onReveal,
- revealing: f.revealing,
- note: f.revealNote
- }) : /* @__PURE__ */ (0, H.jsx)(Ae, { url: n.preview_url }), ce = y ? O : x ? /* @__PURE__ */ (0, H.jsxs)("h4", {
+ openItem: _.openItem,
+ openEntity: _.openEntity,
+ onReveal: _.onReveal,
+ revealing: _.revealing,
+ note: _.revealNote
+ }) : /* @__PURE__ */ (0, V.jsx)(je, { url: n.preview_url }), se = C ? M : T ? /* @__PURE__ */ (0, V.jsxs)("h4", {
className: `${Q} flex-wrap gap-2`,
- children: [/* @__PURE__ */ (0, H.jsx)("span", {
- title: x,
+ children: [/* @__PURE__ */ (0, V.jsx)("span", {
+ title: T,
className: "flex max-w-full min-w-0 overflow-hidden rounded-md",
- children: /* @__PURE__ */ (0, H.jsx)(A, {
+ children: /* @__PURE__ */ (0, V.jsx)(u, {
variant: "caption",
color: "blue",
- children: x
+ children: T
})
- }), /* @__PURE__ */ (0, H.jsx)("span", {
- title: S,
+ }), /* @__PURE__ */ (0, V.jsx)("span", {
+ title: D,
className: "min-w-0 truncate text-body-medium text-text-primary",
- children: S
+ children: D
})]
- }) : /* @__PURE__ */ (0, H.jsx)("h4", {
+ }) : /* @__PURE__ */ (0, V.jsx)("h4", {
className: Q,
- children: /* @__PURE__ */ (0, H.jsx)("span", {
- title: b,
+ children: /* @__PURE__ */ (0, V.jsx)("span", {
+ title: w,
className: "min-w-0 truncate text-body-medium text-text-primary",
- children: b
+ children: w
})
});
- return /* @__PURE__ */ (0, H.jsxs)("section", {
- "aria-label": b,
+ return /* @__PURE__ */ (0, V.jsxs)("section", {
+ "aria-label": w,
"data-review-key": n.item_key,
className: `${Pe} ${Fe(t)} overflow-hidden`,
children: [
- /* @__PURE__ */ (0, H.jsxs)("header", {
+ /* @__PURE__ */ (0, V.jsxs)("header", {
className: "flex min-w-0 shrink-0 items-start gap-2",
children: [
- c ? null : /* @__PURE__ */ (0, H.jsx)("span", {
+ l ? null : /* @__PURE__ */ (0, V.jsx)("span", {
className: `${Q} shrink-0`,
onPointerDownCapture: (e) => {
- p.current = e.shiftKey;
+ v.current = e.shiftKey;
},
onKeyDownCapture: (e) => {
- p.current = e.shiftKey;
+ v.current = e.shiftKey;
},
- children: /* @__PURE__ */ (0, H.jsx)(re, {
- isSelected: o,
- "aria-label": `选择 ${b}`,
- onChange: (e) => s(p.current, e)
+ children: /* @__PURE__ */ (0, V.jsx)(c, {
+ isSelected: a,
+ "aria-label": `选择 ${w}`,
+ onChange: (e) => s(v.current, e)
})
}),
- /* @__PURE__ */ (0, H.jsx)("div", {
+ /* @__PURE__ */ (0, V.jsx)("div", {
className: "min-w-0 flex-1",
- children: ce
+ children: se
}),
- ae ? /* @__PURE__ */ (0, H.jsx)(A, {
+ ae ? /* @__PURE__ */ (0, V.jsx)(u, {
variant: "caption",
color: "neutral",
children: n.decision
}) : null
]
}),
- /* @__PURE__ */ (0, H.jsx)("div", {
+ /* @__PURE__ */ (0, V.jsx)("div", {
className: "relative flex min-w-0 min-h-0 flex-1 flex-col",
- children: /* @__PURE__ */ (0, H.jsxs)("div", {
- ref: m,
+ children: /* @__PURE__ */ (0, V.jsxs)("div", {
+ ref: y,
className: "flex min-w-0 min-h-0 flex-1 flex-col gap-3 overflow-y-auto",
children: [
- n.source_name ? /* @__PURE__ */ (0, H.jsx)("p", {
+ n.source_name ? /* @__PURE__ */ (0, V.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: `来源写法:${n.source_name}`
}) : null,
- !y && (n.board || n.assets) ? /* @__PURE__ */ (0, H.jsx)("p", {
+ !C && (n.board || n.assets) ? /* @__PURE__ */ (0, V.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: `对照文件:${Number(n.video_count || n.assets || 0).toLocaleString()}`
}) : null,
- !y && O ? O : null,
- w.length || t === "creator_tags" ? /* @__PURE__ */ (0, H.jsx)("div", {
+ !C && M ? M : null,
+ k.length || t === "creator_tags" ? /* @__PURE__ */ (0, V.jsx)("div", {
className: "flex flex-wrap gap-1",
- children: w.length ? w.map((e) => /* @__PURE__ */ (0, H.jsx)(A, {
+ children: k.length ? k.map((e) => /* @__PURE__ */ (0, V.jsx)(u, {
variant: "caption",
color: "soft",
children: e
- }, e)) : /* @__PURE__ */ (0, H.jsx)("small", {
+ }, e)) : /* @__PURE__ */ (0, V.jsx)("small", {
className: "text-body-2-regular text-text-secondary",
children: "暂无待确认标签"
})
}) : null,
- se,
- /* @__PURE__ */ (0, H.jsx)(ke, {
+ oe,
+ /* @__PURE__ */ (0, V.jsx)(Ae, {
row: n,
- tags: ee,
- locked: c,
- toast: f.toast
+ tags: h,
+ locked: l,
+ toast: _.toast
}),
- !h && C ? /* @__PURE__ */ (0, H.jsx)("p", {
+ !b && O ? /* @__PURE__ */ (0, V.jsx)("p", {
className: "text-body-2-regular text-text-secondary wrap-anywhere",
- children: C
+ children: O
}) : null
]
})
}),
- h && C ? /* @__PURE__ */ (0, H.jsx)("div", {
+ b && O ? /* @__PURE__ */ (0, V.jsx)("div", {
className: "relative -mx-5 -mb-4 shrink-0",
- children: /* @__PURE__ */ (0, H.jsx)("p", {
+ children: /* @__PURE__ */ (0, V.jsx)("p", {
ref: te,
role: "region",
"aria-label": "当前信息",
className: "max-h-22 overflow-y-auto border-t border-separator-border px-5 py-2.5 text-body-2-regular text-text-secondary wrap-anywhere",
- children: C
+ children: O
})
}) : null,
- /* @__PURE__ */ (0, H.jsxs)("footer", {
+ /* @__PURE__ */ (0, V.jsxs)("footer", {
className: "-mx-5 flex min-h-14 shrink-0 flex-wrap items-center justify-end gap-2 rounded-b-surface border-t border-separator-border bg-background-secondary-default py-3 pr-3 pl-5",
children: [
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "danger",
size: "small",
- disabled: c,
- ...F(l),
- onClick: () => d("rejected"),
+ disabled: l,
+ ...E(d),
+ onClick: () => g("rejected"),
children: "拒绝"
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
- disabled: c,
- ...F(l),
- onClick: () => d("skipped"),
+ disabled: l,
+ ...E(d),
+ onClick: () => g("skipped"),
children: "跳过"
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "primary",
size: "small",
- disabled: c || !E,
- ...F(l),
- title: E ? void 0 : "没有可采用的资料,只能拒绝或跳过",
- onClick: () => d("approved"),
- children: E ? "通过" : "不可通过"
+ disabled: l || !A,
+ ...E(d),
+ title: A ? void 0 : "没有可采用的资料,只能拒绝或跳过",
+ onClick: () => g("approved"),
+ children: A ? "通过" : "不可通过"
}),
- u ? /* @__PURE__ */ (0, H.jsx)("p", {
+ m ? /* @__PURE__ */ (0, V.jsx)("p", {
role: "status",
className: "w-full text-body-2-regular text-text-error-primary",
- children: u
+ children: m
}) : null
]
})
@@ -736,25 +736,25 @@ function Ie(e) {
//#region src/react/review/review-page.tsx
var Le = "flex cursor-pointer items-center justify-between gap-2";
function Re({ page: e, pages: t, onPage: n }) {
- return t <= 1 ? null : /* @__PURE__ */ (0, H.jsxs)("nav", {
+ return t <= 1 ? null : /* @__PURE__ */ (0, V.jsxs)("nav", {
"aria-label": "复核分页",
"data-pagination-layout": "",
className: "inline-grid w-full min-w-0 items-center gap-2",
children: [
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
disabled: e <= 1,
onClick: () => n(e - 1),
children: "上一页"
}),
- /* @__PURE__ */ (0, H.jsx)("ul", {
+ /* @__PURE__ */ (0, V.jsx)("ul", {
className: "flex min-w-0 flex-wrap items-center justify-center gap-1",
- children: m(e, t).map((t, r) => /* @__PURE__ */ (0, H.jsx)("li", { children: t === "…" ? /* @__PURE__ */ (0, H.jsx)("span", {
+ children: N(e, t).map((t, r) => /* @__PURE__ */ (0, V.jsx)("li", { children: t === "…" ? /* @__PURE__ */ (0, V.jsx)("span", {
"aria-hidden": !0,
className: "px-1 text-body-2-regular text-text-tertiary",
children: "…"
- }) : /* @__PURE__ */ (0, H.jsx)(k, {
+ }) : /* @__PURE__ */ (0, V.jsx)(o, {
variant: t === e ? "secondary" : "ghost",
size: "small",
"aria-label": `第 ${t} 页`,
@@ -763,7 +763,7 @@ function Re({ page: e, pages: t, onPage: n }) {
children: t
}) }, t === "…" ? `dots-${r}` : t))
}),
- /* @__PURE__ */ (0, H.jsx)(k, {
+ /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
disabled: e >= t,
@@ -773,196 +773,196 @@ function Re({ page: e, pages: t, onPage: n }) {
]
});
}
-function ze(i) {
- let [a, p] = (0, V.useState)(() => matchMedia("(max-width:900px)").matches);
- (0, V.useEffect)(() => {
- let e = matchMedia("(max-width:900px)"), t = () => p(e.matches);
+function ze(r) {
+ let [i, a] = (0, B.useState)(() => matchMedia("(max-width:900px)").matches);
+ (0, B.useEffect)(() => {
+ let e = matchMedia("(max-width:900px)"), t = () => a(e.matches);
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
}, []);
- let { route: m, openItem: g, openEntity: v, revealSource: b, toast: x, readOnly: re, readOnlyMessage: w, writerUrl: T } = i, [D, ae] = (0, V.useState)(d(i.category) ? i.category : h), [O, oe] = (0, V.useState)("candidates"), [ce, le] = (0, V.useState)(""), [ue, A] = (0, V.useState)(1), [j, M] = (0, V.useState)(/* @__PURE__ */ new Set()), [pe, N] = (0, V.useState)(/* @__PURE__ */ new Map()), [ge, P] = (0, V.useState)(/* @__PURE__ */ new Map()), [ve, F] = (0, V.useState)(""), I = (0, V.useRef)(null), [xe, Se] = (0, V.useState)(0), [Ce, we] = (0, V.useState)(""), L = (0, V.useRef)(!0);
- (0, V.useEffect)(() => () => {
- L.current = !1;
+ let { route: s, openItem: c, openEntity: l, revealSource: u, toast: f, readOnly: ee, readOnlyMessage: h, writerUrl: g } = r, [b, x] = (0, B.useState)(le(r.category) ? r.category : d), [S, C] = (0, B.useState)("candidates"), [w, T] = (0, B.useState)(""), [ne, E] = (0, B.useState)(1), [D, O] = (0, B.useState)(/* @__PURE__ */ new Set()), [ue, N] = (0, B.useState)(/* @__PURE__ */ new Map()), [pe, P] = (0, B.useState)(/* @__PURE__ */ new Map()), [me, F] = (0, B.useState)(""), he = (0, B.useRef)(null), [ve, ye] = (0, B.useState)(0), [be, xe] = (0, B.useState)(""), I = (0, B.useRef)(!0);
+ (0, B.useEffect)(() => () => {
+ I.current = !1;
}, []);
- let R = se({
- queryKey: ee,
- queryFn: ({ signal: e }) => c(e)
- }), z = R.data || {
+ let L = Te({
+ queryKey: y,
+ queryFn: ({ signal: e }) => oe(e)
+ }), R = L.data || {
sections: {},
counts: {}
- }, B = z.sections[D] || [], U = D === "metadata_fields", W = re, G = t(B, U), K = G.some(([e]) => e === O) ? O : "candidates", q = _e(B, K), ke = q.some((e) => e.key === ce) ? ce : "", J = de(f(B, K, ke), ue), Y = J.rows.map((e) => e.item_key), Ae = new Set(Y), je = q.map((e) => ({
+ }, z = R.sections[b] || [], H = b === "metadata_fields", U = ee, W = ge(z, H), G = W.some(([e]) => e === S) ? S : "candidates", K = ce(z, G), Ae = K.some((e) => e.key === w) ? w : "", q = _e(se(z, G, Ae), ne), J = q.rows.map((e) => e.item_key), je = new Set(J), Me = K.map((e) => ({
...e,
- rows: e.rows.filter((e) => Ae.has(e.item_key))
- })).filter((e) => e.rows.length), X = (e) => pe.get(e.item_key) || y(e), Z = B.filter((e) => j.has(e.item_key)), Me = (e) => {
+ rows: e.rows.filter((e) => je.has(e.item_key))
+ })).filter((e) => e.rows.length), Y = (e) => ue.get(e.item_key) || ie(e), X = z.filter((e) => D.has(e.item_key)), Ne = (e) => {
let t = new Set(e);
- M((e) => new Set([...e].filter((e) => !t.has(e)))), N((e) => new Map([...e].filter(([e]) => !t.has(e)))), P((e) => new Map([...e].filter(([e]) => !t.has(e))));
- }, Ne = (e, t) => P((n) => new Map(n).set(e, t)), Pe = (e) => {
- ae(e), oe("candidates"), le(""), A(1), M(/* @__PURE__ */ new Set()), N(/* @__PURE__ */ new Map()), P(/* @__PURE__ */ new Map()), F(""), I.current = null, m({ category: e === "metadata_fields" ? "" : e });
- }, Q = fe({
- mutationFn: ({ row: e, status: t }) => ye(S(D, n(D, e), t, X(e))),
+ O((e) => new Set([...e].filter((e) => !t.has(e)))), N((e) => new Map([...e].filter(([e]) => !t.has(e)))), P((e) => new Map([...e].filter(([e]) => !t.has(e))));
+ }, Z = (e, t) => P((n) => new Map(n).set(e, t)), Pe = (e) => {
+ x(e), C("candidates"), T(""), E(1), O(/* @__PURE__ */ new Set()), N(/* @__PURE__ */ new Map()), P(/* @__PURE__ */ new Map()), F(""), he.current = null, s({ category: e === "metadata_fields" ? "" : e });
+ }, Q = we({
+ mutationFn: ({ row: e, status: t }) => Ce(A(b, k(b, e), t, Y(e))),
onSuccess: (e, { row: t, status: n }) => {
- e.ok ? (C(D, [t.item_key]), Me([t.item_key]), x(u(n))) : Ne(t.item_key, e.error || "服务端拒绝了这次判定");
+ e.ok ? (ae(b, [t.item_key]), Ne([t.item_key]), f(j(n))) : Z(t.item_key, e.error || "服务端拒绝了这次判定");
},
- onError: (e, { row: t }) => Ne(t.item_key, s(e))
- }), $ = fe({
+ onError: (e, { row: t }) => Z(t.item_key, M(e))
+ }), $ = we({
mutationFn: async (e) => {
- let t = Z, r = [], i = [];
- for (let [a, o] of t.entries()) {
- if (!L.current) break;
- F(`正在处理 ${a} / ${t.length}`);
+ let t = X, n = [], r = [];
+ for (let [i, a] of t.entries()) {
+ if (!I.current) break;
+ F(`正在处理 ${i} / ${t.length}`);
try {
- let t = await ye(S(D, n(D, o), e, X(o)));
+ let t = await Ce(A(b, k(b, a), e, Y(a)));
if (!t.ok) throw Error(t.error || "服务端未采用该项");
- r.push(o.item_key);
+ n.push(a.item_key);
} catch (e) {
- i.push([o.item_key, s(e)]);
+ r.push([a.item_key, M(e)]);
}
}
return {
status: e,
- done: r,
- failures: i
+ done: n,
+ failures: r
};
},
onSuccess: ({ status: e, done: t, failures: n }) => {
- C(D, t), Me(t), n.forEach(([e, t]) => Ne(e, t)), F(""), x(`已${e === "approved" ? "通过" : "拒绝"} ${t.length} 项` + (n.length ? `,${n.length} 项未完成` : ""));
+ ae(b, t), Ne(t), n.forEach(([e, t]) => Z(e, t)), F(""), f(`已${e === "approved" ? "通过" : "拒绝"} ${t.length} 项` + (n.length ? `,${n.length} 项未完成` : ""));
},
onError: (e) => {
- F(s(e));
+ F(M(e));
}
}), Fe = (e) => {
- !$.isPending && Z.length && (e === "approved" && U && Z.some((e) => !X(e).candidateKey) ? F("请先为所选资料选择要采用的来源。") : (F(""), $.mutate(e)));
+ !$.isPending && X.length && (e === "approved" && H && X.some((e) => !Y(e).candidateKey) ? F("请先为所选资料选择要采用的来源。") : (F(""), $.mutate(e)));
}, ze = (e) => {
N((t) => {
let n = new Map(t);
- for (let t of Z) {
+ for (let t of X) {
let r = t.candidates?.find((t) => t.source === e);
r && n.set(t.item_key, {
- ...X(t),
+ ...Y(t),
candidateKey: r.candidate_key
});
}
return n;
}), F(`已选择 ${e},点击通过所选采用。`);
}, Be = async (e) => {
- if (xe) return;
- Se(e), we("");
- let t = await b(e);
- L.current && (Se(0), we(t));
- }, Ve = E(z.mirror, w), He = z.genre_tags || [], Ue = {
- openItem: g,
- openEntity: v,
+ if (ve) return;
+ ye(e), xe("");
+ let t = await u(e);
+ I.current && (ye(0), xe(t));
+ }, Ve = fe(R.mirror, h), He = R.genre_tags || [], Ue = {
+ openItem: c,
+ openEntity: l,
onReveal: Be,
- revealing: xe,
- revealNote: Ce,
- toast: x
+ revealing: ve,
+ revealNote: be,
+ toast: f
};
- return /* @__PURE__ */ (0, H.jsx)(Te, { children: /* @__PURE__ */ (0, H.jsxs)("div", {
+ return /* @__PURE__ */ (0, V.jsx)(Ee, { children: /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-col gap-5 pb-10",
children: [
- W ? /* @__PURE__ */ (0, H.jsx)(be, {
+ U ? /* @__PURE__ */ (0, V.jsx)(_, {
tone: "warning",
title: "本机只能浏览",
- extra: T ? /* @__PURE__ */ (0, H.jsx)("p", {
+ extra: g ? /* @__PURE__ */ (0, V.jsx)("p", {
className: "text-body-2-regular",
- children: /* @__PURE__ */ (0, H.jsx)(r, {
- href: T,
+ children: /* @__PURE__ */ (0, V.jsx)(m, {
+ href: g,
children: "前往写入端复核"
})
}) : void 0,
children: Ve
}) : null,
- /* @__PURE__ */ (0, H.jsx)(Oe, { tags: He }),
- /* @__PURE__ */ (0, H.jsxs)(e, {
- orientation: a ? "horizontal" : "vertical",
- selectedKey: D,
+ /* @__PURE__ */ (0, V.jsx)(ke, { tags: He }),
+ /* @__PURE__ */ (0, V.jsxs)(n, {
+ orientation: i ? "horizontal" : "vertical",
+ selectedKey: b,
onSelectionChange: (e) => {
let t = String(e);
- d(t) && Pe(t);
+ le(t) && Pe(t);
},
className: "flex flex-col gap-5 review-split:flex-row review-split:items-start review-split:gap-6",
- children: [/* @__PURE__ */ (0, H.jsxs)("div", {
+ children: [/* @__PURE__ */ (0, V.jsxs)("div", {
"data-section-nav": !0,
className: "w-full min-w-0 review-split:sticky review-split:top-topbar review-split:w-review-tabs review-split:shrink-0",
- children: [/* @__PURE__ */ (0, H.jsx)("h2", {
+ children: [/* @__PURE__ */ (0, V.jsx)("h2", {
id: "reviewcategories",
children: "复核分类"
- }), /* @__PURE__ */ (0, H.jsx)(Ee, {
- scrollable: a,
+ }), /* @__PURE__ */ (0, V.jsx)(De, {
+ scrollable: i,
"aria-labelledby": "reviewcategories",
"data-section-items": !0,
className: "flex review-split:flex-col review-split:items-stretch",
- children: o.map((e) => {
- let t = Number(z.counts[e] || 0);
- return /* @__PURE__ */ (0, H.jsxs)(_, {
+ children: v.map((e) => {
+ let n = Number(R.counts[e] || 0);
+ return /* @__PURE__ */ (0, V.jsxs)(t, {
id: e,
className: Le,
- "data-pill-selected": D === e ? "" : void 0,
+ "data-pill-selected": b === e ? "" : void 0,
"data-pill-variant": "gray",
- children: [te[e], t ? /* @__PURE__ */ (0, H.jsx)("span", {
+ children: [te[e], n ? /* @__PURE__ */ (0, V.jsx)("span", {
className: "tabular-nums text-caption-1-medium text-text-secondary",
- children: t.toLocaleString()
+ children: n.toLocaleString()
}) : null]
}, e);
})
})]
- }), /* @__PURE__ */ (0, H.jsxs)(ie, {
- id: D,
+ }), /* @__PURE__ */ (0, V.jsxs)(e, {
+ id: b,
className: "flex min-w-0 flex-1 flex-col gap-5",
children: [
- B.length && !W ? /* @__PURE__ */ (0, H.jsx)(De, {
- groupOptions: G,
- groupBy: K,
+ z.length && !U ? /* @__PURE__ */ (0, V.jsx)(Oe, {
+ groupOptions: W,
+ groupBy: G,
onGroupBy: (e) => {
- oe(e), le(""), A(1);
+ C(e), T(""), E(1);
},
- groups: q,
- filter: ke,
+ groups: K,
+ filter: Ae,
onFilter: (e) => {
- le(e), A(1);
+ T(e), E(1);
},
- pageKeys: Y,
- selected: j,
- onSelected: M,
- selectedRows: Z,
- metadata: U,
- approvable: Z.every((e) => ne(D, e)),
+ pageKeys: J,
+ selected: D,
+ onSelected: O,
+ selectedRows: X,
+ metadata: H,
+ approvable: X.every((e) => re(b, e)),
busy: $.isPending,
- feedback: ve,
+ feedback: me,
onUnifySource: ze,
onRun: Fe
}) : null,
- J.rows.length ? je.map((e) => /* @__PURE__ */ (0, H.jsxs)("section", {
+ q.rows.length ? Me.map((e) => /* @__PURE__ */ (0, V.jsxs)("section", {
className: "flex flex-col gap-3",
- children: [je.length > 1 || K !== "candidates" ? /* @__PURE__ */ (0, H.jsxs)("div", {
+ children: [Me.length > 1 || G !== "candidates" ? /* @__PURE__ */ (0, V.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, H.jsx)("h3", {
+ children: [/* @__PURE__ */ (0, V.jsx)("h3", {
className: "text-body-medium text-text-primary",
children: `${e.title} · ${e.rows.length}`
- }), W ? null : /* @__PURE__ */ (0, H.jsx)(k, {
+ }), U ? null : /* @__PURE__ */ (0, V.jsx)(o, {
variant: "ghost",
size: "small",
onClick: () => {
- let t = e.rows.map((e) => e.item_key), n = t.every((e) => j.has(e)), r = new Set(j);
+ let t = e.rows.map((e) => e.item_key), n = t.every((e) => D.has(e)), r = new Set(D);
for (let e of t) n ? r.delete(e) : r.add(e);
- M(r);
+ O(r);
},
- children: e.rows.every((e) => j.has(e.item_key)) ? "清空本组" : "全选本组"
+ children: e.rows.every((e) => D.has(e.item_key)) ? "清空本组" : "全选本组"
})]
- }) : null, /* @__PURE__ */ (0, H.jsx)("div", {
+ }) : null, /* @__PURE__ */ (0, V.jsx)("div", {
className: "review-grid gap-5",
- children: e.rows.map((e) => /* @__PURE__ */ (0, H.jsx)(Ie, {
- category: D,
+ children: e.rows.map((e) => /* @__PURE__ */ (0, V.jsx)(Ie, {
+ category: b,
row: e,
- choice: X(e),
+ choice: Y(e),
onChoice: (t) => N((n) => new Map(n).set(e.item_key, t)),
- selected: j.has(e.item_key),
- onSelect: (t, n) => M((r) => {
+ selected: D.has(e.item_key),
+ onSelect: (t, n) => O((r) => {
let i = new Set(r);
- return I.current = me(i, Y, I.current, e.item_key, t, n), i;
+ return he.current = Se(i, J, he.current, e.item_key, t, n), i;
}),
- locked: W,
+ locked: U,
busy: Q.isPending && Q.variables?.row.item_key === e.item_key,
- problem: ge.get(e.item_key) || "",
+ problem: pe.get(e.item_key) || "",
genreTags: He,
onDecide: (t) => {
Q.isPending || $.isPending || (P((t) => new Map([...t].filter(([t]) => t !== e.item_key))), Q.mutate({
@@ -973,34 +973,34 @@ function ze(i) {
handlers: Ue
}, e.item_key))
})]
- }, e.key)) : R.isError && !R.data ? /* @__PURE__ */ (0, H.jsx)(be, {
+ }, e.key)) : L.isError && !L.data ? /* @__PURE__ */ (0, V.jsx)(_, {
tone: "error",
title: "复核队列读取失败",
- action: /* @__PURE__ */ (0, H.jsx)(k, {
+ action: /* @__PURE__ */ (0, V.jsx)(o, {
variant: "secondary",
size: "small",
- disabled: R.isFetching,
- onClick: () => void R.refetch(),
+ disabled: L.isFetching,
+ onClick: () => void L.refetch(),
children: "立即重试"
}),
- children: s(R.error)
- }) : /* @__PURE__ */ (0, H.jsx)(he, {
- icon: l,
+ children: M(L.error)
+ }) : /* @__PURE__ */ (0, V.jsx)(p, {
+ icon: de,
title: "此分类没有待复核项目",
- actions: o.some((e) => e !== D && Number(z.counts[e] || 0) > 0) ? /* @__PURE__ */ (0, H.jsx)(k, {
+ actions: v.some((e) => e !== b && Number(R.counts[e] || 0) > 0) ? /* @__PURE__ */ (0, V.jsx)(o, {
size: "small",
onClick: () => {
- let e = o.find((e) => e !== D && Number(z.counts[e] || 0) > 0);
+ let e = v.find((e) => e !== b && Number(R.counts[e] || 0) > 0);
e && Pe(e);
},
children: "查看其他分类"
}) : void 0,
children: "可切换分类查看其他待确认资料。"
}),
- /* @__PURE__ */ (0, H.jsx)(Re, {
- page: J.page,
- pages: J.pages,
- onPage: A
+ /* @__PURE__ */ (0, V.jsx)(Re, {
+ page: q.page,
+ pages: q.pages,
+ onPage: E
})
]
})]
@@ -1011,4 +1011,4 @@ function ze(i) {
//#endregion
export { ze as ReviewPage };
-//# debugId=784a955c-ce4c-4fa1-99bd-9355f850ad34
\ No newline at end of file
+//# debugId=5d38737a-8167-4a7a-b8b7-f256ab67572b
\ No newline at end of file
diff --git a/web/dist/peach-app.scraping-page-BmS-S4ER.js b/web/dist/peach-app.scraping-page-BmS-S4ER.js
deleted file mode 100644
index 8d57c35ce..000000000
--- a/web/dist/peach-app.scraping-page-BmS-S4ER.js
+++ /dev/null
@@ -1,622 +0,0 @@
-(function() {
- try {
- var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "347ce486-baf6-4625-a635-d065a089de65", e._sentryDebugIdIdentifier = "sentry-dbid-347ce486-baf6-4625-a635-d065a089de65");
- } catch {}
-})();
-import { Aa as e, At as t, Ba as n, Bo as r, Ca as i, Ct as a, Da as o, Dt as s, Ea as c, Et as l, Gl as u, Ha as d, Il as f, Jl as p, Kt as m, Ma as h, Mt as g, Nt as _, Oa as v, Ot as y, Pa as ee, Sa as b, Sc as x, St as S, Ta as C, Tt as w, Wa as te, Wl as T, Xa as E, _a as ne, au as D, bt as O, cu as k, fa as re, fs as A, ga as ie, ht as j, iu as M, jt as N, ka as ae, kt as P, lo as F, ma as oe, mn as I, pa as se, pu as L, ro as R, so as z, ss as ce, uu as B, vt as V, wa as H, wc as U, wt as W, xa as G, yt as le } from "./peach-app.js";
-import { t as ue } from "./peach-app.code-block-De9b0xOF.js";
-import { t as K } from "./peach-app.page-BYr6f5ud.js";
-import { n as q } from "./peach-app.site-mark-C-FsZf9f.js";
-import { t as de } from "./peach-app.connection-status-Pa6aDai7.js";
-//#region src/react/scraping/custom-sources.tsx
-var J = /* @__PURE__ */ L(B(), 1), Y = k(), fe = [
- ["code", "番号"],
- ["title", "标题"],
- ["studio", "厂牌"],
- ["series", "系列"],
- ["release_date", "发行日期"],
- ["performers", "演员(文本数组)"],
- ["tags", "标签(文本数组)"]
-], pe = [
- ["censored", "有码"],
- ["amateur", "素人"],
- ["uncensored", "无码"],
- ["fc2", "FC2"],
- ["kmib", "韩国 MIB"],
- ["other", "其他"],
- ["unsure", "待核番号"],
- ["unknown", "未知"]
-], me = () => ({
- name: "",
- endpoint: "",
- enabled: !1,
- fields: {
- code: "id",
- title: "title"
- },
- content_types: ["censored"]
-});
-function he({ receipt: t }) {
- let [n, r] = (0, J.useState)(null), i = D({
- queryKey: N,
- queryFn: ({ signal: e }) => _(e)
- }), a = d(), s = (e) => f.setQueryData(N, e), c = !!(i.isPending || i.error || i.data?.items.length || a.error), l = /* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- onClick: () => r(me()),
- children: "添加来源"
- });
- return /* @__PURE__ */ (0, Y.jsxs)(e, {
- title: "自定义元数据来源",
- children: [
- c ? /* @__PURE__ */ (0, Y.jsxs)(h, { children: [
- i.isPending ? /* @__PURE__ */ (0, Y.jsx)("div", {
- "aria-busy": "true",
- "data-skeleton": "",
- "aria-label": "读取自定义来源"
- }) : null,
- i.error ? /* @__PURE__ */ (0, Y.jsx)(b, { children: u(i.error) }) : null,
- i.data?.items.map((e) => /* @__PURE__ */ (0, Y.jsxs)("div", {
- className: "flex flex-wrap items-center gap-3",
- children: [
- /* @__PURE__ */ (0, Y.jsx)("span", {
- className: "min-w-0 flex-1",
- children: e.name
- }),
- /* @__PURE__ */ (0, Y.jsx)(m, {
- tone: e.enabled ? "success" : "neutral",
- children: e.enabled ? "已启用" : "已停用"
- }),
- /* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- onClick: () => r(e),
- children: "编辑"
- }),
- /* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- ...R(a.busy === e.id),
- onClick: () => void a.run(e.id, (t) => T(g, {
- ...e,
- enabled: !e.enabled
- }, "POST", t), (n) => {
- s(n), t(e.enabled ? "已停用来源" : "已启用来源");
- }),
- children: e.enabled ? "停用" : "启用"
- }),
- /* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "danger",
- onClick: () => x({
- title: "删除自定义来源",
- body: `删除「${p(e.name)}」后,采集将不再查询这个来源。`,
- confirmLabel: "删除来源",
- danger: !0,
- onConfirm: async () => {
- s(await T(g, {
- action: "delete",
- id: e.id
- })), r(null), t("已删除来源");
- }
- }),
- children: "删除"
- })
- ]
- }, e.id)),
- a.error ? /* @__PURE__ */ (0, Y.jsx)(b, { children: a.error }) : null
- ] }) : null,
- n ? null : c ? /* @__PURE__ */ (0, Y.jsx)(o, { children: l }) : /* @__PURE__ */ (0, Y.jsx)(h, { children: /* @__PURE__ */ (0, Y.jsx)("div", {
- className: "flex justify-end",
- children: l
- }) }),
- n ? /* @__PURE__ */ (0, Y.jsx)(ge, {
- initial: n,
- cancel: () => r(null),
- saved: (e) => {
- s(e), r(null), t("已保存来源");
- }
- }, n.id || "new") : null
- ]
- });
-}
-function ge({ initial: e, cancel: t, saved: n }) {
- let [r, i] = (0, J.useState)(e), [a, s] = (0, J.useState)(""), [l, f] = (0, J.useState)(""), p = (0, J.useRef)(0), m = d(), _ = (e) => {
- p.current++, i((t) => ({
- ...t,
- ...e
- })), f("");
- };
- return /* @__PURE__ */ (0, Y.jsxs)("form", {
- "aria-label": "元数据来源配置",
- "aria-busy": m.busy === "preview",
- onSubmit: (e) => {
- e.preventDefault(), m.run("save", (e) => T(g, r, "POST", e), n);
- },
- children: [/* @__PURE__ */ (0, Y.jsxs)(h, { children: [
- /* @__PURE__ */ (0, Y.jsx)(F, {
- label: "来源名称",
- value: r.name,
- maxLength: 80,
- onChange: (e) => _({ name: e })
- }),
- /* @__PURE__ */ (0, Y.jsx)(F, {
- label: "JSON 接口地址",
- value: r.endpoint,
- maxLength: 2048,
- placeholder: "https://example.com/api/movies/{code}",
- onChange: (e) => _({ endpoint: e })
- }),
- /* @__PURE__ */ (0, Y.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [/* @__PURE__ */ (0, Y.jsx)(c, { children: "来源连接方式" }), /* @__PURE__ */ (0, Y.jsx)(j, {
- id: "custom-source-network",
- label: "来源连接方式",
- epoch: 0,
- value: r.network || "direct",
- options: [["direct", "直连"], ["peach_proxy", "Peach 代理"]],
- onPick: (e) => _({ network: e })
- })]
- }),
- /* @__PURE__ */ (0, Y.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [/* @__PURE__ */ (0, Y.jsx)(c, { children: "接口番号格式" }), /* @__PURE__ */ (0, Y.jsx)(j, {
- id: "custom-source-code-format",
- label: "接口番号格式",
- epoch: 0,
- value: r.code_format || "original",
- options: [
- ["original", "原样"],
- ["lowercase", "小写"],
- ["compact", "去掉连字符"],
- ["underscore", "连字符转下划线"]
- ],
- onPick: (e) => _({ code_format: e })
- })]
- }),
- /* @__PURE__ */ (0, Y.jsx)(v, { children: "填写公开 JSON 接口和响应字段路径,例如 data.title。番号字段用于核对作品身份。" }),
- fe.map(([e, t]) => /* @__PURE__ */ (0, Y.jsx)(F, {
- label: `${t}字段路径`,
- value: r.fields[e] || "",
- onChange: (t) => {
- let n = { ...r.fields };
- t ? n[e] = t : delete n[e], _({ fields: n });
- }
- }, e)),
- /* @__PURE__ */ (0, Y.jsx)("div", {
- className: "flex flex-wrap gap-3",
- role: "group",
- "aria-label": "适用内容类型",
- children: pe.map(([e, t]) => /* @__PURE__ */ (0, Y.jsx)(E, {
- isSelected: r.content_types.includes(e),
- onChange: (t) => _({ content_types: t ? [...r.content_types, e] : r.content_types.filter((t) => t !== e) }),
- children: t
- }, e))
- }),
- /* @__PURE__ */ (0, Y.jsx)(E, {
- isSelected: r.enabled,
- onChange: (e) => _({ enabled: e }),
- children: "启用来源"
- }),
- /* @__PURE__ */ (0, Y.jsx)(F, {
- label: "试查番号(回车查询)",
- value: a,
- onChange: (e) => {
- p.current++, s(e), f("");
- },
- onKeyDown: (e) => {
- if (e.key !== "Enter" || e.nativeEvent.isComposing) return;
- e.preventDefault();
- let t = p.current;
- m.run("preview", (e) => T(g, {
- ...r,
- code: a,
- action: "preview"
- }, "POST", e), (e) => {
- t === p.current && f(JSON.stringify(e.record, null, 2));
- }, (e) => {
- t === p.current && m.setError(u(e));
- });
- }
- }),
- m.busy === "preview" ? /* @__PURE__ */ (0, Y.jsxs)(v, {
- role: "status",
- children: [/* @__PURE__ */ (0, Y.jsx)("span", { dangerouslySetInnerHTML: { __html: U("正在试查来源") } }), "正在试查来源"]
- }) : null,
- l ? /* @__PURE__ */ (0, Y.jsx)(ue, {
- code: l,
- language: "json",
- label: "元数据接口返回"
- }) : null,
- m.error ? /* @__PURE__ */ (0, Y.jsx)(b, { children: m.error }) : null
- ] }), /* @__PURE__ */ (0, Y.jsxs)(o, { children: [/* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- type: "button",
- onClick: t,
- children: "取消"
- }), /* @__PURE__ */ (0, Y.jsx)(A, {
- type: "submit",
- ...R(m.busy === "save"),
- children: "保存来源"
- })] })]
- });
-}
-//#endregion
-//#region src/react/scraping/scraping-page.tsx
-var X = [["peach", "Peach 代理"], ["direct", "直接连接"]];
-function Z(e) {
- return X.some(([t]) => t === e) || !e ? [...X] : [...X, [e, e]];
-}
-function Q(e) {
- try {
- return new URL(e).host || e;
- } catch {
- return e;
- }
-}
-var $ = [["paste", "粘贴 Cookie"], ["file", "导入文件"]];
-function _e() {
- return /* @__PURE__ */ (0, Y.jsx)(q, { source: "github" });
-}
-function ve({ source: t, toast: n }) {
- let [d, p] = (0, J.useState)(t.network), [g, _] = (0, J.useState)(""), [v, y] = (0, J.useState)(""), [x, S] = (0, J.useState)($[0][0]), [C, E] = (0, J.useState)(""), [D, O] = (0, J.useState)(""), k = (0, J.useRef)(null);
- function j() {
- _(""), y(""), E(""), O(""), k.current && (k.current.value = "");
- }
- let N = M({
- mutationFn: (e) => T(l, {
- source: t.source,
- network: d,
- cookie: g,
- cookies_text: v,
- revoke: e
- }),
- onSuccess: (e, t) => {
- f.setQueryData(w, (t) => t && {
- ...t,
- sources: t.sources.map((t) => t.source === e.saved.source ? e.saved : t)
- }), j(), n(t ? "Cookie 已撤销" : "来源设置已保存");
- }
- }), P = M({ mutationFn: () => T(a, { source: t.source }) }), I = N.isPending || P.isPending, L = (e) => {
- e.preventDefault(), !I && (P.reset(), N.mutate(!1));
- }, B = () => {
- I || (P.reset(), N.mutate(!0));
- }, V = () => {
- I || (N.reset(), P.mutate());
- };
- async function H(e) {
- let t = e.currentTarget, n = t.files?.[0];
- if (y(""), O(""), !n) E("");
- else if (n.size > 262144) t.value = "", E(""), O("Cookie 文本超过 256 KiB");
- else try {
- let e = await n.text();
- y(e), E(n.name);
- } catch {
- O("Cookie 文件未读取,请重新选择");
- }
- }
- let U = D || (N.error ? u(N.error) : "") || (P.error ? u(P.error) : ""), W = P.data?.results ?? [], G = d === "peach" || t.accepts_cookie || t.browser || !!U || W.length > 0;
- return /* @__PURE__ */ (0, Y.jsxs)(e, {
- title: t.label,
- onSubmit: L,
- aside: /* @__PURE__ */ (0, Y.jsxs)("span", {
- className: "flex min-w-0 items-center gap-1",
- children: [/* @__PURE__ */ (0, Y.jsx)(q, { source: t.source }), t.login ? /* @__PURE__ */ (0, Y.jsx)(i, {
- href: t.login,
- children: Q(t.login)
- }) : null]
- }),
- children: [
- /* @__PURE__ */ (0, Y.jsx)(ae, { children: /* @__PURE__ */ (0, Y.jsx)(ee, {
- label: "连接方式",
- children: /* @__PURE__ */ (0, Y.jsx)(ie, {
- "aria-label": "连接方式",
- className: "w-44 min-w-0",
- selectedKey: d,
- onSelectionChange: (e) => {
- e !== null && p(String(e));
- },
- children: Z(d).map(([e, t]) => /* @__PURE__ */ (0, Y.jsx)(ne, {
- id: e,
- children: t
- }, e))
- })
- }) }),
- t.cooldown_until && t.cooldown_until > Date.now() / 1e3 ? /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "warning",
- children: /* @__PURE__ */ (0, Y.jsxs)("span", {
- className: "inline-flex flex-wrap items-center gap-2",
- children: [/* @__PURE__ */ (0, Y.jsx)(m, {
- tone: "warning",
- children: "冷却中"
- }), /* @__PURE__ */ (0, Y.jsxs)("span", { children: [
- "可在 ",
- (/* @__PURE__ */ new Date(t.cooldown_until * 1e3)).toLocaleString("zh-CN"),
- " 后重试。"
- ] })]
- })
- }) : null,
- G ? /* @__PURE__ */ (0, Y.jsxs)(h, {
- divided: !0,
- children: [
- d === "peach" ? /* @__PURE__ */ (0, Y.jsx)("span", {
- className: "self-start",
- children: /* @__PURE__ */ (0, Y.jsx)(te, {
- href: "/settings/library#peachProxy",
- size: "small",
- trailingIcon: r,
- children: "配置 Peach 代理"
- })
- }) : null,
- t.browser ? /* @__PURE__ */ (0, Y.jsx)("p", {
- className: "text-body-2-regular text-text-secondary",
- children: "人机验证由本机浏览器自动完成;需要点击时窗口会弹出。这台机器上不需要 Cookie。"
- }) : null,
- t.accepts_cookie && !t.browser ? /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
- /* @__PURE__ */ (0, Y.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [/* @__PURE__ */ (0, Y.jsx)("span", {
- className: "self-start",
- children: /* @__PURE__ */ (0, Y.jsx)(m, {
- tone: t.cookie_saved ? "success" : "neutral",
- children: t.cookie_saved ? "Cookie 已保存" : "Cookie 未配置"
- })
- }), /* @__PURE__ */ (0, Y.jsx)("p", {
- className: "text-body-2-regular text-text-secondary",
- children: t.cookie_saved ? "登录有效性待验证。" : "需要登录时,任选一种方式提供 Cookie。"
- })]
- }),
- /* @__PURE__ */ (0, Y.jsx)(oe, {
- "aria-label": "提供 Cookie 的方式(二选一)",
- value: x,
- onChange: (e) => {
- S(e), j();
- },
- className: se,
- children: $.map(([e, t]) => /* @__PURE__ */ (0, Y.jsx)(ce, {
- value: e,
- className: re,
- children: t
- }, e))
- }),
- x === "paste" ? /* @__PURE__ */ (0, Y.jsx)(F, {
- type: "password",
- label: "Cookie",
- autoComplete: "off",
- value: g,
- onChange: _
- }) : /* @__PURE__ */ (0, Y.jsxs)("div", {
- className: "flex flex-col gap-2",
- children: [
- /* @__PURE__ */ (0, Y.jsx)(c, { children: "Netscape Cookie 文件(.txt)" }),
- /* @__PURE__ */ (0, Y.jsxs)("div", {
- className: "flex flex-wrap items-center gap-3",
- children: [/* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- onClick: () => k.current?.click(),
- children: "选择文件"
- }), /* @__PURE__ */ (0, Y.jsx)("span", {
- className: "min-w-0 text-body-2-regular break-all text-text-secondary",
- children: C || "未选择文件"
- })]
- }),
- /* @__PURE__ */ (0, Y.jsx)("input", {
- ref: k,
- type: "file",
- accept: ".txt",
- tabIndex: -1,
- "aria-hidden": !0,
- className: "hidden",
- onChange: (e) => {
- H(e);
- }
- })
- ]
- })
- ] }) : null,
- U ? /* @__PURE__ */ (0, Y.jsx)(b, { children: U }) : null,
- W.map((e) => /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: e.ok ? "success" : "error",
- children: /* @__PURE__ */ (0, Y.jsxs)("span", {
- className: "flex flex-col items-start gap-1",
- children: [/* @__PURE__ */ (0, Y.jsx)(de, {
- tone: e.ok ? "success" : "error",
- children: e.ok ? "可访问" : "连接失败"
- }), /* @__PURE__ */ (0, Y.jsx)("span", { children: s(e, t.label) })]
- })
- }, e.label))
- ]
- }) : null,
- /* @__PURE__ */ (0, Y.jsxs)(o, { children: [
- t.accepts_cookie && t.cookie_saved ? /* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- onClick: B,
- ...R(I),
- children: "撤销 Cookie"
- }) : null,
- /* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- onClick: V,
- ...R(I),
- children: "检查连接"
- }),
- /* @__PURE__ */ (0, Y.jsx)(A, {
- type: "submit",
- ...R(I),
- children: "保存"
- })
- ] })
- ]
- });
-}
-function ye({ toast: t }) {
- let [r, i] = (0, J.useState)(""), { running: a, outcome: o, start: s } = I({
- queryKey: S,
- queryFn: ({ signal: e }) => P(e),
- start: () => T(W, { code: r }),
- onFinish: (e) => {
- e.status === "complete" && t(e.result || "封面采集完成");
- }
- }), c = (e) => {
- e.preventDefault(), !(a || s.isPending || !r.trim()) && s.mutate();
- }, l = s.error ? u(s.error) : o?.status === "failed" ? o.error || "采集未取得" : "";
- return /* @__PURE__ */ (0, Y.jsx)(e, {
- title: "高清封面",
- onSubmit: c,
- children: /* @__PURE__ */ (0, Y.jsxs)(h, { children: [
- /* @__PURE__ */ (0, Y.jsxs)("div", {
- className: "flex flex-wrap items-end gap-2",
- children: [/* @__PURE__ */ (0, Y.jsx)("div", {
- className: "min-w-0 flex-1",
- children: /* @__PURE__ */ (0, Y.jsx)(F, {
- "aria-label": "馆藏番号",
- isRequired: !0,
- isDisabled: a,
- value: r,
- onChange: i,
- placeholder: "输入馆藏番号,如 ABW-232"
- })
- }), /* @__PURE__ */ (0, Y.jsx)(A, {
- type: "submit",
- disabled: !r.trim(),
- ...R(a || s.isPending),
- children: "抓取封面"
- })]
- }),
- a ? /* @__PURE__ */ (0, Y.jsx)(n, { label: "正在抓取封面" }) : null,
- l ? /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "error",
- children: l
- }) : null,
- o?.status === "complete" ? /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "success",
- children: o.result || "封面采集完成"
- }) : null
- ] })
- });
-}
-function be({ toast: t }) {
- let { query: r, running: a, outcome: s, start: c } = I({
- queryKey: le,
- queryFn: ({ signal: e }) => y(e),
- start: () => T(O, {}),
- jobOf: (e) => e.job,
- withJob: (e, t) => e && {
- ...e,
- job: t
- },
- onFinish: (e) => {
- e.status === "complete" && t(e.result || "amane 桥已重建");
- }
- }), l = M({ mutationFn: () => T(V, {}) }), d = r.data;
- if (!d) return r.error ? /* @__PURE__ */ (0, Y.jsx)(e, {
- id: "amane",
- title: "amane",
- children: /* @__PURE__ */ (0, Y.jsx)(h, { children: /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "error",
- children: u(r.error)
- }) })
- }) : null;
- let f = a || c.isPending || l.isPending, p = c.error ? u(c.error) : l.error ? u(l.error) : s?.status === "failed" ? s.error || "重建未完成" : "";
- return /* @__PURE__ */ (0, Y.jsxs)(e, {
- id: "amane",
- title: "amane",
- aside: /* @__PURE__ */ (0, Y.jsx)(i, {
- href: d.repository,
- leadingIcon: _e,
- children: d.repository
- }),
- children: [
- /* @__PURE__ */ (0, Y.jsxs)(C, { children: [
- /* @__PURE__ */ (0, Y.jsx)(H, {
- term: "已安装版本",
- children: d.installed_version || "未安装"
- }),
- /* @__PURE__ */ (0, Y.jsx)(H, {
- term: "上游最新版本",
- children: l.data?.latest ?? "尚未检查"
- }),
- /* @__PURE__ */ (0, Y.jsx)(H, {
- term: "运行环境",
- children: d.installed ? "已安装" : "未安装"
- }),
- /* @__PURE__ */ (0, Y.jsxs)(H, {
- term: "内置站点",
- children: [d.sites.length.toLocaleString(), " 个"]
- })
- ] }),
- /* @__PURE__ */ (0, Y.jsxs)(h, {
- divided: !0,
- children: [
- d.sites.length ? /* @__PURE__ */ (0, Y.jsx)(G, {
- summary: "查看内置站点",
- children: /* @__PURE__ */ (0, Y.jsx)("p", {
- className: "text-body-2-regular text-text-secondary",
- children: d.sites.map((e) => e.label).join("、")
- })
- }) : null,
- d.problem ? /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "error",
- children: d.problem
- }) : /* @__PURE__ */ (0, Y.jsxs)(v, { children: [
- "已安装版本:",
- d.installed_version || "未安装",
- "。amane(",
- d.license,
- ")提供这些内置站点的解析能力。 重新安装会使用 Peach 内置的 ",
- d.version,
- " 版本,不随上游自动升级。"
- ] }),
- a ? /* @__PURE__ */ (0, Y.jsx)(n, { label: "正在重建运行环境" }) : null,
- p ? /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "error",
- children: p
- }) : null,
- s?.status === "complete" ? /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "success",
- children: s.result || "amane 桥已重建"
- }) : null
- ]
- }),
- /* @__PURE__ */ (0, Y.jsxs)(o, { children: [/* @__PURE__ */ (0, Y.jsx)(A, {
- variant: "secondary",
- onClick: () => {
- f || l.mutate();
- },
- ...R(l.isPending),
- children: "检查上游版本"
- }), /* @__PURE__ */ (0, Y.jsx)(A, {
- disabled: !!d.problem,
- onClick: () => {
- f || c.mutate();
- },
- ...R(a || c.isPending),
- children: d.installed ? "重新安装" : "安装"
- })] })
- ]
- });
-}
-function xe({ toast: e }) {
- let n = D({
- queryKey: w,
- queryFn: ({ signal: e }) => t(e)
- }), r = n.data;
- return r ? /* @__PURE__ */ (0, Y.jsxs)(K, { children: [
- /* @__PURE__ */ (0, Y.jsx)("p", {
- className: "text-body-2-regular text-text-secondary",
- children: "高清图片可能要经代理才能下载,先检查连接。"
- }),
- /* @__PURE__ */ (0, Y.jsx)(ye, { toast: e }),
- /* @__PURE__ */ (0, Y.jsx)(he, { receipt: e }),
- (r.sources || []).map((t) => /* @__PURE__ */ (0, Y.jsx)(ve, {
- source: t,
- toast: e
- }, t.source)),
- /* @__PURE__ */ (0, Y.jsx)(be, { toast: e })
- ] }) : /* @__PURE__ */ (0, Y.jsx)(K, { children: /* @__PURE__ */ (0, Y.jsx)(z, {
- tone: "error",
- title: "采集来源读取失败",
- children: n.error ? u(n.error) : "读取采集来源失败"
- }) });
-}
-//#endregion
-export { xe as ScrapingPage, Q as linkHost, Z as networkOptions };
-
-//# debugId=347ce486-baf6-4625-a635-d065a089de65
\ No newline at end of file
diff --git a/web/dist/peach-app.scraping-page-DM0a_K9-.js b/web/dist/peach-app.scraping-page-DM0a_K9-.js
new file mode 100644
index 000000000..0097b96dd
--- /dev/null
+++ b/web/dist/peach-app.scraping-page-DM0a_K9-.js
@@ -0,0 +1,622 @@
+(function() {
+ try {
+ var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "daaf4ee8-3af3-47e9-ac67-d3b9a7c2692e", e._sentryDebugIdIdentifier = "sentry-dbid-daaf4ee8-3af3-47e9-ac67-d3b9a7c2692e");
+ } catch {}
+})();
+import { $fe21c36db05242bb$export$d7b12c4107be0d61 as e, AMANE_BRIDGE_CHECK_URL as t, AMANE_BRIDGE_KEY as n, AMANE_BRIDGE_REBUILD_URL as r, Button as i, COVER_JOB_KEY as a, CUSTOM_SOURCES_KEY as o, CUSTOM_SOURCES_URL as s, Checkbox as c, Disclosure as l, ErrorText as u, ExternalLink as d, Fact as f, FactList as p, FieldLabel as m, Footer as h, Help as g, Input as _, LinkButton as v, LoadingDots as y, Note as b, Rows as ee, SCRAPING_CHECK_URL as te, SCRAPING_COVER_URL as x, SCRAPING_KEY as S, SCRAPING_SETTINGS_URL as ne, SEGMENT as re, SEGMENTED_TRACK as ie, Section as C, SegmentedRadioGroup as ae, Select$1 as oe, SelectField as w, SelectItem as se, SettingsRow as ce, Stack as T, StatusLabel as E, __toESM as D, apiSend as O, busyProps as k, checkText as le, confirmModal as A, errorMessage as j, esc as M, fetchAmaneBridge as N, fetchCoverJob as P, fetchCustomSources as F, fetchSources as I, i2 as ue, queryClient as L, require_jsx_runtime as R, require_react as z, spinnerHtml as B, useAction as V, useBackgroundJob as H, useMutation as U, useQuery as W } from "./peach-app.js";
+import { CodeBlock as de } from "./peach-app.code-block-CuHUqiH3.js";
+import { Page as G } from "./peach-app.page-Irl_Wogd.js";
+import { SiteMark as K } from "./peach-app.site-mark-Cjd7g2Ii.js";
+import { ConnectionStatus as fe } from "./peach-app.connection-status-BP0ylxDH.js";
+//#region src/react/scraping/custom-sources.tsx
+var q = /* @__PURE__ */ D(z(), 1), J = R(), pe = [
+ ["code", "番号"],
+ ["title", "标题"],
+ ["studio", "厂牌"],
+ ["series", "系列"],
+ ["release_date", "发行日期"],
+ ["performers", "演员(文本数组)"],
+ ["tags", "标签(文本数组)"]
+], me = [
+ ["censored", "有码"],
+ ["amateur", "素人"],
+ ["uncensored", "无码"],
+ ["fc2", "FC2"],
+ ["kmib", "韩国 MIB"],
+ ["other", "其他"],
+ ["unsure", "待核番号"],
+ ["unknown", "未知"]
+], he = () => ({
+ name: "",
+ endpoint: "",
+ enabled: !1,
+ fields: {
+ code: "id",
+ title: "title"
+ },
+ content_types: ["censored"]
+});
+function Y({ receipt: e }) {
+ let [t, n] = (0, q.useState)(null), r = W({
+ queryKey: o,
+ queryFn: ({ signal: e }) => F(e)
+ }), a = V(), c = (e) => L.setQueryData(o, e), l = !!(r.isPending || r.error || r.data?.items.length || a.error), d = /* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ onClick: () => n(he()),
+ children: "添加来源"
+ });
+ return /* @__PURE__ */ (0, J.jsxs)(C, {
+ title: "自定义元数据来源",
+ children: [
+ l ? /* @__PURE__ */ (0, J.jsxs)(T, { children: [
+ r.isPending ? /* @__PURE__ */ (0, J.jsx)("div", {
+ "aria-busy": "true",
+ "data-skeleton": "",
+ "aria-label": "读取自定义来源"
+ }) : null,
+ r.error ? /* @__PURE__ */ (0, J.jsx)(u, { children: j(r.error) }) : null,
+ r.data?.items.map((t) => /* @__PURE__ */ (0, J.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-3",
+ children: [
+ /* @__PURE__ */ (0, J.jsx)("span", {
+ className: "min-w-0 flex-1",
+ children: t.name
+ }),
+ /* @__PURE__ */ (0, J.jsx)(E, {
+ tone: t.enabled ? "success" : "neutral",
+ children: t.enabled ? "已启用" : "已停用"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ onClick: () => n(t),
+ children: "编辑"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ ...k(a.busy === t.id),
+ onClick: () => void a.run(t.id, (e) => O(s, {
+ ...t,
+ enabled: !t.enabled
+ }, "POST", e), (n) => {
+ c(n), e(t.enabled ? "已停用来源" : "已启用来源");
+ }),
+ children: t.enabled ? "停用" : "启用"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "danger",
+ onClick: () => A({
+ title: "删除自定义来源",
+ body: `删除「${M(t.name)}」后,采集将不再查询这个来源。`,
+ confirmLabel: "删除来源",
+ danger: !0,
+ onConfirm: async () => {
+ c(await O(s, {
+ action: "delete",
+ id: t.id
+ })), n(null), e("已删除来源");
+ }
+ }),
+ children: "删除"
+ })
+ ]
+ }, t.id)),
+ a.error ? /* @__PURE__ */ (0, J.jsx)(u, { children: a.error }) : null
+ ] }) : null,
+ t ? null : l ? /* @__PURE__ */ (0, J.jsx)(h, { children: d }) : /* @__PURE__ */ (0, J.jsx)(T, { children: /* @__PURE__ */ (0, J.jsx)("div", {
+ className: "flex justify-end",
+ children: d
+ }) }),
+ t ? /* @__PURE__ */ (0, J.jsx)(ge, {
+ initial: t,
+ cancel: () => n(null),
+ saved: (t) => {
+ c(t), n(null), e("已保存来源");
+ }
+ }, t.id || "new") : null
+ ]
+ });
+}
+function ge({ initial: e, cancel: t, saved: n }) {
+ let [r, a] = (0, q.useState)(e), [o, l] = (0, q.useState)(""), [d, f] = (0, q.useState)(""), p = (0, q.useRef)(0), v = V(), y = (e) => {
+ p.current++, a((t) => ({
+ ...t,
+ ...e
+ })), f("");
+ };
+ return /* @__PURE__ */ (0, J.jsxs)("form", {
+ "aria-label": "元数据来源配置",
+ "aria-busy": v.busy === "preview",
+ onSubmit: (e) => {
+ e.preventDefault(), v.run("save", (e) => O(s, r, "POST", e), n);
+ },
+ children: [/* @__PURE__ */ (0, J.jsxs)(T, { children: [
+ /* @__PURE__ */ (0, J.jsx)(_, {
+ label: "来源名称",
+ value: r.name,
+ maxLength: 80,
+ onChange: (e) => y({ name: e })
+ }),
+ /* @__PURE__ */ (0, J.jsx)(_, {
+ label: "JSON 接口地址",
+ value: r.endpoint,
+ maxLength: 2048,
+ placeholder: "https://example.com/api/movies/{code}",
+ onChange: (e) => y({ endpoint: e })
+ }),
+ /* @__PURE__ */ (0, J.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [/* @__PURE__ */ (0, J.jsx)(m, { children: "来源连接方式" }), /* @__PURE__ */ (0, J.jsx)(w, {
+ id: "custom-source-network",
+ label: "来源连接方式",
+ epoch: 0,
+ value: r.network || "direct",
+ options: [["direct", "直连"], ["peach_proxy", "Peach 代理"]],
+ onPick: (e) => y({ network: e })
+ })]
+ }),
+ /* @__PURE__ */ (0, J.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [/* @__PURE__ */ (0, J.jsx)(m, { children: "接口番号格式" }), /* @__PURE__ */ (0, J.jsx)(w, {
+ id: "custom-source-code-format",
+ label: "接口番号格式",
+ epoch: 0,
+ value: r.code_format || "original",
+ options: [
+ ["original", "原样"],
+ ["lowercase", "小写"],
+ ["compact", "去掉连字符"],
+ ["underscore", "连字符转下划线"]
+ ],
+ onPick: (e) => y({ code_format: e })
+ })]
+ }),
+ /* @__PURE__ */ (0, J.jsx)(g, { children: "填写公开 JSON 接口和响应字段路径,例如 data.title。番号字段用于核对作品身份。" }),
+ pe.map(([e, t]) => /* @__PURE__ */ (0, J.jsx)(_, {
+ label: `${t}字段路径`,
+ value: r.fields[e] || "",
+ onChange: (t) => {
+ let n = { ...r.fields };
+ t ? n[e] = t : delete n[e], y({ fields: n });
+ }
+ }, e)),
+ /* @__PURE__ */ (0, J.jsx)("div", {
+ className: "flex flex-wrap gap-3",
+ role: "group",
+ "aria-label": "适用内容类型",
+ children: me.map(([e, t]) => /* @__PURE__ */ (0, J.jsx)(c, {
+ isSelected: r.content_types.includes(e),
+ onChange: (t) => y({ content_types: t ? [...r.content_types, e] : r.content_types.filter((t) => t !== e) }),
+ children: t
+ }, e))
+ }),
+ /* @__PURE__ */ (0, J.jsx)(c, {
+ isSelected: r.enabled,
+ onChange: (e) => y({ enabled: e }),
+ children: "启用来源"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(_, {
+ label: "试查番号(回车查询)",
+ value: o,
+ onChange: (e) => {
+ p.current++, l(e), f("");
+ },
+ onKeyDown: (e) => {
+ if (e.key !== "Enter" || e.nativeEvent.isComposing) return;
+ e.preventDefault();
+ let t = p.current;
+ v.run("preview", (e) => O(s, {
+ ...r,
+ code: o,
+ action: "preview"
+ }, "POST", e), (e) => {
+ t === p.current && f(JSON.stringify(e.record, null, 2));
+ }, (e) => {
+ t === p.current && v.setError(j(e));
+ });
+ }
+ }),
+ v.busy === "preview" ? /* @__PURE__ */ (0, J.jsxs)(g, {
+ role: "status",
+ children: [/* @__PURE__ */ (0, J.jsx)("span", { dangerouslySetInnerHTML: { __html: B("正在试查来源") } }), "正在试查来源"]
+ }) : null,
+ d ? /* @__PURE__ */ (0, J.jsx)(de, {
+ code: d,
+ language: "json",
+ label: "元数据接口返回"
+ }) : null,
+ v.error ? /* @__PURE__ */ (0, J.jsx)(u, { children: v.error }) : null
+ ] }), /* @__PURE__ */ (0, J.jsxs)(h, { children: [/* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ type: "button",
+ onClick: t,
+ children: "取消"
+ }), /* @__PURE__ */ (0, J.jsx)(i, {
+ type: "submit",
+ ...k(v.busy === "save"),
+ children: "保存来源"
+ })] })]
+ });
+}
+//#endregion
+//#region src/react/scraping/scraping-page.tsx
+var X = [["peach", "Peach 代理"], ["direct", "直接连接"]];
+function Z(e) {
+ return X.some(([t]) => t === e) || !e ? [...X] : [...X, [e, e]];
+}
+function Q(e) {
+ try {
+ return new URL(e).host || e;
+ } catch {
+ return e;
+ }
+}
+var $ = [["paste", "粘贴 Cookie"], ["file", "导入文件"]];
+function _e() {
+ return /* @__PURE__ */ (0, J.jsx)(K, { source: "github" });
+}
+function ve({ source: t, toast: n }) {
+ let [r, a] = (0, q.useState)(t.network), [o, s] = (0, q.useState)(""), [c, l] = (0, q.useState)(""), [f, p] = (0, q.useState)($[0][0]), [g, y] = (0, q.useState)(""), [x, w] = (0, q.useState)(""), D = (0, q.useRef)(null);
+ function A() {
+ s(""), l(""), y(""), w(""), D.current && (D.current.value = "");
+ }
+ let M = U({
+ mutationFn: (e) => O(ne, {
+ source: t.source,
+ network: r,
+ cookie: o,
+ cookies_text: c,
+ revoke: e
+ }),
+ onSuccess: (e, t) => {
+ L.setQueryData(S, (t) => t && {
+ ...t,
+ sources: t.sources.map((t) => t.source === e.saved.source ? e.saved : t)
+ }), A(), n(t ? "Cookie 已撤销" : "来源设置已保存");
+ }
+ }), N = U({ mutationFn: () => O(te, { source: t.source }) }), P = M.isPending || N.isPending, F = (e) => {
+ e.preventDefault(), !P && (N.reset(), M.mutate(!1));
+ }, I = () => {
+ P || (N.reset(), M.mutate(!0));
+ }, R = () => {
+ P || (M.reset(), N.mutate());
+ };
+ async function z(e) {
+ let t = e.currentTarget, n = t.files?.[0];
+ if (l(""), w(""), !n) y("");
+ else if (n.size > 262144) t.value = "", y(""), w("Cookie 文本超过 256 KiB");
+ else try {
+ let e = await n.text();
+ l(e), y(n.name);
+ } catch {
+ w("Cookie 文件未读取,请重新选择");
+ }
+ }
+ let B = x || (M.error ? j(M.error) : "") || (N.error ? j(N.error) : ""), V = N.data?.results ?? [], H = r === "peach" || t.accepts_cookie || t.browser || !!B || V.length > 0;
+ return /* @__PURE__ */ (0, J.jsxs)(C, {
+ title: t.label,
+ onSubmit: F,
+ aside: /* @__PURE__ */ (0, J.jsxs)("span", {
+ className: "flex min-w-0 items-center gap-1",
+ children: [/* @__PURE__ */ (0, J.jsx)(K, { source: t.source }), t.login ? /* @__PURE__ */ (0, J.jsx)(d, {
+ href: t.login,
+ children: Q(t.login)
+ }) : null]
+ }),
+ children: [
+ /* @__PURE__ */ (0, J.jsx)(ee, { children: /* @__PURE__ */ (0, J.jsx)(ce, {
+ label: "连接方式",
+ children: /* @__PURE__ */ (0, J.jsx)(oe, {
+ "aria-label": "连接方式",
+ className: "w-44 min-w-0",
+ selectedKey: r,
+ onSelectionChange: (e) => {
+ e !== null && a(String(e));
+ },
+ children: Z(r).map(([e, t]) => /* @__PURE__ */ (0, J.jsx)(se, {
+ id: e,
+ children: t
+ }, e))
+ })
+ }) }),
+ t.cooldown_until && t.cooldown_until > Date.now() / 1e3 ? /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "warning",
+ children: /* @__PURE__ */ (0, J.jsxs)("span", {
+ className: "inline-flex flex-wrap items-center gap-2",
+ children: [/* @__PURE__ */ (0, J.jsx)(E, {
+ tone: "warning",
+ children: "冷却中"
+ }), /* @__PURE__ */ (0, J.jsxs)("span", { children: [
+ "可在 ",
+ (/* @__PURE__ */ new Date(t.cooldown_until * 1e3)).toLocaleString("zh-CN"),
+ " 后重试。"
+ ] })]
+ })
+ }) : null,
+ H ? /* @__PURE__ */ (0, J.jsxs)(T, {
+ divided: !0,
+ children: [
+ r === "peach" ? /* @__PURE__ */ (0, J.jsx)("span", {
+ className: "self-start",
+ children: /* @__PURE__ */ (0, J.jsx)(v, {
+ href: "/settings/library#peachProxy",
+ size: "small",
+ trailingIcon: ue,
+ children: "配置 Peach 代理"
+ })
+ }) : null,
+ t.browser ? /* @__PURE__ */ (0, J.jsx)("p", {
+ className: "text-body-2-regular text-text-secondary",
+ children: "人机验证由本机浏览器自动完成;需要点击时窗口会弹出。这台机器上不需要 Cookie。"
+ }) : null,
+ t.accepts_cookie && !t.browser ? /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [
+ /* @__PURE__ */ (0, J.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [/* @__PURE__ */ (0, J.jsx)("span", {
+ className: "self-start",
+ children: /* @__PURE__ */ (0, J.jsx)(E, {
+ tone: t.cookie_saved ? "success" : "neutral",
+ children: t.cookie_saved ? "Cookie 已保存" : "Cookie 未配置"
+ })
+ }), /* @__PURE__ */ (0, J.jsx)("p", {
+ className: "text-body-2-regular text-text-secondary",
+ children: t.cookie_saved ? "登录有效性待验证。" : "需要登录时,任选一种方式提供 Cookie。"
+ })]
+ }),
+ /* @__PURE__ */ (0, J.jsx)(ae, {
+ "aria-label": "提供 Cookie 的方式(二选一)",
+ value: f,
+ onChange: (e) => {
+ p(e), A();
+ },
+ className: ie,
+ children: $.map(([t, n]) => /* @__PURE__ */ (0, J.jsx)(e, {
+ value: t,
+ className: re,
+ children: n
+ }, t))
+ }),
+ f === "paste" ? /* @__PURE__ */ (0, J.jsx)(_, {
+ type: "password",
+ label: "Cookie",
+ autoComplete: "off",
+ value: o,
+ onChange: s
+ }) : /* @__PURE__ */ (0, J.jsxs)("div", {
+ className: "flex flex-col gap-2",
+ children: [
+ /* @__PURE__ */ (0, J.jsx)(m, { children: "Netscape Cookie 文件(.txt)" }),
+ /* @__PURE__ */ (0, J.jsxs)("div", {
+ className: "flex flex-wrap items-center gap-3",
+ children: [/* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ onClick: () => D.current?.click(),
+ children: "选择文件"
+ }), /* @__PURE__ */ (0, J.jsx)("span", {
+ className: "min-w-0 text-body-2-regular break-all text-text-secondary",
+ children: g || "未选择文件"
+ })]
+ }),
+ /* @__PURE__ */ (0, J.jsx)("input", {
+ ref: D,
+ type: "file",
+ accept: ".txt",
+ tabIndex: -1,
+ "aria-hidden": !0,
+ className: "hidden",
+ onChange: (e) => {
+ z(e);
+ }
+ })
+ ]
+ })
+ ] }) : null,
+ B ? /* @__PURE__ */ (0, J.jsx)(u, { children: B }) : null,
+ V.map((e) => /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: e.ok ? "success" : "error",
+ children: /* @__PURE__ */ (0, J.jsxs)("span", {
+ className: "flex flex-col items-start gap-1",
+ children: [/* @__PURE__ */ (0, J.jsx)(fe, {
+ tone: e.ok ? "success" : "error",
+ children: e.ok ? "可访问" : "连接失败"
+ }), /* @__PURE__ */ (0, J.jsx)("span", { children: le(e, t.label) })]
+ })
+ }, e.label))
+ ]
+ }) : null,
+ /* @__PURE__ */ (0, J.jsxs)(h, { children: [
+ t.accepts_cookie && t.cookie_saved ? /* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ onClick: I,
+ ...k(P),
+ children: "撤销 Cookie"
+ }) : null,
+ /* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ onClick: R,
+ ...k(P),
+ children: "检查连接"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(i, {
+ type: "submit",
+ ...k(P),
+ children: "保存"
+ })
+ ] })
+ ]
+ });
+}
+function ye({ toast: e }) {
+ let [t, n] = (0, q.useState)(""), { running: r, outcome: o, start: s } = H({
+ queryKey: a,
+ queryFn: ({ signal: e }) => P(e),
+ start: () => O(x, { code: t }),
+ onFinish: (t) => {
+ t.status === "complete" && e(t.result || "封面采集完成");
+ }
+ }), c = (e) => {
+ e.preventDefault(), !(r || s.isPending || !t.trim()) && s.mutate();
+ }, l = s.error ? j(s.error) : o?.status === "failed" ? o.error || "采集未取得" : "";
+ return /* @__PURE__ */ (0, J.jsx)(C, {
+ title: "高清封面",
+ onSubmit: c,
+ children: /* @__PURE__ */ (0, J.jsxs)(T, { children: [
+ /* @__PURE__ */ (0, J.jsxs)("div", {
+ className: "flex flex-wrap items-end gap-2",
+ children: [/* @__PURE__ */ (0, J.jsx)("div", {
+ className: "min-w-0 flex-1",
+ children: /* @__PURE__ */ (0, J.jsx)(_, {
+ "aria-label": "馆藏番号",
+ isRequired: !0,
+ isDisabled: r,
+ value: t,
+ onChange: n,
+ placeholder: "输入馆藏番号,如 ABW-232"
+ })
+ }), /* @__PURE__ */ (0, J.jsx)(i, {
+ type: "submit",
+ disabled: !t.trim(),
+ ...k(r || s.isPending),
+ children: "抓取封面"
+ })]
+ }),
+ r ? /* @__PURE__ */ (0, J.jsx)(y, { label: "正在抓取封面" }) : null,
+ l ? /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "error",
+ children: l
+ }) : null,
+ o?.status === "complete" ? /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "success",
+ children: o.result || "封面采集完成"
+ }) : null
+ ] })
+ });
+}
+function be({ toast: e }) {
+ let { query: a, running: o, outcome: s, start: c } = H({
+ queryKey: n,
+ queryFn: ({ signal: e }) => N(e),
+ start: () => O(r, {}),
+ jobOf: (e) => e.job,
+ withJob: (e, t) => e && {
+ ...e,
+ job: t
+ },
+ onFinish: (t) => {
+ t.status === "complete" && e(t.result || "amane 桥已重建");
+ }
+ }), u = U({ mutationFn: () => O(t, {}) }), m = a.data;
+ if (!m) return a.error ? /* @__PURE__ */ (0, J.jsx)(C, {
+ id: "amane",
+ title: "amane",
+ children: /* @__PURE__ */ (0, J.jsx)(T, { children: /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "error",
+ children: j(a.error)
+ }) })
+ }) : null;
+ let _ = o || c.isPending || u.isPending, v = c.error ? j(c.error) : u.error ? j(u.error) : s?.status === "failed" ? s.error || "重建未完成" : "";
+ return /* @__PURE__ */ (0, J.jsxs)(C, {
+ id: "amane",
+ title: "amane",
+ aside: /* @__PURE__ */ (0, J.jsx)(d, {
+ href: m.repository,
+ leadingIcon: _e,
+ children: m.repository
+ }),
+ children: [
+ /* @__PURE__ */ (0, J.jsxs)(p, { children: [
+ /* @__PURE__ */ (0, J.jsx)(f, {
+ term: "已安装版本",
+ children: m.installed_version || "未安装"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(f, {
+ term: "上游最新版本",
+ children: u.data?.latest ?? "尚未检查"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(f, {
+ term: "运行环境",
+ children: m.installed ? "已安装" : "未安装"
+ }),
+ /* @__PURE__ */ (0, J.jsxs)(f, {
+ term: "内置站点",
+ children: [m.sites.length.toLocaleString(), " 个"]
+ })
+ ] }),
+ /* @__PURE__ */ (0, J.jsxs)(T, {
+ divided: !0,
+ children: [
+ m.sites.length ? /* @__PURE__ */ (0, J.jsx)(l, {
+ summary: "查看内置站点",
+ children: /* @__PURE__ */ (0, J.jsx)("p", {
+ className: "text-body-2-regular text-text-secondary",
+ children: m.sites.map((e) => e.label).join("、")
+ })
+ }) : null,
+ m.problem ? /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "error",
+ children: m.problem
+ }) : /* @__PURE__ */ (0, J.jsxs)(g, { children: [
+ "已安装版本:",
+ m.installed_version || "未安装",
+ "。amane(",
+ m.license,
+ ")提供这些内置站点的解析能力。 重新安装会使用 Peach 内置的 ",
+ m.version,
+ " 版本,不随上游自动升级。"
+ ] }),
+ o ? /* @__PURE__ */ (0, J.jsx)(y, { label: "正在重建运行环境" }) : null,
+ v ? /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "error",
+ children: v
+ }) : null,
+ s?.status === "complete" ? /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "success",
+ children: s.result || "amane 桥已重建"
+ }) : null
+ ]
+ }),
+ /* @__PURE__ */ (0, J.jsxs)(h, { children: [/* @__PURE__ */ (0, J.jsx)(i, {
+ variant: "secondary",
+ onClick: () => {
+ _ || u.mutate();
+ },
+ ...k(u.isPending),
+ children: "检查上游版本"
+ }), /* @__PURE__ */ (0, J.jsx)(i, {
+ disabled: !!m.problem,
+ onClick: () => {
+ _ || c.mutate();
+ },
+ ...k(o || c.isPending),
+ children: m.installed ? "重新安装" : "安装"
+ })] })
+ ]
+ });
+}
+function xe({ toast: e }) {
+ let t = W({
+ queryKey: S,
+ queryFn: ({ signal: e }) => I(e)
+ }), n = t.data;
+ return n ? /* @__PURE__ */ (0, J.jsxs)(G, { children: [
+ /* @__PURE__ */ (0, J.jsx)("p", {
+ className: "text-body-2-regular text-text-secondary",
+ children: "高清图片可能要经代理才能下载,先检查连接。"
+ }),
+ /* @__PURE__ */ (0, J.jsx)(ye, { toast: e }),
+ /* @__PURE__ */ (0, J.jsx)(Y, { receipt: e }),
+ (n.sources || []).map((t) => /* @__PURE__ */ (0, J.jsx)(ve, {
+ source: t,
+ toast: e
+ }, t.source)),
+ /* @__PURE__ */ (0, J.jsx)(be, { toast: e })
+ ] }) : /* @__PURE__ */ (0, J.jsx)(G, { children: /* @__PURE__ */ (0, J.jsx)(b, {
+ tone: "error",
+ title: "采集来源读取失败",
+ children: t.error ? j(t.error) : "读取采集来源失败"
+ }) });
+}
+//#endregion
+export { xe as ScrapingPage, Q as linkHost, Z as networkOptions };
+
+//# debugId=daaf4ee8-3af3-47e9-ac67-d3b9a7c2692e
\ No newline at end of file
diff --git a/web/dist/peach-app.site-mark-C-FsZf9f.js b/web/dist/peach-app.site-mark-Cjd7g2Ii.js
similarity index 52%
rename from web/dist/peach-app.site-mark-C-FsZf9f.js
rename to web/dist/peach-app.site-mark-Cjd7g2Ii.js
index da9eb8a43..429af7bd0 100644
--- a/web/dist/peach-app.site-mark-C-FsZf9f.js
+++ b/web/dist/peach-app.site-mark-Cjd7g2Ii.js
@@ -1,12 +1,12 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "66035760-4b5b-4ff2-a9ad-92bfa29f35cc", e._sentryDebugIdIdentifier = "sentry-dbid-66035760-4b5b-4ff2-a9ad-92bfa29f35cc");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "5edae07f-4b9b-4d7d-960e-7db84a5595ee", e._sentryDebugIdIdentifier = "sentry-dbid-5edae07f-4b9b-4d7d-960e-7db84a5595ee");
} catch {}
})();
-import { $l as e, Po as t, cu as n, pu as r, qo as i, uu as a } from "./peach-app.js";
+import { __toESM as e, cc as t, require_jsx_runtime as n, require_react as r, s5 as i, siteMarkUrl as a } from "./peach-app.js";
//#region src/react/components/site-mark.tsx
-var o = /* @__PURE__ */ r(a(), 1), s = n(), c = "size-(--icon-inline) shrink-0";
+var o = /* @__PURE__ */ e(r(), 1), s = n(), c = "size-(--icon-inline) shrink-0";
function l({ src: e }) {
let [n, r] = (0, o.useState)("");
return !e || n === e ? /* @__PURE__ */ (0, s.jsx)(t, {
@@ -22,22 +22,22 @@ function l({ src: e }) {
className: `${c} rounded-none object-contain`
});
}
-function u({ source: t, linkId: n }) {
- if (t === "makers") return /* @__PURE__ */ (0, s.jsx)(i, {
+function u({ source: e, linkId: t }) {
+ if (e === "makers") return /* @__PURE__ */ (0, s.jsx)(i, {
"aria-hidden": !0,
className: c
});
- if (n === void 0 && !t) return /* @__PURE__ */ (0, s.jsx)(l, { src: "" });
- let r = t && [
+ if (t === void 0 && !e) return /* @__PURE__ */ (0, s.jsx)(l, { src: "" });
+ let n = e && [
"javten",
"fc2ppvdb",
"avwikidb",
"minnano-av",
"github"
- ].includes(t);
- return /* @__PURE__ */ (0, s.jsx)(l, { src: n === void 0 ? r ? `/site-icon/${t}.png` : e({ source: t }) : `/link-mark?id=${n}` });
+ ].includes(e);
+ return /* @__PURE__ */ (0, s.jsx)(l, { src: t === void 0 ? n ? `/site-icon/${e}.png` : a({ source: e }) : `/link-mark?id=${t}` });
}
//#endregion
-export { u as n, l as t };
+export { l as MarkImage, u as SiteMark };
-//# debugId=66035760-4b5b-4ff2-a9ad-92bfa29f35cc
\ No newline at end of file
+//# debugId=5edae07f-4b9b-4d7d-960e-7db84a5595ee
\ No newline at end of file
diff --git a/web/dist/peach-app.source-list-E8TH3X9X.js b/web/dist/peach-app.source-list-B2yIEqVl.js
similarity index 65%
rename from web/dist/peach-app.source-list-E8TH3X9X.js
rename to web/dist/peach-app.source-list-B2yIEqVl.js
index 6bd59cd78..e14c22e00 100644
--- a/web/dist/peach-app.source-list-E8TH3X9X.js
+++ b/web/dist/peach-app.source-list-B2yIEqVl.js
@@ -1,20 +1,20 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "ff24749c-b6de-462c-a663-c18042059274", e._sentryDebugIdIdentifier = "sentry-dbid-ff24749c-b6de-462c-a663-c18042059274");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "fbbba102-962e-4392-a972-cde790b4b949", e._sentryDebugIdIdentifier = "sentry-dbid-fbbba102-962e-4392-a972-cde790b4b949");
} catch {}
})();
-import { t as e } from "./peach-app.createPaginatedRowModel-Cb5ojTIu.js";
-import { $c as t, Ai as n, Bc as r, Bi as i, Bl as ee, Cl as te, El as ne, Eo as re, Gi as a, Gl as o, Hc as s, Ia as ie, Ic as c, Io as l, Jc as u, Ji as d, Kc as ae, La as f, Li as oe, Lo as se, Mc as ce, Mi as le, Ml as p, Ni as ue, Ol as de, Pi as fe, Ql as pe, Ra as me, Ri as he, Sc as m, Tl as ge, Uc as _e, Va as ve, Vi as ye, Vo as be, Wc as xe, Wi as h, Xa as g, Xc as Se, Yi as Ce, Z as we, Zc as Te, _a as Ee, _l as De, as as Oe, bl as ke, bo as Ae, cu as _, da as je, ec as Me, fs as v, gl as Ne, go as Pe, hl as Fe, ia as y, is as Ie, iu as b, ji as Le, jl as Re, kc as x, ll as S, mn as ze, na as Be, nc as C, ns as Ve, oo as He, pl as Ue, pu as We, qc as Ge, qi as w, rl as Ke, ro as T, rs as qe, so as E, to as Je, ts as Ye, uu as Xe, zi as Ze, zl as Qe } from "./peach-app.js";
-import { a as $e, i as et, n as tt, r as D, t as nt } from "./peach-app.source-view-DaRl5mr9.js";
+import { createPaginatedRowModel as e } from "./peach-app.createPaginatedRowModel-DKa1ysea.js";
+import { $76d00c5a4edb230a$export$76ccd210b9029917 as t, $76d00c5a4edb230a$export$816b5d811295e6bc as n, $76d00c5a4edb230a$export$b59bdbef9ce70de2 as r, $76d00c5a4edb230a$export$f6f0c3fe4ec306ea as i, $76d00c5a4edb230a$export$f850895b287ef28e as ee, $ea3928288112382f$export$439d29a4e110a164 as a, Button as o, Bx as te, COLUMN_SORT as s, Checkbox as c, ChevronSortDown as ne, CollapseChevron as re, CollapseRegion as l, DataTableFooter as ie, DataTableFrame as u, EmptyState as d, FOLLOW_CHECK_KEY as f, LAYOUTS as ae, M6 as oe, Note as p, SORT_DEFAULT_DIR as se, SORT_OPTIONS as ce, Select as le, SelectItem as ue, SelectionDock as de, SortDirectionIcon as fe, Switch as pe, Table as me, TableColumnControls as he, TableColumnResizer as ge, TableSelectionHeader as _e, TaskProgress as ve, Un as ye, __toESM as m, authorGroups as be, authorName as xe, busyProps as h, cardClass as Se, checkEvidenceGap as Ce, checkFailures as we, checkReceipt as Te, checkSummary as Ee, checkedText as De, clickedBlank as g, columnVisibilityFeature as Oe, confirmModal as _, createColumnHelper as ke, dZ as v, dropSources as Ae, du as je, errorHeadline as Me, errorMessage as y, fetchCheckJob as Ne, fetchPending as Pe, flexRender as Fe, isBroken as Ie, l7 as b, mapLimit as Le, markItem as Re, pageWindow as ze, patchSource as Be, reloadFollowManage as Ve, removeSource as He, require_jsx_runtime as x, require_react as S, rowPaginationFeature as C, rowSelectionFeature as Ue, rowSortingFeature as w, selectionState as We, setSourceEnabled as Ge, sortLabel as Ke, startCheck as qe, tableFeatures as Je, tableRows as Ye, toggleGroup as T, useBackgroundJob as Xe, useMutation as E, useTable as Ze, useTablePreferences as Qe } from "./peach-app.js";
+import { AuthorAvatar as $e, ErrorLine as et, SourceIcon as D, SourceLink as tt, StatusBadge as nt } from "./peach-app.source-view-Bk_L5GHG.js";
//#region src/react/follow-manage/source-list.tsx
-var O = /* @__PURE__ */ We(Xe(), 1), k = _(), rt = d({
- rowPaginationFeature: a,
- rowSelectionFeature: h,
- rowSortingFeature: ye,
- columnVisibilityFeature: w,
+var O = /* @__PURE__ */ m(S(), 1), k = x(), rt = Je({
+ rowPaginationFeature: C,
+ rowSelectionFeature: Ue,
+ rowSortingFeature: w,
+ columnVisibilityFeature: Oe,
paginatedRowModel: e()
-}), A = (e) => (Number(e) || 0).toLocaleString(), it = Object.fromEntries(Object.entries(x).map(([e, t]) => [t, e])), j = 740;
+}), A = (e) => (Number(e) || 0).toLocaleString(), it = Object.fromEntries(Object.entries(s).map(([e, t]) => [t, e])), j = 740;
function at() {
let [e, t] = (0, O.useState)(!1), n = (0, O.useRef)(null), r = (0, O.useCallback)((e) => {
if (n.current?.disconnect(), !e) {
@@ -49,10 +49,10 @@ function M({ source: e, selected: t, onToggle: n, handlers: r }) {
"data-follow-source-row": "",
className: "flex min-h-16 flex-wrap items-center gap-3 px-2 py-3 last:rounded-b-lg max-sm:gap-x-2",
onClick: (e) => {
- y(e, e.currentTarget) && n(!t);
+ g(e, e.currentTarget) && n(!t);
},
children: [
- /* @__PURE__ */ (0, k.jsx)(g, {
+ /* @__PURE__ */ (0, k.jsx)(c, {
isSelected: t,
onChange: n,
"aria-label": `选择 ${e.label}`
@@ -63,10 +63,10 @@ function M({ source: e, selected: t, onToggle: n, handlers: r }) {
"data-follow-source-site": "",
className: "flex shrink-0 items-center text-body-medium",
children: /* @__PURE__ */ (0, k.jsx)(D, { provider: e.provider })
- }), /* @__PURE__ */ (0, k.jsx)(et, { source: e })]
+ }), /* @__PURE__ */ (0, k.jsx)(tt, { source: e })]
}),
- /* @__PURE__ */ (0, k.jsx)(C, { children: e.provider_label }),
- /* @__PURE__ */ (0, k.jsx)($e, { source: e }),
+ /* @__PURE__ */ (0, k.jsx)(a, { children: e.provider_label }),
+ /* @__PURE__ */ (0, k.jsx)(nt, { source: e }),
e.last_error ? /* @__PURE__ */ (0, k.jsxs)("span", {
"data-follow-source-error": "",
className: "flex min-w-0 basis-full gap-3 max-sm:gap-x-2 sm:order-last",
@@ -80,7 +80,7 @@ function M({ source: e, selected: t, onToggle: n, handlers: r }) {
className: "w-(--icon-inline) shrink-0 text-body-medium"
}), /* @__PURE__ */ (0, k.jsx)("span", {
className: "min-w-0 grow",
- children: /* @__PURE__ */ (0, k.jsx)(tt, { text: e.last_error })
+ children: /* @__PURE__ */ (0, k.jsx)(et, { text: e.last_error })
})]
})]
}) : null,
@@ -90,9 +90,9 @@ function M({ source: e, selected: t, onToggle: n, handlers: r }) {
children: [
/* @__PURE__ */ (0, k.jsx)("span", {
className: "shrink-0 text-body-2-regular whitespace-nowrap text-text-secondary max-sm:mr-auto max-sm:text-caption-1-regular",
- children: u(e)
+ children: De(e)
}),
- /* @__PURE__ */ (0, k.jsx)(we, {
+ /* @__PURE__ */ (0, k.jsx)(pe, {
"aria-label": `启用 ${e.label}`,
isSelected: e.enabled,
isDisabled: r.readOnly,
@@ -100,20 +100,20 @@ function M({ source: e, selected: t, onToggle: n, handlers: r }) {
}),
/* @__PURE__ */ (0, k.jsxs)("span", {
className: "flex shrink-0 items-center gap-1",
- children: [/* @__PURE__ */ (0, k.jsx)(v, {
+ children: [/* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
iconOnly: !0,
- leadingIcon: l,
+ leadingIcon: v,
"aria-label": `检查 ${e.label} 的更新`,
disabled: !e.enabled || r.readOnly,
- ...T(r.busy),
+ ...h(r.busy),
onClick: () => r.check([e.id])
- }), /* @__PURE__ */ (0, k.jsx)(v, {
+ }), /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
iconOnly: !0,
- leadingIcon: Ae,
+ leadingIcon: oe,
"aria-label": `移除 ${e.label}`,
disabled: r.readOnly,
onClick: () => r.remove(e)
@@ -124,11 +124,11 @@ function M({ source: e, selected: t, onToggle: n, handlers: r }) {
]
});
}
-function ct({ group: e, name: t, open: n, selected: r, handlers: i, onOpen: ee, onToggleGroup: ne, onToggle: re }) {
- let a = e.map((e) => e.id), o = e.filter((e) => e.enabled).map((e) => e.id), s = e.filter(S).length, c = [...new Set(e.map((e) => e.provider_label || e.provider))].join("、"), u = `follow-author-${e[0].id}`, d = te(r, a);
+function ct({ group: e, name: t, open: n, selected: r, handlers: i, onOpen: ee, onToggleGroup: te, onToggle: s }) {
+ let c = e.map((e) => e.id), ne = e.filter((e) => e.enabled).map((e) => e.id), ie = e.filter(Ie).length, u = [...new Set(e.map((e) => e.provider_label || e.provider))].join("、"), d = `follow-author-${e[0].id}`, f = We(r, c);
return /* @__PURE__ */ (0, k.jsxs)("section", {
"aria-label": `${t} 的关注来源`,
- className: ve({
+ className: Se({
variant: "raised",
padding: "none",
className: "flex flex-col overflow-hidden p-2"
@@ -138,7 +138,7 @@ function ct({ group: e, name: t, open: n, selected: r, handlers: i, onOpen: ee,
"data-open": n || void 0,
className: "flex flex-wrap items-center gap-3 px-2 py-2.5",
children: [
- /* @__PURE__ */ (0, k.jsx)(nt, {
+ /* @__PURE__ */ (0, k.jsx)($e, {
group: e,
name: t
}),
@@ -150,13 +150,13 @@ function ct({ group: e, name: t, open: n, selected: r, handlers: i, onOpen: ee,
}), /* @__PURE__ */ (0, k.jsxs)("span", {
"data-follow-author-sites": "",
className: "flex min-w-0 flex-wrap items-center gap-1 text-body-2-regular",
- title: c,
+ title: u,
children: [
e.map((e) => /* @__PURE__ */ (0, k.jsx)(D, { provider: e.provider }, e.id)),
- /* @__PURE__ */ (0, k.jsx)(C, { children: `来源:${c}` }),
- s ? /* @__PURE__ */ (0, k.jsx)("span", {
+ /* @__PURE__ */ (0, k.jsx)(a, { children: `来源:${u}` }),
+ ie ? /* @__PURE__ */ (0, k.jsx)("span", {
className: "ml-1 shrink-0 text-text-error-primary",
- children: `${s} 个失败`
+ children: `${ie} 个失败`
}) : null
]
})]
@@ -164,31 +164,31 @@ function ct({ group: e, name: t, open: n, selected: r, handlers: i, onOpen: ee,
/* @__PURE__ */ (0, k.jsxs)("span", {
"data-follow-author-controls": "",
className: "flex flex-none items-center gap-2 max-sm:w-full max-sm:justify-end",
- children: [/* @__PURE__ */ (0, k.jsx)(v, {
+ children: [/* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
iconOnly: !0,
- leadingIcon: l,
+ leadingIcon: v,
"aria-label": `检查 ${t} 的全部来源`,
- disabled: !o.length || i.readOnly,
- ...T(i.busy),
- onClick: () => i.check(o)
+ disabled: !ne.length || i.readOnly,
+ ...h(i.busy),
+ onClick: () => i.check(ne)
}), /* @__PURE__ */ (0, k.jsxs)("span", {
className: "flex flex-none items-center gap-2",
- children: [/* @__PURE__ */ (0, k.jsx)(v, {
+ children: [/* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
- leadingIcon: be,
- "aria-pressed": d.all ? "true" : d.some ? "mixed" : "false",
- "aria-label": `${d.all ? "取消全选" : "全选"} ${t} 的来源`,
- onClick: () => ne(!d.all),
- children: d.all ? "取消全选" : "全选"
- }), /* @__PURE__ */ (0, k.jsx)(v, {
+ leadingIcon: b,
+ "aria-pressed": f.all ? "true" : f.some ? "mixed" : "false",
+ "aria-label": `${f.all ? "取消全选" : "全选"} ${t} 的来源`,
+ onClick: () => te(!f.all),
+ children: f.all ? "取消全选" : "全选"
+ }), /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
"aria-expanded": n,
- "aria-controls": u,
- leadingIcon: ie,
+ "aria-controls": d,
+ leadingIcon: re,
"aria-label": `${n ? "收起" : "展开"} ${t} 的来源`,
onClick: () => ee(!n),
children: n ? "收起" : "展开"
@@ -196,62 +196,62 @@ function ct({ group: e, name: t, open: n, selected: r, handlers: i, onOpen: ee,
})]
})
]
- }), /* @__PURE__ */ (0, k.jsx)(f, {
- id: u,
+ }), /* @__PURE__ */ (0, k.jsx)(l, {
+ id: d,
open: n,
"data-source-divider": !0,
children: e.map((e) => /* @__PURE__ */ (0, k.jsx)(M, {
source: e,
handlers: i,
selected: r.has(e.id),
- onToggle: (t) => re(e.id, t)
+ onToggle: (t) => s(e.id, t)
}, e.id))
})]
});
}
function lt(e) {
- let { data: a, sort: d, dir: f, page: ye, layout: be, pageSize: h, selected: _, readOnly: y, onSort: S, onPage: We, onLayout: w, onPageSize: Xe, onSelected: j, toast: M, openFollow: lt, onAdd: ut } = e, N = a.sources, P = (0, O.useMemo)(() => a.author_aliases || [], [a.author_aliases]), F = a.counts || {}, [I, dt] = (0, O.useState)(/* @__PURE__ */ new Set()), [ft, pt] = at(), [mt, L] = (0, O.useState)(""), R = (0, O.useMemo)(() => r(N, d, f, P), [
+ let { data: l, sort: m, dir: g, page: Oe, layout: Ie, pageSize: b, selected: x, readOnly: S, onSort: C, onPage: Ue, onLayout: w, onPageSize: Je, onSelected: j, toast: M, openFollow: lt, onAdd: ut } = e, N = l.sources, P = (0, O.useMemo)(() => l.author_aliases || [], [l.author_aliases]), F = l.counts || {}, [I, dt] = (0, O.useState)(/* @__PURE__ */ new Set()), [ft, pt] = at(), [mt, L] = (0, O.useState)(""), R = (0, O.useMemo)(() => be(N, m, g, P), [
N,
- d,
- f,
+ m,
+ g,
P
- ]), ht = (0, O.useMemo)(() => Re(R, d, f, P), [
+ ]), ht = (0, O.useMemo)(() => Ye(R, m, g, P), [
R,
- d,
- f,
+ m,
+ g,
P
- ]), { job: z, running: B, outcome: V, start: gt } = ze({
- queryKey: ce,
- queryFn: ({ signal: e }) => t(e),
- start: (e) => de(e),
- onError: (e) => L(o(e)),
+ ]), { job: z, running: B, outcome: V, start: gt } = Xe({
+ queryKey: f,
+ queryFn: ({ signal: e }) => Ne(e),
+ start: (e) => qe(e),
+ onError: (e) => L(y(e)),
onFinish: (e) => {
- De(), M(e.status === "failed" ? e.error || "检查失败" : ae(e));
+ Ve(), M(e.status === "failed" ? e.error || "检查失败" : Te(e));
}
}), H = (e) => {
B || gt.isPending || (L(""), gt.mutate(e));
- }, _t = (e, t) => j(p(_, [e], t)), vt = (e, t) => j(p(_, e, t)), yt = b({
- mutationFn: (e) => ke(e),
+ }, _t = (e, t) => j(T(x, [e], t)), vt = (e, t) => j(T(x, e, t)), yt = E({
+ mutationFn: (e) => He(e),
onSuccess: (e, t) => {
- Se([t]), j(p(_, [t], !1)), M("已取消关注来源");
+ Ae([t]), j(T(x, [t], !1)), M("已取消关注来源");
},
- onError: (e) => L(o(e))
- }), bt = b({
- mutationFn: (e) => ge(e.id, e.enabled),
+ onError: (e) => L(y(e))
+ }), bt = E({
+ mutationFn: (e) => Ge(e.id, e.enabled),
onSuccess: (e, t) => {
- Ne(t.id, { enabled: t.enabled }), L("");
+ Be(t.id, { enabled: t.enabled }), L("");
},
- onError: (e) => L(o(e))
- }), xt = (e) => void m({
+ onError: (e) => L(y(e))
+ }), xt = (e) => void _({
title: "取消关注来源",
body: "将移除这个来源及已抓取的条目,媒体文件保留。",
confirmLabel: "取消关注来源",
danger: !0,
onConfirm: () => yt.mutateAsync(e.id)
- }), U = b({
+ }), U = E({
mutationFn: async (e) => {
- let t = await pe(e.ids, 4, async (t) => {
- e.action === "remove" ? await ke(t) : await ge(t, e.action === "enabled");
+ let t = await Le(e.ids, 4, async (t) => {
+ e.action === "remove" ? await He(t) : await Ge(t, e.action === "enabled");
});
return {
...e,
@@ -260,35 +260,35 @@ function lt(e) {
};
},
onSuccess: (e) => {
- if (e.action === "remove") Se(e.done);
- else for (let t of e.done) Ne(t, { enabled: e.action === "enabled" });
- j(p(_, e.done, !1));
+ if (e.action === "remove") Ae(e.done);
+ else for (let t of e.done) Be(t, { enabled: e.action === "enabled" });
+ j(T(x, e.done, !1));
let t = e.results.filter((e) => !e.ok);
if (t.length) {
- L(`${t.length}/${e.ids.length} 个来源未更新:${o(t[0]?.error)}`);
+ L(`${t.length}/${e.ids.length} 个来源未更新:${y(t[0]?.error)}`);
return;
}
L("");
let n = e.action === "remove" ? "删除" : e.action === "enabled" ? "启用" : "暂停";
M(`已${n} ${e.done.length} 个关注来源`);
},
- onError: (e) => L(o(e))
- }), W = b({
+ onError: (e) => L(y(e))
+ }), W = E({
mutationFn: async (e) => {
- let t = ((await Ke()).groups || []).flatMap((e) => [
+ let t = ((await Pe()).groups || []).flatMap((e) => [
e.primary,
...e.variants,
...e.duplicates
]).filter((e) => e.status === "new").map((e) => e.id);
return {
ids: t,
- failed: (await pe(t, 6, (t) => Ue(t, e))).filter((e) => !e.ok)
+ failed: (await Le(t, 6, (t) => Re(t, e))).filter((e) => !e.ok)
};
},
onSuccess: (e) => {
- De(), e.failed.length ? L(`批量更新 ${e.failed.length}/${e.ids.length} 项未完成`) : (L(""), M(`已批量标记 ${e.ids.length} 项`));
+ Ve(), e.failed.length ? L(`批量更新 ${e.failed.length}/${e.ids.length} 项未完成`) : (L(""), M(`已批量标记 ${e.ids.length} 项`));
},
- onError: (e) => L(o(e))
+ onError: (e) => L(y(e))
}), St = (e, t) => bt.mutate({
id: e.id,
enabled: t
@@ -297,26 +297,26 @@ function lt(e) {
toggle: St,
remove: xt,
busy: !1,
- readOnly: y
+ readOnly: S
});
G.current = {
check: H,
toggle: St,
remove: xt,
busy: B || gt.isPending,
- readOnly: y
+ readOnly: S
};
let K = G.current, Ct = (0, O.useMemo)(() => {
- let e = Ce(), t = (e) => () => ot[e] || e;
+ let e = ke(), t = (e) => () => ot[e] || e;
return e.columns([
e.display({
id: "select",
- header: (e) => /* @__PURE__ */ (0, k.jsx)(n, {
+ header: (e) => /* @__PURE__ */ (0, k.jsx)(_e, {
table: e.table,
label: "全选本页来源",
page: !0
}),
- cell: (e) => /* @__PURE__ */ (0, k.jsx)(g, {
+ cell: (e) => /* @__PURE__ */ (0, k.jsx)(c, {
slot: null,
isSelected: e.row.getIsSelected(),
onChange: (t) => e.row.toggleSelected(t),
@@ -328,7 +328,7 @@ function lt(e) {
header: t("author"),
cell: (e) => /* @__PURE__ */ (0, k.jsxs)("span", {
className: "flex min-w-0 items-center gap-2",
- children: [/* @__PURE__ */ (0, k.jsx)(nt, {
+ children: [/* @__PURE__ */ (0, k.jsx)($e, {
group: e.row.original.group,
name: e.row.original.author
}), /* @__PURE__ */ (0, k.jsx)("span", {
@@ -342,7 +342,7 @@ function lt(e) {
header: t("source"),
cell: (e) => /* @__PURE__ */ (0, k.jsxs)("span", {
className: "flex min-w-0 flex-col gap-0.5",
- children: [/* @__PURE__ */ (0, k.jsx)(et, { source: e.row.original.source }), e.row.original.source.last_error ? /* @__PURE__ */ (0, k.jsx)(tt, { text: e.row.original.source.last_error }) : null]
+ children: [/* @__PURE__ */ (0, k.jsx)(tt, { source: e.row.original.source }), e.row.original.source.last_error ? /* @__PURE__ */ (0, k.jsx)(et, { text: e.row.original.source.last_error }) : null]
})
}),
e.accessor((e) => e.source.provider_label, {
@@ -356,12 +356,12 @@ function lt(e) {
e.display({
id: "status",
header: t("status"),
- cell: (e) => /* @__PURE__ */ (0, k.jsx)($e, { source: e.row.original.source })
+ cell: (e) => /* @__PURE__ */ (0, k.jsx)(nt, { source: e.row.original.source })
}),
e.accessor((e) => e.source.last_checked_at || "", {
id: "checked",
header: t("checked"),
- cell: (e) => u(e.row.original.source)
+ cell: (e) => De(e.row.original.source)
}),
e.display({
id: "actions",
@@ -369,27 +369,27 @@ function lt(e) {
cell: (e) => /* @__PURE__ */ (0, k.jsxs)("span", {
className: "flex items-center gap-1",
children: [
- /* @__PURE__ */ (0, k.jsx)(we, {
+ /* @__PURE__ */ (0, k.jsx)(pe, {
"aria-label": `启用 ${e.row.original.source.label}`,
isSelected: e.row.original.source.enabled,
isDisabled: K.readOnly,
onChange: (t) => G.current.toggle(e.row.original.source, t)
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
iconOnly: !0,
- leadingIcon: l,
+ leadingIcon: v,
"aria-label": `检查 ${e.row.original.source.label} 的更新`,
disabled: !e.row.original.source.enabled || K.readOnly,
- ...T(K.busy),
+ ...h(K.busy),
onClick: () => G.current.check([e.row.original.source.id])
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
iconOnly: !0,
- leadingIcon: Ae,
+ leadingIcon: oe,
"aria-label": `移除 ${e.row.original.source.label}`,
disabled: K.readOnly,
onClick: () => G.current.remove(e.row.original.source)
@@ -399,12 +399,12 @@ function lt(e) {
})
]);
}, [K]), q = (0, O.useMemo)(() => {
- let e = it[d];
+ let e = it[m];
return e ? [{
id: e,
- desc: f === "desc"
+ desc: g === "desc"
}] : [];
- }, [d, f]), wt = (0, O.useMemo)(() => Object.fromEntries([..._].map((e) => [String(e), !0])), [_]), J = be === "table", Y = ue("follow-sources", st), X = Fe(J ? ht.length : R.length, h, ye), Z = i({
+ }, [m, g]), wt = (0, O.useMemo)(() => Object.fromEntries([...x].map((e) => [String(e), !0])), [x]), J = Ie === "table", Y = Qe("follow-sources", st), X = ze(J ? ht.length : R.length, b, Oe), Z = Ze({
features: rt,
data: ht,
columns: Ct,
@@ -414,7 +414,7 @@ function lt(e) {
rowSelection: wt,
pagination: {
pageIndex: X.page - 1,
- pageSize: h
+ pageSize: b
},
columnVisibility: Y.visibility
},
@@ -424,8 +424,8 @@ function lt(e) {
onSortingChange: (e) => {
let t = (typeof e == "function" ? e(q) : e)[0];
if (!t) return;
- let n = x[t.id];
- n && S(n, t.desc ? "desc" : "asc");
+ let n = s[t.id];
+ n && C(n, t.desc ? "desc" : "asc");
},
onRowSelectionChange: (e) => {
let t = typeof e == "function" ? e(wt) : e;
@@ -434,13 +434,13 @@ function lt(e) {
onPaginationChange: (e) => {
let t = {
pageIndex: X.page - 1,
- pageSize: h
+ pageSize: b
}, n = typeof e == "function" ? e(t) : e;
- n.pageSize === h ? n.pageIndex !== t.pageIndex && We(n.pageIndex + 1) : Xe(n.pageSize);
+ n.pageSize === b ? n.pageIndex !== t.pageIndex && Ue(n.pageIndex + 1) : Je(n.pageSize);
}
- }), Tt = Z.getRowModel().rows, Et = J ? Tt.map((e) => e.original.source.id) : R.slice(X.start, X.end).flatMap((e) => e.map((e) => e.id)), Dt = te(_, Et), Q = [..._], Ot = xe(V), kt = N.filter((e) => e.enabled && (e.last_status === "error" || e.last_status === "unauthorized")).map((e) => e.id), At = _e(V), $ = R.length > 0 && I.size >= R.length;
+ }), Tt = Z.getRowModel().rows, Et = J ? Tt.map((e) => e.original.source.id) : R.slice(X.start, X.end).flatMap((e) => e.map((e) => e.id)), Dt = We(x, Et), Q = [...x], Ot = we(V), kt = N.filter((e) => e.enabled && (e.last_status === "error" || e.last_status === "unauthorized")).map((e) => e.id), At = Ce(V), $ = R.length > 0 && I.size >= R.length;
return N.length ? /* @__PURE__ */ (0, k.jsxs)("div", {
- className: ve({
+ className: Se({
padding: "none",
className: "flex flex-col gap-4 px-6 py-5 max-sm:px-4"
}),
@@ -463,20 +463,20 @@ function lt(e) {
"data-follow-toolbar-actions": "",
"data-toolbar-actions": "",
children: [
- kt.length ? /* @__PURE__ */ (0, k.jsx)(v, {
+ kt.length ? /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
- disabled: y,
- ...T(K.busy),
+ disabled: S,
+ ...h(K.busy),
onClick: () => H(kt),
children: "检查失败项"
}) : null,
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "primary",
- leadingIcon: l,
- disabled: y,
+ leadingIcon: v,
+ disabled: S,
"aria-label": "检查全部",
iconOnly: pt,
- ...T(K.busy),
+ ...h(K.busy),
onClick: () => H([]),
children: "检查全部"
}),
@@ -488,54 +488,54 @@ function lt(e) {
"data-button-group": !0,
role: "group",
"aria-label": "关注列表版式",
- children: [/* @__PURE__ */ (0, k.jsx)(v, {
+ children: [/* @__PURE__ */ (0, k.jsx)(o, {
variant: "ghost",
iconOnly: !0,
- leadingIcon: re,
- "aria-label": c[0][1],
+ leadingIcon: ye,
+ "aria-label": ae[0][1],
"aria-pressed": !J,
onClick: () => w("default")
- }), /* @__PURE__ */ (0, k.jsx)(v, {
+ }), /* @__PURE__ */ (0, k.jsx)(o, {
variant: "ghost",
iconOnly: !0,
- leadingIcon: se,
- "aria-label": c[1][1],
+ leadingIcon: je,
+ "aria-label": ae[1][1],
"aria-pressed": J,
onClick: () => w("table")
})]
}),
- J ? /* @__PURE__ */ (0, k.jsx)(Le, {
+ J ? /* @__PURE__ */ (0, k.jsx)(he, {
preferences: Y,
label: "关注来源"
}) : null,
/* @__PURE__ */ (0, k.jsxs)("span", {
className: "flex flex-none items-center gap-2",
- children: [/* @__PURE__ */ (0, k.jsx)(oe, {
+ children: [/* @__PURE__ */ (0, k.jsx)(le, {
"aria-label": "关注列表排序",
prefix: "排序",
- selectedKey: d,
+ selectedKey: m,
onSelectionChange: (e) => {
if (e === null) return;
let t = String(e);
- S(t, Qe[t]);
+ C(t, se[t]);
},
- children: ee.map(([e, t]) => /* @__PURE__ */ (0, k.jsx)(Ee, {
+ children: ce.map(([e, t]) => /* @__PURE__ */ (0, k.jsx)(ue, {
id: e,
children: t
}, e))
- }), /* @__PURE__ */ (0, k.jsx)(v, {
+ }), /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
iconOnly: !0,
- leadingIcon: je,
- "data-icon-state": f === "asc" ? "a" : "b",
- "aria-label": ne(d, f),
- onClick: () => S(d, f === "asc" ? "desc" : "asc")
+ leadingIcon: fe,
+ "data-icon-state": g === "asc" ? "a" : "b",
+ "aria-label": Ke(m, g),
+ onClick: () => C(m, g === "asc" ? "desc" : "asc")
})]
}),
- J ? null : /* @__PURE__ */ (0, k.jsx)(v, {
+ J ? null : /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
iconOnly: pt,
- leadingIcon: ie,
+ leadingIcon: re,
"aria-expanded": !$,
"aria-label": $ ? "全部展开" : "全部收起",
onClick: () => dt($ ? /* @__PURE__ */ new Set() : new Set(R.map((e) => String(e[0].author_key || e[0].id)))),
@@ -550,78 +550,78 @@ function lt(e) {
"aria-live": "polite",
className: "flex flex-col gap-3 empty:hidden",
children: [
- B ? /* @__PURE__ */ (0, k.jsx)(me, {
+ B ? /* @__PURE__ */ (0, k.jsx)(ve, {
embedded: !0,
label: z?.message || (z?.total ? `${z.older ? "抓取历史" : "检查更新"}:已完成 ${z.checked || 0}/${z.total} 个来源` : "正在准备检查任务"),
value: z?.checked,
total: z?.total
}) : null,
- mt ? /* @__PURE__ */ (0, k.jsx)(E, {
+ mt ? /* @__PURE__ */ (0, k.jsx)(p, {
tone: "error",
title: "操作未完成",
children: mt
}) : null,
- !B && V?.results?.length ? /* @__PURE__ */ (0, k.jsx)(E, {
+ !B && V?.results?.length ? /* @__PURE__ */ (0, k.jsx)(p, {
tone: "neutral",
title: "检查结果",
- children: Ge(V)
+ children: Ee(V)
}) : null,
- Ot.length ? /* @__PURE__ */ (0, k.jsx)(E, {
+ Ot.length ? /* @__PURE__ */ (0, k.jsx)(p, {
tone: "error",
title: `${Ot.length} 个来源检查失败`,
extra: /* @__PURE__ */ (0, k.jsx)("ul", {
className: "flex flex-col gap-0.5 text-body-2-regular",
- children: Ot.map((e, t) => /* @__PURE__ */ (0, k.jsx)("li", { children: `${e.provider_label || e.provider || ""} ${e.author || e.label || e.ref || ""}:${Te(e.error || "") || "未说明原因"}` }, `${e.provider || ""}-${e.ref || t}`))
+ children: Ot.map((e, t) => /* @__PURE__ */ (0, k.jsx)("li", { children: `${e.provider_label || e.provider || ""} ${e.author || e.label || e.ref || ""}:${Me(e.error || "") || "未说明原因"}` }, `${e.provider || ""}-${e.ref || t}`))
}),
children: "这些来源这一轮没有取到更新。"
}) : null,
- At ? /* @__PURE__ */ (0, k.jsx)(E, {
+ At ? /* @__PURE__ */ (0, k.jsx)(p, {
tone: "warning",
children: `条目已保存,但这次未保存来源的原始响应:${At}`
}) : null
]
}),
- /* @__PURE__ */ (0, k.jsxs)(Me, {
+ /* @__PURE__ */ (0, k.jsxs)(de, {
label: "关注来源批量操作",
visible: Q.length > 0,
count: `已选 ${Q.length} 个来源`,
children: [
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
- disabled: y,
- ...T(K.busy),
+ disabled: S,
+ ...h(K.busy),
onClick: () => H(Q),
children: "检查所选"
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
- disabled: y,
- ...T(U.isPending),
+ disabled: S,
+ ...h(U.isPending),
onClick: () => U.mutate({
ids: Q,
action: "enabled"
}),
children: "启用"
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
- disabled: y,
- ...T(U.isPending),
+ disabled: S,
+ ...h(U.isPending),
onClick: () => U.mutate({
ids: Q,
action: "paused"
}),
children: "暂停"
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "danger",
size: "small",
- disabled: y,
- ...T(U.isPending),
- onClick: () => void m({
+ disabled: S,
+ ...h(U.isPending),
+ onClick: () => void _({
title: `删除 ${Q.length} 个关注来源`,
body: "将移除所选关注来源及其已抓取条目,媒体文件保留。",
confirmLabel: "删除所选来源",
@@ -633,7 +633,7 @@ function lt(e) {
}),
children: "删除"
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "ghost",
size: "small",
onClick: () => j(/* @__PURE__ */ new Set()),
@@ -641,11 +641,11 @@ function lt(e) {
})
]
}),
- J ? /* @__PURE__ */ (0, k.jsx)(he, {
+ J ? /* @__PURE__ */ (0, k.jsx)(u, {
follow: !0,
preferences: Y,
- onRowClick: (e) => _t(Number(e), !_.has(Number(e))),
- children: /* @__PURE__ */ (0, k.jsxs)(Ze, {
+ onRowClick: (e) => _t(Number(e), !x.has(Number(e))),
+ children: /* @__PURE__ */ (0, k.jsxs)(me, {
"aria-label": "关注来源",
size: "sm",
sortDescriptor: q[0] ? {
@@ -656,41 +656,41 @@ function lt(e) {
id: String(e.column),
desc: e.direction === "descending"
}]),
- children: [/* @__PURE__ */ (0, k.jsxs)(Oe, { children: [Z.getHeaderGroups()[0].headers.map((e) => {
- let t = e.column.id in x, n = Be(e.column.columnDef.header, e.getContext());
- return /* @__PURE__ */ (0, k.jsx)(Ve, {
+ children: [/* @__PURE__ */ (0, k.jsxs)(ee, { children: [Z.getHeaderGroups()[0].headers.map((e) => {
+ let t = e.column.id in s, r = Fe(e.column.columnDef.header, e.getContext());
+ return /* @__PURE__ */ (0, k.jsx)(n, {
id: e.id,
allowsSorting: t,
isRowHeader: e.column.id === "source",
...Y.columnProps(e.id),
- children: ({ sortDirection: r }) => /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [e.id === "select" ? n : t ? /* @__PURE__ */ (0, k.jsxs)("span", {
+ children: ({ sortDirection: n }) => /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [e.id === "select" ? r : t ? /* @__PURE__ */ (0, k.jsxs)("span", {
className: "flex items-center gap-0.5",
- children: [n, /* @__PURE__ */ (0, k.jsx)("span", {
+ children: [r, /* @__PURE__ */ (0, k.jsx)("span", {
"data-sort-indicator": !0,
- "data-direction": r || void 0,
- children: /* @__PURE__ */ (0, k.jsx)(Je, {})
+ "data-direction": n || void 0,
+ children: /* @__PURE__ */ (0, k.jsx)(ne, {})
})]
- }) : /* @__PURE__ */ (0, k.jsx)(C, { children: n }), /* @__PURE__ */ (0, k.jsx)(le, {
+ }) : /* @__PURE__ */ (0, k.jsx)(a, { children: r }), /* @__PURE__ */ (0, k.jsx)(ge, {
preferences: Y,
id: e.id
})] })
}, e.id);
- }), /* @__PURE__ */ (0, k.jsx)(Ve, {
+ }), /* @__PURE__ */ (0, k.jsx)(n, {
id: "remaining-space",
"aria-label": "行空白区域",
"data-table-space": "",
width: Y.spaceWidth,
minWidth: 0
- })] }), /* @__PURE__ */ (0, k.jsx)(Ye, {
+ })] }), /* @__PURE__ */ (0, k.jsx)(t, {
renderEmptyState: () => "这一页没有来源",
- children: Tt.map((e) => /* @__PURE__ */ (0, k.jsxs)(qe, {
+ children: Tt.map((e) => /* @__PURE__ */ (0, k.jsxs)(r, {
id: e.id,
"data-follow-selected": e.getIsSelected() || void 0,
- children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, k.jsx)(Ie, { children: Be(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, k.jsx)(Ie, { "data-table-space": "" })]
+ children: [e.getVisibleCells().map((e) => /* @__PURE__ */ (0, k.jsx)(i, { children: Fe(e.column.columnDef.cell, e.getContext()) }, e.id)), /* @__PURE__ */ (0, k.jsx)(i, { "data-table-space": "" })]
}, e.id))
})]
})
- }) : /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(g, {
+ }) : /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(c, {
isSelected: Dt.all,
isIndeterminate: Dt.some,
onChange: (e) => vt(Et, e),
@@ -702,9 +702,9 @@ function lt(e) {
let t = String(e[0].author_key || e[0].id);
return /* @__PURE__ */ (0, k.jsx)(ct, {
group: e,
- name: s(e, P),
+ name: xe(e, P),
handlers: K,
- selected: _,
+ selected: x,
open: !I.has(t),
onOpen: (e) => {
let n = new Set(I);
@@ -715,17 +715,17 @@ function lt(e) {
}, t);
})
})] }),
- /* @__PURE__ */ (0, k.jsx)(fe, {
+ /* @__PURE__ */ (0, k.jsx)(ie, {
label: "关注列表",
total: X.total,
pagination: {
pageIndex: X.page - 1,
- pageSize: h
+ pageSize: b
},
unit: J ? "个来源" : "位创作者",
pageUnit: J ? "条" : "位",
onChange: (e) => {
- e.pageSize === h ? Z.setPageIndex(e.pageIndex) : Z.setPageSize(e.pageSize);
+ e.pageSize === b ? Z.setPageIndex(e.pageIndex) : Z.setPageSize(e.pageSize);
}
}),
F.new ? /* @__PURE__ */ (0, k.jsxs)("div", {
@@ -735,18 +735,18 @@ function lt(e) {
className: "mr-auto text-body-2-regular text-text-secondary",
children: `未看 ${A(F.new)} · 已看 ${A(F.seen)} · 已保存 ${A(F.saved)} · 已忽略 ${A(F.ignored)}`
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
onClick: lt,
children: "去看更新"
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
- disabled: y,
- ...T(W.isPending),
- onClick: () => void m({
+ disabled: S,
+ ...h(W.isPending),
+ onClick: () => void _({
title: "标记已看",
body: "将把当前未看作品标记为已看。",
confirmLabel: "标记已看",
@@ -754,12 +754,12 @@ function lt(e) {
}),
children: "全部标记已看"
}),
- /* @__PURE__ */ (0, k.jsx)(v, {
+ /* @__PURE__ */ (0, k.jsx)(o, {
variant: "secondary",
size: "small",
- disabled: y,
- ...T(W.isPending),
- onClick: () => void m({
+ disabled: S,
+ ...h(W.isPending),
+ onClick: () => void _({
title: "标记已忽略",
body: "将把当前未看作品标记为已忽略。",
confirmLabel: "标记已忽略",
@@ -770,10 +770,10 @@ function lt(e) {
]
}) : null
]
- }) : /* @__PURE__ */ (0, k.jsx)(He, {
- icon: Pe,
+ }) : /* @__PURE__ */ (0, k.jsx)(d, {
+ icon: te,
title: "还没有关注来源",
- actions: /* @__PURE__ */ (0, k.jsx)(v, {
+ actions: /* @__PURE__ */ (0, k.jsx)(o, {
variant: "primary",
size: "small",
onClick: ut,
@@ -783,6 +783,6 @@ function lt(e) {
});
}
//#endregion
-export { lt as t };
+export { lt as SourceList };
-//# debugId=ff24749c-b6de-462c-a663-c18042059274
\ No newline at end of file
+//# debugId=fbbba102-962e-4392-a972-cde790b4b949
\ No newline at end of file
diff --git a/web/dist/peach-app.source-view-DaRl5mr9.js b/web/dist/peach-app.source-view-Bk_L5GHG.js
similarity index 58%
rename from web/dist/peach-app.source-view-DaRl5mr9.js
rename to web/dist/peach-app.source-view-Bk_L5GHG.js
index a4cbe4ee2..4171a6107 100644
--- a/web/dist/peach-app.source-view-DaRl5mr9.js
+++ b/web/dist/peach-app.source-view-Bk_L5GHG.js
@@ -1,39 +1,39 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "8e1b92cb-2524-4248-8afe-7ba0bac337c2", e._sentryDebugIdIdentifier = "sentry-dbid-8e1b92cb-2524-4248-8afe-7ba0bac337c2");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "26255194-9b7b-4fe8-91cb-f5b6ebe493fa", e._sentryDebugIdIdentifier = "sentry-dbid-26255194-9b7b-4fe8-91cb-f5b6ebe493fa");
} catch {}
})();
-import { Al as e, Dl as t, Do as n, Vc as r, Zc as i, cu as a, fs as o, hn as s, ll as c, pu as l, uu as u, zc as d } from "./peach-app.js";
-import { t as f } from "./peach-app.site-mark-C-FsZf9f.js";
+import { Button as e, Chip as t, Wt as n, __toESM as r, authorAvatar as i, authorInitial as a, errorHeadline as o, isBroken as s, require_jsx_runtime as c, require_react as l, sourceIconUrl as u, statusText as d } from "./peach-app.js";
+import { MarkImage as f } from "./peach-app.site-mark-Cjd7g2Ii.js";
//#region src/react/follow-manage/source-view.tsx
-var p = /* @__PURE__ */ l(u(), 1), m = a();
+var p = /* @__PURE__ */ r(l(), 1), m = c();
function h({ provider: e }) {
- return /* @__PURE__ */ (0, m.jsx)(f, { src: t(e) });
+ return /* @__PURE__ */ (0, m.jsx)(f, { src: u(e) });
}
function g({ group: e, name: t }) {
- let { src: n, fallback: i } = d(e), [a, o] = (0, p.useState)(0), s = [n, i].filter(Boolean)[a];
- return s ? /* @__PURE__ */ (0, m.jsx)("img", {
- src: s,
+ let { src: n, fallback: r } = i(e), [o, s] = (0, p.useState)(0), c = [n, r].filter(Boolean)[o];
+ return c ? /* @__PURE__ */ (0, m.jsx)("img", {
+ src: c,
alt: "",
width: 32,
height: 32,
loading: "lazy",
referrerPolicy: "no-referrer",
- onError: () => o(a + 1),
+ onError: () => s(o + 1),
className: "size-8 shrink-0 rounded-full bg-background-tertiary-default object-cover"
}) : /* @__PURE__ */ (0, m.jsx)("span", {
title: "没有可用头像",
className: "inline-grid size-8 shrink-0 place-items-center rounded-full bg-background-tertiary-default text-caption-1-semibold text-text-secondary",
- children: r(t)
+ children: a(t)
});
}
-function _({ source: t }) {
- let n = !t.enabled || t.history_exhausted ? "gray" : c(t) ? "rose" : t.enabled && t.last_status === "ok" ? "lime" : t.enabled ? "yellow" : "gray";
- return /* @__PURE__ */ (0, m.jsx)(s, {
+function _({ source: e }) {
+ let n = !e.enabled || e.history_exhausted ? "gray" : s(e) ? "rose" : e.enabled && e.last_status === "ok" ? "lime" : e.enabled ? "yellow" : "gray";
+ return /* @__PURE__ */ (0, m.jsx)(t, {
variant: "caption",
color: n,
- children: e(t)
+ children: d(e)
});
}
function v({ source: e }) {
@@ -49,25 +49,25 @@ function v({ source: e }) {
})]
});
}
-function y({ text: e, prefix: t = "", tone: n = "error" }) {
- let r = (0, p.useRef)(null), [a, s] = (0, p.useState)(!1), [c, l] = (0, p.useState)(!1), u = i(e);
+function y({ text: t, prefix: n = "", tone: r = "error" }) {
+ let i = (0, p.useRef)(null), [a, s] = (0, p.useState)(!1), [c, l] = (0, p.useState)(!1), u = o(t);
(0, p.useLayoutEffect)(() => {
- let e = r.current;
+ let e = i.current;
if (!e || a) return;
let t = () => l(e.scrollWidth > e.clientWidth + 1);
t();
let n = new ResizeObserver(t);
return n.observe(e), () => n.disconnect();
}, [u, a]);
- let d = c || u !== String(e || "").trim();
+ let d = c || u !== String(t || "").trim();
return /* @__PURE__ */ (0, m.jsxs)("span", {
className: "flex min-w-0 max-w-full flex-col items-start gap-0.5",
children: [/* @__PURE__ */ (0, m.jsxs)("small", {
- ref: r,
+ ref: i,
"data-error-line": "",
- className: `max-w-full text-caption-1-regular ${n === "error" ? "text-text-error-primary" : "text-text-secondary"} ${a ? "whitespace-pre-line wrap-anywhere" : "block truncate"}`,
- children: [t, a ? e : u]
- }), d ? /* @__PURE__ */ (0, m.jsx)(o, {
+ className: `max-w-full text-caption-1-regular ${r === "error" ? "text-text-error-primary" : "text-text-secondary"} ${a ? "whitespace-pre-line wrap-anywhere" : "block truncate"}`,
+ children: [n, a ? t : u]
+ }), d ? /* @__PURE__ */ (0, m.jsx)(e, {
variant: "ghost",
size: "small",
"data-error-line-toggle": "",
@@ -80,6 +80,6 @@ function y({ text: e, prefix: t = "", tone: n = "error" }) {
});
}
//#endregion
-export { _ as a, v as i, y as n, h as r, g as t };
+export { g as AuthorAvatar, y as ErrorLine, h as SourceIcon, v as SourceLink, _ as StatusBadge };
-//# debugId=8e1b92cb-2524-4248-8afe-7ba0bac337c2
\ No newline at end of file
+//# debugId=26255194-9b7b-4fe8-91cb-f5b6ebe493fa
\ No newline at end of file
diff --git a/web/dist/peach-app.stat-card-8t4QGU2C.js b/web/dist/peach-app.stat-card-Q_AB9v0S.js
similarity index 89%
rename from web/dist/peach-app.stat-card-8t4QGU2C.js
rename to web/dist/peach-app.stat-card-Q_AB9v0S.js
index 6234c7ace..ae1770c31 100644
--- a/web/dist/peach-app.stat-card-8t4QGU2C.js
+++ b/web/dist/peach-app.stat-card-Q_AB9v0S.js
@@ -1,10 +1,10 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "8cb76850-ebc8-4e28-918a-f38dd776dc7e", e._sentryDebugIdIdentifier = "sentry-dbid-8cb76850-ebc8-4e28-918a-f38dd776dc7e");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "aec72817-ff19-477c-a97a-e89d8b02fa4f", e._sentryDebugIdIdentifier = "sentry-dbid-aec72817-ff19-477c-a97a-e89d8b02fa4f");
} catch {}
})();
-import { Va as e, cu as t } from "./peach-app.js";
+import { cardClass as e, require_jsx_runtime as t } from "./peach-app.js";
//#region src/react/components/stat-card.tsx
var n = t(), r = [
"text-chart-6",
@@ -93,6 +93,6 @@ function d({ label: e, icon: t, accent: a = 0, figure: o, footer: s }) {
] });
}
//#endregion
-export { d as a, s as i, u as n, c as o, o as r, a as s, l as t };
+export { l as PLAIN_STAT_STRIP, u as PlainStat, o as STAT_STRIP, s as STAT_STRIP_SIX, d as StatCard, c as plainStatClass, a as statCardClass };
-//# debugId=8cb76850-ebc8-4e28-918a-f38dd776dc7e
\ No newline at end of file
+//# debugId=aec72817-ff19-477c-a97a-e89d8b02fa4f
\ No newline at end of file
diff --git a/web/dist/peach-app.stats-page-BDw9YdMH.js b/web/dist/peach-app.stats-page-Dl0lm7Yt.js
similarity index 63%
rename from web/dist/peach-app.stats-page-BDw9YdMH.js
rename to web/dist/peach-app.stats-page-Dl0lm7Yt.js
index 0a253cf28..e1e64fd71 100644
--- a/web/dist/peach-app.stats-page-BDw9YdMH.js
+++ b/web/dist/peach-app.stats-page-Dl0lm7Yt.js
@@ -1,26 +1,26 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e9dff2b2-ed62-44e7-bc4b-3bb6f0b39255", e._sentryDebugIdIdentifier = "sentry-dbid-e9dff2b2-ed62-44e7-bc4b-3bb6f0b39255");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "82936c02-5b67-4889-8313-b4254447f6e3", e._sentryDebugIdIdentifier = "sentry-dbid-82936c02-5b67-4889-8313-b4254447f6e3");
} catch {}
})();
-import { A as e, At as t, Bt as n, C as r, Ct as i, D as a, Dt as o, Et as s, Ft as c, G as l, Gt as u, H as d, Ht as f, I as p, J as m, Jt as h, K as g, Kt as _, L as v, Lt as y, M as b, Mt as x, N as S, Nt as C, O as w, Ot as T, Pt as E, R as ee, Rt as D, S as te, St as O, T as ne, Ut as re, Vt as ie, W as ae, Wt as oe, X as se, Xt as ce, Y as le, Z as ue, _t as de, an as fe, at as pe, b as me, bt as he, c as ge, cn as _e, ct as ve, en as ye, gt as be, h as xe, ht as k, i as A, in as Se, it as Ce, j as we, jt as Te, k as Ee, kt as De, ln as Oe, lt as ke, m as Ae, mt as je, n as Me, nn as j, nt as Ne, o as Pe, on as M, pt as Fe, q as Ie, qt as Le, rn as Re, rt as ze, s as Be, t as Ve, tn as He, tt as Ue, u as We, v as Ge, vt as Ke, w as qe, x as Je, xt as Ye, y as Xe, yt as Ze, z as Qe } from "./peach-app.expandable-ranking-BW8Gp_lx.js";
-import { $o as $e, A as N, Ao as et, B as tt, D as nt, F as rt, Gl as it, H as at, I as ot, Ja as st, Kl as ct, Kt as lt, L as ut, M as dt, N as ft, O as pt, Oo as mt, P as ht, Qo as P, R as gt, Tc as _t, U as vt, Uo as yt, V as bt, Va as xt, W as St, Yo as Ct, Zl as F, Zo as I, au as wt, cu as Tt, es as Et, fa as L, ha as Dt, j as R, ja as Ot, jo as kt, k as At, oo as z, pa as jt, ps as B, pu as Mt, rc as Nt, so as Pt, uu as Ft, xo as It, z as Lt, za as V } from "./peach-app.js";
-import { t as Rt } from "./peach-app.page-BYr6f5ud.js";
-import { a as zt, r as Bt, s as Vt } from "./peach-app.stat-card-8t4QGU2C.js";
-import { t as Ht } from "./peach-app.connection-status-Pa6aDai7.js";
+import { ActivityHeat as e, AnimatedItems as t, BarCard as n, CHART_CARD as r, CHART_COLORS as i, Cell as a, ChartBackground as o, ChartContainer as s, ChartEmpty as c, ChartLegend as l, ChartLegendContent as u, ChartTip as d, ChartTooltip as f, ChartTooltipContent as p, DefaultZIndexes as m, ExpandableRanking as h, LabelListFromLabelProp as g, Layer as _, LoadingIndicator as v, PolarAngleAxis as y, PolarChart as b, PolarLabelListContextProvider as x, RegisterGraphicalItemId as S, Sector as C, SetPolarGraphicalItem as w, SetPolarLegendPayload as T, SetTooltipEntrySettings as E, Shape as ee, ZIndexLayer as D, adaptEventsOfChild as O, arrayTooltipSearcher as te, combineAllBarPositions as ne, combineBarPosition as re, combineBarSizeList as ie, combineDisplayedStackedData as ae, combineStackGroups as oe, combineStackedData as se, createSelector as k, defaultPolarChartProps as ce, findAllByType as le, getBandSizeOfAxis as A, getBaseValueOfBar as ue, getCateCoordinateOfBar as de, getColorsCount as fe, getNormalizedStackId as pe, getTooltipNameProp as me, getValueByDataKey as he, getZIndexFromUnknown as ge, interpolate as _e, isCategoricalAxis as ve, isNullish as ye, isStacked as be, matchAppend as xe, mathSign as Se, noop as Ce, resolveDefaultProps as we, selectActiveTooltipIndex as Te, selectAngleAxis as Ee, selectBarCategoryGap as De, selectBarGap as Oe, selectChartDataAndAlwaysIgnoreIndexes as ke, selectChartDataWithIndexes as Ae, selectChartLayout as j, selectPolarAxisScale as je, selectPolarAxisTicks as Me, selectPolarGraphicalItemAxisTicks as Ne, selectPolarItemsSettings as Pe, selectPolarViewBox as Fe, selectRadiusAxis as Ie, selectReverseStackOrder as Le, selectRootBarSize as Re, selectRootMaxBarSize as ze, selectStackOffsetType as Be, selectTooltipAxis as Ve, selectUnfilteredPolarItems as He, sliceConfig as Ue, sliceKey as We, svgPropertiesNoEvents as Ge, svgPropertiesNoEventsFromUnknown as Ke, truncateByDomain as qe, useAnimationCallbacks as Je, useAppSelector as M, useMouseClickItemDispatch as Ye, useMouseEnterItemDispatch as Xe, useMouseLeaveItemDispatch as Ze, usePolarChartLayout as Qe } from "./peach-app.expandable-ranking-CyDn34Ar.js";
+import { $b4f18e3395fe64d7$export$3d96ec278d3efce4 as N, $b4f18e3395fe64d7$export$3e41faf802a29e71 as P, $b4f18e3395fe64d7$export$b2539bed5023c21c as $e, $b4f18e3395fe64d7$export$e51a686c67fdaa2d as et, ButtonLink as F, EmptyState as I, LOC as tt, MEDIA_SOURCE_ICONS as nt, NR as rt, Note as it, Progress as L, SEGMENT as at, SEGMENTED_TRACK as ot, STATS_KEY as st, SegmentedTabList as ct, SourceMark as lt, StatusLabel as ut, Xc as dt, Xt as ft, _8 as pt, __toESM as mt, bandRows as ht, cardClass as gt, clsx as _t, errorMessage as vt, fetchStats as yt, fmtCount as R, fmtSize as z, known as bt, lengthRows as xt, mM as St, mediumRows as Ct, percentText as wt, playedFor as Tt, playedItemUrl as Et, radialArc as Dt, radialBarSize as Ot, radialCeiling as kt, radialSlices as At, reachedShare as jt, replayRows as Mt, require_jsx_runtime as Nt, require_react as Pt, settingsPath as Ft, uo as It, useQuery as Lt, watchNote as Rt, watchedShare as zt } from "./peach-app.js";
+import { Page as Bt } from "./peach-app.page-Irl_Wogd.js";
+import { STAT_STRIP as Vt, StatCard as Ht, statCardClass as Ut } from "./peach-app.stat-card-Q_AB9v0S.js";
+import { ConnectionStatus as Wt } from "./peach-app.connection-status-BP0ylxDH.js";
//#region node_modules/recharts/es6/util/RadialBarUtils.js
-var H = /* @__PURE__ */ Mt(Ft()), Ut = ["option"];
-function Wt(e, t) {
+var B = /* @__PURE__ */ mt(Pt()), Gt = ["option"];
+function Kt(e, t) {
if (e == null) return {};
- var n, r, i = Gt(e, t);
+ var n, r, i = qt(e, t);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
}
return i;
}
-function Gt(e, t) {
+function qt(e, t) {
if (e == null) return {};
var n = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -29,21 +29,21 @@ function Gt(e, t) {
}
return n;
}
-var Kt = c;
-function qt(e) {
+var Jt = C;
+function Yt(e) {
return typeof e == "string" ? parseInt(e, 10) : e;
}
-function Jt(e) {
- var t = e.option, n = Wt(e, Ut);
- return /*#__PURE__*/ H.createElement(le, {
+function Xt(e) {
+ var t = e.option, n = Kt(e, Gt);
+ return /*#__PURE__*/ B.createElement(ee, {
option: t,
- DefaultShape: Kt,
+ DefaultShape: Jt,
shapeProps: n
});
}
//#endregion
//#region node_modules/recharts/es6/state/selectors/radialBarSelectors.js
-function Yt(e, t) {
+function Zt(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
@@ -53,30 +53,30 @@ function Yt(e, t) {
}
return n;
}
-function U(e) {
+function V(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t];
- t % 2 ? Yt(Object(n), !0).forEach(function(t) {
- Xt(e, t, n[t]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Yt(Object(n)).forEach(function(t) {
+ t % 2 ? Zt(Object(n), !0).forEach(function(t) {
+ Qt(e, t, n[t]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Zt(Object(n)).forEach(function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
});
}
return e;
}
-function Xt(e, t, n) {
- return (t = Zt(t)) in e ? Object.defineProperty(e, t, {
+function Qt(e, t, n) {
+ return (t = $t(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
-function Zt(e) {
- var t = Qt(e, "string");
+function $t(e) {
+ var t = en(e, "string");
return typeof t == "symbol" ? t : t + "";
}
-function Qt(e, t) {
+function en(e, t) {
if (typeof e != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
@@ -86,73 +86,73 @@ function Qt(e, t) {
}
return (t === "string" ? String : Number)(e);
}
-var W = h([(e, t) => i(e, t), (e, t) => Ue(e, "radiusAxis", t)], (e, t) => {
- if (e != null && t != null) return U(U({}, e), {}, { scale: t });
-}), $t = (e, t) => ze(e, "radiusAxis", t, !1), G = h([(e, t, n) => Ye(e, n), (e, t, n) => Ue(e, "angleAxis", n)], (e, t) => {
- if (e != null && t != null) return U(U({}, e), {}, { scale: t });
-}), en = (e, t, n) => Ne(e, "angleAxis", n, !1), tn = h([pe, (e, t, n, r) => r], (e, t) => {
+var H = k([(e, t) => Ie(e, t), (e, t) => je(e, "radiusAxis", t)], (e, t) => {
+ if (e != null && t != null) return V(V({}, e), {}, { scale: t });
+}), tn = (e, t) => Ne(e, "radiusAxis", t, !1), U = k([(e, t, n) => Ee(e, n), (e, t, n) => je(e, "angleAxis", n)], (e, t) => {
+ if (e != null && t != null) return V(V({}, e), {}, { scale: t });
+}), W = (e, t, n) => Me(e, "angleAxis", n, !1), G = k([He, (e, t, n, r) => r], (e, t) => {
if (e.some((e) => e.type === "radialBar" && t.dataKey === e.dataKey && t.stackId === e.stackId)) return t;
-}), nn = h([
- y,
- W,
- $t,
- G,
- en
-], (e, t, r, i, a) => _(e, "radiusAxis") ? n(t, r, !1) : n(i, a, !1)), rn = h([
- G,
- W,
- y
+}), nn = k([
+ j,
+ H,
+ tn,
+ U,
+ W
+], (e, t, n, r, i) => ve(e, "radiusAxis") ? A(t, n, !1) : A(r, i, !1)), rn = k([
+ U,
+ H,
+ j
], (e, t, n) => {
var r = n === "radial" ? e : t;
- if (r != null && r.scale != null) return ie({ numericAxis: r });
-}), an = (e, t, n, r, i) => i, on = (e, t, n, r, i) => n, sn = (e, t, n, r, i) => t, cn = (e, t, n, r, i) => r.maxBarSize, ln = (e) => e.type === "radialBar", un = h([
- y,
- pe,
+ if (r != null && r.scale != null) return ue({ numericAxis: r });
+}), an = (e, t, n, r, i) => i, on = (e, t, n, r, i) => n, sn = (e, t, n, r, i) => t, cn = (e, t, n, r, i) => r.maxBarSize, ln = (e) => e.type === "radialBar", un = k([
+ j,
+ He,
on,
sn
-], (e, t, n, r) => t.filter((t) => e === "centric" ? t.angleAxisId === n : t.radiusAxisId === r).filter((e) => e.hide === !1).filter(ln)), dn = h([
+], (e, t, n, r) => t.filter((t) => e === "centric" ? t.angleAxisId === n : t.radiusAxisId === r).filter((e) => e.hide === !1).filter(ln)), dn = k([
un,
- t,
+ Re,
() => void 0
-], S), fn = h([
- y,
- Te,
- G,
- en,
+], ie), fn = k([
+ j,
+ ze,
+ U,
W,
- $t,
+ H,
+ tn,
cn
-], (e, t, r, i, a, o, s) => {
- var c = Re(s) ? t : s;
- return e === "centric" ? n(r, i, !0) ?? c ?? 0 : n(a, o, !0) ?? c ?? 0;
-}), pn = h([
+], (e, t, n, r, i, a, o) => {
+ var s = ye(o) ? t : o;
+ return e === "centric" ? A(n, r, !0) ?? s ?? 0 : A(i, a, !0) ?? s ?? 0;
+}), pn = k([
dn,
- Te,
- T,
- o,
+ ze,
+ Oe,
+ De,
fn,
nn,
cn
-], b), mn = h([pn, tn], e), hn = h([Ce], (e) => e.filter(ln).filter(Ze)), gn = h([
+], ne), mn = k([pn, G], re), hn = k([Pe], (e) => e.filter(ln).filter(be)), gn = k([
hn,
- C,
- Ke
-], he), _n = h([
+ ke,
+ Ve
+], ae), _n = k([
gn,
hn,
- x,
- De
-], de), vn = h([(e, t, n) => y(e) === "centric" ? _n(e, "radiusAxis", t) : _n(e, "angleAxis", n), tn], we), yn = h([
- G,
- en,
+ Be,
+ Le
+], oe), vn = k([(e, t, n) => j(e) === "centric" ? _n(e, "radiusAxis", t) : _n(e, "angleAxis", n), G], se), yn = k([
+ U,
W,
- $t,
- E,
+ H,
tn,
+ Ae,
+ G,
nn,
- y,
+ j,
rn,
- O,
+ Fe,
an,
mn,
vn
@@ -181,7 +181,7 @@ var W = h([(e, t) => i(e, t), (e, t) => Ue(e, "radiusAxis", t)], (e, t) => {
stackedDomain: f ? (s === "centric" ? n : e).scale.domain() : null,
startAngle: b
});
-}), bn = h([C, (e, t) => t], (e, t) => {
+}), bn = k([ke, (e, t) => t], (e, t) => {
var n = e.chartData, r = e.dataStartIndex, i = e.dataEndIndex;
if (n == null) return [];
var a = n.slice(r, i + 1);
@@ -289,126 +289,126 @@ function jn(e) {
},
fill: e.fill
}));
- return /*#__PURE__*/ H.createElement(ke, { value: t ? i : void 0 }, r);
+ return /*#__PURE__*/ B.createElement(x, { value: t ? i : void 0 }, r);
}
function Mn(e) {
- var t = e.sectors, n = e.allOtherRadialBarProps, r = e.showLabels, i = e.animationElapsedTime, a = e.isAnimating, o = e.isEntrance, c = n.shape, l = n.activeShape, u = n.cornerRadius, d = n.id, f = On(n, xn), p = _e(f), h = ce(be), _ = n.onMouseEnter, v = n.onClick, y = n.onMouseLeave, b = On(n, Sn), x = Ie(_, n.dataKey, d), S = m(y), C = g(v, n.dataKey, d);
- return t == null ? null : /*#__PURE__*/ H.createElement(jn, {
+ var t = e.sectors, n = e.allOtherRadialBarProps, r = e.showLabels, i = e.animationElapsedTime, a = e.isAnimating, o = e.isEntrance, s = n.shape, c = n.activeShape, l = n.cornerRadius, u = n.id, d = On(n, xn), f = Ge(d), p = M(Te), h = n.onMouseEnter, _ = n.onClick, v = n.onMouseLeave, y = On(n, Sn), b = Xe(h, n.dataKey, u), x = Ze(v), S = Ye(_, n.dataKey, u);
+ return t == null ? null : /*#__PURE__*/ B.createElement(jn, {
showLabels: r,
sectors: t
}, t.map((e, t) => {
- var n = !!(l && h === String(t)), r = x(e, t), d = S(e, t), m = C(e, t), g = q(q(q(q({}, p), {}, { cornerRadius: qt(u) }, e), He(b, e, t)), {}, {
+ var n = !!(c && p === String(t)), r = b(e, t), u = x(e, t), h = S(e, t), g = q(q(q(q({}, f), {}, { cornerRadius: Yt(l) }, e), O(y, e, t)), {}, {
onMouseEnter: r,
- onMouseLeave: d,
- onClick: m,
+ onMouseLeave: u,
+ onClick: h,
className: `recharts-radial-bar-sector ${e.className}`,
- forceCornerRadius: f.forceCornerRadius,
- cornerIsExternal: f.cornerIsExternal,
+ forceCornerRadius: d.forceCornerRadius,
+ cornerIsExternal: d.cornerIsExternal,
animationElapsedTime: i,
isAnimating: a,
isEntrance: o,
isActive: n,
- option: n && l != null ? l : c,
+ option: n && c != null ? c : s,
index: t
});
- return n ? /*#__PURE__*/ H.createElement(k, {
- zIndex: s.activeBar,
+ return n ? /*#__PURE__*/ B.createElement(D, {
+ zIndex: m.activeBar,
key: `sector-${e.cx}-${e.cy}-${e.innerRadius}-${e.outerRadius}-${e.startAngle}-${e.endAngle}-${t}`
- }, /*#__PURE__*/ H.createElement(Jt, g)) : /*#__PURE__*/ H.createElement(Jt, K({ key: `sector-${e.cx}-${e.cy}-${e.innerRadius}-${e.outerRadius}-${e.startAngle}-${e.endAngle}-${t}` }, g));
- }), /*#__PURE__*/ H.createElement(ve, { label: n.label }), n.children);
+ }, /*#__PURE__*/ B.createElement(Xt, g)) : /*#__PURE__*/ B.createElement(Xt, K({ key: `sector-${e.cx}-${e.cy}-${e.innerRadius}-${e.outerRadius}-${e.startAngle}-${e.endAngle}-${t}` }, g));
+ }), /*#__PURE__*/ B.createElement(g, { label: n.label }), n.children);
}
var Nn = (e, t) => e == null ? [] : t === 1 ? e.flatMap((e) => e.status === "removed" ? [] : [e.next]) : e.flatMap((e) => e.status === "removed" ? [] : e.status === "matched" ? [q(q({}, e.next), {}, {
- startAngle: j(e.prev.startAngle, e.next.startAngle, t),
- endAngle: j(e.prev.endAngle, e.next.endAngle, t)
-})] : [q(q({}, e.next), {}, { endAngle: j(e.next.startAngle, e.next.endAngle, t) })]);
+ startAngle: _e(e.prev.startAngle, e.next.startAngle, t),
+ endAngle: _e(e.prev.endAngle, e.next.endAngle, t)
+})] : [q(q({}, e.next), {}, { endAngle: _e(e.next.startAngle, e.next.endAngle, t) })]);
function Pn(e) {
- var t = e.props, n = e.previousSectorsRef, r = t.sectors, i = t.isAnimationActive, a = t.animationBegin, o = t.animationDuration, s = t.animationEasing, c = t.onAnimationStart, l = t.onAnimationEnd, u = Qe(c, l), d = u.isAnimating, f = u.handleAnimationStart, p = u.handleAnimationEnd, m = D();
- return m == null ? null : /*#__PURE__*/ H.createElement(ee, {
- animationInput: t,
+ var n = e.props, r = e.previousSectorsRef, i = n.sectors, a = n.isAnimationActive, o = n.animationBegin, s = n.animationDuration, c = n.animationEasing, l = n.onAnimationStart, u = n.onAnimationEnd, d = Je(l, u), f = d.isAnimating, p = d.handleAnimationStart, m = d.handleAnimationEnd, h = Qe();
+ return h == null ? null : /*#__PURE__*/ B.createElement(t, {
+ animationInput: n,
animationIdPrefix: "recharts-radialbar-",
- items: r,
- previousItemsRef: n,
- isAnimationActive: i,
- animationBegin: a,
- animationDuration: o,
- animationEasing: s,
- onAnimationStart: f,
- onAnimationEnd: p,
- animationInterpolateFn: t.animationInterpolateFn,
- animationMatchBy: t.animationMatchBy,
- layout: m
- }, (e, n, r) => /*#__PURE__*/ H.createElement(Mn, {
+ items: i,
+ previousItemsRef: r,
+ isAnimationActive: a,
+ animationBegin: o,
+ animationDuration: s,
+ animationEasing: c,
+ onAnimationStart: p,
+ onAnimationEnd: m,
+ animationInterpolateFn: n.animationInterpolateFn,
+ animationMatchBy: n.animationMatchBy,
+ layout: h
+ }, (e, t, r) => /*#__PURE__*/ B.createElement(Mn, {
sectors: e,
- allOtherRadialBarProps: t,
- showLabels: !d,
- animationElapsedTime: n,
- isAnimating: d || n < 1,
+ allOtherRadialBarProps: n,
+ showLabels: !f,
+ animationElapsedTime: t,
+ isAnimating: f || t < 1,
isEntrance: r
}));
}
function Fn(e) {
- var t = (0, H.useRef)(null);
- return /*#__PURE__*/ H.createElement(Pn, {
+ var t = (0, B.useRef)(null);
+ return /*#__PURE__*/ B.createElement(Pn, {
props: e,
previousSectorsRef: t
});
}
function In(e) {
- var t = ce((t) => bn(t, e.legendType));
- return /*#__PURE__*/ H.createElement(ae, { legendPayload: t ?? [] });
+ var t = M((t) => bn(t, e.legendType));
+ return /*#__PURE__*/ B.createElement(T, { legendPayload: t ?? [] });
}
-var Ln = /*#__PURE__*/ H.memo((e) => {
- var t = e.dataKey, n = e.sectors, r = e.stroke, i = e.strokeWidth, a = e.name, o = e.hide, s = e.fill, c = e.tooltipType, u = e.formatter, d = e.id, f = {
+var Ln = /*#__PURE__*/ B.memo((e) => {
+ var t = e.dataKey, n = e.sectors, r = e.stroke, i = e.strokeWidth, a = e.name, o = e.hide, s = e.fill, c = e.tooltipType, l = e.formatter, u = e.id, d = {
dataDefinedOnItem: n,
- getPosition: fe,
+ getPosition: Ce,
settings: {
- graphicalItemId: d,
+ graphicalItemId: u,
stroke: r,
strokeWidth: i,
fill: s,
nameKey: void 0,
dataKey: t,
- name: oe(a, t),
+ name: me(a, t),
hide: o,
type: c,
color: s,
unit: "",
- formatter: u
+ formatter: l
}
};
- return /*#__PURE__*/ H.createElement(l, { tooltipEntrySettings: f });
-}), Rn = class extends H.PureComponent {
+ return /*#__PURE__*/ B.createElement(E, { tooltipEntrySettings: d });
+}), Rn = class extends B.PureComponent {
renderBackground(e) {
if (e == null) return null;
- var t = this.props.cornerRadius, n = Oe(this.props.background);
- return /*#__PURE__*/ H.createElement(k, { zIndex: Ee(this.props.background, s.barBackground) }, e.map((e, r) => {
+ var t = this.props.cornerRadius, n = Ke(this.props.background);
+ return /*#__PURE__*/ B.createElement(D, { zIndex: ge(this.props.background, m.barBackground) }, e.map((e, r) => {
e.value;
var i = e.background, a = On(e, Cn);
if (!i) return null;
- var o = q(q(q(q(q({ cornerRadius: qt(t) }, a), {}, { fill: "#eee" }, i), n), He(this.props, e, r)), {}, {
+ var o = q(q(q(q(q({ cornerRadius: Yt(t) }, a), {}, { fill: "#eee" }, i), n), O(this.props, e, r)), {}, {
index: r,
- className: Nt("recharts-radial-bar-background-sector", String(n?.className)),
+ className: _t("recharts-radial-bar-background-sector", String(n?.className)),
option: i,
isActive: !1
});
- return /*#__PURE__*/ H.createElement(Jt, K({ key: `background-${a.cx}-${a.cy}-${a.innerRadius}-${a.outerRadius}-${a.startAngle}-${a.endAngle}-${r}` }, o));
+ return /*#__PURE__*/ B.createElement(Xt, K({ key: `background-${a.cx}-${a.cy}-${a.innerRadius}-${a.outerRadius}-${a.startAngle}-${a.endAngle}-${r}` }, o));
}));
}
render() {
var e = this.props, t = e.hide, n = e.sectors, r = e.className, i = e.background;
if (t) return null;
- var a = Nt("recharts-area", r);
- return /*#__PURE__*/ H.createElement(k, { zIndex: this.props.zIndex }, /*#__PURE__*/ H.createElement(M, { className: a }, i && /*#__PURE__*/ H.createElement(M, { className: "recharts-radial-bar-background" }, this.renderBackground(n)), /*#__PURE__*/ H.createElement(M, { className: "recharts-radial-bar-sectors" }, /*#__PURE__*/ H.createElement(Fn, this.props))));
+ var a = _t("recharts-area", r);
+ return /*#__PURE__*/ B.createElement(D, { zIndex: this.props.zIndex }, /*#__PURE__*/ B.createElement(_, { className: a }, i && /*#__PURE__*/ B.createElement(_, { className: "recharts-radial-bar-background" }, this.renderBackground(n)), /*#__PURE__*/ B.createElement(_, { className: "recharts-radial-bar-sectors" }, /*#__PURE__*/ B.createElement(Fn, this.props))));
}
};
function zn(e) {
- var t = H.useMemo(() => se(e.children, Fe), [e.children]), n = H.useMemo(() => ({
+ var t = B.useMemo(() => le(e.children, a), [e.children]), n = B.useMemo(() => ({
data: void 0,
hide: !1,
id: e.id,
dataKey: e.dataKey,
minPointSize: e.minPointSize,
- stackId: re(e.stackId),
+ stackId: pe(e.stackId),
maxBarSize: e.maxBarSize,
barSize: e.barSize,
type: "radialBar",
@@ -423,8 +423,8 @@ function zn(e) {
e.barSize,
e.angleAxisId,
e.radiusAxisId
- ]), r = ce((r) => yn(r, e.radiusAxisId, e.angleAxisId, n, t)) ?? An;
- return /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(Ln, {
+ ]), r = M((r) => yn(r, e.radiusAxisId, e.angleAxisId, n, t)) ?? An;
+ return /*#__PURE__*/ B.createElement(B.Fragment, null, /*#__PURE__*/ B.createElement(Ln, {
dataKey: e.dataKey,
sectors: r,
stroke: e.stroke,
@@ -435,14 +435,14 @@ function zn(e) {
tooltipType: e.tooltipType,
formatter: e.formatter,
id: e.id
- }), /*#__PURE__*/ H.createElement(Rn, K({}, e, { sectors: r })));
+ }), /*#__PURE__*/ B.createElement(Rn, K({}, e, { sectors: r })));
}
var J = {
angleAxisId: 0,
animationBegin: 0,
animationDuration: 1500,
animationEasing: "ease",
- animationMatchBy: d,
+ animationMatchBy: xe,
animationInterpolateFn: Nn,
background: !1,
cornerIsExternal: !1,
@@ -454,70 +454,70 @@ var J = {
legendType: "rect",
minPointSize: 0,
radiusAxisId: 0,
- shape: Kt,
- zIndex: s.bar
+ shape: Jt,
+ zIndex: m.bar
};
function Bn(e) {
- var t = e.displayedData, n = e.stackedData, r = e.dataStartIndex, i = e.stackedDomain, a = e.dataKey, o = e.baseValue, s = e.layout, c = e.radiusAxis, l = e.radiusAxisTicks, d = e.bandSize, p = e.pos, m = e.angleAxis, h = e.minPointSize, g = e.cx, _ = e.cy, v = e.angleAxisTicks, y = e.cells, b = e.startAngle, x = e.endAngle;
- return v == null || l == null ? An : (t ?? []).map((e, t) => {
- var S, C, w, T, E, ee;
- if (n ? S = Le(n[r + t], i) : (S = u(e, a), Array.isArray(S) || (S = [o, S])), s === "radial") {
- if (T = m.scale.map(S[0]) ?? b, E = m.scale.map(S[1]) ?? x, C = f({
+ var t = e.displayedData, n = e.stackedData, r = e.dataStartIndex, i = e.stackedDomain, a = e.dataKey, o = e.baseValue, s = e.layout, c = e.radiusAxis, l = e.radiusAxisTicks, u = e.bandSize, d = e.pos, f = e.angleAxis, p = e.minPointSize, m = e.cx, h = e.cy, g = e.angleAxisTicks, _ = e.cells, v = e.startAngle, y = e.endAngle;
+ return g == null || l == null ? An : (t ?? []).map((e, t) => {
+ var b, x, S, C, w, T;
+ if (n ? b = qe(n[r + t], i) : (b = he(e, a), Array.isArray(b) || (b = [o, b])), s === "radial") {
+ if (C = f.scale.map(b[0]) ?? v, w = f.scale.map(b[1]) ?? y, x = de({
axis: c,
ticks: l,
- bandSize: d,
- offset: p.offset,
+ bandSize: u,
+ offset: d.offset,
entry: e,
index: t
- }), C != null && E != null && T != null) {
- w = C + p.size;
- var D = E - T;
- if (Math.abs(h) > 0 && Math.abs(D) < Math.abs(h)) {
- var te = Se(D || h) * (Math.abs(h) - Math.abs(D));
- E += te;
+ }), x != null && w != null && C != null) {
+ S = x + d.size;
+ var E = w - C;
+ if (Math.abs(p) > 0 && Math.abs(E) < Math.abs(p)) {
+ var ee = Se(E || p) * (Math.abs(p) - Math.abs(E));
+ w += ee;
}
- ee = { background: {
- cx: g,
- cy: _,
- innerRadius: C,
- outerRadius: w,
- startAngle: b,
- endAngle: x
+ T = { background: {
+ cx: m,
+ cy: h,
+ innerRadius: x,
+ outerRadius: S,
+ startAngle: v,
+ endAngle: y
} };
}
- } else if (C = c.scale.map(S[0]), w = c.scale.map(S[1]), T = f({
- axis: m,
- ticks: v,
- bandSize: d,
- offset: p.offset,
+ } else if (x = c.scale.map(b[0]), S = c.scale.map(b[1]), C = de({
+ axis: f,
+ ticks: g,
+ bandSize: u,
+ offset: d.offset,
entry: e,
index: t
- }), C != null && w != null && T != null) {
- E = T + p.size;
- var O = w - C;
- if (Math.abs(h) > 0 && Math.abs(O) < Math.abs(h)) {
- var ne = Se(O || h) * (Math.abs(h) - Math.abs(O));
- w += ne;
+ }), x != null && S != null && C != null) {
+ w = C + d.size;
+ var D = S - x;
+ if (Math.abs(p) > 0 && Math.abs(D) < Math.abs(p)) {
+ var O = Se(D || p) * (Math.abs(p) - Math.abs(D));
+ S += O;
}
}
- return q(q(q({}, e), ee), {}, {
+ return q(q(q({}, e), T), {}, {
payload: e,
- value: n ? S : S[1],
- cx: g,
- cy: _,
- innerRadius: C,
- outerRadius: w,
- startAngle: T,
- endAngle: E
- }, y && y[t] && y[t].props);
+ value: n ? b : b[1],
+ cx: m,
+ cy: h,
+ innerRadius: x,
+ outerRadius: S,
+ startAngle: C,
+ endAngle: w
+ }, _ && _[t] && _[t].props);
});
}
function Vn(e) {
- var t = ye(e, J);
- return /*#__PURE__*/ H.createElement(v, {
+ var t = we(e, J);
+ return /*#__PURE__*/ B.createElement(S, {
id: t.id,
type: "radialBar"
- }, (e) => /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(p, {
+ }, (e) => /*#__PURE__*/ B.createElement(B.Fragment, null, /*#__PURE__*/ B.createElement(w, {
type: "radialBar",
id: e,
data: void 0,
@@ -525,11 +525,11 @@ function Vn(e) {
hide: t.hide ?? J.hide,
angleAxisId: t.angleAxisId ?? J.angleAxisId,
radiusAxisId: t.radiusAxisId ?? J.radiusAxisId,
- stackId: re(t.stackId),
+ stackId: pe(t.stackId),
barSize: t.barSize,
minPointSize: t.minPointSize,
maxBarSize: t.maxBarSize
- }), /*#__PURE__*/ H.createElement(In, t), /*#__PURE__*/ H.createElement(zn, K({}, t, { id: e }))));
+ }), /*#__PURE__*/ B.createElement(In, t), /*#__PURE__*/ B.createElement(zn, K({}, t, { id: e }))));
}
Vn.displayName = "RadialBar";
//#endregion
@@ -577,82 +577,82 @@ function Kn(e, t) {
}
return (t === "string" ? String : Number)(e);
}
-var qn = ["axis", "item"], Jn = Un(Un({}, w), {}, {
+var qn = ["axis", "item"], Jn = Un(Un({}, ce), {}, {
layout: "radial",
startAngle: 0,
endAngle: 360
-}), Yn = /*#__PURE__*/ (0, H.forwardRef)((e, t) => {
- var n = ye(e, Jn);
- return /*#__PURE__*/ H.createElement(a, {
+}), Yn = /*#__PURE__*/ (0, B.forwardRef)((e, t) => {
+ var n = we(e, Jn);
+ return /*#__PURE__*/ B.createElement(b, {
chartName: "RadialBarChart",
defaultTooltipEventType: "axis",
validateTooltipEventTypes: qn,
- tooltipPayloadSearcher: je,
+ tooltipPayloadSearcher: te,
categoricalChartProps: n,
ref: t
});
-}), Y = Tt(), Xn = "30%", Zn = "100%", Qn = 5, $n = 14, er = 5, tr = 1500, nr = (0, H.createContext)(null);
+}), Y = Nt(), Xn = "30%", Zn = "100%", Qn = 5, $n = 14, er = 5, tr = 1500, nr = (0, B.createContext)(null);
function rr() {
- let e = (0, H.use)(nr);
+ let e = (0, B.use)(nr);
if (!e) throw Error("Radial chart parts (<RadialBar />, <Tooltip />, …) must be used within <EvilRadialChart />");
return e;
}
-function X({ config: e, data: t, nameKey: n, children: i, className: a, chartProps: o, variant: s = "full", max: c, innerRadius: l = Xn, outerRadius: u = Zn, defaultSelectedDataKey: d = null, onSelectionChange: f, isLoading: p = !1, backgroundVariant: m }) {
- let h = (0, H.useId)().replace(/:/g, ""), [g, _] = (0, H.useState)(d), v = ur(p), y = sr(s), b = (0, H.useCallback)((e, t) => {
- _(e), f?.(e === null ? null : {
+function X({ config: e, data: t, nameKey: n, children: r, className: i, chartProps: a, variant: c = "full", max: l, innerRadius: u = Xn, outerRadius: d = Zn, defaultSelectedDataKey: f = null, onSelectionChange: p, isLoading: m = !1, backgroundVariant: h }) {
+ let g = (0, B.useId)().replace(/:/g, ""), [_, b] = (0, B.useState)(f), x = ur(m), S = sr(c), C = (0, B.useCallback)((e, t) => {
+ b(e), p?.(e === null ? null : {
dataKey: e,
value: t ?? 0
});
- }, [f]), x = (0, H.useMemo)(() => t.map((e) => ({
+ }, [p]), w = (0, B.useMemo)(() => t.map((e) => ({
...e,
- fill: `url(#${h}-radial-colors-${e[n]})`
+ fill: `url(#${g}-radial-colors-${e[n]})`
})), [
t,
n,
- h
- ]), S = (0, H.useMemo)(() => ({
+ g
+ ]), T = (0, B.useMemo)(() => ({
config: e,
nameKey: n,
- chartId: h,
- isLoading: p,
- selectedBar: g,
- selectBar: b
+ chartId: g,
+ isLoading: m,
+ selectedBar: _,
+ selectBar: C
}), [
e,
n,
- h,
- p,
g,
- b
+ m,
+ _,
+ C
]);
return /* @__PURE__ */ (0, Y.jsx)(nr, {
- value: S,
- children: /* @__PURE__ */ (0, Y.jsxs)(r, {
- className: a,
+ value: T,
+ children: /* @__PURE__ */ (0, Y.jsxs)(s, {
+ className: i,
config: e,
- children: [/* @__PURE__ */ (0, Y.jsx)(qe, { isLoading: p }), /* @__PURE__ */ (0, Y.jsxs)(Yn, {
- id: h,
- data: p ? v : x,
- innerRadius: l,
- outerRadius: u,
- startAngle: y.startAngle,
- endAngle: y.endAngle,
- cx: y.cx,
- cy: y.cy,
- ...o,
+ children: [/* @__PURE__ */ (0, Y.jsx)(v, { isLoading: m }), /* @__PURE__ */ (0, Y.jsxs)(Yn, {
+ id: g,
+ data: m ? x : w,
+ innerRadius: u,
+ outerRadius: d,
+ startAngle: S.startAngle,
+ endAngle: S.endAngle,
+ cx: S.cx,
+ cy: S.cy,
+ ...a,
children: [
- c != null && c > 0 && /* @__PURE__ */ (0, Y.jsx)(ue, {
+ l != null && l > 0 && /* @__PURE__ */ (0, Y.jsx)(y, {
type: "number",
- domain: [0, c],
+ domain: [0, l],
tick: !1,
axisLine: !1
}),
- m && /* @__PURE__ */ (0, Y.jsx)(Ge, { variant: m }),
- i,
- p && /* @__PURE__ */ (0, Y.jsx)(dr, {}),
+ h && /* @__PURE__ */ (0, Y.jsx)(o, { variant: h }),
+ r,
+ m && /* @__PURE__ */ (0, Y.jsx)(dr, {}),
/* @__PURE__ */ (0, Y.jsx)("defs", { children: /* @__PURE__ */ (0, Y.jsx)(cr, {
config: e,
- chartId: h
+ chartId: g
}) })
]
})]
@@ -660,7 +660,7 @@ function X({ config: e, data: t, nameKey: n, children: i, className: a, chartPro
});
}
function ir({ dataKey: e, cornerRadius: t = Qn, barSize: n = $n, showBackground: r = !0, isClickable: i = !1, radialBarProps: a }) {
- let { nameKey: o, isLoading: s, selectedBar: l, selectBar: u } = rr();
+ let { nameKey: o, isLoading: s, selectedBar: c, selectBar: l } = rr();
return s ? null : /* @__PURE__ */ (0, Y.jsx)(Vn, {
dataKey: e,
cornerRadius: t,
@@ -671,11 +671,11 @@ function ir({ dataKey: e, cornerRadius: t = Qn, barSize: n = $n, showBackground:
onClick: (t, n) => {
if (!i) return;
let r = t, a = r?.[o] ?? String(n), s = Number(r?.[e] ?? 0);
- u(l === a ? null : a, s);
+ l(c === a ? null : a, s);
},
shape: (e) => {
- let t = e[o], n = l === null || l === t;
- return /* @__PURE__ */ (0, Y.jsx)(c, {
+ let t = e[o], n = c === null || c === t;
+ return /* @__PURE__ */ (0, Y.jsx)(C, {
...e,
opacity: i && !n ? .15 : 1,
className: "transition-opacity duration-200"
@@ -686,10 +686,10 @@ function ir({ dataKey: e, cornerRadius: t = Qn, barSize: n = $n, showBackground:
}
function ar({ variant: e, roundness: t, defaultIndex: n }) {
let { nameKey: r, isLoading: i } = rr();
- return i ? null : /* @__PURE__ */ (0, Y.jsx)(Je, {
+ return i ? null : /* @__PURE__ */ (0, Y.jsx)(f, {
defaultIndex: n,
cursor: !1,
- content: /* @__PURE__ */ (0, Y.jsx)(te, {
+ content: /* @__PURE__ */ (0, Y.jsx)(p, {
nameKey: r,
hideLabel: !0,
roundness: t,
@@ -699,10 +699,10 @@ function ar({ variant: e, roundness: t, defaultIndex: n }) {
}
function or({ variant: e, align: t = "center", verticalAlign: n = "bottom", isClickable: r = !1 }) {
let { nameKey: i, isLoading: a, selectedBar: o, selectBar: s } = rr();
- return a ? null : /* @__PURE__ */ (0, Y.jsx)(Xe, {
+ return a ? null : /* @__PURE__ */ (0, Y.jsx)(l, {
verticalAlign: n,
align: t,
- content: /* @__PURE__ */ (0, Y.jsx)(me, {
+ content: /* @__PURE__ */ (0, Y.jsx)(u, {
selected: o,
onSelectChange: s,
isClickable: r,
@@ -728,7 +728,7 @@ function sr(e) {
}
}
var cr = ({ config: e, chartId: t }) => /* @__PURE__ */ (0, Y.jsx)(Y.Fragment, { children: Object.entries(e).map(([e, n]) => {
- let r = ne(n);
+ let r = fe(n);
return /* @__PURE__ */ (0, Y.jsx)("linearGradient", {
id: `${t}-radial-colors-${e}`,
x1: "0",
@@ -757,14 +757,14 @@ function lr() {
}));
}
function ur(e) {
- let [t, n] = (0, H.useState)(0);
- return (0, H.useEffect)(() => {
+ let [t, n] = (0, B.useState)(0);
+ return (0, B.useEffect)(() => {
if (!e) return;
let t = setInterval(() => {
n((e) => e + 1);
}, tr);
return () => clearInterval(t);
- }, [e]), (0, H.useMemo)(() => lr(), [t]);
+ }, [e]), (0, B.useMemo)(() => lr(), [t]);
}
var dr = () => /* @__PURE__ */ (0, Y.jsx)(Vn, {
dataKey: "value",
@@ -774,7 +774,7 @@ var dr = () => /* @__PURE__ */ (0, Y.jsx)(Vn, {
isAnimationActive: !0,
animationDuration: tr,
animationEasing: "ease-in-out",
- shape: (e) => /* @__PURE__ */ (0, Y.jsx)(c, {
+ shape: (e) => /* @__PURE__ */ (0, Y.jsx)(C, {
...e,
fill: "currentColor",
fillOpacity: .25
@@ -798,19 +798,19 @@ var fr = [
"aria-pressed:bg-chart-5/10 aria-pressed:ring-chart-5",
"aria-pressed:bg-chart-6/10 aria-pressed:ring-chart-6"
];
-function mr({ title: e, rows: t, empty: n, unit: r = "个视频" }) {
- let [i, a] = (0, H.useState)(-1), [o, s] = (0, H.useState)(-1), l = tt(t);
- if (!l.length) return /* @__PURE__ */ (0, Y.jsx)(We, {
+function mr({ title: e, rows: t, empty: n, unit: i = "个视频" }) {
+ let [a, o] = (0, B.useState)(-1), [s, l] = (0, B.useState)(-1), u = At(t);
+ if (!u.length) return /* @__PURE__ */ (0, Y.jsx)(c, {
title: e,
children: n
});
- let u = o >= 0 ? o : i, d = l.reduce((e, t) => e + t.value, 0), f = l[u], p = (e) => a((t) => t === e ? -1 : e), m = Lt(l.map((e) => e.value)), h = l.map((e, t) => ({
- slice: xe(t),
+ let f = s >= 0 ? s : a, p = u.reduce((e, t) => e + t.value, 0), m = u[f], h = (e) => o((t) => t === e ? -1 : e), g = kt(u.map((e) => e.value)), _ = u.map((e, t) => ({
+ slice: We(t),
value: e.value,
- arc: ut(e.value, m)
+ arc: Dt(e.value, g)
}));
return /* @__PURE__ */ (0, Y.jsxs)("section", {
- className: Be,
+ className: r,
children: [
/* @__PURE__ */ (0, Y.jsxs)("header", {
className: "flex flex-wrap items-end justify-between gap-x-4 gap-y-1",
@@ -818,40 +818,40 @@ function mr({ title: e, rows: t, empty: n, unit: r = "个视频" }) {
className: "flex min-w-0 flex-col gap-1",
children: [/* @__PURE__ */ (0, Y.jsxs)("h3", {
className: "flex items-center gap-1.5 text-title-2-medium wrap-anywhere text-text-primary",
- children: [f?.mark ? /* @__PURE__ */ (0, Y.jsx)(Ot, { mark: f.mark }) : null, f ? f.name : e]
+ children: [m?.mark ? /* @__PURE__ */ (0, Y.jsx)(lt, { mark: m.mark }) : null, m ? m.name : e]
}), /* @__PURE__ */ (0, Y.jsx)("b", {
className: "text-display-4-medium tabular-nums text-text-primary",
- children: (f ? f.value : d).toLocaleString()
+ children: (m ? m.value : p).toLocaleString()
})]
}), /* @__PURE__ */ (0, Y.jsx)("small", {
className: "text-caption-1-regular text-text-secondary",
- children: r
+ children: i
})]
}),
/* @__PURE__ */ (0, Y.jsx)("div", {
role: "img",
"aria-label": e,
- onPointerLeave: () => s(-1),
+ onPointerLeave: () => l(-1),
children: /* @__PURE__ */ (0, Y.jsxs)(X, {
- data: h,
+ data: _,
nameKey: "slice",
- config: Ae(l.map((e) => e.name)),
- max: m,
+ config: Ue(u.map((e) => e.name)),
+ max: g,
innerRadius: "22%",
className: "aspect-auto h-75 max-sm:h-65",
children: [/* @__PURE__ */ (0, Y.jsx)(X.RadialBar, {
dataKey: "arc",
- barSize: gt(l.length),
+ barSize: Ot(u.length),
radialBarProps: {
- shape: (e) => /* @__PURE__ */ (0, Y.jsx)(c, {
+ shape: (e) => /* @__PURE__ */ (0, Y.jsx)(C, {
...e,
- opacity: u >= 0 && u !== e.index ? .3 : 1,
+ opacity: f >= 0 && f !== e.index ? .3 : 1,
className: "cursor-pointer transition-opacity duration-200"
}),
- onClick: (e, t) => p(t),
- onMouseEnter: (e, t) => s(t)
+ onClick: (e, t) => h(t),
+ onMouseEnter: (e, t) => l(t)
}
- }), /* @__PURE__ */ (0, Y.jsx)(Pe, {
+ }), /* @__PURE__ */ (0, Y.jsx)(d, {
nameKey: "slice",
valueKey: "value",
hideLabel: !0
@@ -860,14 +860,14 @@ function mr({ title: e, rows: t, empty: n, unit: r = "个视频" }) {
}),
/* @__PURE__ */ (0, Y.jsx)("div", {
className: "inline-grid w-full grid-cols-3 gap-2 max-sm:grid-cols-2",
- children: l.map((e, t) => /* @__PURE__ */ (0, Y.jsxs)("button", {
+ children: u.map((e, t) => /* @__PURE__ */ (0, Y.jsxs)("button", {
type: "button",
- "aria-pressed": i === t,
- onClick: () => p(t),
- onPointerEnter: () => s(t),
- onPointerLeave: () => s(-1),
- onFocus: () => s(t),
- onBlur: () => s(-1),
+ "aria-pressed": a === t,
+ onClick: () => h(t),
+ onPointerEnter: () => l(t),
+ onPointerLeave: () => l(-1),
+ onFocus: () => l(t),
+ onBlur: () => l(-1),
className: `flex min-w-0 cursor-pointer flex-col items-start gap-1 rounded-xl bg-background-tertiary-default p-2.5 text-left outline-none aria-pressed:ring-1 aria-pressed:ring-inset focus-visible:ring-2 focus-visible:ring-border-focus-ring ${pr[t % 6]}`,
children: [
/* @__PURE__ */ (0, Y.jsxs)("span", {
@@ -877,7 +877,7 @@ function mr({ title: e, rows: t, empty: n, unit: r = "个视频" }) {
className: `mt-0.5 size-3 shrink-0 rounded-sm ${fr[t % 6]}`
}), /* @__PURE__ */ (0, Y.jsxs)("span", {
className: "inline-flex min-w-0 items-start gap-1.5 wrap-anywhere",
- children: [e.mark ? /* @__PURE__ */ (0, Y.jsx)(Ot, { mark: e.mark }) : null, e.name]
+ children: [e.mark ? /* @__PURE__ */ (0, Y.jsx)(lt, { mark: e.mark }) : null, e.name]
})]
}),
/* @__PURE__ */ (0, Y.jsx)("b", {
@@ -886,17 +886,17 @@ function mr({ title: e, rows: t, empty: n, unit: r = "个视频" }) {
}),
e.bytes == null ? null : /* @__PURE__ */ (0, Y.jsx)("small", {
className: "text-caption-1-regular text-text-secondary",
- children: F(e.bytes)
+ children: z(e.bytes)
})
]
- }, xe(t)))
+ }, We(t)))
})
]
});
}
//#endregion
//#region src/react/stats/stats-page.tsx
-var hr = st("媒体库与入库"), gr = 10, _r = ge[5], vr = ge[4], yr = `${xt()} flex flex-col gap-4`, br = "添加媒体目录或关注来源后,这里会显示馆藏统计。", xr = "补全资料或添加标签后,这里会显示馆藏中的内容标签。", Sr = "开始播放后,这里会显示最近的真实观看证据。", Cr = "补充作品资料或手动添加标签后,这里会显示各个标签来源对应的视频数量。", wr = "添加媒体目录后,这里会显示存储空间。", Tr = "把媒体目录归进媒体库后,这里会按库显示视频数。", Er = "探测时长后,这里会显示时长分布。", Dr = "探测画质后,这里会显示画质分布。", Or = "开始播放后,这里会显示播放落在一周的哪些时段。", kr = "开始播放后,这里会显示每个作品播了几次。", Ar = (e, t) => Math.min(Math.max(e, 0), t);
+var hr = Ft("媒体库与入库"), gr = 10, _r = i[5], vr = i[4], yr = `${gt()} flex flex-col gap-4`, br = "添加媒体目录或关注来源后,这里会显示馆藏统计。", xr = "补全资料或添加标签后,这里会显示馆藏中的内容标签。", Sr = "开始播放后,这里会显示最近的真实观看证据。", Cr = "补充作品资料或手动添加标签后,这里会显示各个标签来源对应的视频数量。", wr = "添加媒体目录后,这里会显示存储空间。", Tr = "把媒体目录归进媒体库后,这里会按库显示视频数。", Er = "探测时长后,这里会显示时长分布。", Dr = "探测画质后,这里会显示画质分布。", Or = "开始播放后,这里会显示播放落在一周的哪些时段。", kr = "开始播放后,这里会显示每个作品播了几次。", Ar = (e, t) => Math.min(Math.max(e, 0), t);
function Z({ term: e, value: t }) {
return /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex min-h-16 min-w-0 flex-col gap-1.5 rounded-2lg bg-background-primary-default p-3",
@@ -905,7 +905,7 @@ function Z({ term: e, value: t }) {
children: e
}), /* @__PURE__ */ (0, Y.jsx)("b", {
className: "text-title-3-medium tabular-nums text-text-primary",
- children: N(t)
+ children: R(t)
})]
});
}
@@ -917,14 +917,14 @@ function Q({ term: e, value: t, total: n }) {
className: "flex items-baseline justify-between gap-3 text-body-2-regular text-text-primary",
children: [/* @__PURE__ */ (0, Y.jsx)("span", { children: e }), /* @__PURE__ */ (0, Y.jsxs)("b", {
className: "tabular-nums",
- children: [N(t), R(t) ? /* @__PURE__ */ (0, Y.jsx)("span", {
+ children: [R(t), bt(t) ? /* @__PURE__ */ (0, Y.jsx)("span", {
className: "ml-1.5 text-caption-1-regular text-text-secondary",
- children: ht(t, n)
+ children: wt(t, n)
}) : null]
})]
- }), /* @__PURE__ */ (0, Y.jsx)(V, {
- label: `${e}:${N(t)} / ${n.toLocaleString()}`,
- value: R(t) ? Ar(t, r) : 0,
+ }), /* @__PURE__ */ (0, Y.jsx)(L, {
+ label: `${e}:${R(t)} / ${n.toLocaleString()}`,
+ value: bt(t) ? Ar(t, r) : 0,
max: r
})]
});
@@ -966,10 +966,10 @@ function Nr({ data: e }) {
title: "网盘与本地",
empty: br,
rows: e.by_loc.map((e) => ({
- name: ct[e.k] ?? e.k,
+ name: tt[e.k] ?? e.k,
value: e.videos,
bytes: e.bytes,
- mark: _t[e.k] || "database"
+ mark: nt[e.k] || "database"
}))
}), /* @__PURE__ */ (0, Y.jsx)(mr, {
title: "媒体库",
@@ -978,48 +978,48 @@ function Nr({ data: e }) {
name: e.name,
value: e.videos,
bytes: e.bytes,
- mark: _t[e.icon] || e.icon || "database"
+ mark: nt[e.icon] || e.icon || "database"
}))
})]
}), /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "inline-grid w-full gap-5 md:grid-cols-2 xl:grid-cols-3",
children: [
- /* @__PURE__ */ (0, Y.jsx)(A, {
+ /* @__PURE__ */ (0, Y.jsx)(n, {
title: "时长",
unit: "个视频",
series: "视频",
color: _r,
- rows: dt(e.by_length),
+ rows: xt(e.by_length),
empty: Er
}),
- /* @__PURE__ */ (0, Y.jsx)(A, {
+ /* @__PURE__ */ (0, Y.jsx)(n, {
title: "画质",
unit: "个视频",
series: "视频",
color: _r,
- rows: pt(e.by_quality),
+ rows: ht(e.by_quality),
empty: Dr
}),
- /* @__PURE__ */ (0, Y.jsx)(A, {
+ /* @__PURE__ */ (0, Y.jsx)(n, {
title: "文件类型",
unit: "个条目",
series: "条目",
color: _r,
layout: "horizontal",
- rows: ft(e.by_medium),
+ rows: Ct(e.by_medium),
empty: br
})
]
})]
- }) : /* @__PURE__ */ (0, Y.jsx)(z, {
- icon: It,
+ }) : /* @__PURE__ */ (0, Y.jsx)(I, {
+ icon: rt,
title: "还没有视频",
- actions: /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)(B, {
+ actions: /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)(F, {
variant: "secondary",
href: "/subscriptions?tab=add",
size: "small",
children: "添加关注"
- }), /* @__PURE__ */ (0, Y.jsx)(B, {
+ }), /* @__PURE__ */ (0, Y.jsx)(F, {
variant: "primary",
href: hr,
size: "small",
@@ -1028,9 +1028,9 @@ function Nr({ data: e }) {
children: br
});
}
-function Pr({ data: e }) {
- return /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)(Me, {
- activity: e.play_activity,
+function Pr({ data: t }) {
+ return /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)(e, {
+ activity: t.play_activity,
title: "播放时间",
dailyTitle: "每日播放",
words: {
@@ -1040,12 +1040,12 @@ function Pr({ data: e }) {
},
tone: 5,
empty: Or
- }), /* @__PURE__ */ (0, Y.jsx)(A, {
+ }), /* @__PURE__ */ (0, Y.jsx)(n, {
title: "播放次数",
unit: "个作品",
series: "作品",
color: vr,
- rows: at(e.replays),
+ rows: Mt(t.replays),
empty: kr
})] });
}
@@ -1092,15 +1092,15 @@ function Ir({ volume: e }) {
children: [/* @__PURE__ */ (0, Y.jsx)("h3", {
className: "min-w-0 break-words",
children: e.label
- }), t == null ? e.online ? /* @__PURE__ */ (0, Y.jsx)(lt, { children: "容量未取得" }) : /* @__PURE__ */ (0, Y.jsx)(Ht, { online: !1 }) : /* @__PURE__ */ (0, Y.jsxs)("b", {
+ }), t == null ? e.online ? /* @__PURE__ */ (0, Y.jsx)(ut, { children: "容量未取得" }) : /* @__PURE__ */ (0, Y.jsx)(Wt, { online: !1 }) : /* @__PURE__ */ (0, Y.jsxs)("b", {
className: "whitespace-nowrap tabular-nums",
- children: [F(n), /* @__PURE__ */ (0, Y.jsx)("span", {
+ children: [z(n), /* @__PURE__ */ (0, Y.jsx)("span", {
className: "ml-1.5 text-caption-1-regular text-text-secondary",
- children: ht(n, t)
+ children: wt(n, t)
})]
})]
}),
- t == null ? null : /* @__PURE__ */ (0, Y.jsx)(V, {
+ t == null ? null : /* @__PURE__ */ (0, Y.jsx)(L, {
label: `${e.label}空间使用率`,
value: Ar(n, Math.max(t, 1)),
max: Math.max(t, 1)
@@ -1112,7 +1112,7 @@ function Ir({ volume: e }) {
children: e.root ?? "未映射"
}), t == null ? null : /* @__PURE__ */ (0, Y.jsx)("span", {
className: "whitespace-nowrap tabular-nums",
- children: `可用 ${F(e.free ?? 0)} · 共 ${F(t)}`
+ children: `可用 ${z(e.free ?? 0)} · 共 ${z(t)}`
})]
})
]
@@ -1122,10 +1122,10 @@ function Lr({ volumes: e }) {
return e.length ? /* @__PURE__ */ (0, Y.jsx)("div", {
className: "flex flex-col",
children: e.map((e) => /* @__PURE__ */ (0, Y.jsx)(Ir, { volume: e }, `${e.kind}:${e.label}`))
- }) : /* @__PURE__ */ (0, Y.jsx)(z, {
- icon: mt,
+ }) : /* @__PURE__ */ (0, Y.jsx)(I, {
+ icon: dt,
title: "还没有存储来源",
- actions: /* @__PURE__ */ (0, Y.jsx)(B, {
+ actions: /* @__PURE__ */ (0, Y.jsx)(F, {
variant: "primary",
href: hr,
size: "small",
@@ -1135,7 +1135,7 @@ function Lr({ volumes: e }) {
});
}
function Rr({ tags: e, tagLabel: t, onTag: n, hasMedia: r }) {
- return e.length ? /* @__PURE__ */ (0, Y.jsx)(Ve, {
+ return e.length ? /* @__PURE__ */ (0, Y.jsx)(h, {
previewCount: gr,
className: "inline-grid w-full gap-x-6 gap-y-1 sm:grid-cols-2",
children: e.map((e, r) => /* @__PURE__ */ (0, Y.jsx)("li", {
@@ -1160,10 +1160,10 @@ function Rr({ tags: e, tagLabel: t, onTag: n, hasMedia: r }) {
]
})
}, `${e.k}:${r}`))
- }) : /* @__PURE__ */ (0, Y.jsx)(z, {
- icon: yt,
+ }) : /* @__PURE__ */ (0, Y.jsx)(I, {
+ icon: St,
title: "还没有内容标签",
- actions: /* @__PURE__ */ (0, Y.jsx)(B, {
+ actions: /* @__PURE__ */ (0, Y.jsx)(F, {
variant: "secondary",
href: r ? "/data-cleanup" : "/settings/library",
size: "small",
@@ -1176,7 +1176,7 @@ function zr({ rows: e, hasMedia: t }) {
return e.length ? /* @__PURE__ */ (0, Y.jsx)("div", {
className: "flex flex-col gap-5",
children: e.map((e) => {
- let t = St(e);
+ let t = zt(e);
return /* @__PURE__ */ (0, Y.jsxs)("article", {
className: "flex flex-wrap items-center gap-x-6 gap-y-2",
children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
@@ -1184,7 +1184,7 @@ function zr({ rows: e, hasMedia: t }) {
children: [/* @__PURE__ */ (0, Y.jsx)("h3", {
className: "min-w-0 text-body-2-medium text-text-primary",
children: /* @__PURE__ */ (0, Y.jsx)("a", {
- href: ot(e),
+ href: Et(e),
"data-middle-truncate": !0,
className: "block max-w-full overflow-hidden whitespace-nowrap hover:underline",
children: e.name
@@ -1194,24 +1194,24 @@ function zr({ rows: e, hasMedia: t }) {
children: [e.creator ? /* @__PURE__ */ (0, Y.jsx)("span", {
className: "min-w-0 wrap-anywhere",
children: e.creator
- }) : null, /* @__PURE__ */ (0, Y.jsx)("span", { children: vt(e) })]
+ }) : null, /* @__PURE__ */ (0, Y.jsx)("span", { children: Rt(e) })]
})]
}), /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "min-w-0 basis-40",
- children: [/* @__PURE__ */ (0, Y.jsx)(V, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(L, {
label: `真实观看 ${t.toFixed(0)}%`,
value: t
}), /* @__PURE__ */ (0, Y.jsx)("small", {
className: "mt-1.5 block text-caption-1-regular text-text-secondary",
- children: `真实 ${t.toFixed(0)}% · 到达 ${bt(e).toFixed(0)}%`
+ children: `真实 ${t.toFixed(0)}% · 到达 ${jt(e).toFixed(0)}%`
})]
})]
}, `${e.kind}:${e.id}`);
})
- }) : /* @__PURE__ */ (0, Y.jsx)(z, {
- icon: Ct,
+ }) : /* @__PURE__ */ (0, Y.jsx)(I, {
+ icon: It,
title: "还没有观看记录",
- actions: /* @__PURE__ */ (0, Y.jsx)(B, {
+ actions: /* @__PURE__ */ (0, Y.jsx)(F, {
variant: "secondary",
href: t ? "/" : "/settings/library",
size: "small",
@@ -1239,7 +1239,7 @@ function Br({ sources: e, videos: t }) {
})]
})]
}),
- /* @__PURE__ */ (0, Y.jsx)(V, {
+ /* @__PURE__ */ (0, Y.jsx)(L, {
label: `${e.k} 覆盖视频`,
value: Ar(e.assets, Math.max(t, 1)),
max: Math.max(t, 1)
@@ -1250,10 +1250,10 @@ function Br({ sources: e, videos: t }) {
})
]
}, e.k))
- }) : /* @__PURE__ */ (0, Y.jsx)(z, {
- icon: yt,
+ }) : /* @__PURE__ */ (0, Y.jsx)(I, {
+ icon: St,
title: "还没有标签来源",
- actions: /* @__PURE__ */ (0, Y.jsx)(B, {
+ actions: /* @__PURE__ */ (0, Y.jsx)(F, {
variant: "secondary",
href: t ? "/data-cleanup" : "/settings/library",
size: "small",
@@ -1265,11 +1265,11 @@ function Br({ sources: e, videos: t }) {
function $({ id: e, label: t, figure: n, detail: r, icon: i, accent: a }) {
return /* @__PURE__ */ (0, Y.jsx)(P, {
id: e,
- className: Vt({
+ className: Ut({
interactive: !0,
selectable: !0
}),
- children: /* @__PURE__ */ (0, Y.jsx)(zt, {
+ children: /* @__PURE__ */ (0, Y.jsx)(Ht, {
label: t,
icon: i,
accent: a,
@@ -1279,49 +1279,49 @@ function $({ id: e, label: t, figure: n, detail: r, icon: i, accent: a }) {
});
}
function Vr(e) {
- let t = wt({
- queryKey: nt,
- queryFn: ({ signal: e }) => At(e)
+ let t = Lt({
+ queryKey: st,
+ queryFn: ({ signal: e }) => yt(e)
}), n = t.data;
- if (!n) return /* @__PURE__ */ (0, Y.jsx)(Rt, { children: /* @__PURE__ */ (0, Y.jsx)(Pt, {
+ if (!n) return /* @__PURE__ */ (0, Y.jsx)(Bt, { children: /* @__PURE__ */ (0, Y.jsx)(it, {
tone: "error",
title: "馆藏统计读取失败",
- children: t.error ? it(t.error) : "未取得统计数据,请刷新页面重试。"
+ children: t.error ? vt(t.error) : "未取得统计数据,请刷新页面重试。"
}) });
- let r = n.consumption, i = n.storage_summary, a = n.by_loc.reduce((e, t) => e + t.videos, 0), o = n.by_loc.reduce((e, t) => e + t.bytes, 0), s = R(n.tag_cov) ? ht(n.tag_cov, n.attribution.videos) : "未取得", c = `${N(n.tag_cov)} / ${n.attribution.videos.toLocaleString()}`;
- return /* @__PURE__ */ (0, Y.jsxs)(Rt, { children: [
+ let r = n.consumption, i = n.storage_summary, a = n.by_loc.reduce((e, t) => e + t.videos, 0), o = n.by_loc.reduce((e, t) => e + t.bytes, 0), s = bt(n.tag_cov) ? wt(n.tag_cov, n.attribution.videos) : "未取得", c = `${R(n.tag_cov)} / ${n.attribution.videos.toLocaleString()}`;
+ return /* @__PURE__ */ (0, Y.jsxs)(Bt, { children: [
/* @__PURE__ */ (0, Y.jsx)("p", {
className: "text-caption-1-regular text-text-secondary",
- children: `数据库中的当前统计 · ${a.toLocaleString()} 个视频 · ${F(o)}`
+ children: `数据库中的当前统计 · ${a.toLocaleString()} 个视频 · ${z(o)}`
}),
/* @__PURE__ */ (0, Y.jsxs)($e, {
defaultSelectedKey: "inventory",
className: "flex flex-col gap-4",
children: [
- /* @__PURE__ */ (0, Y.jsxs)(Et, {
+ /* @__PURE__ */ (0, Y.jsxs)(et, {
"aria-label": "统计视图",
- className: Bt,
+ className: Vt,
children: [
/* @__PURE__ */ (0, Y.jsx)($, {
id: "inventory",
label: "馆藏视频",
- icon: kt,
+ icon: pt,
accent: 0,
figure: a.toLocaleString(),
- detail: F(o)
+ detail: z(o)
}),
/* @__PURE__ */ (0, Y.jsx)($, {
id: "viewing",
label: "看过",
- icon: et,
+ icon: ft,
accent: 1,
- figure: N(r.played),
- detail: rt(r.play_seconds)
+ figure: R(r.played),
+ detail: Tt(r.play_seconds)
}),
/* @__PURE__ */ (0, Y.jsx)($, {
id: "coverage",
label: "内容标签",
- icon: yt,
+ icon: St,
accent: 2,
figure: s,
detail: c
@@ -1329,27 +1329,27 @@ function Vr(e) {
/* @__PURE__ */ (0, Y.jsx)($, {
id: "storage",
label: "使用空间",
- icon: mt,
+ icon: dt,
accent: 3,
figure: `${i.online.toLocaleString()} 个卷`,
- detail: i.measured ? `已用 ${F(i.used)}` : "容量未取得"
+ detail: i.measured ? `已用 ${z(i.used)}` : "容量未取得"
})
]
}),
- /* @__PURE__ */ (0, Y.jsx)(I, {
+ /* @__PURE__ */ (0, Y.jsx)(N, {
id: "inventory",
children: /* @__PURE__ */ (0, Y.jsx)(Nr, {
data: n,
...e
})
}),
- /* @__PURE__ */ (0, Y.jsxs)(I, {
+ /* @__PURE__ */ (0, Y.jsxs)(N, {
id: "viewing",
className: "flex flex-col gap-5",
children: [/* @__PURE__ */ (0, Y.jsx)(Mr, {
headline: /* @__PURE__ */ (0, Y.jsx)(jr, {
term: "观看",
- figure: N(r.played),
+ figure: R(r.played),
unit: "个作品有播放记录"
}),
children: /* @__PURE__ */ (0, Y.jsxs)("div", {
@@ -1391,7 +1391,7 @@ function Vr(e) {
})
}), /* @__PURE__ */ (0, Y.jsx)(Pr, { data: n })]
}),
- /* @__PURE__ */ (0, Y.jsx)(I, {
+ /* @__PURE__ */ (0, Y.jsx)(N, {
id: "coverage",
children: /* @__PURE__ */ (0, Y.jsx)(Mr, {
headline: /* @__PURE__ */ (0, Y.jsx)(jr, {
@@ -1402,7 +1402,7 @@ function Vr(e) {
children: /* @__PURE__ */ (0, Y.jsx)(Fr, { attribution: n.attribution })
})
}),
- /* @__PURE__ */ (0, Y.jsx)(I, {
+ /* @__PURE__ */ (0, Y.jsx)(N, {
id: "storage",
children: /* @__PURE__ */ (0, Y.jsx)(Mr, {
headline: /* @__PURE__ */ (0, Y.jsx)(jr, {
@@ -1420,33 +1420,33 @@ function Vr(e) {
}),
/* @__PURE__ */ (0, Y.jsxs)($e, {
defaultSelectedKey: "tags",
- className: `${xt({ padding: "none" })} flex flex-col`,
+ className: `${gt({ padding: "none" })} flex flex-col`,
children: [
/* @__PURE__ */ (0, Y.jsx)("div", {
className: "px-4 pt-3",
- children: /* @__PURE__ */ (0, Y.jsxs)(Dt, {
+ children: /* @__PURE__ */ (0, Y.jsxs)(ct, {
"aria-label": "统计维度",
- className: jt,
+ className: ot,
children: [
/* @__PURE__ */ (0, Y.jsx)(P, {
id: "tags",
- className: L,
+ className: at,
children: "内容标签"
}),
/* @__PURE__ */ (0, Y.jsx)(P, {
id: "recent",
- className: L,
+ className: at,
children: "最近看过"
}),
/* @__PURE__ */ (0, Y.jsx)(P, {
id: "sources",
- className: L,
+ className: at,
children: "标签来源"
})
]
})
}),
- /* @__PURE__ */ (0, Y.jsx)(I, {
+ /* @__PURE__ */ (0, Y.jsx)(N, {
id: "tags",
className: "px-4 pt-3.5 pb-4",
children: /* @__PURE__ */ (0, Y.jsx)(Rr, {
@@ -1455,7 +1455,7 @@ function Vr(e) {
...e
})
}),
- /* @__PURE__ */ (0, Y.jsx)(I, {
+ /* @__PURE__ */ (0, Y.jsx)(N, {
id: "recent",
className: "px-4 pt-3.5 pb-4",
children: /* @__PURE__ */ (0, Y.jsx)(zr, {
@@ -1463,7 +1463,7 @@ function Vr(e) {
hasMedia: a > 0
})
}),
- /* @__PURE__ */ (0, Y.jsx)(I, {
+ /* @__PURE__ */ (0, Y.jsx)(N, {
id: "sources",
className: "px-4 pt-3.5 pb-4",
children: /* @__PURE__ */ (0, Y.jsx)(Br, {
@@ -1478,4 +1478,4 @@ function Vr(e) {
//#endregion
export { Vr as StatsPage };
-//# debugId=e9dff2b2-ed62-44e7-bc4b-3bb6f0b39255
\ No newline at end of file
+//# debugId=82936c02-5b67-4889-8313-b4254447f6e3
\ No newline at end of file
diff --git a/web/dist/peach-app.taste-page-B4dCRjRy.js b/web/dist/peach-app.taste-page-ByDbTYiW.js
similarity index 57%
rename from web/dist/peach-app.taste-page-B4dCRjRy.js
rename to web/dist/peach-app.taste-page-ByDbTYiW.js
index deee0fa58..080c24143 100644
--- a/web/dist/peach-app.taste-page-B4dCRjRy.js
+++ b/web/dist/peach-app.taste-page-ByDbTYiW.js
@@ -1,19 +1,19 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "e6f0d41e-6c62-4dc8-b6b4-5a52c3b9ac7c", e._sentryDebugIdIdentifier = "sentry-dbid-e6f0d41e-6c62-4dc8-b6b4-5a52c3b9ac7c");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "8abe0556-ed80-48ed-9ba4-6a697e5e5b94", e._sentryDebugIdIdentifier = "sentry-dbid-8abe0556-ed80-48ed-9ba4-6a697e5e5b94");
} catch {}
})();
-import { $ as e, $t as t, B as n, Bt as r, C as i, Ct as a, D as o, E as s, Et as c, F as l, G as u, Gt as d, I as f, It as p, Jt as m, Kt as h, L as g, Lt as _, Nt as v, O as y, P as b, Q as x, Qt as S, R as ee, Rt as C, S as w, St as T, T as E, Tt as te, U as ne, V as re, W as ie, Wt as ae, Xt as D, Yt as oe, Z as se, Zt as ce, _ as le, a as ue, an as de, at as fe, b as pe, c as me, cn as O, ct as he, d as ge, dt as _e, en as k, et as ve, f as ye, ft as be, g as xe, ht as Se, l as Ce, ln as we, mt as Te, n as Ee, nn as A, nt as j, o as De, on as M, ot as Oe, p as ke, r as Ae, rn as je, s as Me, sn as Ne, st as Pe, t as Fe, tn as Ie, tt as Le, ut as Re, v as ze, w as Be, wt as Ve, x as He, xt as Ue, y as We, z as Ge, zt as Ke } from "./peach-app.expandable-ranking-BW8Gp_lx.js";
-import { $a as qe, $l as Je, $o as Ye, Ao as Xe, C as Ze, Co as Qe, Do as $e, Ec as et, Gl as N, Il as P, Ko as tt, Mo as nt, No as rt, Qa as it, Qo as at, Ra as ot, Ro as st, S as ct, Sc as lt, To as ut, Ua as dt, Uo as ft, Us as pt, Va as F, Wo as I, Yl as mt, Yo as ht, Zl as gt, Zo as _t, _ as vt, _a as yt, _o as bt, a as xt, au as St, b as Ct, bo as wt, c as Tt, cu as Et, d as Dt, eo as Ot, f as kt, fa as At, fs as L, g as jt, ga as Mt, h as Nt, ha as Pt, i as Ft, iu as It, jo as Lt, l as Rt, lo as zt, ls as Bt, m as Vt, mn as Ht, o as Ut, oo as R, ou as Wt, p as Gt, pa as Kt, ps as qt, pu as Jt, r as Yt, rc as z, ro as B, s as Xt, so as V, u as Zt, uu as Qt, v as $t, w as en, x as tn, xa as nn, y as rn, yo as an, za as on, zo as sn } from "./peach-app.js";
-import { t as cn } from "./peach-app.page-BYr6f5ud.js";
-import { a as ln, r as un, s as dn } from "./peach-app.stat-card-8t4QGU2C.js";
-import { t as fn } from "./peach-app.legacy-avatar-CV1xk6vD.js";
-var pn = m([(e, t) => j(e, "angleAxis", t, !1)], (e) => {
+import { ActivePoints as e, ActivityHeat as t, AnimatedItems as n, BAR_DOMAIN as r, CHART_CARD as i, CHART_COLORS as a, CartesianLabelListContextProvider as o, CategoryTick as s, ChartBackground as c, ChartContainer as l, ChartHead as u, ChartLegend as d, ChartLegendContent as f, ChartTip as p, ChartTooltip as m, ChartTooltipContent as h, DefaultZIndexes as g, Dots as _, EvilBarChart as v, ExpandableRanking as y, LabelListFromLabelProp as b, Layer as x, LoadingIndicator as S, PolarAngleAxis as C, PolarChart as ee, PolarLabelContextProvider as w, PolarLabelFromLabelProp as te, Polygon as ne, RegisterGraphicalItemId as re, SetPolarGraphicalItem as ie, SetPolarLegendPayload as ae, SetTooltipEntrySettings as oe, Text as se, ZIndexLayer as ce, adaptEventsOfChild as le, addRadiusAxis as ue, arrayTooltipSearcher as de, barLabel as fe, categoryAxisWidth as pe, cn as me, createSelector as T, defaultPolarChartProps as he, defaultPolarRadiusAxisProps as ge, fitLabel as _e, getAxisTypeBasedOnLayout as ve, getBandSizeOfAxis as ye, getClassNameFromUnknown as be, getColorsCount as xe, getTooltipNameProp as Se, getValueByDataKey as Ce, identity as we, interpolate as E, isArrayLike as Te, isCategoricalAxis as Ee, isNullish as De, iteratee as Oe, matchAnimationItems as ke, matchByIndex as Ae, noop as je, polarToCartesian as D, removeRadiusAxis as Me, resolveDefaultProps as O, selectAngleAxis as Ne, selectChartDataAndAlwaysIgnoreIndexes as Pe, selectChartLayout as Fe, selectPolarAxisScale as Ie, selectPolarAxisTicks as k, selectPolarViewBox as Le, selectRadiusAxis as Re, selectUnfilteredPolarItems as ze, svgPropertiesAndEvents as Be, svgPropertiesNoEvents as A, svgPropertiesNoEventsFromUnknown as Ve, tone as He, useAnimationCallbacks as Ue, useAnimationStartSnapshot as We, useAppDispatch as Ge, useAppSelector as j, useIsPanorama as Ke, usePolarChartLayout as qe } from "./peach-app.expandable-ranking-CyDn34Ar.js";
+import { $542a13ca2fa5b484$export$5b6b19405a83ff9d as Je, $b4f18e3395fe64d7$export$3d96ec278d3efce4 as Ye, $b4f18e3395fe64d7$export$3e41faf802a29e71 as Xe, $b4f18e3395fe64d7$export$b2539bed5023c21c as Ze, Button as M, ButtonLink as Qe, Disclosure as $e, E3 as et, EmptyState as N, FLOW_LABEL_X as tt, FLOW_VIEWBOX as nt, Gg as rt, IDLE_POLL_MS as it, Input as at, M6 as ot, MENU_ITEM as st, MENU_ITEM_INTERACTIVE as ct, MENU_POPOVER_SURFACE as lt, MenuDialog as ut, Note as P, OV as dt, Progress as ft, Rf as pt, SEGMENT as mt, SEGMENTED_TRACK as ht, SegmentedTabList as gt, Select$1 as _t, SelectItem as vt, TASTE_REFRESH_KEY as yt, TASTE_WINDOWS as bt, TaskProgress as xt, Wt as St, Xt as Ct, _8 as wt, __toESM as Tt, aB as Et, avatarInner as Dt, busyProps as F, cB as Ot, cardClass as I, clsx as L, configureTasteBrowser as kt, confirmModal as At, cx as jt, errorMessage as R, f1 as Mt, fetchTaste as Nt, fetchTasteJob as Pt, firstGrapheme as Ft, flowGraph as It, flowLabel as Lt, fmtSize as Rt, g4 as zt, historySpan as Bt, importTasteExport as Vt, keepPreviousData as Ht, mM as Ut, pv as z, queryClient as B, r2 as Wt, radarRows as Gt, rankDetail as Kt, rankShares as qt, removeTasteSource as Jt, require_jsx_runtime as Yt, require_react as Xt, siteMarkUrl as Zt, startTasteRefresh as Qt, tasteDate as $t, tasteDimensions as en, tasteHours as tn, tasteKey as V, topScores as nn, uo as rn, useBackgroundJob as an, useMutation as on, useQuery as sn } from "./peach-app.js";
+import { Page as cn } from "./peach-app.page-Irl_Wogd.js";
+import { STAT_STRIP as ln, StatCard as un, statCardClass as dn } from "./peach-app.stat-card-Q_AB9v0S.js";
+import { LEGACY_AVATAR_IMG as fn } from "./peach-app.legacy-avatar-CtPLcaNX.js";
+var pn = T([(e, t) => k(e, "angleAxis", t, !1)], (e) => {
if (e) return e.map((e) => e.coordinate);
-}), mn = m([(e, t) => j(e, "radiusAxis", t, !1)], (e) => {
+}), mn = T([(e, t) => k(e, "radiusAxis", t, !1)], (e) => {
if (e) return e.map((e) => e.coordinate);
-}), H = /* @__PURE__ */ Jt(Qt()), hn = [
+}), H = /* @__PURE__ */ Tt(Xt()), hn = [
"gridType",
"radialLines",
"angleAxisId",
@@ -99,15 +99,15 @@ function xn(e, t) {
var Sn = (e, t, n, r) => {
var i = "";
return r.forEach((r, a) => {
- var o = p(t, n, e, r);
+ var o = D(t, n, e, r);
i += a ? `L ${o.x},${o.y}` : `M ${o.x},${o.y}`;
}), i += "Z", i;
}, Cn = (e) => {
var t = e.cx, n = e.cy, r = e.innerRadius, i = e.outerRadius, a = e.polarAngles, o = e.radialLines;
if (!a || !a.length || !o) return null;
- var s = W({}, O(e));
+ var s = W({}, A(e));
return /*#__PURE__*/ H.createElement("g", { className: "recharts-polar-grid-angle" }, a.map((e) => {
- var a = p(t, n, r, e), o = p(t, n, i, e);
+ var a = D(t, n, r, e), o = D(t, n, i, e);
return /*#__PURE__*/ H.createElement("line", U({ key: `line-${e}` }, s, {
x1: a.x,
y1: a.y,
@@ -116,17 +116,17 @@ var Sn = (e, t, n, r) => {
}));
}));
}, wn = (e) => {
- var t = e.cx, n = e.cy, r = e.radius, i = W({}, O(e));
+ var t = e.cx, n = e.cy, r = e.radius, i = W({}, A(e));
return /*#__PURE__*/ H.createElement("circle", U({}, i, {
- className: z("recharts-polar-grid-concentric-circle", e.className),
+ className: L("recharts-polar-grid-concentric-circle", e.className),
cx: t,
cy: n,
r
}));
}, Tn = (e) => {
- var t = e.radius, n = W({}, O(e));
+ var t = e.radius, n = W({}, A(e));
return /*#__PURE__*/ H.createElement("path", U({}, n, {
- className: z("recharts-polar-grid-concentric-polygon", e.className),
+ className: L("recharts-polar-grid-concentric-polygon", e.className),
d: Sn(t, e.cx, e.cy, e.polarAngles)
}));
}, En = (e) => {
@@ -148,12 +148,12 @@ var Sn = (e, t, n, r) => {
radiusAxisId: 0,
gridType: "polygon",
radialLines: !0,
- zIndex: c.grid,
+ zIndex: g.grid,
stroke: "#ccc",
strokeWidth: 1,
fill: "none"
}, On = (e) => {
- var t = k(e, Dn), n = t.gridType, r = t.radialLines, i = t.angleAxisId, a = t.radiusAxisId, o = t.cx, s = t.cy, c = t.innerRadius, l = t.outerRadius, u = t.polarAngles, d = t.polarRadius, f = t.zIndex, p = gn(t, hn), m = D(T), h = D((e) => pn(e, i)), g = D((e) => mn(e, a)), _ = Array.isArray(u) ? u : h, v = Array.isArray(d) ? d : g;
+ var t = O(e, Dn), n = t.gridType, r = t.radialLines, i = t.angleAxisId, a = t.radiusAxisId, o = t.cx, s = t.cy, c = t.innerRadius, l = t.outerRadius, u = t.polarAngles, d = t.polarRadius, f = t.zIndex, p = gn(t, hn), m = j(Le), h = j((e) => pn(e, i)), g = j((e) => mn(e, a)), _ = Array.isArray(u) ? u : h, v = Array.isArray(d) ? d : g;
if (_ == null || v == null) return null;
var y = W({
cx: m?.cx ?? o ?? 0,
@@ -164,7 +164,7 @@ var Sn = (e, t, n, r) => {
polarRadius: v,
zIndex: f
}, p);
- return y.outerRadius <= 0 ? null : /*#__PURE__*/ H.createElement(Se, { zIndex: y.zIndex }, /*#__PURE__*/ H.createElement("g", { className: "recharts-polar-grid" }, /*#__PURE__*/ H.createElement(En, U({
+ return y.outerRadius <= 0 ? null : /*#__PURE__*/ H.createElement(ce, { zIndex: y.zIndex }, /*#__PURE__*/ H.createElement("g", { className: "recharts-polar-grid" }, /*#__PURE__*/ H.createElement(En, U({
gridType: n,
radialLines: r
}, y, {
@@ -186,29 +186,29 @@ function kn(e) {
}
//#endregion
//#region node_modules/es-toolkit/dist/compat/math/maxBy.mjs
-function An(e, n = t) {
+function An(e, t = we) {
if (e == null) return;
- let r = kn(e);
- if (r.length === 0) return;
- let i = ce(n), a, o;
- for (let e = 0; e < r.length; e++) {
- let t = r[e], n = i(t, e, r);
- n == null || Number.isNaN(n) || typeof n == "symbol" || (o === void 0 || n > o) && (o = n, a = t);
+ let n = kn(e);
+ if (n.length === 0) return;
+ let r = Oe(t), i, a;
+ for (let e = 0; e < n.length; e++) {
+ let t = n[e], o = r(t, e, n);
+ o == null || Number.isNaN(o) || typeof o == "symbol" || (a === void 0 || o > a) && (a = o, i = t);
}
- return a;
+ return i;
}
//#endregion
//#region node_modules/es-toolkit/dist/compat/math/minBy.mjs
-function jn(e, n = t) {
+function jn(e, t = we) {
if (e == null) return;
- let r = kn(e);
- if (r.length === 0) return;
- let i = ce(n), a, o;
- for (let e = 0; e < r.length; e++) {
- let t = r[e], n = i(t, e, r);
- n == null || Number.isNaN(n) || typeof n == "symbol" || (o === void 0 || n < o) && (o = n, a = t);
+ let n = kn(e);
+ if (n.length === 0) return;
+ let r = Oe(t), i, a;
+ for (let e = 0; e < n.length; e++) {
+ let t = n[e], o = r(t, e, n);
+ o == null || Number.isNaN(o) || typeof o == "symbol" || (a === void 0 || o < a) && (a = o, i = t);
}
- return a;
+ return i;
}
//#endregion
//#region node_modules/recharts/es6/polar/PolarRadiusAxis.js
@@ -294,18 +294,18 @@ function Bn(e, t) {
return n;
}
var Vn = "radiusAxis";
-function Hn(t) {
- var n = oe(), r = C(), i = (0, H.useMemo)(() => {
- var e = t.type, n = zn(t, Mn), i = Ve(r, "radiusAxis", e);
- if (i != null) return K(K({}, n), {}, { type: i });
- }, [t, r]);
- return (0, H.useEffect)(() => i == null ? de : (n(e(i)), () => {
- n(ve(i));
- }), [n, i]), null;
+function Hn(e) {
+ var t = Ge(), n = qe(), r = (0, H.useMemo)(() => {
+ var t = e.type, r = zn(e, Mn), i = ve(n, "radiusAxis", t);
+ if (i != null) return K(K({}, r), {}, { type: i });
+ }, [e, n]);
+ return (0, H.useEffect)(() => r == null ? je : (t(ue(r)), () => {
+ t(Me(r));
+ }), [t, r]), null;
}
var Un = (e, t, n, r) => {
var i = e.coordinate;
- return p(n, r, i, t);
+ return D(n, r, i, t);
}, Wn = (e) => {
var t;
switch (e) {
@@ -330,15 +330,15 @@ var Un = (e, t, n, r) => {
clockWise: !1
};
}, Kn = (e, t) => {
- var n = e.cx, r = e.cy, i = e.angle, a = e.axisLine, o = zn(e, Nn), s = t.reduce((e, t) => [Math.min(e[0], t.coordinate), Math.max(e[1], t.coordinate)], [Infinity, -Infinity]), c = p(n, r, s[0], i), l = p(n, r, s[1], i), u = K(K(K({}, O(o)), {}, { fill: "none" }, O(a)), {}, {
+ var n = e.cx, r = e.cy, i = e.angle, a = e.axisLine, o = zn(e, Nn), s = t.reduce((e, t) => [Math.min(e[0], t.coordinate), Math.max(e[1], t.coordinate)], [Infinity, -Infinity]), c = D(n, r, s[0], i), l = D(n, r, s[1], i), u = K(K(K({}, A(o)), {}, { fill: "none" }, A(a)), {}, {
x1: c.x,
y1: c.y,
x2: l.x,
y2: l.y
});
return /*#__PURE__*/ H.createElement("line", G({ className: "recharts-polar-radius-axis-line" }, u));
-}, qn = (e, t, n) => /*#__PURE__*/ H.isValidElement(e) ? /*#__PURE__*/ H.cloneElement(e, t) : typeof e == "function" ? e(t) : /*#__PURE__*/ H.createElement(be, G({}, t, { className: "recharts-polar-radius-axis-tick-value" }), n), Jn = (e, t) => {
- var n = e.angle, r = e.tickFormatter, i = e.stroke, a = e.tick, o = zn(e, Pn), s = Wn(e.orientation), c = O(o), l = we(a), u = t.map((t, o) => {
+}, qn = (e, t, n) => /*#__PURE__*/ H.isValidElement(e) ? /*#__PURE__*/ H.cloneElement(e, t) : typeof e == "function" ? e(t) : /*#__PURE__*/ H.createElement(se, G({}, t, { className: "recharts-polar-radius-axis-tick-value" }), n), Jn = (e, t) => {
+ var n = e.angle, r = e.tickFormatter, i = e.stroke, a = e.tick, o = zn(e, Pn), s = Wn(e.orientation), c = A(o), l = Ve(a), u = t.map((t, o) => {
var u = Un(t, e.angle, e.cx, e.cy), d = K(K(K(K({
textAnchor: s,
transform: `rotate(${90 - n}, ${u.x}, ${u.y})`
@@ -346,20 +346,20 @@ var Un = (e, t, n, r) => {
stroke: "none",
fill: i
}, l), {}, { index: o }, u), {}, { payload: t });
- return /*#__PURE__*/ H.createElement(M, G({
- className: z("recharts-polar-radius-axis-tick", x(a)),
+ return /*#__PURE__*/ H.createElement(x, G({
+ className: L("recharts-polar-radius-axis-tick", be(a)),
key: `tick-${t.coordinate}`
- }, Ie(e, t, o)), qn(a, d, r ? r(t.value, o) : t.value));
+ }, le(e, t, o)), qn(a, d, r ? r(t.value, o) : t.value));
});
- return /*#__PURE__*/ H.createElement(M, { className: "recharts-polar-radius-axis-ticks" }, u);
+ return /*#__PURE__*/ H.createElement(x, { className: "recharts-polar-radius-axis-ticks" }, u);
}, Yn = (e) => {
- var t = e.radiusAxisId, n = D(T), r = D((e) => Le(e, "radiusAxis", t)), i = D((e) => j(e, "radiusAxis", t, !1));
+ var t = e.radiusAxisId, n = j(Le), r = j((e) => Ie(e, "radiusAxis", t)), i = j((e) => k(e, "radiusAxis", t, !1));
if (n == null || !i || !i.length || r == null) return null;
var a = K(K({}, e), {}, { scale: r }, n), o = a.tick, s = a.axisLine;
- return /*#__PURE__*/ H.createElement(Se, { zIndex: a.zIndex }, /*#__PURE__*/ H.createElement(M, { className: z("recharts-polar-radius-axis", Vn, a.className) }, s && Kn(a, i), o && Jn(a, i), /*#__PURE__*/ H.createElement(Re, Gn(a.angle, a.cx, a.cy, i), /*#__PURE__*/ H.createElement(_e, { label: a.label }), a.children)));
+ return /*#__PURE__*/ H.createElement(ce, { zIndex: a.zIndex }, /*#__PURE__*/ H.createElement(x, { className: L("recharts-polar-radius-axis", Vn, a.className) }, s && Kn(a, i), o && Jn(a, i), /*#__PURE__*/ H.createElement(w, Gn(a.angle, a.cx, a.cy, i), /*#__PURE__*/ H.createElement(te, { label: a.label }), a.children)));
};
function Xn(e) {
- var t = k(e, te);
+ var t = O(e, ge);
return /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(Hn, {
domain: t.domain,
id: t.radiusAxisId,
@@ -388,7 +388,7 @@ function Zn(e) {
//#endregion
//#region node_modules/es-toolkit/dist/compat/array/last.mjs
function Qn(e) {
- if (S(e) && e.length !== 0) return Zn(kn(e));
+ if (Te(e) && e.length !== 0) return Zn(kn(e));
}
//#endregion
//#region node_modules/recharts/es6/state/selectors/radarSelectors.js
@@ -402,30 +402,30 @@ function $n(e, t) {
}
return n;
}
-function q(e) {
+function er(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t];
t % 2 ? $n(Object(n), !0).forEach(function(t) {
- er(e, t, n[t]);
+ tr(e, t, n[t]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : $n(Object(n)).forEach(function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
});
}
return e;
}
-function er(e, t, n) {
- return (t = tr(t)) in e ? Object.defineProperty(e, t, {
+function tr(e, t, n) {
+ return (t = nr(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
-function tr(e) {
- var t = nr(e, "string");
+function nr(e) {
+ var t = rr(e, "string");
return typeof t == "symbol" ? t : t + "";
}
-function nr(e, t) {
+function rr(e, t) {
if (typeof e != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
@@ -435,16 +435,16 @@ function nr(e, t) {
}
return (t === "string" ? String : Number)(e);
}
-var rr = (e, t) => Le(e, "radiusAxis", t), ir = m([rr], (e) => {
+var ir = (e, t) => Ie(e, "radiusAxis", t), ar = T([ir], (e) => {
if (e != null) return { scale: e };
-}), ar = m([a, rr], (e, t) => {
- if (e != null && t != null) return q(q({}, e), {}, { scale: t });
-}), or = (e, t, n, r) => j(e, "radiusAxis", t, r), sr = (e, t, n) => Ue(e, n), cr = (e, t, n) => Le(e, "angleAxis", n), lr = m([sr, cr], (e, t) => {
- if (e != null && t != null) return q(q({}, e), {}, { scale: t });
-}), ur = (e, t, n, r) => j(e, "angleAxis", n, r), dr = m([
- sr,
+}), or = T([Re, ir], (e, t) => {
+ if (e != null && t != null) return er(er({}, e), {}, { scale: t });
+}), sr = (e, t, n, r) => k(e, "radiusAxis", t, r), cr = (e, t, n) => Ne(e, n), lr = (e, t, n) => Ie(e, "angleAxis", n), ur = T([cr, lr], (e, t) => {
+ if (e != null && t != null) return er(er({}, e), {}, { scale: t });
+}), dr = (e, t, n, r) => k(e, "angleAxis", n, r), fr = T([
cr,
- T
+ lr,
+ Le
], (e, t, n) => {
if (n != null && t != null) return {
scale: t,
@@ -453,40 +453,40 @@ var rr = (e, t) => Le(e, "radiusAxis", t), ir = m([rr], (e) => {
cx: n.cx,
cy: n.cy
};
-}), fr = (e, t, n, r, i) => i, pr = m([
- _,
- ar,
+}), pr = (e, t, n, r, i) => i, mr = T([
+ Fe,
or,
- lr,
- ur
-], (e, t, n, i, a) => h(e, "radiusAxis") ? r(t, n, !1) : r(i, a, !1)), mr = m([fe, fr], (e, t) => {
+ sr,
+ ur,
+ dr
+], (e, t, n, r, i) => Ee(e, "radiusAxis") ? ye(t, n, !1) : ye(r, i, !1)), hr = T([ze, pr], (e, t) => {
if (e != null) return e.find((e) => e.type === "radar" && t === e.id)?.dataKey;
-}), hr = m([
- ir,
- dr,
- v,
- mr,
- pr
+}), gr = T([
+ ar,
+ fr,
+ Pe,
+ hr,
+ mr
], (e, t, n, r, i) => {
var a = n.chartData, o = n.dataStartIndex, s = n.dataEndIndex;
- if (e != null && t != null && a != null && i != null && r != null) return Dr({
+ if (e != null && t != null && a != null && i != null && r != null) return Or({
radiusAxis: e,
angleAxis: t,
displayedData: a.slice(o, s + 1),
dataKey: r,
bandSize: i
});
-}), gr = ["id"];
-function J() {
- return J = Object.assign ? Object.assign.bind() : function(e) {
+}), _r = ["id"];
+function q() {
+ return q = Object.assign ? Object.assign.bind() : function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
}
return e;
- }, J.apply(null, arguments);
+ }, q.apply(null, arguments);
}
-function _r(e, t) {
+function vr(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
@@ -496,30 +496,30 @@ function _r(e, t) {
}
return n;
}
-function Y(e) {
+function J(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t];
- t % 2 ? _r(Object(n), !0).forEach(function(t) {
- vr(e, t, n[t]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : _r(Object(n)).forEach(function(t) {
+ t % 2 ? vr(Object(n), !0).forEach(function(t) {
+ yr(e, t, n[t]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : vr(Object(n)).forEach(function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
});
}
return e;
}
-function vr(e, t, n) {
- return (t = yr(t)) in e ? Object.defineProperty(e, t, {
+function yr(e, t, n) {
+ return (t = br(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
-function yr(e) {
- var t = br(e, "string");
+function br(e) {
+ var t = xr(e, "string");
return typeof t == "symbol" ? t : t + "";
}
-function br(e, t) {
+function xr(e, t) {
if (typeof e != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
@@ -529,16 +529,16 @@ function br(e, t) {
}
return (t === "string" ? String : Number)(e);
}
-function xr(e, t) {
+function Sr(e, t) {
if (e == null) return {};
- var n, r, i = Sr(e, t);
+ var n, r, i = Cr(e, t);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
}
return i;
}
-function Sr(e, t) {
+function Cr(e, t) {
if (e == null) return {};
var n = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -547,44 +547,44 @@ function Sr(e, t) {
}
return n;
}
-function Cr(e, t) {
+function wr(e, t) {
return e && e !== "none" ? e : t;
}
-var wr = (e) => {
+var Tr = (e) => {
var t = e.dataKey, n = e.name, r = e.stroke, i = e.fill, a = e.legendType;
return [{
inactive: e.hide,
dataKey: t,
type: a,
- color: Cr(r, i),
- value: ae(n, t),
+ color: wr(r, i),
+ value: Se(n, t),
payload: e
}];
-}, Tr = /*#__PURE__*/ H.memo((e) => {
+}, Er = /*#__PURE__*/ H.memo((e) => {
var t = e.dataKey, n = e.stroke, r = e.strokeWidth, i = e.fill, a = e.name, o = e.hide, s = e.tooltipType, c = e.id, l = {
dataDefinedOnItem: void 0,
- getPosition: de,
+ getPosition: je,
settings: {
stroke: n,
strokeWidth: r,
fill: i,
nameKey: void 0,
dataKey: t,
- name: ae(a, t),
+ name: Se(a, t),
hide: o,
type: s,
- color: Cr(n, i),
+ color: wr(n, i),
unit: "",
graphicalItemId: c
}
};
- return /*#__PURE__*/ H.createElement(u, { tooltipEntrySettings: l });
+ return /*#__PURE__*/ H.createElement(oe, { tooltipEntrySettings: l });
});
-function Er(e) {
+function Dr(e) {
var t = e.points, n = e.props, r = n.dot, i = n.dataKey;
n.id;
- var a = xr(n, gr), o = O(a);
- return /*#__PURE__*/ H.createElement(l, {
+ var a = Sr(n, _r), o = A(a);
+ return /*#__PURE__*/ H.createElement(_, {
points: t,
dot: r,
className: "recharts-radar-dots",
@@ -593,33 +593,33 @@ function Er(e) {
baseProps: o
});
}
-function Dr(e) {
+function Or(e) {
var t = e.radiusAxis, n = e.angleAxis, r = e.displayedData, i = e.dataKey, a = e.bandSize, o = n.cx, s = n.cy, c = !1, l = [], u = n.type === "number" ? 0 : a ?? 0;
r.forEach((e, r) => {
- var a = d(e, n.dataKey, r), f = d(e, i), m = (n.scale.map(a) ?? 0) + u, h = Array.isArray(f) ? Qn(f) : f, g = je(h) ? 0 : t.scale.map(h) ?? 0;
- Array.isArray(f) && f.length >= 2 && (c = !0), l.push(Y(Y({}, p(o, s, g, m)), {}, {
+ var a = Ce(e, n.dataKey, r), d = Ce(e, i), f = (n.scale.map(a) ?? 0) + u, p = Array.isArray(d) ? Qn(d) : d, m = De(p) ? 0 : t.scale.map(p) ?? 0;
+ Array.isArray(d) && d.length >= 2 && (c = !0), l.push(J(J({}, D(o, s, m, f)), {}, {
name: a,
- value: f,
+ value: d,
cx: o,
cy: s,
- radius: g,
- angle: m,
+ radius: m,
+ angle: f,
payload: e
}));
});
- var f = [];
+ var d = [];
return c && l.forEach((e) => {
if (Array.isArray(e.value)) {
- var n = e.value[0], r = je(n) ? 0 : t.scale.map(n) ?? 0;
- f.push(Y(Y({}, e), {}, { radius: r }, p(o, s, r, e.angle)));
- } else f.push(e);
+ var n = e.value[0], r = De(n) ? 0 : t.scale.map(n) ?? 0;
+ d.push(J(J({}, e), {}, { radius: r }, D(o, s, r, e.angle)));
+ } else d.push(e);
}), {
points: l,
isRange: c,
- baseLinePoints: f
+ baseLinePoints: d
};
}
-function Or(e) {
+function kr(e) {
var t = e.showLabels, n = e.points, r = e.children, i = n.map((e) => {
var t = {
x: e.x,
@@ -629,7 +629,7 @@ function Or(e) {
upperWidth: 0,
height: 0
};
- return Y(Y({}, t), {}, {
+ return J(J({}, t), {}, {
value: e.value ?? "",
payload: e.payload,
parentViewBox: void 0,
@@ -637,12 +637,12 @@ function Or(e) {
fill: void 0
});
});
- return /*#__PURE__*/ H.createElement(Pe, { value: t ? i : void 0 }, r);
+ return /*#__PURE__*/ H.createElement(o, { value: t ? i : void 0 }, r);
}
-function kr(e) {
+function Ar(e) {
var t = e.points, n = e.baseLinePoints, r = e.props;
if (t == null) return null;
- var i = r.shape, a = r.isRange, o = r.connectNulls, s = /*#__PURE__*/ H.isValidElement(i) ? /*#__PURE__*/ H.cloneElement(i, Y(Y({}, r), {}, { points: t })) : typeof i == "function" ? i(Y(Y({}, r), {}, { points: t })) : /*#__PURE__*/ H.createElement(Oe, J({}, Ne(r), {
+ var i = r.shape, a = r.isRange, o = r.connectNulls, s = /*#__PURE__*/ H.isValidElement(i) ? /*#__PURE__*/ H.cloneElement(i, J(J({}, r), {}, { points: t })) : typeof i == "function" ? i(J(J({}, r), {}, { points: t })) : /*#__PURE__*/ H.createElement(ne, q({}, Be(r), {
onMouseEnter: (e) => {
var t = r.onMouseEnter;
t && t(r, e);
@@ -655,24 +655,24 @@ function kr(e) {
baseLinePoints: a ? n : void 0,
connectNulls: o
}));
- return /*#__PURE__*/ H.createElement(M, { className: "recharts-radar-polygon" }, s, /*#__PURE__*/ H.createElement(Er, {
+ return /*#__PURE__*/ H.createElement(x, { className: "recharts-radar-polygon" }, s, /*#__PURE__*/ H.createElement(Dr, {
props: r,
points: t
}));
}
-var Ar = (e, t) => e == null ? [] : t === 1 ? e.flatMap((e) => e.status === "removed" ? [] : [e.next]) : e.flatMap((e) => e.status === "removed" ? [] : e.status === "matched" ? [Y(Y({}, e.next), {}, {
- x: A(e.prev.x, e.next.x, t),
- y: A(e.prev.y, e.next.y, t)
-})] : [Y(Y({}, e.next), {}, {
- x: A(e.next.cx, e.next.x, t),
- y: A(e.next.cy, e.next.y, t)
+var jr = (e, t) => e == null ? [] : t === 1 ? e.flatMap((e) => e.status === "removed" ? [] : [e.next]) : e.flatMap((e) => e.status === "removed" ? [] : e.status === "matched" ? [J(J({}, e.next), {}, {
+ x: E(e.prev.x, e.next.x, t),
+ y: E(e.prev.y, e.next.y, t)
+})] : [J(J({}, e.next), {}, {
+ x: E(e.next.cx, e.next.x, t),
+ y: E(e.next.cy, e.next.y, t)
})]);
-function jr(e) {
- var t = e.props, r = e.previousPointsRef, i = e.previousBaseLinePointsRef, a = t.points, o = t.baseLinePoints, s = t.isAnimationActive, c = t.animationBegin, l = t.animationDuration, u = t.animationEasing, d = t.animationMatchBy, f = t.animationInterpolateFn, p = t.onAnimationStart, m = t.onAnimationEnd, h = n(t, i), g = h.startValue, _ = re(g ?? null, o, d), v = Ge(p, m), y = v.isAnimating, b = v.handleAnimationStart, x = v.handleAnimationEnd, S = C();
- return S == null ? null : /*#__PURE__*/ H.createElement(Or, {
+function Mr(e) {
+ var t = e.props, r = e.previousPointsRef, i = e.previousBaseLinePointsRef, a = t.points, o = t.baseLinePoints, s = t.isAnimationActive, c = t.animationBegin, l = t.animationDuration, u = t.animationEasing, d = t.animationMatchBy, f = t.animationInterpolateFn, p = t.onAnimationStart, m = t.onAnimationEnd, h = We(t, i), g = h.startValue, _ = ke(g ?? null, o, d), v = Ue(p, m), y = v.isAnimating, x = v.handleAnimationStart, S = v.handleAnimationEnd, C = qe();
+ return C == null ? null : /*#__PURE__*/ H.createElement(kr, {
showLabels: !y,
points: a
- }, /*#__PURE__*/ H.createElement(ee, {
+ }, /*#__PURE__*/ H.createElement(n, {
animationInput: t,
animationIdPrefix: "recharts-radar-",
items: a,
@@ -681,69 +681,69 @@ function jr(e) {
animationBegin: c,
animationDuration: l,
animationEasing: u,
- onAnimationStart: b,
- onAnimationEnd: x,
+ onAnimationStart: x,
+ onAnimationEnd: S,
animationInterpolateFn: f,
animationMatchBy: d,
- layout: S
+ layout: C
}, (e, n) => {
- var r = n === 1 ? o : f(_, n, S);
- return h.syncStepValue(r, n), /*#__PURE__*/ H.createElement(kr, {
+ var r = n === 1 ? o : f(_, n, C);
+ return h.syncStepValue(r, n), /*#__PURE__*/ H.createElement(Ar, {
points: e,
baseLinePoints: r,
props: t
});
- }), /*#__PURE__*/ H.createElement(he, { label: t.label }), t.children);
+ }), /*#__PURE__*/ H.createElement(b, { label: t.label }), t.children);
}
-function Mr(e) {
+function Nr(e) {
var t = (0, H.useRef)(void 0), n = (0, H.useRef)(void 0);
- return /*#__PURE__*/ H.createElement(jr, {
+ return /*#__PURE__*/ H.createElement(Mr, {
props: e,
previousPointsRef: t,
previousBaseLinePointsRef: n
});
}
-var Nr = {
+var Pr = {
activeDot: !0,
angleAxisId: 0,
animationBegin: 0,
animationDuration: 1500,
animationEasing: "ease",
- animationMatchBy: ne,
- animationInterpolateFn: Ar,
+ animationMatchBy: Ae,
+ animationInterpolateFn: jr,
dot: !1,
hide: !1,
isAnimationActive: "auto",
label: !1,
legendType: "rect",
radiusAxisId: 0,
- zIndex: c.area
+ zIndex: g.area
};
-function Pr(e) {
- var t = e.hide, n = e.className, r = e.points;
- if (t) return null;
- var i = z("recharts-radar", n);
- return /*#__PURE__*/ H.createElement(Se, { zIndex: e.zIndex }, /*#__PURE__*/ H.createElement(M, { className: i }, /*#__PURE__*/ H.createElement(Mr, e)), /*#__PURE__*/ H.createElement(b, {
- points: r,
- mainColor: Cr(e.stroke, e.fill),
- itemDataKey: e.dataKey,
- activeDot: e.activeDot
+function Fr(t) {
+ var n = t.hide, r = t.className, i = t.points;
+ if (n) return null;
+ var a = L("recharts-radar", r);
+ return /*#__PURE__*/ H.createElement(ce, { zIndex: t.zIndex }, /*#__PURE__*/ H.createElement(x, { className: a }, /*#__PURE__*/ H.createElement(Nr, t)), /*#__PURE__*/ H.createElement(e, {
+ points: i,
+ mainColor: wr(t.stroke, t.fill),
+ itemDataKey: t.dataKey,
+ activeDot: t.activeDot
}));
}
-function Fr(e) {
- var t = Ke(), n = D((n) => hr(n, e.radiusAxisId, e.angleAxisId, t, e.id));
- return n?.points == null ? null : /*#__PURE__*/ H.createElement(Pr, J({}, e, {
+function Ir(e) {
+ var t = Ke(), n = j((n) => gr(n, e.radiusAxisId, e.angleAxisId, t, e.id));
+ return n?.points == null ? null : /*#__PURE__*/ H.createElement(Fr, q({}, e, {
points: n?.points,
baseLinePoints: n?.baseLinePoints,
isRange: n?.isRange
}));
}
-function Ir(e) {
- var t = k(e, Nr);
- return /*#__PURE__*/ H.createElement(g, {
+function Lr(e) {
+ var t = O(e, Pr);
+ return /*#__PURE__*/ H.createElement(re, {
id: t.id,
type: "radar"
- }, (e) => /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(f, {
+ }, (e) => /*#__PURE__*/ H.createElement(H.Fragment, null, /*#__PURE__*/ H.createElement(ie, {
type: "radar",
id: e,
data: void 0,
@@ -751,7 +751,7 @@ function Ir(e) {
hide: t.hide,
angleAxisId: t.angleAxisId,
radiusAxisId: t.radiusAxisId
- }), /*#__PURE__*/ H.createElement(ie, { legendPayload: wr(t) }), /*#__PURE__*/ H.createElement(Tr, {
+ }), /*#__PURE__*/ H.createElement(ae, { legendPayload: Tr(t) }), /*#__PURE__*/ H.createElement(Er, {
dataKey: t.dataKey,
stroke: t.stroke,
strokeWidth: t.strokeWidth,
@@ -760,12 +760,12 @@ function Ir(e) {
hide: t.hide,
tooltipType: t.tooltipType,
id: e
- }), /*#__PURE__*/ H.createElement(Fr, J({}, t, { id: e }))));
+ }), /*#__PURE__*/ H.createElement(Ir, q({}, t, { id: e }))));
}
-Ir.displayName = "Radar";
+Lr.displayName = "Radar";
//#endregion
//#region node_modules/recharts/es6/chart/RadarChart.js
-function Lr(e, t) {
+function Rr(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
@@ -775,30 +775,30 @@ function Lr(e, t) {
}
return n;
}
-function Rr(e) {
+function zr(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t];
- t % 2 ? Lr(Object(n), !0).forEach(function(t) {
- zr(e, t, n[t]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Lr(Object(n)).forEach(function(t) {
+ t % 2 ? Rr(Object(n), !0).forEach(function(t) {
+ Br(e, t, n[t]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Rr(Object(n)).forEach(function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
});
}
return e;
}
-function zr(e, t, n) {
- return (t = Br(t)) in e ? Object.defineProperty(e, t, {
+function Br(e, t, n) {
+ return (t = Vr(t)) in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
-function Br(e) {
- var t = Vr(e, "string");
+function Vr(e) {
+ var t = Hr(e, "string");
return typeof t == "symbol" ? t : t + "";
}
-function Vr(e, t) {
+function Hr(e, t) {
if (typeof e != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
@@ -808,25 +808,25 @@ function Vr(e, t) {
}
return (t === "string" ? String : Number)(e);
}
-var Hr = ["axis"], Ur = Rr(Rr({}, y), {}, {
+var Ur = ["axis"], Wr = zr(zr({}, he), {}, {
layout: "centric",
startAngle: 90,
endAngle: -270
-}), Wr = /*#__PURE__*/ (0, H.forwardRef)((e, t) => {
- var n = k(e, Ur);
- return /*#__PURE__*/ H.createElement(o, {
+}), Gr = /*#__PURE__*/ (0, H.forwardRef)((e, t) => {
+ var n = O(e, Wr);
+ return /*#__PURE__*/ H.createElement(ee, {
chartName: "RadarChart",
defaultTooltipEventType: "axis",
- validateTooltipEventTypes: Hr,
- tooltipPayloadSearcher: Te,
+ validateTooltipEventTypes: Ur,
+ tooltipPayloadSearcher: de,
categoricalChartProps: n,
ref: t
});
-}), X = Et(), Gr = H.memo(function({ cx: e, cy: t, dataKey: n, chartId: r, className: i, fillOpacity: a = 1, type: o = "default", maskId: s }) {
+}), Y = Yt(), Kr = H.memo(function({ cx: e, cy: t, dataKey: n, chartId: r, className: i, fillOpacity: a = 1, type: o = "default", maskId: s }) {
let c = H.useId().replace(/:/g, ""), l = `url(#${r}-colors-${String(n)})`;
if (e === void 0 || t === void 0) return null;
switch (o) {
- case "border": return /* @__PURE__ */ (0, X.jsx)(qr, {
+ case "border": return /* @__PURE__ */ (0, Y.jsx)(Jr, {
cx: e,
cy: t,
dotId: c,
@@ -835,7 +835,7 @@ var Hr = ["axis"], Ur = Rr(Rr({}, y), {}, {
className: i,
maskId: s
});
- case "colored-border": return /* @__PURE__ */ (0, X.jsx)(Jr, {
+ case "colored-border": return /* @__PURE__ */ (0, Y.jsx)(Yr, {
cx: e,
cy: t,
dotId: c,
@@ -844,7 +844,7 @@ var Hr = ["axis"], Ur = Rr(Rr({}, y), {}, {
className: i,
maskId: s
});
- default: return /* @__PURE__ */ (0, X.jsx)(Kr, {
+ default: return /* @__PURE__ */ (0, Y.jsx)(qr, {
cx: e,
cy: t,
dotId: c,
@@ -854,17 +854,17 @@ var Hr = ["axis"], Ur = Rr(Rr({}, y), {}, {
maskId: s
});
}
-}), Kr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, X.jsxs)("g", {
+}), qr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, Y.jsxs)("g", {
className: a,
mask: o ? `url(#${o})` : void 0,
- children: [/* @__PURE__ */ (0, X.jsx)("defs", { children: /* @__PURE__ */ (0, X.jsx)("clipPath", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("defs", { children: /* @__PURE__ */ (0, Y.jsx)("clipPath", {
id: `dot-clip-${n}`,
- children: /* @__PURE__ */ (0, X.jsx)("circle", {
+ children: /* @__PURE__ */ (0, Y.jsx)("circle", {
cx: e,
cy: t,
r: 3
})
- }) }), /* @__PURE__ */ (0, X.jsx)("rect", {
+ }) }), /* @__PURE__ */ (0, Y.jsx)("rect", {
x: "0",
y: t - 3,
width: "100%",
@@ -874,26 +874,26 @@ var Hr = ["axis"], Ur = Rr(Rr({}, y), {}, {
clipPath: `url(#dot-clip-${n})`
})]
}));
-Kr.displayName = "DefaultDot";
-var qr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, X.jsxs)("g", {
- className: s(a, "text-background"),
+qr.displayName = "DefaultDot";
+var Jr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, Y.jsxs)("g", {
+ className: me(a, "text-background"),
mask: o ? `url(#${o})` : void 0,
children: [
- /* @__PURE__ */ (0, X.jsx)("defs", { children: /* @__PURE__ */ (0, X.jsx)("clipPath", {
+ /* @__PURE__ */ (0, Y.jsx)("defs", { children: /* @__PURE__ */ (0, Y.jsx)("clipPath", {
id: `dot-clip-${n}`,
- children: /* @__PURE__ */ (0, X.jsx)("circle", {
+ children: /* @__PURE__ */ (0, Y.jsx)("circle", {
cx: e,
cy: t,
r: 6
})
}) }),
- /* @__PURE__ */ (0, X.jsx)("circle", {
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
cx: e,
cy: t,
r: 6,
fill: "currentColor"
}),
- /* @__PURE__ */ (0, X.jsx)("rect", {
+ /* @__PURE__ */ (0, Y.jsx)("rect", {
x: "0",
y: t - (6 - 5 / 2),
width: "100%",
@@ -902,9 +902,9 @@ var qr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, class
fillOpacity: r,
clipPath: `url(#dot-clip-inner-${n})`
}),
- /* @__PURE__ */ (0, X.jsx)("defs", { children: /* @__PURE__ */ (0, X.jsx)("clipPath", {
+ /* @__PURE__ */ (0, Y.jsx)("defs", { children: /* @__PURE__ */ (0, Y.jsx)("clipPath", {
id: `dot-clip-inner-${n}`,
- children: /* @__PURE__ */ (0, X.jsx)("circle", {
+ children: /* @__PURE__ */ (0, Y.jsx)("circle", {
cx: e,
cy: t,
r: 6 - 5 / 2
@@ -912,20 +912,20 @@ var qr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, class
}) })
]
}));
-qr.displayName = "PrimaryBorderDot";
-var Jr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, X.jsxs)("g", {
- className: s(a, "text-background"),
+Jr.displayName = "PrimaryBorderDot";
+var Yr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, className: a, maskId: o }) => /* @__PURE__ */ (0, Y.jsxs)("g", {
+ className: me(a, "text-background"),
mask: o ? `url(#${o})` : void 0,
children: [
- /* @__PURE__ */ (0, X.jsx)("defs", { children: /* @__PURE__ */ (0, X.jsx)("clipPath", {
+ /* @__PURE__ */ (0, Y.jsx)("defs", { children: /* @__PURE__ */ (0, Y.jsx)("clipPath", {
id: `dot-clip-${n}`,
- children: /* @__PURE__ */ (0, X.jsx)("circle", {
+ children: /* @__PURE__ */ (0, Y.jsx)("circle", {
cx: e,
cy: t,
r: 3.5
})
}) }),
- /* @__PURE__ */ (0, X.jsx)("rect", {
+ /* @__PURE__ */ (0, Y.jsx)("rect", {
x: "0",
y: t - 3 - 1 / 2,
width: "100%",
@@ -934,7 +934,7 @@ var Jr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, class
fillOpacity: r,
clipPath: `url(#dot-clip-${n})`
}),
- /* @__PURE__ */ (0, X.jsx)("circle", {
+ /* @__PURE__ */ (0, Y.jsx)("circle", {
cx: e,
cy: t,
r: 3 - 1 / 2,
@@ -942,60 +942,60 @@ var Jr = H.memo(({ cx: e, cy: t, dotId: n, fillOpacity: r, gradientUrl: i, class
})
]
}));
-Jr.displayName = "ColoredBorderDot";
+Yr.displayName = "ColoredBorderDot";
//#endregion
//#region src/react/evilcharts/registry/charts/recharts-radar-chart.tsx
-var Yr = 1, Xr = .3, Zr = 6, Qr = 1500, $r = "value", ei = (0, H.createContext)(null);
-function Z() {
- let e = (0, H.use)(ei);
+var Xr = 1, Zr = .3, Qr = 6, $r = 1500, ei = "value", ti = (0, H.createContext)(null);
+function X() {
+ let e = (0, H.use)(ti);
if (!e) throw Error("Radar chart parts (<Radar />, <PolarAngleAxis />, …) must be used within <EvilRadarChart />");
return e;
}
-function Q({ config: e, data: t, children: n, className: r, chartProps: a, backgroundVariant: o, defaultSelectedDataKey: s = null, onSelectionChange: c, isLoading: l = !1, loadingPoints: u }) {
- let d = (0, H.useId)().replace(/:/g, ""), [f, p] = (0, H.useState)(s), m = gi(l, u), h = (0, H.useCallback)((e) => {
- p(e), c?.(e);
- }, [c]), g = (0, H.useMemo)(() => ({
+function Z({ config: e, data: t, children: n, className: r, chartProps: i, backgroundVariant: a, defaultSelectedDataKey: o = null, onSelectionChange: s, isLoading: u = !1, loadingPoints: d }) {
+ let f = (0, H.useId)().replace(/:/g, ""), [p, m] = (0, H.useState)(o), h = _i(u, d), g = (0, H.useCallback)((e) => {
+ m(e), s?.(e);
+ }, [s]), _ = (0, H.useMemo)(() => ({
config: e,
- isLoading: l,
- selectedDataKey: f,
- selectDataKey: h
+ isLoading: u,
+ selectedDataKey: p,
+ selectDataKey: g
}), [
e,
- l,
- f,
- h
+ u,
+ p,
+ g
]);
- return /* @__PURE__ */ (0, X.jsx)(ei, {
- value: g,
- children: /* @__PURE__ */ (0, X.jsxs)(i, {
+ return /* @__PURE__ */ (0, Y.jsx)(ti, {
+ value: _,
+ children: /* @__PURE__ */ (0, Y.jsxs)(l, {
className: r,
config: e,
- children: [/* @__PURE__ */ (0, X.jsx)(Be, { isLoading: l }), /* @__PURE__ */ (0, X.jsxs)(Wr, {
- id: d,
- data: l ? m : t,
- ...a,
+ children: [/* @__PURE__ */ (0, Y.jsx)(S, { isLoading: u }), /* @__PURE__ */ (0, Y.jsxs)(Gr, {
+ id: f,
+ data: u ? h : t,
+ ...i,
children: [
- o && /* @__PURE__ */ (0, X.jsx)(ze, { variant: o }),
+ a && /* @__PURE__ */ (0, Y.jsx)(c, { variant: a }),
n,
- l && /* @__PURE__ */ (0, X.jsx)(_i, {})
+ u && /* @__PURE__ */ (0, Y.jsx)(vi, {})
]
})]
})
});
}
-function ti({ dataKey: e, variant: t = "filled", fillOpacity: n = Xr, isGlowing: r = !1, isClickable: i = !1, children: a, radarProps: o }) {
- let { config: s, isLoading: c, selectedDataKey: l, selectDataKey: u } = Z(), d = (0, H.useId)().replace(/:/g, "");
+function ni({ dataKey: e, variant: t = "filled", fillOpacity: n = Zr, isGlowing: r = !1, isClickable: i = !1, children: a, radarProps: o }) {
+ let { config: s, isLoading: c, selectedDataKey: l, selectDataKey: u } = X(), d = (0, H.useId)().replace(/:/g, "");
if (c) return null;
let f = i && l !== null && l !== e, p = {
stroke: f ? .2 : 1,
fill: f ? .1 : 1,
dot: f ? .2 : 1
- }, m = t === "filled", { dot: h, activeDot: g } = li(a, d, e, p.dot);
- return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Ir, {
+ }, m = t === "filled", { dot: h, activeDot: g } = ui(a, d, e, p.dot);
+ return /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)(Lr, {
dataKey: e,
stroke: `url(#${d}-radar-stroke-${e})`,
strokeOpacity: p.stroke,
- strokeWidth: Yr,
+ strokeWidth: Xr,
fill: m ? `url(#${d}-radar-fill-${e})` : "none",
fillOpacity: m ? n * p.fill : 0,
dot: h,
@@ -1007,31 +1007,31 @@ function ti({ dataKey: e, variant: t = "filled", fillOpacity: n = Xr, isGlowing:
i && u(l === e ? null : e);
},
...o
- }), /* @__PURE__ */ (0, X.jsxs)("defs", { children: [
- /* @__PURE__ */ (0, X.jsx)(di, {
+ }), /* @__PURE__ */ (0, Y.jsxs)("defs", { children: [
+ /* @__PURE__ */ (0, Y.jsx)(fi, {
id: d,
dataKey: e,
config: s
}),
- /* @__PURE__ */ (0, X.jsx)(fi, {
+ /* @__PURE__ */ (0, Y.jsx)(pi, {
id: d,
dataKey: e,
config: s
}),
- m && /* @__PURE__ */ (0, X.jsx)(pi, {
+ m && /* @__PURE__ */ (0, Y.jsx)(mi, {
id: d,
dataKey: e,
config: s
}),
- r && /* @__PURE__ */ (0, X.jsx)(mi, {
+ r && /* @__PURE__ */ (0, Y.jsx)(hi, {
id: d,
dataKey: e
})
] })] });
}
-var ni = () => null, ri = () => null;
-function ii({ gridType: e = "polygon", stroke: t = "currentColor", strokeOpacity: n = .2, strokeDasharray: r = "3 4", ...i }) {
- return /* @__PURE__ */ (0, X.jsx)(On, {
+var ri = () => null, ii = () => null;
+function ai({ gridType: e = "polygon", stroke: t = "currentColor", strokeOpacity: n = .2, strokeDasharray: r = "3 4", ...i }) {
+ return /* @__PURE__ */ (0, Y.jsx)(On, {
gridType: e,
stroke: t,
strokeOpacity: n,
@@ -1039,47 +1039,47 @@ function ii({ gridType: e = "polygon", stroke: t = "currentColor", strokeOpacity
...i
});
}
-function ai({ tick: e = {
+function oi({ tick: e = {
fill: "currentColor",
fontSize: 12
}, tickLine: t = !1, ...n }) {
- let { isLoading: r } = Z();
- return r ? null : /* @__PURE__ */ (0, X.jsx)(se, {
+ let { isLoading: r } = X();
+ return r ? null : /* @__PURE__ */ (0, Y.jsx)(C, {
tick: e,
tickLine: t,
...n
});
}
-function oi({ tick: e = {
+function si({ tick: e = {
fill: "currentColor",
fontSize: 10
}, tickLine: t = !1, axisLine: n = !1, ...r }) {
- let { isLoading: i } = Z();
- return i ? null : /* @__PURE__ */ (0, X.jsx)(Xn, {
+ let { isLoading: i } = X();
+ return i ? null : /* @__PURE__ */ (0, Y.jsx)(Xn, {
tick: e,
tickLine: t,
axisLine: n,
...r
});
}
-function si({ variant: e, roundness: t, defaultIndex: n }) {
- let { isLoading: r, selectedDataKey: i } = Z();
- return r ? null : /* @__PURE__ */ (0, X.jsx)(He, {
+function ci({ variant: e, roundness: t, defaultIndex: n }) {
+ let { isLoading: r, selectedDataKey: i } = X();
+ return r ? null : /* @__PURE__ */ (0, Y.jsx)(m, {
defaultIndex: n,
cursor: !1,
- content: /* @__PURE__ */ (0, X.jsx)(w, {
+ content: /* @__PURE__ */ (0, Y.jsx)(h, {
selected: i,
roundness: t,
variant: e
})
});
}
-function ci({ variant: e, align: t = "center", verticalAlign: n = "bottom", isClickable: r = !1 }) {
- let { isLoading: i, selectedDataKey: a, selectDataKey: o } = Z();
- return i ? null : /* @__PURE__ */ (0, X.jsx)(We, {
+function li({ variant: e, align: t = "center", verticalAlign: n = "bottom", isClickable: r = !1 }) {
+ let { isLoading: i, selectedDataKey: a, selectDataKey: o } = X();
+ return i ? null : /* @__PURE__ */ (0, Y.jsx)(d, {
verticalAlign: n,
align: t,
- content: /* @__PURE__ */ (0, X.jsx)(pe, {
+ content: /* @__PURE__ */ (0, Y.jsx)(f, {
selected: a,
onSelectChange: o,
isClickable: r,
@@ -1087,22 +1087,22 @@ function ci({ variant: e, align: t = "center", verticalAlign: n = "bottom", isCl
})
});
}
-var li = (e, t, n, r) => {
+var ui = (e, t, n, r) => {
let i = !1, a = !1;
return H.Children.forEach(e, (e) => {
if ((0, H.isValidElement)(e)) {
- if (e.type === ni) {
+ if (e.type === ri) {
let { variant: a } = e.props;
- i = /* @__PURE__ */ (0, X.jsx)(Gr, {
+ i = /* @__PURE__ */ (0, Y.jsx)(Kr, {
type: a,
dataKey: n,
chartId: t,
fillOpacity: r
});
}
- if (e.type === ri) {
+ if (e.type === ii) {
let { variant: i } = e.props;
- a = /* @__PURE__ */ (0, X.jsx)(Gr, {
+ a = /* @__PURE__ */ (0, Y.jsx)(Kr, {
type: i,
dataKey: n,
chartId: t,
@@ -1114,81 +1114,81 @@ var li = (e, t, n, r) => {
dot: i,
activeDot: a
};
-}, ui = ({ dataKey: e, colorsCount: t, opacities: n }) => t === 1 ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)("stop", {
+}, di = ({ dataKey: e, colorsCount: t, opacities: n }) => t === 1 ? /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsx)("stop", {
offset: "0%",
stopColor: `var(--color-${e}-0)`,
stopOpacity: n?.[0]
-}), /* @__PURE__ */ (0, X.jsx)("stop", {
+}), /* @__PURE__ */ (0, Y.jsx)("stop", {
offset: "100%",
stopColor: `var(--color-${e}-0)`,
stopOpacity: n?.[n.length - 1]
-})] }) : /* @__PURE__ */ (0, X.jsx)(X.Fragment, { children: Array.from({ length: t }, (r, i) => {
+})] }) : /* @__PURE__ */ (0, Y.jsx)(Y.Fragment, { children: Array.from({ length: t }, (r, i) => {
let a = `${i / (t - 1) * 100}%`;
- return /* @__PURE__ */ (0, X.jsx)("stop", {
+ return /* @__PURE__ */ (0, Y.jsx)("stop", {
offset: a,
stopColor: `var(--color-${e}-${i}, var(--color-${e}-0))`,
stopOpacity: n?.[i]
}, a);
-}) }), di = ({ id: e, dataKey: t, config: n }) => {
- let r = E(n[t] ?? {});
- return /* @__PURE__ */ (0, X.jsx)("linearGradient", {
+}) }), fi = ({ id: e, dataKey: t, config: n }) => {
+ let r = xe(n[t] ?? {});
+ return /* @__PURE__ */ (0, Y.jsx)("linearGradient", {
id: `${e}-colors-${t}`,
x1: "0",
y1: "0",
x2: "1",
y2: "0",
- children: /* @__PURE__ */ (0, X.jsx)(ui, {
+ children: /* @__PURE__ */ (0, Y.jsx)(di, {
dataKey: t,
colorsCount: r
})
});
-}, fi = ({ id: e, dataKey: t, config: n }) => {
- let r = E(n[t] ?? {});
- return /* @__PURE__ */ (0, X.jsx)("linearGradient", {
+}, pi = ({ id: e, dataKey: t, config: n }) => {
+ let r = xe(n[t] ?? {});
+ return /* @__PURE__ */ (0, Y.jsx)("linearGradient", {
id: `${e}-radar-stroke-${t}`,
x1: "0",
y1: "0",
x2: "1",
y2: "1",
- children: /* @__PURE__ */ (0, X.jsx)(ui, {
+ children: /* @__PURE__ */ (0, Y.jsx)(di, {
dataKey: t,
colorsCount: r
})
});
-}, pi = ({ id: e, dataKey: t, config: n }) => {
- let r = E(n[t] ?? {}), i = r === 1 ? [.8, .3] : Array.from({ length: r }, (e, t) => t === 0 ? .8 : .3);
- return /* @__PURE__ */ (0, X.jsx)("radialGradient", {
+}, mi = ({ id: e, dataKey: t, config: n }) => {
+ let r = xe(n[t] ?? {}), i = r === 1 ? [.8, .3] : Array.from({ length: r }, (e, t) => t === 0 ? .8 : .3);
+ return /* @__PURE__ */ (0, Y.jsx)("radialGradient", {
id: `${e}-radar-fill-${t}`,
cx: "50%",
cy: "50%",
r: "50%",
- children: /* @__PURE__ */ (0, X.jsx)(ui, {
+ children: /* @__PURE__ */ (0, Y.jsx)(di, {
dataKey: t,
colorsCount: r,
opacities: i
})
});
-}, mi = ({ id: e, dataKey: t }) => /* @__PURE__ */ (0, X.jsxs)("filter", {
+}, hi = ({ id: e, dataKey: t }) => /* @__PURE__ */ (0, Y.jsxs)("filter", {
id: `${e}-radar-glow-${t}`,
x: "-50%",
y: "-50%",
width: "200%",
height: "200%",
children: [
- /* @__PURE__ */ (0, X.jsx)("feGaussianBlur", {
+ /* @__PURE__ */ (0, Y.jsx)("feGaussianBlur", {
in: "SourceGraphic",
stdDeviation: "4",
result: "blur"
}),
- /* @__PURE__ */ (0, X.jsx)("feColorMatrix", {
+ /* @__PURE__ */ (0, Y.jsx)("feColorMatrix", {
in: "blur",
type: "matrix",
values: "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.6 0",
result: "glow"
}),
- /* @__PURE__ */ (0, X.jsxs)("feMerge", { children: [/* @__PURE__ */ (0, X.jsx)("feMergeNode", { in: "glow" }), /* @__PURE__ */ (0, X.jsx)("feMergeNode", { in: "SourceGraphic" })] })
+ /* @__PURE__ */ (0, Y.jsxs)("feMerge", { children: [/* @__PURE__ */ (0, Y.jsx)("feMergeNode", { in: "glow" }), /* @__PURE__ */ (0, Y.jsx)("feMergeNode", { in: "SourceGraphic" })] })
]
-}), hi = (e) => [
+}), gi = (e) => [
"A",
"B",
"C",
@@ -1197,20 +1197,20 @@ var li = (e, t, n, r) => {
"F"
].slice(0, e).map((e) => ({
skill: e,
- [$r]: 30 + Math.random() * 70
+ [ei]: 30 + Math.random() * 70
}));
-function gi(e, t = Zr) {
+function _i(e, t = Qr) {
let [n, r] = (0, H.useState)(0);
return (0, H.useEffect)(() => {
if (!e) return;
let t = setInterval(() => {
r((e) => e + 1);
- }, Qr);
+ }, $r);
return () => clearInterval(t);
- }, [e]), (0, H.useMemo)(() => hi(t), [t, n]);
+ }, [e]), (0, H.useMemo)(() => gi(t), [t, n]);
}
-var _i = () => /* @__PURE__ */ (0, X.jsx)(Ir, {
- dataKey: $r,
+var vi = () => /* @__PURE__ */ (0, Y.jsx)(Lr, {
+ dataKey: ei,
stroke: "currentColor",
strokeOpacity: .3,
strokeWidth: 2,
@@ -1218,41 +1218,41 @@ var _i = () => /* @__PURE__ */ (0, X.jsx)(Ir, {
fillOpacity: .1,
dot: !1,
isAnimationActive: !0,
- animationDuration: Qr,
+ animationDuration: $r,
animationEasing: "ease-in-out"
});
-Q.Radar = ti, Q.Dot = ni, Q.ActiveDot = ri, Q.PolarGrid = ii, Q.PolarAngleAxis = ai, Q.PolarRadiusAxis = oi, Q.Tooltip = si, Q.Legend = ci;
+Z.Radar = ni, Z.Dot = ri, Z.ActiveDot = ii, Z.PolarGrid = ai, Z.PolarAngleAxis = oi, Z.PolarRadiusAxis = si, Z.Tooltip = ci, Z.Legend = li;
//#endregion
//#region src/react/taste/charts.tsx
-function vi(e) {
+function yi(e) {
let { x: t = 0, cx: n, textAnchor: r, payload: i, ...a } = e, o = String(i?.value ?? ""), s = typeof n == "number" ? n * 2 : 0, c = s ? r === "start" ? s - t : r === "end" ? t : 2 * Math.min(t, s - t) : 56;
- return /* @__PURE__ */ (0, X.jsxs)("g", { children: [/* @__PURE__ */ (0, X.jsx)("title", { children: o }), /* @__PURE__ */ (0, X.jsx)(be, {
+ return /* @__PURE__ */ (0, Y.jsxs)("g", { children: [/* @__PURE__ */ (0, Y.jsx)("title", { children: o }), /* @__PURE__ */ (0, Y.jsx)(se, {
...a,
x: t,
textAnchor: r,
fill: "currentColor",
fontSize: 12,
- children: ke(o, c - 4)
+ children: _e(o, c - 4)
})] });
}
-var yi = [
+var bi = [
"stroke-chart-1",
"stroke-chart-2",
"stroke-chart-3",
"stroke-chart-4",
"stroke-chart-5",
"stroke-chart-6"
-], bi = [
+], xi = [
"fill-chart-1",
"fill-chart-2",
"fill-chart-3",
"fill-chart-4",
"fill-chart-5",
"fill-chart-6"
-], xi = { value: {
+], Si = { value: {
label: "标签出现次数",
- colors: xe(me[3])
-} }, Si = [
+ colors: He(a[3])
+} }, Ci = [
"min-h-24",
"min-h-24",
"min-h-24",
@@ -1262,51 +1262,51 @@ var yi = [
"min-h-52",
"min-h-60",
"min-h-64"
-], Ci = 26, wi = { radius: xi.value }, Ti = (e, t) => Math.sqrt(e / t);
-function Ei({ rows: e, label: t }) {
- let n = Nt(e);
+], wi = 26, Ti = { radius: Si.value }, Ei = (e, t) => Math.sqrt(e / t);
+function Di({ rows: e, label: t }) {
+ let n = Gt(e);
if (!n.length) return null;
let r = n[0].value, i = n.map((e) => ({
...e,
- radius: Ti(e.value, r)
+ radius: Ei(e.value, r)
}));
- return /* @__PURE__ */ (0, X.jsx)("div", {
+ return /* @__PURE__ */ (0, Y.jsx)("div", {
role: "img",
"aria-label": `${t}:${i.map((e) => e.name).join(",")}`,
- children: /* @__PURE__ */ (0, X.jsxs)(Q, {
+ children: /* @__PURE__ */ (0, Y.jsxs)(Z, {
data: i,
- config: wi,
+ config: Ti,
chartProps: { outerRadius: "58%" },
className: "aspect-auto h-70 text-text-secondary",
children: [
- /* @__PURE__ */ (0, X.jsx)(Q.PolarGrid, {}),
- /* @__PURE__ */ (0, X.jsx)(Q.PolarAngleAxis, {
+ /* @__PURE__ */ (0, Y.jsx)(Z.PolarGrid, {}),
+ /* @__PURE__ */ (0, Y.jsx)(Z.PolarAngleAxis, {
dataKey: "name",
- tick: /* @__PURE__ */ (0, X.jsx)(vi, {})
+ tick: /* @__PURE__ */ (0, Y.jsx)(yi, {})
}),
- /* @__PURE__ */ (0, X.jsx)(Q.PolarRadiusAxis, {
+ /* @__PURE__ */ (0, Y.jsx)(Z.PolarRadiusAxis, {
domain: [0, 1],
allowDecimals: !0,
tick: !1
}),
- /* @__PURE__ */ (0, X.jsx)(Q.Radar, { dataKey: "radius" }),
- /* @__PURE__ */ (0, X.jsx)(De, { valueKey: "value" })
+ /* @__PURE__ */ (0, Y.jsx)(Z.Radar, { dataKey: "radius" }),
+ /* @__PURE__ */ (0, Y.jsx)(p, { valueKey: "value" })
]
})
});
}
-function Di({ rows: e, label: t }) {
- let n = en(e, 8);
- return n.length ? /* @__PURE__ */ (0, X.jsx)("section", {
+function Oi({ rows: e, label: t }) {
+ let n = nn(e, 8);
+ return n.length ? /* @__PURE__ */ (0, Y.jsx)("section", {
"aria-label": t,
- className: `flex grow flex-col ${Si[n.length]}`,
- children: /* @__PURE__ */ (0, X.jsxs)(le, {
+ className: `flex grow flex-col ${Ci[n.length]}`,
+ children: /* @__PURE__ */ (0, Y.jsxs)(v, {
data: n,
- config: xi,
+ config: Si,
layout: "horizontal",
barRadius: 4,
chartProps: {
- maxBarSize: Ci,
+ maxBarSize: wi,
margin: {
top: 5,
right: 56,
@@ -1316,73 +1316,73 @@ function Di({ rows: e, label: t }) {
},
className: "aspect-auto text-text-secondary",
children: [
- /* @__PURE__ */ (0, X.jsx)(le.YAxis, {
+ /* @__PURE__ */ (0, Y.jsx)(v.YAxis, {
dataKey: "name",
interval: 0,
- tick: /* @__PURE__ */ (0, X.jsx)(Ce, { along: "y" }),
- width: ye(n.map((e) => e.name))
+ tick: /* @__PURE__ */ (0, Y.jsx)(s, { along: "y" }),
+ width: pe(n.map((e) => e.name))
}),
- /* @__PURE__ */ (0, X.jsx)(le.XAxis, {
+ /* @__PURE__ */ (0, Y.jsx)(v.XAxis, {
hide: !0,
- domain: Ae
+ domain: r
}),
- /* @__PURE__ */ (0, X.jsx)(le.Bar, {
+ /* @__PURE__ */ (0, Y.jsx)(v.Bar, {
dataKey: "value",
enableHoverHighlight: !0,
barProps: {
dataKey: "value",
- label: ue("right")
+ label: fe("right")
}
}),
- /* @__PURE__ */ (0, X.jsx)(De, {})
+ /* @__PURE__ */ (0, Y.jsx)(p, {})
]
})
}) : null;
}
-function Oi({ flows: e }) {
- let [t, n] = (0, H.useState)(null), r = Dt(e);
+function ki({ flows: e }) {
+ let [t, n] = (0, H.useState)(null), r = It(e);
if (!r) return null;
- let i = t?.node ?? null, a = (e, n) => t ? i === null ? t.label === n : e.source === i || e.target === i : !0;
- return /* @__PURE__ */ (0, X.jsxs)("section", {
- className: Me,
+ let a = t?.node ?? null, o = (e, n) => t ? a === null ? t.label === n : e.source === a || e.target === a : !0;
+ return /* @__PURE__ */ (0, Y.jsxs)("section", {
+ className: i,
children: [
- /* @__PURE__ */ (0, X.jsx)(ge, {
+ /* @__PURE__ */ (0, Y.jsx)(u, {
title: "创作者线索来源",
figure: (t ? t.value : r.total).toLocaleString(),
note: t ? t.label : "条线索"
}),
- /* @__PURE__ */ (0, X.jsx)("ol", {
+ /* @__PURE__ */ (0, Y.jsx)("ol", {
"aria-label": "来源网站与创作者线索",
className: "flex flex-col sm:hidden",
- children: [...r.links].sort((e, t) => t.value - e.value).map((e) => /* @__PURE__ */ (0, X.jsxs)("li", {
+ children: [...r.links].sort((e, t) => t.value - e.value).map((e) => /* @__PURE__ */ (0, Y.jsxs)("li", {
className: "flex items-baseline justify-between gap-3 border-b border-separator-border py-2 text-body-2-regular text-text-primary last:border-b-0",
- children: [/* @__PURE__ */ (0, X.jsx)("span", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", {
className: "min-w-0 wrap-anywhere",
children: e.label
- }), /* @__PURE__ */ (0, X.jsx)("b", {
+ }), /* @__PURE__ */ (0, Y.jsx)("b", {
className: "shrink-0 tabular-nums",
children: e.value.toLocaleString()
})]
}, e.key))
}),
- /* @__PURE__ */ (0, X.jsx)("div", {
+ /* @__PURE__ */ (0, Y.jsx)("div", {
className: "min-w-0 max-sm:hidden",
- children: /* @__PURE__ */ (0, X.jsxs)("svg", {
- viewBox: `0 0 ${Ft.width} ${r.height}`,
+ children: /* @__PURE__ */ (0, Y.jsxs)("svg", {
+ viewBox: `0 0 ${nt.width} ${r.height}`,
fill: "none",
role: "img",
"aria-label": "来源网站与创作者线索",
className: "block h-auto w-full",
onPointerLeave: () => n(null),
- children: [/* @__PURE__ */ (0, X.jsx)("g", { children: r.links.map((e) => /* @__PURE__ */ (0, X.jsx)("path", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("g", { children: r.links.map((e) => /* @__PURE__ */ (0, Y.jsx)("path", {
d: e.d,
strokeWidth: e.width,
tabIndex: 0,
role: "img",
"aria-label": `${e.label}:${e.value} 条线索`,
fillOpacity: 0,
- strokeOpacity: a(e, e.label) ? .55 : .08,
- className: `outline-none transition-opacity ${yi[e.color]}`,
+ strokeOpacity: o(e, e.label) ? .55 : .08,
+ className: `outline-none transition-opacity ${bi[e.color]}`,
onPointerEnter: () => n({
value: e.value,
label: e.label,
@@ -1394,7 +1394,7 @@ function Oi({ flows: e }) {
node: null
}),
onBlur: () => n(null)
- }, e.key)) }), /* @__PURE__ */ (0, X.jsx)("g", { children: r.nodes.map((e) => /* @__PURE__ */ (0, X.jsxs)("g", {
+ }, e.key)) }), /* @__PURE__ */ (0, Y.jsx)("g", { children: r.nodes.map((e) => /* @__PURE__ */ (0, Y.jsxs)("g", {
tabIndex: 0,
role: "img",
"aria-label": `${e.name}:${e.value} 条线索`,
@@ -1410,21 +1410,21 @@ function Oi({ flows: e }) {
node: e.index
}),
onBlur: () => n(null),
- children: [/* @__PURE__ */ (0, X.jsx)("rect", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("rect", {
x: e.x,
y: e.y,
width: 10,
height: e.height,
rx: 5,
- className: e.side === "source" ? bi[e.color] : "fill-text-secondary"
- }), /* @__PURE__ */ (0, X.jsxs)("text", {
- x: Yt[e.side],
+ className: e.side === "source" ? xi[e.color] : "fill-text-secondary"
+ }), /* @__PURE__ */ (0, Y.jsxs)("text", {
+ x: tt[e.side],
y: e.y + e.height / 2,
textAnchor: e.side === "source" ? "end" : "start",
dominantBaseline: "middle",
className: "fill-text-secondary text-caption-1-regular",
- children: [kt(e.name), /* @__PURE__ */ (0, X.jsx)("tspan", {
- x: Yt[e.side],
+ children: [Lt(e.name), /* @__PURE__ */ (0, Y.jsx)("tspan", {
+ x: tt[e.side],
dy: 15,
children: e.side === "source" ? e.value.toLocaleString() : `${e.share.toFixed(1)}%`
})]
@@ -1432,44 +1432,44 @@ function Oi({ flows: e }) {
}, e.id)) })]
})
}),
- /* @__PURE__ */ (0, X.jsxs)("footer", {
+ /* @__PURE__ */ (0, Y.jsxs)("footer", {
className: "flex justify-between gap-3 text-caption-1-regular text-text-secondary max-sm:hidden",
- children: [/* @__PURE__ */ (0, X.jsx)("span", { children: "来源网站" }), /* @__PURE__ */ (0, X.jsx)("span", { children: "创作者 · 线索占比" })]
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", { children: "来源网站" }), /* @__PURE__ */ (0, Y.jsx)("span", { children: "创作者 · 线索占比" })]
})
]
});
}
//#endregion
//#region src/react/taste/browser-sources.tsx
-var ki = "flex min-w-0 items-center gap-3 rounded-xl bg-background-primary-default p-3";
-function Ai({ browsers: e, sources: t, range: n, children: r }) {
- let [i, a] = (0, H.useState)(!1), [o, s] = (0, H.useState)(""), [c, l] = (0, H.useState)(""), u = It({
- mutationFn: (e) => Tt(e, n),
+var Ai = "flex min-w-0 items-center gap-3 rounded-xl bg-background-primary-default p-3";
+function ji({ browsers: e, sources: t, range: n, children: r }) {
+ let [i, a] = (0, H.useState)(!1), [o, s] = (0, H.useState)(""), [c, l] = (0, H.useState)(""), u = on({
+ mutationFn: (e) => kt(e, n),
onSuccess: (e) => {
- P.setQueryData(Ze(n), e.dashboard), a(!1), s(""), l("");
+ B.setQueryData(V(n), e.dashboard), a(!1), s(""), l("");
}
});
- return /* @__PURE__ */ (0, X.jsxs)("section", {
- className: `${F()} flex flex-col gap-4`,
+ return /* @__PURE__ */ (0, Y.jsxs)("section", {
+ className: `${I()} flex flex-col gap-4`,
"aria-label": "数据源",
children: [
- /* @__PURE__ */ (0, X.jsxs)("div", {
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex flex-wrap items-center justify-between gap-3",
- children: [/* @__PURE__ */ (0, X.jsx)("h3", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("h3", {
className: "text-title-2-medium text-text-primary",
children: "数据源"
- }), /* @__PURE__ */ (0, X.jsx)(L, {
+ }), /* @__PURE__ */ (0, Y.jsx)(M, {
variant: "secondary",
onClick: () => a(!0),
disabled: i,
children: "添加浏览器"
})]
}),
- u.error ? /* @__PURE__ */ (0, X.jsx)(V, {
+ u.error ? /* @__PURE__ */ (0, Y.jsx)(P, {
tone: "error",
- children: N(u.error)
+ children: R(u.error)
}) : null,
- i ? /* @__PURE__ */ (0, X.jsxs)("form", {
+ i ? /* @__PURE__ */ (0, Y.jsxs)("form", {
className: "flex flex-col gap-3",
onSubmit: (e) => {
e.preventDefault(), u.isPending || u.mutate({
@@ -1479,7 +1479,7 @@ function Ai({ browsers: e, sources: t, range: n, children: r }) {
});
},
children: [
- /* @__PURE__ */ (0, X.jsx)(zt, {
+ /* @__PURE__ */ (0, Y.jsx)(at, {
label: "浏览器名称",
value: o,
onChange: s,
@@ -1487,7 +1487,7 @@ function Ai({ browsers: e, sources: t, range: n, children: r }) {
isRequired: !0,
isDisabled: u.isPending
}),
- /* @__PURE__ */ (0, X.jsx)(zt, {
+ /* @__PURE__ */ (0, Y.jsx)(at, {
label: "资料目录或历史文件",
value: c,
onChange: l,
@@ -1496,56 +1496,56 @@ function Ai({ browsers: e, sources: t, range: n, children: r }) {
isDisabled: u.isPending,
hint: "请选择运行 Peach 的电脑上的浏览器资料。"
}),
- /* @__PURE__ */ (0, X.jsxs)("div", {
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex gap-2",
- children: [/* @__PURE__ */ (0, X.jsx)(L, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(M, {
variant: "ghost",
disabled: u.isPending,
onClick: () => {
a(!1), u.reset();
},
children: "取消"
- }), /* @__PURE__ */ (0, X.jsx)(L, {
+ }), /* @__PURE__ */ (0, Y.jsx)(M, {
type: "submit",
variant: "secondary",
disabled: !o.trim() || !c.trim(),
- ...B(u.isPending),
+ ...F(u.isPending),
children: "添加"
})]
})
]
}) : null,
- /* @__PURE__ */ (0, X.jsxs)("div", {
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "inline-grid w-full min-w-0 gap-2 sm:grid-cols-2",
children: [r, e.map((e) => {
let n = t.filter((t) => e.source_keys?.includes(t.source_key)), r = n.reduce((e, t) => e + (t.visits || 0), 0), i = n.reduce((e, t) => e + (t.bookmarks || 0), 0);
- return /* @__PURE__ */ (0, X.jsxs)("div", {
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
"data-taste-source": "browser",
- className: ki,
+ className: Ai,
children: [
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "inline-grid size-8 shrink-0 place-items-center rounded-lg text-text-secondary",
- children: /* @__PURE__ */ (0, X.jsx)(bt, {
+ children: /* @__PURE__ */ (0, Y.jsx)(et, {
"aria-hidden": !0,
className: "size-4"
})
}),
- /* @__PURE__ */ (0, X.jsxs)("div", {
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex min-w-0 grow flex-col gap-0.5",
children: [
- /* @__PURE__ */ (0, X.jsx)("b", {
+ /* @__PURE__ */ (0, Y.jsx)("b", {
className: "text-body-2-medium break-words text-text-primary",
children: e.name
}),
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "break-all text-caption-1-regular text-text-secondary",
children: e.path
}),
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "text-caption-1-regular text-text-secondary",
children: e.enabled ? e.available ? `历史与书签 · ${e.profiles} 个资料` : "资料目录不可用" : "已停止读取"
}),
- n.length ? /* @__PURE__ */ (0, X.jsxs)("span", {
+ n.length ? /* @__PURE__ */ (0, Y.jsxs)("span", {
className: "text-caption-1-regular text-text-secondary",
children: [
r.toLocaleString(),
@@ -1556,17 +1556,17 @@ function Ai({ browsers: e, sources: t, range: n, children: r }) {
}) : null
]
}),
- /* @__PURE__ */ (0, X.jsxs)("span", {
+ /* @__PURE__ */ (0, Y.jsxs)("span", {
className: "flex shrink-0 gap-1",
- children: [/* @__PURE__ */ (0, X.jsx)(L, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(M, {
variant: "secondary",
size: "small",
- ...B(u.isPending),
+ ...F(u.isPending),
iconOnly: !0,
- leadingIcon: e.enabled ? Qe : an,
+ leadingIcon: e.enabled ? dt : rt,
"aria-label": `${e.enabled ? "停止读取" : "启用"} ${e.name}`,
onClick: () => {
- e.enabled ? lt({
+ e.enabled ? At({
title: `停止读取 ${e.name}`,
body: "已导入的历史与书签仍用于口味分析。",
confirmLabel: "停止读取",
@@ -1579,15 +1579,15 @@ function Ai({ browsers: e, sources: t, range: n, children: r }) {
id: e.id
});
}
- }), /* @__PURE__ */ (0, X.jsx)(L, {
+ }), /* @__PURE__ */ (0, Y.jsx)(M, {
variant: "secondary",
size: "small",
iconOnly: !0,
- leadingIcon: wt,
- ...B(u.isPending),
+ leadingIcon: ot,
+ ...F(u.isPending),
"aria-label": `删除 ${e.name}`,
onClick: () => {
- lt({
+ At({
title: `删除 ${e.name}`,
body: "移除该浏览器的读取配置和已导入历史、书签,浏览器原文件保留。可以通过添加浏览器重新接入。",
confirmLabel: "删除浏览器来源",
@@ -1609,7 +1609,7 @@ function Ai({ browsers: e, sources: t, range: n, children: r }) {
}
//#endregion
//#region src/react/taste/taste-page.tsx
-var ji = 10, Mi = pt(it, qe, "text-body-2-medium"), Ni = `${F()} flex flex-col gap-4`, Pi = "rounded-xl bg-background-primary-default p-3", Fi = "读取运行 Peach 的这台电脑上的浏览历史与书签", Ii = "导入或读取浏览记录后,这里会列出记录来自哪些设备。", Li = "馆藏中暂时没有与你浏览过的内容相符的标签。", Ri = "读取浏览记录后,这里会按类别汇总你浏览过的内容。", zi = "这些标签出现在浏览记录中,Peach 的观看或评价记录中尚未出现这些标签", Bi = "采集浏览记录后,这里会列出浏览过的标签。", Vi = "采集浏览记录后,这里会列出浏览过的创作者。", Hi = "采集浏览记录后,这里会列出常访问的网站。", Ui = "在 Peach 里播放或评价作品后,这里会列出对应的标签。", Wi = "在 Peach 里播放或评价作品后,这里会列出对应的创作者。", Gi = "在 Peach 里播放或评价作品后,这里会列出对应的女优。", Ki = "在运行 Peach 的电脑上使用浏览器:点上面的「读取浏览器记录」。", qi = "记录在其他设备上:导出文件后,选择「导入历史文件」或「导入书签文件」。书签支持浏览器导出的 HTML 文件和 Chromium Bookmarks JSON 文件。", Ji = "需要刷新时再次读取或导入;数据源可在页面底部移除。", Yi = "删除这个来源的已导入记录,原始文件保留。若浏览器仍启用,下次读取会再次导入。", Xi = "peach-taste-guide-dismissed", Zi = (0, H.createContext)(/* @__PURE__ */ (0, X.jsx)(qt, {
+var Mi = 10, Ni = jt(st, ct, "text-body-2-medium"), Q = `${I()} flex flex-col gap-4`, Pi = "rounded-xl bg-background-primary-default p-3", Fi = "读取运行 Peach 的这台电脑上的浏览历史与书签", Ii = "导入或读取浏览记录后,这里会列出记录来自哪些设备。", Li = "馆藏中暂时没有与你浏览过的内容相符的标签。", Ri = "读取浏览记录后,这里会按类别汇总你浏览过的内容。", zi = "这些标签出现在浏览记录中,Peach 的观看或评价记录中尚未出现这些标签", Bi = "采集浏览记录后,这里会列出浏览过的标签。", Vi = "采集浏览记录后,这里会列出浏览过的创作者。", Hi = "采集浏览记录后,这里会列出常访问的网站。", Ui = "在 Peach 里播放或评价作品后,这里会列出对应的标签。", Wi = "在 Peach 里播放或评价作品后,这里会列出对应的创作者。", Gi = "在 Peach 里播放或评价作品后,这里会列出对应的女优。", Ki = "在运行 Peach 的电脑上使用浏览器:点上面的「读取浏览器记录」。", qi = "记录在其他设备上:导出文件后,选择「导入历史文件」或「导入书签文件」。书签支持浏览器导出的 HTML 文件和 Chromium Bookmarks JSON 文件。", Ji = "需要刷新时再次读取或导入;数据源可在页面底部移除。", Yi = "删除这个来源的已导入记录,原始文件保留。若浏览器仍启用,下次读取会再次导入。", Xi = "peach-taste-guide-dismissed", Zi = (0, H.createContext)(/* @__PURE__ */ (0, Y.jsx)(Qe, {
size: "small",
href: "/",
children: "浏览馆藏"
@@ -1618,14 +1618,14 @@ function Qi() {
return (0, H.useContext)(Zi);
}
function $({ icon: e, term: t, figure: n, detail: r, detailTitle: i, accent: a }) {
- return /* @__PURE__ */ (0, X.jsx)("div", {
+ return /* @__PURE__ */ (0, Y.jsx)("div", {
className: dn(),
- children: /* @__PURE__ */ (0, X.jsx)(ln, {
+ children: /* @__PURE__ */ (0, Y.jsx)(un, {
label: t,
icon: e,
accent: a,
figure: n,
- footer: /* @__PURE__ */ (0, X.jsx)("span", {
+ footer: /* @__PURE__ */ (0, Y.jsx)("span", {
className: "block min-w-0 truncate",
title: i || r,
children: r ?? ""
@@ -1634,10 +1634,10 @@ function $({ icon: e, term: t, figure: n, detail: r, detailTitle: i, accent: a }
});
}
function $i({ name: e, domain: t }) {
- return /* @__PURE__ */ (0, X.jsxs)("span", {
+ return /* @__PURE__ */ (0, Y.jsxs)("span", {
className: "relative inline-grid size-8 shrink-0 place-items-center overflow-hidden rounded-lg bg-background-tertiary-default text-caption-1-medium text-text-secondary",
- children: [mt(e).toUpperCase(), /* @__PURE__ */ (0, X.jsx)("img", {
- src: Je({ domain: t }),
+ children: [Ft(e).toUpperCase(), /* @__PURE__ */ (0, Y.jsx)("img", {
+ src: Zt({ domain: t }),
alt: "",
loading: "lazy",
width: 20,
@@ -1648,78 +1648,78 @@ function $i({ name: e, domain: t }) {
});
}
function ea({ html: e }) {
- return /* @__PURE__ */ (0, X.jsx)("span", {
+ return /* @__PURE__ */ (0, Y.jsx)("span", {
className: `relative inline-grid size-8 shrink-0 place-items-center overflow-hidden rounded-full bg-background-tertiary-default text-caption-1-medium text-text-secondary ${fn}`,
dangerouslySetInnerHTML: { __html: e }
});
}
function ta({ rows: e, kind: t, visual: n, empty: r, onSignal: i }) {
- if (!e.length) return /* @__PURE__ */ (0, X.jsx)(R, {
+ if (!e.length) return /* @__PURE__ */ (0, Y.jsx)(N, {
size: "compact",
- icon: I,
+ icon: z,
title: "记录还不够",
- actions: /* @__PURE__ */ (0, X.jsx)(Qi, {}),
+ actions: /* @__PURE__ */ (0, Y.jsx)(Qi, {}),
children: r
});
- let a = vt(e);
- return /* @__PURE__ */ (0, X.jsx)(Fe, {
- previewCount: ji,
+ let a = qt(e);
+ return /* @__PURE__ */ (0, Y.jsx)(y, {
+ previewCount: Mi,
className: "inline-grid w-full gap-x-7 gap-y-2 sm:grid-cols-2",
children: e.map((e, r) => {
- let o = !!t && !!e.peach_items, s = String(e.source_domain || ""), c = /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [
- /* @__PURE__ */ (0, X.jsx)("svg", {
+ let o = !!t && !!e.peach_items, s = String(e.source_domain || ""), c = /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [
+ /* @__PURE__ */ (0, Y.jsx)("svg", {
viewBox: "0 0 100 1",
preserveAspectRatio: "none",
"aria-hidden": !0,
className: "absolute inset-0 -z-10 size-full overflow-hidden rounded-lg opacity-15",
- children: /* @__PURE__ */ (0, X.jsx)("rect", {
+ children: /* @__PURE__ */ (0, Y.jsx)("rect", {
width: a[r],
height: 1,
className: "fill-chart-4"
})
}),
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "w-6 shrink-0 text-caption-1-regular tabular-nums text-text-secondary",
children: r + 1
}),
- n === "domain" ? /* @__PURE__ */ (0, X.jsx)($i, {
+ n === "domain" ? /* @__PURE__ */ (0, Y.jsx)($i, {
name: e.name,
domain: e.name
}) : null,
- n === "creator" && !e.entity_id && !e.has_avatar && s ? /* @__PURE__ */ (0, X.jsx)($i, {
+ n === "creator" && !e.entity_id && !e.has_avatar && s ? /* @__PURE__ */ (0, Y.jsx)($i, {
name: e.name,
domain: s
}) : null,
- n !== "none" && n !== "domain" && (e.entity_id || e.has_avatar || !s) ? /* @__PURE__ */ (0, X.jsx)(ea, { html: et(e.name, e.entity_id ? {
+ n !== "none" && n !== "domain" && (e.entity_id || e.has_avatar || !s) ? /* @__PURE__ */ (0, Y.jsx)(ea, { html: Dt(e.name, e.entity_id ? {
id: e.entity_id,
has_image: !!e.has_image,
image_version: e.image_version,
avatar_focus: e.avatar_focus,
avatar_stand_in: e.avatar_stand_in
} : null, e.has_avatar ? e.representative_asset_id ?? null : null, n === "creator" ? "creator" : t || "performer") }) : null,
- /* @__PURE__ */ (0, X.jsxs)("span", {
+ /* @__PURE__ */ (0, Y.jsxs)("span", {
className: "flex min-w-0 grow flex-col gap-0.5",
- children: [/* @__PURE__ */ (0, X.jsx)("b", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("b", {
className: "min-w-0 text-body-medium break-words text-text-primary",
children: e.name
- }), /* @__PURE__ */ (0, X.jsx)("small", {
+ }), /* @__PURE__ */ (0, Y.jsx)("small", {
className: "text-caption-1-regular text-text-secondary",
- children: jt(e)
+ children: Kt(e)
})]
}),
- o ? /* @__PURE__ */ (0, X.jsx)(tt, {
+ o ? /* @__PURE__ */ (0, Y.jsx)(Wt, {
"aria-hidden": !0,
className: "size-4 shrink-0 text-text-tertiary"
}) : null
] }), l = "relative isolate flex min-h-11 w-full min-w-0 items-center gap-2.5 rounded-lg px-3 py-2 text-left";
- return /* @__PURE__ */ (0, X.jsx)("li", {
+ return /* @__PURE__ */ (0, Y.jsx)("li", {
className: "min-w-0",
- children: o ? /* @__PURE__ */ (0, X.jsx)("button", {
+ children: o ? /* @__PURE__ */ (0, Y.jsx)("button", {
type: "button",
onClick: () => i(t, e.name),
className: `${l} cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring`,
children: c
- }) : /* @__PURE__ */ (0, X.jsx)("div", {
+ }) : /* @__PURE__ */ (0, Y.jsx)("div", {
className: l,
children: c
})
@@ -1728,23 +1728,23 @@ function ta({ rows: e, kind: t, visual: n, empty: r, onSignal: i }) {
});
}
function na({ label: e, panels: t, onSignal: n }) {
- return /* @__PURE__ */ (0, X.jsxs)(Ye, {
- className: `${F({ padding: "none" })} flex flex-col`,
- children: [/* @__PURE__ */ (0, X.jsx)("div", {
+ return /* @__PURE__ */ (0, Y.jsxs)(Ze, {
+ className: `${I({ padding: "none" })} flex flex-col`,
+ children: [/* @__PURE__ */ (0, Y.jsx)("div", {
className: "px-4 pt-3",
- children: /* @__PURE__ */ (0, X.jsx)(Pt, {
+ children: /* @__PURE__ */ (0, Y.jsx)(gt, {
"aria-label": e,
- className: Kt,
- children: t.map((e) => /* @__PURE__ */ (0, X.jsx)(at, {
+ className: ht,
+ children: t.map((e) => /* @__PURE__ */ (0, Y.jsx)(Xe, {
id: e.id,
- className: At,
+ className: mt,
children: e.name
}, e.id))
})
- }), t.map((e) => /* @__PURE__ */ (0, X.jsx)(_t, {
+ }), t.map((e) => /* @__PURE__ */ (0, Y.jsx)(Ye, {
id: e.id,
className: "px-4 pt-3.5 pb-4",
- children: /* @__PURE__ */ (0, X.jsx)(ta, {
+ children: /* @__PURE__ */ (0, Y.jsx)(ta, {
...e.props,
onSignal: n
})
@@ -1765,71 +1765,71 @@ function ra({ data: e, onSignal: t, navigate: n }) {
detail: e.detail,
act: () => n(e.route)
}))];
- return /* @__PURE__ */ (0, X.jsxs)("section", {
- className: Ni,
+ return /* @__PURE__ */ (0, Y.jsxs)("section", {
+ className: Q,
"aria-label": "口味总结",
children: [
- /* @__PURE__ */ (0, X.jsxs)("header", {
+ /* @__PURE__ */ (0, Y.jsxs)("header", {
className: "flex flex-col gap-2",
children: [
- /* @__PURE__ */ (0, X.jsx)("h3", {
+ /* @__PURE__ */ (0, Y.jsx)("h3", {
className: "text-title-2-medium text-text-primary",
children: "口味总结"
}),
- /* @__PURE__ */ (0, X.jsx)("p", {
+ /* @__PURE__ */ (0, Y.jsx)("p", {
className: "max-w-prose text-title-2-regular wrap-anywhere text-text-primary",
children: r.headline
}),
- /* @__PURE__ */ (0, X.jsxs)("p", {
+ /* @__PURE__ */ (0, Y.jsxs)("p", {
className: "flex flex-wrap items-center gap-2 text-body-2-regular text-text-secondary",
- children: [/* @__PURE__ */ (0, X.jsx)("i", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("i", {
"aria-hidden": !0,
className: `size-2 shrink-0 rounded-full ${i.level === "high" ? "bg-status-lime-text" : i.level === "medium" ? "bg-status-yellow-text" : "bg-text-tertiary"}`
- }), /* @__PURE__ */ (0, X.jsx)("span", {
+ }), /* @__PURE__ */ (0, Y.jsx)("span", {
className: "min-w-0 wrap-anywhere",
children: i.label || "仍在学习"
})]
})
]
}),
- r.points?.length ? /* @__PURE__ */ (0, X.jsx)("div", {
+ r.points?.length ? /* @__PURE__ */ (0, Y.jsx)("div", {
className: "inline-grid w-full gap-3 sm:grid-cols-2",
- children: r.points.map((e) => /* @__PURE__ */ (0, X.jsxs)("div", {
+ children: r.points.map((e) => /* @__PURE__ */ (0, Y.jsxs)("div", {
className: `flex min-w-0 flex-col gap-1 ${Pi}`,
- children: [/* @__PURE__ */ (0, X.jsx)("span", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", {
className: "text-caption-1-regular text-text-secondary",
children: e.label
- }), /* @__PURE__ */ (0, X.jsx)("b", {
+ }), /* @__PURE__ */ (0, Y.jsx)("b", {
className: "text-body-2-medium break-words text-text-primary",
children: e.text
})]
}, e.label))
}) : null,
- a.length ? /* @__PURE__ */ (0, X.jsx)("div", {
+ a.length ? /* @__PURE__ */ (0, Y.jsx)("div", {
className: "flex flex-col gap-2",
- children: a.map((e) => /* @__PURE__ */ (0, X.jsxs)("button", {
+ children: a.map((e) => /* @__PURE__ */ (0, Y.jsxs)("button", {
type: "button",
onClick: e.act,
className: `flex w-full min-w-0 cursor-pointer items-center gap-3 ${Pi} text-left outline-none hover:bg-background-primary-hover focus-visible:ring-2 focus-visible:ring-border-focus-ring`,
- children: [/* @__PURE__ */ (0, X.jsxs)("span", {
+ children: [/* @__PURE__ */ (0, Y.jsxs)("span", {
className: "flex min-w-0 grow flex-col gap-1",
- children: [/* @__PURE__ */ (0, X.jsx)("b", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("b", {
className: "text-body-2-medium wrap-anywhere text-text-primary",
children: e.title
- }), /* @__PURE__ */ (0, X.jsx)("small", {
+ }), /* @__PURE__ */ (0, Y.jsx)("small", {
className: "text-caption-1-regular wrap-anywhere text-text-secondary",
children: e.detail
})]
- }), /* @__PURE__ */ (0, X.jsx)(tt, {
+ }), /* @__PURE__ */ (0, Y.jsx)(Wt, {
"aria-hidden": !0,
className: "size-4 shrink-0 text-text-tertiary"
})]
}, e.key))
- }) : /* @__PURE__ */ (0, X.jsx)(R, {
+ }) : /* @__PURE__ */ (0, Y.jsx)(N, {
size: "compact",
- icon: I,
+ icon: z,
title: "还没有可探索的入口",
- actions: /* @__PURE__ */ (0, X.jsx)(qt, {
+ actions: /* @__PURE__ */ (0, Y.jsx)(Qe, {
size: "small",
href: "/",
children: "浏览馆藏"
@@ -1847,47 +1847,47 @@ function ia({ onboarding: e, done: t }) {
return !1;
}
});
- return t || n ? null : /* @__PURE__ */ (0, X.jsx)("div", {
- className: F({
+ return t || n ? null : /* @__PURE__ */ (0, Y.jsx)("div", {
+ className: I({
padding: "none",
className: "p-4"
}),
- children: /* @__PURE__ */ (0, X.jsxs)(nn, {
+ children: /* @__PURE__ */ (0, Y.jsxs)($e, {
summary: "浏览器历史记录导入指南",
defaultOpen: e,
children: [
- /* @__PURE__ */ (0, X.jsx)("p", {
+ /* @__PURE__ */ (0, Y.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: Ki
}),
- /* @__PURE__ */ (0, X.jsx)("p", {
+ /* @__PURE__ */ (0, Y.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: qi
}),
- /* @__PURE__ */ (0, X.jsxs)("ul", {
+ /* @__PURE__ */ (0, Y.jsxs)("ul", {
className: "flex list-disc flex-col gap-1 pl-5 text-body-2-regular text-text-secondary",
- children: [/* @__PURE__ */ (0, X.jsxs)("li", { children: [
+ children: [/* @__PURE__ */ (0, Y.jsxs)("li", { children: [
"Chrome:在 ",
- /* @__PURE__ */ (0, X.jsxs)("a", {
+ /* @__PURE__ */ (0, Y.jsxs)("a", {
href: "https://takeout.google.com/",
target: "_blank",
rel: "noopener noreferrer",
className: "text-text-primary underline-offset-4 hover:underline",
- children: ["Google Takeout", /* @__PURE__ */ (0, X.jsx)($e, {
+ children: ["Google Takeout", /* @__PURE__ */ (0, Y.jsx)(St, {
"aria-hidden": !0,
className: "size-(--icon-inline) shrink-0"
})]
}),
" ",
"选择 Chrome 历史记录,下载 ZIP 后直接导入。"
- ] }), /* @__PURE__ */ (0, X.jsxs)("li", { children: [
+ ] }), /* @__PURE__ */ (0, Y.jsxs)("li", { children: [
"其他浏览器:用 ",
- /* @__PURE__ */ (0, X.jsxs)("a", {
+ /* @__PURE__ */ (0, Y.jsxs)("a", {
href: "https://github.com/purarue/browserexport",
target: "_blank",
rel: "noopener noreferrer",
className: "text-text-primary underline-offset-4 hover:underline",
- children: ["browserexport", /* @__PURE__ */ (0, X.jsx)($e, {
+ children: ["browserexport", /* @__PURE__ */ (0, Y.jsx)(St, {
"aria-hidden": !0,
className: "size-(--icon-inline) shrink-0"
})]
@@ -1896,13 +1896,13 @@ function ia({ onboarding: e, done: t }) {
"导出历史记录,再导入导出文件。"
] })]
}),
- /* @__PURE__ */ (0, X.jsx)("p", {
+ /* @__PURE__ */ (0, Y.jsx)("p", {
className: "text-body-2-regular text-text-secondary",
children: Ji
}),
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "self-start",
- children: /* @__PURE__ */ (0, X.jsx)(L, {
+ children: /* @__PURE__ */ (0, Y.jsx)(M, {
variant: "secondary",
size: "small",
onClick: () => {
@@ -1922,62 +1922,62 @@ function aa({ busy: e, onRefresh: t, onImport: n, onImportBookmarks: r }) {
let i = (0, H.useRef)(null), [a, o] = (0, H.useState)(!1), s = (e) => {
o(!1), e();
};
- return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsxs)("span", {
+ return /* @__PURE__ */ (0, Y.jsxs)(Y.Fragment, { children: [/* @__PURE__ */ (0, Y.jsxs)("span", {
"data-button-group": !0,
"data-split-button": !0,
"data-variant": "primary",
- children: [/* @__PURE__ */ (0, X.jsx)(L, {
- leadingIcon: bt,
+ children: [/* @__PURE__ */ (0, Y.jsx)(M, {
+ leadingIcon: et,
title: Fi,
onClick: t,
- ...B(e),
+ ...F(e),
children: "读取浏览器记录"
- }), /* @__PURE__ */ (0, X.jsx)(L, {
+ }), /* @__PURE__ */ (0, Y.jsx)(M, {
ref: i,
iconOnly: !0,
- leadingIcon: st,
+ leadingIcon: Mt,
"aria-label": "更多取得浏览记录的方式",
"aria-haspopup": "dialog",
"aria-expanded": a,
- ...B(e),
+ ...F(e),
onClick: () => {
e || o(!0);
}
})]
- }), /* @__PURE__ */ (0, X.jsx)(Bt, {
+ }), /* @__PURE__ */ (0, Y.jsx)(Je, {
triggerRef: i,
isOpen: a,
onOpenChange: o,
placement: "bottom end",
offset: 4,
- className: Ot,
- children: /* @__PURE__ */ (0, X.jsxs)(dt, {
+ className: lt,
+ children: /* @__PURE__ */ (0, Y.jsxs)(ut, {
"aria-label": "更多取得浏览记录的方式",
className: "flex w-52 flex-col gap-1 outline-none",
children: [
- /* @__PURE__ */ (0, X.jsxs)("button", {
+ /* @__PURE__ */ (0, Y.jsxs)("button", {
type: "button",
- className: Mi,
+ className: Ni,
onClick: () => s(t),
- children: [/* @__PURE__ */ (0, X.jsx)(bt, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(et, {
"aria-hidden": !0,
className: "size-4 shrink-0"
}), "读取浏览器记录"]
}),
- /* @__PURE__ */ (0, X.jsxs)("button", {
+ /* @__PURE__ */ (0, Y.jsxs)("button", {
type: "button",
- className: Mi,
+ className: Ni,
onClick: () => s(n),
- children: [/* @__PURE__ */ (0, X.jsx)(ut, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(pt, {
"aria-hidden": !0,
className: "size-4 shrink-0"
}), "导入历史文件"]
}),
- /* @__PURE__ */ (0, X.jsxs)("button", {
+ /* @__PURE__ */ (0, Y.jsxs)("button", {
type: "button",
- className: Mi,
+ className: Ni,
onClick: () => s(r),
- children: [/* @__PURE__ */ (0, X.jsx)(sn, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(zt, {
"aria-hidden": !0,
className: "size-4 shrink-0"
}), "导入书签文件"]
@@ -1987,56 +1987,56 @@ function aa({ busy: e, onRefresh: t, onImport: n, onImportBookmarks: r }) {
})] });
}
function oa({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {
- let a = It({
- mutationFn: (e) => $t(e, n),
+ let a = on({
+ mutationFn: (e) => Jt(e, n),
onSuccess: (e) => {
- P.setQueryData(Ze(n), e.dashboard), r("已移除口味数据源");
+ B.setQueryData(V(n), e.dashboard), r("已移除口味数据源");
}
});
- return /* @__PURE__ */ (0, X.jsxs)(Ai, {
+ return /* @__PURE__ */ (0, Y.jsxs)(ji, {
browsers: t,
sources: e,
range: n,
- children: [a.error ? /* @__PURE__ */ (0, X.jsx)("div", {
+ children: [a.error ? /* @__PURE__ */ (0, Y.jsx)("div", {
className: "sm:col-span-2",
- children: /* @__PURE__ */ (0, X.jsx)(V, {
+ children: /* @__PURE__ */ (0, Y.jsx)(P, {
tone: "error",
- children: N(a.error)
+ children: R(a.error)
})
- }) : null, e.length ? /* @__PURE__ */ (0, X.jsx)(X.Fragment, { children: e.filter((e) => !t.some((t) => t.source_keys?.includes(e.source_key))).map((e) => /* @__PURE__ */ (0, X.jsxs)("div", {
+ }) : null, e.length ? /* @__PURE__ */ (0, Y.jsx)(Y.Fragment, { children: e.filter((e) => !t.some((t) => t.source_keys?.includes(e.source_key))).map((e) => /* @__PURE__ */ (0, Y.jsxs)("div", {
"data-taste-source": "import",
- className: ki,
+ className: Ai,
children: [
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "inline-grid size-8 shrink-0 place-items-center rounded-lg text-text-secondary",
- children: e.browser === "browserexport" ? /* @__PURE__ */ (0, X.jsx)(ut, {
+ children: e.browser === "browserexport" ? /* @__PURE__ */ (0, Y.jsx)(pt, {
"aria-hidden": !0,
className: "size-4"
- }) : /* @__PURE__ */ (0, X.jsx)(Lt, {
+ }) : /* @__PURE__ */ (0, Y.jsx)(wt, {
"aria-hidden": !0,
className: "size-4"
})
}),
- /* @__PURE__ */ (0, X.jsxs)("span", {
+ /* @__PURE__ */ (0, Y.jsxs)("span", {
className: "flex min-w-0 grow flex-col gap-0.5",
- children: [/* @__PURE__ */ (0, X.jsx)("b", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("b", {
className: "min-w-0 text-body-2-medium break-words text-text-primary",
children: e.profile
- }), /* @__PURE__ */ (0, X.jsx)("small", {
+ }), /* @__PURE__ */ (0, Y.jsx)("small", {
className: "min-w-0 text-caption-1-regular break-words text-text-secondary",
children: `导入文件 · ${e.host} · ${Number(e.visits || e.bookmarks || 0).toLocaleString()} ${e.bookmarks ? "枚书签" : "条历史"}`
})]
}),
- /* @__PURE__ */ (0, X.jsx)(L, {
+ /* @__PURE__ */ (0, Y.jsx)(M, {
variant: "secondary",
size: "small",
"aria-label": `移除 ${e.profile}`,
className: "shrink-0",
iconOnly: !0,
- leadingIcon: wt,
- ...B(a.isPending),
+ leadingIcon: ot,
+ ...F(a.isPending),
onClick: () => {
- a.isPending || lt({
+ a.isPending || At({
title: "移除口味数据源",
body: Yi,
confirmLabel: "移除口味数据源",
@@ -2045,9 +2045,9 @@ function oa({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {
}
})
]
- }, e.source_key)) }) : t.length ? null : /* @__PURE__ */ (0, X.jsx)(R, {
+ }, e.source_key)) }) : t.length ? null : /* @__PURE__ */ (0, Y.jsx)(N, {
size: "compact",
- icon: Lt,
+ icon: wt,
title: "还没有数据源",
actions: i,
children: Ii
@@ -2055,216 +2055,216 @@ function oa({ sources: e, browsers: t, window: n, toast: r, emptyActions: i }) {
});
}
function sa(e) {
- let { onSignal: t, navigate: n, toast: r, onboarding: i } = e, [a, o] = (0, H.useState)("all"), [s, c] = (0, H.useState)("browser"), l = (0, H.useRef)(null), u = (0, H.useRef)(null), d = St({
- queryKey: Ze(a),
- queryFn: ({ signal: e }) => Rt(a, e),
- placeholderData: Wt
- }), { job: f, running: p, outcome: m, start: h } = Ht({
- queryKey: Ut,
- queryFn: ({ signal: e }) => Zt(e),
- start: () => rn(a),
- idlePollMs: xt,
+ let { onSignal: n, navigate: r, toast: i, onboarding: a } = e, [o, s] = (0, H.useState)("all"), [c, l] = (0, H.useState)("browser"), u = (0, H.useRef)(null), d = (0, H.useRef)(null), f = sn({
+ queryKey: V(o),
+ queryFn: ({ signal: e }) => Nt(o, e),
+ placeholderData: Ht
+ }), { job: p, running: m, outcome: h, start: g } = an({
+ queryKey: yt,
+ queryFn: ({ signal: e }) => Pt(e),
+ start: () => Qt(o),
+ idlePollMs: it,
onFinish: (e) => {
- e.status !== "failed" && (P.invalidateQueries({ queryKey: ["taste"] }), r(e.warnings?.length ? "部分浏览记录未取得" : "已更新口味分析"));
+ e.status !== "failed" && (B.invalidateQueries({ queryKey: ["taste"] }), i(e.warnings?.length ? "部分浏览记录未取得" : "已更新口味分析"));
}
- }), g = It({
+ }), _ = on({
mutationFn: (e) => Vt(e),
onSuccess: (e) => {
- P.setQueryData(Ze("all"), e.dashboard), o("all"), r("已导入口味数据");
+ B.setQueryData(V("all"), e.dashboard), s("all"), i("已导入口味数据");
}
- }), _ = (e) => {
+ }), v = (e) => {
let t = e.currentTarget.files?.[0];
- e.currentTarget.value = "", t && !g.isPending && (g.reset(), g.mutate(t));
- }, v = () => {
- p || h.isPending || (h.reset(), h.mutate());
- }, y = d.data;
- if (!y) return /* @__PURE__ */ (0, X.jsx)(cn, { children: /* @__PURE__ */ (0, X.jsx)(V, {
+ e.currentTarget.value = "", t && !_.isPending && (_.reset(), _.mutate(t));
+ }, y = () => {
+ m || g.isPending || (g.reset(), g.mutate());
+ }, b = f.data;
+ if (!b) return /* @__PURE__ */ (0, Y.jsx)(cn, { children: /* @__PURE__ */ (0, Y.jsx)(P, {
tone: "error",
title: "口味分析读取失败",
- children: d.error ? N(d.error) : "读取口味分析失败"
+ children: f.error ? R(f.error) : "读取口味分析失败"
}) });
- let b = y.summary || {}, x = y.coverage || {}, S = y.rankings || {}, ee = y.storage || {}, C = tn(S.browser_categories || []), w = Nt(C).length > 0, T = y.gaps || [], E = x.tagged || 0, te = x.identified || 0, ne = h.error ? N(h.error) : g.error ? N(g.error) : m?.status === "failed" ? m.error || "读取未取得" : "", re = /* @__PURE__ */ (0, X.jsxs)("div", {
+ let x = b.summary || {}, S = b.coverage || {}, C = b.rankings || {}, ee = b.storage || {}, w = en(C.browser_categories || []), te = Gt(w).length > 0, ne = b.gaps || [], re = S.tagged || 0, ie = S.identified || 0, ae = g.error ? R(g.error) : _.error ? R(_.error) : h?.status === "failed" ? h.error || "读取未取得" : "", oe = /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex flex-wrap justify-center gap-2",
- children: [/* @__PURE__ */ (0, X.jsx)(L, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(M, {
variant: "secondary",
- ...B(p || h.isPending || g.isPending),
- onClick: v,
+ ...F(m || g.isPending || _.isPending),
+ onClick: y,
children: "读取浏览器记录"
- }), /* @__PURE__ */ (0, X.jsx)(L, {
+ }), /* @__PURE__ */ (0, Y.jsx)(M, {
variant: "secondary",
- ...B(g.isPending),
- onClick: () => l.current?.click(),
+ ...F(_.isPending),
+ onClick: () => u.current?.click(),
children: "导入历史文件"
})]
});
- return /* @__PURE__ */ (0, X.jsx)(cn, { children: /* @__PURE__ */ (0, X.jsxs)(Zi, {
- value: a === "all" ? s === "peach" ? /* @__PURE__ */ (0, X.jsx)(qt, {
+ return /* @__PURE__ */ (0, Y.jsx)(cn, { children: /* @__PURE__ */ (0, Y.jsxs)(Zi, {
+ value: o === "all" ? c === "peach" ? /* @__PURE__ */ (0, Y.jsx)(Qe, {
size: "small",
variant: "secondary",
href: "/",
children: "浏览馆藏"
- }) : re : /* @__PURE__ */ (0, X.jsx)(L, {
+ }) : oe : /* @__PURE__ */ (0, Y.jsx)(M, {
size: "small",
variant: "secondary",
- onClick: () => o("all"),
+ onClick: () => s("all"),
children: "查看全部时间"
}),
children: [
- /* @__PURE__ */ (0, X.jsxs)(Ye, {
- selectedKey: s,
- onSelectionChange: (e) => c(String(e)),
+ /* @__PURE__ */ (0, Y.jsxs)(Ze, {
+ selectedKey: c,
+ onSelectionChange: (e) => l(String(e)),
className: "flex flex-col gap-5",
children: [
- /* @__PURE__ */ (0, X.jsxs)("div", {
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex flex-wrap items-center justify-between gap-3",
- children: [/* @__PURE__ */ (0, X.jsxs)(Pt, {
+ children: [/* @__PURE__ */ (0, Y.jsxs)(gt, {
"aria-label": "口味分析的数据来源",
- className: Kt,
- children: [/* @__PURE__ */ (0, X.jsx)(at, {
+ className: ht,
+ children: [/* @__PURE__ */ (0, Y.jsx)(Xe, {
id: "browser",
- className: At,
+ className: mt,
children: "浏览器记录"
- }), /* @__PURE__ */ (0, X.jsx)(at, {
+ }), /* @__PURE__ */ (0, Y.jsx)(Xe, {
id: "peach",
- className: At,
+ className: mt,
children: "Peach 观看与评价"
})]
- }), /* @__PURE__ */ (0, X.jsxs)("div", {
+ }), /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex flex-wrap items-center gap-2",
children: [
- /* @__PURE__ */ (0, X.jsx)(Mt, {
+ /* @__PURE__ */ (0, Y.jsx)(_t, {
"aria-label": "分析范围",
- selectedKey: a,
+ selectedKey: o,
onSelectionChange: (e) => {
- e !== null && o(String(e));
+ e !== null && s(String(e));
},
- children: Xt.map(([e, t]) => /* @__PURE__ */ (0, X.jsx)(yt, {
+ children: bt.map(([e, t]) => /* @__PURE__ */ (0, Y.jsx)(vt, {
id: e,
children: t
}, e))
}),
- /* @__PURE__ */ (0, X.jsx)(aa, {
- busy: p || h.isPending || g.isPending,
- onRefresh: v,
- onImport: () => l.current?.click(),
- onImportBookmarks: () => u.current?.click()
+ /* @__PURE__ */ (0, Y.jsx)(aa, {
+ busy: m || g.isPending || _.isPending,
+ onRefresh: y,
+ onImport: () => u.current?.click(),
+ onImportBookmarks: () => d.current?.click()
}),
- /* @__PURE__ */ (0, X.jsx)("input", {
- ref: l,
+ /* @__PURE__ */ (0, Y.jsx)("input", {
+ ref: u,
type: "file",
tabIndex: -1,
"aria-hidden": !0,
className: "hidden",
- onChange: _
+ onChange: v
}),
- /* @__PURE__ */ (0, X.jsx)("input", {
- ref: u,
+ /* @__PURE__ */ (0, Y.jsx)("input", {
+ ref: d,
type: "file",
tabIndex: -1,
"aria-hidden": !0,
className: "hidden",
"data-bookmark-import": !0,
- onChange: _
+ onChange: v
})
]
})]
}),
- /* @__PURE__ */ (0, X.jsx)(ia, {
- onboarding: i,
- done: !!(b.history_sources || y.updated_at)
+ /* @__PURE__ */ (0, Y.jsx)(ia, {
+ onboarding: a,
+ done: !!(x.history_sources || b.updated_at)
}),
- /* @__PURE__ */ (0, X.jsxs)("div", {
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
"aria-live": "polite",
className: "flex flex-col gap-3 empty:hidden",
children: [
- p ? /* @__PURE__ */ (0, X.jsx)(ot, {
- label: f?.message || "正在读取浏览记录并更新口味分析",
- value: f?.checked,
- total: f?.total
+ m ? /* @__PURE__ */ (0, Y.jsx)(xt, {
+ label: p?.message || "正在读取浏览记录并更新口味分析",
+ value: p?.checked,
+ total: p?.total
}) : null,
- g.isPending ? /* @__PURE__ */ (0, X.jsx)(ot, { label: "正在导入口味数据" }) : null,
- ne ? /* @__PURE__ */ (0, X.jsx)(V, {
+ _.isPending ? /* @__PURE__ */ (0, Y.jsx)(xt, { label: "正在导入口味数据" }) : null,
+ ae ? /* @__PURE__ */ (0, Y.jsx)(P, {
tone: "error",
- children: ne
+ children: ae
}) : null,
- m?.warnings?.length ? /* @__PURE__ */ (0, X.jsx)(V, {
+ h?.warnings?.length ? /* @__PURE__ */ (0, Y.jsx)(P, {
tone: "warning",
- children: m.warnings.join(";")
+ children: h.warnings.join(";")
}) : null
]
}),
- /* @__PURE__ */ (0, X.jsxs)(_t, {
+ /* @__PURE__ */ (0, Y.jsxs)(Ye, {
id: "browser",
className: "flex flex-col gap-5",
children: [
- /* @__PURE__ */ (0, X.jsxs)("div", {
- className: un,
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
+ className: ln,
children: [
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 0,
- icon: ht,
+ icon: rn,
term: "浏览记录",
- figure: Number(b.history_visits || 0).toLocaleString(),
- detail: Gt(b),
- detailTitle: `${Ct(b.range_start)}—${Ct(b.range_end)}`
+ figure: Number(x.history_visits || 0).toLocaleString(),
+ detail: Bt(x),
+ detailTitle: `${$t(x.range_start)}—${$t(x.range_end)}`
}),
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 1,
- icon: ft,
+ icon: Ut,
term: "口味维度",
- figure: C.length.toLocaleString(),
- detail: C[0]?.name || "尚无主维度"
+ figure: w.length.toLocaleString(),
+ detail: w[0]?.name || "尚无主维度"
}),
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 2,
- icon: I,
+ icon: z,
term: "浏览线索",
- figure: T.length.toLocaleString()
+ figure: ne.length.toLocaleString()
}),
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 3,
- icon: sn,
+ icon: zt,
term: "浏览器书签",
- figure: Number(b.bookmarks || 0).toLocaleString(),
- detail: `${Number(ee.exports || 0).toLocaleString()} 份私有导出 · ${gt(ee.bytes || 0)}`
+ figure: Number(x.bookmarks || 0).toLocaleString(),
+ detail: `${Number(ee.exports || 0).toLocaleString()} 份私有导出 · ${Rt(ee.bytes || 0)}`
})
]
}),
- /* @__PURE__ */ (0, X.jsxs)("section", {
- className: w ? `${Ni} md:flex-row md:gap-6` : Ni,
+ /* @__PURE__ */ (0, Y.jsxs)("section", {
+ className: te ? `${Q} md:flex-row md:gap-6` : Q,
"aria-label": "浏览器画像",
- children: [/* @__PURE__ */ (0, X.jsxs)("div", {
- className: w ? "flex shrink-0 flex-col gap-2 pb-5 md:w-80 md:pr-6 md:pb-0" : "flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",
+ children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
+ className: te ? "flex shrink-0 flex-col gap-2 pb-5 md:w-80 md:pr-6 md:pb-0" : "flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",
children: [
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "text-caption-1-regular text-text-secondary",
children: "浏览器画像"
}),
- w ? /* @__PURE__ */ (0, X.jsx)(Ei, {
- rows: C,
+ te ? /* @__PURE__ */ (0, Y.jsx)(Di, {
+ rows: w,
label: "主要口味维度"
}) : null,
- /* @__PURE__ */ (0, X.jsx)("small", {
+ /* @__PURE__ */ (0, Y.jsx)("small", {
className: "text-caption-1-regular text-text-secondary",
- children: y.updated_at ? `更新于 ${Ct(y.updated_at)}` : "尚未采集浏览记录"
+ children: b.updated_at ? `更新于 ${$t(b.updated_at)}` : "尚未采集浏览记录"
})
]
- }), /* @__PURE__ */ (0, X.jsx)("div", {
+ }), /* @__PURE__ */ (0, Y.jsx)("div", {
className: "flex min-w-0 grow flex-col",
- children: C.length ? /* @__PURE__ */ (0, X.jsx)(Di, {
- rows: C,
+ children: w.length ? /* @__PURE__ */ (0, Y.jsx)(Oi, {
+ rows: w,
label: "口味维度排名"
- }) : /* @__PURE__ */ (0, X.jsx)(R, {
+ }) : /* @__PURE__ */ (0, Y.jsx)(N, {
size: "compact",
- icon: I,
+ icon: z,
title: "暂无口味维度",
- actions: /* @__PURE__ */ (0, X.jsx)(Qi, {}),
+ actions: /* @__PURE__ */ (0, Y.jsx)(Qi, {}),
children: Ri
})
})]
}),
- /* @__PURE__ */ (0, X.jsx)(Ee, {
- activity: y.activity,
+ /* @__PURE__ */ (0, Y.jsx)(t, {
+ activity: b.activity,
title: "浏览活跃时间",
dailyTitle: "每日活跃",
words: {
@@ -2275,16 +2275,16 @@ function sa(e) {
tone: 4,
empty: "还没有可用于分析的口味网站访问记录。"
}),
- /* @__PURE__ */ (0, X.jsx)(Oi, { flows: y.creator_flows }),
- /* @__PURE__ */ (0, X.jsx)(na, {
+ /* @__PURE__ */ (0, Y.jsx)(ki, { flows: b.creator_flows }),
+ /* @__PURE__ */ (0, Y.jsx)(na, {
label: "浏览器口味维度",
- onSignal: t,
+ onSignal: n,
panels: [
{
id: "tags",
name: "标签",
props: {
- rows: S.browser_tags || [],
+ rows: C.browser_tags || [],
kind: "tag",
visual: "none",
empty: Bi
@@ -2294,7 +2294,7 @@ function sa(e) {
id: "creators",
name: "创作者",
props: {
- rows: S.browser_creators || [],
+ rows: C.browser_creators || [],
kind: "creator",
visual: "creator",
empty: Vi
@@ -2304,7 +2304,7 @@ function sa(e) {
id: "performers",
name: "女优",
props: {
- rows: S.browser_performers || [],
+ rows: C.browser_performers || [],
kind: "performer",
visual: "entity",
empty: "还没有与已建档女优关联的浏览记录。"
@@ -2314,7 +2314,7 @@ function sa(e) {
id: "domains",
name: "常访问网站",
props: {
- rows: S.domains || [],
+ rows: C.domains || [],
kind: "",
visual: "domain",
empty: Hi
@@ -2324,7 +2324,7 @@ function sa(e) {
id: "gaps",
name: "浏览线索",
props: {
- rows: T,
+ rows: ne,
kind: "",
visual: "none",
empty: zi
@@ -2334,81 +2334,81 @@ function sa(e) {
})
]
}),
- /* @__PURE__ */ (0, X.jsxs)(_t, {
+ /* @__PURE__ */ (0, Y.jsxs)(Ye, {
id: "peach",
className: "flex flex-col gap-5",
children: [
- /* @__PURE__ */ (0, X.jsxs)("div", {
- className: un,
+ /* @__PURE__ */ (0, Y.jsxs)("div", {
+ className: ln,
children: [
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 0,
- icon: Xe,
+ icon: Ct,
term: "Peach 看过",
- figure: Number(b.peach_items || 0).toLocaleString(),
- detail: ct(b.peach_seconds || 0)
+ figure: Number(x.peach_items || 0).toLocaleString(),
+ detail: tn(x.peach_seconds || 0)
}),
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 1,
- icon: nt,
+ icon: Et,
term: "喜欢",
- figure: Number(b.liked || 0).toLocaleString()
+ figure: Number(x.liked || 0).toLocaleString()
}),
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 2,
- icon: rt,
+ icon: Ot,
term: "不合口味",
- figure: Number(b.disliked || 0).toLocaleString()
+ figure: Number(x.disliked || 0).toLocaleString()
}),
- /* @__PURE__ */ (0, X.jsx)($, {
+ /* @__PURE__ */ (0, Y.jsx)($, {
accent: 3,
- icon: ft,
+ icon: Ut,
term: "有标签",
- figure: E.toLocaleString()
+ figure: re.toLocaleString()
})
]
}),
- /* @__PURE__ */ (0, X.jsxs)("section", {
- className: `${Ni} md:flex-row md:gap-6`,
+ /* @__PURE__ */ (0, Y.jsxs)("section", {
+ className: `${Q} md:flex-row md:gap-6`,
"aria-label": "Peach 观看",
- children: [/* @__PURE__ */ (0, X.jsxs)("div", {
+ children: [/* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex shrink-0 flex-col gap-0.5 pb-5 md:w-72 md:pr-6 md:pb-0",
children: [
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "text-caption-1-regular text-text-secondary",
children: "Peach 观看"
}),
- /* @__PURE__ */ (0, X.jsx)("b", {
+ /* @__PURE__ */ (0, Y.jsx)("b", {
className: "text-display-4-medium tabular-nums text-text-primary",
- children: Number(b.peach_items || 0).toLocaleString()
+ children: Number(x.peach_items || 0).toLocaleString()
}),
- /* @__PURE__ */ (0, X.jsx)("span", {
+ /* @__PURE__ */ (0, Y.jsx)("span", {
className: "text-body-2-regular text-text-secondary",
children: "部作品有观看或评价记录"
})
]
- }), /* @__PURE__ */ (0, X.jsxs)("div", {
+ }), /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex min-w-0 grow flex-col",
- children: [/* @__PURE__ */ (0, X.jsx)(ca, {
+ children: [/* @__PURE__ */ (0, Y.jsx)(ca, {
term: "有标签",
- value: E,
- rest: x.untagged || 0
- }), /* @__PURE__ */ (0, X.jsx)(ca, {
+ value: re,
+ rest: S.untagged || 0
+ }), /* @__PURE__ */ (0, Y.jsx)(ca, {
term: "有身份",
- value: te,
- rest: x.unidentified || 0
+ value: ie,
+ rest: S.unidentified || 0
})]
})]
}),
- /* @__PURE__ */ (0, X.jsx)(na, {
+ /* @__PURE__ */ (0, Y.jsx)(na, {
label: "Peach 口味维度",
- onSignal: t,
+ onSignal: n,
panels: [
{
id: "tags",
name: "标签",
props: {
- rows: S.peach_tags || [],
+ rows: C.peach_tags || [],
kind: "tag",
visual: "none",
empty: Ui
@@ -2418,7 +2418,7 @@ function sa(e) {
id: "creators",
name: "创作者",
props: {
- rows: S.peach_creators || [],
+ rows: C.peach_creators || [],
kind: "creator",
visual: "creator",
empty: Wi
@@ -2428,7 +2428,7 @@ function sa(e) {
id: "performers",
name: "女优",
props: {
- rows: S.peach_performers || [],
+ rows: C.peach_performers || [],
kind: "performer",
visual: "entity",
empty: Gi
@@ -2440,35 +2440,35 @@ function sa(e) {
})
]
}),
- /* @__PURE__ */ (0, X.jsx)(ra, {
- data: y,
- onSignal: t,
- navigate: n
+ /* @__PURE__ */ (0, Y.jsx)(ra, {
+ data: b,
+ onSignal: n,
+ navigate: r
}),
- /* @__PURE__ */ (0, X.jsx)(oa, {
- sources: y.sources || [],
- browsers: y.browsers || [],
- window: a,
- toast: r,
- emptyActions: re
+ /* @__PURE__ */ (0, Y.jsx)(oa, {
+ sources: b.sources || [],
+ browsers: b.browsers || [],
+ window: o,
+ toast: i,
+ emptyActions: oe
})
]
}) });
}
function ca({ term: e, value: t, rest: n }) {
let r = Math.max(t + n, 1);
- return /* @__PURE__ */ (0, X.jsxs)("div", {
+ return /* @__PURE__ */ (0, Y.jsxs)("div", {
className: "flex flex-col gap-1.5 border-b border-separator-border py-3 last:border-b-0",
- children: [/* @__PURE__ */ (0, X.jsxs)("p", {
+ children: [/* @__PURE__ */ (0, Y.jsxs)("p", {
className: "flex items-baseline justify-between gap-3 text-body-2-regular text-text-primary",
- children: [/* @__PURE__ */ (0, X.jsx)("span", { children: e }), /* @__PURE__ */ (0, X.jsxs)("b", {
+ children: [/* @__PURE__ */ (0, Y.jsx)("span", { children: e }), /* @__PURE__ */ (0, Y.jsxs)("b", {
className: "tabular-nums",
- children: [t.toLocaleString(), /* @__PURE__ */ (0, X.jsx)("span", {
+ children: [t.toLocaleString(), /* @__PURE__ */ (0, Y.jsx)("span", {
className: "ml-1.5 text-caption-1-regular text-text-secondary",
children: `${n.toLocaleString()} 项待补`
})]
})]
- }), /* @__PURE__ */ (0, X.jsx)(on, {
+ }), /* @__PURE__ */ (0, Y.jsx)(ft, {
label: `${e}:${t.toLocaleString()} / ${r.toLocaleString()}`,
value: t,
max: r
@@ -2478,4 +2478,4 @@ function ca({ term: e, value: t, rest: n }) {
//#endregion
export { Xi as TASTE_GUIDE_KEY, sa as TastePage };
-//# debugId=e6f0d41e-6c62-4dc8-b6b4-5a52c3b9ac7c
\ No newline at end of file
+//# debugId=8abe0556-ed80-48ed-9ba4-6a697e5e5b94
\ No newline at end of file
diff --git a/web/dist/peach-app.use-table-selection-KrR-g6fk.js b/web/dist/peach-app.use-table-selection-Bi_E2zbh.js
similarity index 65%
rename from web/dist/peach-app.use-table-selection-KrR-g6fk.js
rename to web/dist/peach-app.use-table-selection-Bi_E2zbh.js
index db2eb80eb..d2b917469 100644
--- a/web/dist/peach-app.use-table-selection-KrR-g6fk.js
+++ b/web/dist/peach-app.use-table-selection-Bi_E2zbh.js
@@ -1,32 +1,32 @@
(function() {
try {
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "2e2dcca0-a664-496a-a593-937ecc2fd209", e._sentryDebugIdIdentifier = "sentry-dbid-2e2dcca0-a664-496a-a593-937ecc2fd209");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "cf2bed7a-b623-4d5c-9660-b1e6d3b0412a", e._sentryDebugIdIdentifier = "sentry-dbid-cf2bed7a-b623-4d5c-9660-b1e6d3b0412a");
} catch {}
})();
-import { $i as e, Hi as t, Qi as n, Ui as r, Xi as i, ea as a, pu as o, uu as s } from "./peach-app.js";
+import { __toESM as e, autoResetPageIndex as t, column_getCanSort as n, column_getSortFn as r, copyInstancePropertiesWithoutMemos as i, require_react as a, skipFirstRun as o, tableMemo as s } from "./peach-app.js";
//#region node_modules/@tanstack/table-core/dist/features/row-sorting/createSortedRowModel.js
function c() {
- return (t) => {
- let n = t;
- return a({
+ return (e) => {
+ let n = e;
+ return s({
feature: "rowSortingFeature",
table: n,
fnName: "table.getSortedRowModel",
memoDeps: () => [n.atoms.sorting?.get(), n.getPreSortedRowModel()],
fn: () => l(n),
- onAfterUpdate: e(() => i(n))
+ onAfterUpdate: o(() => t(n))
});
};
}
function l(e) {
- let i = e.getPreSortedRowModel(), a = e.atoms.sorting?.get();
- if (!i.rows.length || !a?.length) return i;
- let o = [], s = a.filter((n) => {
- let r = e.getColumn(n.id);
- return r ? t(r) : !1;
+ let t = e.getPreSortedRowModel(), a = e.atoms.sorting?.get();
+ if (!t.rows.length || !a?.length) return t;
+ let o = [], s = a.filter((t) => {
+ let r = e.getColumn(t.id);
+ return r ? n(r) : !1;
});
- if (!s.length) return i;
+ if (!s.length) return t;
let c = [];
for (let t = 0; t < s.length; t++) {
let n = s[t], i = e.getColumn(n.id);
@@ -56,33 +56,33 @@ function l(e) {
}, u = (e) => {
let t = e.slice();
t.sort(l);
- let r = !1;
- for (let i = 0; i < t.length; i++) {
- let a = t[i];
- a !== e[i] && (r = !0);
+ let n = !1;
+ for (let r = 0; r < t.length; r++) {
+ let a = t[r];
+ a !== e[r] && (n = !0);
let s = o.length;
if (o.push(a), a.subRows.length) {
let e = u(a.subRows);
if (e.changed) {
let c = Object.create(Object.getPrototypeOf(a));
- n(c, a), c.subRows = e.rows, t[i] = c, o[s] = c, r = !0;
+ i(c, a), c.subRows = e.rows, t[r] = c, o[s] = c, n = !0;
}
}
}
return {
rows: t,
- changed: r
+ changed: n
};
};
return {
- rows: u(i.rows).rows,
+ rows: u(t.rows).rows,
flatRows: o,
- rowsById: i.rowsById
+ rowsById: t.rowsById
};
}
//#endregion
//#region src/react/components/use-table-selection.ts
-var u = /* @__PURE__ */ o(s(), 1), d = /* @__PURE__ */ new Map();
+var u = /* @__PURE__ */ e(a(), 1), d = /* @__PURE__ */ new Map();
function f(e) {
let t = (0, u.useId)(), n = (0, u.useRef)(e);
return n.current = e, (0, u.useEffect)(() => (d.set(t, () => n.current()), () => {
@@ -92,6 +92,6 @@ function f(e) {
}, [t]);
}
//#endregion
-export { c as n, f as t };
+export { c as createSortedRowModel, f as useTableSelection };
-//# debugId=2e2dcca0-a664-496a-a593-937ecc2fd209
\ No newline at end of file
+//# debugId=cf2bed7a-b623-4d5c-9660-b1e6d3b0412a
\ No newline at end of file