Files
temu-plugin/src/api/genAnti.js

1426 lines
51 KiB
JavaScript
Raw Normal View History

const genAnti = function () {
2023-08-16 18:10:50 +08:00
return function (t) {
var n = {};
function r(e) {
if (n[e])
return n[e].exports;
var i = n[e] = {
i: e,
l: !1,
exports: {}
};
return t[e].call(i.exports, i, i.exports, r),
i.l = !0,
i.exports
}
2023-08-16 18:10:50 +08:00
return r.m = t,
r.c = n,
r.d = function (t, n, e) {
r.o(t, n) || p(t, n, {
enumerable: !0,
get: e
})
},
r.r = function (t) {
void 0 !== _ && d && p(t, d, {
value: "Module"
}),
Object.defineProperty(t, "__esModule", {
value: !0
})
},
r.t = function (t, n) {
if (1 & n && (t = r(t)),
8 & n)
return t;
if (4 & n && "object" == x(t) && t && t.__esModule)
return t;
var e = l(null);
if (r.r(e),
Object.defineProperty(e, "default", {
enumerable: !0,
value: t
}),
2 & n && "string" != typeof t)
for (var i in t)
r.d(e, i, function (n) {
return t[n]
}
.bind(null, i));
return e
},
r.n = function (t) {
var n = t && t.__esModule ? function () {
return t.default
} :
function () {
return t
};
return r.d(n, "a", n),
n
},
r.o = function (t, n) {
return Object.prototype.hasOwnProperty.call(t, n)
},
r.p = "",
r(r.s = 0)
}([
function (t, e, r) {
var n = r(1), o = r.n(n), i = r(2), a = r.n(i), s = r(3);
2023-08-16 18:10:50 +08:00
function l(t, e, r, n, o, i, a) {
try {
var s = t[i](a), u = s.value
} catch (l) {
return void r(l)
}
2023-08-16 18:10:50 +08:00
s.done ? e(u) : Promise.resolve(u).then(n, o)
}
2023-08-16 18:10:50 +08:00
function c(t) {
return function () {
var e = this, r = arguments;
return new Promise((function (n, o) {
var i = t.apply(e, r);
2023-08-16 18:10:50 +08:00
function a(t) {
l(i, n, o, a, s, "next", t)
}
2023-08-16 18:10:50 +08:00
function s(t) {
l(i, n, o, a, s, "throw", t)
}
a(void 0)
}))
}
}
2023-08-16 18:10:50 +08:00
function u() {
u = function () {
return t
};
var t = {}, e = Object.prototype, r = e.hasOwnProperty, n = "function" == typeof Symbol ? Symbol : {},
o = n.iterator || "@@iterator", i = n.asyncIterator || "@@asyncIterator",
a = n.toStringTag || "@@toStringTag";
function s(t, e, r) {
return Object.defineProperty(t, e, {value: r, enumerable: !0, configurable: !0, writable: !0}), t[e]
}
try {
s({}, "")
} catch (E) {
s = function (t, e, r) {
return t[e] = r
}
2023-08-16 18:10:50 +08:00
}
function l(t, e, r, n) {
var o = e && e.prototype instanceof d ? e : d, i = Object.create(o.prototype), a = new O(n || []);
return i._invoke = function (t, e, r) {
var n = "suspendedStart";
return function (o, i) {
if ("executing" === n) throw new Error("Generator is already running");
if ("completed" === n) {
if ("throw" === o) throw i;
return k()
}
for (r.method = o, r.arg = i; ;) {
var a = r.delegate;
if (a) {
var s = x(a, r);
if (s) {
if (s === f) continue;
return s
}
}
if ("next" === r.method) r.sent = r._sent = r.arg; else if ("throw" === r.method) {
if ("suspendedStart" === n) throw n = "completed", r.arg;
r.dispatchException(r.arg)
} else "return" === r.method && r.abrupt("return", r.arg);
n = "executing";
var u = c(t, e, r);
if ("normal" === u.type) {
if (n = r.done ? "completed" : "suspendedYield", u.arg === f) continue;
return {value: u.arg, done: r.done}
}
"throw" === u.type && (n = "completed", r.method = "throw", r.arg = u.arg)
}
}
2023-08-16 18:10:50 +08:00
}(t, r, a), i
}
function c(t, e, r) {
try {
return {type: "normal", arg: t.call(e, r)}
} catch (E) {
return {type: "throw", arg: E}
}
}
t.wrap = l;
var f = {};
function d() {
}
function p() {
}
function h() {
}
var v = {};
s(v, o, (function () {
return this
}));
var g = Object.getPrototypeOf, m = g && g(g(C([])));
m && m !== e && r.call(m, o) && (v = m);
var b = h.prototype = d.prototype = Object.create(v);
function y(t) {
["next", "throw", "return"].forEach((function (e) {
s(t, e, (function (t) {
return this._invoke(e, t)
}))
}))
}
function w(t, e) {
function n(o, i, a, s) {
var u = c(t[o], t, i);
if ("throw" !== u.type) {
var l = u.arg, f = l.value;
return f && "object" == typeof f && r.call(f, "__await") ? e.resolve(f.__await).then((function (t) {
n("next", t, a, s)
}), (function (t) {
n("throw", t, a, s)
})) : e.resolve(f).then((function (t) {
l.value = t, a(l)
}), (function (t) {
return n("throw", t, a, s)
}))
}
2023-08-16 18:10:50 +08:00
s(u.arg)
}
var o;
this._invoke = function (t, r) {
function i() {
return new e((function (e, o) {
n(t, r, e, o)
}))
}
return o = o ? o.then(i, i) : i()
}
}
2023-08-16 18:10:50 +08:00
function x(t, e) {
var r = t.iterator[e.method];
if (void 0 === r) {
if (e.delegate = null, "throw" === e.method) {
if (t.iterator.return && (e.method = "return", e.arg = void 0, x(t, e), "throw" === e.method)) return f;
e.method = "throw", e.arg = new TypeError("The iterator does not provide a 'throw' method")
}
return f
}
var n = c(r, t.iterator, e.arg);
if ("throw" === n.type) return e.method = "throw", e.arg = n.arg, e.delegate = null, f;
var o = n.arg;
return o ? o.done ? (e[t.resultName] = o.value, e.next = t.nextLoc, "return" !== e.method && (e.method = "next", e.arg = void 0), e.delegate = null, f) : o : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f)
}
function _(t) {
var e = {tryLoc: t[0]};
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e)
}
function S(t) {
var e = t.completion || {};
e.type = "normal", delete e.arg, t.completion = e
}
function O(t) {
this.tryEntries = [{tryLoc: "root"}], t.forEach(_, this), this.reset(!0)
}
function C(t) {
if (t) {
var e = t[o];
if (e) return e.call(t);
if ("function" == typeof t.next) return t;
if (!isNaN(t.length)) {
var n = -1, i = function e() {
for (; ++n < t.length;) if (r.call(t, n)) return e.value = t[n], e.done = !1, e;
return e.value = void 0, e.done = !0, e
};
return i.next = i
}
}
return {next: k}
}
function k() {
return {value: void 0, done: !0}
}
return p.prototype = h, s(b, "constructor", h), s(h, "constructor", p), p.displayName = s(h, a, "GeneratorFunction"), t.isGeneratorFunction = function (t) {
var e = "function" == typeof t && t.constructor;
return !!e && (e === p || "GeneratorFunction" === (e.displayName || e.name))
}, t.mark = function (t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, h) : (t.__proto__ = h, s(t, a, "GeneratorFunction")), t.prototype = Object.create(b), t
}, t.awrap = function (t) {
return {__await: t}
}, y(w.prototype), s(w.prototype, i, (function () {
return this
})), t.AsyncIterator = w, t.async = function (e, r, n, o, i) {
void 0 === i && (i = Promise);
var a = new w(l(e, r, n, o), i);
return t.isGeneratorFunction(r) ? a : a.next().then((function (t) {
return t.done ? t.value : a.next()
}))
}, y(b), s(b, a, "Generator"), s(b, o, (function () {
return this
})), s(b, "toString", (function () {
return "[object Generator]"
})), t.keys = function (t) {
var e = [];
for (var r in t) e.push(r);
return e.reverse(), function r() {
for (; e.length;) {
var n = e.pop();
if (n in t) return r.value = n, r.done = !1, r
}
return r.done = !0, r
}
}, t.values = C, O.prototype = {
constructor: O, reset: function (t) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(S), !t) for (var e in this) "t" === e.charAt(0) && r.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = void 0)
}, stop: function () {
this.done = !0;
var t = this.tryEntries[0].completion;
if ("throw" === t.type) throw t.arg;
return this.rval
}, dispatchException: function (t) {
if (this.done) throw t;
var e = this;
function n(r, n) {
return a.type = "throw", a.arg = t, e.next = r, n && (e.method = "next", e.arg = void 0), !!n
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var i = this.tryEntries[o], a = i.completion;
if ("root" === i.tryLoc) return n("end");
if (i.tryLoc <= this.prev) {
var s = r.call(i, "catchLoc"), u = r.call(i, "finallyLoc");
if (s && u) {
if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return n(i.finallyLoc)
} else if (s) {
if (this.prev < i.catchLoc) return n(i.catchLoc, !0)
} else {
if (!u) throw new Error("try statement without catch or finally");
if (this.prev < i.finallyLoc) return n(i.finallyLoc)
}
}
}
}, abrupt: function (t, e) {
for (var n = this.tryEntries.length - 1; n >= 0; --n) {
var o = this.tryEntries[n];
if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var i = o;
break
}
}
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
var a = i ? i.completion : {};
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, f) : this.complete(a)
}, complete: function (t, e) {
if ("throw" === t.type) throw t.arg;
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), f
}, finish: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), S(r), f
}
}, catch: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.tryLoc === t) {
var n = r.completion;
if ("throw" === n.type) {
var o = n.arg;
S(r)
}
return o
}
}
throw new Error("illegal catch attempt")
}, delegateYield: function (t, e, r) {
return this.delegate = {
iterator: C(t),
resultName: e,
nextLoc: r
}, "next" === this.method && (this.arg = void 0), f
}
}, t
}
2023-08-16 18:10:50 +08:00
function f() {
return f = Object.assign ? Object.assign.bind() : function (t) {
for (var e = 1; e < arguments.length; e++) {
var r = arguments[e];
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n])
}
return t
}, f.apply(this, arguments)
}
2023-08-16 18:10:50 +08:00
var d = Object(s.a)({system: "third-party-lib", project: "risk-util"}), p = function () {
var t = c(u().mark((function t(e, r) {
var n;
return u().wrap((function (t) {
for (; ;) switch (t.prev = t.next) {
case 0:
if (t.prev = 0, "undefined" !== typeof window) {
t.next = 3;
break
}
return t.abrupt("return");
case 3:
n = {tag: e, s1: r}, d.send(n), t.next = 10;
break;
case 7:
t.prev = 7, t.t0 = t.catch(0), console.error(t.t0);
case 10:
case"end":
return t.stop()
}
}), t, null, [[0, 7]])
})));
return function (e, r) {
return t.apply(this, arguments)
}
}(), h = "undefined" !== typeof window, v = 36e5, g = function (t, e) {
return Math.abs(t - e) > v
}, m = function () {
if (!h) return (new Date).getTime();
var t = a()(window, "bgbRisk.timeBaseline.serverTime"), e = a()(window, "bgbRisk.timeBaseline.localTime");
if (t && e) {
var r = (new Date).getTime() - e;
return r > v ? 0 : r + t
}
return 0
}, b = function () {
var t = m();
if (t) return new Promise((function (e) {
return e(t)
}));
return new Promise((function (t) {
var e = function () {
return new Promise((function (t) {
var e = function (e) {
p("riskUtilGetServerTimeFallback", e), t((new Date).getTime())
}, r = new XMLHttpRequest;
r.open("HEAD", window.location.href, !0), r.setRequestHeader("Content-type", "application/json; charset=utf-8"), r.withCredentials = !0, r.onreadystatechange = function () {
if (4 === r.readyState) {
var n = r.getResponseHeader("Date");
if (n) {
var o = new Date(n).getTime();
o || e("date invalid " + JSON.stringify(n));
var i = (new Date).getTime();
window.bgbRisk.timeBaseline = {
serverTime: o,
localTime: i
}, t(o), g(o, i) && p("getServerTimeFallback timeDiffOverOneHour", JSON.stringify({
serverTime: o,
localTime: i
}))
} else e("date not exsit, " + r.statusText)
}
}, r.send(null)
})).then(t).catch((function (e) {
p("riskUtilGetServerTimeFallback", "catch " + (null == e ? void 0 : e.stack)), t((new Date).getTime())
}))
}, r = new XMLHttpRequest;
r.open("GET", "/api/server/_stm", !0), r.setRequestHeader("Content-type", "application/json; charset=utf-8"), r.withCredentials = !0, r.onreadystatechange = function () {
if (4 === r.readyState) {
try {
var n = JSON.parse(r.responseText).server_time;
if (n && "number" === typeof n) {
var o = (new Date).getTime();
return window.bgbRisk.timeBaseline = {
serverTime: n,
localTime: o
}, t(n), void (g(n, o) && p("getServerTime timeDiffOverOneHour", JSON.stringify({
serverTime: n,
localTime: o
})))
}
} catch (i) {
console.error(i)
}
e()
}
}, r.send()
}))
}
2023-08-16 18:10:50 +08:00
h && !a()(window, "bgbRisk") && (window.bgbRisk = {timeBaseline: null});
2023-08-16 18:10:50 +08:00
var y, w = {_2827c887a48a351a: !1, serverTime: NaN}, x = {
touchEventData: !0,
clickEventData: !0,
focusblurEventData: !0,
changeEventData: !0,
locationInfo: !0,
referrer: !0,
browserSize: !0,
browserInfo: !0,
token: !0,
fingerprint: !0
}, _ = function () {
var t = c(u().mark((function t() {
var e, r;
return u().wrap((function (t) {
for (; ;) switch (t.prev = t.next) {
case 0:
return t.next = 2, b();//时间校验
case 2:
return e = t.sent, r = f({}, w, {serverTime: e}), y = new o.a(r), t.abrupt("return", y);//返回生成器
case 6:
case"end":
return t.stop()
}
}), t)
})));
return function () {
return t.apply(this, arguments)
}
}()
return function () {
var t = c(u().mark((function t() {
var e, r, n;
return u().wrap((function (t) {
for (; ;) switch (t.prev = t.next) {
case 0:
return t.prev = 0, t.next = 3, _();
case 3:
return e = t.sent, r = e.messagePack(x), e.clearCache(), t.abrupt("return", r);
case 9:
t.prev = 9, t.t0 = t.catch(0);
try {
n = void 0, n = t.t0 instanceof Error ? t.t0.message : "string" === typeof t.t0 ? t.t0 : JSON.stringify(t.t0), p("riskUtilGetRiskInfo", n)
} catch (o) {
console.error(o)
}
return t.abrupt("return", "");
case 13:
case"end":
return t.stop()
}
}), t, null, [[0, 9]])
})));
return function () {
return t.apply(this, arguments)
}
}()
},
function (e, t, r) {
"use strict";
function n(e) {
for (var t = arguments.length, r = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++) r[n - 1] = arguments[n];
throw Error("[Immer] minified error nr: " + e + (r.length ? " " + r.map((function (e) {
return "'" + e + "'"
})).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf")
}
function o(e) {
return !!e && !!e[$]
}
2023-08-16 18:10:50 +08:00
function i(e) {
var t;
return !!e && (function (e) {
if (!e || "object" != typeof e) return !1;
var t = Object.getPrototypeOf(e);
if (null === t) return !0;
var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
return r === Object || "function" == typeof r && Function.toString.call(r) === te
}(e) || Array.isArray(e) || !!e[Z] || !!(null === (t = e.constructor) || void 0 === t ? void 0 : t[Z]) || h(e) || p(e))
}
function a(e) {
return o(e) || n(23, e), e[$].t
}
function c(e, t, r) {
void 0 === r && (r = !1), 0 === s(e) ? (r ? Object.keys : re)(e).forEach((function (n) {
r && "symbol" == typeof n || t(n, e[n], e)
})) : e.forEach((function (r, n) {
return t(n, r, e)
}))
2023-08-16 18:10:50 +08:00
}
2023-08-16 18:10:50 +08:00
function s(e) {
var t = e[$];
return t ? t.i > 3 ? t.i - 4 : t.i : Array.isArray(e) ? 1 : h(e) ? 2 : p(e) ? 3 : 0
}
function u(e, t) {
return 2 === s(e) ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t)
}
function l(e, t) {
return 2 === s(e) ? e.get(t) : e[t]
}
function f(e, t, r) {
var n = s(e);
2 === n ? e.set(t, r) : 3 === n ? e.add(r) : e[t] = r
}
function d(e, t) {
return e === t ? 0 !== e || 1 / e == 1 / t : e != e && t != t
}
function h(e) {
return K && e instanceof Map
}
function p(e) {
return q && e instanceof Set
}
function g(e) {
return e.o || e.t
}
function v(e) {
if (Array.isArray(e)) return Array.prototype.slice.call(e);
var t = ne(e);
delete t[$];
for (var r = re(t), n = 0; n < r.length; n++) {
var o = r[n], i = t[o];
!1 === i.writable && (i.writable = !0, i.configurable = !0), (i.get || i.set) && (t[o] = {
configurable: !0,
writable: !0,
enumerable: i.enumerable,
value: e[o]
})
}
2023-08-16 18:10:50 +08:00
return Object.create(Object.getPrototypeOf(e), t)
}
2023-08-16 18:10:50 +08:00
function m(e, t) {
return void 0 === t && (t = !1), x(e) || o(e) || !i(e) || (s(e) > 1 && (e.set = e.add = e.clear = e.delete = b), Object.freeze(e), t && c(e, (function (e, t) {
return m(t, !0)
}), !0)), e
}
function b() {
n(2)
}
function x(e) {
return null == e || "object" != typeof e || Object.isFrozen(e)
}
function y(e) {
var t = oe[e];
return t || n(18, e), t
}
function w(e, t) {
oe[e] || (oe[e] = t)
}
function C() {
return Y
}
function A(e, t) {
t && (y("Patches"), e.u = [], e.s = [], e.v = t)
}
function E(e) {
S(e), e.p.forEach(k), e.p = null
}
function S(e) {
e === Y && (Y = e.l)
}
function O(e) {
return Y = {p: [], l: Y, h: e, m: !0, _: 0}
}
function k(e) {
var t = e[$];
0 === t.i || 1 === t.i ? t.j() : t.O = !0
}
function I(e, t) {
t._ = t.p.length;
var r = t.p[0], o = void 0 !== e && e !== r;
return t.h.g || y("ES5").S(t, e, o), o ? (r[$].P && (E(t), n(4)), i(e) && (e = B(t, e), t.l || R(t, e)), t.u && y("Patches").M(r[$].t, e, t.u, t.s)) : e = B(t, r, []), E(t), t.u && t.v(t.u, t.s), e !== X ? e : void 0
}
function B(e, t, r) {
if (x(t)) return t;
var n = t[$];
if (!n) return c(t, (function (o, i) {
return _(e, n, t, o, i, r)
}), !0), t;
if (n.A !== e) return t;
if (!n.P) return R(e, n.t, !0), n.t;
if (!n.I) {
n.I = !0, n.A._--;
var o = 4 === n.i || 5 === n.i ? n.o = v(n.k) : n.o, i = o, a = !1;
3 === n.i && (i = new Set(o), o.clear(), a = !0), c(i, (function (t, i) {
return _(e, n, o, t, i, r, a)
})), R(e, o, !1), r && e.u && y("Patches").N(n, r, e.u, e.s)
}
return n.o
}
function _(e, t, r, n, a, c, s) {
if (o(a)) {
var l = B(e, a, c && t && 3 !== t.i && !u(t.R, n) ? c.concat(n) : void 0);
if (f(r, n, l), !o(l)) return;
e.m = !1
} else s && r.add(a);
if (i(a) && !x(a)) {
if (!e.h.D && e._ < 1) return;
B(e, a), t && t.A.l || R(e, a)
}
2023-08-16 18:10:50 +08:00
}
2023-08-16 18:10:50 +08:00
function R(e, t, r) {
void 0 === r && (r = !1), !e.l && e.h.D && e.m && m(t, r)
}
function j(e, t) {
var r = e[$];
return (r ? g(r) : e)[t]
}
2023-08-16 18:10:50 +08:00
function M(e, t) {
if (t in e) for (var r = Object.getPrototypeOf(e); r;) {
var n = Object.getOwnPropertyDescriptor(r, t);
if (n) return n;
r = Object.getPrototypeOf(r)
}
}
2023-08-16 18:10:50 +08:00
function D(e) {
e.P || (e.P = !0, e.l && D(e.l))
}
2023-08-16 18:10:50 +08:00
function T(e) {
e.o || (e.o = v(e.t))
}
2023-08-16 18:10:50 +08:00
function P(e, t, r) {
var n = h(t) ? y("MapSet").F(t, r) : p(t) ? y("MapSet").T(t, r) : e.g ? function (e, t) {
var r = Array.isArray(e),
n = {i: r ? 1 : 0, A: t ? t.A : C(), P: !1, I: !1, R: {}, l: t, t: e, k: null, o: null, j: null, C: !1},
o = n, i = ie;
r && (o = [n], i = ae);
var a = Proxy.revocable(o, i), c = a.revoke, s = a.proxy;
return n.k = s, n.j = c, s
}(t, r) : y("ES5").J(t, r);
return (r ? r.A : C()).p.push(n), n
}
2023-08-16 18:10:50 +08:00
function F(e) {
return o(e) || n(22, e), function e(t) {
if (!i(t)) return t;
var r, n = t[$], o = s(t);
if (n) {
if (!n.P && (n.i < 4 || !y("ES5").K(n))) return n.t;
n.I = !0, r = N(t, o), n.I = !1
} else r = N(t, o);
return c(r, (function (t, o) {
n && l(n.t, t) === o || f(r, t, e(o))
})), 3 === o ? new Set(r) : r
}(e)
}
function N(e, t) {
switch (t) {
case 2:
return new Map(e);
case 3:
return Array.from(e)
}
2023-08-16 18:10:50 +08:00
return v(e)
}
2023-08-16 18:10:50 +08:00
function L() {
function e(e, t) {
var r = i[e];
return r ? r.enumerable = t : i[e] = r = {
configurable: !0, enumerable: t, get: function () {
var t = this[$];
return ie.get(t, e)
}, set: function (t) {
var r = this[$];
ie.set(r, e, t)
}
}, r
}
2023-08-16 18:10:50 +08:00
function t(e) {
for (var t = e.length - 1; t >= 0; t--) {
var o = e[t][$];
if (!o.P) switch (o.i) {
case 5:
n(o) && D(o);
break;
case 4:
r(o) && D(o)
}
}
}
function r(e) {
for (var t = e.t, r = e.k, n = re(r), o = n.length - 1; o >= 0; o--) {
var i = n[o];
if (i !== $) {
var a = t[i];
if (void 0 === a && !u(t, i)) return !0;
var c = r[i], s = c && c[$];
if (s ? s.t !== a : !d(c, a)) return !0
}
}
2023-08-16 18:10:50 +08:00
var l = !!t[$];
return n.length !== re(t).length + (l ? 0 : 1)
}
function n(e) {
var t = e.k;
if (t.length !== e.t.length) return !0;
var r = Object.getOwnPropertyDescriptor(t, t.length - 1);
if (r && !r.get) return !0;
for (var n = 0; n < t.length; n++) if (!t.hasOwnProperty(n)) return !0;
return !1
}
2023-08-16 18:10:50 +08:00
var i = {};
w("ES5", {
J: function (t, r) {
var n = Array.isArray(t), o = function (t, r) {
if (t) {
for (var n = Array(r.length), o = 0; o < r.length; o++) Object.defineProperty(n, "" + o, e(o, !0));
return n
}
var i = ne(r);
delete i[$];
for (var a = re(i), c = 0; c < a.length; c++) {
var s = a[c];
i[s] = e(s, t || !!i[s].enumerable)
}
return Object.create(Object.getPrototypeOf(r), i)
}(n, t), i = {i: n ? 5 : 4, A: r ? r.A : C(), P: !1, I: !1, R: {}, l: r, t: t, k: o, o: null, O: !1, C: !1};
return Object.defineProperty(o, $, {value: i, writable: !0}), o
}, S: function (e, r, i) {
i ? o(r) && r[$].A === e && t(e.p) : (e.u && function e(t) {
if (t && "object" == typeof t) {
var r = t[$];
if (r) {
var o = r.t, i = r.k, a = r.R, s = r.i;
if (4 === s) c(i, (function (t) {
t !== $ && (void 0 !== o[t] || u(o, t) ? a[t] || e(i[t]) : (a[t] = !0, D(r)))
})), c(o, (function (e) {
void 0 !== i[e] || u(i, e) || (a[e] = !1, D(r))
})); else if (5 === s) {
if (n(r) && (D(r), a.length = !0), i.length < o.length) for (var l = i.length; l < o.length; l++) a[l] = !1; else for (var f = o.length; f < i.length; f++) a[f] = !0;
for (var d = Math.min(i.length, o.length), h = 0; h < d; h++) i.hasOwnProperty(h) || (a[h] = !0), void 0 === a[h] && e(i[h])
}
}
}
}(e.p[0]), t(e.p))
}, K: function (e) {
return 4 === e.i ? r(e) : n(e)
}
2023-08-16 18:10:50 +08:00
})
}
function W() {
function e(t) {
if (!i(t)) return t;
if (Array.isArray(t)) return t.map(e);
if (h(t)) return new Map(Array.from(t.entries()).map((function (t) {
return [t[0], e(t[1])]
})));
if (p(t)) return new Set(Array.from(t).map(e));
var r = Object.create(Object.getPrototypeOf(t));
for (var n in t) r[n] = e(t[n]);
return u(t, Z) && (r[Z] = t[Z]), r
}
function t(t) {
return o(t) ? e(t) : t
}
2023-08-16 18:10:50 +08:00
var r = "add";
w("Patches", {
$: function (t, o) {
return o.forEach((function (o) {
for (var i = o.path, a = o.op, c = t, u = 0; u < i.length - 1; u++) {
var f = s(c), d = "" + i[u];
0 !== f && 1 !== f || "__proto__" !== d && "constructor" !== d || n(24), "function" == typeof c && "prototype" === d && n(24), "object" != typeof (c = l(c, d)) && n(15, i.join("/"))
}
var h = s(c), p = e(o.value), g = i[i.length - 1];
switch (a) {
case"replace":
switch (h) {
case 2:
return c.set(g, p);
case 3:
n(16);
default:
return c[g] = p
}
case r:
switch (h) {
case 1:
return "-" === g ? c.push(p) : c.splice(g, 0, p);
case 2:
return c.set(g, p);
case 3:
return c.add(p);
default:
return c[g] = p
}
case"remove":
switch (h) {
case 1:
return c.splice(g, 1);
case 2:
return c.delete(g);
case 3:
return c.delete(o.value);
default:
return delete c[g]
}
default:
n(17, a)
}
})), t
}, N: function (e, n, o, i) {
switch (e.i) {
case 0:
case 4:
case 2:
return function (e, n, o, i) {
var a = e.t, s = e.o;
c(e.R, (function (e, c) {
var f = l(a, e), d = l(s, e), h = c ? u(a, e) ? "replace" : r : "remove";
if (f !== d || "replace" !== h) {
var p = n.concat(e);
o.push("remove" === h ? {op: h, path: p} : {
op: h,
path: p,
value: d
}), i.push(h === r ? {op: "remove", path: p} : "remove" === h ? {
op: r,
path: p,
value: t(f)
} : {op: "replace", path: p, value: t(f)})
}
}))
}(e, n, o, i);
case 5:
case 1:
return function (e, n, o, i) {
var a = e.t, c = e.R, s = e.o;
if (s.length < a.length) {
var u = [s, a];
a = u[0], s = u[1];
var l = [i, o];
o = l[0], i = l[1]
}
for (var f = 0; f < a.length; f++) if (c[f] && s[f] !== a[f]) {
var d = n.concat([f]);
o.push({op: "replace", path: d, value: t(s[f])}), i.push({op: "replace", path: d, value: t(a[f])})
}
for (var h = a.length; h < s.length; h++) {
var p = n.concat([h]);
o.push({op: r, path: p, value: t(s[h])})
}
a.length < s.length && i.push({op: "replace", path: n.concat(["length"]), value: a.length})
}(e, n, o, i);
case 3:
return function (e, t, n, o) {
var i = e.t, a = e.o, c = 0;
i.forEach((function (e) {
if (!a.has(e)) {
var i = t.concat([c]);
n.push({op: "remove", path: i, value: e}), o.unshift({op: r, path: i, value: e})
}
c++
})), c = 0, a.forEach((function (e) {
if (!i.has(e)) {
var a = t.concat([c]);
n.push({op: r, path: a, value: e}), o.unshift({op: "remove", path: a, value: e})
}
c++
}))
}(e, n, o, i)
}
2023-08-16 18:10:50 +08:00
}, M: function (e, t, r, n) {
r.push({op: "replace", path: [], value: t === X ? void 0 : t}), n.push({op: "replace", path: [], value: e})
}
2023-08-16 18:10:50 +08:00
})
}
function G() {
function e(e, t) {
function r() {
this.constructor = e
}
a(e, t), e.prototype = (r.prototype = t.prototype, new r)
}
2023-08-16 18:10:50 +08:00
function t(e) {
e.o || (e.R = new Map, e.o = new Map(e.t))
}
function r(e) {
e.o || (e.o = new Set, e.t.forEach((function (t) {
if (i(t)) {
var r = P(e.A.h, t, e);
e.p.set(t, r), e.o.add(r)
} else e.o.add(t)
})))
}
function o(e) {
e.O && n(3, JSON.stringify(g(e)))
}
var a = function (e, t) {
return (a = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (e, t) {
e.__proto__ = t
} || function (e, t) {
for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r])
})(e, t)
}, s = function () {
function r(e, t) {
return this[$] = {
i: 2,
l: t,
A: t ? t.A : C(),
P: !1,
I: !1,
o: void 0,
R: void 0,
t: e,
k: this,
C: !1,
O: !1
}, this
}
e(r, Map);
var n = r.prototype;
return Object.defineProperty(n, "size", {
get: function () {
return g(this[$]).size
}
2023-08-16 18:10:50 +08:00
}), n.has = function (e) {
return g(this[$]).has(e)
}, n.set = function (e, r) {
var n = this[$];
return o(n), g(n).has(e) && g(n).get(e) === r || (t(n), D(n), n.R.set(e, !0), n.o.set(e, r), n.R.set(e, !0)), this
}, n.delete = function (e) {
if (!this.has(e)) return !1;
var r = this[$];
return o(r), t(r), D(r), r.t.has(e) ? r.R.set(e, !1) : r.R.delete(e), r.o.delete(e), !0
}, n.clear = function () {
var e = this[$];
o(e), g(e).size && (t(e), D(e), e.R = new Map, c(e.t, (function (t) {
e.R.set(t, !1)
})), e.o.clear())
}, n.forEach = function (e, t) {
var r = this;
g(this[$]).forEach((function (n, o) {
e.call(t, r.get(o), o, r)
}))
}, n.get = function (e) {
var r = this[$];
o(r);
var n = g(r).get(e);
if (r.I || !i(n)) return n;
if (n !== r.t.get(e)) return n;
var a = P(r.A.h, n, r);
return t(r), r.o.set(e, a), a
}, n.keys = function () {
return g(this[$]).keys()
}, n.values = function () {
var e, t = this, r = this.keys();
return (e = {})[ee] = function () {
return t.values()
}, e.next = function () {
var e = r.next();
return e.done ? e : {done: !1, value: t.get(e.value)}
}, e
}, n.entries = function () {
var e, t = this, r = this.keys();
return (e = {})[ee] = function () {
return t.entries()
}, e.next = function () {
var e = r.next();
if (e.done) return e;
var n = t.get(e.value);
return {done: !1, value: [e.value, n]}
}, e
}, n[ee] = function () {
return this.entries()
}, r
}(), u = function () {
function t(e, t) {
return this[$] = {
i: 3,
l: t,
A: t ? t.A : C(),
P: !1,
I: !1,
o: void 0,
t: e,
k: this,
p: new Map,
O: !1,
C: !1
}, this
}
e(t, Set);
var n = t.prototype;
return Object.defineProperty(n, "size", {
get: function () {
return g(this[$]).size
}
2023-08-16 18:10:50 +08:00
}), n.has = function (e) {
var t = this[$];
return o(t), t.o ? !!t.o.has(e) || !(!t.p.has(e) || !t.o.has(t.p.get(e))) : t.t.has(e)
}, n.add = function (e) {
var t = this[$];
return o(t), this.has(e) || (r(t), D(t), t.o.add(e)), this
}, n.delete = function (e) {
if (!this.has(e)) return !1;
var t = this[$];
return o(t), r(t), D(t), t.o.delete(e) || !!t.p.has(e) && t.o.delete(t.p.get(e))
}, n.clear = function () {
var e = this[$];
o(e), g(e).size && (r(e), D(e), e.o.clear())
}, n.values = function () {
var e = this[$];
return o(e), r(e), e.o.values()
}, n.entries = function () {
var e = this[$];
return o(e), r(e), e.o.entries()
}, n.keys = function () {
return this.values()
}, n[ee] = function () {
return this.values()
}, n.forEach = function (e, t) {
for (var r = this.values(), n = r.next(); !n.done;) e.call(t, n.value, n.value, this), n = r.next()
}, t
}();
w("MapSet", {
F: function (e, t) {
return new s(e, t)
}, T: function (e, t) {
return new u(e, t)
}
2023-08-16 18:10:50 +08:00
})
}
function U() {
L(), G(), W()
}
function z(e) {
return e
}
function H(e) {
return e
}
r.r(t), r.d(t, "Immer", (function () {
return ce
})), r.d(t, "applyPatches", (function () {
return he
})), r.d(t, "castDraft", (function () {
return z
})), r.d(t, "castImmutable", (function () {
return H
})), r.d(t, "createDraft", (function () {
return pe
})), r.d(t, "current", (function () {
return F
})), r.d(t, "enableAllPlugins", (function () {
return U
})), r.d(t, "enableES5", (function () {
return L
})), r.d(t, "enableMapSet", (function () {
return G
})), r.d(t, "enablePatches", (function () {
return W
})), r.d(t, "finishDraft", (function () {
return ge
})), r.d(t, "freeze", (function () {
return m
})), r.d(t, "immerable", (function () {
return Z
})), r.d(t, "isDraft", (function () {
return o
})), r.d(t, "isDraftable", (function () {
return i
})), r.d(t, "nothing", (function () {
return X
})), r.d(t, "original", (function () {
return a
})), r.d(t, "produce", (function () {
return ue
})), r.d(t, "produceWithPatches", (function () {
return le
})), r.d(t, "setAutoFreeze", (function () {
return fe
})), r.d(t, "setUseProxies", (function () {
return de
}));
var V, Y, Q = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x"), K = "undefined" != typeof Map,
q = "undefined" != typeof Set,
J = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect,
X = Q ? Symbol.for("immer-nothing") : ((V = {})["immer-nothing"] = !0, V),
Z = Q ? Symbol.for("immer-draftable") : "__$immer_draftable",
$ = Q ? Symbol.for("immer-state") : "__$immer_state",
ee = "undefined" != typeof Symbol && Symbol.iterator || "@@iterator", te = "" + Object.prototype.constructor,
re = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function (e) {
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))
} : Object.getOwnPropertyNames, ne = Object.getOwnPropertyDescriptors || function (e) {
var t = {};
return re(e).forEach((function (r) {
t[r] = Object.getOwnPropertyDescriptor(e, r)
})), t
}, oe = {}, ie = {
get: function (e, t) {
if (t === $) return e;
var r = g(e);
if (!u(r, t)) return function (e, t, r) {
var n, o = M(t, r);
return o ? "value" in o ? o.value : null === (n = o.get) || void 0 === n ? void 0 : n.call(e.k) : void 0
}(e, r, t);
var n = r[t];
return e.I || !i(n) ? n : n === j(e.t, t) ? (T(e), e.o[t] = P(e.A.h, n, e)) : n
}, has: function (e, t) {
return t in g(e)
}, ownKeys: function (e) {
return Reflect.ownKeys(g(e))
}, set: function (e, t, r) {
var n = M(g(e), t);
if (null == n ? void 0 : n.set) return n.set.call(e.k, r), !0;
if (!e.P) {
var o = j(g(e), t), i = null == o ? void 0 : o[$];
if (i && i.t === r) return e.o[t] = r, e.R[t] = !1, !0;
if (d(r, o) && (void 0 !== r || u(e.t, t))) return !0;
T(e), D(e)
}
return e.o[t] === r && (void 0 !== r || t in e.o) || Number.isNaN(r) && Number.isNaN(e.o[t]) || (e.o[t] = r, e.R[t] = !0), !0
}, deleteProperty: function (e, t) {
return void 0 !== j(e.t, t) || t in e.t ? (e.R[t] = !1, T(e), D(e)) : delete e.R[t], e.o && delete e.o[t], !0
}, getOwnPropertyDescriptor: function (e, t) {
var r = g(e), n = Reflect.getOwnPropertyDescriptor(r, t);
return n ? {
writable: !0,
configurable: 1 !== e.i || "length" !== t,
enumerable: n.enumerable,
value: r[t]
} : n
}, defineProperty: function () {
n(11)
}, getPrototypeOf: function (e) {
return Object.getPrototypeOf(e.t)
}, setPrototypeOf: function () {
n(12)
}
}, ae = {};
c(ie, (function (e, t) {
ae[e] = function () {
return arguments[0] = arguments[0][0], t.apply(this, arguments)
}
})), ae.deleteProperty = function (e, t) {
return ae.set.call(this, e, t, void 0)
}, ae.set = function (e, t, r) {
return ie.set.call(this, e[0], t, r, e[0])
};
var ce = function () {
function e(e) {
var t = this;
this.g = J, this.D = !0, this.produce = function (e, r, o) {
if ("function" == typeof e && "function" != typeof r) {
var a = r;
r = e;
var c = t;
return function (e) {
var t = this;
void 0 === e && (e = a);
for (var n = arguments.length, o = Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) o[i - 1] = arguments[i];
return c.produce(e, (function (e) {
var n;
return (n = r).call.apply(n, [t, e].concat(o))
}))
}
}
var s;
if ("function" != typeof r && n(6), void 0 !== o && "function" != typeof o && n(7), i(e)) {
var u = O(t), l = P(t, e, void 0), f = !0;
try {
s = r(l), f = !1
} finally {
f ? E(u) : S(u)
}
return "undefined" != typeof Promise && s instanceof Promise ? s.then((function (e) {
return A(u, o), I(e, u)
}), (function (e) {
throw E(u), e
})) : (A(u, o), I(s, u))
}
if (!e || "object" != typeof e) {
if (void 0 === (s = r(e)) && (s = e), s === X && (s = void 0), t.D && m(s, !0), o) {
var d = [], h = [];
y("Patches").M(e, s, d, h), o(d, h)
}
return s
}
n(21, e)
}, this.produceWithPatches = function (e, r) {
if ("function" == typeof e) return function (r) {
for (var n = arguments.length, o = Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++) o[i - 1] = arguments[i];
return t.produceWithPatches(r, (function (t) {
return e.apply(void 0, [t].concat(o))
}))
};
var n, o, i = t.produce(e, r, (function (e, t) {
n = e, o = t
}));
return "undefined" != typeof Promise && i instanceof Promise ? i.then((function (e) {
return [e, n, o]
})) : [i, n, o]
}, "boolean" == typeof (null == e ? void 0 : e.useProxies) && this.setUseProxies(e.useProxies), "boolean" == typeof (null == e ? void 0 : e.autoFreeze) && this.setAutoFreeze(e.autoFreeze)
}
var t = e.prototype;
return t.createDraft = function (e) {
i(e) || n(8), o(e) && (e = F(e));
var t = O(this), r = P(this, e, void 0);
return r[$].C = !0, S(t), r
}, t.finishDraft = function (e, t) {
var r = (e && e[$]).A;
return A(r, t), I(void 0, r)
}, t.setAutoFreeze = function (e) {
this.D = e
}, t.setUseProxies = function (e) {
e && !J && n(20), this.g = e
}, t.applyPatches = function (e, t) {
var r;
for (r = t.length - 1; r >= 0; r--) {
var n = t[r];
if (0 === n.path.length && "replace" === n.op) {
e = n.value;
break
}
}
r > -1 && (t = t.slice(r + 1));
var i = y("Patches").$;
return o(e) ? i(e, t) : this.produce(e, (function (e) {
return i(e, t)
}))
}, e
}(), se = new ce, le = se.produceWithPatches.bind(se), fe = se.setAutoFreeze.bind(se),
de = se.setUseProxies.bind(se), he = se.applyPatches.bind(se), pe = se.createDraft.bind(se),
ge = se.finishDraft.bind(se);
t.default = se.produce
},
function (e, t, r) {
"use strict";
function n(e, t) {
return Object.prototype.toString.call(e) === "[object " + t + "]"
}
function o(e) {
return void 0 !== e && null !== e
}
r.d(t, "a", (function () {
return o
})), r.d(t, "b", (function () {
return n
}))
},
function (e, t, r) {
"use strict";
function n() {
var e = this.constructor.getDerivedStateFromProps(this.props, this.state);
null !== e && void 0 !== e && this.setState(e)
}
function o(e) {
this.setState(function (t) {
var r = this.constructor.getDerivedStateFromProps(e, t);
return null !== r && void 0 !== r ? r : null
}.bind(this))
}
function i(e, t) {
try {
var r = this.props, n = this.state;
this.props = e, this.state = t, this.__reactInternalSnapshotFlag = !0, this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(r, n)
} finally {
this.props = r, this.state = n
}
}
function a(e) {
var t = e.prototype;
if (!t || !t.isReactComponent) throw new Error("Can only polyfill class components");
if ("function" !== typeof e.getDerivedStateFromProps && "function" !== typeof t.getSnapshotBeforeUpdate) return e;
var r = null, a = null, c = null;
if ("function" === typeof t.componentWillMount ? r = "componentWillMount" : "function" === typeof t.UNSAFE_componentWillMount && (r = "UNSAFE_componentWillMount"), "function" === typeof t.componentWillReceiveProps ? a = "componentWillReceiveProps" : "function" === typeof t.UNSAFE_componentWillReceiveProps && (a = "UNSAFE_componentWillReceiveProps"), "function" === typeof t.componentWillUpdate ? c = "componentWillUpdate" : "function" === typeof t.UNSAFE_componentWillUpdate && (c = "UNSAFE_componentWillUpdate"), null !== r || null !== a || null !== c) {
var s = e.displayName || e.name,
u = "function" === typeof e.getDerivedStateFromProps ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n" + s + " uses " + u + " but also contains the following legacy lifecycles:" + (null !== r ? "\\n " + r : "") + (null !== a ? "\\n " + a : "") + (null !== c ? "\\n " + c : "") + "\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\nhttps://fb.me/react-async-component-lifecycle-hooks")
}
if ("function" === typeof e.getDerivedStateFromProps && (t.componentWillMount = n, t.componentWillReceiveProps = o), "function" === typeof t.getSnapshotBeforeUpdate) {
if ("function" !== typeof t.componentDidUpdate) throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");
t.componentWillUpdate = i;
var l = t.componentDidUpdate;
t.componentDidUpdate = function (e, t, r) {
var n = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : r;
l.call(this, e, t, n)
}
}
2023-08-16 18:10:50 +08:00
return e
}
r.r(t), r.d(t, "polyfill", (function () {
return a
})), n.__suppressDeprecationWarning = !0, o.__suppressDeprecationWarning = !0, i.__suppressDeprecationWarning = !0
}
2023-08-16 18:10:50 +08:00
])
}