Skip to content

armgit / peach

Public Imported from GitHub
0

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

Merge branch 'master' into agent/claude/vercel-button-fills

longmeidaoe997ea84ca0c
diff --cc web/css/19-immersive.css
index de3a55cbc,8c444e4a3..bee22c09d
--- a/web/css/19-immersive.css
+++ b/web/css/19-immersive.css
@@@ -81,12 -81,23 +81,22 @@@
.emptystate h3{margin:0;font-size:var(--fs-md);font-weight:600;color:var(--ink)}
.emptystate p{margin:0;max-width:340px;font-size:var(--fs-sm);line-height:1.55;color:var(--muted)}
.emptystate .es-actions{display:flex;justify-content:center;gap:8px;margin-top:8px}
- .batchbar{position:fixed;left:50%;bottom:22px;z-index:180;transform:translateX(-50%);display:flex;align-items:center;gap:7px;
+ .selectiondock{position:fixed;left:50%;bottom:max(22px,env(safe-area-inset-bottom));z-index:180;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:7px;width:max-content;max-width:calc(100vw - 24px);box-sizing:border-box;
padding:9px 11px;border:1px solid var(--line);border-radius:var(--floating-radius);background:var(--surface);
- box-shadow:0 8px 24px #0005}.batchbar[hidden]{display:none}
+ box-shadow:0 8px 24px #0005}.selectiondock[hidden]{display:none}
+ .selectiondock>button{white-space:nowrap}
+ .tagselection.selectiondock{margin:0}
+ .selectiondock [hidden]{display:none}
+ body:has(#batchbar:not([hidden])) #stage{padding-bottom:180px}
+ #index:has(.tagselection:not([hidden])){padding-bottom:220px}
+ .review:has(.reviewdock:not([hidden])){padding-bottom:220px}
+ .reviewdock .reviewbulkfeedback{flex-basis:100%;margin:0;text-align:center}
+ .reviewdock .reviewbulkdecisions{flex-wrap:wrap;justify-content:center;gap:7px}
+ .reviewdock .reviewbulksource{max-width:min(280px,calc(100vw - 48px))}
+ .reviewdock .geist-button,.reviewdock .gselectfield{height:var(--control-h)}
-.batchbar span{padding:0 8px;color:var(--ink-2);white-space:nowrap}.batchbar button{border:1px solid var(--line);border-radius:var(--floating-radius);
- background:var(--surface);color:var(--ink);padding:9px 12px;cursor:pointer}.batchbar button:hover{background:var(--hover);color:var(--ink)}
+.batchbar span{padding:0 8px;color:var(--ink-2);white-space:nowrap}.batchbar button{border:0;border-radius:var(--floating-radius);
+ background:var(--ground);color:var(--ink);padding:9px 12px;cursor:pointer}.batchbar button:hover{background:var(--hover);color:var(--ink)}
.batchbar button svg{width:17px;height:17px;margin-right:6px;vertical-align:-4px;stroke:currentColor;fill:none;stroke-width:2}
-.batchbar .danger{color:var(--drop)}
@media (max-width:1080px){.sgrid,.sgrid.mixgrid{grid-template-columns:minmax(0,1fr)}
.sgrid.mixgrid{grid-template-areas:"media" "side" "queue"}
diff --cc web/dist/peach-ui.js
index 4ff23f3a4,00822e7b1..9f92ce3b2
--- a/web/dist/peach-ui.js
+++ b/web/dist/peach-ui.js
@@@ -1,21 -1,21 +1,21 @@@
import { MEDIA_SOURCE_ICONS as e, badgeHtml as t, checkboxHtml as n, confirmModal as r, emptyStateHtml as i, fieldsetTitle as a, loadingDotsHtml as o, noteHtml as s, progressHtml as c, selectFieldHtml as l, selectOptionIconHtml as u, setActionBusy as d, wireCollapse as f, wireSelectField as p } from "/js/ui-components.js";
-import { LOC as m, esc as h, fmtDur as g, fmtSize as _, icon as v } from "/js/core.js";
+import { LOC as m, esc as h, faviconUrl as g, fmtDur as _, fmtSize as v, icon as y } from "/js/core.js";
//#region node_modules/preact/dist/preact.module.js
- var b, x, S, C, w, T, E, D, O, k, A, j, M, N, ee, te = {}, ne = [], re = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ie = Array.isArray;
- function P(e, t) {
-var y, b, x, S, C, w, T, E, D, O, k, A, j, M, N, P = {}, F = [], ee = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, te = Array.isArray;
-function I(e, t) {
++var b, x, S, C, w, T, E, D, O, k, A, ee, te, j, M, N = {}, P = [], ne = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, re = Array.isArray;
++function F(e, t) {
for (var n in t) e[n] = t[n];
return e;
}
- function ae(e) {
-function ne(e) {
++function ie(e) {
e && e.parentNode && e.parentNode.removeChild(e);
}
- function oe(e, t, n) {
-function re(e, t, n) {
++function ae(e, t, n) {
var r, i, a, o = {};
for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];
- if (arguments.length > 2 && (o.children = arguments.length > 3 ? y.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);
- return ie(e, o, r, i, null);
+ if (arguments.length > 2 && (o.children = arguments.length > 3 ? b.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);
- return se(e, o, r, i, null);
++ return oe(e, o, r, i, null);
}
- function se(e, t, n, r, i) {
-function ie(e, t, n, r, i) {
++function oe(e, t, n, r, i) {
var a = {
type: e,
props: t,
@@@ -31,64 -31,64 +31,64 @@@
__i: -1,
__u: 0
};
- return i == null && b.vnode != null && b.vnode(a), a;
+ return i == null && x.vnode != null && x.vnode(a), a;
}
- function F(e) {
-function L(e) {
++function I(e) {
return e.children;
}
- function ce(e, t) {
-function ae(e, t) {
++function se(e, t) {
this.props = e, this.context = t;
}
- function I(e, t) {
- if (t == null) return e.__ ? I(e.__, e.__i + 1) : null;
-function R(e, t) {
- if (t == null) return e.__ ? R(e.__, e.__i + 1) : null;
++function L(e, t) {
++ if (t == null) return e.__ ? L(e.__, e.__i + 1) : null;
for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
- return typeof e.type == "function" ? I(e) : null;
- return typeof e.type == "function" ? R(e) : null;
++ return typeof e.type == "function" ? L(e) : null;
}
- function le(e) {
-function oe(e) {
++function ce(e) {
if (e.__P && e.__d) {
- var t = e.__v, n = t.__e, r = [], i = [], a = P({}, t);
- a.__v = t.__v + 1, x.vnode && x.vnode(a), be(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? I(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, Se(r, a, i), t.__e = t.__ = null, a.__e != n && ue(a);
- var t = e.__v, n = t.__e, r = [], i = [], a = I({}, t);
- a.__v = t.__v + 1, b.vnode && b.vnode(a), _e(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? R(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, ye(r, a, i), t.__e = t.__ = null, a.__e != n && se(a);
++ var t = e.__v, n = t.__e, r = [], i = [], a = F({}, t);
++ a.__v = t.__v + 1, x.vnode && x.vnode(a), ye(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? L(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, xe(r, a, i), t.__e = t.__ = null, a.__e != n && le(a);
}
}
- function ue(e) {
-function se(e) {
++function le(e) {
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
- }), ue(e);
- }), se(e);
++ }), le(e);
}
- function de(e) {
- (!e.__d && (e.__d = !0) && w.push(e) && !fe.__r++ || T != x.debounceRendering) && ((T = x.debounceRendering) || E)(fe);
-function ce(e) {
- (!e.__d && (e.__d = !0) && C.push(e) && !le.__r++ || w != b.debounceRendering) && ((w = b.debounceRendering) || T)(le);
++function ue(e) {
++ (!e.__d && (e.__d = !0) && w.push(e) && !de.__r++ || T != x.debounceRendering) && ((T = x.debounceRendering) || E)(de);
}
- function fe() {
-function le() {
++function de() {
try {
- for (var e, t = 1; w.length;) w.length > t && w.sort(D), e = w.shift(), t = w.length, le(e);
- for (var e, t = 1; C.length;) C.length > t && C.sort(E), e = C.shift(), t = C.length, oe(e);
++ for (var e, t = 1; w.length;) w.length > t && w.sort(D), e = w.shift(), t = w.length, ce(e);
} finally {
- w.length = fe.__r = 0;
- C.length = le.__r = 0;
++ w.length = de.__r = 0;
}
}
- function pe(e, t, n, r, i, a, o, s, c, l, u) {
- var d, f, p, m, h, g, _ = r && r.__k || ne, v = t.length;
- for (c = me(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || te, p.__i = d, g = be(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && Te(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = he(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
-function ue(e, t, n, r, i, a, o, s, c, l, u) {
- var d, f, p, m, h, g, _ = r && r.__k || F, v = t.length;
- for (c = de(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || P, p.__i = d, g = _e(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && Se(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = fe(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
++function fe(e, t, n, r, i, a, o, s, c, l, u) {
++ var d, f, p, m, h, g, _ = r && r.__k || P, v = t.length;
++ for (c = pe(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || N, p.__i = d, g = ye(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && we(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = me(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);
return n.__e = h, c;
}
- function me(e, t, n, r, i) {
-function de(e, t, n, r, i) {
++function pe(e, t, n, r, i) {
var a, o, s, c, l, u = n.length, d = u, f = 0;
- for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = se(null, o, null, null, null) : ie(o) ? o = e.__k[a] = se(F, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = se(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = ge(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
- if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = I(s)), Ee(s, s));
- for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = ie(null, o, null, null, null) : te(o) ? o = e.__k[a] = ie(L, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = ie(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = pe(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
- if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = R(s)), Ce(s, s));
++ for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = oe(null, o, null, null, null) : re(o) ? o = e.__k[a] = oe(I, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = oe(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = he(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
++ if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = L(s)), Te(s, s));
return r;
}
- function he(e, t, n) {
-function fe(e, t, n) {
++function me(e, t, n) {
var r, i;
if (typeof e.type == "function") {
- for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = he(r[i], t, n));
- for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = fe(r[i], t, n));
++ for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = me(r[i], t, n));
return t;
}
- e.__e != t && (t && e.type && !t.parentNode && (t = I(e)), t = n.insertBefore(e.__e, t || null));
- e.__e != t && (t && e.type && !t.parentNode && (t = R(e)), t = n.insertBefore(e.__e, t || null));
++ e.__e != t && (t && e.type && !t.parentNode && (t = L(e)), t = n.insertBefore(e.__e, t || null));
do
t &&= t.nextSibling;
while (t != null && t.nodeType == 8);
return t;
}
- function ge(e, t, n, r) {
-function pe(e, t, n, r) {
++function he(e, t, n, r) {
var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);
if (l === null && s == null || u && s == l.key && c == l.type) return n;
if (r > +!!u) {
@@@ -96,18 -96,18 +96,18 @@@
}
return -1;
}
- function _e(e, t, n) {
- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || re.test(t) ? n : n + "px";
-function me(e, t, n) {
- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ee.test(t) ? n : n + "px";
++function ge(e, t, n) {
++ t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ne.test(t) ? n : n + "px";
}
- function ve(e, t, n, r, i) {
-function he(e, t, n, r, i) {
++function _e(e, t, n, r, i) {
var a, o;
n: if (t == "style") {
if (typeof n == "string") e.style.cssText = n;
else {
- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || _e(e.style, t, "");
- if (n) for (t in n) r && n[t] == r[t] || _e(e.style, t, n[t]);
- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || me(e.style, t, "");
- if (n) for (t in n) r && n[t] == r[t] || me(e.style, t, n[t]);
++ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ge(e.style, t, "");
++ if (n) for (t in n) r && n[t] == r[t] || ge(e.style, t, n[t]);
}
- } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(j, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[A] = r[A] : (n[A] = M, e.addEventListener(t, a ? ee : N, a)) : e.removeEventListener(t, a ? ee : N, a);
- } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(A, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[k] = r[k] : (n[k] = j, e.addEventListener(t, a ? N : M, a)) : e.removeEventListener(t, a ? N : M, a);
++ } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(ee, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[A] = r[A] : (n[A] = te, e.addEventListener(t, a ? M : j, a)) : e.removeEventListener(t, a ? M : j, a);
else {
if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
@@@ -117,58 -117,58 +117,58 @@@
typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
}
}
- function ye(e) {
-function ge(e) {
++function ve(e) {
return function(t) {
if (this.l) {
var n = this.l[t.type + e];
- if (t[k] == null) t[k] = M++;
- if (t[O] == null) t[O] = j++;
- else if (t[O] < n[k]) return;
- return n(b.event ? b.event(t) : t);
++ if (t[k] == null) t[k] = te++;
+ else if (t[k] < n[A]) return;
+ return n(x.event ? x.event(t) : t);
}
};
}
- function be(e, t, n, r, i, a, o, s, c, l) {
-function _e(e, t, n, r, i, a, o, s, c, l) {
- var u, d, f, p, m, h, g, _, v, y, x, S, C, w, T, E, D = t.type;
++function ye(e, t, n, r, i, a, o, s, c, l) {
+ var u, d, f, p, m, h, g, _, v, y, b, S, C, w, T, E, D = t.type;
if (t.constructor !== void 0) return null;
- 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = b.__b) && u(t);
+ 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = x.__b) && u(t);
n: if (typeof D == "function") {
d = o.length;
try {
- if (v = t.props, y = D.prototype && D.prototype.render, b = (u = D.contextType) && r[u.__c], S = u ? b ? b.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, S) : (t.__c = f = new ce(v, S), f.constructor = D, f.render = De), b && b.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), y && f.__s == null && (f.__s = f.state), y && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = P({}, f.__s)), P(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) y && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), y && f.componentDidMount != null && f.__h.push(f.componentDidMount);
- if (v = t.props, y = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, S) : (t.__c = f = new ae(v, S), f.constructor = D, f.render = we), x && x.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), y && f.__s == null && (f.__s = f.state), y && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = I({}, f.__s)), I(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) y && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), y && f.componentDidMount != null && f.__h.push(f.componentDidMount);
++ if (v = t.props, y = D.prototype && D.prototype.render, b = (u = D.contextType) && r[u.__c], S = u ? b ? b.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, S) : (t.__c = f = new se(v, S), f.constructor = D, f.render = Ee), b && b.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), y && f.__s == null && (f.__s = f.state), y && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = F({}, f.__s)), F(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) y && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), y && f.componentDidMount != null && f.__h.push(f.componentDidMount);
else {
if (y && D.getDerivedStateFromProps == null && v !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(v, S), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(v, f.__s, S)) {
t.__v != n.__v && (f.props = v, f.state = f.__s, f.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {
e && (e.__ = t);
- }), ne.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = I(n);
- }), F.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = R(n);
++ }), P.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = L(n);
break n;
}
f.componentWillUpdate != null && f.componentWillUpdate(v, f.__s, S), y && f.componentDidUpdate != null && f.__h.push(function() {
f.componentDidUpdate(m, h, g);
});
}
- if (f.context = S, f.props = v, f.__P = e, f.__e = !1, C = x.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), ne.push.apply(f.__h, f._sb), f._sb = [];
- if (f.context = S, f.props = v, f.__P = e, f.__e = !1, C = b.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), F.push.apply(f.__h, f._sb), f._sb = [];
++ if (f.context = S, f.props = v, f.__P = e, f.__e = !1, C = x.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), P.push.apply(f.__h, f._sb), f._sb = [];
else do
f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;
while (f.__d && ++w < 25);
- f.state = f.__s, f.getChildContext != null && (r = P(P({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === F && u.key == null ? Ce(u.props.children) : u, s = pe(e, ie(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), _ && (f.__E = f.__ = null);
- f.state = f.__s, f.getChildContext != null && (r = I(I({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === L && u.key == null ? be(u.props.children) : u, s = ue(e, te(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), _ && (f.__E = f.__ = null);
++ f.state = f.__s, f.getChildContext != null && (r = F(F({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === I && u.key == null ? Se(u.props.children) : u, s = fe(e, re(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), _ && (f.__E = f.__ = null);
} catch (e) {
if (o.length = d, t.__v = null, c || a != null) {
if (e.then) {
for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;
a != null && (a[a.indexOf(s)] = null), t.__e = s;
- } else if (a != null) for (E = a.length; E--;) ae(a[E]);
- } else if (a != null) for (E = a.length; E--;) ne(a[E]);
++ } else if (a != null) for (E = a.length; E--;) ie(a[E]);
} else t.__e = n.__e;
- t.__k ??= n.__k || [], e.then || xe(t), x.__e(e, t, n);
- t.__k ??= n.__k || [], e.then || ve(t), b.__e(e, t, n);
++ t.__k ??= n.__k || [], e.then || be(t), x.__e(e, t, n);
}
- } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = we(n.__e, t, n, r, i, a, o, c, l);
- } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = xe(n.__e, t, n, r, i, a, o, c, l);
- return (u = b.diffed) && u(t), 128 & t.__u ? void 0 : s;
++ } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = Ce(n.__e, t, n, r, i, a, o, c, l);
+ return (u = x.diffed) && u(t), 128 & t.__u ? void 0 : s;
}
- function xe(e) {
- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(xe));
-function ve(e) {
- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(ve));
++function be(e) {
++ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(be));
}
- function Se(e, t, n) {
- for (var r = 0; r < n.length; r++) Te(n[r], n[++r], n[++r]);
-function ye(e, t, n) {
- for (var r = 0; r < n.length; r++) Se(n[r], n[++r], n[++r]);
- b.__c && b.__c(t, e), e.some(function(t) {
++function xe(e, t, n) {
++ for (var r = 0; r < n.length; r++) we(n[r], n[++r], n[++r]);
+ x.__c && x.__c(t, e), e.some(function(t) {
try {
e = t.__h, t.__h = [], e.some(function(e) {
e.call(t);
@@@ -178,11 -178,11 +178,11 @@@
}
});
}
- function Ce(e) {
- return typeof e != "object" || !e || e.__b > 0 ? e : ie(e) ? e.map(Ce) : e.constructor === void 0 ? P({}, e) : null;
-function be(e) {
- return typeof e != "object" || !e || e.__b > 0 ? e : te(e) ? e.map(be) : e.constructor === void 0 ? I({}, e) : null;
++function Se(e) {
++ return typeof e != "object" || !e || e.__b > 0 ? e : re(e) ? e.map(Se) : e.constructor === void 0 ? F({}, e) : null;
}
- function we(e, t, n, r, i, a, o, s, c) {
- var l, u, d, f, p, m, h, g = n.props || te, _ = t.props, v = t.type;
-function xe(e, t, n, r, i, a, o, s, c) {
- var l, u, d, f, p, m, h, g = n.props || P, _ = t.props, v = t.type;
++function Ce(e, t, n, r, i, a, o, s, c) {
++ var l, u, d, f, p, m, h, g = n.props || N, _ = t.props, v = t.type;
if (v == "svg" ? i = "http://www.w3.org/2000/svg" : v == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {
for (l = 0; l < a.length; l++) if ((p = a[l]) && "setAttribute" in p == !!v && (v ? p.localName == v : p.nodeType == 3)) {
e = p, a[l] = null;
@@@ -195,28 -195,28 +195,28 @@@
}
if (v == null) g === _ || s && e.data == _ || (e.data = _);
else {
- if (a = v == "textarea" && _.defaultValue != null ? null : a && y.call(e.childNodes), !s && a != null) for (g = {}, l = 0; l < e.attributes.length; l++) g[(p = e.attributes[l]).name] = p.value;
- for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || he(e, l, null, p, i);
- for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || he(e, l, p, g[l], i);
+ if (a = v == "textarea" && _.defaultValue != null ? null : a && b.call(e.childNodes), !s && a != null) for (g = {}, l = 0; l < e.attributes.length; l++) g[(p = e.attributes[l]).name] = p.value;
- for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || ve(e, l, null, p, i);
- for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || ve(e, l, p, g[l], i);
++ for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || _e(e, l, null, p, i);
++ for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || _e(e, l, p, g[l], i);
if (u) s || d && (u.__html == d.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];
- else if (d && (e.innerHTML = ""), pe(t.type == "template" ? e.content : e, ie(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && I(n, 0), s, c), a != null) for (l = a.length; l--;) ae(a[l]);
- s && v != "textarea" || (l = "value", v == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || v == "progress" && !m || v == "option" && m != g[l]) && ve(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && ve(e, l, h, g[l], i));
- else if (d && (e.innerHTML = ""), ue(t.type == "template" ? e.content : e, te(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && R(n, 0), s, c), a != null) for (l = a.length; l--;) ne(a[l]);
- s && v != "textarea" || (l = "value", v == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || v == "progress" && !m || v == "option" && m != g[l]) && he(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && he(e, l, h, g[l], i));
++ else if (d && (e.innerHTML = ""), fe(t.type == "template" ? e.content : e, re(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && L(n, 0), s, c), a != null) for (l = a.length; l--;) ie(a[l]);
++ s && v != "textarea" || (l = "value", v == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || v == "progress" && !m || v == "option" && m != g[l]) && _e(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && _e(e, l, h, g[l], i));
}
return e;
}
- function Te(e, t, n) {
-function Se(e, t, n) {
++function we(e, t, n) {
try {
if (typeof e == "function") {
var r = typeof e.__u == "function";
r && e.__u(), r && t == null || (e.__u = e(t));
} else e.current = t;
} catch (e) {
- b.__e(e, n);
+ x.__e(e, n);
}
}
- function Ee(e, t, n) {
-function Ce(e, t, n) {
++function Te(e, t, n) {
var r, i;
- if (x.unmount && x.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || Te(r, null, t)), (r = e.__c) != null) {
- if (b.unmount && b.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || Se(r, null, t)), (r = e.__c) != null) {
++ if (x.unmount && x.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || we(r, null, t)), (r = e.__c) != null) {
if (r.componentWillUnmount) try {
r.componentWillUnmount();
} catch (e) {
@@@ -224,47 -224,47 +224,47 @@@
}
r.base = r.__P = r.__n = null;
}
- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Ee(r[i], t, n || typeof e.type != "function");
- n || ae(e.__e), e.__c = e.__ = e.__e = void 0;
- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Ce(r[i], t, n || typeof e.type != "function");
- n || ne(e.__e), e.__c = e.__ = e.__e = void 0;
++ if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Te(r[i], t, n || typeof e.type != "function");
++ n || ie(e.__e), e.__c = e.__ = e.__e = void 0;
}
- function De(e, t, n) {
-function we(e, t, n) {
++function Ee(e, t, n) {
return this.constructor(e, n);
}
- function Oe(e, t, n) {
-function Te(e, t, n) {
++function De(e, t, n) {
var r, i, a, o;
- t == document && (t = document.documentElement), x.__ && x.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], be(t, e = (!r && n || t).__k = oe(F, null, [e]), i || te, te, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? b.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), Se(a, e, o), e.props.children = null;
- t == document && (t = document.documentElement), b.__ && b.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], _e(t, e = (!r && n || t).__k = re(L, null, [e]), i || P, P, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? y.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), ye(a, e, o), e.props.children = null;
++ t == document && (t = document.documentElement), x.__ && x.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ye(t, e = (!r && n || t).__k = ae(I, null, [e]), i || N, N, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? b.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), xe(a, e, o), e.props.children = null;
}
- b = ne.slice, x = { __e: function(e, t, n, r) {
-y = F.slice, b = { __e: function(e, t, n, r) {
++b = P.slice, x = { __e: function(e, t, n, r) {
for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {
if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(e)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, r || {}), o = i.__d), o) return i.__E = i;
} catch (t) {
e = t;
}
throw e;
-} }, x = 0, S = function(e) {
+} }, S = 0, C = function(e) {
return e != null && e.constructor === void 0;
- }, ce.prototype.setState = function(e, t) {
- var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = P({}, this.state);
- typeof e == "function" && (e = e(P({}, n), this.props)), e && P(n, e), e != null && this.__v && (t && this._sb.push(t), de(this));
- }, ce.prototype.forceUpdate = function(e) {
- this.__v && (this.__e = !0, e && this.__h.push(e), de(this));
- }, ce.prototype.render = F, w = [], E = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, D = function(e, t) {
-}, ae.prototype.setState = function(e, t) {
- var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = I({}, this.state);
- typeof e == "function" && (e = e(I({}, n), this.props)), e && I(n, e), e != null && this.__v && (t && this._sb.push(t), ce(this));
-}, ae.prototype.forceUpdate = function(e) {
- this.__v && (this.__e = !0, e && this.__h.push(e), ce(this));
-}, ae.prototype.render = L, C = [], T = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, E = function(e, t) {
++}, se.prototype.setState = function(e, t) {
++ var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = F({}, this.state);
++ typeof e == "function" && (e = e(F({}, n), this.props)), e && F(n, e), e != null && this.__v && (t && this._sb.push(t), ue(this));
++}, se.prototype.forceUpdate = function(e) {
++ this.__v && (this.__e = !0, e && this.__h.push(e), ue(this));
++}, se.prototype.render = I, w = [], E = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, D = function(e, t) {
return e.__v.__b - t.__v.__b;
- }, fe.__r = 0, O = Math.random().toString(8), k = "__d" + O, A = "__a" + O, j = /(PointerCapture)$|Capture$/i, M = 0, N = ye(!1), ee = ye(!0);
-}, le.__r = 0, D = Math.random().toString(8), O = "__d" + D, k = "__a" + D, A = /(PointerCapture)$|Capture$/i, j = 0, M = ge(!1), N = ge(!0);
++}, de.__r = 0, O = Math.random().toString(8), k = "__d" + O, A = "__a" + O, ee = /(PointerCapture)$|Capture$/i, te = 0, j = ve(!1), M = ve(!0);
//#endregion
//#region src/sort-preferences.ts
- function ke(e, t, n) {
-function Ee(e, t, n) {
++function Oe(e, t, n) {
return e === "seed" ? "" : e === t && n === "asc" ? "asc" : "desc";
}
//#endregion
//#region src/api.ts
- var Ae = class extends Error {
-var De = class extends Error {
++var ke = class extends Error {
status;
body;
constructor(e, t, n = null) {
super(e), this.name = "ApiError", this.status = t, this.body = n;
}
- }, je = (e) => {
-}, Oe = (e) => {
++}, Ae = (e) => {
if (!e || typeof e != "object") return "";
let t = e;
for (let e of [
@@@ -276,8 -276,8 +276,8 @@@
if (typeof n == "string" && n) return n;
}
return "";
- }, L = (e) => e instanceof Error ? e.message : String(e);
- async function R(e, t) {
-}, z = (e) => e instanceof Error ? e.message : String(e);
-async function B(e, t) {
++}, R = (e) => e instanceof Error ? e.message : String(e);
++async function z(e, t) {
let n = await fetch(e, {
headers: { Accept: "application/json" },
credentials: "same-origin",
@@@ -286,10 -286,10 +286,10 @@@
try {
r = await n.json();
} catch {}
- if (!n.ok) throw new Ae(je(r) || `请求失败(${n.status})`, n.status);
- if (!n.ok) throw new De(Oe(r) || `请求失败(${n.status})`, n.status);
++ if (!n.ok) throw new ke(Ae(r) || `请求失败(${n.status})`, n.status);
return r;
}
- async function z(e, t, n = "POST", r) {
-async function V(e, t, n = "POST", r) {
++async function B(e, t, n = "POST", r) {
let i = await fetch(e, {
method: n,
...r ? { signal: r } : {},
@@@ -303,29 -303,29 +303,29 @@@
try {
a = await i.json();
} catch {}
- if (!i.ok) throw new Ae(je(a) || `请求失败(${i.status})`, i.status, a);
- if (!i.ok) throw new De(Oe(a) || `请求失败(${i.status})`, i.status, a);
++ if (!i.ok) throw new ke(Ae(a) || `请求失败(${i.status})`, i.status, a);
return a;
}
//#endregion
//#region node_modules/preact/hooks/dist/hooks.module.js
- var B, V, Me, Ne, Pe = 0, Fe = [], H = x, Ie = H.__b, Le = H.__r, Re = H.diffed, ze = H.__c, Be = H.unmount, Ve = H.__;
- function He(e, t) {
- H.__h && H.__h(V, e, Pe || t), Pe = 0;
- var n = V.__H || (V.__H = {
-var ke, H, Ae, je, Me = 0, Ne = [], U = b, Pe = U.__b, Fe = U.__r, Ie = U.diffed, Le = U.__c, Re = U.unmount, ze = U.__;
-function Be(e, t) {
- U.__h && U.__h(H, e, Me || t), Me = 0;
++var V, H, je, Me, Ne = 0, Pe = [], U = x, Fe = U.__b, Ie = U.__r, Le = U.diffed, Re = U.__c, ze = U.unmount, Be = U.__;
++function Ve(e, t) {
++ U.__h && U.__h(H, e, Ne || t), Ne = 0;
+ var n = H.__H || (H.__H = {
__: [],
__h: []
});
return e >= n.__.length && n.__.push({}), n.__[e];
}
- function U(e) {
- return Pe = 1, Ue(Ze, e);
+ function W(e) {
- return Me = 1, Ve(Ye, e);
++ return Ne = 1, He(Xe, e);
}
- function Ue(e, t, n) {
- var r = He(B++, 2);
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ze(void 0, t), function(e) {
-function Ve(e, t, n) {
- var r = Be(ke++, 2);
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ye(void 0, t), function(e) {
++function He(e, t, n) {
++ var r = Ve(V++, 2);
++ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Xe(void 0, t), function(e) {
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
- }], r.__c = V, !V.__f)) {
+ }], r.__c = H, !H.__f)) {
var i = function(e, t, n) {
if (!r.__c.__H) return !0;
var i = !1, o = r.__c.props !== e;
@@@ -353,100 -353,100 +353,100 @@@
}
return r.__N || r.__;
}
- function W(e, t) {
- var n = He(B++, 3);
- !H.__s && Xe(n.__H, t) && (n.__ = e, n.u = t, V.__H.__h.push(n));
- }
function G(e, t) {
- var n = He(B++, 4);
- !H.__s && Xe(n.__H, t) && (n.__ = e, n.u = t, V.__h.push(n));
- var n = Be(ke++, 3);
- !U.__s && Je(n.__H, t) && (n.__ = e, n.u = t, H.__H.__h.push(n));
++ var n = Ve(V++, 3);
++ !U.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, H.__H.__h.push(n));
+ }
+ function K(e, t) {
- var n = Be(ke++, 4);
- !U.__s && Je(n.__H, t) && (n.__ = e, n.u = t, H.__h.push(n));
++ var n = Ve(V++, 4);
++ !U.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, H.__h.push(n));
}
- function K(e) {
- return Pe = 5, We(function() {
+ function q(e) {
- return Me = 5, He(function() {
++ return Ne = 5, Ue(function() {
return { current: e };
}, []);
}
- function We(e, t) {
- var n = He(B++, 7);
- return Xe(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
-function He(e, t) {
- var n = Be(ke++, 7);
- return Je(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
++function Ue(e, t) {
++ var n = Ve(V++, 7);
++ return Ye(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
}
- function Ge() {
- for (var e; e = Fe.shift();) {
-function Ue() {
- for (var e; e = Ne.shift();) {
++function We() {
++ for (var e; e = Pe.shift();) {
var t = e.__H;
if (e.__P && t) try {
- t.__h.some(Je), t.__h.some(Ye), t.__h = [];
- t.__h.some(Ke), t.__h.some(qe), t.__h = [];
++ t.__h.some(qe), t.__h.some(Je), t.__h = [];
} catch (n) {
- t.__h = [], H.__e(n, e.__v);
+ t.__h = [], U.__e(n, e.__v);
}
}
}
- H.__b = function(e) {
- V = null, Ie && Ie(e);
- }, H.__ = function(e, t) {
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ve && Ve(e, t);
- }, H.__r = function(e) {
- Le && Le(e), B = 0;
- var t = (V = e.__c).__H;
- t && (Me === V ? (t.__h = [], V.__h = [], t.__.some(function(e) {
+ U.__b = function(e) {
- H = null, Pe && Pe(e);
++ H = null, Fe && Fe(e);
+ }, U.__ = function(e, t) {
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), ze && ze(e, t);
++ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Be && Be(e, t);
+ }, U.__r = function(e) {
- Fe && Fe(e), ke = 0;
++ Ie && Ie(e), V = 0;
+ var t = (H = e.__c).__H;
- t && (Ae === H ? (t.__h = [], H.__h = [], t.__.some(function(e) {
++ t && (je === H ? (t.__h = [], H.__h = [], t.__.some(function(e) {
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
- })) : (t.__h.some(Je), t.__h.some(Ye), t.__h = [], B = 0)), Me = V;
- }, H.diffed = function(e) {
- Re && Re(e);
- })) : (t.__h.some(Ke), t.__h.some(qe), t.__h = [], ke = 0)), Ae = H;
++ })) : (t.__h.some(qe), t.__h.some(Je), t.__h = [], V = 0)), je = H;
+ }, U.diffed = function(e) {
- Ie && Ie(e);
++ Le && Le(e);
var t = e.__c;
- t && t.__H && (t.__H.__h.length && (Fe.push(t) !== 1 && Ne === H.requestAnimationFrame || ((Ne = H.requestAnimationFrame) || qe)(Ge)), t.__H.__.some(function(e) {
- t && t.__H && (t.__H.__h.length && (Ne.push(t) !== 1 && je === U.requestAnimationFrame || ((je = U.requestAnimationFrame) || Ge)(Ue)), t.__H.__.some(function(e) {
++ t && t.__H && (t.__H.__h.length && (Pe.push(t) !== 1 && Me === U.requestAnimationFrame || ((Me = U.requestAnimationFrame) || Ke)(We)), t.__H.__.some(function(e) {
e.u &&= (e.__H = e.u, void 0);
- })), Me = V = null;
- }, H.__c = function(e, t) {
- })), Ae = H = null;
++ })), je = H = null;
+ }, U.__c = function(e, t) {
t.some(function(e) {
try {
- e.__h.some(Je), e.__h = e.__h.filter(function(e) {
- return !e.__ || Ye(e);
- e.__h.some(Ke), e.__h = e.__h.filter(function(e) {
- return !e.__ || qe(e);
++ e.__h.some(qe), e.__h = e.__h.filter(function(e) {
++ return !e.__ || Je(e);
});
} catch (n) {
t.some(function(e) {
e.__h &&= [];
- }), t = [], H.__e(n, e.__v);
+ }), t = [], U.__e(n, e.__v);
}
- }), ze && ze(e, t);
- }, H.unmount = function(e) {
- Be && Be(e);
- }), Le && Le(e, t);
++ }), Re && Re(e, t);
+ }, U.unmount = function(e) {
- Re && Re(e);
++ ze && ze(e);
var t, n = e.__c;
n && n.__H && (n.__H.__.some(function(e) {
try {
- Je(e);
- Ke(e);
++ qe(e);
} catch (e) {
t = e;
}
- }), n.__H = void 0, t && H.__e(t, n.__v));
+ }), n.__H = void 0, t && U.__e(t, n.__v));
};
- var Ke = typeof requestAnimationFrame == "function";
- function qe(e) {
-var We = typeof requestAnimationFrame == "function";
-function Ge(e) {
++var Ge = typeof requestAnimationFrame == "function";
++function Ke(e) {
var t, n = function() {
- clearTimeout(r), Ke && cancelAnimationFrame(t), setTimeout(e);
- clearTimeout(r), We && cancelAnimationFrame(t), setTimeout(e);
++ clearTimeout(r), Ge && cancelAnimationFrame(t), setTimeout(e);
}, r = setTimeout(n, 35);
- Ke && (t = requestAnimationFrame(n));
- We && (t = requestAnimationFrame(n));
++ Ge && (t = requestAnimationFrame(n));
}
- function Je(e) {
- var t = V, n = e.__c;
- typeof n == "function" && (e.__c = void 0, n()), V = t;
-function Ke(e) {
++function qe(e) {
+ var t = H, n = e.__c;
+ typeof n == "function" && (e.__c = void 0, n()), H = t;
}
- function Ye(e) {
- var t = V;
- e.__c = e.__(), V = t;
-function qe(e) {
++function Je(e) {
+ var t = H;
+ e.__c = e.__(), H = t;
}
- function Xe(e, t) {
-function Je(e, t) {
++function Ye(e, t) {
return !e || e.length !== t.length || t.some(function(t, n) {
return t !== e[n];
});
}
- function Ze(e, t) {
-function Ye(e, t) {
++function Xe(e, t) {
return typeof t == "function" ? t(e) : t;
}
//#endregion
//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
- var Qe = 0;
-var Xe = 0;
++var Ze = 0;
Array.isArray;
- function q(e, t, n, r, i, a) {
+ function J(e, t, n, r, i, a) {
t ||= {};
var o, s, c = t;
if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];
@@@ -461,7 -461,7 +461,7 @@@
__e: null,
__c: null,
constructor: void 0,
- __v: --Qe,
- __v: --Xe,
++ __v: --Ze,
__i: -1,
__u: 0,
__source: i,
@@@ -472,11 -472,11 +472,11 @@@
}
//#endregion
//#region src/islands/access-settings.tsx
- function $e({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {
- return /* @__PURE__ */ q("div", {
-function Ze({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {
++function Qe({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {
+ return /* @__PURE__ */ J("div", {
class: "configfield",
children: [
- /* @__PURE__ */ q("label", {
+ /* @__PURE__ */ J("label", {
for: e,
children: t
}),
@@@ -502,9 -502,9 +502,9 @@@
]
});
}
- function et({ initial: e, receipt: t }) {
- let [n, r] = U(e), [i, o] = U(""), [c, l] = U(""), [u, f] = U(""), [p, m] = U(!1), [h, g] = U(""), [_, v] = U({}), y = K(null), b = K(!1), x = K(null);
- return /* @__PURE__ */ q("form", {
-function Qe({ initial: e, receipt: t }) {
++function $e({ initial: e, receipt: t }) {
+ let [n, r] = W(e), [i, o] = W(""), [c, l] = W(""), [u, f] = W(""), [p, m] = W(!1), [h, g] = W(""), [_, v] = W({}), y = q(null), b = q(!1), x = q(null);
+ return /* @__PURE__ */ J("form", {
class: "configfieldset",
"data-fieldset-type": p ? "warning" : void 0,
onSubmit: async (e) => {
@@@ -517,7 -517,7 +517,7 @@@
}
b.current = !0, d(x.current, !0);
try {
- let e = await z("/api/configuration/access", {
- let e = await V("/api/configuration/access", {
++ let e = await B("/api/configuration/access", {
revision: n.revision,
action: p ? "disable" : "set",
confirm_disable: p,
@@@ -527,8 -527,8 +527,8 @@@
});
r(e), o(""), l(""), f(""), m(!1), v({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");
} catch (e) {
- let t = e instanceof Ae ? e.body : null, n = t?.errors || t?.detail?.errors;
- n ? v(n) : g(L(e));
- let t = e instanceof De ? e.body : null, n = t?.errors || t?.detail?.errors;
- n ? v(n) : g(z(e));
++ let t = e instanceof ke ? e.body : null, n = t?.errors || t?.detail?.errors;
++ n ? v(n) : g(R(e));
} finally {
b.current = !1, d(x.current, !1);
}
@@@ -554,16 -554,16 +554,16 @@@
type: "checkbox",
checked: p,
onChange: (e) => m(e.currentTarget.checked)
- }), /* @__PURE__ */ q("span", {
+ }), /* @__PURE__ */ J("span", {
"aria-hidden": "true",
- children: /* @__PURE__ */ q("svg", {
+ children: /* @__PURE__ */ J("svg", {
viewBox: "0 0 24 24",
- children: /* @__PURE__ */ q("use", { href: "#i-check" })
+ children: /* @__PURE__ */ J("use", { href: "#i-check" })
})
})]
- }), /* @__PURE__ */ q("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]
+ }), /* @__PURE__ */ J("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]
}) : null,
- n.mode === "password" ? /* @__PURE__ */ q($e, {
- n.mode === "password" ? /* @__PURE__ */ J(Ze, {
++ n.mode === "password" ? /* @__PURE__ */ J(Qe, {
id: "access-current",
label: "当前访问密码",
value: i,
@@@ -571,7 -571,7 +571,7 @@@
error: _.current_password,
current: !0
}) : null,
- n.mode === "locked" ? null : /* @__PURE__ */ q(F, { children: [/* @__PURE__ */ q($e, {
- n.mode === "locked" ? null : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J(Ze, {
++ n.mode === "locked" ? null : /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J(Qe, {
id: "access-password",
label: n.mode === "password" ? "新访问密码" : "设置访问密码",
value: c,
@@@ -579,7 -579,7 +579,7 @@@
disabled: p,
error: p ? void 0 : _.password,
help: p ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"
- }), /* @__PURE__ */ q($e, {
- }), /* @__PURE__ */ J(Ze, {
++ }), /* @__PURE__ */ J(Qe, {
id: "access-confirm",
label: "确认访问密码",
value: u,
@@@ -610,7 -610,7 +610,7 @@@
}
//#endregion
//#region src/islands/release-updates.tsx
- var tt = /* @__PURE__ */ new Set([
-var $e = /* @__PURE__ */ new Set([
++var et = /* @__PURE__ */ new Set([
"downloading",
"verifying",
"extracting",
@@@ -618,21 -618,21 +618,21 @@@
"restarting",
"installing"
]);
- function nt({ initial: e, initialJob: t }) {
- let [n, i] = U(e), [o, s] = U(t || {
-function et({ initial: e, initialJob: t }) {
++function tt({ initial: e, initialJob: t }) {
+ let [n, i] = W(e), [o, s] = W(t || {
state: "idle",
progress: 0
- }), [l, u] = U(""), f = K(null), p = K(!0), m = K(!1), h = K(null);
- W(() => {
- d(h.current, tt.has(o.state));
- }, [o.state]), W(() => () => {
+ }), [l, u] = W(""), f = q(null), p = q(!0), m = q(!1), h = q(null);
+ G(() => {
- d(h.current, $e.has(o.state));
++ d(h.current, et.has(o.state));
+ }, [o.state]), G(() => () => {
p.current = !1, f.current?.abort();
}, []);
let g = async () => {
- let e = await z("/api/configuration/update-restart", {});
- let e = await V("/api/configuration/update-restart", {});
++ let e = await B("/api/configuration/update-restart", {});
p.current && s(e);
};
- W(() => {
+ G(() => {
o.state !== "ready" || m.current || (m.current = !0, r({
title: "更新已准备好",
body: `Peach ${o.version || ""} 将在重启后安装。`,
@@@ -640,11 -640,11 +640,11 @@@
cancelLabel: "稍后",
onConfirm: g
}));
- }, [o.state]), W(() => {
- if (!tt.has(o.state)) return;
+ }, [o.state]), G(() => {
- if (!$e.has(o.state)) return;
++ if (!et.has(o.state)) return;
let e = new AbortController(), t, n = 0, r = async () => {
try {
- let t = await R("/api/configuration/update-status", e.signal);
- let t = await B("/api/configuration/update-status", e.signal);
++ let t = await z("/api/configuration/update-status", e.signal);
e.signal.aborted || (s(t), n = 0, t.state === "complete" && i((e) => ({
...e,
current_version: t.version || e.current_version,
@@@ -661,14 -661,14 +661,14 @@@
};
}, [o.state]);
let _ = async (e) => {
- if (f.current || tt.has(o.state)) return;
- if (f.current || $e.has(o.state)) return;
++ if (f.current || et.has(o.state)) return;
let t = new AbortController();
f.current = t, m.current = !1, u(""), d(e, !0);
try {
- let e = await z("/api/configuration/update", {}, "POST", t.signal);
- let e = await V("/api/configuration/update", {}, "POST", t.signal);
++ let e = await B("/api/configuration/update", {}, "POST", t.signal);
t.signal.aborted || s(e);
} catch (e) {
- t.signal.aborted || u(L(e));
- t.signal.aborted || u(z(e));
++ t.signal.aborted || u(R(e));
} finally {
f.current = null, d(e, !1);
}
@@@ -677,13 -677,13 +677,13 @@@
let n = new AbortController();
f.current = n, d(t, !0), u("");
try {
- let e = await R("/api/configuration/updates", n.signal);
- let e = await B("/api/configuration/updates", n.signal);
++ let e = await z("/api/configuration/updates", n.signal);
n.signal.aborted || i(e);
} catch (t) {
n.signal.aborted || (i({
...e,
state: "error"
- }), u(L(t)));
- }), u(z(t)));
++ }), u(R(t)));
} finally {
f.current = null, d(t, !1);
}
@@@ -714,12 -714,12 +714,12 @@@
role: l || n.state === "error" ? "alert" : "status",
children: l || n.message
}),
- o.state === "idle" ? null : /* @__PURE__ */ q("div", {
+ o.state === "idle" ? null : /* @__PURE__ */ J("div", {
"aria-live": "polite",
- children: [/* @__PURE__ */ q("p", {
+ children: [/* @__PURE__ */ J("p", {
class: o.state === "error" ? "configbad" : "confighelp",
children: o.message
- }), o.state === "error" ? null : /* @__PURE__ */ q(F, { children: [/* @__PURE__ */ q("div", { dangerouslySetInnerHTML: { __html: c(o.state === "downloading" ? "下载进度" : "安装进度", o.state === "downloading" ? o.downloaded || 0 : o.progress, o.state === "downloading" ? o.total || 1 : 100) } }), /* @__PURE__ */ q("p", {
- }), o.state === "error" ? null : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: c(o.state === "downloading" ? "下载进度" : "安装进度", o.state === "downloading" ? o.downloaded || 0 : o.progress, o.state === "downloading" ? o.total || 1 : 100) } }), /* @__PURE__ */ J("p", {
++ }), o.state === "error" ? null : /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: c(o.state === "downloading" ? "下载进度" : "安装进度", o.state === "downloading" ? o.downloaded || 0 : o.progress, o.state === "downloading" ? o.total || 1 : 100) } }), /* @__PURE__ */ J("p", {
class: "confighelp",
children: o.state === "downloading" && o.total ? `${((o.downloaded || 0) / 1048576).toFixed(1)} / ${(o.total / 1048576).toFixed(1)} MB` : `${o.progress}%`
})] })]
@@@ -734,13 -734,9 +734,13 @@@
href: n.release_url,
target: "_blank",
rel: "noreferrer",
- children: ["查看发布页", /* @__PURE__ */ q("svg", {
- children: "查看发布页"
++ children: ["查看发布页", /* @__PURE__ */ J("svg", {
+ "aria-hidden": "true",
+ viewBox: "0 0 24 24",
- children: /* @__PURE__ */ q("use", { href: "#i-external-link" })
++ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })
+ })]
}),
- o.state === "ready" ? /* @__PURE__ */ q("button", {
+ o.state === "ready" ? /* @__PURE__ */ J("button", {
type: "button",
class: "geist-button primary",
onClick: () => {
@@@ -761,10 -757,10 +761,10 @@@
onClick: (e) => _(e.currentTarget),
children: "下载并安装"
}) : null,
- /* @__PURE__ */ q("button", {
+ /* @__PURE__ */ J("button", {
type: "button",
class: "geist-button",
- disabled: tt.has(o.state),
- disabled: $e.has(o.state),
++ disabled: et.has(o.state),
onClick: (e) => v(e.currentTarget),
children: "检查更新"
})
@@@ -774,9 -770,9 +774,9 @@@
}
//#endregion
//#region src/islands/peach-proxy.tsx
- function rt({ initial: e, receipt: t }) {
- let [n, r] = U(e), [i, o] = U(e.mode), [s, c] = U(""), [u, f] = U(""), m = K(!1), h = K(null), g = K(null), _ = K(new AbortController());
- W(() => () => _.current.abort(), []), G(() => {
-function tt({ initial: e, receipt: t }) {
++function nt({ initial: e, receipt: t }) {
+ let [n, r] = W(e), [i, o] = W(e.mode), [s, c] = W(""), [u, f] = W(""), m = q(!1), h = q(null), g = q(null), _ = q(new AbortController());
+ G(() => () => _.current.abort(), []), K(() => {
let t = h.current;
t.innerHTML = l([
["environment", "系统代理"],
@@@ -796,13 -792,13 +796,13 @@@
if (!m.current) {
m.current = !0, d(g.current, !0), f("");
try {
- let e = await z("/api/configuration/peach-proxy", {
- let e = await V("/api/configuration/peach-proxy", {
++ let e = await B("/api/configuration/peach-proxy", {
mode: i,
proxy: s
}, "POST", _.current.signal);
_.current.signal.aborted || (r(e), c(""), t("已保存 Peach 代理"));
} catch (e) {
- _.current.signal.aborted || f(L(e));
- _.current.signal.aborted || f(z(e));
++ _.current.signal.aborted || f(R(e));
} finally {
m.current = !1, d(g.current, !1);
}
@@@ -865,30 -861,30 +865,30 @@@
}
//#endregion
//#region src/islands/desktop-settings.tsx
- function it({ label: e, checked: t, disabled: n, change: r }) {
- return /* @__PURE__ */ q("label", {
-function nt({ label: e, checked: t, disabled: n, change: r }) {
++function rt({ label: e, checked: t, disabled: n, change: r }) {
+ return /* @__PURE__ */ J("label", {
class: "configcheck",
- children: [/* @__PURE__ */ q("span", {
+ children: [/* @__PURE__ */ J("span", {
class: "pcheck",
- children: [/* @__PURE__ */ q("input", {
+ children: [/* @__PURE__ */ J("input", {
type: "checkbox",
checked: t,
disabled: n,
onChange: (e) => r(e.currentTarget.checked)
- }), /* @__PURE__ */ q("span", {
+ }), /* @__PURE__ */ J("span", {
"aria-hidden": "true",
- children: /* @__PURE__ */ q("svg", {
+ children: /* @__PURE__ */ J("svg", {
viewBox: "0 0 24 24",
- children: /* @__PURE__ */ q("use", { href: "#i-check" })
+ children: /* @__PURE__ */ J("use", { href: "#i-check" })
})
})]
- }), /* @__PURE__ */ q("span", { children: e })]
+ }), /* @__PURE__ */ J("span", { children: e })]
});
}
- function at({ label: e, checked: t, disabled: n, change: r }) {
- return /* @__PURE__ */ q("label", {
-function rt({ label: e, checked: t, disabled: n, change: r }) {
++function it({ label: e, checked: t, disabled: n, change: r }) {
+ return /* @__PURE__ */ J("label", {
class: "configtoggle",
- children: [/* @__PURE__ */ q("span", { children: e }), /* @__PURE__ */ q("input", {
+ children: [/* @__PURE__ */ J("span", { children: e }), /* @__PURE__ */ J("input", {
class: "ptoggle",
type: "checkbox",
role: "switch",
@@@ -898,18 -894,18 +898,18 @@@
})]
});
}
- function ot({ startup: e, receipt: t }) {
- let [n, r] = U(e.enabled), [i, o] = U(e.silent), [s, c] = U(""), l = K(!1), u = K(null);
-function it({ startup: e, receipt: t }) {
++function at({ startup: e, receipt: t }) {
+ let [n, r] = W(e.enabled), [i, o] = W(e.silent), [s, c] = W(""), l = q(!1), u = q(null);
async function f() {
if (!l.current) {
l.current = !0, d(u.current, !0), c("");
try {
- await z("/api/configuration/startup", {
- await V("/api/configuration/startup", {
++ await B("/api/configuration/startup", {
enabled: n,
silent: i
}), t("已保存开机自启");
} catch (e) {
- c(L(e));
- c(z(e));
++ c(R(e));
} finally {
l.current = !1, d(u.current, !1);
}
@@@ -929,14 -925,14 +929,14 @@@
class: "configoptions",
role: "group",
"aria-labelledby": "startupTitle",
- children: [/* @__PURE__ */ q(at, {
- children: [/* @__PURE__ */ J(rt, {
++ children: [/* @__PURE__ */ J(it, {
label: "开机后启动 Peach",
checked: n,
disabled: !e.available,
change: r
- }), /* @__PURE__ */ q("div", {
+ }), /* @__PURE__ */ J("div", {
class: "configoption",
- children: [/* @__PURE__ */ q(at, {
- children: [/* @__PURE__ */ J(rt, {
++ children: [/* @__PURE__ */ J(it, {
label: "静默启动",
checked: i,
disabled: !e.available,
@@@ -970,9 -966,9 +970,9 @@@
})]
});
}
- function st({ data: e }) {
- let t = K(null);
- return G(() => {
-function at({ data: e }) {
++function ot({ data: e }) {
+ let t = q(null);
+ return K(() => {
let n = t.current, r = document.createElement("details");
r.className = "configdirectories";
let i = document.createElement("summary");
@@@ -982,10 -978,10 +982,10 @@@
e.className = "confighelp", e.textContent = t, r.append(e);
}
return n.replaceChildren(r), f(n, "details", "uninstall-data"), () => n.replaceChildren();
- }, [e]), /* @__PURE__ */ q("div", { ref: t });
+ }, [e]), /* @__PURE__ */ J("div", { ref: t });
}
- function ct({ uninstall: e }) {
- let [t, n] = U(!1), [i, o] = U("");
-function ot({ uninstall: e }) {
++function st({ uninstall: e }) {
+ let [t, n] = W(!1), [i, o] = W("");
async function s() {
await r({
title: "卸载 Peach",
@@@ -993,7 -989,7 +993,7 @@@
body: t ? "将退出 Peach,移除程序、开机自启、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序和开机自启。设置、本地数据库、观看记录与缓存保留。",
confirmLabel: "卸载 Peach",
onConfirm: async () => {
- let e = await z("/api/configuration/uninstall", {
- let e = await V("/api/configuration/uninstall", {
++ let e = await B("/api/configuration/uninstall", {
delete_data: t,
confirmation: "卸载 Peach"
});
@@@ -1016,14 -1012,14 +1016,14 @@@
children: "卸载会退出 Peach、移除程序和开机自启。原始媒体文件保留。"
})]
}),
- /* @__PURE__ */ q(it, {
- /* @__PURE__ */ J(nt, {
++ /* @__PURE__ */ J(rt, {
label: "完全卸载:同时删除设置、本地数据库、观看记录、凭据和缓存",
checked: t,
disabled: !e.full_available || !!i,
change: n
}),
- /* @__PURE__ */ q(st, { data: e }),
- e.message && /* @__PURE__ */ q("p", {
- /* @__PURE__ */ J(at, { data: e }),
++ /* @__PURE__ */ J(ot, { data: e }),
+ e.message && /* @__PURE__ */ J("p", {
class: "confighelp",
children: e.message
}),
@@@ -1048,22 -1044,22 +1048,22 @@@
}
//#endregion
//#region src/islands/configuration.tsx
- var lt = "/api/configuration", ut = "/api/pick-folder", dt = 8e3, ft = (e, t) => R(lt, t), pt = ({ html: e, class: t }) => /* @__PURE__ */ q("div", {
-var st = "/api/configuration", ct = "/api/pick-folder", lt = 8e3, ut = (e, t) => B(st, t), Y = ({ html: e, class: t }) => /* @__PURE__ */ J("div", {
++var ct = "/api/configuration", lt = "/api/pick-folder", ut = 8e3, dt = (e, t) => z(ct, t), ft = ({ html: e, class: t }) => /* @__PURE__ */ J("div", {
class: t,
dangerouslySetInnerHTML: { __html: e }
- }), mt = (e) => !(e instanceof Ae) || e.status !== 400 ? null : e.body?.errors ?? null;
- function ht({ facts: e }) {
- return /* @__PURE__ */ q("section", {
-}), dt = (e) => !(e instanceof De) || e.status !== 400 ? null : e.body?.errors ?? null;
-function ft({ facts: e }) {
++}), pt = (e) => !(e instanceof ke) || e.status !== 400 ? null : e.body?.errors ?? null;
++function mt({ facts: e }) {
+ return /* @__PURE__ */ J("section", {
class: "configfieldset",
"data-geist-fieldset": !0,
"aria-labelledby": "configFactsTitle",
- children: /* @__PURE__ */ q("div", {
+ children: /* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
- children: [/* @__PURE__ */ q(pt, { html: a("configFactsTitle", "运行信息") }), /* @__PURE__ */ q("dl", {
- children: [/* @__PURE__ */ J(Y, { html: a("configFactsTitle", "运行信息") }), /* @__PURE__ */ J("dl", {
++ children: [/* @__PURE__ */ J(ft, { html: a("configFactsTitle", "运行信息") }), /* @__PURE__ */ J("dl", {
class: "configfacts",
- children: e.map((e) => /* @__PURE__ */ q(F, { children: [/* @__PURE__ */ q("dt", { children: e.term }), /* @__PURE__ */ q("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ q("span", {
- children: e.map((e) => /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("dt", { children: e.term }), /* @__PURE__ */ J("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ J("span", {
++ children: e.map((e) => /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("dt", { children: e.term }), /* @__PURE__ */ J("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ J("span", {
class: "confighelp",
- children: [" ", /* @__PURE__ */ q("a", {
+ children: [" ", /* @__PURE__ */ J("a", {
href: e.download_url,
target: "_blank",
rel: "noreferrer",
@@@ -1078,32 -1074,32 +1078,32 @@@
})
});
}
- function gt({ data: t }) {
- let [n, r] = U(t.media_sources), [i, o] = U(""), s = K(null);
- W(() => () => s.current?.abort(), []);
-function pt({ data: t }) {
++function ht({ data: t }) {
+ let [n, r] = W(t.media_sources), [i, o] = W(""), s = q(null);
+ G(() => () => s.current?.abort(), []);
let c = async (e) => {
if (s.current) return;
let t = new AbortController();
s.current = t, d(e, !0), o("");
try {
- let e = await R(lt, t.signal);
- let e = await B(st, t.signal);
++ let e = await z(ct, t.signal);
t.signal.aborted || r(e.media_sources);
} catch (e) {
- t.signal.aborted || o(L(e));
- t.signal.aborted || o(z(e));
++ t.signal.aborted || o(R(e));
} finally {
s.current = null, d(e, !1);
}
};
- return n ? /* @__PURE__ */ q("section", {
+ return n ? /* @__PURE__ */ J("section", {
class: "configfieldset",
"aria-labelledby": "configMountsTitle",
- children: [/* @__PURE__ */ q("div", {
+ children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ q(pt, { html: a("configMountsTitle", "挂载状态") }),
- /* @__PURE__ */ q("dl", {
- /* @__PURE__ */ J(Y, { html: a("configMountsTitle", "挂载状态") }),
++ /* @__PURE__ */ J(ft, { html: a("configMountsTitle", "挂载状态") }),
+ /* @__PURE__ */ J("dl", {
class: "configfacts",
- children: n.map((t) => /* @__PURE__ */ q(F, { children: [/* @__PURE__ */ q("dt", { children: [/* @__PURE__ */ q("span", {
- children: n.map((t) => /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("dt", { children: [/* @__PURE__ */ J("span", {
++ children: n.map((t) => /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("dt", { children: [/* @__PURE__ */ J("span", {
"aria-hidden": "true",
dangerouslySetInnerHTML: { __html: u(e[t.location]) }
}), {
@@@ -1137,9 -1133,9 +1137,9 @@@
})]
}) : null;
}
- function _t({ value: t, label: n, onChange: r }) {
- let i = K(null), a = K(null), o = K(r);
- return o.current = r, G(() => {
-function mt({ value: t, label: n, onChange: r }) {
++function gt({ value: t, label: n, onChange: r }) {
+ let i = q(null), a = q(null), o = q(r);
+ return o.current = r, K(() => {
let r = i.current;
r.innerHTML = l([
["local", "本地磁盘"],
@@@ -1163,39 -1159,39 +1163,39 @@@
class: "configsourcecontrol"
});
}
- function vt({ data: e, receipt: t }) {
-function ht({ data: e, receipt: t }) {
++function _t({ data: e, receipt: t }) {
let n = e.media_sources?.filter((e) => [
"local",
"115",
"pikpak"
- ].includes(e.location)), [r, i] = U(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [o, c] = U(n?.map((e) => e.location) ?? []), [l, u] = U(n?.map((e) => e.root) ?? []), [f, p] = U(String(e.port)), [m, h] = U(!1), [g, _] = U([]), [v, y] = U(""), [b, x] = U(""), [S, C] = U(null), [w, T] = U(null), E = K(!1), D = K(e.revision), O = K([]), k = K(null);
- G(() => {
+ ].includes(e.location)), [r, i] = W(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [o, c] = W(n?.map((e) => e.location) ?? []), [l, u] = W(n?.map((e) => e.root) ?? []), [f, p] = W(String(e.port)), [m, h] = W(!1), [g, _] = W([]), [v, y] = W(""), [b, x] = W(""), [S, C] = W(null), [w, T] = W(null), E = q(!1), D = q(e.revision), O = q([]), k = q(null);
+ K(() => {
w !== null && (O.current[w]?.focus(), T(null));
- }, [w]), W(() => {
+ }, [w]), G(() => {
if (!S) return;
- let e = setTimeout(() => location.assign(S.url), dt);
- let e = setTimeout(() => location.assign(S.url), lt);
++ let e = setTimeout(() => location.assign(S.url), ut);
return () => clearTimeout(e);
}, [S]);
let A = (e, t) => {
i((n) => n.map((n, r) => r === e ? t : n));
-- }, j = () => {
++ }, ee = () => {
T(r.length), i((e) => [...e, ""]);
-- }, M = (e) => {
++ }, te = (e) => {
c((t) => t.filter((t, n) => n !== e)), u((t) => t.filter((t, n) => n !== e)), i((t) => t.filter((t, n) => n !== e)), _((t) => t.filter((t, n) => n !== e));
-- }, N = (e, t) => {
++ }, j = (e, t) => {
_((n) => {
let r = [...n];
for (; r.length <= e;) r.push("");
return r[e] = t, r;
});
- }, ee = async (e, t) => {
- }, P = async (e, t) => {
++ }, M = async (e, t) => {
if (t.getAttribute("aria-busy") !== "true") {
d(t, !0);
try {
- let { path: t } = await z(ut, { initial: r[e] ?? "" });
- let { path: t } = await V(ct, { initial: r[e] ?? "" });
-- t && (A(e, t), N(e, ""));
++ let { path: t } = await B(lt, { initial: r[e] ?? "" });
++ t && (A(e, t), j(e, ""));
} catch (t) {
- N(e, L(t));
- N(e, z(t));
++ j(e, R(t));
} finally {
d(t, !1);
}
@@@ -1228,7 -1224,7 +1228,7 @@@
if (n.preventDefault(), !E.current) {
E.current = !0, d(k.current, !0), x("");
try {
- let n = await z(lt, {
- let n = await V(st, {
++ let n = await B(ct, {
revision: D.current,
media_dirs: r,
...e.media_sources ? { media_sources: r.map((e, t) => ({
@@@ -1241,22 -1237,22 +1241,22 @@@
});
D.current = n.revision, _([]), y(""), t("已保存配置"), C(n);
} catch (e) {
- let t = mt(e);
- t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(L(e)));
- let t = dt(e);
- t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(z(e)));
++ let t = pt(e);
++ t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(R(e)));
} finally {
E.current = !1, d(k.current, !1);
}
}
},
noValidate: !0,
- children: [/* @__PURE__ */ q("div", {
+ children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content",
children: [
- /* @__PURE__ */ q(pt, { html: a("configTitle", "这台电脑") }),
- /* @__PURE__ */ q("div", {
- /* @__PURE__ */ J(Y, { html: a("configTitle", "这台电脑") }),
++ /* @__PURE__ */ J(ft, { html: a("configTitle", "这台电脑") }),
+ /* @__PURE__ */ J("div", {
class: "configfield",
children: [
- /* @__PURE__ */ q("span", {
+ /* @__PURE__ */ J("span", {
class: "configlabel",
id: "configDirsLabel",
children: "媒体文件夹"
@@@ -1287,29 -1283,29 +1287,29 @@@
type: "button",
class: "geist-button configpick",
"aria-label": "选择文件夹",
- onClick: (e) => ee(n, e.currentTarget),
- children: /* @__PURE__ */ q("svg", {
- onClick: (e) => P(n, e.currentTarget),
++ onClick: (e) => M(n, e.currentTarget),
+ children: /* @__PURE__ */ J("svg", {
viewBox: "0 0 24 24",
"aria-hidden": "true",
- children: /* @__PURE__ */ q("use", { href: "#i-folder-search" })
+ children: /* @__PURE__ */ J("use", { href: "#i-folder-search" })
})
}),
- r.length > 1 ? /* @__PURE__ */ q("button", {
+ r.length > 1 ? /* @__PURE__ */ J("button", {
type: "button",
class: "geist-button configrm",
"aria-label": "移除这个文件夹",
-- onClick: () => M(n),
- children: /* @__PURE__ */ q("svg", {
++ onClick: () => te(n),
+ children: /* @__PURE__ */ J("svg", {
viewBox: "0 0 24 24",
"aria-hidden": "true",
- children: /* @__PURE__ */ q("use", { href: "#i-x" })
+ children: /* @__PURE__ */ J("use", { href: "#i-x" })
})
}) : null,
- /* @__PURE__ */ q("div", {
+ /* @__PURE__ */ J("div", {
class: "configsource",
- children: [/* @__PURE__ */ q("div", {
+ children: [/* @__PURE__ */ J("div", {
class: "configsourcelabel",
- children: ["媒体来源", /* @__PURE__ */ q(_t, {
- children: ["媒体来源", /* @__PURE__ */ J(mt, {
++ children: ["媒体来源", /* @__PURE__ */ J(gt, {
label: `媒体来源 ${n + 1}`,
value: o[n] || "local",
onChange: (e) => {
@@@ -1336,15 -1332,15 +1336,15 @@@
]
}, n))
}),
- /* @__PURE__ */ q("button", {
+ /* @__PURE__ */ J("button", {
type: "button",
class: "geist-button configadd",
-- onClick: j,
++ onClick: ee,
children: "添加文件夹"
}),
- o.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ q("p", {
+ o.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ J("p", {
class: "confighelp",
- children: ["先在 CloudDrive 登录网盘并完成挂载。", /* @__PURE__ */ q("a", {
+ children: ["先在 CloudDrive 登录网盘并完成挂载。", /* @__PURE__ */ J("a", {
href: "https://www.clouddrive2.com/help.html",
target: "_blank",
rel: "noreferrer",
@@@ -1418,16 -1414,16 +1418,16 @@@
type: "checkbox",
checked: m,
onChange: (e) => h(e.currentTarget.checked)
- }), /* @__PURE__ */ q("span", {
+ }), /* @__PURE__ */ J("span", {
"aria-hidden": "true",
- children: /* @__PURE__ */ q("svg", {
+ children: /* @__PURE__ */ J("svg", {
viewBox: "0 0 24 24",
- children: /* @__PURE__ */ q("use", { href: "#i-check" })
+ children: /* @__PURE__ */ J("use", { href: "#i-check" })
})
})]
- }), /* @__PURE__ */ q("span", { children: "保存后扫描并补全资料" })]
+ }), /* @__PURE__ */ J("span", { children: "保存后扫描并补全资料" })]
}),
- b ? /* @__PURE__ */ q(pt, { html: s(b, {
- b ? /* @__PURE__ */ J(Y, { html: s(b, {
++ b ? /* @__PURE__ */ J(ft, { html: s(b, {
variant: "error",
label: "没有保存"
}) }) : null
@@@ -1444,8 -1440,8 +1444,8 @@@
})]
});
}
- function yt({ receipt: e, data: t, error: n }) {
- return n || !t ? /* @__PURE__ */ q(pt, {
-function gt({ receipt: e, data: t, error: n }) {
- return n || !t ? /* @__PURE__ */ J(Y, {
++function vt({ receipt: e, data: t, error: n }) {
++ return n || !t ? /* @__PURE__ */ J(ft, {
class: "configpage",
html: s(n || "没有读到配置", {
variant: "error",
@@@ -1458,7 -1454,7 +1458,7 @@@
class: "configgroup",
children: "通用"
}) : null,
- t.startup ? /* @__PURE__ */ q(ot, {
- t.startup ? /* @__PURE__ */ J(it, {
++ t.startup ? /* @__PURE__ */ J(at, {
startup: t.startup,
receipt: e
}) : null,
@@@ -1466,23 -1462,23 +1466,23 @@@
class: "configgroup",
children: "媒体"
}),
- t.editable ? /* @__PURE__ */ q(vt, {
- t.editable ? /* @__PURE__ */ J(ht, {
++ t.editable ? /* @__PURE__ */ J(_t, {
data: t,
receipt: e
- }) : /* @__PURE__ */ q(pt, { html: s(t.notice, {
- }) : /* @__PURE__ */ J(Y, { html: s(t.notice, {
++ }) : /* @__PURE__ */ J(ft, { html: s(t.notice, {
variant: "secondary",
label: "只读"
}) }),
- /* @__PURE__ */ q(gt, { data: t }),
- t.peach_proxy || t.access ? /* @__PURE__ */ q("h2", {
- /* @__PURE__ */ J(pt, { data: t }),
++ /* @__PURE__ */ J(ht, { data: t }),
+ t.peach_proxy || t.access ? /* @__PURE__ */ J("h2", {
class: "configgroup",
children: "网络与访问"
}) : null,
- t.peach_proxy ? /* @__PURE__ */ q(rt, {
- t.peach_proxy ? /* @__PURE__ */ J(tt, {
++ t.peach_proxy ? /* @__PURE__ */ J(nt, {
initial: t.peach_proxy,
receipt: e
}) : null,
- t.access ? /* @__PURE__ */ q(et, {
- t.access ? /* @__PURE__ */ J(Qe, {
++ t.access ? /* @__PURE__ */ J($e, {
initial: t.access,
receipt: e
}) : null,
@@@ -1490,34 -1486,34 +1490,34 @@@
class: "configgroup",
children: "更新与维护"
}),
- t.updates ? /* @__PURE__ */ q(nt, {
- t.updates ? /* @__PURE__ */ J(et, {
++ t.updates ? /* @__PURE__ */ J(tt, {
initial: t.updates,
initialJob: t.update_job
}) : null,
- /* @__PURE__ */ q(ht, { facts: t.facts }),
- t.uninstall ? /* @__PURE__ */ q(ct, { uninstall: t.uninstall }) : null
- /* @__PURE__ */ J(ft, { facts: t.facts }),
- t.uninstall ? /* @__PURE__ */ J(ot, { uninstall: t.uninstall }) : null
++ /* @__PURE__ */ J(mt, { facts: t.facts }),
++ t.uninstall ? /* @__PURE__ */ J(st, { uninstall: t.uninstall }) : null
]
});
}
//#endregion
//#region node_modules/@preact/signals-core/dist/signals-core.module.js
- var bt = Symbol.for("preact-signals");
- function xt() {
- if (Y > 1) Y--;
-var _t = Symbol.for("preact-signals");
-function vt() {
- if (Z > 1) Z--;
++var yt = Symbol.for("preact-signals");
++function bt() {
++ if (X > 1) X--;
else {
var e, t = !1;
for ((function() {
- var e = kt;
- for (kt = void 0; e !== void 0;) {
- var e = Et;
- for (Et = void 0; e !== void 0;) {
++ var e = Ot;
++ for (Ot = void 0; e !== void 0;) {
var t = e.S;
if (t.v === e.v) for (var n = t.t; n !== void 0; n = n.x) n.i === e.i && (n.i = t.i);
e = e.o;
}
- })(); Tt !== void 0;) {
- var n = Tt;
- for (Tt = void 0, Et++; n !== void 0;) {
- })(); St !== void 0;) {
- var n = St;
- for (St = void 0, Ct++; n !== void 0;) {
++ })(); wt !== void 0;) {
++ var n = wt;
++ for (wt = void 0, Tt++; n !== void 0;) {
var r = n.u;
- if (n.u = void 0, n.f &= -3, !(8 & n.f) && Nt(n)) try {
- if (n.u = void 0, n.f &= -3, !(8 & n.f) && At(n)) try {
++ if (n.u = void 0, n.f &= -3, !(8 & n.f) && Mt(n)) try {
n.c();
} catch (n) {
t ||= (e = n, !0);
@@@ -1525,116 -1521,116 +1525,116 @@@
n = r;
}
}
- if (Et = 0, Y--, t) throw e;
- if (Ct = 0, Z--, t) throw e;
++ if (Tt = 0, X--, t) throw e;
}
}
- function St(e) {
- if (Y > 0) return e();
- Ot = ++Dt, Y++;
-function yt(e) {
- if (Z > 0) return e();
- Tt = ++wt, Z++;
++function xt(e) {
++ if (X > 0) return e();
++ Dt = ++Et, X++;
try {
return e();
} finally {
- xt();
- vt();
++ bt();
}
}
- var Ct, J = void 0;
- function wt(e) {
- var t = J, n = Ct;
- J = void 0, Ct = void 0;
-var bt, X = void 0;
-function xt(e) {
- var t = X, n = bt;
- X = void 0, bt = void 0;
++var St, Y = void 0;
++function Ct(e) {
++ var t = Y, n = St;
++ Y = void 0, St = void 0;
try {
return e();
} finally {
- J = t, Ct = n;
- X = t, bt = n;
++ Y = t, St = n;
}
}
- var Tt = void 0, Y = 0, Et = 0, Dt = 0, Ot = 0, kt = void 0, At = 0;
- function jt(e) {
- if (J !== void 0) {
-var St = void 0, Z = 0, Ct = 0, wt = 0, Tt = 0, Et = void 0, Dt = 0;
-function Ot(e) {
- if (X !== void 0) {
++var wt = void 0, X = 0, Tt = 0, Et = 0, Dt = 0, Ot = void 0, kt = 0;
++function At(e) {
++ if (Y !== void 0) {
var t = e.n;
- if (t === void 0 || t.t !== J) return t = {
- if (t === void 0 || t.t !== X) return t = {
++ if (t === void 0 || t.t !== Y) return t = {
i: 0,
S: e,
- p: J.s,
- p: X.s,
++ p: Y.s,
n: void 0,
- t: J,
- t: X,
++ t: Y,
e: void 0,
x: void 0,
r: t
- }, J.s !== void 0 && (J.s.n = t), J.s = t, e.n = t, 32 & J.f && e.S(t), t;
- if (t.i === -1) return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = J.s, t.n = void 0, J.s.n = t, J.s = t), t;
- }, X.s !== void 0 && (X.s.n = t), X.s = t, e.n = t, 32 & X.f && e.S(t), t;
- if (t.i === -1) return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = X.s, t.n = void 0, X.s.n = t, X.s = t), t;
++ }, Y.s !== void 0 && (Y.s.n = t), Y.s = t, e.n = t, 32 & Y.f && e.S(t), t;
++ if (t.i === -1) return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = Y.s, t.n = void 0, Y.s.n = t, Y.s = t), t;
}
}
- function X(e, t) {
-function Q(e, t) {
++function Z(e, t) {
this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
}
- X.prototype.brand = bt, X.prototype.h = function() {
-Q.prototype.brand = _t, Q.prototype.h = function() {
++Z.prototype.brand = yt, Z.prototype.h = function() {
return !0;
- }, X.prototype.S = function(e) {
-}, Q.prototype.S = function(e) {
++}, Z.prototype.S = function(e) {
var t = this, n = this.t;
- n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? wt(function() {
- n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? xt(function() {
++ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? Ct(function() {
var e;
(e = t.W) == null || e.call(t);
}) : n.e = e);
- }, X.prototype.U = function(e) {
-}, Q.prototype.U = function(e) {
++}, Z.prototype.U = function(e) {
var t = this;
if (this.t !== void 0) {
var n = e.e, r = e.x;
- n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && wt(function() {
- n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && xt(function() {
++ n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && Ct(function() {
var e;
(e = t.Z) == null || e.call(t);
}));
}
- }, X.prototype.subscribe = function(e) {
-}, Q.prototype.subscribe = function(e) {
++}, Z.prototype.subscribe = function(e) {
var t = this;
- return Rt(function() {
+ return Bt(function() {
var n = t.value;
- wt(function() {
- xt(function() {
++ Ct(function() {
return e(n);
});
}, { name: "sub" });
- }, X.prototype.valueOf = function() {
-}, Q.prototype.valueOf = function() {
++}, Z.prototype.valueOf = function() {
return this.value;
- }, X.prototype.toString = function() {
-}, Q.prototype.toString = function() {
++}, Z.prototype.toString = function() {
return this.value + "";
- }, X.prototype.toJSON = function() {
-}, Q.prototype.toJSON = function() {
++}, Z.prototype.toJSON = function() {
return this.value;
- }, X.prototype.peek = function() {
-}, Q.prototype.peek = function() {
++}, Z.prototype.peek = function() {
var e = this;
- return wt(function() {
- return xt(function() {
++ return Ct(function() {
return e.value;
});
- }, Object.defineProperty(X.prototype, "value", {
-}, Object.defineProperty(Q.prototype, "value", {
++}, Object.defineProperty(Z.prototype, "value", {
get: function() {
- var e = jt(this);
- var e = Ot(this);
++ var e = At(this);
return e !== void 0 && (e.i = this.i), this.v;
},
set: function(e) {
if (e !== this.v) {
- if (Et > 100) throw Error("Cycle detected");
- if (Ct > 100) throw Error("Cycle detected");
++ if (Tt > 100) throw Error("Cycle detected");
(function(e) {
- Y !== 0 && Et === 0 && e.l !== Ot && (e.l = Ot, kt = {
- Z !== 0 && Ct === 0 && e.l !== Tt && (e.l = Tt, Et = {
++ X !== 0 && Tt === 0 && e.l !== Dt && (e.l = Dt, Ot = {
S: e,
v: e.v,
i: e.i,
- o: kt
- o: Et
++ o: Ot
});
- })(this), this.v = e, this.i++, At++, Y++;
- })(this), this.v = e, this.i++, Dt++, Z++;
++ })(this), this.v = e, this.i++, kt++, X++;
try {
for (var t = this.t; t !== void 0; t = t.x) t.t.N();
} finally {
- xt();
- vt();
++ bt();
}
}
}
});
- function Mt(e, t) {
- return new X(e, t);
-function kt(e, t) {
- return new Q(e, t);
++function jt(e, t) {
++ return new Z(e, t);
}
- function Nt(e) {
-function At(e) {
++function Mt(e) {
for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
return !1;
}
- function Pt(e) {
-function jt(e) {
++function Nt(e) {
for (var t = e.s; t !== void 0; t = t.n) {
var n = t.S.n;
if (n !== void 0 && (t.r = n), t.S.n = t, t.i = -1, t.n === void 0) {
@@@ -1643,81 -1639,81 +1643,81 @@@
}
}
}
- function Ft(e) {
-function Mt(e) {
++function Pt(e) {
for (var t = e.s, n = void 0; t !== void 0;) {
var r = t.p;
t.i === -1 ? (t.S.U(t), r !== void 0 && (r.n = t.n), t.n !== void 0 && (t.n.p = r)) : n = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = r;
}
e.s = n;
}
- function Z(e, t) {
- X.call(this, void 0, t), this.x = e, this.s = void 0, this.g = At - 1, this.f = 4;
-function $(e, t) {
- Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = Dt - 1, this.f = 4;
++function Q(e, t) {
++ Z.call(this, void 0, t), this.x = e, this.s = void 0, this.g = kt - 1, this.f = 4;
}
- Z.prototype = new X(), Z.prototype.h = function() {
-$.prototype = new Q(), $.prototype.h = function() {
++Q.prototype = new Z(), Q.prototype.h = function() {
if (this.f &= -3, 1 & this.f) return !1;
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === At)) return !0;
- if (this.g = At, this.f |= 1, this.i > 0 && !Nt(this)) return this.f &= -2, !0;
- var e = J;
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === Dt)) return !0;
- if (this.g = Dt, this.f |= 1, this.i > 0 && !At(this)) return this.f &= -2, !0;
- var e = X;
++ if ((36 & this.f) == 32 || (this.f &= -5, this.g === kt)) return !0;
++ if (this.g = kt, this.f |= 1, this.i > 0 && !Mt(this)) return this.f &= -2, !0;
++ var e = Y;
try {
- Pt(this), J = this;
- jt(this), X = this;
++ Nt(this), Y = this;
var t = this.x();
(16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
} catch (e) {
this.v = e, this.f |= 16, this.i++;
}
- return J = e, Ft(this), this.f &= -2, !0;
- }, Z.prototype.S = function(e) {
- return X = e, Mt(this), this.f &= -2, !0;
-}, $.prototype.S = function(e) {
++ return Y = e, Pt(this), this.f &= -2, !0;
++}, Q.prototype.S = function(e) {
if (this.t === void 0) {
this.f |= 36;
for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);
}
- X.prototype.S.call(this, e);
- }, Z.prototype.U = function(e) {
- if (this.t !== void 0 && (X.prototype.U.call(this, e), this.t === void 0)) {
- Q.prototype.S.call(this, e);
-}, $.prototype.U = function(e) {
- if (this.t !== void 0 && (Q.prototype.U.call(this, e), this.t === void 0)) {
++ Z.prototype.S.call(this, e);
++}, Q.prototype.U = function(e) {
++ if (this.t !== void 0 && (Z.prototype.U.call(this, e), this.t === void 0)) {
this.f &= -33;
for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);
}
- }, Z.prototype.N = function() {
-}, $.prototype.N = function() {
++}, Q.prototype.N = function() {
if (!(2 & this.f)) {
this.f |= 6;
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
}
- }, Object.defineProperty(Z.prototype, "value", { get: function() {
-}, Object.defineProperty($.prototype, "value", { get: function() {
++}, Object.defineProperty(Q.prototype, "value", { get: function() {
if (1 & this.f) throw Error("Cycle detected");
- var e = jt(this);
- var e = Ot(this);
++ var e = At(this);
if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
return this.v;
} });
- function It(e, t) {
- return new Z(e, t);
-function Nt(e, t) {
- return new $(e, t);
++function Ft(e, t) {
++ return new Q(e, t);
}
- function Lt(e) {
-function Pt(e) {
++function It(e) {
var t = e.m;
if (e.m = void 0, typeof t == "function") {
- Y++;
- var n = J;
- J = void 0;
- Z++;
- var n = X;
- X = void 0;
++ X++;
++ var n = Y;
++ Y = void 0;
try {
t();
} catch (t) {
- throw e.f &= -2, e.f |= 8, Rt(e), t;
- throw e.f &= -2, e.f |= 8, Ft(e), t;
++ throw e.f &= -2, e.f |= 8, Lt(e), t;
} finally {
- J = n, xt();
- X = n, vt();
++ Y = n, bt();
}
}
}
- function Rt(e) {
-function Ft(e) {
++function Lt(e) {
for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
- e.x = void 0, e.s = void 0, Lt(e);
- e.x = void 0, e.s = void 0, Pt(e);
++ e.x = void 0, e.s = void 0, It(e);
}
- function zt(e) {
- if (J !== this) throw Error("Out-of-order effect");
- Ft(this), J = e, this.f &= -2, 8 & this.f && Rt(this), xt();
-function It(e) {
- if (X !== this) throw Error("Out-of-order effect");
- Mt(this), X = e, this.f &= -2, 8 & this.f && Ft(this), vt();
++function Rt(e) {
++ if (Y !== this) throw Error("Out-of-order effect");
++ Pt(this), Y = e, this.f &= -2, 8 & this.f && Lt(this), bt();
}
- function Q(e, t) {
- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, Ct && Ct.push(this);
-function Lt(e, t) {
- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, bt && bt.push(this);
++function zt(e, t) {
++ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, St && St.push(this);
}
- Q.prototype.c = function() {
-Lt.prototype.c = function() {
++zt.prototype.c = function() {
var e = this.S();
try {
if (8 & this.f || this.x === void 0) return;
@@@ -1726,20 -1722,20 +1726,20 @@@
} finally {
e();
}
- }, Q.prototype.S = function() {
-}, Lt.prototype.S = function() {
++}, zt.prototype.S = function() {
if (1 & this.f) throw Error("Cycle detected");
- this.f |= 1, this.f &= -9, Lt(this), Pt(this), Y++;
- var e = J;
- return J = this, zt.bind(this, e);
- }, Q.prototype.N = function() {
- 2 & this.f || (this.f |= 2, this.u = Tt, Tt = this);
- }, Q.prototype.d = function() {
- this.f |= 8, 1 & this.f || Rt(this);
- }, Q.prototype.dispose = function() {
- this.f |= 1, this.f &= -9, Pt(this), jt(this), Z++;
- var e = X;
- return X = this, It.bind(this, e);
-}, Lt.prototype.N = function() {
- 2 & this.f || (this.f |= 2, this.u = St, St = this);
-}, Lt.prototype.d = function() {
- this.f |= 8, 1 & this.f || Ft(this);
-}, Lt.prototype.dispose = function() {
++ this.f |= 1, this.f &= -9, It(this), Nt(this), X++;
++ var e = Y;
++ return Y = this, Rt.bind(this, e);
++}, zt.prototype.N = function() {
++ 2 & this.f || (this.f |= 2, this.u = wt, wt = this);
++}, zt.prototype.d = function() {
++ this.f |= 8, 1 & this.f || Lt(this);
++}, zt.prototype.dispose = function() {
this.d();
};
-function Rt(e, t) {
- var n = new Lt(e, t);
+function Bt(e, t) {
- var n = new Q(e, t);
++ var n = new zt(e, t);
try {
n.c();
} catch (e) {
@@@ -1750,35 -1746,35 +1750,35 @@@
}
//#endregion
//#region node_modules/@preact/signals/dist/signals.module.js
-var zt, Bt, Vt = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Ht = [];
-Rt(function() {
- zt = this.N;
+var Vt, Ht, Ut = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Wt = [];
+Bt(function() {
+ Vt = this.N;
})();
-function Ut(e, t) {
- b[e] = t.bind(null, b[e] || function() {});
+function $(e, t) {
+ x[e] = t.bind(null, x[e] || function() {});
}
-function Wt(e) {
- if (Bt) {
- var t = Bt;
- Bt = void 0, t();
+function Gt(e) {
+ if (Ht) {
+ var t = Ht;
+ Ht = void 0, t();
}
- Bt = e && e.S();
+ Ht = e && e.S();
}
-function Gt(e) {
- var t = this, n = e.data, r = qt(n);
+function Kt(e) {
+ var t = this, n = e.data, r = Jt(n);
r.name = "ReactiveDom", r.value = n;
- var i = We(function() {
- var i = He(function() {
++ var i = Ue(function() {
for (var e = t, n = t.__v; n = n.__;) if (n.__c) {
n.__c.__$f |= 4;
break;
}
- var i = It(function() {
- var i = Nt(function() {
++ var i = Ft(function() {
var e = r.value.value;
return e === 0 ? 0 : !0 === e ? "" : e || "";
- }), a = It(function() {
- }), a = Nt(function() {
- return !Array.isArray(i.value) && !S(i.value);
- }), o = Rt(function() {
- if (this.N = Xt, a.value) {
++ }), a = Ft(function() {
+ return !Array.isArray(i.value) && !C(i.value);
+ }), o = Bt(function() {
+ if (this.N = Zt, a.value) {
var t = i.value;
e.__v && e.__v.__e && e.__v.__e.nodeType === 3 && (e.__v.__e.data = t);
}
@@@ -1789,7 -1785,7 +1789,7 @@@
}, []), a = i[0], o = i[1];
return a.value ? o.peek() : o.value;
}
- Kt.displayName = "ReactiveTextNode", Object.defineProperties(X.prototype, {
-Gt.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {
++Kt.displayName = "ReactiveTextNode", Object.defineProperties(Z.prototype, {
constructor: {
configurable: !0,
value: void 0
@@@ -1816,13 -1812,13 +1816,13 @@@
var n, r = t.props;
for (var i in r) if (i !== "children") {
var a = r[i];
- a instanceof X && (n || (t.__np = n = {}), n[i] = a, r[i] = a.peek());
- a instanceof Q && (n || (t.__np = n = {}), n[i] = a, r[i] = a.peek());
++ a instanceof Z && (n || (t.__np = n = {}), n[i] = a, r[i] = a.peek());
}
}
e(t);
-}), Ut("__r", function(e, t) {
- if (e(t), t.type !== L) {
- Wt();
+}), $("__r", function(e, t) {
- if (e(t), t.type !== F) {
++ if (e(t), t.type !== I) {
+ Gt();
var n, r = t.__c;
r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(e, t) {
var n;
@@@ -1854,8 -1850,8 +1854,8 @@@
}
e(t);
});
-function Kt(e, t, n, r) {
- var i = t in e && e.ownerSVGElement === void 0, a = kt(n);
+function qt(e, t, n, r) {
- var i = t in e && e.ownerSVGElement === void 0, a = Mt(n);
++ var i = t in e && e.ownerSVGElement === void 0, a = jt(n);
return {
o: function(e, t) {
a.value = e, r = t;
@@@ -1891,9 -1887,9 +1891,9 @@@ $("unmount", function(e, t)
}
}
e(t);
-}), Ut("__h", function(e, t, n, r) {
+}), $("__h", function(e, t, n, r) {
r < 3 && (t.__$f |= 2), e(t, n, r);
- }), ce.prototype.shouldComponentUpdate = function(e, t) {
-}), ae.prototype.shouldComponentUpdate = function(e, t) {
++}), se.prototype.shouldComponentUpdate = function(e, t) {
if (this.__R) return !0;
var n = this.__$u, r = n && n.s !== void 0;
for (var i in t) return !0;
@@@ -1905,55 -1901,55 +1905,55 @@@
for (var s in this.props) if (!(s in e)) return !0;
return !1;
};
-function qt(e, t) {
- return He(function() {
- return kt(e, t);
+function Jt(e, t) {
- return We(function() {
- return Mt(e, t);
++ return Ue(function() {
++ return jt(e, t);
}, []);
}
-var Jt = function(e) {
+var Yt = function(e) {
queueMicrotask(function() {
queueMicrotask(e);
});
};
-function Yt() {
- yt(function() {
- for (var e; e = Ht.shift();) zt.call(e);
+function Xt() {
- St(function() {
++ xt(function() {
+ for (var e; e = Wt.shift();) Vt.call(e);
});
}
-function Xt() {
- Ht.push(this) === 1 && (b.requestAnimationFrame || Jt)(Yt);
+function Zt() {
+ Wt.push(this) === 1 && (x.requestAnimationFrame || Yt)(Xt);
}
//#endregion
//#region src/state/quality-goals.ts
-var Zt = "/api/quality-goals?limit=200", Qt = {
+var Qt = "/api/quality-goals?limit=200", $t = {
data: null,
error: ""
- }, en = Mt($t), tn = 0, nn = It(() => en.value);
- It(() => en.value.data?.total ?? null);
-}, $t = kt(Qt), en = 0, tn = Nt(() => $t.value);
-Nt(() => $t.value.data?.total ?? null);
-function nn() {
- en += 1, $t.value = Qt;
++}, en = jt($t), tn = 0, nn = Ft(() => en.value);
++Ft(() => en.value.data?.total ?? null);
+function rn() {
+ tn += 1, en.value = $t;
}
-async function rn(e) {
- let t = en += 1;
+async function an(e) {
+ let t = tn += 1;
try {
- let n = await R(Qt, e);
- let n = await B(Zt, e);
- return t === en && ($t.value = {
++ let n = await z(Qt, e);
+ return t === tn && (en.value = {
data: n,
error: ""
}), n;
} catch (n) {
- throw !e?.aborted && t === en && ($t.value = {
+ throw !e?.aborted && t === tn && (en.value = {
data: null,
- error: L(n)
- error: z(n)
++ error: R(n)
}), n;
}
}
//#endregion
//#region src/islands/quality-goals.tsx
-var an = (e, t) => rn(t), on = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;
-function sn({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: r }) {
- let { data: a, error: o } = tn.value;
+var on = (e, t) => an(t), sn = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;
+function cn({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: r }) {
+ let { data: a, error: o } = nn.value;
- if (o) return /* @__PURE__ */ q("div", {
+ if (o) return /* @__PURE__ */ J("div", {
class: "qualitylist",
dangerouslySetInnerHTML: { __html: s(o, {
variant: "error",
@@@ -1970,8 -1966,8 +1970,8 @@@
type: "button",
"aria-label": `打开 ${n(i)}`,
onClick: () => e(i.id),
- children: /* @__PURE__ */ q("img", {
+ children: /* @__PURE__ */ J("img", {
- src: on(i),
+ src: sn(i),
alt: "",
loading: "lazy",
onError: (e) => e.currentTarget.remove()
@@@ -1990,15 -1986,15 +1990,15 @@@
style: "display:contents",
dangerouslySetInnerHTML: { __html: r(i.location, i.cost) }
}),
- /* @__PURE__ */ q("span", { children: m[i.location] ?? i.location }),
- /* @__PURE__ */ q("span", { children: _(i.duration) }),
- /* @__PURE__ */ q("span", { children: v(i.size ?? 0) })
+ /* @__PURE__ */ J("span", { children: m[i.location] ?? i.location }),
- /* @__PURE__ */ J("span", { children: g(i.duration) }),
- /* @__PURE__ */ J("span", { children: _(i.size ?? 0) })
++ /* @__PURE__ */ J("span", { children: _(i.duration) }),
++ /* @__PURE__ */ J("span", { children: v(i.size ?? 0) })
]
}),
- i.reason ? /* @__PURE__ */ q("p", { children: i.reason }) : null
+ i.reason ? /* @__PURE__ */ J("p", { children: i.reason }) : null
] })]
}, i.id))
- }) : /* @__PURE__ */ q("div", {
+ }) : /* @__PURE__ */ J("div", {
class: "qualitylist",
dangerouslySetInnerHTML: { __html: i("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }
});
@@@ -2050,10 -2046,10 +2050,10 @@@ function un(e)
}
//#endregion
//#region src/islands/scraping.tsx
- var dn = (e, t) => R("/api/scraping", t);
-var un = (e, t) => B("/api/scraping", t);
-function dn({ value: e, onChange: t }) {
++var dn = (e, t) => z("/api/scraping", t);
+function fn({ value: e, onChange: t }) {
- let n = K(null), r = K(t);
- return r.current = t, G(() => {
+ let n = q(null), r = q(t);
+ return r.current = t, K(() => {
let t = n.current;
t.innerHTML = l([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });
let i = p(t.firstElementChild), a = () => r.current(i.value);
@@@ -2065,76 -2061,62 +2065,76 @@@
class: "scraping-network"
});
}
-function fn({ source: e, toast: t }) {
- let [n, r] = W(e), [i, o] = W(e.network), [c, l] = W(""), [u, f] = W(""), [p, m] = W("paste"), [h, g] = W(""), [_, v] = W(!1), [y, b] = W(""), [x, S] = W([]), C = q(null), w = q(null);
+function pn({ source: e, toast: t }) {
- let [n, r] = U(e), [i, o] = U(e.network), [c, l] = U(""), [u, f] = U(""), [p, m] = U("paste"), [h, _] = U(""), [v, y] = U(!1), [b, x] = U(""), [S, C] = U([]), w = K(null), T = K(null);
- G(() => {
++ let [n, r] = W(e), [i, o] = W(e.network), [c, l] = W(""), [u, f] = W(""), [p, m] = W("paste"), [h, _] = W(""), [v, y] = W(!1), [b, x] = W(""), [S, C] = W([]), w = q(null), T = q(null);
+ K(() => {
- w.current?.querySelectorAll("footer button").forEach((e) => d(e, _));
- }, [_]);
- let T = q(new AbortController());
- G(() => () => T.current.abort(), []);
- async function E(n) {
- if (!_) {
- v(!0), b(""), S([]);
+ T.current?.querySelectorAll("footer button").forEach((e) => d(e, v));
+ }, [v]);
- let E = K(new AbortController());
- W(() => () => E.current.abort(), []);
++ let E = q(new AbortController());
++ G(() => () => E.current.abort(), []);
+ async function D(n) {
+ if (!v) {
+ y(!0), x(""), C([]);
try {
if (n === "check") {
- let t = await z("/api/scraping/check", { source: e.source }, "POST", E.current.signal);
- let t = await V("/api/scraping/check", { source: e.source }, "POST", T.current.signal);
- T.current.signal.aborted || S(t.results);
++ let t = await B("/api/scraping/check", { source: e.source }, "POST", E.current.signal);
+ E.current.signal.aborted || C(t.results);
} else {
- let a = await z("/api/scraping/settings", {
- let a = await V("/api/scraping/settings", {
++ let a = await B("/api/scraping/settings", {
source: e.source,
network: i,
cookie: c,
cookies_text: u,
revoke: n === "revoke"
- }, "POST", T.current.signal);
- T.current.signal.aborted || (r(a.saved), l(""), f(""), g(""), C.current && (C.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));
+ }, "POST", E.current.signal);
+ E.current.signal.aborted || (r(a.saved), l(""), f(""), _(""), w.current && (w.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));
}
} catch (e) {
- E.current.signal.aborted || x(L(e));
- T.current.signal.aborted || b(z(e));
++ E.current.signal.aborted || x(R(e));
} finally {
- T.current.signal.aborted || v(!1);
+ E.current.signal.aborted || y(!1);
}
}
}
- return /* @__PURE__ */ q("section", {
+ return /* @__PURE__ */ J("section", {
class: "scraping-source",
- children: /* @__PURE__ */ q("form", {
+ children: /* @__PURE__ */ J("form", {
- ref: w,
+ ref: T,
class: "cleanupfieldset",
"data-geist-fieldset": !0,
onSubmit: (e) => {
- e.preventDefault(), E("save");
+ e.preventDefault(), D("save");
},
- children: [/* @__PURE__ */ q("div", {
+ children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content scraping-fields",
children: [
- /* @__PURE__ */ q("div", {
+ /* @__PURE__ */ J("div", {
class: "geist-fieldset-heading",
- children: [/* @__PURE__ */ q("div", { dangerouslySetInnerHTML: { __html: a(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ q("a", {
+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: a(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ J("a", {
class: "scraping-url",
href: e.login,
target: "_blank",
rel: "noopener noreferrer",
- children: e.login
+ children: [
- /* @__PURE__ */ q("img", {
++ /* @__PURE__ */ J("img", {
+ src: g(e.login),
+ alt: "",
+ width: "16",
+ height: "16",
+ loading: "lazy",
+ onError: (e) => e.currentTarget.remove()
+ }),
- /* @__PURE__ */ q("span", { children: e.login }),
- /* @__PURE__ */ q("svg", {
++ /* @__PURE__ */ J("span", { children: e.login }),
++ /* @__PURE__ */ J("svg", {
+ "aria-hidden": "true",
- children: /* @__PURE__ */ q("use", { href: "#i-external-link" })
++ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })
+ })
+ ]
})]
}),
- /* @__PURE__ */ q("div", {
+ /* @__PURE__ */ J("div", {
class: "scraping-label",
- children: ["连接方式", /* @__PURE__ */ q(fn, {
- children: ["连接方式", /* @__PURE__ */ J(dn, {
++ children: ["连接方式", /* @__PURE__ */ J(fn, {
value: i,
onChange: o
})]
@@@ -2144,9 -2126,9 +2144,9 @@@
href: "/configuration#peachProxy",
children: "配置 Peach 代理"
}),
- e.accepts_cookie && /* @__PURE__ */ q(F, { children: [
- /* @__PURE__ */ q("p", { children: n.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),
- /* @__PURE__ */ q("div", {
- e.accepts_cookie && /* @__PURE__ */ J(L, { children: [
++ e.accepts_cookie && /* @__PURE__ */ J(I, { children: [
+ /* @__PURE__ */ J("p", { children: n.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),
+ /* @__PURE__ */ J("div", {
class: "insightswitch scraping-cookie-method",
role: "radiogroup",
"aria-label": "提供 Cookie 的方式(二选一)",
@@@ -2156,23 -2138,23 +2156,23 @@@
value: t,
checked: p === t,
onChange: () => {
- m(t), l(""), f(""), g("");
+ m(t), l(""), f(""), _("");
}
- }), /* @__PURE__ */ q("span", { children: n })] }, t))
+ }), /* @__PURE__ */ J("span", { children: n })] }, t))
}),
- p === "paste" ? /* @__PURE__ */ q("label", { children: ["Cookie", /* @__PURE__ */ q("input", {
+ p === "paste" ? /* @__PURE__ */ J("label", { children: ["Cookie", /* @__PURE__ */ J("input", {
class: "geist-input",
type: "password",
autoComplete: "off",
value: c,
- disabled: _,
+ disabled: v,
onInput: (e) => l(e.currentTarget.value)
- })] }) : /* @__PURE__ */ q("label", {
+ })] }) : /* @__PURE__ */ J("label", {
class: "scraping-file",
- children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ q("span", {
+ children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ J("span", {
class: "scraping-file-control",
children: [
- /* @__PURE__ */ q("span", {
+ /* @__PURE__ */ J("span", {
class: "geist-button",
children: "选择文件"
}),
@@@ -2180,11 -2162,11 +2180,11 @@@
class: "scraping-file-name",
children: h || "未选择文件"
}),
- /* @__PURE__ */ q("input", {
+ /* @__PURE__ */ J("input", {
- ref: C,
+ ref: w,
type: "file",
accept: ".txt",
- disabled: _,
+ disabled: v,
onChange: async (e) => {
let t = e.currentTarget.files?.[0];
if (!t) {
@@@ -2210,11 -2192,11 +2210,11 @@@
})]
})
] }),
- b && /* @__PURE__ */ q("div", {
- y && /* @__PURE__ */ J("div", {
++ b && /* @__PURE__ */ J("div", {
role: "alert",
- dangerouslySetInnerHTML: { __html: s(y, { variant: "error" }) }
+ dangerouslySetInnerHTML: { __html: s(b, { variant: "error" }) }
}),
- S.map((t) => /* @__PURE__ */ q("div", {
- x.map((t) => /* @__PURE__ */ J("div", {
++ S.map((t) => /* @__PURE__ */ J("div", {
role: "status",
dangerouslySetInnerHTML: { __html: s(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }
}, t.label))
@@@ -2223,36 -2205,36 +2223,36 @@@
class: "geist-fieldset-footer",
"data-geist-fieldset-footer": !0,
children: [
- e.accepts_cookie && n.cookie_saved && /* @__PURE__ */ q("button", {
- /* @__PURE__ */ J("button", {
- class: "geist-button primary",
- type: "submit",
- children: "保存"
++ e.accepts_cookie && n.cookie_saved && /* @__PURE__ */ J("button", {
+ class: "geist-button",
+ type: "button",
+ onClick: () => void D("revoke"),
+ children: "撤销 Cookie"
}),
- /* @__PURE__ */ q("button", {
+ /* @__PURE__ */ J("button", {
class: "geist-button",
type: "button",
- onClick: () => void E("check"),
+ onClick: () => void D("check"),
children: "检查连接"
}),
- /* @__PURE__ */ q("button", {
- e.accepts_cookie && n.cookie_saved && /* @__PURE__ */ J("button", {
- class: "geist-button",
- type: "button",
- onClick: () => void E("revoke"),
- children: "撤销 Cookie"
++ /* @__PURE__ */ J("button", {
+ class: "geist-button primary",
+ type: "submit",
+ children: "保存"
})
]
})]
})
});
}
-function pn({ data: e, error: t, toast: n }) {
+function mn({ data: e, error: t, toast: n }) {
- let [r, i] = U(""), [o, c] = U(!1), [l, u] = U(""), f = K(null);
- G(() => d(f.current, o), [o]);
- let p = K(new AbortController()), m = K(0);
+ let [r, i] = W(""), [o, c] = W(!1), [l, u] = W(""), f = q(null);
+ K(() => d(f.current, o), [o]);
+ let p = q(new AbortController()), m = q(0);
async function h(e = !1) {
let t = ++m.current;
- await cn({
- read: (e) => B("/api/scraping/cover", e),
+ await ln({
- read: (e) => R("/api/scraping/cover", e),
++ read: (e) => z("/api/scraping/cover", e),
active: () => !p.current.signal.aborted && t === m.current,
render: (t) => {
c(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && u(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");
@@@ -2265,9 -2247,9 +2265,9 @@@
if (!o) {
m.current++, c(!0), u("");
try {
- await z("/api/scraping/cover", { code: r }, "POST", p.current.signal), await h();
- await V("/api/scraping/cover", { code: r }, "POST", p.current.signal), await h();
++ await B("/api/scraping/cover", { code: r }, "POST", p.current.signal), await h();
} catch (e) {
- p.current.signal.aborted || (c(!1), u(L(e)));
- p.current.signal.aborted || (c(!1), u(z(e)));
++ p.current.signal.aborted || (c(!1), u(R(e)));
}
}
}
@@@ -2312,7 -2294,7 +2312,7 @@@
]
})
}),
- e?.sources.map((e) => /* @__PURE__ */ q(pn, {
- e?.sources.map((e) => /* @__PURE__ */ J(fn, {
++ e?.sources.map((e) => /* @__PURE__ */ J(pn, {
source: e,
toast: n
}, e.source))
@@@ -2321,14 -2303,14 +2321,14 @@@
}
//#endregion
//#region src/islands/library-processing.tsx
- var hn = (e, t) => R("/api/library-processing", t);
-var mn = (e, t) => B("/api/library-processing", t);
-function hn({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: l }) {
++var hn = (e, t) => z("/api/library-processing", t);
+function gn({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: l }) {
- let [u, f] = U(e || { status: "idle" }), [p, m] = U(t), [h, g] = U(!1), [_, v] = U(!1), y = K(new AbortController()), b = K(0), x = K(u.status), S = K(null), C = h || u.status === "running";
- G(() => d(S.current, C), [C]);
+ let [u, f] = W(e || { status: "idle" }), [p, m] = W(t), [h, g] = W(!1), [_, v] = W(!1), y = q(new AbortController()), b = q(0), x = q(u.status), S = q(null), C = h || u.status === "running";
+ K(() => d(S.current, C), [C]);
async function w() {
let e = ++b.current;
- await cn({
- read: (e) => B("/api/library-processing", e),
+ await ln({
- read: (e) => R("/api/library-processing", e),
++ read: (e) => z("/api/library-processing", e),
active: () => !y.current.signal.aborted && b.current === e,
keepWatching: i === "notice" || !!l,
render: (e) => {
@@@ -2342,11 -2324,11 +2342,11 @@@
if (!C) {
g(!0), m(""), v(!1);
try {
- let e = await z("/api/library-processing", {}, "POST", y.current.signal);
- let e = await V("/api/library-processing", {}, "POST", y.current.signal);
++ let e = await B("/api/library-processing", {}, "POST", y.current.signal);
if (y.current.signal.aborted) return;
x.current = e.status, f(e), g(!1), await w();
} catch (e) {
- y.current.signal.aborted || (m(L(e)), g(!1));
- y.current.signal.aborted || (m(z(e)), g(!1));
++ y.current.signal.aborted || (m(R(e)), g(!1));
}
}
}
@@@ -2358,16 -2340,16 +2358,16 @@@
href: "/data-cleanup#libraryProcessing",
children: p || u.status === "failed" ? "查看并处理" : "查看进度"
})]
- }) : /* @__PURE__ */ q(F, { children: [/* @__PURE__ */ q("div", {
- }) : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("div", {
++ }) : /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("div", {
class: "geist-fieldset-content library-processing",
children: [
- /* @__PURE__ */ q("div", { dangerouslySetInnerHTML: { __html: a("cleanupScrapingTitle", "扫描与采集") } }),
- /* @__PURE__ */ q("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),
- /* @__PURE__ */ q("div", {
+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: a("cleanupScrapingTitle", "扫描与采集") } }),
+ /* @__PURE__ */ J("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),
+ /* @__PURE__ */ J("div", {
"aria-live": "polite",
children: [
- u.status === "running" && /* @__PURE__ */ q(F, { children: [/* @__PURE__ */ q("div", { dangerouslySetInnerHTML: { __html: o(`${u.stage || "正在处理"}${u.total ? ` · ${u.checked || 0} / ${u.total}` : ""}`) } }), !!u.total && /* @__PURE__ */ q("div", { dangerouslySetInnerHTML: { __html: c(`已处理 ${u.checked || 0} / ${u.total} 个视频`, u.checked || 0, u.total) } })] }),
- (p || u.status === "failed") && /* @__PURE__ */ q("div", {
- u.status === "running" && /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: o(`${u.stage || "正在处理"}${u.total ? ` · ${u.checked || 0} / ${u.total}` : ""}`) } }), !!u.total && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: c(`已处理 ${u.checked || 0} / ${u.total} 个视频`, u.checked || 0, u.total) } })] }),
++ u.status === "running" && /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: o(`${u.stage || "正在处理"}${u.total ? ` · ${u.checked || 0} / ${u.total}` : ""}`) } }), !!u.total && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: c(`已处理 ${u.checked || 0} / ${u.total} 个视频`, u.checked || 0, u.total) } })] }),
+ (p || u.status === "failed") && /* @__PURE__ */ J("div", {
role: "alert",
dangerouslySetInnerHTML: { __html: s(p || u.error || "处理未完成,请重试", { variant: "error" }) }
}),
@@@ -2518,7 -2500,7 +2518,7 @@@ async function On(e, t, n, r)
} catch (e) {
i.push({
key: o.key,
- message: L(e)
- message: z(e)
++ message: R(e)
});
}
}
@@@ -2584,16 -2566,22 +2584,22 @@@ function An(e, r)
let O = document.createElement("p");
O.className = "reviewstate reviewbulkfeedback", O.setAttribute("role", "status");
let k = document.createElement("div");
- k.className = "reviewbulkdecisions", k.append(w, T), _.append(v, b, C, E, D, k), i.before(_, O), i.classList.add("reviewgroups");
- let A = () => {
+ k.className = "reviewbulkdecisions", k.append(w, T);
+ let A = document.createElement("div");
+ A.className = "selectiondock reviewdock", A.setAttribute("role", "group"), A.setAttribute("aria-label", "复核所选项目");
- let j = g("取消选择");
- A.append(E, D, k, j, O), _.append(v, b, C), i.before(_), e.append(A), i.classList.add("reviewgroups");
- let M = () => {
- a.selected.clear(), a.anchor = null, F();
++ let ee = g("取消选择");
++ A.append(E, D, k, ee, O), _.append(v, b, C), i.before(_), e.append(A), i.classList.add("reviewgroups");
++ let te = () => {
+ a.selected.clear(), a.anchor = null, N();
};
- C.onclick = () => {
- j.onclick = () => {
- a.busy || (M(), C.focus({ preventScroll: !0 }));
++ ee.onclick = () => {
++ a.busy || (te(), C.focus({ preventScroll: !0 }));
+ }, C.onclick = () => {
if (a.busy) return;
let e = u(), t = f().length === e.length;
- e.forEach((e) => t ? a.selected.delete(e.dataset.reviewKey) : a.selected.add(e.dataset.reviewKey)), F();
- }, w.onclick = () => ee("approved", w), T.onclick = () => ee("rejected", T);
- let N = [];
+ e.forEach((e) => t ? a.selected.delete(e.dataset.reviewKey) : a.selected.add(e.dataset.reviewKey)), N();
- }, w.onclick = () => ee("approved", w), T.onclick = () => ee("rejected", T);
++ }, w.onclick = () => P("approved", w), T.onclick = () => P("rejected", T);
+ let j = [];
for (let e of c) {
let t = e.rows.map((e) => o.find((t) => t.dataset.reviewKey === e.item_key)).filter((e) => !!e), r = document.createElement("section");
r.className = "reviewgroup", r.hidden = !!a.filter && e.key !== a.filter;
@@@ -2658,20 -2646,20 +2664,20 @@@
}
}
e.addEventListener("keydown", (t) => {
- a.busy || !e.contains(i) || (t.key === "Escape" && a.selected.size && (t.preventDefault(), t.stopPropagation(), A()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), u().forEach((e) => a.selected.add(e.dataset.reviewKey)), N()));
- a.busy || !e.contains(i) || (t.key === "Escape" && a.selected.size && (t.preventDefault(), t.stopPropagation(), M()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), u().forEach((e) => a.selected.add(e.dataset.reviewKey)), F()));
++ a.busy || !e.contains(i) || (t.key === "Escape" && a.selected.size && (t.preventDefault(), t.stopPropagation(), te()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), u().forEach((e) => a.selected.add(e.dataset.reviewKey)), N()));
});
- let P = "";
- function F() {
+ let M = "";
+ function N() {
let e = f();
- C.textContent = e.length === u().length ? "清空当前选择" : a.filter ? "全选当前分类" : "全选本页", E.innerHTML = t(`已选 ${e.length} 项`), w.disabled = !e.length || e.some((e) => !h(e)), T.disabled = !e.length;
+ C.textContent = e.length === u().length ? "清空当前选择" : a.filter ? "全选当前分类" : "全选本页", A.hidden = !e.length, E.innerHTML = t(`已选 ${e.length} 项`), w.disabled = !e.length || e.some((e) => !h(e)), T.disabled = !e.length;
- let n = On(m());
+ let n = kn(m());
D.hidden = !r.metadata || !m().some((e) => (e.candidates?.length || 0) > 1);
let i = e.length && !n.length ? "所选项目无共同来源" : "统一选择来源", o = JSON.stringify([i, n]);
- if (o !== P) {
- P = o, D.innerHTML = l([["", i], ...n.map((e) => [e, e])], "", { label: "统一选择来源" });
+ if (o !== M) {
+ M = o, D.innerHTML = l([["", i], ...n.map((e) => [e, e])], "", { label: "统一选择来源" });
let e = p(D.firstElementChild);
e.disabled = !n.length, e.addEventListener("change", () => {
- if (!(a.busy || !On(m()).includes(e.value))) {
+ if (!(a.busy || !kn(m()).includes(e.value))) {
for (let t of f()) {
let n = r.rows.find((e) => e.item_key === t.dataset.reviewKey).candidates.find((t) => t.source === e.value);
t.querySelectorAll("input[type=\"radio\"]").forEach((e) => {
@@@ -2682,9 -2670,9 +2688,9 @@@
}
});
}
- N.forEach((e) => e());
+ j.forEach((e) => e());
}
-- async function ee(t, n) {
++ async function P(t, n) {
if (a.busy || !f().length) return;
let i = f().map((e) => ({
key: e.dataset.reviewKey,
@@@ -2930,28 -2918,28 +2936,28 @@@ function Zn(e, t)
}
//#endregion
//#region src/islands.ts
-var Zn = {
+var Qn = {
"library-processing": {
- load: mn,
- component: hn
+ load: hn,
+ component: gn
},
scraping: {
- load: un,
- component: pn
+ load: dn,
+ component: mn
},
"quality-goals": {
- load: an,
- component: sn
+ load: on,
+ component: cn
},
configuration: {
- load: ft,
- component: yt
- load: ut,
- component: gt
++ load: dt,
++ component: vt
}
-}, Qn = () => Object.keys(Zn), $n = /* @__PURE__ */ new Map();
-async function er(e, t, n, r = {}) {
- let i = Zn[e];
+}, $n = () => Object.keys(Qn), er = /* @__PURE__ */ new Map();
+async function tr(e, t, n, r = {}) {
+ let i = Qn[e];
if (!i) throw Error(`未注册的 island:${String(e)}`);
- tr(t);
+ nr(t);
let a = {
controller: new AbortController(),
painted: !1
@@@ -2967,12 -2955,12 +2973,12 @@@
if (a.controller.signal.aborted) return;
o = {
data: null,
- error: L(e)
- error: z(e)
++ error: R(e)
};
}
- if ($n.get(t) !== a) return;
+ if (er.get(t) !== a) return;
if (r.isCurrent && !r.isCurrent()) {
- $n.delete(t);
+ er.delete(t);
return;
}
t.textContent = "", a.painted = !0;
@@@ -2980,11 -2968,11 +2986,11 @@@
...n,
...o
};
- Oe(oe(i.component, s), t);
- Te(re(i.component, s), t);
++ De(ae(i.component, s), t);
}
-function tr(e) {
- let t = $n.get(e);
- t && (t.controller.abort(), $n.delete(e), t.painted && Te(null, e));
+function nr(e) {
+ let t = er.get(e);
- t && (t.controller.abort(), er.delete(e), t.painted && Oe(null, e));
++ t && (t.controller.abort(), er.delete(e), t.painted && De(null, e));
}
//#endregion
- export { Gn as TASTE_GUIDE_KEY, Ln as catalogEmptyHtml, In as catalogSuggestions, Un as cleanupSkeletonHtml, Vn as cloudLocations, Hn as cloudPreferenceLocations, wn as createReviewSelection, Fn as emptyCatalogLayout, Nn as entitySkeletonHtml, un as followJobProgress, Sn as identityEvidenceHtml, $n as islandNames, Xn as javImageKind, jn as matchesFaceSource, tr as mountIsland, Mn as nativeImageFit, Yn as normalizeJavImage, qn as normalizeJavLayout, Jn as normalizeJavPreferences, ke as preferredDirection, yn as refreshStore, xn as reviewImageHtml, Rn as sidebarHasCatalogContent, Bn as sidebarTagCounts, vn as storeNames, Zn as syncJavImages, zn as syncSidebarSurface, Wn as tasteHistoryGuideHtml, nr as unmountIsland, ln as watchJob, Cn as wireReviewPictures, An as wireReviewSelection, Kn as wireTasteHistoryGuide };
-export { Wn as TASTE_GUIDE_KEY, In as catalogEmptyHtml, Fn as catalogSuggestions, Hn as cleanupSkeletonHtml, Bn as cloudLocations, Vn as cloudPreferenceLocations, Cn as createReviewSelection, Pn as emptyCatalogLayout, Mn as entitySkeletonHtml, ln as followJobProgress, xn as identityEvidenceHtml, Qn as islandNames, Yn as javImageKind, An as matchesFaceSource, er as mountIsland, jn as nativeImageFit, Jn as normalizeJavImage, Kn as normalizeJavLayout, qn as normalizeJavPreferences, Ee as preferredDirection, vn as refreshStore, bn as reviewImageHtml, Ln as sidebarHasCatalogContent, zn as sidebarTagCounts, _n as storeNames, Xn as syncJavImages, Rn as syncSidebarSurface, Un as tasteHistoryGuideHtml, tr as unmountIsland, cn as watchJob, Sn as wireReviewPictures, kn as wireReviewSelection, Gn as wireTasteHistoryGuide };
++export { Gn as TASTE_GUIDE_KEY, Ln as catalogEmptyHtml, In as catalogSuggestions, Un as cleanupSkeletonHtml, Vn as cloudLocations, Hn as cloudPreferenceLocations, wn as createReviewSelection, Fn as emptyCatalogLayout, Nn as entitySkeletonHtml, un as followJobProgress, Sn as identityEvidenceHtml, $n as islandNames, Xn as javImageKind, jn as matchesFaceSource, tr as mountIsland, Mn as nativeImageFit, Yn as normalizeJavImage, qn as normalizeJavLayout, Jn as normalizeJavPreferences, Oe as preferredDirection, yn as refreshStore, xn as reviewImageHtml, Rn as sidebarHasCatalogContent, Bn as sidebarTagCounts, vn as storeNames, Zn as syncJavImages, zn as syncSidebarSurface, Wn as tasteHistoryGuideHtml, nr as unmountIsland, ln as watchJob, Cn as wireReviewPictures, An as wireReviewSelection, Kn as wireTasteHistoryGuide };