Files
2025-12-10 15:07:14 +08:00

2166 lines
130 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const $ = new Env("有赞");
const notify = $.isNode() ? require("../sendNotify") : "";
(() => {
function b(M) {
{
b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (P) {
{
return typeof P;
}
} : function (P) {
{
return P && "function" == typeof Symbol && P.constructor === Symbol && P !== Symbol.prototype ? "symbol" : typeof P;
}
};
return b(M);
}
}
function c(M, N) {
{
var P = "undefined" != typeof Symbol && M[Symbol.iterator] || M["@@iterator"];
if (!P) {
{
if (Array.isArray(M) || (P = d(M)) || N && M && "number" == typeof M.length) {
{
P && (M = P);
var Q = 0;
var R = function () {};
return {
s: R,
n: function () {
{
var X = {
done: true
};
return Q >= M.length ? X : {
done: false,
value: M[Q++]
};
}
},
e: function (X) {
{
throw X;
}
},
f: R
};
}
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
}
var S;
var T = true;
var U = false;
return {
s: function () {
{
P = P.call(M);
}
},
n: function () {
{
var X = P.next();
T = X.done;
return X;
}
},
e: function (X) {
{
U = true;
S = X;
}
},
f: function () {
{
try {
{
T || null == P.return || P.return();
}
} finally {
{
if (U) {
throw S;
}
}
}
}
}
};
}
}
function d(M, N) {
{
if (M) {
{
if ("string" == typeof M) {
return e(M, N);
}
var P = {}.toString.call(M).slice(8, -1);
"Object" === P && M.constructor && (P = M.constructor.name);
return "Map" === P || "Set" === P ? Array.from(M) : "Arguments" === P || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P) ? e(M, N) : undefined;
}
}
}
}
function e(M, N) {
{
(null == N || N > M.length) && (N = M.length);
for (var O = 0, P = Array(N); O < N; O++) {
P[O] = M[O];
}
return P;
}
}
function f() {
"use strict";
var M = {
QnXBi: "siuUS",
BMbTX: " API请求失败请检查网路重试",
yIWXy: function (ao) {
return ao();
},
SFGAc: function (ao, ap) {
return ao !== ap;
},
EyfHX: "IWsBK",
jgquk: "root",
XjbCO: "JPAjq",
wvZmc: function (ao, ap) {
return ao === ap;
},
BjPYU: "Map",
wOYds: "Set",
wYByX: "fcvbA",
GscAy: function (ao, ap) {
return ao instanceof ap;
},
fSPJd: function (ao, ap, aq, ar) {
return ao(ap, aq, ar);
},
wIPSs: "_invoke",
bjNLx: function (ao, ap) {
return ao < ap;
},
UcVEQ: function (ao, ap) {
return ao(ap);
},
ryavL: function (ao, ap) {
return ao === ap;
},
zjgrg: function (ao, ap) {
return ao === ap;
},
VmaPw: "continue",
cfsCC: "return",
UuXGN: "normal",
sjIMf: function (ao, ap) {
return ao !== ap;
},
gXpkf: "qKuvm",
XRMcN: "HDwzT",
TlDNx: "cjVQN",
aOCtZ: "ZqhRb",
gQMDC: "BCgfn",
CyEXo: "FhUoY",
pxdzf: "throw",
pRXRA: "kTomk",
hEdkE: function (ao, ap, aq, ar) {
return ao(ap, aq, ar);
},
oSjQx: function (ao, ap) {
return ao === ap;
},
fDanI: "wQBRm",
WQLyR: function (ao, ap) {
return ao == ap;
},
uRqPE: "object",
Xmoxs: "jBhYB",
NwpXe: "VvGHo",
ZsQYq: function (ao, ap, aq, ar, as) {
return ao(ap, aq, ar, as);
},
yxOIE: "FjUBi",
IUxee: "function",
SbaaX: function (ao, ap) {
return ao(ap);
},
rGZrg: " is not iterable",
KscbN: "AhgRh",
LMoYp: "NPLyP",
OKJyJ: function (ao) {
return ao();
},
iKAJY: "JXvRe",
pfEaw: "wNEmk",
dxtMq: function (ao) {
return ao();
},
DqdpF: function (ao, ap) {
return ao === ap;
},
oFwRi: function (ao, ap) {
return ao(ap);
},
iRgTS: "hHgGJ",
MGfDk: "Generator is already running",
CoOJF: function (ao, ap) {
return ao === ap;
},
rJKmW: "XLOiu",
aGmip: function (ao, ap, aq) {
return ao(ap, aq);
},
SHphR: "TsLsA",
CAeWh: "next",
uSRUH: function (ao, ap) {
return ao === ap;
},
QSSFG: "ROvaY",
rdskg: "BSoXn",
eOKCU: function (ao, ap, aq, ar) {
return ao(ap, aq, ar);
},
SlusR: function (ao, ap) {
return ao === ap;
},
Iawzd: "ykxiQ",
jPXBn: function (ao, ap) {
return ao === ap;
},
jYEiQ: "qvEbD",
dNHQQ: "OstlY",
aPeZa: "(((.+)+)+)+$",
GMdRg: "HIkJa",
MMUnJ: function (ao, ap) {
return ao === ap;
},
WBvop: "RZIqy",
JfrTv: "cSKtd",
blFzl: function (ao) {
return ao();
},
OMTHJ: function (ao, ap) {
return ao + ap;
},
eIFdF: "iterator result is not an object",
Bnafv: function (ao, ap) {
return ao == ap;
},
FkqLp: function (ao, ap) {
return ao(ap);
},
tgSKW: "QmaSX",
fntXM: "Jodob",
cSGGF: "KMCLl",
fYXig: function (ao, ap) {
return ao(ap);
},
NkxwG: function (ao, ap) {
return ao !== ap;
},
nIwCR: "UUWVw",
MYlIB: function (ao, ap) {
return ao < ap;
},
nYfrf: "IWRQj",
AJkGZ: "wwqah",
PKgoT: "商品:",
tkWWS: " + ¥",
FjZdV: function (ao, ap) {
return ao / ap;
},
WJtFS: function (ao) {
return ao();
},
nElSJ: "end",
zwnWG: "uAhEk",
jhTkH: function (ao, ap) {
return ao === ap;
},
ffXmX: "uxxgR",
qbReo: "ExuIi",
miDVh: "vSyLh",
TKSXp: function (ao, ap) {
return ao(ap);
},
AIbwX: "uqnbD",
lrmhJ: "Utils_Code",
MgroK: "✅ Utils加载成功, 请继续",
SvCtY: function (ao, ap) {
return ao - ap;
},
ftFFI: function (ao, ap) {
return ao === ap;
},
LIMCf: "catchLoc",
vRubL: "finallyLoc",
BjGbw: function (ao, ap) {
return ao && ap;
},
IqQMP: function (ao, ap) {
return ao < ap;
},
hgYYi: function (ao, ap, aq) {
return ao(ap, aq);
},
xxLer: "try statement without catch or finally",
THKXV: function (ao, ap) {
return ao < ap;
},
BIcug: function (ao, ap) {
return ao(ap);
},
OxnSE: function (ao, ap) {
return ao === ap;
},
QjXYr: "wUtjJ",
VOWkX: function (ao, ap) {
return ao >= ap;
},
hzlvr: "GASbi",
UStdb: "BJhrQ",
XJYec: "qczrC",
NHaZE: function (ao, ap) {
return ao === ap;
},
zIuig: "nDwqy",
sdFYF: function (ao, ap) {
return ao(ap);
},
oaYJK: "illegal catch attempt"
};
f = function () {
return T;
};
var Q;
var T = {};
var U = Object.prototype;
var V = U.hasOwnProperty;
var W = Object.defineProperty || function (ao, ap, aq) {
{
ao[ap] = aq.value;
}
};
var X = "function" == typeof Symbol ? Symbol : {};
var Y = X.iterator || "@@iterator";
var Z = X.asyncIterator || "@@asyncIterator";
var a0 = X.toStringTag || "@@toStringTag";
function a1(ao, ap, aq) {
{
var as = {
value: aq,
enumerable: true,
configurable: true,
writable: true
};
Object.defineProperty(ao, ap, as);
return ao[ap];
}
}
try {
a1({}, "");
} catch (ap) {
{
a1 = function (ar, as, at) {
return ar[as] = at;
};
}
}
function a2(ar, as, at, au) {
{
var aw = as && as.prototype instanceof a9 ? as : a9;
var ax = Object.create(aw.prototype);
var ay = new am(au || []);
W(ax, "_invoke", {
value: ai(ar, at, ay)
});
return ax;
}
}
function a3(ar, as, at) {
{
try {
return {
type: "normal",
arg: ar.call(as, at)
};
} catch (aw) {
{
var au = {
type: "throw",
arg: aw
};
return au;
}
}
}
}
T.wrap = a2;
var a4 = "suspendedStart";
var a5 = "suspendedYield";
var a6 = "executing";
var a7 = "completed";
var a8 = {};
function a9() {}
function aa() {}
function ab() {}
var ac = {};
a1(ac, Y, function () {
return this;
});
var ad = Object.getPrototypeOf;
var ae = ad && ad(ad(an([])));
ae && ae !== U && V.call(ae, Y) && (ac = ae);
ab.prototype = a9.prototype = Object.create(ac);
var af = ab.prototype;
function ag(ar) {
{
["next", "throw", "return"].forEach(function (at) {
{
a1(ar, at, function (aw) {
{
return this._invoke(at, aw);
}
});
}
});
}
}
function ah(ar, as) {
{
function aw(ax, ay, az, aA) {
{
var aC = a3(ar[ax], ar, ay);
if ("throw" !== aC.type) {
{
var aD = aC.arg;
var aE = aD.value;
return aE && "object" == b(aE) && V.call(aE, "__await") ? as.resolve(aE.__await).then(function (aG) {
{
aw("next", aG, az, aA);
}
}, function (aG) {
{
aw("throw", aG, az, aA);
}
}) : as.resolve(aE).then(function (aG) {
{
aD.value = aG;
az(aD);
}
}, function (aG) {
{
return aw("throw", aG, az, aA);
}
});
}
}
aA(aC.arg);
}
}
var au;
W(this, "_invoke", {
value: function (ax, ay) {
{
function aA() {
{
return new as(function (aD, aE) {
{
aw(ax, ay, aD, aE);
}
});
}
}
return au = au ? au.then(aA, aA) : aA();
}
}
});
}
}
function ai(ar, as, at) {
{
var av = a4;
return function (ax, ay) {
{
if (av === a6) {
throw Error("Generator is already running");
}
if (av === a7) {
{
if ("throw" === ax) {
throw ay;
}
var aA = {
value: Q,
done: true
};
return aA;
}
}
for (at.method = ax, at.arg = ay;;) {
{
var aB = at.delegate;
if (aB) {
{
var aC = aj(aB, at);
if (aC) {
{
if (aC === a8) {
continue;
}
return aC;
}
}
}
}
if ("next" === at.method) {
at.sent = at._sent = at.arg;
} else {
if ("throw" === at.method) {
{
if (av === a4) {
throw av = a7, at.arg;
}
at.dispatchException(at.arg);
}
} else {
"return" === at.method && at.abrupt("return", at.arg);
}
}
av = a6;
var aD = a3(ar, as, at);
if ("normal" === aD.type) {
{
if (av = at.done ? a7 : a5, aD.arg === a8) {
continue;
}
var aE = {
value: aD.arg,
done: at.done
};
return aE;
}
}
"throw" === aD.type && (av = a7, at.method = "throw", at.arg = aD.arg);
}
}
}
};
}
}
function aj(ar, as) {
{
var ax = as.method;
var ay = ar.iterator[ax];
if (ay === Q) {
as.delegate = null;
"throw" === ax && ar.iterator.return && (as.method = "return", as.arg = Q, aj(ar, as), "throw" === as.method) || "return" !== ax && (as.method = "throw", as.arg = new TypeError("The iterator does not provide a '" + ax + "' method"));
return a8;
}
var aw = a3(ay, ar.iterator, as.arg);
if ("throw" === aw.type) {
as.method = "throw";
as.arg = aw.arg;
as.delegate = null;
return a8;
}
var av = aw.arg;
return av ? av.done ? (as[ar.resultName] = av.value, as.next = ar.nextLoc, "return" !== as.method && (as.method = "next", as.arg = Q), as.delegate = null, a8) : av : (as.method = "throw", as.arg = new TypeError("iterator result is not an object"), as.delegate = null, a8);
}
}
function ak(ar) {
{
var at = {
tryLoc: ar[0]
};
1 in ar && (at.catchLoc = ar[1]);
2 in ar && (at.finallyLoc = ar[2], at.afterLoc = ar[3]);
this.tryEntries.push(at);
}
}
function al(ar) {
{
var at = ar.completion || {};
at.type = "normal";
delete at.arg;
ar.completion = at;
}
}
function am(ar) {
{
var as = {
tryLoc: "root"
};
this.tryEntries = [as];
ar.forEach(ak, this);
this.reset(true);
}
}
function an(ar) {
{
if (ar || "" === ar) {
{
var at = ar[Y];
if (at) {
return at.call(ar);
}
if ("function" == typeof ar.next) {
return ar;
}
if (!isNaN(ar.length)) {
{
var au = -1;
var av = function ax() {
{
for (; ++au < ar.length;) {
if (V.call(ar, au)) {
ax.value = ar[au];
ax.done = false;
return ax;
}
}
ax.value = Q;
ax.done = true;
return ax;
}
};
return av.next = av;
}
}
}
}
throw new TypeError(b(ar) + " is not iterable");
}
}
aa.prototype = ab;
W(af, "constructor", {
value: ab,
configurable: true
});
W(ab, "constructor", {
value: aa,
configurable: true
});
aa.displayName = a1(ab, a0, "GeneratorFunction");
T.isGeneratorFunction = function (ar) {
{
var at = "function" == typeof ar && ar.constructor;
return !!at && (at === aa || "GeneratorFunction" === (at.displayName || at.name));
}
};
T.mark = function (ar) {
Object.setPrototypeOf ? Object.setPrototypeOf(ar, ab) : (ar.__proto__ = ab, a1(ar, a0, "GeneratorFunction"));
ar.prototype = Object.create(af);
return ar;
};
T.awrap = function (ar) {
{
var as = {
__await: ar
};
return as;
}
};
ag(ah.prototype);
a1(ah.prototype, Z, function () {
{
return this;
}
});
T.AsyncIterator = ah;
T.async = function (ar, as, at, au, av) {
{
undefined === av && (av = Promise);
var ax = new ah(a2(ar, as, at, au), av);
return T.isGeneratorFunction(as) ? ax : ax.next().then(function (az) {
{
return az.done ? az.value : ax.next();
}
});
}
};
ag(af);
a1(af, a0, "Generator");
a1(af, Y, function () {
{
return this;
}
});
a1(af, "toString", function () {
{
return "[object Generator]";
}
});
T.keys = function (ar) {
{
var as = Object(ar);
var at = [];
for (var au in as) at.push(au);
at.reverse();
return function aw() {
{
for (; at.length;) {
{
var ay = at.pop();
if (ay in as) {
aw.value = ay;
aw.done = false;
return aw;
}
}
}
aw.done = true;
return aw;
}
};
}
};
T.values = an;
am.prototype = {
constructor: am,
reset: function (ar) {
{
if (this.prev = 0, this.next = 0, this.sent = this._sent = Q, this.done = false, this.delegate = null, this.method = "next", this.arg = Q, this.tryEntries.forEach(al), !ar) {
for (var au in this) "t" === au.charAt(0) && V.call(this, au) && !isNaN(+au.slice(1)) && (this[au] = Q);
}
}
},
stop: function () {
{
this.done = true;
var ar = this.tryEntries[0].completion;
if ("throw" === ar.type) {
throw ar.arg;
}
return this.rval;
}
},
dispatchException: function (ar) {
{
if (this.done) {
throw ar;
}
var at = this;
function aA(aB, aC) {
{
aw.type = "throw";
aw.arg = ar;
at.next = aB;
aC && (at.method = "next", at.arg = Q);
return !!aC;
}
}
for (var au = this.tryEntries.length - 1; au >= 0; --au) {
{
var av = this.tryEntries[au];
var aw = av.completion;
if ("root" === av.tryLoc) {
return aA("end");
}
if (av.tryLoc <= this.prev) {
{
var ax = V.call(av, "catchLoc");
var ay = V.call(av, "finallyLoc");
if (ax && ay) {
{
if (this.prev < av.catchLoc) {
return aA(av.catchLoc, true);
}
if (this.prev < av.finallyLoc) {
return aA(av.finallyLoc);
}
}
} else {
if (ax) {
{
if (this.prev < av.catchLoc) {
return aA(av.catchLoc, true);
}
}
} else {
{
if (!ay) {
throw Error("try statement without catch or finally");
}
if (this.prev < av.finallyLoc) {
return aA(av.finallyLoc);
}
}
}
}
}
}
}
}
}
},
abrupt: function (ar, as) {
{
for (var av = this.tryEntries.length - 1; av >= 0; --av) {
{
var aw = this.tryEntries[av];
if (aw.tryLoc <= this.prev && V.call(aw, "finallyLoc") && this.prev < aw.finallyLoc) {
{
var ax = aw;
break;
}
}
}
}
ax && ("break" === ar || "continue" === ar) && ax.tryLoc <= as && as <= ax.finallyLoc && (ax = null);
var ay = ax ? ax.completion : {};
ay.type = ar;
ay.arg = as;
return ax ? (this.method = "next", this.next = ax.finallyLoc, a8) : this.complete(ay);
}
},
complete: function (ar, as) {
{
if ("throw" === ar.type) {
throw ar.arg;
}
"break" === ar.type || "continue" === ar.type ? this.next = ar.arg : "return" === ar.type ? (this.rval = this.arg = ar.arg, this.method = "return", this.next = "end") : "normal" === ar.type && as && (this.next = as);
return a8;
}
},
finish: function (ar) {
{
for (var at = this.tryEntries.length - 1; at >= 0; --at) {
{
var au = this.tryEntries[at];
if (au.finallyLoc === ar) {
this.complete(au.completion, au.afterLoc);
al(au);
return a8;
}
}
}
}
},
catch: function (ar) {
{
for (var at = this.tryEntries.length - 1; at >= 0; --at) {
{
var au = this.tryEntries[at];
if (au.tryLoc === ar) {
{
var av = au.completion;
if ("throw" === av.type) {
{
var aw = av.arg;
al(au);
}
}
return aw;
}
}
}
}
throw Error("illegal catch attempt");
}
},
delegateYield: function (ar, as, at) {
{
this.delegate = {
iterator: an(ar),
resultName: as,
nextLoc: at
};
"next" === this.method && (this.arg = Q);
return a8;
}
}
};
return T;
}
function g(M, N, O, P, Q, R, S) {
{
try {
{
var T = M[R](S);
var U = T.value;
}
} catch (X) {
{
return void O(X);
}
}
T.done ? N(U) : Promise.resolve(U).then(P, Q);
}
}
function h(M) {
return function () {
var O = this;
var P = arguments;
return new Promise(function (Q, R) {
var T = M.apply(O, P);
function U(W) {
{
g(T, Q, R, U, V, "next", W);
}
}
function V(W) {
g(T, Q, R, U, V, "throw", W);
}
U(undefined);
});
};
}
var i = ($.isNode() ? process.env.XZXXN : $.getdata("XZXXN")) || "";
var j = ($.isNode() ? process.env.XZXXNSERVER : $.getdata("XZXXNSERVER")) || "https://dalaoshi.xn--ug8h.eu.org";
var k = ($.isNode() ? process.env.YOUZAN : $.getdata("YOUZAN")) || "";
var l = ($.isNode() ? process.env.CAPTCHA_SERVER : $.getdata("CAPTCHA_SERVER")) || "https://captcha.fuckinghigh.eu.org";
var m = ($.isNode() ? process.env.GHPROXYURL : $.getdata("GHPROXYURL")) || "https://ghfast.top";
var n;
var o;
var p;
var q;
var r;
var s = "";
var u = ($.isNode() ? process.env.YOUZAN_QueryProduct : $.getdata("YOUZAN_QueryProduct")) || false;
var v = ["checkinId=12063&kdt_id=18739377", "checkinId=2162835&kdt_id=44877243", "checkinId=99&kdt_id=41067901", "checkinId=3520910&kdt_id=129380009", "checkinId=2923467&kdt_id=109809208", "checkinId=2910869&kdt_id=43958855", "checkinId=2386563&kdt_id=42213767", "checkinId=1597464&kdt_id=100464643", "checkinId=3347128&kdt_id=117130552", "checkinId=2299510&kdt_id=107786737", "checkinId=18415&kdt_id=44694253", "checkinId=3549859&kdt_id=130177909", "checkinId=1820214&kdt_id=93457151", "checkinId=3997371&kdt_id=105036832", "checkinId=4804346&kdt_id=121810522", "checkinId=4296415&kdt_id=146288343", "checkinId=4806300&kdt_id=139827364", "checkinId=13736&kdt_id=16365465", "checkinId=9975&kdt_id=77770507", "checkinId=24630&kdt_id=43183730", "checkinId=3721624&kdt_id=96543670", "checkinId=3800805&kdt_id=113745713", "checkinId=5428477&kdt_id=179778907", "checkinId=2947047&kdt_id=77093133", "checkinId=2682116&kdt_id=44519665"];
function w() {
{
return x.apply(this, arguments);
}
}
function x() {
x = h(f().mark(function O() {
{
var Q;
var R;
var S;
var T;
var U;
var V;
var W;
var X;
var Y;
var Z;
var a0;
var a1;
var a2;
var a3;
var a4;
var a5;
var a6;
var a7;
var a8;
return f().wrap(function (a9) {
{
for (;;) {
switch (a9.prev = a9.next) {
case 0:
if (k) {
{
a9.next = 5;
break;
}
}
console.log("先填写账号token");
a9.next = 4;
return K("先填写账号token");
case 4:
return a9.abrupt("return");
case 5:
a9.next = 7;
return G();
case 7:
Utils = a9.sent;
r = Utils.createCryptoJS();
Q = k.split(" ");
R = c(Q);
a9.prev = 11;
R.s();
case 13:
if ((S = R.n()).done) {
{
a9.next = 94;
break;
}
}
T = S.value;
a9.prev = 15;
p = T.split("&")[0];
q = T.split("&")[1];
console.log("用户:".concat(p, "开始签到"));
a9.next = 21;
return E({
token: i,
type: "YOUZAN",
userId: p
});
case 21:
if (U = a9.sent, 200 == (null == U ? undefined : U.code)) {
{
a9.next = 25;
break;
}
}
console.log(null == U ? undefined : U.msg);
return a9.abrupt("continue", 92);
case 25:
o = r.enc.Utf8.parse("youzan.com._key_");
n = r.enc.Utf8.parse("youzan.com.aesiv");
a9.next = 29;
return A("https://passport.youzan.com/api/login/password.json", {
countryCode: "+86",
mobile: p,
password: D(q),
passwordLevel: C(q),
passwordLength: q.length
});
case 29:
if (V = a9.sent, console.log(V.msg), 40000310 != V.code) {
{
a9.next = 46;
break;
}
}
a9.next = 34;
return y("".concat(l, "/captcha?aidEncrypted=").concat(V.data.decisionData.aidEncrypted));
case 34:
if (W = a9.sent, W) {
{
a9.next = 37;
break;
}
}
return a9.abrupt("continue", 92);
case 37:
console.log(W);
a9.next = 40;
return A("https://passport.youzan.com/api/login/password.json", {
countryCode: "+86",
mobile: p,
password: D(q),
passwordLevel: C(q),
passwordLength: q.length,
behavior: {
decisionCode: "TENCENT_LOW_RISK",
verifyResult: {
code: 0,
data: {
appid: V.data.decisionData.captchaAppId,
ret: 0,
ticket: W.ticket,
randstr: W.randstr,
verifyDuration: W.verifyDuration,
actionDuration: W.actionDuration,
sid: W.sid
}
}
}
});
case 40:
if (V = a9.sent, console.log(V.msg), 0 == V.code) {
a9.next = 46;
break;
}
a9.next = 45;
return K("用户:".concat(p, " 登录失败:").concat(V.msg));
case 45:
return a9.abrupt("continue", 92);
case 46:
X = c(v);
a9.prev = 47;
X.s();
case 49:
if ((Y = X.n()).done) {
{
a9.next = 77;
break;
}
}
Z = Y.value;
a9.next = 53;
return y("https://h5.youzan.com/wscshopcore/extension/shop-info.json?".concat(Z));
case 53:
a0 = a9.sent;
console.log("店铺: ".concat(a0.data.shop.shopName, " id").concat(Z));
a9.next = 57;
return y("https://h5.youzan.com/wscump/checkin/checkinV2.json?".concat(Z));
case 57:
a1 = a9.sent;
console.log("签到结果:" + a1.msg);
a9.next = 61;
return $.wait(2000);
case 61:
a9.next = 63;
return y("https://h5.youzan.com/wscuser/membercenter/pointsName.json?".concat(Z));
case 63:
a2 = a9.sent;
a9.next = 66;
return y("https://h5.youzan.com/wscuser/membercenter/stats.json?".concat(Z));
case 66:
if (a3 = a9.sent, console.log("拥有".concat(a2.data.pointsName, "").concat(a3.data.stats.points)), !u) {
{
a9.next = 74;
break;
}
}
a9.next = 71;
return y("https://h5.youzan.com/wscump/pointstore/listPointGoods.json?page_size=1000");
case 71:
a4 = a9.sent;
a5 = c(a4.data.items);
try {
{
for (a5.s(); !(a6 = a5.n()).done;) {
a7 = a6.value;
a8 = a7.couponGroupInfoDTO.groupName || a7.generalGoodsInfoDTO.generalGoodsTitle;
console.log("商品:".concat(a8, " 库存:").concat(a7.pointGoodsStockDTO.availableStock, " 需要").concat(a2.data.pointsName, "").concat(a7.pointGoodsExchangePriceDTO.points, " + ¥").concat(a7.pointGoodsExchangePriceDTO.cash / 100));
}
}
} catch (al) {
a5.e(al);
} finally {
{
a5.f();
}
}
case 74:
console.log("\n");
case 75:
a9.next = 49;
break;
case 77:
a9.next = 82;
break;
case 79:
a9.prev = 79;
a9.t0 = a9.catch(47);
X.e(a9.t0);
case 82:
a9.prev = 82;
X.f();
return a9.finish(82);
case 85:
console.log("用户:".concat(p, "签到结束\n"));
s += "用户:".concat(p, " 签到已完成\n");
a9.next = 92;
break;
case 89:
a9.prev = 89;
a9.t1 = a9.catch(15);
console.log(a9.t1);
case 92:
a9.next = 13;
break;
case 94:
a9.next = 99;
break;
case 96:
a9.prev = 96;
a9.t2 = a9.catch(11);
R.e(a9.t2);
case 99:
a9.prev = 99;
R.f();
return a9.finish(99);
case 102:
if (!s) {
{
a9.next = 105;
break;
}
}
a9.next = 105;
return K(s);
case 105:
case "end":
return a9.stop();
}
}
}
}, O, null, [[11, 96, 99, 102], [15, 89], [47, 79, 82, 85]]);
}
}));
return x.apply(this, arguments);
}
function y(M) {
{
return z.apply(this, arguments);
}
}
function z() {
z = h(f().mark(function N(O) {
return f().wrap(function (Q) {
var R = {
veKIm: function (S, T) {
return S !== T;
},
dJsiQ: function (S, T) {
return S == T;
},
HYGlX: "function",
oPHfU: function (S, T) {
return S === T;
},
karBC: function (S, T) {
return S === T;
},
QuSXf: function (S, T) {
return S < T;
},
JIWpQ: "uHXFd",
FbDPF: " API请求失败请检查网路重试",
uvJyl: "elNRL",
GMhnD: "ibHij",
suXAP: function (S) {
return S();
},
lPdwm: function (S, T, U, V, W, X, Y, Z) {
return S(T, U, V, W, X, Y, Z);
},
ghzDj: "HAKfZ",
fYfvv: function (S, T) {
return S !== T;
},
FpcJK: "rWvLP",
YNkfh: function (S, T) {
return S(T);
},
JnuYY: function (S) {
return S();
}
};
for (;;) {
switch (Q.prev = Q.next) {
case 0:
return Q.abrupt("return", new Promise(function (S) {
var T = {
nVYUG: function (V, W) {
return V !== W;
},
qNOyZ: "JtfZX",
nsQMN: function (V, W) {
return V == W;
},
ugAxI: "function",
gauPM: function (V, W) {
return V === W;
},
PqfFA: function (V, W) {
return V === W;
},
cnior: "GeneratorFunction",
FaaTV: function (V, W) {
return V < W;
},
AOfxe: "FgJZD",
LAsAI: "uHXFd",
IWjeW: " API请求失败请检查网路重试",
avhFj: "elNRL",
Kfbqo: "ibHij",
jvsTc: function (V) {
return V();
},
afdio: function (V, W, X, Y, Z, a0, a1, a2) {
return V(W, X, Y, Z, a0, a1, a2);
},
HzdVR: "HAKfZ",
XpLEL: function (V, W) {
return V(W);
},
POJAA: function (V, W) {
return V !== W;
},
WgPBG: "rWvLP",
dPWbm: function (V, W) {
return V(W);
},
LDyEj: function (V) {
return V();
}
};
var U = {
url: "".concat(O),
headers: {}
};
$.get(U, function () {
var V = {
gejBn: function (X, Y) {
return X < Y;
},
DdKWN: function (X, Y) {
return X === Y;
},
iLrDz: "FgJZD",
ovwkT: "uHXFd",
GYhAp: " API请求失败请检查网路重试",
hETBK: function (X, Y) {
return X === Y;
},
TjZGa: "elNRL",
PbRNt: function (X, Y) {
return X === Y;
},
fwVVf: "NJHpu",
jVvsH: "ibHij",
xWEle: function (X) {
return X();
},
HGXcW: "end",
wIDGs: function (X, Y, Z, a0, a1, a2, a3, a4) {
return X(Y, Z, a0, a1, a2, a3, a4);
},
WioMD: "HAKfZ",
QWXQL: function (X, Y) {
return X(Y);
}
};
{
var W = h(f().mark(function X(Y, Z, a0) {
{
return f().wrap(function (a2) {
{
for (;;) {
switch (a2.prev = a2.next) {
case 0:
try {
Y ? (console.log("".concat(JSON.stringify(Y))), console.log("".concat($.name, " API请求失败请检查网路重试"))) : S(JSON.parse(a0));
} catch (a6) {
{
$.logErr(a6, Z);
}
} finally {
{
S();
}
}
case 1:
case "end":
return a2.stop();
}
}
}
}, X);
}
}));
return function (Y, Z, a0) {
{
return W.apply(this, arguments);
}
};
}
}());
}));
case 1:
case "end":
return Q.stop();
}
}
}, N);
}));
return z.apply(this, arguments);
}
function A(M, N) {
return B.apply(this, arguments);
}
function B() {
B = h(f().mark(function N(O, P) {
return f().wrap(function (R) {
for (;;) {
switch (R.prev = R.next) {
case 0:
return R.abrupt("return", new Promise(function (S) {
var U = {
"content-type": "application/json"
};
var V = {
url: "".concat(O),
headers: U,
body: JSON.stringify(P)
};
$.post(V, function () {
var W = h(f().mark(function X(Y, Z, a0) {
return f().wrap(function (a2) {
for (;;) {
switch (a2.prev = a2.next) {
case 0:
try {
Y ? (console.log("".concat(JSON.stringify(Y))), console.log("".concat($.name, " API请求失败请检查网路重试"))) : S(JSON.parse(a0));
} catch (a3) {
$.logErr(a3, Z);
} finally {
S();
}
case 1:
case "end":
return a2.stop();
}
}
}, X);
}));
return function (Y, Z, a0) {
return W.apply(this, arguments);
};
}());
}));
case 1:
case "end":
return R.stop();
}
}
}, N);
}));
return B.apply(this, arguments);
}
function C(M) {
var N = -1;
/\d+/.test(M) && N++;
/[a-zA-Z]+/.test(M) && N++;
/[^A-Za-z0-9]+/.test(M) && N++;
return N;
}
function D(M) {
var N = r.enc.Utf8.parse(M);
var O = r.AES.encrypt(N, o, {
mode: r.mode.CBC,
padding: r.pad.Pkcs7,
iv: n
});
return O.toString();
}
function E(M) {
return F.apply(this, arguments);
}
function F() {
F = h(f().mark(function N(O) {
return f().wrap(function (Q) {
for (;;) {
switch (Q.prev = Q.next) {
case 0:
return Q.abrupt("return", new Promise(function (S) {
var U = {
"Content-Type": "application/json"
};
var V = {
url: "".concat(j, "/token/verify"),
headers: U,
body: JSON.stringify(O)
};
$.post(V, function () {
var X = h(f().mark(function Y(Z, a0, a1) {
return f().wrap(function (a2) {
for (;;) {
switch (a2.prev = a2.next) {
case 0:
try {
Z ? (console.log("".concat(JSON.stringify(Z))), console.log("".concat($.name, " API请求失败请检查网路重试"))) : S(JSON.parse(a1));
} catch (a3) {
$.logErr(a3, a0);
} finally {
S();
}
case 1:
case "end":
return a2.stop();
}
}
}, Y);
}));
return function (Z, a0, a1) {
return X.apply(this, arguments);
};
}());
}));
case 1:
case "end":
return Q.stop();
}
}
}, N);
}));
return F.apply(this, arguments);
}
function G() {
return H.apply(this, arguments);
}
function H() {
H = h(f().mark(function M() {
var O;
return f().wrap(function P(Q) {
for (;;) {
switch (Q.prev = Q.next) {
case 0:
if (O = $.getdata("Utils_Code") || "", !O || !Object.keys(O).length) {
Q.next = 5;
break;
}
console.log("✅ ".concat($.name, ": 缓存中存在Utils代码, 跳过下载"));
eval(O);
return Q.abrupt("return", creatUtils());
case 5:
console.log("🚀 ".concat($.name, ": 开始下载Utils代码"));
return Q.abrupt("return", new Promise(function () {
var T = h(f().mark(function U(V) {
return f().wrap(function W(X) {
for (;;) {
switch (X.prev = X.next) {
case 0:
$.getScript("".concat(m, "/https://raw.githubusercontent.com/xzxxn777/Surge/main/Utils/Utils.js")).then(function (Z) {
$.setdata(Z, "Utils_Code");
eval(Z);
console.log("✅ Utils加载成功, 请继续");
V(creatUtils());
});
case 1:
case "end":
return X.stop();
}
}
}, U);
}));
return function (V) {
return T.apply(this, arguments);
};
}()));
case 7:
case "end":
return Q.stop();
}
}
}, M);
}));
return H.apply(this, arguments);
}
function I() {
return J.apply(this, arguments);
}
function J() {
J = h(f().mark(function N() {
return f().wrap(function (Q) {
for (;;) {
switch (Q.prev = Q.next) {
case 0:
return Q.abrupt("return", new Promise(function (S) {
var U = {
url: "https://fastly.jsdelivr.net/gh/xzxxn777/Surge@main/Utils/Notice.json"
};
$.get(U, function () {
var W = h(f().mark(function X(Y, Z, a0) {
return f().wrap(function (a1) {
for (;;) {
switch (a1.prev = a1.next) {
case 0:
try {
Y ? (console.log("".concat(JSON.stringify(Y))), console.log("".concat($.name, " API请求失败请检查网路重试"))) : console.log(JSON.parse(a0).notice);
} catch (a2) {
$.logErr(a2, Z);
} finally {
S();
}
case 1:
case "end":
return a1.stop();
}
}
}, X);
}));
return function (Y, Z, a0) {
return W.apply(this, arguments);
};
}());
}));
case 1:
case "end":
return Q.stop();
}
}
}, N);
}));
return J.apply(this, arguments);
}
function K(M) {
return L.apply(this, arguments);
}
function L() {
L = h(f().mark(function N(O) {
return f().wrap(function (R) {
for (;;) {
switch (R.prev = R.next) {
case 0:
if (!$.isNode()) {
R.next = 5;
break;
}
R.next = 3;
return notify.sendNotify($.name, O);
case 3:
R.next = 6;
break;
case 5:
$.msg($.name, "", O);
case 6:
case "end":
return R.stop();
}
}
}, N);
}));
return L.apply(this, arguments);
}
h(f().mark(function M() {
return f().wrap(function (N) {
for (;;) {
switch (N.prev = N.next) {
case 0:
N.next = 2;
return I();
case 2:
N.next = 4;
return w();
case 4:
case "end":
return N.stop();
}
}
}, M);
}))().catch(function (N) {
$.log(N);
}).finally(function () {
$.done({});
});
})();
function Env(t, e) {
class s {
constructor(t) {
this.env = t;
}
send(t, e = "GET") {
t = "string" == typeof t ? {
url: t
} : t;
let s = this.get;
"POST" === e && (s = this.post);
return new Promise((e, a) => {
s.call(this, t, (t, s, r) => {
t ? a(t) : e(s);
});
});
}
get(t) {
return this.send.call(this.env, t);
}
post(t) {
return this.send.call(this.env, t, "POST");
}
}
return new class {
constructor(t, e) {
this.name = t;
this.http = new s(this);
this.data = null;
this.dataFile = "box.dat";
this.logs = [];
this.isMute = false;
this.isNeedRewrite = false;
this.logSeparator = "\n";
this.encoding = "utf-8";
this.startTime = new Date().getTime();
Object.assign(this, e);
this.log("", `🔔${this.name}, 开始!`);
}
getEnv() {
return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : undefined;
}
isNode() {
return "Node.js" === this.getEnv();
}
isQuanX() {
return "Quantumult X" === this.getEnv();
}
isSurge() {
return "Surge" === this.getEnv();
}
isLoon() {
return "Loon" === this.getEnv();
}
isShadowrocket() {
return "Shadowrocket" === this.getEnv();
}
isStash() {
return "Stash" === this.getEnv();
}
toObj(t, e = null) {
try {
return JSON.parse(t);
} catch {
return e;
}
}
toStr(t, e = null) {
try {
return JSON.stringify(t);
} catch {
return e;
}
}
getjson(t, e) {
let s = e;
const a = this.getdata(t);
if (a) {
try {
s = JSON.parse(this.getdata(t));
} catch {}
}
return s;
}
setjson(t, e) {
try {
return this.setdata(JSON.stringify(t), e);
} catch {
return false;
}
}
getScript(t) {
return new Promise(e => {
this.get({
url: t
}, (t, s, a) => e(a));
});
}
runScript(t, e) {
return new Promise(s => {
let a = this.getdata("@chavy_boxjs_userCfgs.httpapi");
a = a ? a.replace(/\n/g, "").trim() : a;
let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");
r = r ? 1 * r : 20;
r = e && e.timeout ? e.timeout : r;
const [i, o] = a.split("@");
const n = {
url: `http://${o}/v1/scripting/evaluate`,
body: {
script_text: t,
mock_type: "cron",
timeout: r
},
headers: {
"X-Key": i,
Accept: "*/*"
},
timeout: r
};
this.post(n, (t, e, a) => s(a));
}).catch(t => this.logErr(t));
}
loaddata() {
if (!this.isNode()) {
return {};
}
{
this.fs = this.fs ? this.fs : require("fs");
this.path = this.path ? this.path : require("path");
const t = this.path.resolve(this.dataFile);
const e = this.path.resolve(process.cwd(), this.dataFile);
const s = this.fs.existsSync(t);
const a = !s && this.fs.existsSync(e);
if (!s && !a) {
return {};
}
{
const a = s ? t : e;
try {
return JSON.parse(this.fs.readFileSync(a));
} catch (t) {
return {};
}
}
}
}
writedata() {
if (this.isNode()) {
this.fs = this.fs ? this.fs : require("fs");
this.path = this.path ? this.path : require("path");
const t = this.path.resolve(this.dataFile);
const e = this.path.resolve(process.cwd(), this.dataFile);
const s = this.fs.existsSync(t);
const a = !s && this.fs.existsSync(e);
const r = JSON.stringify(this.data);
s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r);
}
}
lodash_get(t, e, s) {
const a = e.replace(/\[(\d+)\]/g, ".$1").split(".");
let r = t;
for (const t of a) if (r = Object(r)[t], undefined === r) {
return s;
}
return r;
}
lodash_set(t, e, s) {
return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, a) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}, t)[e[e.length - 1]] = s, t);
}
getdata(t) {
let e = this.getval(t);
if (/^@/.test(t)) {
const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t);
const r = s ? this.getval(s) : "";
if (r) {
try {
const t = JSON.parse(r);
e = t ? this.lodash_get(t, a, "") : e;
} catch (t) {
e = "";
}
}
}
return e;
}
setdata(t, e) {
let s = false;
if (/^@/.test(e)) {
const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e);
const i = this.getval(a);
const o = a ? "null" === i ? null : i || "{}" : "{}";
try {
const e = JSON.parse(o);
this.lodash_set(e, r, t);
s = this.setval(JSON.stringify(e), a);
} catch (e) {
const i = {};
this.lodash_set(i, r, t);
s = this.setval(JSON.stringify(i), a);
}
} else {
s = this.setval(t, e);
}
return s;
}
getval(t) {
switch (this.getEnv()) {
case "Surge":
case "Loon":
case "Stash":
case "Shadowrocket":
return $persistentStore.read(t);
case "Quantumult X":
return $prefs.valueForKey(t);
case "Node.js":
this.data = this.loaddata();
return this.data[t];
default:
return this.data && this.data[t] || null;
}
}
setval(t, e) {
switch (this.getEnv()) {
case "Surge":
case "Loon":
case "Stash":
case "Shadowrocket":
return $persistentStore.write(t, e);
case "Quantumult X":
return $prefs.setValueForKey(t, e);
case "Node.js":
this.data = this.loaddata();
this.data[e] = t;
this.writedata();
return true;
default:
return this.data && this.data[e] || null;
}
}
initGotEnv(t) {
this.got = this.got ? this.got : require("got");
this.cktough = this.cktough ? this.cktough : require("tough-cookie");
this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar();
t && (t.headers = t.headers ? t.headers : {}, undefined === t.headers.Cookie && undefined === t.cookieJar && (t.cookieJar = this.ckjar));
}
get(t, e = () => {}) {
switch (t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), t.params && (t.url += "?" + this.queryStr(t.params)), this.getEnv()) {
case "Surge":
case "Loon":
case "Stash":
case "Shadowrocket":
default:
this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
"X-Surge-Skip-Scripting": false
}));
$httpClient.get(t, (t, s, a) => {
!t && s && (s.body = a, s.statusCode = s.status ? s.status : s.statusCode, s.status = s.statusCode);
e(t, s, a);
});
break;
case "Quantumult X":
this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
hints: false
}));
$task.fetch(t).then(t => {
const {
statusCode: s,
statusCode: a,
headers: r,
body: i,
bodyBytes: o
} = t;
e(null, {
status: s,
statusCode: a,
headers: r,
body: i,
bodyBytes: o
}, i, o);
}, t => e(t && t.error || "UndefinedError"));
break;
case "Node.js":
let s = require("iconv-lite");
this.initGotEnv(t);
this.got(t).on("redirect", (t, e) => {
try {
if (t.headers["set-cookie"]) {
const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
s && this.ckjar.setCookieSync(s, null);
e.cookieJar = this.ckjar;
}
} catch (t) {
this.logErr(t);
}
}).then(t => {
const {
statusCode: a,
statusCode: r,
headers: i,
rawBody: o
} = t;
const n = s.decode(o, this.encoding);
e(null, {
status: a,
statusCode: r,
headers: i,
rawBody: o,
body: n
}, n);
}, t => {
const {
message: a,
response: r
} = t;
e(a, r, r && s.decode(r.rawBody, this.encoding));
});
}
}
post(t, e = () => {}) {
const s = t.method ? t.method.toLocaleLowerCase() : "post";
switch (t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv()) {
case "Surge":
case "Loon":
case "Stash":
case "Shadowrocket":
default:
this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {
"X-Surge-Skip-Scripting": false
}));
$httpClient[s](t, (t, s, a) => {
!t && s && (s.body = a, s.statusCode = s.status ? s.status : s.statusCode, s.status = s.statusCode);
e(t, s, a);
});
break;
case "Quantumult X":
t.method = s;
this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {
hints: false
}));
$task.fetch(t).then(t => {
const {
statusCode: s,
statusCode: a,
headers: r,
body: i,
bodyBytes: o
} = t;
e(null, {
status: s,
statusCode: a,
headers: r,
body: i,
bodyBytes: o
}, i, o);
}, t => e(t && t.error || "UndefinedError"));
break;
case "Node.js":
let a = require("iconv-lite");
this.initGotEnv(t);
const {
url: r,
...i
} = t;
this.got[s](r, i).then(t => {
const {
statusCode: s,
statusCode: r,
headers: i,
rawBody: o
} = t;
const n = a.decode(o, this.encoding);
e(null, {
status: s,
statusCode: r,
headers: i,
rawBody: o,
body: n
}, n);
}, t => {
const {
message: s,
response: r
} = t;
e(s, r, r && a.decode(r.rawBody, this.encoding));
});
}
}
time(t, e = null) {
const s = e ? new Date(e) : new Date();
let a = {
"M+": s.getMonth() + 1,
"d+": s.getDate(),
"H+": s.getHours(),
"m+": s.getMinutes(),
"s+": s.getSeconds(),
"q+": Math.floor((s.getMonth() + 3) / 3),
S: s.getMilliseconds()
};
/(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let e in a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length)));
return t;
}
queryStr(t) {
let e = "";
for (const s in t) {
let a = t[s];
null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), e += `${s}=${a}&`);
}
e = e.substring(0, e.length - 1);
return e;
}
msg(e = t, s = "", a = "", r) {
const i = t => {
switch (typeof t) {
case undefined:
return t;
case "string":
switch (this.getEnv()) {
case "Surge":
case "Stash":
default:
return {
url: t
};
case "Loon":
case "Shadowrocket":
return t;
case "Quantumult X":
return {
"open-url": t
};
case "Node.js":
return;
}
case "object":
switch (this.getEnv()) {
case "Surge":
case "Stash":
case "Shadowrocket":
default:
{
let e = t.url || t.openUrl || t["open-url"];
return {
url: e
};
}
case "Loon":
{
let e = t.openUrl || t.url || t["open-url"];
let s = t.mediaUrl || t["media-url"];
return {
openUrl: e,
mediaUrl: s
};
}
case "Quantumult X":
{
let e = t["open-url"] || t.url || t.openUrl;
let s = t["media-url"] || t.mediaUrl;
let a = t["update-pasteboard"] || t.updatePasteboard;
return {
"open-url": e,
"media-url": s,
"update-pasteboard": a
};
}
case "Node.js":
return;
}
default:
return;
}
};
if (!this.isMute) {
switch (this.getEnv()) {
case "Surge":
case "Loon":
case "Stash":
case "Shadowrocket":
default:
$notification.post(e, s, a, i(r));
break;
case "Quantumult X":
$notify(e, s, a, i(r));
break;
case "Node.js":
}
}
if (!this.isMuteLog) {
let t = ["", "==============📣系统通知📣=============="];
t.push(e);
s && t.push(s);
a && t.push(a);
console.log(t.join("\n"));
this.logs = this.logs.concat(t);
}
}
log(...t) {
t.length > 0 && (this.logs = [...this.logs, ...t]);
console.log(t.join(this.logSeparator));
}
logErr(t, e) {
switch (this.getEnv()) {
case "Surge":
case "Loon":
case "Stash":
case "Shadowrocket":
case "Quantumult X":
default:
this.log("", `❗️${this.name}, 错误!`, t);
break;
case "Node.js":
this.log("", `❗️${this.name}, 错误!`, t.stack);
}
}
wait(t) {
return new Promise(e => setTimeout(e, t));
}
done(t = {}) {
const e = new Date().getTime();
const s = (e - this.startTime) / 1000;
switch (this.log("", `🔔${this.name}, 结束! 🕛 ${s}`), this.log(), this.getEnv()) {
case "Surge":
case "Loon":
case "Stash":
case "Shadowrocket":
case "Quantumult X":
default:
$done(t);
break;
case "Node.js":
process.exit(1);
}
}
}(t, e);
}