// ==UserScript==
// @name 爱问答助手
// @namespace aiask/askHelper
// @version 2.4.11
// @author aiask
// @description 全平台问答助手,一键获取整个页面的试题答案,目前支持【超星学习通、知到智慧树、国家开放大学、广东开放大学、江苏开放大学、上海开放大学、云南开放大学、芯位教育、云慕学苑、职教云、川农在线、安徽继续教育平台、青书学堂、睿学在线、成教云、京人平台、绎通继教云、学起Plus、云上河开、河南继续教育、四川开放大学、良师在线、继教云、日照专业技术人员继续教育、麦能网、21tb、168网校、云班课、电大中专、learnin、西财在线、春风雨】,更多平台开发中...
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAAHVQTFRFR3BMgICBQD8/QUVHQ0ZIRUhKX2FiQD8/Tk1NP0VJPzs7Pz8/QD4+UE9QQD8/PVlnQD8/M6vj////n5+fN5C60NDQSl9qOXWSZL/qTFNXzOr4QWl8yMjItLS02traOIOnNZzN6OfnlJeZ9/f3PYGgpdrzmdXxgSBJqQAAABB0Uk5TAP5E6vys+7/Q0RhsfPFV/OwFarYAAAEESURBVHjapdHrboMgGIBhUHBaD/sAlTE8VOt2/5c4GlBMRZOl7w8j+kQQ0FaVwbG48IDq+piMPcgkO1bD/8DXvhD4/fb9ePDuGiqa2krV7pO1AxSLYIl2ABoeTLSvYMBi4N0sphOAlVaqg1aTPggmZYYaFvNMBYGQz6G6m2vbhEBvF81MxALFTDpbQQd3ZhvBgxqiFfBEO/CJ7ZxkNPcUbWBwn5DJw4KSsJHcHPCTLLDuQxpLkiMLbAIWJs1wBRVkyAFXT7Sa+AYQjTywNfOD74DNA18I9Ifjpg7Es/3Jj5eKyIEcBgNwhk5L8XMPonMQQcfNhBfRpIfbFbiRskCX5enFyz/07TSN9vGxKwAAAABJRU5ErkJggg==
// @match *://*.chaoxing.com/*
// @match *://*.hlju.edu.cn/*
// @match *://*.ecust.edu.cn/*
// @match *://lms.ouchn.cn/*
// @match *://*.ouchn.cn/*
// @match *://xczxzdbf.moodle.qwbx.ouchn.cn/*
// @match *://study.ouchn.cn/*
// @match *://moodle.syxy.ouchn.cn/*
// @match *://moodle.qwbx.ouchn.cn/*
// @match *://*.tongyi.com/*
// @match *://chat.deepseek.com/*
// @match *://*.zhihuishu.com/*
// @match *://course.ougd.cn/*
// @match *://elearning.bjou.edu.cn/*
// @match *://whkpc.hnqtyq.cn:5678/*
// @match *://www.51xinwei.com/*
// @match *://*.w-ling.cn/*
// @match *://*.edu-edu.com/*
// @match *://xuexi.jsou.cn/*
// @match *://*.icve.com.cn/*
// @match *://zice.cnzx.info/*
// @match *://any.cnzx.info:81/*
// @match *://www.icourse163.org/*
// @match *://*.shou.org.cn/*
// @match *://*.ahjxjy.cn/*
// @match *://*.chinaedu.net/*
// @match *://*.qingshuxuetang.com/*
// @match *://cce.org.uooconline.com/*
// @match *://*.courshare.cn/*
// @match *://*.cep.webtrn.cn/*
// @match *://*.webtrn.cn/*
// @match *://*.cj-edu.com/*
// @match *://*.ytccr.com/*
// @match *://*.exam-cloud.cn/*
// @match *://gdrtvu.exam-cloud.cn/*
// @match *://*.open.ha.cn/*
// @match *://lhycjy.cloudwis.tech/*
// @match *://*.sclecb.cn/*
// @match *://*.web2.superchutou.com/*
// @match *://*.ls365.net/*
// @match *://*.jijiaox.com/*
// @match *://*.wencaischool.net/*
// @match *://sdrz.gxk.yxlearning.com/*
// @match *://*.crjxjy.net/*
// @match *://*.cjnep.net/*
// @match *://*.91huayi.com/*
// @match *://teach.ynou.edu.cn/*
// @match *://*.edu-edu.com.cn/*
// @match *://*.21tb.com/*
// @match *://*.168wangxiao.com/*
// @match *://*.mynep.com/*
// @match *://www.mosoteach.cn/*
// @match *://*.aufe.edu.cn/*
// @match *://*.learnin.com.cn/*
// @match *://*.ouchn.edu.cn/*
// @match *://*.swufe-online.com/*
// @match *://ks.cqsdx.cn/*
// @match *://*.qau.edu.cn/*
// @match *://*.gdufemooc.cn/*
// @match *://*.telfri-edu.com/*
// @match *://www.beeline-ai.com/*
// @match *://*.wxic.edu.cn/*
// @match *://*.yxbyun.com/*
// @match *://*.wdjycj.com/*
// @match *://*.hbcjpt.com/*
// @match *://*.csmu.edu.cn/*
// @match *://*.ketangx.net/*
// @match *://*.cnzx.info/*
// @match *://www.asklib.com/*
// @match *://*.xust.edu.cn/*
// @match *://*.whut.edu.cn/*
// @match *://*.lut.edu.cn/*
// @match *://*.wwwwsoft.com/*
// @match *://*.dufe.edu.cn/*
// @match *://*.lygtc.edu.cn/*
// @match *://*.iwdjy.com/*
// @match *://*.jijiaool.com/*
// @match *://lms.cjzx.hblll.com/*
// @match *://*.ouc-online.com.cn/*
// @match *://*.lsedu.vip/*
// @match *://*.jxjypt.cn/*
// @require https://lib.baomitu.com/vue/3.4.27/vue.global.min.js
// @require https://lib.baomitu.com/vue-demi/0.14.6/index.iife.js
// @require data:application/javascript,%3Bwindow.Vue%3DVue%3B
// @require https://cdn.jsdelivr.net/npm/@iconify/vue@5.0.0/dist/iconify.js
// @require https://lib.baomitu.com/jquery/3.6.0/jquery.min.js
// @require https://lib.baomitu.com/dompurify/3.1.6/purify.min.js
// @require https://lib.baomitu.com/crypto-js/4.2.0/crypto-js.min.js
// @connect 127.0.0.1
// @connect icodef.com
// @connect muketool.com
// @connect wk66.top
// @connect zhihuishu.com
// @connect greasyfork.org
// @connect chaoxing.com
// @connect shou.org.cn
// @connect jsdelivr.net
// @connect jsdmirror.cn
// @connect gitee.com
// @connect vxo.im
// @connect zeroai.chat
// @connect forestpolice.org
// @connect scriptcat.org
// @connect aiask.site
// @connect api.deepseek.com
// @connect dashscope.aliyuncs.com
// @connect open.bigmodel.cn
// @connect qianfan.baidubce.com
// @connect ark.cn-beijing.volces.com
// @connect api.hunyuan.cloud.tencent.com
// @connect api.longcat.chat
// @connect api.moonshot.ai
// @connect api.siliconflow.com
// @connect api.openai.com
// @connect api.anthropic.com
// @connect generativelanguage.googleapis.com
// @connect openrouter.ai
// @connect api.groq.com
// @connect api.together.ai
// @connect api.mistral.ai
// @grant GM.xmlHttpRequest
// @grant GM_deleteValue
// @grant GM_getValue
// @grant GM_info
// @grant GM_listValues
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
// hello
(function (vue, vue$1, V, K, W) {
'use strict';
var e = Object.defineProperty, __publicField = (t, a, n) => ((t, a, n) => a in t ? e(t, a, {
enumerable: !0,
configurable: !0,
writable: !0,
value: n
}) : t[a] = n)(t, "symbol" != typeof a ? a + "" : a, n);
let Q;
const setActivePinia = e => Q = e, J = Symbol();
function isPlainObject(e) {
return e && "object" == typeof e && "[object Object]" === Object.prototype.toString.call(e) && "function" != typeof e.toJSON;
}
var X, Y;
(Y = X || (X = {})).direct = "direct", Y.patchObject = "patch object", Y.patchFunction = "patch function";
const noop = () => {};
function addSubscription(e, t, a, n = noop) {
e.push(t);
const removeSubscription = () => {
const a = e.indexOf(t);
a > -1 && (e.splice(a, 1), n());
};
return !a && vue.getCurrentScope() && vue.onScopeDispose(removeSubscription), removeSubscription;
}
function triggerSubscriptions(e, ...t) {
e.slice().forEach((e => {
e(...t);
}));
}
const fallbackRunWithContext = e => e(), Z = Symbol(), ee = Symbol();
function mergeReactiveObjects(e, t) {
e instanceof Map && t instanceof Map ? t.forEach(((t, a) => e.set(a, t))) : e instanceof Set && t instanceof Set && t.forEach(e.add, e);
for (const a in t) {
if (!t.hasOwnProperty(a)) continue;
const n = t[a], r = e[a];
isPlainObject(r) && isPlainObject(n) && e.hasOwnProperty(a) && !vue.isRef(n) && !vue.isReactive(n) ? e[a] = mergeReactiveObjects(r, n) : e[a] = n;
}
return e;
}
const te = Symbol();
const {assign: ae} = Object;
function createSetupStore(e, n, r = {}, s, u, d) {
let h;
const f = ae({
actions: {}
}, r), g = {
deep: !0
};
let v, y, b, w = [], x = [];
const k = s.state.value[e];
let q;
function $patch(t) {
let a;
v = y = !1, "function" == typeof t ? (t(s.state.value[e]), a = {
type: X.patchFunction,
storeId: e,
events: b
}) : (mergeReactiveObjects(s.state.value[e], t), a = {
type: X.patchObject,
payload: t,
storeId: e,
events: b
});
const n = q = Symbol();
vue.nextTick().then((() => {
q === n && (v = !0);
})), y = !0, triggerSubscriptions(w, a, s.state.value[e]);
}
d || k || (s.state.value[e] = {}), vue.ref({});
const _ = d ? function() {
const {state: e} = r, t = e ? e() : {};
this.$patch((e => {
ae(e, t);
}));
} : noop;
const action = (t, a = "") => {
if (Z in t) return t[ee] = a, t;
const wrappedAction = function() {
setActivePinia(s);
const a = Array.from(arguments), n = [], r = [];
let i;
triggerSubscriptions(x, {
args: a,
name: wrappedAction[ee],
store: T,
after: function(e) {
n.push(e);
},
onError: function(e) {
r.push(e);
}
});
try {
i = t.apply(this && this.$id === e ? this : T, a);
} catch (o) {
throw triggerSubscriptions(r, o), o;
}
return i instanceof Promise ? i.then((e => (triggerSubscriptions(n, e), e))).catch((e => (triggerSubscriptions(r, e),
Promise.reject(e)))) : (triggerSubscriptions(n, i), i);
};
return wrappedAction[Z] = !0, wrappedAction[ee] = a, wrappedAction;
}, A = {
_p: s,
$id: e,
$onAction: addSubscription.bind(null, x),
$patch: $patch,
$reset: _,
$subscribe(t, a = {}) {
const n = addSubscription(w, t, a.detached, (() => r())), r = h.run((() => vue.watch((() => s.state.value[e]), (n => {
("sync" === a.flush ? y : v) && t({
storeId: e,
type: X.direct,
events: b
}, n);
}), ae({}, g, a))));
return n;
},
$dispose: function() {
h.stop(), w = [], x = [], s._s.delete(e);
}
}, T = vue.reactive(A);
s._s.set(e, T);
const C = (s._a && s._a.runWithContext || fallbackRunWithContext)((() => s._e.run((() => (h = vue.effectScope()).run((() => n({
action: action
})))))));
for (const t in C) {
const a = C[t];
if (vue.isRef(a) && (!vue.isRef(I = a) || !I.effect) || vue.isReactive(a)) d || (!k || isPlainObject(S = a) && S.hasOwnProperty(te) || (vue.isRef(a) ? a.value = k[t] : mergeReactiveObjects(a, k[t])),
s.state.value[e][t] = a); else if ("function" == typeof a) {
const e = action(a, t);
C[t] = e, f.actions[t] = a;
}
}
var S, I;
return ae(T, C), ae(vue.toRaw(T), C), Object.defineProperty(T, "$state", {
get: () => s.state.value[e],
set: e => {
$patch((t => {
ae(t, e);
}));
}
}), s._p.forEach((e => {
ae(T, h.run((() => e({
store: T,
app: s._a,
pinia: s,
options: f
}))));
})), k && d && r.hydrate && r.hydrate(T.$state, k), v = !0, y = !0, T;
}
function defineStore(e, t, a) {
let i, o;
const l = "function" == typeof t;
function useStore(e, a) {
const c = vue.hasInjectionContext();
(e = e || (c ? vue.inject(J, null) : null)) && setActivePinia(e), (e = Q)._s.has(i) || (l ? createSetupStore(i, t, o, e) : function(e, t, a) {
const {state: r, actions: s, getters: i} = t, o = a.state.value[e];
createSetupStore(e, (function() {
o || (a.state.value[e] = r ? r() : {});
const t = vue.toRefs(a.state.value[e]);
return ae(t, s, Object.keys(i || {}).reduce(((t, r) => (t[r] = vue.markRaw(vue.computed((() => {
setActivePinia(a);
const t = a._s.get(e);
return i[r].call(t, t);
}))), t)), {}));
}), t, a, 0, !0);
}(i, o, e));
return e._s.get(i);
}
return "string" == typeof e ? (i = e, o = l ? a : t) : (o = e, i = e.id), useStore.$id = i,
useStore;
}
var ne = (() => "undefined" != typeof GM_deleteValue ? GM_deleteValue : void 0)(), re = (() => "undefined" != typeof GM_getValue ? GM_getValue : void 0)(), se = (() => "undefined" != typeof GM_info ? GM_info : void 0)(), ie = (() => "undefined" != typeof GM_listValues ? GM_listValues : void 0)(), oe = (() => "undefined" != typeof GM_setValue ? GM_setValue : void 0)(), le = (() => "undefined" != typeof GM_xmlhttpRequest ? GM_xmlhttpRequest : void 0)(), ce = (() => "undefined" != typeof unsafeWindow ? unsafeWindow : void 0)();
const pe = "AiAsk_";
class Cache {
static set(e, t, a = 0) {
e = pe + e;
const n = {
value: t,
expire: a > 0 ? Date.now() + 1e3 * a : 0
};
return oe(e, n), re(e);
}
static get(e, t = null) {
const a = re(e = pe + e);
return a && a.expire && a.expire < Date.now() ? (ne(e), t) : a ? a.value : t;
}
static match(e) {
return e = pe + e, ie().filter((t => t.startsWith(e)));
}
static matchGet(e) {
const t = pe + e;
let a = ie().filter((e => e.startsWith(t))).map((e => {
const t = re(e, {
value: null,
expire: 0
}).value;
return t && (t.key = e.replace(pe, "")), t;
})).filter((e => null !== e));
return a.sort(((e, t) => (t.createTime || 0) - (e.createTime || 0))), a;
}
static remove(e) {
ne(pe + e);
}
static clear() {
ie().filter((e => e.startsWith(pe))).forEach(ne);
}
static matchRemove(e) {
e = pe + e, ie().filter((t => t.startsWith(e))).forEach(ne);
}
}
function getDefaultExportFromCjs(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var ue, de, me = {
exports: {}
}, he = {
exports: {}
};
ue = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", de = {
rotl: function(e, t) {
return e << t | e >>> 32 - t;
},
rotr: function(e, t) {
return e << 32 - t | e >>> t;
},
endian: function(e) {
if (e.constructor == Number) return 16711935 & de.rotl(e, 8) | 4278255360 & de.rotl(e, 24);
for (var t = 0; t < e.length; t++) e[t] = de.endian(e[t]);
return e;
},
randomBytes: function(e) {
for (var t = []; e > 0; e--) t.push(Math.floor(256 * Math.random()));
return t;
},
bytesToWords: function(e) {
for (var t = [], a = 0, n = 0; a < e.length; a++, n += 8) t[n >>> 5] |= e[a] << 24 - n % 32;
return t;
},
wordsToBytes: function(e) {
for (var t = [], a = 0; a < 32 * e.length; a += 8) t.push(e[a >>> 5] >>> 24 - a % 32 & 255);
return t;
},
bytesToHex: function(e) {
for (var t = [], a = 0; a < e.length; a++) t.push((e[a] >>> 4).toString(16)), t.push((15 & e[a]).toString(16));
return t.join("");
},
hexToBytes: function(e) {
for (var t = [], a = 0; a < e.length; a += 2) t.push(parseInt(e.substr(a, 2), 16));
return t;
},
bytesToBase64: function(e) {
for (var t = [], a = 0; a < e.length; a += 3) for (var n = e[a] << 16 | e[a + 1] << 8 | e[a + 2], r = 0; r < 4; r++) 8 * a + 6 * r <= 8 * e.length ? t.push(ue.charAt(n >>> 6 * (3 - r) & 63)) : t.push("=");
return t.join("");
},
base64ToBytes: function(e) {
e = e.replace(/[^A-Z0-9+\/]/gi, "");
for (var t = [], a = 0, n = 0; a < e.length; n = ++a % 4) 0 != n && t.push((ue.indexOf(e.charAt(a - 1)) & Math.pow(2, -2 * n + 8) - 1) << 2 * n | ue.indexOf(e.charAt(a)) >>> 6 - 2 * n);
return t;
}
}, he.exports = de;
var fe, ge, ve, ye, be, we = he.exports, xe = {
utf8: {
stringToBytes: function(e) {
return xe.bin.stringToBytes(unescape(encodeURIComponent(e)));
},
bytesToString: function(e) {
return decodeURIComponent(escape(xe.bin.bytesToString(e)));
}
},
bin: {
stringToBytes: function(e) {
for (var t = [], a = 0; a < e.length; a++) t.push(255 & e.charCodeAt(a));
return t;
},
bytesToString: function(e) {
for (var t = [], a = 0; a < e.length; a++) t.push(String.fromCharCode(e[a]));
return t.join("");
}
}
}, ke = xe, isBuffer_1 = function(e) {
return null != e && (isBuffer(e) || function(e) {
return "function" == typeof e.readFloatLE && "function" == typeof e.slice && isBuffer(e.slice(0, 0));
}(e) || !!e._isBuffer);
};
function isBuffer(e) {
return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
}
fe = we, ge = ke.utf8, ve = isBuffer_1, ye = ke.bin, (be = function(e, t) {
e.constructor == String ? e = t && "binary" === t.encoding ? ye.stringToBytes(e) : ge.stringToBytes(e) : ve(e) ? e = Array.prototype.slice.call(e, 0) : Array.isArray(e) || e.constructor === Uint8Array || (e = e.toString());
for (var a = fe.bytesToWords(e), n = 8 * e.length, r = 1732584193, s = -271733879, i = -1732584194, o = 271733878, l = 0; l < a.length; l++) a[l] = 16711935 & (a[l] << 8 | a[l] >>> 24) | 4278255360 & (a[l] << 24 | a[l] >>> 8);
a[n >>> 5] |= 128 << n % 32, a[14 + (n + 64 >>> 9 << 4)] = n;
var c = be._ff, p = be._gg, u = be._hh, d = be._ii;
for (l = 0; l < a.length; l += 16) {
var m = r, h = s, f = i, g = o;
r = c(r, s, i, o, a[l + 0], 7, -680876936), o = c(o, r, s, i, a[l + 1], 12, -389564586),
i = c(i, o, r, s, a[l + 2], 17, 606105819), s = c(s, i, o, r, a[l + 3], 22, -1044525330),
r = c(r, s, i, o, a[l + 4], 7, -176418897), o = c(o, r, s, i, a[l + 5], 12, 1200080426),
i = c(i, o, r, s, a[l + 6], 17, -1473231341), s = c(s, i, o, r, a[l + 7], 22, -45705983),
r = c(r, s, i, o, a[l + 8], 7, 1770035416), o = c(o, r, s, i, a[l + 9], 12, -1958414417),
i = c(i, o, r, s, a[l + 10], 17, -42063), s = c(s, i, o, r, a[l + 11], 22, -1990404162),
r = c(r, s, i, o, a[l + 12], 7, 1804603682), o = c(o, r, s, i, a[l + 13], 12, -40341101),
i = c(i, o, r, s, a[l + 14], 17, -1502002290), r = p(r, s = c(s, i, o, r, a[l + 15], 22, 1236535329), i, o, a[l + 1], 5, -165796510),
o = p(o, r, s, i, a[l + 6], 9, -1069501632), i = p(i, o, r, s, a[l + 11], 14, 643717713),
s = p(s, i, o, r, a[l + 0], 20, -373897302), r = p(r, s, i, o, a[l + 5], 5, -701558691),
o = p(o, r, s, i, a[l + 10], 9, 38016083), i = p(i, o, r, s, a[l + 15], 14, -660478335),
s = p(s, i, o, r, a[l + 4], 20, -405537848), r = p(r, s, i, o, a[l + 9], 5, 568446438),
o = p(o, r, s, i, a[l + 14], 9, -1019803690), i = p(i, o, r, s, a[l + 3], 14, -187363961),
s = p(s, i, o, r, a[l + 8], 20, 1163531501), r = p(r, s, i, o, a[l + 13], 5, -1444681467),
o = p(o, r, s, i, a[l + 2], 9, -51403784), i = p(i, o, r, s, a[l + 7], 14, 1735328473),
r = u(r, s = p(s, i, o, r, a[l + 12], 20, -1926607734), i, o, a[l + 5], 4, -378558),
o = u(o, r, s, i, a[l + 8], 11, -2022574463), i = u(i, o, r, s, a[l + 11], 16, 1839030562),
s = u(s, i, o, r, a[l + 14], 23, -35309556), r = u(r, s, i, o, a[l + 1], 4, -1530992060),
o = u(o, r, s, i, a[l + 4], 11, 1272893353), i = u(i, o, r, s, a[l + 7], 16, -155497632),
s = u(s, i, o, r, a[l + 10], 23, -1094730640), r = u(r, s, i, o, a[l + 13], 4, 681279174),
o = u(o, r, s, i, a[l + 0], 11, -358537222), i = u(i, o, r, s, a[l + 3], 16, -722521979),
s = u(s, i, o, r, a[l + 6], 23, 76029189), r = u(r, s, i, o, a[l + 9], 4, -640364487),
o = u(o, r, s, i, a[l + 12], 11, -421815835), i = u(i, o, r, s, a[l + 15], 16, 530742520),
r = d(r, s = u(s, i, o, r, a[l + 2], 23, -995338651), i, o, a[l + 0], 6, -198630844),
o = d(o, r, s, i, a[l + 7], 10, 1126891415), i = d(i, o, r, s, a[l + 14], 15, -1416354905),
s = d(s, i, o, r, a[l + 5], 21, -57434055), r = d(r, s, i, o, a[l + 12], 6, 1700485571),
o = d(o, r, s, i, a[l + 3], 10, -1894986606), i = d(i, o, r, s, a[l + 10], 15, -1051523),
s = d(s, i, o, r, a[l + 1], 21, -2054922799), r = d(r, s, i, o, a[l + 8], 6, 1873313359),
o = d(o, r, s, i, a[l + 15], 10, -30611744), i = d(i, o, r, s, a[l + 6], 15, -1560198380),
s = d(s, i, o, r, a[l + 13], 21, 1309151649), r = d(r, s, i, o, a[l + 4], 6, -145523070),
o = d(o, r, s, i, a[l + 11], 10, -1120210379), i = d(i, o, r, s, a[l + 2], 15, 718787259),
s = d(s, i, o, r, a[l + 9], 21, -343485551), r = r + m >>> 0, s = s + h >>> 0, i = i + f >>> 0,
o = o + g >>> 0;
}
return fe.endian([ r, s, i, o ]);
})._ff = function(e, t, a, n, r, s, i) {
var o = e + (t & a | ~t & n) + (r >>> 0) + i;
return (o << s | o >>> 32 - s) + t;
}, be._gg = function(e, t, a, n, r, s, i) {
var o = e + (t & n | a & ~n) + (r >>> 0) + i;
return (o << s | o >>> 32 - s) + t;
}, be._hh = function(e, t, a, n, r, s, i) {
var o = e + (t ^ a ^ n) + (r >>> 0) + i;
return (o << s | o >>> 32 - s) + t;
}, be._ii = function(e, t, a, n, r, s, i) {
var o = e + (a ^ (t | ~n)) + (r >>> 0) + i;
return (o << s | o >>> 32 - s) + t;
}, be._blocksize = 16, be._digestsize = 16, me.exports = function(e, t) {
if (null == e) throw new Error("Illegal argument " + e);
var a = fe.wordsToBytes(be(e, t));
return t && t.asBytes ? a : t && t.asString ? ye.bytesToString(a) : fe.bytesToHex(a);
};
const qe = getDefaultExportFromCjs(me.exports), _e = [ {
type: "hook",
name: "\u4e91\u5e55\u5b66\u82d1hook",
match: location.host.includes("w-ling.cn"),
main: e => {
observeVuePageChange(K("#app")[0], (() => K("#app")[0].__vue__.$route.path), {
beforeChange: async e => {
"homework-detail-container" === e && await waitUntil((function() {
return 0 !== K(".selectDan").length;
}));
}
});
}
}, {
type: "save",
name: "\u4e91\u5e55\u5b66\u82d1\u6536\u5f55",
match: () => location.host.includes("w-ling.cn") && location.href.includes("practiceRecord"),
question: {
html: ".selectDan >div >div",
question: ".title",
options: ".selectItem label .tagbq",
type: ".question-box .tag",
workType: "yunmuxueyuan",
pageType: "yunmuxueyuan"
},
init: async () => {
await waitUntil((function() {
return isExist(".selectDan >div >div");
}));
},
answerHook: e => {
const t = K(e.html).parent().find("h3").text().split("\u3001")[1];
e.question = e.question.replace(/^\d+\u3001/, ""), e.question = e.question.replace(/\(\d+\u5206\)$/, "");
let a = K(e.html).find(".anaylize > span:eq(0)").text().replace("\u4f5c\u7b54\u6b63\u786e\uff1a", "");
switch ("" === a && (a = K(e.html).find(".falsanaly > span:eq(1)").text().replace("\u6b63\u786e\u7b54\u6848\uff1a", "")),
t) {
case "\u5355\u9009\u9898":
case "\u591a\u9009\u9898":
let t = a.split("");
if (e.answer = t.map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return;
e.answer.length > 1 ? e.type = "1" : e.type = "0";
break;
case "\u5224\u65ad\u9898":
e.type = "3", "T" == a && (e.answer = [ "\u6b63\u786e" ]), "F" == a && (e.answer = [ "\u9519\u8bef" ]);
break;
case "\u586b\u7a7a\u9898":
e.answer = K(e.html).find(".riganswer > span").first().nextAll("span").map(((e, t) => removeHtml(K(t).text()))).get(),
e.type = "2";
}
return e;
}
}, {
type: "ask",
name: "\u4e91\u5e55\u5b66\u82d1",
tips: "",
match: () => location.host.includes("w-ling.cn") && (location.href.includes("practicePaper") || location.href.includes("examIndex")),
types: [ "0", "1", "3" ],
question: {
html: ".selectDan >div >div",
question: ".title",
options: ".selectItem label .tagbq",
type: ".question-box .tag",
workType: "yunmuxueyuan",
pageType: "yunmuxueyuan"
},
init: async () => {
await waitUntil((function() {
return 0 !== K(".selectDan >div >div").length;
}));
},
ischecked: isParentChecked,
questionHook: e => {
e.question = e.question.replace(/^\d+\u3001/, ""), e.question = e.question.replace(/\(\d+\u5206\)$/, "");
switch (K(e.html).parent().find("h4").text().split("\u3001")[1]) {
case "\u5355\u9009\u9898":
e.type = "0";
break;
case "\u591a\u9009\u9898":
e.type = "1";
break;
case "\u5224\u65ad\u9898":
e.type = "3", e.$options = K(e.html).find(".selectItem label"), e.options = e.$options.map(((e, t) => removeHtml(K(t).text()))).get(),
e.$options;
break;
case "\u586b\u7a7a\u9898":
e.type = "2";
}
return e;
},
setAnswer: e => {
switch (e.type) {
case "3":
break;
case "2":
return K(e.html).find(".tiankong input").each(((t, a) => {
let n = K(a).parent()[0].__vue__;
K(a).val(e.answer[t]);
const r = new Event("input");
a.dispatchEvent(r), n.$emit("change", e.answer[t]);
})), !1;
}
return !0;
}
} ], Ae = "\u7b54\u9898\u5df2\u53d6\u6d88", assertFillShouldContinue = e => {
if ((null == e ? void 0 : e.shouldContinue) && !e.shouldContinue()) throw new Error(Ae);
}, fillPlanToLegacyAnswerData = e => "choice" === e.kind ? [ "xx", e.indexes ] : "judge" === e.kind ? [ "pd", e.value ] : "blank" === e.kind ? [ "jd", e.values ] : "link" === e.kind ? [ "lx", e.value ] : "reading" === e.kind ? [ "ydlj", e.subPlans.map((e => "choice" === e.kind ? e.indexes : [])) ] : [ "", [] ], mapChoiceLettersToOptions = (e, t) => {
const toOption = e => {
if ("string" != typeof e) return e;
const a = e.trim().toUpperCase()[0];
return a && /[A-Z]/.test(a) ? t[a.charCodeAt(0) - 65] : void 0;
};
return Array.isArray(e) ? e.map(toOption).filter((e => void 0 !== e)) : "string" == typeof e ? e.replace(/[^a-zA-Z]/g, "").split("").map(toOption).filter((e => void 0 !== e)) : e;
}, rawFormForLegacyMatch = e => {
if (!e || "object" != typeof e) return {};
const t = {
...e
};
var a;
return !("match" in t) || (a = t.match, Array.isArray(a) && a.every((e => "number" == typeof e || Array.isArray(e)))) || delete t.match,
t;
}, createLegacyMatchResult = e => {
if (!e.haveAnswer || !e.source || !e.fillPlan) return {
res: e.displayAnswers.map((e => e.raw || e)),
haveAnswer: !1
};
const [, t] = fillPlanToLegacyAnswerData(e.fillPlan);
return {
res: e.displayAnswers.map((e => e.raw || e)),
form: {
...rawFormForLegacyMatch(e.source.raw),
form: e.source.source,
answer: e.source.answer,
...void 0 !== e.source.duration ? {
duration: e.source.duration
} : {},
...void 0 !== e.source.msg ? {
msg: e.source.msg
} : {},
...void 0 !== e.source.needLogin ? {
needLogin: e.source.needLogin
} : {},
...(a = e.fillPlan, "choice" === a.kind || "reading" === a.kind ? {
match: t
} : {})
},
haveAnswer: !0
};
var a;
}, applyFillPlan = async (e, t, a, n, r) => {
const [s, i] = fillPlanToLegacyAnswerData(e);
if (!s) return {
success: !1,
reason: "unsupported" === e.kind ? e.reason : "\u5f53\u524d\u9898\u578b\u6682\u4e0d\u652f\u6301\u586b\u5145"
};
const o = (null == r ? void 0 : r.shouldContinue) ? {
shouldContinue: () => (assertFillShouldContinue(r), !0)
} : void 0;
try {
return assertFillShouldContinue(r), await n(s, i, t, a, o), assertFillShouldContinue(r),
{
success: !0
};
} catch (l) {
if ((e => e instanceof Error && e.message === Ae)(l)) return {
success: !1,
reason: Ae
};
throw l;
}
}, cleanQuestionText = e => String(e ?? "").replace(/]*)>/gi, ((e, t) => {
const a = String(t).match(/(?:^|\s)src\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i);
return a ? a[1] || a[2] || a[3] || "" : e;
})).replace(/
/gi, "\n").replace(/<(\/)?(p|div).*?>/gi, "\n").replace(/<[^>]+>/g, "").replace(/[\t\r\xa0]/g, " ").replace(/[\u2000-\u200a]/g, " ").replace(/ {2,}/g, " ").replace(/\n{2,}/g, "\n").trim(), cleanQuestionTitle = e => e.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim(), normalizeComparableText = e => (e => {
if (/^[+-]?\d+(\.\d+)?$/.test(e)) return e;
const t = e.replace(/\s+/g, "");
return t.replace(new RegExp("\\p{P}", "gu"), "") || t;
})((e => String(e ?? "").replace(/<[^>]*>/g, ""))(e)).trim(), removeOptionPrefixes = (e, {removeBareLetter: t = !1} = {}) => e.map(((e, a) => {
const n = String.fromCharCode(65 + a), r = t ? `^${n}(?:\\s*[.\u3001\uff0e)\uff09:\uff1a]\\s*|\\s+)?` : `^${n}\\s*[.\u3001\uff0e)\uff09:\uff1a]\\s*`;
return e.replace(new RegExp(r), "").trim();
})), Te = new Set([ "\u5bf9", "\u6b63\u786e", "true", "t", "\u221a", "\u2713", "1", "\u662f", "yes", "y", "right", "correct", "ri" ]), Ce = new Set([ "\u9519", "\u9519\u8bef", "\u4e0d\u6b63\u786e", "false", "f", "\xd7", "\u2715", "x", "0", "\u5426", "no", "n", "wrong", "incorrect", "wr" ]), splitAnswerText = (e, t) => e.split(t).map((e => e.trim())).filter(Boolean), normalizeJudgeAnswer = e => {
const t = normalizeComparableText(e).toLowerCase();
return Te.has(t) ? "\u6b63\u786e" : Ce.has(t) ? "\u9519\u8bef" : null;
}, mapChoiceValueToOption = (e, t) => {
var a;
const n = ((e, t) => {
var a;
const n = e.trim().toUpperCase();
if (/^[A-Z]$/.test(n)) return (null == (a = t[n.charCodeAt(0) - 65]) ? void 0 : a.trim()) || void 0;
})(e, t);
if (n) return n;
const r = e.trim();
return null == (a = t.find((e => e.trim() === r))) ? void 0 : a.trim();
}, Se = new Set([ "2", "4", "5", "6", "7", "9", "14" ]), answerAsArray = e => Array.isArray(e) ? e : "string" == typeof e && e.trim() ? [ e.trim() ] : [], answerAsTextArray = e => answerAsArray(e).map((e => "string" == typeof e ? e.trim() : String(e ?? "").trim())).filter(Boolean), getLength = e => {
if ("function" == typeof e) try {
return getLength(e());
} catch {
return 0;
}
if (Array.isArray(e)) return e.length;
if (e && "object" == typeof e && "length" in e) {
const t = e.length;
return "number" == typeof t ? t : 0;
}
return 0;
}, matchChoiceCandidate = (e, t) => {
const a = answerAsTextArray(e.answer);
if (0 === a.length || !Array.isArray(t.options)) return;
if (!t.options.every((e => "string" == typeof e))) return;
const n = ((e, t) => {
const a = e.map(normalizeComparableText);
if (0 === a.length || a.some((e => "" === e))) return [];
const n = t.map(normalizeComparableText), r = a.map((e => {
const t = n.findIndex((t => t === e));
return -1 !== t ? t : n.findIndex((t => t.includes(e)));
}));
return r.includes(-1) ? [] : r;
})(a, t.options);
return 0 !== n.length ? {
kind: "choice",
indexes: n
} : void 0;
}, matchJudgeCandidate = e => {
const [t] = answerAsArray(e.answer);
return (e => "\u6b63\u786e" === normalizeJudgeAnswer(e))(t) ? {
kind: "judge",
value: "\u6b63\u786e"
} : (e => "\u9519\u8bef" === normalizeJudgeAnswer(e))(t) ? {
kind: "judge",
value: "\u9519\u8bef"
} : void 0;
}, matchBlankCandidate = (e, t) => {
const a = answerAsTextArray(e.answer);
if (0 === a.length) return;
const n = (e => {
const t = getLength(e.$options);
return t > 0 ? t : Array.isArray(e.options) && e.options.length > 0 && e.options.every((e => "string" == typeof e)) ? e.options.length : 0;
})(t);
return n > 0 && a.length !== n ? void 0 : {
kind: "blank",
values: a
};
}, findPlan = (e, t) => {
if (e.valid) return "0" === t.type || "1" === t.type ? matchChoiceCandidate(e, t) : "3" === t.type ? matchJudgeCandidate(e) : Se.has(t.type) ? matchBlankCandidate(e, t) : "11" === t.type ? (e => {
if (e.answer && "object" == typeof e.answer && !Array.isArray(e.answer)) return {
kind: "link",
value: e.answer
};
})(e) : "15" === t.type ? ((e, t) => {
if (!Array.isArray(e.answer) || !Array.isArray(t.options)) return;
if (0 === t.options.length || e.answer.length !== t.options.length) return;
const a = [];
let n = 0;
for (let r = 0; r < t.options.length; r++) {
const s = t.options[r];
if (!s || "object" != typeof s || !("options" in s)) {
a.push({
kind: "unsupported",
reason: "\u5b50\u9898\u65e0\u6cd5\u5339\u914d"
});
continue;
}
const i = matchChoiceCandidate({
...e,
answer: e.answer[r]
}, s);
i ? (n++, a.push(i)) : a.push({
kind: "unsupported",
reason: "\u5b50\u9898\u65e0\u7b54\u6848"
});
}
return n > 0 ? {
kind: "reading",
subPlans: a
} : void 0;
})(e, t) : void 0;
}, matchAnswerCandidates = (e, t) => {
for (const a of e) {
const n = findPlan(a, t);
if (n) return {
haveAnswer: !0,
source: a,
fillPlan: n,
displayAnswers: e
};
}
return ((e, t = "\u7b54\u6848\u6570\u91cf\u6216\u5185\u5bb9\u65e0\u6cd5\u5339\u914d\u5f53\u524d\u9898\u76ee") => ({
haveAnswer: !1,
displayAnswers: e,
reason: t
}))(e);
}, isBlankAnswer = e => null == e || ("string" == typeof e ? "" === e.trim() : !!Array.isArray(e) && (0 === e.length || e.every(isBlankAnswer))), normalizeAnswerArray = e => e.map((e => Array.isArray(e) ? normalizeAnswerArray(e) : "string" == typeof e ? e.trim() : e)).filter((e => !isBlankAnswer(e))), normalizeAnswerCandidates = e => e.map(((e, t) => {
const a = (e => {
if (null == e) return [];
if ("string" == typeof e) {
return e.trim() || [];
}
return Array.isArray(e) ? e.map((e => Array.isArray(e) ? normalizeAnswerArray(e) : "string" == typeof e ? e.trim() : e)).filter((e => Array.isArray(e) || !isBlankAnswer(e))) : e;
})(null == e ? void 0 : e.answer);
return {
source: (null == e ? void 0 : e.form) || (null == e ? void 0 : e.source) || "\u672a\u77e5\u6765\u6e90",
answer: a,
valid: !isBlankAnswer(a),
duration: null == e ? void 0 : e.duration,
msg: null == e ? void 0 : e.msg,
needLogin: null == e ? void 0 : e.needLogin,
raw: (null == e ? void 0 : e.raw) ?? e,
priority: "number" == typeof (null == e ? void 0 : e.priority) ? e.priority : t
};
})), randomIndex = (e, t) => Math.floor(t() * e);
class Answer {
constructor() {}
static score(e, t) {
let a = Cache.get("api_" + e, {
score: 0
});
a.score += t, Cache.set("api_" + e, a, 600);
}
static async getAllAnswers(e) {
const t = [ this.getAnswer1(e) ];
return Promise.all(t);
}
static async getAnswersFree(e) {
const t = [ this.getMainAnswer(e), this.getAnswer1(e) ];
return Promise.all(t);
}
static async getAnswer1(e) {
let t = function() {
let e = Array.from({
length: 4
}, (() => Math.floor(255 * Math.random()))).join(".");
return {
"X-Forwarded-For": e,
"X-Real-IP": e
};
}();
return new Promise((a => {
request("http://cx.icodef.com/wyn-nb?v=4", "POST", {
question: e.question
}, t).then((e => {
let t = e[1];
try {
e = JSON.parse(e[0].responseText);
} catch (r) {
a({
form: "\u4e00\u4e4b\u9898\u5e93",
answer: null,
error: r,
duration: t
});
}
let n = "";
if (1 === e.code) {
let t = e.data.replace(/javascript:void\(0\);/g, "").trim().replace(/\n/g, "");
[ "\u53db\u9006", "\u516c\u4f17\u53f7", "\u674e\u6052\u96c5", "\u4e00\u4e4b" ].every((e => !t.includes(e))) && (n = t.split("#"));
}
a({
form: "\u4e00\u4e4b\u9898\u5e93",
answer: n,
duration: t
});
})).catch((e => {
"timeout" === e && this.score("icodef", -1), a({
form: "\u4e00\u4e4b\u9898\u5e93",
answer: "",
msg: e,
duration: 5e3
});
}));
}));
}
static async getAnswer2(e) {
return new Promise((t => {
[ 0, 1, 2 ].includes(parseInt(e.type)) ? request("https://api.muketool.com/cx/v2/query", "POST", {
question: e.question,
type: parseInt(e.type)
}, {}).then((e => {
let a = e[1];
e = JSON.parse(e[0].responseText), t({
form: "muketool",
answer: 1 === e.code ? e.data.split("#") : "",
duration: a
});
})).catch((e => {
"timeout" === e && this.score("muketool", -1), t({
form: "muketool",
answer: ""
});
})) : t({
form: "muketool",
answer: "",
duration: "\u4e0d\u652f\u6301\u7684\u9898\u578b"
});
}));
}
static getTimestamp() {
return Math.floor((new Date).getTime() / 1e3);
}
static cacheAnswer(e) {
const t = {
type: e.type,
question: e.question,
options: e.options,
answer: e.answer
}, a = questionHash(t.type, t.question, t.options);
t.createTime = this.getTimestamp(), Cache.set("ques1_" + a, t);
}
static async getCacheAnswer(e) {
const t = questionHash(e.type, e.question, e.options);
e.type, e.question, e.options;
let a = Cache.get("ques1_" + t);
return a ? {
form: "\u672c\u5730\u7f13\u5b58",
answer: a.answer,
duration: 10
} : {
form: "\u672c\u5730\u7f13\u5b58",
answer: "",
duration: 10,
msg: "\u672a\u627e\u5230\u7f13\u5b58"
};
}
static getMainAnswer(e) {
const t = {
type: e.type,
question: e.question,
options: e.options.map((e => e)),
workType: e.workType,
pageType: e.pageType
};
return new Promise((e => {
requestApi("https://www.aiask.site/v1/question/search", "POST", t, {}).then((t => {
let a = t[1];
200 === (t = JSON.parse(t[0].responseText)).code && t.data.answer ? e({
form: "\u7231\u95ee\u7b54\u9898\u5e93",
answer: t.data.answer,
duration: a,
msg: t.message
}) : 401 === t.code ? e({
form: "\u7231\u95ee\u7b54\u9898\u5e93",
answer: "",
duration: a,
msg: t.message,
needLogin: !0
}) : e({
form: "\u7231\u95ee\u7b54\u9898\u5e93",
answer: "",
duration: a,
msg: t.message
});
})).catch((t => {
e({
form: "\u7231\u95ee\u7b54\u9898\u5e93",
answer: "",
error: t,
duration: 10,
msg: "\u8bf7\u6c42\u5931\u8d25"
});
}));
}));
}
static async syncQuestionList(e) {
return new Promise((t => {
requestApi("https://www.aiask.site/v1/question/sync", "POST", e, {}).then((e => {
e[0].responseText, t(e[0].responseText);
})).catch((e => {
t(e);
}));
}));
}
static async syncPaper(e) {
return new Promise(((t, a) => {
requestApi("https://www.aiask.site/v1/question/courseSync", "POST", e, {}).then((e => {
try {
const a = e[0].responseText, n = JSON.parse(a);
n && (200 === n.code || 0 === n.code || n.success), t(n);
} catch (a) {
t({
code: -1,
error: a,
msg: "\u54cd\u5e94\u89e3\u6790\u5931\u8d25"
});
}
})).catch((e => {
t({
code: -1,
error: e,
msg: "\u7f51\u7edc\u8bf7\u6c42\u5931\u8d25"
});
}));
}));
}
}
const resolveQuestionOptions = e => {
const resolveOptions = e => {
if ((null == e ? void 0 : e.$options) && "function" == typeof e.$options) try {
e.$options = e.$options();
} catch (t) {}
};
return resolveOptions(e), Array.isArray(null == e ? void 0 : e.options) && e.options.forEach((e => {
e && "object" == typeof e && resolveOptions(e);
})), e;
}, defaultSetAnswer = async (e, t, a, n, r) => {
var s;
switch (assertFillShouldContinue(r), e) {
case "xx":
for (let s = 0; s < a.$options.length; s++) if (assertFillShouldContinue(r), t.includes(s)) {
if (n.ischecked && n.ischecked(a.$options.eq(s))) continue;
a.$options.eq(s).click(), await sleep(Math.floor(300 * Math.random() + 200));
} else n.ischecked && n.ischecked(a.$options.eq(s)) && (a.$options.eq(s).click(),
await sleep(Math.floor(300 * Math.random() + 200)));
break;
case "pd":
let e = t;
0 == a.options.length ? a.$options.each(((t, a) => {
assertFillShouldContinue(r), isTrue(e) && isTrue(removeHtml(K(a).html())) && K(a).click(),
isFalse(e) && isFalse(removeHtml(K(a).html())) && K(a).click();
})) : a.$options.each(((t, n) => {
assertFillShouldContinue(r), isTrue(e) && isTrue(a.options[t]) && K(n).click(),
isFalse(e) && isFalse(a.options[t]) && K(n).click();
}));
break;
case "jd":
K(a.html).find("textarea").each((function(e) {
assertFillShouldContinue(r), ce.UE.getEditor(K(this).attr("name")).ready((function() {
this.setContent(t[e].replace(/\u7b2c.\u7a7a:/g, ""));
}));
})), null == (s = K(a.html).find(".savebtndiv>a")) || s.click();
break;
case "ydlj":
if (Array.isArray(t) && a.options) for (let s = 0; s < t.length && s < a.options.length; s++) {
assertFillShouldContinue(r);
let e = t[s], i = a.options[s];
if (Array.isArray(e) && e.length > 0 && i.$options) for (let t = 0; t < i.$options.length; t++) if (assertFillShouldContinue(r),
e.includes(t)) {
if (n.ischecked && n.ischecked(i.$options.eq(t))) continue;
i.$options.eq(t).click(), await sleep(Math.floor(300 * Math.random() + 200));
} else n.ischecked && n.ischecked(i.$options.eq(t)) && (i.$options.eq(t).click(),
await sleep(Math.floor(300 * Math.random() + 200)));
}
}
}, applyAnswerResult = async (e, t, a, n, r) => {
let s = !0;
assertFillShouldContinue(r), n.setAnswerHook && "function" == typeof n.setAnswerHook && await n.setAnswerHook({
type: a.type,
answer: t,
html: a.html,
ques: a
}), assertFillShouldContinue(r), n.setAnswer && "function" == typeof n.setAnswer && (s = await n.setAnswer({
type: a.type,
answer: t,
html: a.html,
ques: a,
rule: n
})), assertFillShouldContinue(r), s && await defaultSetAnswer(e, t, a, n, r);
}, ApiAnswerMatch = async (e, t, a = !1) => {
const n = getAskStore();
resolveQuestionOptions(t);
const r = normalizeAnswerCandidates(((e, t, a = !1) => a && ("0" === (null == t ? void 0 : t.type) || "1" === (null == t ? void 0 : t.type)) && Array.isArray(e) && Array.isArray(null == t ? void 0 : t.options) ? e.map((e => ({
...e,
answer: mapChoiceLettersToOptions(null == e ? void 0 : e.answer, t.options)
}))) : e)(e, t, a)), s = matchAnswerCandidates(r, t);
if (!s.haveAnswer || !s.fillPlan) return createLegacyMatchResult(s);
const i = await applyFillPlan(s.fillPlan, t, n.rule, applyAnswerResult);
return i.success ? createLegacyMatchResult(s) : {
...createLegacyMatchResult(s),
haveAnswer: !1,
reason: i.reason
};
}, Ie = class _Paper {
static getPaper(e) {
return Cache.get(`${_Paper.prefix}_${e}`);
}
static getLastSyncedHashes(e) {
const t = Cache.get(`${_Paper.lastSyncedPrefix}_${e}`, {
questions: [],
chapters: []
});
return {
questions: new Set(t.questions || []),
chapters: new Set(t.chapters || [])
};
}
static setLastSyncedHashes(e, t, a) {
Cache.set(`${_Paper.lastSyncedPrefix}_${e}`, {
questions: t,
chapters: a
});
}
static compareAndGetNewData(e, t) {
const a = _Paper.getLastSyncedHashes(t), n = new Set, r = new Set, s = new Map, i = new Map;
e.chapter && Array.isArray(e.chapter) && e.chapter.forEach((e => {
const t = e.hash;
r.add(t);
const a = new Map;
e.question && Array.isArray(e.question) && e.question.forEach((e => {
const t = e.hash;
n.add(t), s.set(t, e), a.set(t, e);
})), i.set(t, {
chapter: e,
questions: a
});
}));
const o = [], l = [];
n.forEach((e => {
a.questions.has(e) || o.push(e);
})), r.forEach((e => {
a.chapters.has(e) || l.push(e);
}));
const c = {
hash: e.hash,
name: e.name,
platform: e.platform,
info: e.info,
chapter: []
};
return i.forEach(((e, t) => {
if (l.includes(t)) c.chapter.push({
hash: e.chapter.hash,
name: e.chapter.name,
question: Array.from(e.questions.values())
}); else {
const t = [];
e.questions.forEach(((e, a) => {
o.includes(a) && t.push(e);
})), t.length > 0 && c.chapter.push({
hash: e.chapter.hash,
name: e.chapter.name,
question: t
});
}
})), {
newData: c,
newQuestionHashes: o,
newChapterHashes: l
};
}
static async setPaper(e, t) {
if (!e || !t) return;
const a = _Paper.getPaper(e) || {
chapter: []
};
t.chapter && t.chapter.forEach((e => {
const t = a.chapter.find((t => t.hash === e.hash));
t ? (e.question.forEach((e => {
const a = t.question.findIndex((t => t.hash === e.hash));
-1 !== a ? t.question[a] = e : t.question.push(e);
})), Object.keys(e).forEach((a => {
"question" !== a && (t[a] = e[a]);
}))) : a.chapter.push(e);
})), Object.keys(t).forEach((e => {
"chapter" !== e && (a[e] = t[e]);
})), Cache.set(`${_Paper.prefix}_${e}`, a);
const {newData: n, newQuestionHashes: r, newChapterHashes: s} = _Paper.compareAndGetNewData(a, e);
if (r.length > 0 || s.length > 0) {
if (0 === n.chapter.length) return;
r.length, s.length;
try {
const t = await Answer.syncPaper(n);
let a;
if ("string" == typeof t) try {
a = JSON.parse(t);
} catch (i) {
return;
} else a = t;
if (!a || 200 !== a.code && 0 !== a.code && !0 !== a.success) JSON.stringify(a); else {
const t = _Paper.getLastSyncedHashes(e), a = Array.from(new Set([ ...t.questions, ...r ])), n = Array.from(new Set([ ...t.chapters, ...s ]));
_Paper.setLastSyncedHashes(e, a, n), r.length, s.length;
}
} catch (o) {}
}
}
static hasChapter(e, t) {
const a = _Paper.getPaper(e);
return !(!a || !a.chapter) && a.chapter.some((e => e.hash === t));
}
static getAllPapers() {
return Cache.matchGet(`${_Paper.prefix}_`);
}
};
__publicField(Ie, "prefix", "paper_"), __publicField(Ie, "lastSyncedPrefix", "paper_last_synced_");
let Ee = Ie;
var Ue = {
parse: function(e) {
var t = Ue._bin, a = new Uint8Array(e), n = 0;
t.readFixed(a, n), n += 4;
var r = t.readUshort(a, n);
n += 2, t.readUshort(a, n), n += 2, t.readUshort(a, n), n += 2, t.readUshort(a, n),
n += 2;
for (var s = [ "cmap", "head", "hhea", "maxp", "hmtx", "name", "OS/2", "post", "loca", "glyf", "kern", "CFF ", "GPOS", "GSUB", "SVG " ], i = {
_data: a
}, o = {}, l = 0; l < r; l++) {
var c = t.readASCII(a, n, 4);
n += 4, t.readUint(a, n), n += 4;
var p = t.readUint(a, n);
n += 4;
var u = t.readUint(a, n);
n += 4, o[c] = {
offset: p,
length: u
};
}
for (l = 0; l < s.length; l++) {
var d = s[l];
o[d] && (i[d.trim()] = Ue[d.trim()].parse(a, o[d].offset, o[d].length, i));
}
return i;
},
_tabOffset: function(e, t) {
for (var a = Ue._bin, n = a.readUshort(e, 4), r = 12, s = 0; s < n; s++) {
var i = a.readASCII(e, r, 4);
r += 4, a.readUint(e, r), r += 4;
var o = a.readUint(e, r);
if (r += 4, a.readUint(e, r), r += 4, i == t) return o;
}
return 0;
}
};
Ue._bin = {
readFixed: function(e, t) {
return (e[t] << 8 | e[t + 1]) + (e[t + 2] << 8 | e[t + 3]) / 65540;
},
readF2dot14: function(e, t) {
return Ue._bin.readShort(e, t) / 16384;
},
readInt: function(e, t) {
var a = Ue._bin.t.uint8;
return a[0] = e[t + 3], a[1] = e[t + 2], a[2] = e[t + 1], a[3] = e[t], Ue._bin.t.int32[0];
},
readInt8: function(e, t) {
return Ue._bin.t.uint8[0] = e[t], Ue._bin.t.int8[0];
},
readShort: function(e, t) {
var a = Ue._bin.t.uint8;
return a[1] = e[t], a[0] = e[t + 1], Ue._bin.t.int16[0];
},
readUshort: function(e, t) {
return e[t] << 8 | e[t + 1];
},
readUshorts: function(e, t, a) {
for (var n = [], r = 0; r < a; r++) n.push(Ue._bin.readUshort(e, t + 2 * r));
return n;
},
readUint: function(e, t) {
var a = Ue._bin.t.uint8;
return a[3] = e[t], a[2] = e[t + 1], a[1] = e[t + 2], a[0] = e[t + 3], Ue._bin.t.uint32[0];
},
readUint64: function(e, t) {
return 4294967296 * Ue._bin.readUint(e, t) + Ue._bin.readUint(e, t + 4);
},
readASCII: function(e, t, a) {
for (var n = "", r = 0; r < a; r++) n += String.fromCharCode(e[t + r]);
return n;
},
readUnicode: function(e, t, a) {
for (var n = "", r = 0; r < a; r++) {
var s = e[t++] << 8 | e[t++];
n += String.fromCharCode(s);
}
return n;
},
_tdec: window.TextDecoder ? new window.TextDecoder : null,
readUTF8: function(e, t, a) {
var n = Ue._bin._tdec;
return n && 0 == t && a == e.length ? n.decode(e) : Ue._bin.readASCII(e, t, a);
},
readBytes: function(e, t, a) {
for (var n = [], r = 0; r < a; r++) n.push(e[t + r]);
return n;
},
readASCIIArray: function(e, t, a) {
for (var n = [], r = 0; r < a; r++) n.push(String.fromCharCode(e[t + r]));
return n;
}
}, Ue._bin.t = {
buff: new ArrayBuffer(8)
}, Ue._bin.t.int8 = new Int8Array(Ue._bin.t.buff), Ue._bin.t.uint8 = new Uint8Array(Ue._bin.t.buff),
Ue._bin.t.int16 = new Int16Array(Ue._bin.t.buff), Ue._bin.t.uint16 = new Uint16Array(Ue._bin.t.buff),
Ue._bin.t.int32 = new Int32Array(Ue._bin.t.buff), Ue._bin.t.uint32 = new Uint32Array(Ue._bin.t.buff),
Ue._lctf = {}, Ue._lctf.parse = function(e, t, a, n, r) {
var s = Ue._bin, i = {}, o = t;
s.readFixed(e, t), t += 4;
var l = s.readUshort(e, t);
t += 2;
var c = s.readUshort(e, t);
t += 2;
var p = s.readUshort(e, t);
return t += 2, i.scriptList = Ue._lctf.readScriptList(e, o + l), i.featureList = Ue._lctf.readFeatureList(e, o + c),
i.lookupList = Ue._lctf.readLookupList(e, o + p, r), i;
}, Ue._lctf.readLookupList = function(e, t, a) {
var n = Ue._bin, r = t, s = [], i = n.readUshort(e, t);
t += 2;
for (var o = 0; o < i; o++) {
var l = n.readUshort(e, t);
t += 2;
var c = Ue._lctf.readLookupTable(e, r + l, a);
s.push(c);
}
return s;
}, Ue._lctf.readLookupTable = function(e, t, a) {
var n = Ue._bin, r = t, s = {
tabs: []
};
s.ltype = n.readUshort(e, t), t += 2, s.flag = n.readUshort(e, t), t += 2;
var i = n.readUshort(e, t);
t += 2;
for (var o = 0; o < i; o++) {
var l = n.readUshort(e, t);
t += 2;
var c = a(e, s.ltype, r + l);
s.tabs.push(c);
}
return s;
}, Ue._lctf.numOfOnes = function(e) {
for (var t = 0, a = 0; a < 32; a++) e >>> a & 1 && t++;
return t;
}, Ue._lctf.readClassDef = function(e, t) {
var a = Ue._bin, n = [], r = a.readUshort(e, t);
if (t += 2, 1 == r) {
var s = a.readUshort(e, t);
t += 2;
var i = a.readUshort(e, t);
t += 2;
for (var o = 0; o < i; o++) n.push(s + o), n.push(s + o), n.push(a.readUshort(e, t)),
t += 2;
}
if (2 == r) {
var l = a.readUshort(e, t);
t += 2;
for (o = 0; o < l; o++) n.push(a.readUshort(e, t)), t += 2, n.push(a.readUshort(e, t)),
t += 2, n.push(a.readUshort(e, t)), t += 2;
}
return n;
}, Ue._lctf.getInterval = function(e, t) {
for (var a = 0; a < e.length; a += 3) {
var n = e[a], r = e[a + 1];
if (e[a + 2], n <= t && t <= r) return a;
}
return -1;
}, Ue._lctf.readValueRecord = function(e, t, a) {
var n = Ue._bin, r = [];
return r.push(1 & a ? n.readShort(e, t) : 0), t += 1 & a ? 2 : 0, r.push(2 & a ? n.readShort(e, t) : 0),
t += 2 & a ? 2 : 0, r.push(4 & a ? n.readShort(e, t) : 0), t += 4 & a ? 2 : 0, r.push(8 & a ? n.readShort(e, t) : 0),
t += 8 & a ? 2 : 0, r;
}, Ue._lctf.readCoverage = function(e, t) {
var a = Ue._bin, n = {};
n.fmt = a.readUshort(e, t), t += 2;
var r = a.readUshort(e, t);
return t += 2, 1 == n.fmt && (n.tab = a.readUshorts(e, t, r)), 2 == n.fmt && (n.tab = a.readUshorts(e, t, 3 * r)),
n;
}, Ue._lctf.coverageIndex = function(e, t) {
var a = e.tab;
if (1 == e.fmt) return a.indexOf(t);
if (2 == e.fmt) {
var n = Ue._lctf.getInterval(a, t);
if (-1 != n) return a[n + 2] + (t - a[n]);
}
return -1;
}, Ue._lctf.readFeatureList = function(e, t) {
var a = Ue._bin, n = t, r = [], s = a.readUshort(e, t);
t += 2;
for (var i = 0; i < s; i++) {
var o = a.readASCII(e, t, 4);
t += 4;
var l = a.readUshort(e, t);
t += 2, r.push({
tag: o.trim(),
tab: Ue._lctf.readFeatureTable(e, n + l)
});
}
return r;
}, Ue._lctf.readFeatureTable = function(e, t) {
var a = Ue._bin;
a.readUshort(e, t), t += 2;
var n = a.readUshort(e, t);
t += 2;
for (var r = [], s = 0; s < n; s++) r.push(a.readUshort(e, t + 2 * s));
return r;
}, Ue._lctf.readScriptList = function(e, t) {
var a = Ue._bin, n = t, r = {}, s = a.readUshort(e, t);
t += 2;
for (var i = 0; i < s; i++) {
var o = a.readASCII(e, t, 4);
t += 4;
var l = a.readUshort(e, t);
t += 2, r[o.trim()] = Ue._lctf.readScriptTable(e, n + l);
}
return r;
}, Ue._lctf.readScriptTable = function(e, t) {
var a = Ue._bin, n = t, r = {}, s = a.readUshort(e, t);
t += 2, r.default = Ue._lctf.readLangSysTable(e, n + s);
var i = a.readUshort(e, t);
t += 2;
for (var o = 0; o < i; o++) {
var l = a.readASCII(e, t, 4);
t += 4;
var c = a.readUshort(e, t);
t += 2, r[l.trim()] = Ue._lctf.readLangSysTable(e, n + c);
}
return r;
}, Ue._lctf.readLangSysTable = function(e, t) {
var a = Ue._bin, n = {};
a.readUshort(e, t), t += 2, n.reqFeature = a.readUshort(e, t), t += 2;
var r = a.readUshort(e, t);
return t += 2, n.features = a.readUshorts(e, t, r), n;
}, Ue.CFF = {}, Ue.CFF.parse = function(e, t, a) {
var n = Ue._bin;
(e = new Uint8Array(e.buffer, t, a))[t = 0], e[++t], e[++t], e[++t], t++;
var r = [];
t = Ue.CFF.readIndex(e, t, r);
for (var s = [], i = 0; i < r.length - 1; i++) s.push(n.readASCII(e, t + r[i], r[i + 1] - r[i]));
t += r[r.length - 1];
var o = [];
t = Ue.CFF.readIndex(e, t, o);
var l = [];
for (i = 0; i < o.length - 1; i++) l.push(Ue.CFF.readDict(e, t + o[i], t + o[i + 1]));
t += o[o.length - 1];
var c = l[0], p = [];
t = Ue.CFF.readIndex(e, t, p);
var u = [];
for (i = 0; i < p.length - 1; i++) u.push(n.readASCII(e, t + p[i], p[i + 1] - p[i]));
if (t += p[p.length - 1], Ue.CFF.readSubrs(e, t, c), c.CharStrings) {
t = c.CharStrings;
p = [];
t = Ue.CFF.readIndex(e, t, p);
var d = [];
for (i = 0; i < p.length - 1; i++) d.push(n.readBytes(e, t + p[i], p[i + 1] - p[i]));
c.CharStrings = d;
}
c.Encoding && (c.Encoding = Ue.CFF.readEncoding(e, c.Encoding, c.CharStrings.length)),
c.charset && (c.charset = Ue.CFF.readCharset(e, c.charset, c.CharStrings.length)),
c.Private && (t = c.Private[1], c.Private = Ue.CFF.readDict(e, t, t + c.Private[0]),
c.Private.Subrs && Ue.CFF.readSubrs(e, t + c.Private.Subrs, c.Private));
var m = {};
for (var h in c) -1 != [ "FamilyName", "FullName", "Notice", "version", "Copyright" ].indexOf(h) ? m[h] = u[c[h] - 426 + 35] : m[h] = c[h];
return m;
}, Ue.CFF.readSubrs = function(e, t, a) {
var n = Ue._bin, r = [];
t = Ue.CFF.readIndex(e, t, r);
var s, i = r.length;
s = i < 1240 ? 107 : i < 33900 ? 1131 : 32768, a.Bias = s, a.Subrs = [];
for (var o = 0; o < r.length - 1; o++) a.Subrs.push(n.readBytes(e, t + r[o], r[o + 1] - r[o]));
}, Ue.CFF.tableSE = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 111, 112, 113, 114, 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, 126, 127, 128, 129, 130, 131, 0, 132, 133, 0, 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, 139, 0, 0, 0, 0, 140, 141, 142, 143, 0, 0, 0, 0, 0, 144, 0, 0, 0, 145, 0, 0, 146, 147, 148, 149, 0, 0, 0, 0 ],
Ue.CFF.glyphByUnicode = function(e, t) {
for (var a = 0; a < e.charset.length; a++) if (e.charset[a] == t) return a;
return -1;
}, Ue.CFF.glyphBySE = function(e, t) {
return t < 0 || t > 255 ? -1 : Ue.CFF.glyphByUnicode(e, Ue.CFF.tableSE[t]);
}, Ue.CFF.readEncoding = function(e, t, a) {
Ue._bin;
var n = [ ".notdef" ], r = e[t];
if (t++, 0 != r) throw "error: unknown encoding format: " + r;
var s = e[t];
t++;
for (var i = 0; i < s; i++) n.push(e[t + i]);
return n;
}, Ue.CFF.readCharset = function(e, t, a) {
var n = Ue._bin, r = [ ".notdef" ], s = e[t];
if (t++, 0 == s) for (var i = 0; i < a; i++) {
var o = n.readUshort(e, t);
t += 2, r.push(o);
} else {
if (1 != s && 2 != s) throw "error: format: " + s;
for (;r.length < a; ) {
o = n.readUshort(e, t);
t += 2;
var l = 0;
1 == s ? (l = e[t], t++) : (l = n.readUshort(e, t), t += 2);
for (i = 0; i <= l; i++) r.push(o), o++;
}
}
return r;
}, Ue.CFF.readIndex = function(e, t, a) {
var n = Ue._bin, r = n.readUshort(e, t), s = e[t += 2];
if (t++, 1 == s) for (var i = 0; i < r + 1; i++) a.push(e[t + i]); else if (2 == s) for (i = 0; i < r + 1; i++) a.push(n.readUshort(e, t + 2 * i)); else if (3 == s) for (i = 0; i < r + 1; i++) a.push(16777215 & n.readUint(e, t + 3 * i - 1)); else if (0 != r) throw "unsupported offset size: " + s + ", count: " + r;
return (t += (r + 1) * s) - 1;
}, Ue.CFF.getCharString = function(e, t, a) {
var n = Ue._bin, r = e[t], s = e[t + 1];
e[t + 2], e[t + 3], e[t + 4];
var i = 1, o = null, l = null;
r <= 20 && (o = r, i = 1), 12 == r && (o = 100 * r + s, i = 2), 21 <= r && r <= 27 && (o = r,
i = 1), 28 == r && (l = n.readShort(e, t + 1), i = 3), 29 <= r && r <= 31 && (o = r,
i = 1), 32 <= r && r <= 246 && (l = r - 139, i = 1), 247 <= r && r <= 250 && (l = 256 * (r - 247) + s + 108,
i = 2), 251 <= r && r <= 254 && (l = 256 * -(r - 251) - s - 108, i = 2), 255 == r && (l = n.readInt(e, t + 1) / 65535,
i = 5), a.val = null != l ? l : "o" + o, a.size = i;
}, Ue.CFF.readCharString = function(e, t, a) {
for (var n = t + a, r = Ue._bin, s = []; t < n; ) {
var i = e[t], o = e[t + 1];
e[t + 2], e[t + 3], e[t + 4];
var l = 1, c = null, p = null;
i <= 20 && (c = i, l = 1), 12 == i && (c = 100 * i + o, l = 2), 19 != i && 20 != i || (c = i,
l = 2), 21 <= i && i <= 27 && (c = i, l = 1), 28 == i && (p = r.readShort(e, t + 1),
l = 3), 29 <= i && i <= 31 && (c = i, l = 1), 32 <= i && i <= 246 && (p = i - 139,
l = 1), 247 <= i && i <= 250 && (p = 256 * (i - 247) + o + 108, l = 2), 251 <= i && i <= 254 && (p = 256 * -(i - 251) - o - 108,
l = 2), 255 == i && (p = r.readInt(e, t + 1) / 65535, l = 5), s.push(null != p ? p : "o" + c),
t += l;
}
return s;
}, Ue.CFF.readDict = function(e, t, a) {
for (var n = Ue._bin, r = {}, s = []; t < a; ) {
var i = e[t], o = e[t + 1];
e[t + 2], e[t + 3], e[t + 4];
var l = 1, c = null, p = null;
if (28 == i && (p = n.readShort(e, t + 1), l = 3), 29 == i && (p = n.readInt(e, t + 1),
l = 5), 32 <= i && i <= 246 && (p = i - 139, l = 1), 247 <= i && i <= 250 && (p = 256 * (i - 247) + o + 108,
l = 2), 251 <= i && i <= 254 && (p = 256 * -(i - 251) - o - 108, l = 2), 255 == i) throw p = n.readInt(e, t + 1) / 65535,
l = 5, "unknown number";
if (30 == i) {
var u = [];
for (l = 1; ;) {
var d = e[t + l];
l++;
var m = d >> 4, h = 15 & d;
if (15 != m && u.push(m), 15 != h && u.push(h), 15 == h) break;
}
for (var f = "", g = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ".", "e", "e-", "reserved", "-", "endOfNumber" ], v = 0; v < u.length; v++) f += g[u[v]];
p = parseFloat(f);
}
if (i <= 21) if (c = [ "version", "Notice", "FullName", "FamilyName", "Weight", "FontBBox", "BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StdHW", "StdVW", "escape", "UniqueID", "XUID", "charset", "Encoding", "CharStrings", "Private", "Subrs", "defaultWidthX", "nominalWidthX" ][i],
l = 1, 12 == i) c = [ "Copyright", "isFixedPitch", "ItalicAngle", "UnderlinePosition", "UnderlineThickness", "PaintType", "CharstringType", "FontMatrix", "StrokeWidth", "BlueScale", "BlueShift", "BlueFuzz", "StemSnapH", "StemSnapV", "ForceBold", 0, 0, "LanguageGroup", "ExpansionFactor", "initialRandomSeed", "SyntheticBase", "PostScript", "BaseFontName", "BaseFontBlend", 0, 0, 0, 0, 0, 0, "ROS", "CIDFontVersion", "CIDFontRevision", "CIDFontType", "CIDCount", "UIDBase", "FDArray", "FDSelect", "FontName" ][o],
l = 2;
null != c ? (r[c] = 1 == s.length ? s[0] : s, s = []) : s.push(p), t += l;
}
return r;
}, Ue.cmap = {}, Ue.cmap.parse = function(e, t, a) {
e = new Uint8Array(e.buffer, t, a), t = 0;
var n = Ue._bin, r = {};
n.readUshort(e, t), t += 2;
var s = n.readUshort(e, t);
t += 2;
var i = [];
r.tables = [];
for (var o = 0; o < s; o++) {
var l = n.readUshort(e, t);
t += 2;
var c = n.readUshort(e, t);
t += 2;
var p = n.readUint(e, t);
t += 4;
var u = "p" + l + "e" + c, d = i.indexOf(p);
if (-1 == d) {
var m;
d = r.tables.length, i.push(p);
var h = n.readUshort(e, p);
0 == h ? m = Ue.cmap.parse0(e, p) : 4 == h ? m = Ue.cmap.parse4(e, p) : 6 == h ? m = Ue.cmap.parse6(e, p) : 12 == h ? m = Ue.cmap.parse12(e, p) : console.log("unknown format: " + h, l, c, p),
r.tables.push(m);
}
if (null != r[u]) throw "multiple tables for one platform+encoding";
r[u] = d;
}
return r;
}, Ue.cmap.parse0 = function(e, t) {
var a = Ue._bin, n = {};
n.format = a.readUshort(e, t), t += 2;
var r = a.readUshort(e, t);
t += 2, a.readUshort(e, t), t += 2, n.map = [];
for (var s = 0; s < r - 6; s++) n.map.push(e[t + s]);
return n;
}, Ue.cmap.parse4 = function(e, t) {
var a = Ue._bin, n = t, r = {};
r.format = a.readUshort(e, t), t += 2;
var s = a.readUshort(e, t);
t += 2, a.readUshort(e, t), t += 2;
var i = a.readUshort(e, t);
t += 2;
var o = i / 2;
r.searchRange = a.readUshort(e, t), t += 2, r.entrySelector = a.readUshort(e, t),
t += 2, r.rangeShift = a.readUshort(e, t), t += 2, r.endCount = a.readUshorts(e, t, o),
t += 2 * o, t += 2, r.startCount = a.readUshorts(e, t, o), t += 2 * o, r.idDelta = [];
for (var l = 0; l < o; l++) r.idDelta.push(a.readShort(e, t)), t += 2;
for (r.idRangeOffset = a.readUshorts(e, t, o), t += 2 * o, r.glyphIdArray = []; t < n + s; ) r.glyphIdArray.push(a.readUshort(e, t)),
t += 2;
return r;
}, Ue.cmap.parse6 = function(e, t) {
var a = Ue._bin, n = {};
n.format = a.readUshort(e, t), t += 2, a.readUshort(e, t), t += 2, a.readUshort(e, t),
t += 2, n.firstCode = a.readUshort(e, t), t += 2;
var r = a.readUshort(e, t);
t += 2, n.glyphIdArray = [];
for (var s = 0; s < r; s++) n.glyphIdArray.push(a.readUshort(e, t)), t += 2;
return n;
}, Ue.cmap.parse12 = function(e, t) {
var a = Ue._bin, n = {};
n.format = a.readUshort(e, t), t += 2, t += 2, a.readUint(e, t), t += 4, a.readUint(e, t),
t += 4;
var r = a.readUint(e, t);
t += 4, n.groups = [];
for (var s = 0; s < r; s++) {
var i = t + 12 * s, o = a.readUint(e, i + 0), l = a.readUint(e, i + 4), c = a.readUint(e, i + 8);
n.groups.push([ o, l, c ]);
}
return n;
}, Ue.glyf = {}, Ue.glyf.parse = function(e, t, a, n) {
for (var r = [], s = 0; s < n.maxp.numGlyphs; s++) r.push(null);
return r;
}, Ue.glyf._parseGlyf = function(e, t) {
var a = Ue._bin, n = e._data, r = Ue._tabOffset(n, "glyf") + e.loca[t];
if (e.loca[t] == e.loca[t + 1]) return null;
var s = {};
if (s.noc = a.readShort(n, r), r += 2, s.xMin = a.readShort(n, r), r += 2, s.yMin = a.readShort(n, r),
r += 2, s.xMax = a.readShort(n, r), r += 2, s.yMax = a.readShort(n, r), r += 2,
s.xMin >= s.xMax || s.yMin >= s.yMax) return null;
if (s.noc > 0) {
s.endPts = [];
for (var i = 0; i < s.noc; i++) s.endPts.push(a.readUshort(n, r)), r += 2;
var o = a.readUshort(n, r);
if (r += 2, n.length - r < o) return null;
s.instructions = a.readBytes(n, r, o), r += o;
var l = s.endPts[s.noc - 1] + 1;
s.flags = [];
for (i = 0; i < l; i++) {
var c = n[r];
if (r++, s.flags.push(c), 8 & c) {
var p = n[r];
r++;
for (var u = 0; u < p; u++) s.flags.push(c), i++;
}
}
s.xs = [];
for (i = 0; i < l; i++) {
var d = !!(2 & s.flags[i]), m = !!(16 & s.flags[i]);
d ? (s.xs.push(m ? n[r] : -n[r]), r++) : m ? s.xs.push(0) : (s.xs.push(a.readShort(n, r)),
r += 2);
}
s.ys = [];
for (i = 0; i < l; i++) {
d = !!(4 & s.flags[i]), m = !!(32 & s.flags[i]);
d ? (s.ys.push(m ? n[r] : -n[r]), r++) : m ? s.ys.push(0) : (s.ys.push(a.readShort(n, r)),
r += 2);
}
var h = 0, f = 0;
for (i = 0; i < l; i++) h += s.xs[i], f += s.ys[i], s.xs[i] = h, s.ys[i] = f;
} else {
var g;
s.parts = [];
do {
g = a.readUshort(n, r), r += 2;
var v = {
m: {
a: 1,
b: 0,
c: 0,
d: 1,
tx: 0,
ty: 0
},
p1: -1,
p2: -1
};
if (s.parts.push(v), v.glyphIndex = a.readUshort(n, r), r += 2, 1 & g) {
var y = a.readShort(n, r);
r += 2;
var b = a.readShort(n, r);
r += 2;
} else {
y = a.readInt8(n, r);
r++;
b = a.readInt8(n, r);
r++;
}
2 & g ? (v.m.tx = y, v.m.ty = b) : (v.p1 = y, v.p2 = b), 8 & g ? (v.m.a = v.m.d = a.readF2dot14(n, r),
r += 2) : 64 & g ? (v.m.a = a.readF2dot14(n, r), r += 2, v.m.d = a.readF2dot14(n, r),
r += 2) : 128 & g && (v.m.a = a.readF2dot14(n, r), r += 2, v.m.b = a.readF2dot14(n, r),
r += 2, v.m.c = a.readF2dot14(n, r), r += 2, v.m.d = a.readF2dot14(n, r), r += 2);
} while (32 & g);
if (256 & g) {
var w = a.readUshort(n, r);
r += 2, s.instr = [];
for (i = 0; i < w; i++) s.instr.push(n[r]), r++;
}
}
return s;
}, Ue.GPOS = {}, Ue.GPOS.parse = function(e, t, a, n) {
return Ue._lctf.parse(e, t, a, n, Ue.GPOS.subt);
}, Ue.GPOS.subt = function(e, t, a) {
if (2 != t) return null;
var n = Ue._bin, r = a, s = {};
s.format = n.readUshort(e, a), a += 2;
var i = n.readUshort(e, a);
a += 2, s.coverage = Ue._lctf.readCoverage(e, i + r), s.valFmt1 = n.readUshort(e, a),
a += 2, s.valFmt2 = n.readUshort(e, a), a += 2;
var o = Ue._lctf.numOfOnes(s.valFmt1), l = Ue._lctf.numOfOnes(s.valFmt2);
if (1 == s.format) {
s.pairsets = [];
var c = n.readUshort(e, a);
a += 2;
for (var p = 0; p < c; p++) {
var u = n.readUshort(e, a);
a += 2, u += r;
var d = n.readUshort(e, u);
u += 2;
for (var m = [], h = 0; h < d; h++) {
var f = n.readUshort(e, u);
u += 2, 0 != s.valFmt1 && (x = Ue._lctf.readValueRecord(e, u, s.valFmt1), u += 2 * o),
0 != s.valFmt2 && (k = Ue._lctf.readValueRecord(e, u, s.valFmt2), u += 2 * l), m.push({
gid2: f,
val1: x,
val2: k
});
}
s.pairsets.push(m);
}
}
if (2 == s.format) {
var g = n.readUshort(e, a);
a += 2;
var v = n.readUshort(e, a);
a += 2;
var y = n.readUshort(e, a);
a += 2;
var b = n.readUshort(e, a);
a += 2, s.classDef1 = Ue._lctf.readClassDef(e, r + g), s.classDef2 = Ue._lctf.readClassDef(e, r + v),
s.matrix = [];
for (p = 0; p < y; p++) {
var w = [];
for (h = 0; h < b; h++) {
var x = null, k = null;
0 != s.valFmt1 && (x = Ue._lctf.readValueRecord(e, a, s.valFmt1), a += 2 * o), 0 != s.valFmt2 && (k = Ue._lctf.readValueRecord(e, a, s.valFmt2),
a += 2 * l), w.push({
val1: x,
val2: k
});
}
s.matrix.push(w);
}
}
return s;
}, Ue.GSUB = {}, Ue.GSUB.parse = function(e, t, a, n) {
return Ue._lctf.parse(e, t, a, n, Ue.GSUB.subt);
}, Ue.GSUB.subt = function(e, t, a) {
var n = Ue._bin, r = a, s = {};
if (1 != t && 4 != t && 5 != t) return null;
s.fmt = n.readUshort(e, a), a += 2;
var i = n.readUshort(e, a);
if (a += 2, s.coverage = Ue._lctf.readCoverage(e, i + r), 1 == t) {
if (1 == s.fmt) s.delta = n.readShort(e, a), a += 2; else if (2 == s.fmt) {
var o = n.readUshort(e, a);
a += 2, s.newg = n.readUshorts(e, a, o), a += 2 * s.newg.length;
}
} else if (4 == t) {
s.vals = [];
o = n.readUshort(e, a);
a += 2;
for (var l = 0; l < o; l++) {
var c = n.readUshort(e, a);
a += 2, s.vals.push(Ue.GSUB.readLigatureSet(e, r + c));
}
} else if (5 == t) if (2 == s.fmt) {
var p = n.readUshort(e, a);
a += 2, s.cDef = Ue._lctf.readClassDef(e, r + p), s.scset = [];
var u = n.readUshort(e, a);
a += 2;
for (l = 0; l < u; l++) {
var d = n.readUshort(e, a);
a += 2, s.scset.push(0 == d ? null : Ue.GSUB.readSubClassSet(e, r + d));
}
} else console.log("unknown table format", s.fmt);
return s;
}, Ue.GSUB.readSubClassSet = function(e, t) {
var a = Ue._bin.readUshort, n = t, r = [], s = a(e, t);
t += 2;
for (var i = 0; i < s; i++) {
var o = a(e, t);
t += 2, r.push(Ue.GSUB.readSubClassRule(e, n + o));
}
return r;
}, Ue.GSUB.readSubClassRule = function(e, t) {
var a = Ue._bin.readUshort, n = {}, r = a(e, t), s = a(e, t += 2);
t += 2, n.input = [];
for (var i = 0; i < r - 1; i++) n.input.push(a(e, t)), t += 2;
return n.substLookupRecords = Ue.GSUB.readSubstLookupRecords(e, t, s), n;
}, Ue.GSUB.readSubstLookupRecords = function(e, t, a) {
for (var n = Ue._bin.readUshort, r = [], s = 0; s < a; s++) r.push(n(e, t), n(e, t + 2)),
t += 4;
return r;
}, Ue.GSUB.readChainSubClassSet = function(e, t) {
var a = Ue._bin, n = t, r = [], s = a.readUshort(e, t);
t += 2;
for (var i = 0; i < s; i++) {
var o = a.readUshort(e, t);
t += 2, r.push(Ue.GSUB.readChainSubClassRule(e, n + o));
}
return r;
}, Ue.GSUB.readChainSubClassRule = function(e, t) {
for (var a = Ue._bin, n = {}, r = [ "backtrack", "input", "lookahead" ], s = 0; s < r.length; s++) {
var i = a.readUshort(e, t);
t += 2, 1 == s && i--, n[r[s]] = a.readUshorts(e, t, i), t += 2 * n[r[s]].length;
}
i = a.readUshort(e, t);
return t += 2, n.subst = a.readUshorts(e, t, 2 * i), t += 2 * n.subst.length, n;
}, Ue.GSUB.readLigatureSet = function(e, t) {
var a = Ue._bin, n = t, r = [], s = a.readUshort(e, t);
t += 2;
for (var i = 0; i < s; i++) {
var o = a.readUshort(e, t);
t += 2, r.push(Ue.GSUB.readLigature(e, n + o));
}
return r;
}, Ue.GSUB.readLigature = function(e, t) {
var a = Ue._bin, n = {
chain: []
};
n.nglyph = a.readUshort(e, t), t += 2;
var r = a.readUshort(e, t);
t += 2;
for (var s = 0; s < r - 1; s++) n.chain.push(a.readUshort(e, t)), t += 2;
return n;
}, Ue.head = {}, Ue.head.parse = function(e, t, a) {
var n = Ue._bin, r = {};
return n.readFixed(e, t), t += 4, r.fontRevision = n.readFixed(e, t), t += 4, n.readUint(e, t),
t += 4, n.readUint(e, t), t += 4, r.flags = n.readUshort(e, t), t += 2, r.unitsPerEm = n.readUshort(e, t),
t += 2, r.created = n.readUint64(e, t), t += 8, r.modified = n.readUint64(e, t),
t += 8, r.xMin = n.readShort(e, t), t += 2, r.yMin = n.readShort(e, t), t += 2,
r.xMax = n.readShort(e, t), t += 2, r.yMax = n.readShort(e, t), t += 2, r.macStyle = n.readUshort(e, t),
t += 2, r.lowestRecPPEM = n.readUshort(e, t), t += 2, r.fontDirectionHint = n.readShort(e, t),
t += 2, r.indexToLocFormat = n.readShort(e, t), t += 2, r.glyphDataFormat = n.readShort(e, t),
t += 2, r;
}, Ue.hhea = {}, Ue.hhea.parse = function(e, t, a) {
var n = Ue._bin, r = {};
return n.readFixed(e, t), t += 4, r.ascender = n.readShort(e, t), t += 2, r.descender = n.readShort(e, t),
t += 2, r.lineGap = n.readShort(e, t), t += 2, r.advanceWidthMax = n.readUshort(e, t),
t += 2, r.minLeftSideBearing = n.readShort(e, t), t += 2, r.minRightSideBearing = n.readShort(e, t),
t += 2, r.xMaxExtent = n.readShort(e, t), t += 2, r.caretSlopeRise = n.readShort(e, t),
t += 2, r.caretSlopeRun = n.readShort(e, t), t += 2, r.caretOffset = n.readShort(e, t),
t += 2, t += 8, r.metricDataFormat = n.readShort(e, t), t += 2, r.numberOfHMetrics = n.readUshort(e, t),
t += 2, r;
}, Ue.hmtx = {}, Ue.hmtx.parse = function(e, t, a, n) {
for (var r = Ue._bin, s = {
aWidth: [],
lsBearing: []
}, i = 0, o = 0, l = 0; l < n.maxp.numGlyphs; l++) l < n.hhea.numberOfHMetrics && (i = r.readUshort(e, t),
t += 2, o = r.readShort(e, t), t += 2), s.aWidth.push(i), s.lsBearing.push(o);
return s;
}, Ue.kern = {}, Ue.kern.parse = function(e, t, a, n) {
var r = Ue._bin, s = r.readUshort(e, t);
if (t += 2, 1 == s) return Ue.kern.parseV1(e, t - 2, a, n);
var i = r.readUshort(e, t);
t += 2;
for (var o = {
glyph1: [],
rval: []
}, l = 0; l < i; l++) {
t += 2;
a = r.readUshort(e, t);
t += 2;
var c = r.readUshort(e, t);
t += 2;
var p = c >>> 8;
if (0 != (p &= 15)) throw "unknown kern table format: " + p;
t = Ue.kern.readFormat0(e, t, o);
}
return o;
}, Ue.kern.parseV1 = function(e, t, a, n) {
var r = Ue._bin;
r.readFixed(e, t), t += 4;
var s = r.readUint(e, t);
t += 4;
for (var i = {
glyph1: [],
rval: []
}, o = 0; o < s; o++) {
r.readUint(e, t), t += 4;
var l = r.readUshort(e, t);
t += 2, r.readUshort(e, t), t += 2;
var c = l >>> 8;
if (0 != (c &= 15)) throw "unknown kern table format: " + c;
t = Ue.kern.readFormat0(e, t, i);
}
return i;
}, Ue.kern.readFormat0 = function(e, t, a) {
var n = Ue._bin, r = -1, s = n.readUshort(e, t);
t += 2, n.readUshort(e, t), t += 2, n.readUshort(e, t), t += 2, n.readUshort(e, t),
t += 2;
for (var i = 0; i < s; i++) {
var o = n.readUshort(e, t);
t += 2;
var l = n.readUshort(e, t);
t += 2;
var c = n.readShort(e, t);
t += 2, o != r && (a.glyph1.push(o), a.rval.push({
glyph2: [],
vals: []
}));
var p = a.rval[a.rval.length - 1];
p.glyph2.push(l), p.vals.push(c), r = o;
}
return t;
}, Ue.loca = {}, Ue.loca.parse = function(e, t, a, n) {
var r = Ue._bin, s = [], i = n.head.indexToLocFormat, o = n.maxp.numGlyphs + 1;
if (0 == i) for (var l = 0; l < o; l++) s.push(r.readUshort(e, t + (l << 1)) << 1);
if (1 == i) for (l = 0; l < o; l++) s.push(r.readUint(e, t + (l << 2)));
return s;
}, Ue.maxp = {}, Ue.maxp.parse = function(e, t, a) {
var n = Ue._bin, r = {}, s = n.readUint(e, t);
return t += 4, r.numGlyphs = n.readUshort(e, t), t += 2, 65536 == s && (r.maxPoints = n.readUshort(e, t),
t += 2, r.maxContours = n.readUshort(e, t), t += 2, r.maxCompositePoints = n.readUshort(e, t),
t += 2, r.maxCompositeContours = n.readUshort(e, t), t += 2, r.maxZones = n.readUshort(e, t),
t += 2, r.maxTwilightPoints = n.readUshort(e, t), t += 2, r.maxStorage = n.readUshort(e, t),
t += 2, r.maxFunctionDefs = n.readUshort(e, t), t += 2, r.maxInstructionDefs = n.readUshort(e, t),
t += 2, r.maxStackElements = n.readUshort(e, t), t += 2, r.maxSizeOfInstructions = n.readUshort(e, t),
t += 2, r.maxComponentElements = n.readUshort(e, t), t += 2, r.maxComponentDepth = n.readUshort(e, t),
t += 2), r;
}, Ue.name = {}, Ue.name.parse = function(e, t, a) {
var n = Ue._bin, r = {};
n.readUshort(e, t), t += 2;
var s = n.readUshort(e, t);
t += 2, n.readUshort(e, t);
for (var i, o = t += 2, l = 0; l < s; l++) {
var c = n.readUshort(e, t);
t += 2;
var p = n.readUshort(e, t);
t += 2;
var u = n.readUshort(e, t);
t += 2;
var d = n.readUshort(e, t);
t += 2;
a = n.readUshort(e, t);
t += 2;
var m = n.readUshort(e, t);
t += 2;
var h = "p" + c;
null == r[h] && (r[h] = {});
var f, g = [ "copyright", "fontFamily", "fontSubfamily", "ID", "fullName", "version", "postScriptName", "trademark", "manufacturer", "designer", "description", "urlVendor", "urlDesigner", "licence", "licenceURL", "---", "typoFamilyName", "typoSubfamilyName", "compatibleFull", "sampleText", "postScriptCID", "wwsFamilyName", "wwsSubfamilyName", "lightPalette", "darkPalette" ][d], v = o + 12 * s + m;
if (0 == c) f = n.readUnicode(e, v, a / 2); else if (3 == c && 0 == p) f = n.readUnicode(e, v, a / 2); else if (0 == p) f = n.readASCII(e, v, a); else if (1 == p) f = n.readUnicode(e, v, a / 2); else if (3 == p) f = n.readUnicode(e, v, a / 2); else {
if (1 != c) throw "unknown encoding " + p + ", platformID: " + c;
f = n.readASCII(e, v, a), console.log("reading unknown MAC encoding " + p + " as ASCII");
}
r[h][g] = f, r[h]._lang = u;
}
for (var y in r) if (null != r[y].postScriptName && 1033 == r[y]._lang) return r[y];
for (var y in r) if (null != r[y].postScriptName && 3084 == r[y]._lang) return r[y];
for (var y in r) if (null != r[y].postScriptName) return r[y];
for (var y in r) {
i = y;
break;
}
return console.log("returning name table with languageID " + r[i]._lang), r[i];
}, Ue["OS/2"] = {}, Ue["OS/2"].parse = function(e, t, a) {
var n = Ue._bin.readUshort(e, t);
t += 2;
var r = {};
if (0 == n) Ue["OS/2"].version0(e, t, r); else if (1 == n) Ue["OS/2"].version1(e, t, r); else if (2 == n || 3 == n || 4 == n) Ue["OS/2"].version2(e, t, r); else {
if (5 != n) throw "unknown OS/2 table version: " + n;
Ue["OS/2"].version5(e, t, r);
}
return r;
}, Ue["OS/2"].version0 = function(e, t, a) {
var n = Ue._bin;
return a.xAvgCharWidth = n.readShort(e, t), t += 2, a.usWeightClass = n.readUshort(e, t),
t += 2, a.usWidthClass = n.readUshort(e, t), t += 2, a.fsType = n.readUshort(e, t),
t += 2, a.ySubscriptXSize = n.readShort(e, t), t += 2, a.ySubscriptYSize = n.readShort(e, t),
t += 2, a.ySubscriptXOffset = n.readShort(e, t), t += 2, a.ySubscriptYOffset = n.readShort(e, t),
t += 2, a.ySuperscriptXSize = n.readShort(e, t), t += 2, a.ySuperscriptYSize = n.readShort(e, t),
t += 2, a.ySuperscriptXOffset = n.readShort(e, t), t += 2, a.ySuperscriptYOffset = n.readShort(e, t),
t += 2, a.yStrikeoutSize = n.readShort(e, t), t += 2, a.yStrikeoutPosition = n.readShort(e, t),
t += 2, a.sFamilyClass = n.readShort(e, t), t += 2, a.panose = n.readBytes(e, t, 10),
t += 10, a.ulUnicodeRange1 = n.readUint(e, t), t += 4, a.ulUnicodeRange2 = n.readUint(e, t),
t += 4, a.ulUnicodeRange3 = n.readUint(e, t), t += 4, a.ulUnicodeRange4 = n.readUint(e, t),
t += 4, a.achVendID = [ n.readInt8(e, t), n.readInt8(e, t + 1), n.readInt8(e, t + 2), n.readInt8(e, t + 3) ],
t += 4, a.fsSelection = n.readUshort(e, t), t += 2, a.usFirstCharIndex = n.readUshort(e, t),
t += 2, a.usLastCharIndex = n.readUshort(e, t), t += 2, a.sTypoAscender = n.readShort(e, t),
t += 2, a.sTypoDescender = n.readShort(e, t), t += 2, a.sTypoLineGap = n.readShort(e, t),
t += 2, a.usWinAscent = n.readUshort(e, t), t += 2, a.usWinDescent = n.readUshort(e, t),
t += 2;
}, Ue["OS/2"].version1 = function(e, t, a) {
var n = Ue._bin;
return t = Ue["OS/2"].version0(e, t, a), a.ulCodePageRange1 = n.readUint(e, t),
t += 4, a.ulCodePageRange2 = n.readUint(e, t), t += 4;
}, Ue["OS/2"].version2 = function(e, t, a) {
var n = Ue._bin;
return t = Ue["OS/2"].version1(e, t, a), a.sxHeight = n.readShort(e, t), t += 2,
a.sCapHeight = n.readShort(e, t), t += 2, a.usDefault = n.readUshort(e, t), t += 2,
a.usBreak = n.readUshort(e, t), t += 2, a.usMaxContext = n.readUshort(e, t), t += 2;
}, Ue["OS/2"].version5 = function(e, t, a) {
var n = Ue._bin;
return t = Ue["OS/2"].version2(e, t, a), a.usLowerOpticalPointSize = n.readUshort(e, t),
t += 2, a.usUpperOpticalPointSize = n.readUshort(e, t), t += 2;
}, Ue.post = {}, Ue.post.parse = function(e, t, a) {
var n = Ue._bin, r = {};
return r.version = n.readFixed(e, t), t += 4, r.italicAngle = n.readFixed(e, t),
t += 4, r.underlinePosition = n.readShort(e, t), t += 2, r.underlineThickness = n.readShort(e, t),
t += 2, r;
}, Ue.SVG = {}, Ue.SVG.parse = function(e, t, a) {
var n = Ue._bin, r = {
entries: []
}, s = t;
n.readUshort(e, t), t += 2;
var i = n.readUint(e, t);
t += 4, n.readUint(e, t), t += 4, t = i + s;
var o = n.readUshort(e, t);
t += 2;
for (var l = 0; l < o; l++) {
var c = n.readUshort(e, t);
t += 2;
var p = n.readUshort(e, t);
t += 2;
var u = n.readUint(e, t);
t += 4;
var d = n.readUint(e, t);
t += 4;
for (var m = new Uint8Array(e.buffer, s + u + i, d), h = n.readUTF8(m, 0, m.length), f = c; f <= p; f++) r.entries[f] = h;
}
return r;
}, Ue.SVG.toPath = function(e) {
var t = {
cmds: [],
crds: []
};
if (null == e) return t;
for (var a = (new DOMParser).parseFromString(e, "image/svg+xml").firstChild; "svg" != a.tagName; ) a = a.nextSibling;
var n = a.getAttribute("viewBox");
n = n ? n.trim().split(" ").map(parseFloat) : [ 0, 0, 1e3, 1e3 ], Ue.SVG._toPath(a.children, t);
for (var r = 0; r < t.crds.length; r += 2) {
var s = t.crds[r], i = t.crds[r + 1];
s -= n[0], i = -(i -= n[1]), t.crds[r] = s, t.crds[r + 1] = i;
}
return t;
}, Ue.SVG._toPath = function(e, t, a) {
for (var n = 0; n < e.length; n++) {
var r = e[n], s = r.tagName, i = r.getAttribute("fill");
if (null == i && (i = a), "g" == s) Ue.SVG._toPath(r.children, t, i); else if ("path" == s) {
t.cmds.push(i || "#000000");
var o = r.getAttribute("d"), l = Ue.SVG._tokens(o);
Ue.SVG._toksToPath(l, t), t.cmds.push("X");
} else "defs" == s || console.log(s, r);
}
}, Ue.SVG._tokens = function(e) {
for (var t = [], a = 0, n = !1, r = ""; a < e.length; ) {
var s = e.charCodeAt(a), i = e.charAt(a);
a++;
var o = 48 <= s && s <= 57 || "." == i || "-" == i;
n ? "-" == i ? (t.push(parseFloat(r)), r = i) : o ? r += i : (t.push(parseFloat(r)),
"," != i && " " != i && t.push(i), n = !1) : o ? (r = i, n = !0) : "," != i && " " != i && t.push(i);
}
return n && t.push(parseFloat(r)), t;
}, Ue.SVG._toksToPath = function(e, t) {
for (var a = 0, n = 0, r = 0, s = 0, i = 0, o = {
M: 2,
L: 2,
H: 1,
V: 1,
S: 4,
C: 6
}, l = t.cmds, c = t.crds; a < e.length; ) {
var p = e[a];
if (a++, "z" == p) l.push("Z"), n = s, r = i; else for (var u = p.toUpperCase(), d = o[u], m = Ue.SVG._reps(e, a, d), h = 0; h < m; h++) {
var f = 0, g = 0;
if (p != u && (f = n, g = r), "M" == u) n = f + e[a++], r = g + e[a++], l.push("M"),
c.push(n, r), s = n, i = r; else if ("L" == u) n = f + e[a++], r = g + e[a++], l.push("L"),
c.push(n, r); else if ("H" == u) n = f + e[a++], l.push("L"), c.push(n, r); else if ("V" == u) r = g + e[a++],
l.push("L"), c.push(n, r); else if ("C" == u) {
var v = f + e[a++], y = g + e[a++], b = f + e[a++], w = g + e[a++], x = f + e[a++], k = g + e[a++];
l.push("C"), c.push(v, y, b, w, x, k), n = x, r = k;
} else if ("S" == u) {
var q = Math.max(c.length - 4, 0);
v = n + n - c[q], y = r + r - c[q + 1], b = f + e[a++], w = g + e[a++], x = f + e[a++],
k = g + e[a++];
l.push("C"), c.push(v, y, b, w, x, k), n = x, r = k;
} else console.log("Unknown SVG command " + p);
}
}
}, Ue.SVG._reps = function(e, t, a) {
for (var n = t; n < e.length && "string" != typeof e[n]; ) n += a;
return (n - t) / a;
}, null == Ue && (Ue = {}), null == Ue.U && (Ue.U = {}), Ue.U.codeToGlyph = function(e, t) {
var a = e.cmap, n = -1;
if (null != a.p0e4 ? n = a.p0e4 : null != a.p3e1 ? n = a.p3e1 : null != a.p1e0 && (n = a.p1e0),
-1 == n) throw "no familiar platform and encoding!";
var r = a.tables[n];
if (0 == r.format) return t >= r.map.length ? 0 : r.map[t];
if (4 == r.format) {
for (var s = -1, i = 0; i < r.endCount.length; i++) if (t <= r.endCount[i]) {
s = i;
break;
}
if (-1 == s) return 0;
if (r.startCount[s] > t) return 0;
return 65535 & (0 != r.idRangeOffset[s] ? r.glyphIdArray[t - r.startCount[s] + (r.idRangeOffset[s] >> 1) - (r.idRangeOffset.length - s)] : t + r.idDelta[s]);
}
if (12 == r.format) {
if (t > r.groups[r.groups.length - 1][1]) return 0;
for (i = 0; i < r.groups.length; i++) {
var o = r.groups[i];
if (o[0] <= t && t <= o[1]) return o[2] + (t - o[0]);
}
return 0;
}
throw "unknown cmap table format " + r.format;
}, Ue.U.glyphToPath = function(e, t) {
var a = {
cmds: [],
crds: []
};
if (e.SVG && e.SVG.entries[t]) {
var n = e.SVG.entries[t];
return null == n ? a : ("string" == typeof n && (n = Ue.SVG.toPath(n), e.SVG.entries[t] = n),
n);
}
if (e.CFF) {
var r = {
x: 0,
y: 0,
stack: [],
nStems: 0,
haveWidth: !1,
width: e.CFF.Private ? e.CFF.Private.defaultWidthX : 0,
open: !1
};
Ue.U._drawCFF(e.CFF.CharStrings[t], r, e.CFF, a);
} else e.glyf && Ue.U._drawGlyf(t, e, a);
return a;
}, Ue.U._drawGlyf = function(e, t, a) {
var n = t.glyf[e];
null == n && (n = t.glyf[e] = Ue.glyf._parseGlyf(t, e)), null != n && (n.noc > -1 ? Ue.U._simpleGlyph(n, a) : Ue.U._compoGlyph(n, t, a));
}, Ue.U._simpleGlyph = function(e, t) {
for (var a = 0; a < e.noc; a++) {
for (var n = 0 == a ? 0 : e.endPts[a - 1] + 1, r = e.endPts[a], s = n; s <= r; s++) {
var i = s == n ? r : s - 1, o = s == r ? n : s + 1, l = 1 & e.flags[s], c = 1 & e.flags[i], p = 1 & e.flags[o], u = e.xs[s], d = e.ys[s];
if (s == n) if (l) {
if (!c) {
Ue.U.P.moveTo(t, u, d);
continue;
}
Ue.U.P.moveTo(t, e.xs[i], e.ys[i]);
} else c ? Ue.U.P.moveTo(t, e.xs[i], e.ys[i]) : Ue.U.P.moveTo(t, (e.xs[i] + u) / 2, (e.ys[i] + d) / 2);
l ? c && Ue.U.P.lineTo(t, u, d) : p ? Ue.U.P.qcurveTo(t, u, d, e.xs[o], e.ys[o]) : Ue.U.P.qcurveTo(t, u, d, (u + e.xs[o]) / 2, (d + e.ys[o]) / 2);
}
Ue.U.P.closePath(t);
}
}, Ue.U._compoGlyph = function(e, t, a) {
for (var n = 0; n < e.parts.length; n++) {
var r = {
cmds: [],
crds: []
}, s = e.parts[n];
Ue.U._drawGlyf(s.glyphIndex, t, r);
for (var i = s.m, o = 0; o < r.crds.length; o += 2) {
var l = r.crds[o], c = r.crds[o + 1];
a.crds.push(l * i.a + c * i.b + i.tx), a.crds.push(l * i.c + c * i.d + i.ty);
}
for (o = 0; o < r.cmds.length; o++) a.cmds.push(r.cmds[o]);
}
}, Ue.U._getGlyphClass = function(e, t) {
var a = Ue._lctf.getInterval(t, e);
return -1 == a ? 0 : t[a + 2];
}, Ue.U.getPairAdjustment = function(e, t, a) {
if (e.GPOS) {
for (var n = null, r = 0; r < e.GPOS.featureList.length; r++) {
var s = e.GPOS.featureList[r];
if ("kern" == s.tag) for (var i = 0; i < s.tab.length; i++) 2 == e.GPOS.lookupList[s.tab[i]].ltype && (n = e.GPOS.lookupList[s.tab[i]]);
}
if (n) for (r = 0; r < n.tabs.length; r++) {
var o = n.tabs[r], l = Ue._lctf.coverageIndex(o.coverage, t);
if (-1 != l) {
if (1 == o.format) {
var c = o.pairsets[l];
for (i = 0; i < c.length; i++) c[i].gid2 == a && (d = c[i]);
if (null == d) continue;
} else if (2 == o.format) var p = Ue.U._getGlyphClass(t, o.classDef1), u = Ue.U._getGlyphClass(a, o.classDef2), d = o.matrix[p][u];
return d.val1[2];
}
}
}
if (e.kern) {
var m = e.kern.glyph1.indexOf(t);
if (-1 != m) {
var h = e.kern.rval[m].glyph2.indexOf(a);
if (-1 != h) return e.kern.rval[m].vals[h];
}
}
return 0;
}, Ue.U.stringToGlyphs = function(e, t) {
for (var a = [], n = 0; n < t.length; n++) {
var r = t.codePointAt(n);
r > 65535 && n++, a.push(Ue.U.codeToGlyph(e, r));
}
var s = e.GSUB;
if (null == s) return a;
for (var i = s.lookupList, o = s.featureList, l = '\n\t" ,.:;!?() \u060c', c = "\u0622\u0623\u0624\u0625\u0627\u0629\u062f\u0630\u0631\u0632\u0648\u0671\u0672\u0673\u0675\u0676\u0677\u0688\u0689\u068a\u068b\u068c\u068d\u068e\u068f\u0690\u0691\u0692\u0693\u0694\u0695\u0696\u0697\u0698\u0699\u06c0\u06c3\u06c4\u06c5\u06c6\u06c7\u06c8\u06c9\u06ca\u06cb\u06cd\u06cf\u06d2\u06d3\u06d5\u06ee\u06ef\u0710\u0715\u0716\u0717\u0718\u0719\u071e\u0728\u072a\u072c\u072f\u074d\u0759\u075a\u075b\u076b\u076c\u0771\u0773\u0774\u0778\u0779\u0840\u0846\u0847\u0849\u0854\u0867\u0869\u086a\u08aa\u08ab\u08ac\u08ae\u08b1\u08b2\u08b9\u0ac5\u0ac7\u0ac9\u0aca\u0ace\u0acf\u0ad0\u0ad1\u0ad2\u0add\u0ae1\u0ae4\u0aef\u0b81\u0b83\u0b84\u0b85\u0b89\u0b8c\u0b8e\u0b8f\u0b91\u0ba9\u0baa\u0bab\u0bac", p = 0; p < a.length; p++) {
var u = a[p], d = 0 == p || -1 != l.indexOf(t[p - 1]), m = p == a.length - 1 || -1 != l.indexOf(t[p + 1]);
d || -1 == c.indexOf(t[p - 1]) || (d = !0), m || -1 == c.indexOf(t[p]) || (m = !0),
m || -1 == "\ua872\u0acd\u0ad7".indexOf(t[p + 1]) || (m = !0), d || -1 == "\ua872\u0acd\u0ad7".indexOf(t[p]) || (d = !0);
var h = null;
h = d ? m ? "isol" : "init" : m ? "fina" : "medi";
for (var f = 0; f < o.length; f++) if (o[f].tag == h) for (var g = 0; g < o[f].tab.length; g++) {
1 == (w = i[o[f].tab[g]]).ltype && Ue.U._applyType1(a, p, w);
}
}
var v = [ "rlig", "liga", "mset" ];
for (p = 0; p < a.length; p++) {
u = a[p];
var y = Math.min(3, a.length - p - 1);
for (f = 0; f < o.length; f++) {
var b = o[f];
if (-1 != v.indexOf(b.tag)) for (g = 0; g < b.tab.length; g++) for (var w = i[b.tab[g]], x = 0; x < w.tabs.length; x++) if (null != w.tabs[x]) {
var k = Ue._lctf.coverageIndex(w.tabs[x].coverage, u);
if (-1 != k) if (4 == w.ltype) for (var q = w.tabs[x].vals[k], _ = 0; _ < q.length; _++) {
var A = q[_], T = A.chain.length;
if (!(T > y)) {
for (var C = !0, S = 0; S < T; S++) A.chain[S] != a[p + (1 + S)] && (C = !1);
if (C) {
a[p] = A.nglyph;
for (S = 0; S < T; S++) a[p + S + 1] = -1;
}
}
} else if (5 == w.ltype) {
var I = w.tabs[x];
if (2 != I.fmt) continue;
var E = Ue._lctf.getInterval(I.cDef, u), U = I.cDef[E + 2], H = I.scset[U];
for (n = 0; n < H.length; n++) {
var P = H[n], j = P.input;
if (!(j.length > y)) {
for (C = !0, S = 0; S < j.length; S++) {
var L = Ue._lctf.getInterval(I.cDef, a[p + 1 + S]);
if (-1 == E && I.cDef[L + 2] != j[S]) {
C = !1;
break;
}
}
if (C) {
var z = P.substLookupRecords;
for (_ = 0; _ < z.length; _ += 2) z[_], z[_ + 1];
}
}
}
}
}
}
}
return a;
}, Ue.U._applyType1 = function(e, t, a) {
for (var n = e[t], r = 0; r < a.tabs.length; r++) {
var s = a.tabs[r], i = Ue._lctf.coverageIndex(s.coverage, n);
-1 != i && (1 == s.fmt ? e[t] = e[t] + s.delta : e[t] = s.newg[i]);
}
}, Ue.U.glyphsToPath = function(e, t, a) {
for (var n = {
cmds: [],
crds: []
}, r = 0, s = 0; s < t.length; s++) {
var i = t[s];
if (-1 != i) {
for (var o = s < t.length - 1 && -1 != t[s + 1] ? t[s + 1] : 0, l = Ue.U.glyphToPath(e, i), c = 0; c < l.crds.length; c += 2) n.crds.push(l.crds[c] + r),
n.crds.push(l.crds[c + 1]);
a && n.cmds.push(a);
for (c = 0; c < l.cmds.length; c++) n.cmds.push(l.cmds[c]);
a && n.cmds.push("X"), r += e.hmtx.aWidth[i], s < t.length - 1 && (r += Ue.U.getPairAdjustment(e, i, o));
}
}
return n;
}, Ue.U.pathToSVG = function(e, t) {
null == t && (t = 5);
for (var a = [], n = 0, r = {
M: 2,
L: 2,
Q: 4,
C: 6
}, s = 0; s < e.cmds.length; s++) {
var i = e.cmds[s], o = n + (r[i] ? r[i] : 0);
for (a.push(i); n < o; ) {
var l = e.crds[n++];
a.push(parseFloat(l.toFixed(t)) + (n == o ? "" : " "));
}
}
return a.join("");
}, Ue.U.pathToContext = function(e, t) {
for (var a = 0, n = e.crds, r = 0; r < e.cmds.length; r++) {
var s = e.cmds[r];
"M" == s ? (t.moveTo(n[a], n[a + 1]), a += 2) : "L" == s ? (t.lineTo(n[a], n[a + 1]),
a += 2) : "C" == s ? (t.bezierCurveTo(n[a], n[a + 1], n[a + 2], n[a + 3], n[a + 4], n[a + 5]),
a += 6) : "Q" == s ? (t.quadraticCurveTo(n[a], n[a + 1], n[a + 2], n[a + 3]), a += 4) : "#" == s.charAt(0) ? (t.beginPath(),
t.fillStyle = s) : "Z" == s ? t.closePath() : "X" == s && t.fill();
}
}, Ue.U.P = {}, Ue.U.P.moveTo = function(e, t, a) {
e.cmds.push("M"), e.crds.push(t, a);
}, Ue.U.P.lineTo = function(e, t, a) {
e.cmds.push("L"), e.crds.push(t, a);
}, Ue.U.P.curveTo = function(e, t, a, n, r, s, i) {
e.cmds.push("C"), e.crds.push(t, a, n, r, s, i);
}, Ue.U.P.qcurveTo = function(e, t, a, n, r) {
e.cmds.push("Q"), e.crds.push(t, a, n, r);
}, Ue.U.P.closePath = function(e) {
e.cmds.push("Z");
}, Ue.U._drawCFF = function(e, t, a, n) {
for (var r = t.stack, s = t.nStems, i = t.haveWidth, o = t.width, l = t.open, c = 0, p = t.x, u = t.y, d = 0, m = 0, h = 0, f = 0, g = 0, v = 0, y = 0, b = 0, w = 0, x = 0, k = {
val: 0,
size: 0
}; c < e.length; ) {
Ue.CFF.getCharString(e, c, k);
var q = k.val;
if (c += k.size, "o1" == q || "o18" == q) r.length % 2 != 0 && !i && (o = r.shift() + a.Private.nominalWidthX),
s += r.length >> 1, r.length = 0, i = !0; else if ("o3" == q || "o23" == q) {
r.length % 2 != 0 && !i && (o = r.shift() + a.Private.nominalWidthX), s += r.length >> 1,
r.length = 0, i = !0;
} else if ("o4" == q) r.length > 1 && !i && (o = r.shift() + a.Private.nominalWidthX,
i = !0), l && Ue.U.P.closePath(n), u += r.pop(), Ue.U.P.moveTo(n, p, u), l = !0; else if ("o5" == q) for (;r.length > 0; ) p += r.shift(),
u += r.shift(), Ue.U.P.lineTo(n, p, u); else if ("o6" == q || "o7" == q) for (var _ = r.length, A = "o6" == q, T = 0; T < _; T++) {
var C = r.shift();
A ? p += C : u += C, A = !A, Ue.U.P.lineTo(n, p, u);
} else if ("o8" == q || "o24" == q) {
_ = r.length;
for (var S = 0; S + 6 <= _; ) d = p + r.shift(), m = u + r.shift(), h = d + r.shift(),
f = m + r.shift(), p = h + r.shift(), u = f + r.shift(), Ue.U.P.curveTo(n, d, m, h, f, p, u),
S += 6;
"o24" == q && (p += r.shift(), u += r.shift(), Ue.U.P.lineTo(n, p, u));
} else {
if ("o11" == q) break;
if ("o1234" == q || "o1235" == q || "o1236" == q || "o1237" == q) "o1234" == q && (m = u,
h = (d = p + r.shift()) + r.shift(), x = f = m + r.shift(), v = f, b = u, p = (y = (g = (w = h + r.shift()) + r.shift()) + r.shift()) + r.shift(),
Ue.U.P.curveTo(n, d, m, h, f, w, x), Ue.U.P.curveTo(n, g, v, y, b, p, u)), "o1235" == q && (d = p + r.shift(),
m = u + r.shift(), h = d + r.shift(), f = m + r.shift(), w = h + r.shift(), x = f + r.shift(),
g = w + r.shift(), v = x + r.shift(), y = g + r.shift(), b = v + r.shift(), p = y + r.shift(),
u = b + r.shift(), r.shift(), Ue.U.P.curveTo(n, d, m, h, f, w, x), Ue.U.P.curveTo(n, g, v, y, b, p, u)),
"o1236" == q && (d = p + r.shift(), m = u + r.shift(), h = d + r.shift(), x = f = m + r.shift(),
v = f, y = (g = (w = h + r.shift()) + r.shift()) + r.shift(), b = v + r.shift(),
p = y + r.shift(), Ue.U.P.curveTo(n, d, m, h, f, w, x), Ue.U.P.curveTo(n, g, v, y, b, p, u)),
"o1237" == q && (d = p + r.shift(), m = u + r.shift(), h = d + r.shift(), f = m + r.shift(),
w = h + r.shift(), x = f + r.shift(), g = w + r.shift(), v = x + r.shift(), y = g + r.shift(),
b = v + r.shift(), Math.abs(y - p) > Math.abs(b - u) ? p = y + r.shift() : u = b + r.shift(),
Ue.U.P.curveTo(n, d, m, h, f, w, x), Ue.U.P.curveTo(n, g, v, y, b, p, u)); else if ("o14" == q) {
if (r.length > 0 && !i && (o = r.shift() + a.nominalWidthX, i = !0), 4 == r.length) {
var I = r.shift(), E = r.shift(), U = r.shift(), H = r.shift(), P = Ue.CFF.glyphBySE(a, U), j = Ue.CFF.glyphBySE(a, H);
Ue.U._drawCFF(a.CharStrings[P], t, a, n), t.x = I, t.y = E, Ue.U._drawCFF(a.CharStrings[j], t, a, n);
}
l && (Ue.U.P.closePath(n), l = !1);
} else if ("o19" == q || "o20" == q) {
r.length % 2 != 0 && !i && (o = r.shift() + a.Private.nominalWidthX), s += r.length >> 1,
r.length = 0, i = !0, c += s + 7 >> 3;
} else if ("o21" == q) r.length > 2 && !i && (o = r.shift() + a.Private.nominalWidthX,
i = !0), u += r.pop(), p += r.pop(), l && Ue.U.P.closePath(n), Ue.U.P.moveTo(n, p, u),
l = !0; else if ("o22" == q) r.length > 1 && !i && (o = r.shift() + a.Private.nominalWidthX,
i = !0), p += r.pop(), l && Ue.U.P.closePath(n), Ue.U.P.moveTo(n, p, u), l = !0; else if ("o25" == q) {
for (;r.length > 6; ) p += r.shift(), u += r.shift(), Ue.U.P.lineTo(n, p, u);
d = p + r.shift(), m = u + r.shift(), h = d + r.shift(), f = m + r.shift(), p = h + r.shift(),
u = f + r.shift(), Ue.U.P.curveTo(n, d, m, h, f, p, u);
} else if ("o26" == q) for (r.length % 2 && (p += r.shift()); r.length > 0; ) d = p,
m = u + r.shift(), p = h = d + r.shift(), u = (f = m + r.shift()) + r.shift(), Ue.U.P.curveTo(n, d, m, h, f, p, u); else if ("o27" == q) for (r.length % 2 && (u += r.shift()); r.length > 0; ) m = u,
h = (d = p + r.shift()) + r.shift(), f = m + r.shift(), p = h + r.shift(), u = f,
Ue.U.P.curveTo(n, d, m, h, f, p, u); else if ("o10" == q || "o29" == q) {
var L = "o10" == q ? a.Private : a;
if (0 == r.length) console.log("error: empty stack"); else {
var z = r.pop(), M = L.Subrs[z + L.Bias];
t.x = p, t.y = u, t.nStems = s, t.haveWidth = i, t.width = o, t.open = l, Ue.U._drawCFF(M, t, a, n),
p = t.x, u = t.y, s = t.nStems, i = t.haveWidth, o = t.width, l = t.open;
}
} else if ("o30" == q || "o31" == q) {
var O = r.length, $ = (S = 0, "o31" == q);
for (S += O - (_ = -3 & O); S < _; ) $ ? (m = u, h = (d = p + r.shift()) + r.shift(),
u = (f = m + r.shift()) + r.shift(), _ - S == 5 ? (p = h + r.shift(), S++) : p = h,
$ = !1) : (d = p, m = u + r.shift(), h = d + r.shift(), f = m + r.shift(), p = h + r.shift(),
_ - S == 5 ? (u = f + r.shift(), S++) : u = f, $ = !0), Ue.U.P.curveTo(n, d, m, h, f, p, u),
S += 4;
} else {
if ("o" == (q + "").charAt(0)) throw console.log("Unknown operation: " + q, e),
q;
r.push(q);
}
}
}
t.x = p, t.y = u, t.nStems = s, t.haveWidth = i, t.width = o, t.open = l;
};
const He = getDefaultExportFromCjs(Ue), decode = async () => {
var e;
const t = ce.document.querySelectorAll("style");
let a = null;
if (t.forEach((e => {
var t;
-1 !== (null == (t = e.textContent) ? void 0 : t.indexOf("font-cxsecret")) && (a = e);
})), !a) return !0;
const n = null == (e = a.textContent) ? void 0 : e.match(/base64,([\w\W]+?)'/);
if (!n) return;
const r = base64ToUint8Array(n[1]), s = He.parse(r);
let i = await ttfDownload1("https://www.forestpolice.org/ttf/2.0/table.json") || await ttfDownload1("https://jsd.vxo.im/gh/chengbianruan/staticfile/c.json") || await ttfDownload1("https://cdn.jsdelivr.net/gh/chengbianruan/staticfile/c.json");
if (!i) return !1;
let o = {};
for (let l = 19968; l < 40870; l++) {
let e = He.U.codeToGlyph(s, l);
e && (e = He.U.glyphToPath(s, e), e = somd5(JSON.stringify(e)).slice(24), o[l] = i[e]);
}
return ce.document.querySelectorAll(".font-cxsecret").forEach((e => {
let t = e.innerHTML;
Object.keys(o).forEach((e => {
const a = new RegExp(String.fromCharCode(e), "g");
t = t.replace(a, String.fromCharCode(o[e]));
})), e.innerHTML = t, e.classList.remove("font-cxsecret");
})), !0;
}, base64ToUint8Array = e => {
const t = atob(e), a = new Uint8Array(t.length);
for (let n = 0; n < t.length; n++) a[n] = t.charCodeAt(n);
return a;
}, cleanChaoxingQuestionLiTitle = (e, t, a) => {
const n = e || "", r = t || "";
return a(r && n.includes(r) ? n.split(r).slice(1).join(r).trim() : n).trim();
}, getChaoxingAnswerIndex = e => {
const t = (e || "").trim().toUpperCase();
if (/^[A-Z]$/.test(t)) return t.charCodeAt(0) - 65;
if (/^\d+$/.test(t)) {
const e = Number.parseInt(t, 10) - 1;
return e >= 0 ? e : null;
}
return null;
}, mapChaoxingChoiceLettersToOptions = (e, t) => (e || "").trim().toUpperCase().split("").map((e => {
const a = getChaoxingAnswerIndex(e);
return null == a ? void 0 : t[a];
})).filter((e => void 0 !== e && "" !== e)), normalizeChaoxingSubjectiveAnswer = (e, t = 10) => {
const a = (e || "").replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim();
return a.length < t ? null : [ a ];
}, getChaoxingExamOutLinkTarget = e => {
let t;
try {
t = new URL(e);
} catch {
return "";
}
if ("i.mooc.chaoxing.com" !== t.hostname) return "";
if (!t.pathname.includes("/space/out_link.shtml")) return "";
const a = t.searchParams.get("burl");
if (!a) return "";
try {
const e = new URL(a), t = "chaoxing.com" === e.hostname || e.hostname.endsWith(".chaoxing.com"), n = e.pathname.includes("/exam-ans/exam/test/");
return t && n ? e.href : "";
} catch {
return "";
}
}, redirectCurrentChaoxingExamOutLink = () => {
((e, t) => {
const a = getChaoxingExamOutLinkTarget(e);
!!a && t(a);
})(location.href, (e => {
ce.location.href = e;
}));
}, Pe = [ {
type: "hook",
name: "\u5b66\u4e60\u901a\u8003\u8bd5\u5916\u94fe\u8df3\u8f6c",
match: () => "" !== getChaoxingExamOutLinkTarget(location.href),
hook: redirectCurrentChaoxingExamOutLink,
main: redirectCurrentChaoxingExamOutLink
}, {
type: "ask",
name: "\u5b66\u4e60\u901a\u968f\u5802\u7ec3\u4e60",
match: () => location.href.includes("/page/quiz/stu/answerQuestion2"),
types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ],
minDelay: 100,
answerDelay: 1e3,
question: {
html: ".left-question-list>.question-item",
question: ".html-content-box",
options: "ul.option-list>li",
type: ".grey-text",
workType: "stlx",
pageType: "cx"
},
init: async () => {},
ischecked: isParentChecked,
questionHook: e => (e.options = removeStartChar(e.options), e.type = typeMatch(K(e.html).find(".grey-text").text()),
e)
}, {
type: "save",
name: "\u5b66\u4e60\u901a\u8003\u8bd5\u65b0\u7248\u6536\u5f55",
match: () => location.href.includes("work/view") || location.href.includes("test/reVersionPaperMarkContentNew"),
question: {
html: ".questionLi",
question: "h3.mark_name",
options: "ul.mark_letter.colorDeep > li",
type: ".colorShallow",
workType: "zj",
pageType: "cx"
},
answerHook: e => {
let t = removeHtml(K(e.html).find('span[class="colorShallow"]').html());
if ("" === t) return null;
let a = t.match(/^\((.+?)\)/);
if (null === a) return null;
e.type = a[1].split(",")[0], e.question = titleClean(e.question.split(t)[1].trim()).trim(),
e.options = removeStartChar(e.options);
const n = K(e.html).find(".mark_score>.totalScore>i").text(), r = t.match(/(\d+(\.\d+)?)/);
let s, i = K(e.html).find(".marking_dui").length > 0 || Number(n) == ((null == r ? void 0 : r[0]) || 0) && 0 != Number(n), o = typeMatch(t);
if (!i) switch (o) {
case "0":
case "1":
case "3":
0 != Number(n) && (i = !0);
}
switch (o) {
case "0":
case "1":
e.type = o, e.answer = mapChaoxingChoiceLettersToOptions(K(e.html).find(".mark_answer>div>span.colorGreen:eq(0)").text().replace("\u6b63\u786e\u7b54\u6848:", ""), e.options),
0 === e.answer.length && i && (e.answer = mapChaoxingChoiceLettersToOptions(K(e.html).find(".mark_answer>div>span.colorDeep:eq(0)").text().replace("\u6211\u7684\u7b54\u6848:", ""), e.options));
break;
case "3":
if (e.type = "3", e.options = [], e.answer = judgeAnswer(K(e.html).find(".mark_answer>div>span.colorGreen:eq(0)").text().replace("\u6b63\u786e\u7b54\u6848", "")),
e.answer, 0 === e.answer.length) {
if (s = removeHtml(K(e.html).find(".mark_answer>div>span.colorDeep:eq(0)").html()),
e.answer = judgeAnswer(s), 0 === e.answer.length) return null;
if (0 == Number(n) && !i && "3" == o) return null;
i || (e.answer = "\u6b63\u786e" === e.answer[0] ? [ "\u9519\u8bef" ] : [ "\u6b63\u786e" ]);
}
break;
case "4":
if (e.type = "4", e.answer = normalizeChaoxingSubjectiveAnswer(removeHtml(K(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html())),
null == e.answer) return null;
break;
case "5":
if (e.type = "5", e.answer = normalizeChaoxingSubjectiveAnswer(removeHtml(K(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html())),
null == e.answer) return null;
break;
case "7":
if (e.type = "7", e.answer = normalizeChaoxingSubjectiveAnswer(removeHtml(K(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html())),
null == e.answer) return null;
break;
case "6":
if (e.type = "6", e.answer = normalizeChaoxingSubjectiveAnswer(removeHtml(K(e.html).find(".mark_answer>div>.colorGreen:eq(0)").html())),
null == e.answer) return null;
break;
case "2":
if (e.type = "2", e.answer = K(e.html).find(".mark_answer>div>.colorGreen:eq(0)>dd").map(((e, t) => removeHtml(K(t).html()).replace(`(${e + 1})`, "").trim())).get(),
0 == e.answer.length) {
const t = K(e.html).find(".mark_answer>div>.colorDeep:eq(0)>dd").map(((e, t) => removeHtml(K(t).html()).replace(`(${e + 1})`, "").trim())).get();
K(e.html).find(".mark_answer>div>.colorDeep:eq(0)>dd>.marking_dui").length == t.length && (e.answer = t);
}
break;
default:
return null;
}
return e;
},
paper: async e => {
const t = {
platform: "cx"
}, a = K("#courseId").val(), n = (ce.document.body.innerHTML.match(/(?:examId|relationId)=(\d+)/) || [])[1] || "", r = `https://mobilelearn.chaoxing.com/v2/apis/class/getClassDetail?courseId=${a}&classId=${K("#classId").val()}`;
await request(r, "GET").then((e => {
const a = JSON.parse(e[0].responseText).data.course.data[0];
t.name = a.name, t.info = {}, t.info.imageurl = a.imageurl;
})), t.hash = a, t.info = {}, t.chapter = [ {
hash: `${n}`,
name: K(".mark_title").text().trim(),
question: e
} ], Ee.setPaper(t.hash, t);
}
}, {
type: "hook",
name: "hook",
match: location.href.includes("work/selectWorkQuestionYiPiYue") && location.href.includes("mooc2=0"),
main: e => {
location.href.includes("mooc2=0") ? ce.location.href = location.href.replace("mooc2=0", "mooc2=1") : ce.location.href = location.href + "&mooc2=1";
}
}, {
type: "save",
name: "\u5b66\u4e60\u901a\u4f5c\u4e1a\u6536\u5f55\u65b0",
match: () => location.href.includes("work/selectWorkQuestionYiPiYue") && location.href.includes("mooc2=1"),
question: {
html: ".TiMu",
question: ".Zy_TItle .clearfix",
options: "ul.Zy_ulTop li",
type: ".newZy_TItle",
workType: "zj",
pageType: "cx"
},
answerHook: e => {
e.type = K(e.html).find(".newZy_TItle").text().replace(/\u3010|\u3011/g, "").trim();
let t, a = K(e.html).find(".marking_dui").length > 0;
switch (removeHtml(K(e.html).find(".Py_addpy:eq(0)").html()), e.question = titleClean(e.question).trim(),
e.type) {
case "\u5355\u9009\u9898":
case "\u591a\u9009\u9898":
e.type = "\u5355\u9009\u9898" === e.type ? "0" : "1", e.options = K(e.html).find("ul.Zy_ulTop li").map(((e, t) => {
let a = K(t).find("i.fl").text().trim(), n = removeHtml(K(t).html());
return "" === a ? n.trim() : n.split(a)[1].trim();
})).get(), e.answer = mapChaoxingChoiceLettersToOptions(K(e.html).find(".correctAnswer >.fl.answerCon").text(), e.options),
0 === e.answer.length && a && (e.answer = mapChaoxingChoiceLettersToOptions(K(e.html).find(".myAnswer > .fl.answerCon").text(), e.options));
break;
case "\u5224\u65ad\u9898":
if (e.type = "3", e.answer = K(e.html).find(".correctAnswer > .fl.answerCon").text().trim().split("").map((e => e.includes("\u6b63\u786e") || e.includes("\u5bf9") || e.includes("\u221a") ? "\u6b63\u786e" : e.includes("\u9519\u8bef") || e.includes("\u9519") || e.includes("\xd7") ? "\u9519\u8bef" : null)).filter((e => null !== e)),
0 === e.answer.length) {
t = removeHtml(K(e.html).find(".fl.answerCon").html());
let [a, n] = [ ".marking_dui", ".marking_cuo" ].map((t => K(e.html).find(t).length));
if (a + n === 0) return null;
if (t.includes("\u6b63\u786e") || t.includes("\u5bf9") || t.includes("\u221a")) e.answer = [ "\u6b63\u786e" ]; else {
if (!(t.includes("\u9519\u8bef") || t.includes("\u9519") || t.includes("\xd7"))) return null;
e.answer = [ "\u9519\u8bef" ];
}
0 === a && 0 !== n && (e.answer = "\u6b63\u786e" === e.answer[0] ? "\u9519\u8bef" : "\u6b63\u786e");
}
break;
case "\u586b\u7a7a\u9898":
e.type = "2", e.answer = K(e.html).find(".correctAnswerBx>.correctAnswer>p:not(.clear)").map(((e, t) => removeHtml(K(t).html()).replace(`(${e + 1})`, "").trim())).get().filter((e => "" !== e)),
0 == e.answer.length && (e.answer = K(e.html).find(".myAllAnswerBx>.myAnswerBx>.myAnswer").map(((e, t) => removeHtml(K(t).html()).replace(/\u7b2c[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\u7a7a\uff1a/, "").trim())).get(),
e.answer.length !== K(e.html).find(".marking_dui").length && (e.answer = []));
break;
case "\u5206\u5f55\u9898":
if (e.type = "9", e.answer = K(e.html).find(".correctAnswerBx>.correctAnswer>p:not(.clear)").map(((e, t) => removeHtml(K(t).html()))).get().filter((e => "" !== e)),
e.answer.length != K(e.html).find(".CorrectOrNot").length) {
if (K(e.html).find(".marking_cuo").length > 0) return null;
if (e.answer = K(e.html).find(".myAnswerBx>.myAnswer>p:not(.clear)").map(((e, t) => removeHtml(K(t).html()))).get().filter((e => "" !== e)),
e.answer.length != K(e.html).find(".CorrectOrNot").length) return null;
}
e.answer;
break;
case "\u8fde\u7ebf\u9898":
e.type = "11";
let n = K(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => {
let a = K(t).clone();
return a.find(".fl").remove(), removeHtml(a.html());
})).get(), r = K(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => {
let a = K(t).clone();
return a.find(".fl").remove(), removeHtml(a.html());
})).get();
t = K(e.html).find(".correctAnswer >.fl.answerCon >.collectAnswer").map(((e, t) => removeHtml(K(t).text()))).get(),
e.options = [ n, r ];
let s = {};
t.forEach((e => {
let [t, a] = e.split("-");
const i = getChaoxingAnswerIndex(t), o = getChaoxingAnswerIndex(a);
null != i && null != o && null != n[i] && null != r[o] && (s[n[i]] = r[o]);
})), e.answer = s, e.answer;
break;
case "\u9605\u8bfb\u7406\u89e3":
const i = K(e.html).find(".readCompreHensionItem").map(((e, t) => {
let a = typeMatch(K(t).find("i.index").text()), n = removeHtml(K(t).find(".clearfix").html()), r = K(t).find("ul.Zy_ulTop>li").map(((e, t) => removeHtml(K(t).html()))).get();
r = removeOptionsStartChar(r);
let s = removeHtml(K(t).find(".correctAnswerBx>.correctAnswer>.answerCon").text()), i = [];
switch (a) {
case "0":
case "1":
i = mapChaoxingChoiceLettersToOptions(s, r);
break;
default:
return null;
}
return 0 === i.length ? null : {
type: a,
question: n,
options: r,
answer: i
};
})).get();
if (null == i || 0 == i.length) return null;
e.answer = i.map((e => e.answer)), e.options = i.map((e => (delete e.answer, e))),
e.type = "15";
break;
default:
return e.type, null;
}
return e;
},
paper: async e => {
const t = {
platform: "cx"
}, a = ce.courseId, n = ce.jobid, r = `https://mobilelearn.chaoxing.com/v2/apis/class/getClassDetail?courseId=${a}&classId=${ce.classId}`;
await request(r, "GET").then((e => {
const a = JSON.parse(e[0].responseText).data.course.data[0];
t.name = a.name, t.info = {}, t.info.imageurl = a.imageurl;
})), t.hash = a, t.info = {}, t.chapter = [ {
hash: `${n}`,
name: K(".ceyan_name>h3").text().trim(),
question: e
} ], Ee.setPaper(t.hash, t);
}
}, {
type: "ask",
name: "\u5b66\u4e60\u901a\u65b0\u7248\u4f5c\u4e1a",
match: () => /\/mooc2\/work\/dowork/i.test(location.pathname),
types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ],
question: {
html: ".questionLi",
question: "h3",
options: "ul:eq(0) li .after, .answer_p",
type: "input[name^=answertype]:eq(0)",
workType: "zy",
pageType: "cx"
},
questionHook: e => {
const t = removeHtml(K(e.html).find(".colorShallow").html());
return e.question = cleanChaoxingQuestionLiTitle(e.question, t, titleClean), e.$options = K(e.html).find(".answerBg"),
e;
},
setAnswerHook: e => {
qc(e.html), qc1(e.html);
}
}, {
type: "ask",
name: "\u5b66\u4e60\u901a\u65b0\u7248\u8003\u8bd5",
match: () => /exam\/preview/i.test(location.pathname) || /exam\/test\/reVersionTestStartNew/i.test(location.pathname),
types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ],
question: {
html: ".questionLi",
question: "h3",
options: "ul:eq(0) li .after, .answer_p",
type: "input[name^=type]:not([name=type])",
workType: "ks",
pageType: "cx"
},
questionHook: e => {
const t = removeHtml(K(e.html).find(".colorShallow").html());
if (e.question = cleanChaoxingQuestionLiTitle(e.question, t, titleClean), e.$options = K(e.html).find(".answerBg"),
"3" === e.type) e.options = [];
return e;
},
setAnswerHook: e => {
qc(e.html), qc1(e.html);
},
next: () => {
K('.nextDiv .jb_btn:contains("\u4e0b\u4e00\u9898")').click();
}
}, {
type: "ask",
name: "\u5b66\u4e60\u901a\u65e7\u7248\u4f5c\u4e1a",
match: () => /work\/doHomeWorkNew/i.test(location.pathname) && 0 == location.href.includes("mooc2=1"),
types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ],
init: async () => {
if (!(await decode())) return msg("\u9875\u9762\u89e3\u5bc6\u5931\u8d25\uff0c\u65e0\u6cd5\u7b54\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u53cd\u9988\u7ed9\u4f5c\u8005\u5427", "error"),
!1;
},
question: {
html: ".TiMu",
question: ".clearfix.fontLabel",
options: "ul:eq(0) li .after",
type: "input[name^=answertype]:eq(0), .answer_p",
workType: "zy",
pageType: "cx"
},
questionHook: e => {
switch (e.question = titleClean(e.question).trim(), e.$options = K(e.html).find(".fl.before"),
e.type) {
case "3":
e.options = K(e.html).find("ul:eq(0) li").map(((e, t) => K(t).find(".ri").length > 0 ? "\u6b63\u786e" : K(t).find(".wr").length > 0 ? "\u9519\u8bef" : isTrue(K(t).attr("aria-label") || "") ? "\u6b63\u786e" : isFalse(K(t).attr("aria-label") || "") ? "\u9519\u8bef" : void 0)).get(),
e.$options = K(e.html).find("ul>li");
break;
case "11":
let t = K(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => {
let a = K(t).clone();
return a.find(".fl").remove(), removeHtml(a.html());
})).get(), a = K(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => {
let a = K(t).clone();
return a.find(".fl").remove(), removeHtml(a.html());
})).get();
e.options = [ t, a ], e.$options = K(e.html).find("ul.thirdUlList>li:not(.groupTitile)");
}
return e;
},
setAnswerHook: e => {
qc(e.html), qc1(e.html);
},
setAnswer: e => {
switch (e.type) {
case "11":
return e.ques.$options.each(((t, a) => {
let n = e.ques.options[0], r = e.ques.options[1], s = e.answer[n[t]], i = r.indexOf(s);
s = String.fromCharCode(i + 65), K(a).find("select>option").each(((e, t) => {
K(t).val(), K(t).val() == s && K(t).prop("selected", !0);
}));
})), e.answer, !1;
case "3":
let t = e.answer;
return e.ques.$options.each(((e, a) => {
isTrue(t) && (isTrue(removeHtml(K(a).html())) || K(a).find(".ri").length > 0) && K(a).find("input").click(),
isFalse(t) && (isFalse(removeHtml(K(a).html())) || K(a).find(".wr").length > 0) && K(a).find("input").click();
})), !1;
default:
return !0;
}
}
}, {
type: "ask",
name: "\u5b66\u4e60\u901a\u65b0\u7248\u7ae0\u8282",
match: () => /work\/doHomeWorkNew/i.test(location.pathname) && location.href.includes("mooc2=1"),
types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9" ],
init: async () => {
if (!(await decode())) return msg("\u9875\u9762\u89e3\u5bc6\u5931\u8d25\uff0c\u65e0\u6cd5\u7b54\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u53cd\u9988\u7ed9\u4f5c\u8005\u5427", "error"),
!1;
},
question: {
html: ".TiMu",
question: ".clearfix.fontLabel",
options: "ul:eq(0) li .after, .answer_p",
type: "input[name^=answertype]:eq(0)",
workType: "zj",
pageType: "cx"
},
questionHook: e => {
switch (e.question = titleClean(e.question).trim(), e.type) {
case "3":
e.options = K(e.html).find("ul:eq(0) li").map(((e, t) => "true" === K(t).find(".num_option").attr("data") ? "\u6b63\u786e" : "false" === K(t).find(".num_option").attr("data") ? "\u9519\u8bef" : void 0)).get(),
e.options = [];
break;
case "11":
let t = K(e.html).find("ul.firstUlList>li:not(.groupTitile)").map(((e, t) => {
let a = K(t).clone();
return a.find(".fl").remove(), removeHtml(a.html());
})).get(), a = K(e.html).find("ul.secondUlList>li:not(.groupTitile)").map(((e, t) => {
let a = K(t).clone();
return a.find(".fl").remove(), removeHtml(a.html());
})).get();
e.options = [ t, a ], e.$options = K(e.html).find("ul.thirdUlList>li:not(.groupTitile)");
break;
case "15":
const n = K(e.html).find(".readCompreHensionItem").map(((e, t) => {
let a = typeMatch(K(t).find("i.index").text()), n = removeHtml(K(t).find(".clearfix").html()), r = K(t).find("ul.Zy_ulTop>li").map(((e, t) => removeHtml(K(t).html()))).get();
return r = removeOptionsStartChar(r), {
type: a,
question: n,
options: r,
$options: K(t).find("ul.Zy_ulTop>li")
};
})).get();
if (null == n || 0 == n.length) return null;
e.options = n, e.$options = null;
break;
default:
e.type;
}
return e;
},
setAnswerHook: e => {
qc(e.html), qc1(e.html);
},
setAnswer: e => (e.ques.options, "11" !== e.type || (e.ques.$options.each(((t, a) => {
let n = e.ques.options[0], r = e.ques.options[1], s = e.answer[n[t]], i = r.indexOf(s);
s = String.fromCharCode(i + 65), ce.$(a).find(".dept_select").chosen().val(s).trigger("chosen:updated");
})), e.answer, !1))
} ], je = [ {
type: "ask",
name: "\u667a\u6167\u6811\u7ae0\u8282",
tips: "\u667a\u6167\u6811\u5fc5\u987b\u5f00\u81ea\u52a8\u8df3\u8f6c\uff0c\u5426\u5219\u7b54\u6848\u53ef\u80fd\u65e0\u6cd5\u4fdd\u5b58\u5bfc\u81f4\u4f4e\u5206\uff01",
match: () => location.href.includes("zhihuishu.com") && !location.href.includes("checkHomework") && location.host.includes("zhihuishu") && ("/stuExamWeb.html" === location.pathname || location.href.includes("/webExamList/dohomework/") || location.href.includes("/webExamList/doexamination/")),
types: [ "0", "1", "2", "3" ],
question: {
html: ".examPaper_box > div:eq(1) >div:not(.examPaper_partTit)",
question: ".subject_describe.dynamic-fonts:eq(0) div:eq(0)",
options: ".subject_node .nodeLab .label.clearfix .node_detail",
type: ".subject_type span:first-child",
workType: "zhs",
pageType: "zhs"
},
init: async () => {
await waitUntil((function() {
return !K(".yidun_popup").hasClass("yidun_popup--light") && ce.zhsques;
}));
},
next: () => {
K(".switch-btn-box button:eq(1)").click();
},
questionHook: (e, t) => {
const a = ce.zhsques.examBase.workExamParts.map((e => e.questionDtos)).flat()[t];
return e.type = typeConvert(a.questionType.name), e.question = removeHtml(a.name),
e.options = a.questionOptions ? a.questionOptions.map((e => removeHtml(e.content))) : [],
"3" == e.type && (e.options = []), e;
}
}, {
type: "save",
name: "\u667a\u6167\u6811\u4f5c\u4e1a\u6536\u5f55",
match: () => location.href.includes("zhihuishu.com") && location.href.includes("checkHomework") && location.host.includes("zhihuishu") && ("/stuExamWeb.html" === location.pathname || location.href.includes("/webExamList/checkHomework/")),
question: {
html: ".questionType",
question: ".subject_describe",
options: ".examquestions-answer",
type: ".newZy_TItle",
workType: "zhs",
pageType: "zhs"
},
init: async () => {
await waitUntil((function() {
return K(".questionType").length > 0 && K(".questionType:eq(0)")[0].__vue__.answerImgMap;
}));
},
answerHook: e => {
const t = K(e.html)[0].__vue__, a = t.answerData[t.data.id], n = "1" === a.isCurrent ? a.answer.split(",") : [], r = t.data, s = t.answerImgMap[t.data.id] || "";
t.answerImgMap, t.data.id, somd5(s), e.type = typeMatch(r.questionType.name);
const i = [];
if (e.options = r.questionOptions.map((e => (n.includes(String(e.id)) && i.push(removeHtml(e.content)),
removeHtml(e.content)))), e.answer = i, "3" === e.type) {
e.options = [];
const t = e.answer[0];
e.answer = isTrue(t) ? [ "\u6b63\u786e" ] : isFalse(t) ? [ "\u9519\u8bef" ] : [];
}
return e;
}
}, {
type: "save",
name: "\u667a\u6167\u6811\u8003\u8bd5\u6536\u5f55",
match: () => location.href.includes("zhihuishu.com") && location.href.includes("/atHomeworkExam/stu/examQ/doExamnew"),
question: {
html: ".subjecttype-div.clearfloat",
question: ".subjectTitle-p",
options: ".TitleOptions-div label",
type: ".subjecttopic-div",
workType: "zhs",
pageType: "zhs"
},
init: async () => {
await waitUntil((function() {
return K(".subjecttype-div.clearfloat").length > 0;
}));
},
answerHook: e => {
const t = K(e.html).find(".Referenceanswer-div.clearFloat>.Referenceanswer-r.fl").text();
return e.question = removeHtml(e.question), e.options = removeStartChar(e.options),
e.type = typeMatch(K(e.html).find(".subjecttopic-div").text()), e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])),
"3" == e.type && (e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []),
e;
}
} ], Le = [ {
type: "hook",
name: "\u82af\u4f4d\u6559\u80b2hook",
match: "www.beeline-ai.com" === location.host,
main: async e => {
const getPageIdentifier = () => K(".el-main > div:eq(0)").attr("class");
ce.mainClass = getPageIdentifier();
const t = new MutationObserver((async e => {
const a = getPageIdentifier();
ce.mainClass !== a && (ce.mainClass = a, "homework-detail-container" === a && await waitUntil((() => 0 === K(".el-loading-mask").length)),
vuePageChange(), t.disconnect());
for (const n of e) if ("attributes" === n.type && "class" === n.attributeName) {
const e = n.target.textContent;
if (e && (e.includes("\u4e0b\u4e00\u9898") || e.includes("\u4e0a\u4e00\u9898"))) {
vuePageChange(), t.disconnect();
break;
}
}
}));
K("body").length >= 1 && t.observe(K("body")[0], {
subtree: !0,
attributes: !0,
childList: !0
});
}
}, {
type: "ask",
name: "\u82af\u4f4d\u6559\u80b2\u4f5c\u4e1a",
tips: "\u82af\u4f4d\u6559\u80b2\u4ec5\u652f\u6301\u9009\u62e9\u5224\u65ad\uff0c\u5176\u4ed6\u9898\u578b\u5f85\u9002\u914d",
match: () => "www.beeline-ai.com" === location.host && (/student\/#\/courseInfo\/[A-Za-z0-9]+\/homework/i.test(location.href) || /student\/#\/courseInfo\/[A-Za-z0-9]+\/exam/i.test(location.href)),
types: [ "0", "1", "3" ],
question: {
html: ".content-area > div.content",
question: ".content",
options: ".el-radio-group label .label,.el-checkbox-group label .label",
type: ".question-box .tag",
workType: "xinwei",
pageType: "xinwei"
},
init: async () => {
await waitUntil((function() {
return 0 !== K(".question-box").length;
}));
},
next: () => {
K('.toggle-box > button:contains("\u4e0b\u4e00\u9898")').click();
},
ischecked: isParentChecked,
questionHook: e => (e.type = typeMatch(K(e.html).find(".question-box>.tag").text()),
e)
}, {
type: "save",
name: "\u82af\u4f4d\u6559\u80b2\u6536\u5f55",
match: () => "www.beeline-ai.com" === location.host && location.href.includes("/homeworkDetailPage"),
question: {
html: ".question-content-body",
question: ".topic-title",
options: ".el-radio-group label .label,.el-checkbox-group label .label",
type: ".question-box .tag",
workType: "xinwei",
pageType: "xinwei"
},
init: async () => {
await waitUntil((function() {
return 0 !== K(".question-content-body").length;
}));
},
answerHook: e => {
e.type = typeMatch(K(e.html).find(".question-box>.tag").text());
let t = K(e.html).find(".answer-area > span:eq(1)").text();
switch (e.type) {
case "0":
case "1":
let a = t.split(",");
if (e.answer = a.map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return;
break;
case "3":
"T" == t && (e.answer = [ "\u6b63\u786e" ]), "F" == t && (e.answer = [ "\u9519\u8bef" ]);
}
return e;
}
} ], ze = {
single_selection: "\u5355\u9009\u9898",
multiple_selection: "\u591a\u9009\u9898",
true_or_false: "\u5224\u65ad\u9898",
fill_in_blank: "\u586b\u7a7a\u9898",
short_answer: "\u7b80\u7b54\u9898",
text: "\u6587\u672c",
analysis: "\u7efc\u5408\u9898",
matching: "\u5339\u914d\u9898",
random: "\u968f\u673a\u9898",
cloze: "\u5b8c\u5f62\u586b\u7a7a\u9898"
}, Me = [ {
type: "hook",
name: "\u56fd\u5f00hook",
match: location.host.includes("ouchn.cn"),
main: e => {
observeVuePageChange(K("body")[0], getUrl, {
beforeChange: async e => {
"homework-detail-container" === e && await waitUntil((function() {
return 0 !== K(".selectDan").length;
}));
}
});
}
}, {
type: "save",
name: "\u56fd\u5f00\u7b54\u6848\u6536\u5f55\u65e7",
match: () => /\/exam\/([0-9]+)\/subjects#\/submission\/([0-9]+)/i.test(location.href),
question: {
html: "li.subject",
question: ".summary-title .subject-description",
options: ".subject-options li .option-content",
type: ".subject-point > span:eq(0)",
workType: "guokai",
pageType: "guokai"
},
init: async () => {
await waitUntil((function() {
return K(".loading-gif").hasClass("ng-hide");
}));
},
answerHook: e => {
const t = ce.angular.element(e.html).scope().subject;
if ("text" === t.type) return;
let a = !1;
const n = parseFloat(t.point), r = parseFloat(t.score), s = 0 !== n && n === r;
let i = K(`
${e.answer}
`), !1; } return !0; } }, { type: "save", name: "\u804c\u6559\u4e91\u6536\u5f55", match: () => location.href.includes("examrecord_recordDetail.action"), question: { html: ".q_content", question: ".divQuestionTitle", options: ".questionOptions>div.q_option_readonly", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== K(".q_content").length; })); }, answerHook: e => { const t = K(e.html).find(".exam.icon_examright").length, a = K(e.html).find("input[name='quesId']:not([id='']").attr("id"), n = K(`input#qId${a}`).attr("qtype"), r = K(e.html).find("span[name^='questionIndex']").text().trim() + "\u3001", s = K(e.html).find(".q_score").text().trim(); switch (e.question = e.question.replace(r, "").replace(s, "").trim(), e.options = K(e.html).find(".questionOptions>div.q_option_readonly").map(((e, t) => { let a = K(t).find("span[name='optionIndexName']").text().trim(); return removeHtml(K(t).html()).replace(a, "").trim(); })).get(), n) { case "\u5355\u9879\u9009\u62e9\u9898": case "\u5355\u9009\u9898": case "singlechoice": e.type = "0"; break; case "\u591a\u9879\u9009\u62e9\u9898": case "\u591a\u9009\u9898": case "multichoice": e.type = "1"; break; case "\u5224\u65ad\u9898": case "bijudgement": e.type = "3"; break; case "fillblank": case "\u586b\u7a7a\u9898": e.type = "2"; const t = K(e.html).find(".answerOption>span:eq(0)").clone(); t.find(".exam_answers").remove(), e.question = titleClean(removeHtml(t.html())).replace(/\uff08.*?\u5206\uff09/g, "").trim(); break; case "cloze": case "\u5b8c\u5f62\u586b\u7a7a": e.type = "14", e.options = K(e.html).find(".questionOptions>.exam_cloze_choice").map(((e, t) => [ K(t).find(".optionContent").map(((e, t) => removeHtml(K(t).html()))).get() ])).get(), e.answer = K(e.html).find(".exam_rightAnswer .answer_table .one_answer>span").map(((t, a) => { const n = K(a).text().trim(); return e.options[t][n.charCodeAt(0) - 65]; })).get(); break; case "textarea": e.type = "4", e.options = [], e.answer = removeHtml(K(e.html).find(".exam_rightAnswer .has_standard_answer").html()); } switch (e.type) { case "0": case "1": if (e.answer = K(e.html).find('.exam_rightAnswer .exam_answers_tit>span[name="rightAnswer"]').text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])), e.answer, 0 == e.answer.length) { if (0 == t) return; e.answer = K(e.html).find('.exam_stu_answer span[name="stuAnswer"]').text().trim().split("").map((t => e.options[t.charCodeAt(0) - 65])); } break; case "2": e.answer = 0 == t ? K(e.html).find(".exam_rightAnswer span.fillblank_answer").map(((e, t) => removeHtml(K(t).html()))).get() : K(e.html).find(".exam_stu_answer span.fillblank_answer").map(((e, t) => removeHtml(K(t).html()))).get(), e.answer; break; case "3": e.options = []; let a = K(e.html).find('.exam_stu_answer span[name="stuAnswer"]').text().trim(); [ "\u6b63\u786e", "\u9519\u8bef" ].includes(a) && t && (e.answer = [ a ]); } return e; } }, { type: "save", name: "\u667a\u6167\u804c\u6559\u6536\u5f55", match: () => "zjy2.icve.com.cn" === location.host && (location.href.includes("/spocviewsJob") || location.href.includes("/viewExam")), question: { html: ".subjectDet", question: ".seeTitle .htmlP.ql-editor", options: ".optionList .htmlP.ql-editor", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== K(".subjectDet").length; })); }, answerHook: e => { const t = K(e.html).find(".xvhao").text().trim(); e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")); let a = K(e.html).find(".answer").text().trim(); switch (e.answer = a.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "2": e.options = [], e.answer = K(e.html).find(".answer>span").map(((e, t) => removeHtml(K(t).html()))).get(); break; case "3": e.options = K(e.html).find(".optionList>div").map(((e, t) => removeHtml(K(t).html()))).get(), e.answer = a.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = judgeAnswer(e.answer[0]), e.options = []; break; case "11": const t = K(e.html).find(".optionList .matching>.htmlP.ql-editor").map(((e, t) => removeHtml(K(t).html()))).get(), n = K(e.html).find(".optionList>.text .htmlP.ql-editor").map(((e, t) => removeHtml(K(t).html()))).get(); e.options = [ t, n ]; let r = {}; a = K(e.html).find(".answer>span").map(((e, a) => { let [s, i] = K(a).text().trim().split("."); s.charCodeAt(0) >= 65 ? s = (s.charCodeAt(0) - 65).toString() : /^\d+$/.test(s) && (s = (parseInt(s) - 1).toString()), i.charCodeAt(0) >= 65 ? i = (i.charCodeAt(0) - 65).toString() : /^\d+$/.test(i) && (i = (parseInt(i) - 1).toString()), r[t[s]] = n[i]; })), e.answer = r; } return e; } }, { type: "ask", name: "\u667a\u6167\u804c\u6559+\u7b54\u9898", tips: "\u8be5\u5e73\u53f0\u95ee\u9898\u8f83\u591a\uff0c\u9047\u5230\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.href.includes("coursePreview/jobTest") || location.href.includes("spockeepTest") || location.href.includes("spocjobTest"), types: [ "0", "1", "3" ], question: { html: ".subjectDet", question: ".ql-editor", options: ".optionList .ql-editor", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== K(".subjectDet").length; })); }, ischecked: e => e.parent().parent().parent().hasClass("is-checked"), questionHook: e => { const t = K(e.html).find(".title.titleTwo").text().trim(); if (e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")), "3" === e.type) e.options = [], e.$options = K(e.html).find(".optionList>div label"); return e; } }, { type: "save", name: "\u667a\u6167\u804c\u6559+\u6536\u5f55", match: () => "zyk.icve.com.cn" === location.host && (location.href.includes("/coursePreview/viewJob1") || location.href.includes("/viewExam")), question: { html: ".subjectDet", question: ".seeTitle>span:eq(1)", options: ".optionList>div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== K(".subjectDet").length; })); }, answerHook: e => { e.options = removeStartChar(e.options); const t = K(e.html).find(".xvhao").text().trim(); e.type = typeConvert(t.match(/\u3010(.*)\u3011/)[1].trim().replace("\u586b\u7a7a\u9898(\u5ba2\u89c2)", "\u586b\u7a7a\u9898")); let a = K(e.html).find(".answer").text().trim(); switch (e.answer = a.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "2": e.options = [], e.answer = K(e.html).find(".answer>span").map(((e, t) => removeHtml(K(t).html()))).get(); break; case "3": e.options = K(e.html).find(".optionList>div").map(((e, t) => removeHtml(K(t).html()))).get(), e.answer = a.split(",").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = judgeAnswer(e.answer[0]), e.options = []; } return e; } }, { type: "save", name: "ai\u4f18\u8bfe\u6536\u5f55\u65b0", match: () => "ai.icve.com.cn" === location.host && location.href.includes("/review-exam/"), question: { html: () => { let e = K(".examination-paper")[0].__vue__.sjAllInfo.questions, t = []; return e.sort(((e, t) => e.txdm - t.txdm)), e.forEach((e => { t.push(e); })), t; }, question: ".seeTitle>span:eq(1)", options: ".optionList>div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== K(".examination-paper")[0].__vue__.sjAllInfo.questions.length; })); let e = K(".examination-paper")[0].__vue__.sjAllInfo.questions, t = []; e.sort(((e, t) => e.txdm - t.txdm)), e.forEach((e => { t.push(e); })), ce.quesList = t; }, answerHook: (e, t) => { const a = e.html; e.type = typeMatch(a.type), e.question = titleClean(a.tmmc); let n = []; switch (e.type) { case "3": "1" == a.answer && (e.answer = [ "\u6b63\u786e" ]), "0" == a.answer && (e.answer = [ "\u9519\u8bef" ]); break; case "2": e.answer = a.answer.split(","); break; case "4": e.answer = a.answer; break; case "0": case "1": e.options = a.sjtmxxlist.map((e => ("1" == e.sfzqda && n.push(removeHtml(e.xxnr)), removeHtml(e.xxnr)))), e.answer = n; } return e; }, paper: async e => {} }, { type: "ask", name: "ai\u4f18\u8bfe\u7b54\u9898", tips: "", match: () => "ai.icve.com.cn" === location.host && location.href.includes("/preview-exam/"), types: [ "0", "1" ], question: { html: () => { let e = K(".examination-paper")[0].__vue__.tmActivelist, t = []; return e.sort(((e, t) => e.px - t.px)), e.forEach((e => { t.push(e); })), t; }, question: ".seeTitle>span:eq(1)", options: "label", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== K(".examination-paper")[0].__vue__.tmActivelist.length; })); }, toquestion: e => { K(".topic-zpx-list .topic-zpx-main span:eq(" + e + ")").click(); }, ischecked: e => e.hasClass("wrongXz"), questionHook: e => { var t; const a = e.html, n = K(".examination-paper")[0].__vue__.topList, r = []; Object.keys(n).forEach((e => { n[e].forEach((t => { r.push({ id: t.id, type: t.txdmmc || e }); })); })); const s = (null == (t = r.find((e => e.id === a.id))) ? void 0 : t.type) || "\u5176\u4ed6"; e.type = typeMatch(s), e.question = titleClean(a.title); const i = a.dataArr.map((e => removeHtml(e.Content))); return e.options = i, e.answer = [], e.html = K(".content-center"), e.$options = () => K("label"), e; } } ], De = [ { type: "ask", name: "\u5ddd\u519c\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.host.includes("cnzx.info") && location.href.includes("KaoShi/ShiTiYe.aspx"), types: [ "0", "1", "3" ], question: { html: "li.question", question: ".wenti >p.stem", options: ".wenti > ol > li", type: ".question_head > span:eq(0)", workType: "cnzx", pageType: "cnzx" }, init: async () => {}, ischecked: e => e.find("input").prop("checked"), questionHook: e => (e.$options = K(e.html).find(".wenti > ol > li input"), 0 !== e.options.length && (e.type = "radio" === e.$options.eq(0).attr("type") ? "0" : "1", 2 === e.options.length && e.options.includes("\u6b63\u786e") && e.options.includes("\u9519\u8bef") && (e.type = "3", e.options = [])), e), setAnswer: e => "3" !== e.type || (K(e.html).find(".wenti > ol > li").each(((t, a) => { isTrue(e.answer) && isTrue(removeHtml(K(a).html())) && e.ques.$options.eq(t).click(), isFalse(e.answer) && isFalse(removeHtml(K(a).html())) && e.ques.$options.eq(t).click(); })), !1), finish: e => { K("li.paginationjs-next.J-paginationjs-next").click(); } }, { type: "save", name: "\u5ddd\u519c\u5728\u7ebf\u6536\u5f55", match: () => location.host.includes("cnzx.info") && location.href.includes("ZaiXianLianXi.aspx"), question: { html: ".ShiTi>.ShiTiMiaoShu", question: ".ShiTiMiaoShu", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "cnzx", pageType: "cnzx" }, init: async () => {}, answerHook: e => { K(e.html).text(), e.question = removeHtml(titleClean(removeHtml(K(e.html).html()))); let t = K("ul.TiXing>li.DangQianTiXing:eq(0)>a").text(), a = [], n = K(e.html).next(); switch (e.options = removeStartChar(n.find("ul li").map(((e, t) => (K(t).hasClass("DaAn1") && a.push(e), titleClean(removeHtml(K(t).html()))))).get()), e.answer = a.map((t => e.options[t])), t) { case "\u5355\u9009\u9898": case "\u8bcd\u6c47\u4e0e\u7ed3\u6784": case "\u4ea4\u9645\u7528\u8bed": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.type = "3", e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []; } return e; } } ], Ne = [ { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u65e7\u7248)", tips: "", match: () => location.href.includes("study/html/content/studying/?courseOpenId=") || location.href.includes("study/html/content/sxsk/?courseOpenId=") || location.href.includes("study/html/content/tkOnline/?courseOpenId=") || location.href.includes("study/html/content/bkExam/?courseOpenId="), types: [ "0", "1", "3" ], question: { html: ".e-q-body>.e-q", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".e-q-body>.e-q") && isExist(".e-item"); })), !isExist(".photo-time") && !isExist(".btn_save")) return !1; }, ischecked: e => e.parent().hasClass("checked"), questionHook: e => { var t; const a = K(e.html).parent().parent(); switch (e.type = a ? null == (t = a.attr("id")) ? void 0 : t.trim() : "", e.type) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.$options = K(e.html).find("ul>li"); break; case "4": e.type = "2"; break; case "5": e.type = "4"; break; default: e.type, e.type = "8"; } return e; }, setAnswer: e => { switch (e.type) { case "4": case "2": return K(e.html).find("textarea.answer-input").focus(), K(e.html).find(" textarea.answer-input"), K(e.html).find(".answer-input.edui-default").each(((t, a) => { let n = K(a).attr("id"), r = ce.UE.getEditor(n); r.ready((function() { r.setContent(`${e.answer[t]}
`); })); })), K(e.html).find(".answer-input").blur(), !1; } return !0; } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u65e7\u7248)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("study/html/content/studying/?courseOpenId=") || location.href.includes("study/html/content/sxsk/?courseOpenId=") || location.href.includes("study/html/content/tkOnline/?courseOpenId=") || location.href.includes("study/html/content/bkExam/?courseOpenId="), question: { html: ".e-q-body>.e-q", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".e-save"), isExist(".e-q-body>.e-q") && isExist(".w_e-q-panel"); })), !isExist(".e-quest-review")) return !1; }, answerHook: e => { var t; const a = K(e.html).parent().parent(); e.type = a ? null == (t = a.attr("id")) ? void 0 : t.trim() : "", e.$options = K(e.html).find("ul>li"); let n = K(e.html).find("ul>li.checked").map(((e, t) => removeHtml(K(t).find(".ErichText").html()))).get(); const r = K(e.html).find(".e-q-right").length > 0; e.answer = n.filter((e => "" !== e)); let s = K(e.html).find(".e-ans-ref .e-ans-r").map(((e, t) => removeHtml(K(t).html()))).get(); 1 === s.length && s[0].length > 1 && (s = s[0].split("\u3001")); let i = s.map((t => { let a = t.charCodeAt() - 65; return e.options[a]; })).filter((e => "" !== e && void 0 !== e)); switch (e.type) { case "2": e.type = "1"; break; case "1": e.type = "0"; break; case "3": e.type = "3", e.answer = K(e.html).find("ul>li.checked").map(((e, t) => removeHtml(K(t).html()))).get(), e.options = [], isTrue(e.answer[0]) ? e.answer = [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? e.answer = [ "\u9519\u8bef" ] : e.answer = []; break; case "4": e.type = "2", e.options = []; break; case "5": e.type = "4", i = [ removeHtml(K(e.html).find(".e-ans-ref>.e-ans-r").html()) ], e.options = []; break; case "11": e.type = "19"; const t = K(e.html).find("form").map(((e, t) => ({ type: "0", question: removeHtml(K(t).find(".e-q-q .ErichText").html()), options: K(t).find("ul li .ErichText").map(((e, t) => removeHtml(K(t).html()))).get() }))).get(); i = i.length > 0 ? judgeAnswer(i[0]) : [], e.options = t; default: return void e.type; } if (i.length > 0) return e.answer = i, e; if (!r && "3" === e.type && e.answer.length > 0) { if (e.answer = function(e) { if (!isTrue(e[0]) && !isFalse(e[0])) return e[0], []; return isTrue(e[0]) ? [ "\u9519\u8bef" ] : isFalse(e[0]) ? [ "\u6b63\u786e" ] : []; }(e.answer), 0 === e.answer.length) return; } else if (!r) return; return e; }, paper: e => { const t = ce.online, a = { platform: "ahjxjy" }; a.hash = t.courseOpenId, a.name = ce.localStorage.courseNmae, a.info = {}, a.chapter = [ { hash: `${t.cell.id}`, name: t.cell.title, question: e } ], Ee.setPaper(a.hash, a); } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u65b0\u7248)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("/myHomework/answerRecord") || location.href.includes("/myHomework/assignment") || location.href.includes("/myExam/examDetails") || location.href.includes("/myExam/examHistory"), question: { html: ".option>div[id='answer-card-area']", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { await waitUntil((function() { return isExist(".option>div[id='answer-card-area']"); })); }, answerHook: (e, t) => { const a = K("micro-app-body>#app>div")[0].__vue__.hierarchyList[t]; e.type = typeMatch(a.name), e.question = titleClean(removeHtml(a.Content)); const {options: n, answer: r} = a.CourseQuestionOptionList.reduce(((e, t) => { const a = removeHtml(t.Content); return t.IsAnswer && e.answer.push(a), e.options.push(a), e; }), { options: [], answer: [] }); return e.options = n, e.answer = "3" === e.type ? [ judgeAnswer(r[0]) ] : r, "3" === e.type && (e.options = []), e; } }, { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u65b0\u7248)", tips: "\u5355\u9898\u95f4\u9694\u5fc5\u987b\u5927\u4e8e 3 \u79d2\uff01\uff01\u5426\u5219\u5bb9\u6613\u5f02\u5e38\uff01\uff01", match: () => location.href.includes("/myHomework/assignment") || location.href.includes("/myExam/examDetails"), types: [ "0", "1", "3" ], minDelay: 3e3, answerDelay: 1e3, question: { html: ".option>div[id='answer-card-area']", question: ".ErichText", options: "ul.answer-list>li", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".option>div[id='answer-card-area']"); })), !K(".submit-area").text().includes("\u63d0\u4ea4")) return !1; const e = K("micro-app-body>#app>div")[0].__vue__, t = e.hierarchyList[0]; e.goAnchor(t.Id); }, toquestion: e => { const t = K("micro-app-body>#app>div")[0].__vue__, a = t.hierarchyList[e]; (null == a ? void 0 : a.Id) && t.goAnchor(a.Id); }, ischecked: e => e.hasClass("on"), questionHook: (e, t) => { const a = K("micro-app-body>#app>div")[0].__vue__.hierarchyList[t]; e.type = typeMatch(a.name), e.question = titleClean(removeHtml(a.Content)); let n = []; return a.CourseQuestionOptionList.forEach((e => { const t = removeHtml(e.Content); e.IsAnswer, n.push(t); })), e.options = n, e.html = "body", e.$options = () => K("ul.answer-list>li"), e; } }, { type: "ask", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u7b54\u9898(\u81ea\u8003)", tips: "", match: () => location.href.includes("/userinfo/testPaper"), types: [ "0", "1", "3" ], question: { html: ".item-card-area", question: ".desc", options: "ul>li", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".exam-paper-wrap"); })), isExist(".exam-process-area")) return !1; const e = K(".exam-paper-wrap")[0].__vue__.topicList.map((e => e.getPaperList)).flat(); window.Zques = e; }, ischecked: e => e.parent().hasClass("checked"), questionHook: (e, t) => { const a = Zques[t]; e.type = typeMatch(a.questionTypeName), e.question = titleClean(removeHtml(a.content)); const {options: n, answer: r} = a.courseQuestionOptionList.reduce(((e, t) => { const a = removeHtml(t.content); return t.isAnswer && e.answer.push(a), e.options.push(a), e; }), { options: [], answer: [] }); return e.options = n, e.answer = "3" === e.type ? [ judgeAnswer(r[0]) ] : r, "3" === e.type && (e.options = []), e; }, setAnswer: e => { switch (e.type) { case "4": case "2": return K(e.html).find("textarea.answer-input").focus(), K(e.html).find(" textarea.answer-input"), K(e.html).find(".answer-input.edui-default").each(((t, a) => { let n = K(a).attr("id"), r = ce.UE.getEditor(n); r.ready((function() { r.setContent(`${e.answer[t]}
`); })); })), K(e.html).find(".answer-input").blur(), !1; } return !0; } }, { type: "save", name: "\u5b89\u5fbd\u7ee7\u7eed\u6559\u80b2\u6536\u5f55(\u81ea\u8003)", tips: "\u8be5\u5e73\u53f0\u4ec5\u652f\u6301\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u9898\u578b\uff0c\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301", match: () => location.href.includes("/userinfo/testPaper"), question: { html: ".item-card-area", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "ahjxjy", pageType: "ahjxjy" }, init: async () => { if (await waitUntil((function() { return isExist(".exam-paper-wrap"); })), !isExist(".score-describe")) return !1; const e = K(".exam-paper-wrap")[0].__vue__.topicList.map((e => e.getPaperList)).flat(); window.Zques = e; }, answerHook: (e, t) => { const a = Zques[t]; e.type = typeMatch(a.questionTypeName), e.question = titleClean(removeHtml(a.content)); const {options: n, answer: r} = a.courseQuestionOptionList.reduce(((e, t) => { const a = removeHtml(t.content); return t.isAnswer && e.answer.push(a), e.options.push(a), e; }), { options: [], answer: [] }); return e.options = n, e.answer = "3" === e.type ? [ judgeAnswer(r[0]) ] : r, "3" === e.type && (e.options = []), e; } } ], Re = [ { type: "save", name: "\u9752\u4e66\u4f5c\u4e1a\u7b54\u9898\u6536\u5f55", match: () => location.host.includes("qingshuxuetang.com") && (location.href.includes("Student/ExercisePaper?courseId=") || location.href.includes("Student/ViewQuiz?quizId=") || location.href.includes("Student/SimulationExercise/Detail?id=") || location.href.includes("Student/Quiz/Detail?id=")), question: { html: ".paper-container > .question-detail-container", question: ".question-detail-description", options: ".question-detail-options .question-detail-option .option-description-preview", type: ".question-detail-type-desc", workType: "qingshu", pageType: "qingshu" }, init: async () => { await waitUntil((function() { return isExist(".question-detail-container") && ce.qsques; })); }, answerHook: (e, t) => { const a = ce.qsques[t]; switch (e.question = removeHtml(a.description), e.options = a.options ? a.options.map((e => removeHtml(e.description))) : [], e.type = typeConvert(a.typeDesc), e.answer = a.solution.split("").map((t => e.options[t.charCodeAt(0) - 65])), e.type) { case "3": e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : [ "" ]; break; case "15": e.options = [], e.answer = [], a.subQuestions.forEach((t => { let a = t.options ? t.options.map((e => removeHtml(e.description))) : [], n = t.solution.split("").map((e => a[e.charCodeAt(0) - 65])); e.answer.push(n), e.options.push(a); })); } return e; } }, { type: "ask", name: "\u9752\u4e66\u5b66\u5802\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.host.includes("qingshuxuetang.com") && (location.href.includes("/Student/ExercisePaper") || location.href.includes("Student/ExamPaper") || location.href.includes("Student/ViewQuiz") || location.href.includes("Student/SimulationExercise/Detail") || location.href.includes("Student/Quiz/Detail")), types: [ "0", "1", "3" ], question: { html: ".paper-container > .question-detail-container", question: ".question-detail-description", options: ".question-detail-options .question-detail-option .option-description", type: ".question-detail-type-desc", workType: "qingshu", pageType: "qingshu" }, init: async () => { await waitUntil((function() { return isExist(".question-detail-container") && ce.qsques; })); }, ischecked: e => e.parent().find("input").prop("checked"), toquestion: e => { K(`.group_item:eq(${e})`), K(`.group_item:eq(${e})`).click(); }, questionHook: (e, t) => { const a = ce.qsques[t]; if (e.question = removeHtml(a.description), e.options = a.options ? a.options.map((e => removeHtml(e.description))) : [], e.type = typeConvert(a.typeDesc), "3" === e.type) e.options = []; return e; } } ], Be = [ { type: "save", name: "\u4f18\u8bfe\u5728\u7ebf\u6536\u5f55", match: () => "cce.org.uooconline.com" === location.host && (location.href.includes("/exam/paper") || location.href.includes("/exam/")), question: { html: ".queContainer", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "uooc", pageType: "uooc" }, init: async () => { await waitUntil((function() { return 0 !== K(".queContainer").length; })); }, answerHook: e => { const t = ce.angular.element(e.html).scope().question; if (e.type = typeConvert(t.type_text), e.question = t.question, e.options = t.options_app.map((e => e.value)), e.answer = t.answer.map((e => t.options[e])), "3" === e.type) e.options = [], e.answer = judgeAnswer(e.answer[0]); return e; } } ], Ge = [ { type: "ask", name: "\u4eac\u4eba\u5e73\u53f0\u7b54\u9898", tips: "", match: () => location.host.includes("cj-edu.com") && (location.href.includes("/Examination") || location.href.includes("/ExamInfo")), types: [ "0", "1", "3" ], question: { html: ".el-main>.all_subject>div.el-row", question: "div.stem", options: "ul li > label > span.el-radio__label > div:nth-child(2),ul li > label > span.el-checkbox__label > div:nth-child(2)", type: ".question-box .tag", workType: "cjedu", pageType: "cjedu" }, init: async () => { await waitUntil((function() { return 0 !== K(".el-main>.all_subject>div.el-row").length; })); }, ischecked: isParentChecked, questionHook: e => { switch (K(e.html).prevAll("h1").first().text().trim()) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.$options = K(e.html).find("ul li>label"), e.options = [], e.type = "3"; } return e; } }, { type: "save", name: "\u4eac\u4eba\u5e73\u53f0\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("cj-edu.com") && location.href.includes("/ViewAnswerSheet"), question: { html: ".el-main>.all_subject>div.el-row", question: "p.stem", options: "ul li > label > span.el-radio__label > div:nth-child(2),ul li > label > span.el-checkbox__label > div:nth-child(2)", type: ".question-box .tag", workType: "cjedu", pageType: "cjedu" }, init: async () => { await waitUntil((function() { return 0 !== K(".el-main>.all_subject>div.el-row").length; })); }, answerHook: e => { let t = K(e.html).find(".seeStudentAnswer>p.answer").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(), a = K(e.html).prevAll("h1").first().text().trim(); switch (e.options.length > 0 && (e.answer = t.split(",").map((t => e.options[t.charCodeAt(0) - 65]))), a) { case "\u5355\u9009\u9898": e.type = "0"; break; case "\u591a\u9009\u9898": e.type = "1"; break; case "\u5224\u65ad\u9898": e.options = [], e.answer = judgeAnswer(t), e.type = "3"; } return e; } } ], Ve = [ { type: "hook", name: "hook", match: location.host.includes("ytccr.com"), main: e => { observeVuePageChange(K("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u7ece\u901a\u7ee7\u6559\u4e91\u7b54\u9898", tips: "", match: () => location.host.includes("ytccr.com") && location.href.includes("learning-work") && location.href.includes("type=3"), types: [ "0", "1", "3" ], question: { html: ".border-item", question: ".title.qa-title", options: ".opts-list .opt-title-cnt", type: ".question-box .tag", workType: "ytccr", pageType: "ytccr" }, init: async () => { await waitUntil((function() { return 0 !== K(".border-item").length; })); }, ischecked: isParentChecked, questionHook: e => { if (e.type = typeConvert(K(e.html).find(".qtype").text().trim()), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u7ece\u901a\u7ee7\u6559\u4e91\u6536\u5f55", match: () => location.host.includes("ytccr.com") && location.href.includes("learning-work") && location.href.includes("type=5"), question: { html: ".border-item", question: ".title.qa-title", options: ".opts-list .opt-title-cnt", type: ".question-box .tag", workType: "ytccr", pageType: "ytccr" }, init: async () => { await waitUntil((function() { return 0 !== K(".border-item").length; })); }, answerHook: e => { e.type = typeConvert(K(e.html).find(".qtype").text().trim()); let t = K(e.html).find(".u-text-success,.u-text-danger").text().split("\uff0c")[0].trim(); if (t = t.match(/[A-Z]+$/)[0].trim(), e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), 0 === e.answer.length) return e; if ("3" === e.type) e.options = [], e.answer = judgeAnswer(e.answer[0]); return e; } } ], Ke = [ { type: "ask", name: "\u5b66\u8d77\u8003\u8bd5", tips: "", match: () => location.href.includes("oxer/page/ots/examIndex.html"), types: [ "0", "1", "3" ], question: { html: ".queItemClass", question: "dt > div.din:eq(1)", options: "dd > div", type: ".question-box .tag", workType: "xueqi", pageType: "xueqi" }, init: async () => { await waitUntil((function() { return isExist(".queItemClass"); })), ce.document.onkeydown = null, ce.oncontextmenu = null; }, ischecked: e => e.parent().hasClass("cur"), questionHook: e => { let t = K(e.html).parent().find("div .fb:eq(0)").text().split("\u3001")[1]; if (t.includes("\u5224\u65ad") && (t = "\u5224\u65ad\u9898"), e.type = typeMatch(t), "3" === e.type) e.options = [], e.$options = K(e.html).find("input"); return e; }, setAnswer: e => { if ("3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, a) => { isTrue(t) && isTrue(removeHtml(K(a).val())) && K(a).click(), isFalse(t) && isFalse(removeHtml(K(a).val())) && K(a).click(); })), !1; } return !0; } }, { type: "save", name: "\u5b66\u671f\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("OTS-UniverDetail.html"), question: { html: ".dl_list", question: "dt > div.fl:eq(1)", options: "dd > var", type: ".question-box .tag", workType: "xueqi", pageType: "xueqi" }, init: async () => { await waitUntil((function() { return isExist(".dl_list"); })); }, answerHook: e => { var t, a, n, r, s; const i = K(e.html).attr("queid"), o = e.html._ms_context_.el.questions.find((e => e.id === i)); o.questionTypeName.includes("\u5224\u65ad") && (o.questionTypeName = "\u5224\u65ad\u9898"), e.type = typeMatch(o.questionTypeName), e.question = removeHtml(o.stem), console.log(o), e.options = (null == (a = null == (t = o.answerArea) ? void 0 : t.optionList) ? void 0 : a.sort(((e, t) => e.sequence - t.sequence)).map((e => removeHtml(e.content)))) || []; let l = o.answer.ans || (null == (n = o.answer.ansL) ? void 0 : n.join("")) || null; if (l) e.answer = l.split("").map((t => e.options[t.charCodeAt(0) - 65])); else { const t = (null == (s = null == (r = o.answerArea) ? void 0 : r.optionList) ? void 0 : s.filter((e => e.isTrue)).map((e => removeHtml(e.content)))) || []; if (0 === o.answerScore) return; e.answer = t; } return "3" === e.type && (e.options = [], e.answer = judgeAnswer(l)), e; }, paper: e => { const t = K(".dl_list:eq(0)")[0]._ms_context_.loop.category, a = K(".dl_list:eq(0)")[0]._ms_context_.oAnswerDetailInfo, n = { platform: "xueqi" }; n.hash = t.code, n.name = t.value, n.info = {}, n.chapter = [ { hash: `${a.arrangementid}`, name: a.arrangementname, question: e } ], Ee.setPaper(n.hash, n); } } ], We = [ { type: "hook", name: "hook", match: "gdrtvu.exam-cloud.cn" === location.host, main: e => { observeVuePageChange(K("#app")[0], getUrl); } }, { type: "ask", name: "\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("exam-cloud.cn") && location.href.includes("oe-web/online-exam/exam"), types: [ "0", "1", "3" ], question: { html: ".question-container", question: ".question-body:first", options: ".option .question-options", type: ".question-header .container", workType: "guangkai", pageType: "guangkai" }, init: async () => { await waitUntil((function() { return isExist(".question-container"); })); }, ischecked: isParentChecked, questionHook: e => { let t = K(".list .current-question").parent().parent().find(".title").text(); if (console.log(t), t = t.split("\u3001")[1], t = t.replace(/\(.*\)/, "").trim(), console.log(t), e.type = typeConvert(t), "8" == e.type ? e.type = typeMatch(t) : e.type, "3" === e.type) e.options = []; return e; }, finish: e => { K(".next .qm-primary-button").length && K(".next .qm-primary-button")[0].click(); } } ], Qe = [ { type: "hook", name: "hook", match: location.host.includes("open.ha.cn"), main: e => { const getHash = () => K(".stuHomeworkVersionId.active").attr("id"); ce.mainClass = getHash(); let t = new MutationObserver((async e => { getHash(), ce.mainClass !== getHash() && (ce.mainClass = getHash(), vuePageChange(), t.disconnect()); })); K(".homeworkBody").length >= 1 && t.observe(K(".homeworkBody")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "ask", name: "\u4e91\u4e0a\u6cb3\u5f00\u7b54\u9898", tips: "", match: () => location.host.includes("open.ha.cn") && location.href.includes("/homework/showHomeworkByStatus") && location.href.includes("checked=false"), types: [ "0", "1" ], question: { html: ".layui-colla-content > .insert", question: ".window-title", options: ".option-title", type: ".question-box .tag", workType: "openha", pageType: "openha" }, init: async () => { await waitUntil((function() { return isExist(".layui-colla-content > .insert"); })); }, ischecked: isParentChecked, questionHook: e => (e.options = e.$options.map(((t, a) => { let n = K(a).find(".numberCover").text().trim(); return removeHtml(e.$options.eq(t).html()).replace(n, "").trim(); })).get(), e.type = typeConvert(K(e.html).find(".questionDiv>.float-l:eq(1)").text().trim()), e.$options = K(e.html).find(".option-title .numberCover"), e) }, { type: "save", name: "\u4e91\u4e0a\u6cb3\u5f00\u6536\u5f55", match: () => location.host.includes("open.ha.cn") && location.href.includes("/homework/showHomeworkByStatus") && location.href.includes("checked=true"), question: { html: ".layui-colla-content > .insert", question: ".window-title", options: ".option-title", type: ".question-box .tag", workType: "openha", pageType: "openha" }, init: async () => { await waitUntil((function() { return isExist(".layui-colla-content > .insert"); })); }, answerHook: e => { let t = []; const a = 0 == K(e.html).find(".option-title.error2").length; if (e.options = e.$options.map(((a, n) => { let r = K(n).find(".numberCover").text().trim(), s = removeHtml(e.$options.eq(a).html()).replace(r, "").trim(); return K(n).hasClass("answer-title") && t.push(s), s; })).get(), e.type = typeConvert(K(e.html).find(".questionDiv>.float-l:eq(1)").text().trim()), a) return e.answer = t, K(e.html).find(".option-title.error2"), e; }, paper: e => { const t = ce.homework, a = { platform: "openha" }; a.hash = t.courseId, a.name = t.courseName, a.info = {}, a.chapter = [ { hash: `${t.homeworkId}`, name: t.title, question: e } ], Ee.setPaper(a.hash, a); } } ], Je = [ { type: "ask", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u7b54\u9898", tips: "", match: () => location.href.includes("uc/task/startTask"), types: [ "0", "1" ], answerDelay: 1e3, minDelay: 1e3, question: { html: ".carousel-inner>.item.changeless-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".carousel-inner>.item.changeless-box"); })), !isExist("#finish")) return !1; await waitUntil((function() { let e = K(".carousel-inner>article").filter(((e, t) => K(t).hasClass("temporary-box"))).eq(0).index(); return e > 0 ? (K(".slide-tihao:eq(" + e + ")")[0].click(), !1) : (K(".slide-tihao:eq(0)")[0].click(), !0); })); }, toquestion: e => { K(".slide-tihao:eq(" + e + ")")[0].click(); }, ischecked: e => e.find(".checked").length > 0, questionHook: e => (e.type = typeConvert(K(e.html).attr("data-name") || ""), e.$options = K(e.html).find(".ic-options__wrap label"), e.question = e.question.replace(/^\(\d+\)/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e) }, { type: "ask", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.href.includes("uc/exam/record/startExamination"), types: [ "0", "1" ], question: { html: ".trunk-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".trunk-box") && isExist(".ic-ac-checkbox-ol"); })), await waitUntil((function() { return window.scrollTo(0, document.body.scrollHeight), K(".ic-ac-checkbox-ol li").length == K(".trunk-box").length; })), !isExist("#submit-btn")) return !1; }, next: () => { K("#carousel-professional").carousel("next"); }, ischecked: e => e.find(".checked").length > 0, questionHook: e => { const t = K(e.html).attr("data-type"); switch (console.log(t), t) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; case "3": e.type = "3", e.options = []; } return e.question = e.question.replace(/^\d+\u3001/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e.question = e.question.replace(/\[\S+\]$/, "").trim(), e.$options = K(e.html).find(".ic-options__wrap label"), e; } }, { type: "save", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u6536\u5f55", match: () => location.href.includes("uc/task/startTask"), question: { html: ".carousel-inner>.item.changeless-box", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".carousel-inner>.item.changeless-box") && isExist(".slide-tihao"); })), isExist("#finish")) return !1; await waitUntil((function() { let e = K(".carousel-inner>article").filter(((e, t) => K(t).hasClass("temporary-box"))).eq(0).index(); return e > 0 ? (K(".slide-tihao:eq(" + e + ")")[0].click(), !1) : (K(".slide-tihao:eq(0)")[0].click(), !0); })); }, answerHook: e => { const t = K(e.html).find(".analysis-box .fs20.c-primary.vam").text().trim().split(""); return e.type = typeConvert(K(e.html).attr("data-name") || ""), e.answer = t.map((t => e.options[t.charCodeAt(0) - 65])), e.question = e.question.replace(/^\(\d+\)/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e; } }, { type: "save", name: "\u6cb3\u5357\u7ee7\u7eed\u6559\u80b2\u8003\u8bd5\u6536\u5f55", match: () => location.href.includes("uc/exam/record/startExamination"), question: { html: ".trunk-box.answer-question", question: ".exam-tg-txt__wrap.e-tg-box", options: ".ic-options-list address", type: ".question-box .tag", workType: "cloudwis", pageType: "cloudwis" }, init: async () => { if (await waitUntil((function() { return isExist(".trunk-box") && isExist(".ic-ac-correct"); })), await waitUntil((function() { return window.scrollTo(0, document.body.scrollHeight), K(".ic-ac-correct,.ic-ac-error").length == K(".trunk-box").length; })), isExist("#submit-btn")) return !1; }, next: () => { K(".next-slide").click(); }, answerHook: e => { const t = K(e.html).attr("data-type"); console.log(t); const a = K(e.html).find(".ic-options__wrap label").filter(((e, t) => K(t).find(".checked").length > 0)).map(((e, t) => removeHtml(K(t).html()))).get(); switch (e.answer = a.map((t => e.options[t.charCodeAt(0) - 65])), e.question = e.question.replace(/^\d+\u3001/, "").trim(), e.question = e.question.replace(/\(\d+\u5206\)$/, "").trim(), e.question = e.question.replace(/\[\S+\]$/, "").trim(), t) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; case "3": e.type = "3", e.options = [], e.answer = judgeAnswer(e.answer[0]); } return e; } } ], Xe = [ { type: "hook", name: "hook", match: location.host.includes("sclecb.cn"), main: e => { observeVuePageChange(K("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => "study.sclecb.cn" === location.host && /\/[0-9]+\/show/i.test(location.href), types: [ "0", "1", "3" ], question: { html: ".testpaper-question.js-testpaper-question", question: ".testpaper-question-stem", options: ".testpaper-question-choices li", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".testpaper-question.js-testpaper-question"); })); }, ischecked: e => e.hasClass("checked"), questionHook: e => { switch (e.options = removeStartChar(e.options), e.$options = K(e.html).find(".testpaper-question-choice-inputs > label > input"), e.type = typeConvert(K(e.html).parent().parent().find(".panel-heading>strong").text().trim()), e.type, e.type) { case "0": case "1": break; case "3": e.$options = K(e.html).find(".radio-inline"); } return e; } }, { type: "ask", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u7b54\u9898\u65e7", tips: "", match: () => location.host.includes("sclecb.cn") && /student\/course\/study\/[0-9a-zA-Z]+\/test\/redo/i.test(location.href), types: [ "0", "1" ], question: { html: ".questiono-item", question: ".clearfix.questiono-header h6", options: ".common_test_option .processing_img", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".questiono-item"); })); }, ischecked: e => e.hasClass("checked"), questionHook: e => { const t = K(e.html).parent().parent().find("div:eq(0)").text().trim(); switch (!0) { case t.includes("\u5355\u9009\u9898"): e.type = "0"; break; case t.includes("\u591a\u9009\u9898"): e.type = "1"; break; case t.includes("\u5224\u65ad\u9898"): e.type = "3", e.options = [], e.$options = K(e.html).find(".common_test_option > label"); break; default: return; } return e; } }, { type: "save", name: "\u56db\u5ddd\u5f00\u653e\u5927\u5b66\u6536\u5f55", match: () => "study.sclecb.cn" === location.host && (/task\/[0-9]+\/activity_show/i.test(location.href) || /result\/[0-9]+\/show/i.test(location.href)), question: { html: ".testpaper-question.js-testpaper-question", question: ".testpaper-question-stem", options: ".testpaper-question-choices li", type: ".question-box .tag", workType: "sclecb", pageType: "sclecb" }, init: async () => { await waitUntil((function() { return isExist(".testpaper-question.js-testpaper-question"); })); }, answerHook: (e, t) => { let a = []; e.options = e.$options.map(((e, t) => { const n = removeHtml(K(t).clone().find(".testpaper-question-choice-index").remove().end().html()); return K(t).hasClass("testpaper-question-choice-right") && a.push(n), n; })).get(), e.answer = a, e.type = typeConvert(K(".js-panel-card>span").eq(t).prevAll("p").first().text().trim()); const n = K(".js-panel-card>span").eq(t).hasClass("bg-success"); switch (e.type) { case "0": case "1": break; case "3": let t = ""; t = K(e.html).find(".testpaper-question-result").text().replace("\u4f60\u7684\u7b54\u6848\u662f", "").trim(), e.answer = judgeAnswer(t); } if ((n || !(e.answer.length > 0) || "3" != e.type) && n) return e; } } ], Ye = [ { type: "hook", name: "hook", match: location.host.includes("superchutou.com"), main: e => { observeVuePageChange(K("#root")[0], (() => getUrl())); } }, { type: "ask", name: "\u51fa\u5934\u7cfb\u7edf\u7b54\u9898", tips: "", match: () => location.host.includes("superchutou.com") && location.href.includes("onlineclass/exam/"), types: [ "0", "1" ], question: { html: "[class^='single_excer_item']", question: "[class^='title_content'] > [class^='title_content_text']:eq(1)", options: "[class^='options_content'] label", type: ".question-box .tag", workType: "chutou", pageType: "chutou" }, init: async () => { await waitUntil((function() { return isExist("[class^='single_excer_item']"); })); }, ischecked: isParentChecked, questionHook: e => { let t = K(e.html).find("[class^='title_content'] > span:eq(1)").text(); if (t = t.replace(/\u3010|\u3011/g, "").trim(), e.type = typeConvert(t), e.options = removeStartChar(e.options), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u51fa\u5934\u6536\u5f55", match: () => location.host.includes("superchutou.com") && location.href.includes("/onlineclass/analysis/"), question: { html: "[class^='single_excer_item']", question: "[class^='title_content'] > [class^='title_content_text']:eq(1)", options: "[class^='options_content'] label", type: ".question-box .tag", workType: "chutou", pageType: "chutou" }, init: async () => { await waitUntil((function() { return isExist("dl>dd>span"); })); }, answerHook: e => { let t = K(e.html).find("[class^='title_content'] > span:eq(1)").text(); t = t.replace(/\u3010|\u3011/g, "").trim(), e.type = typeConvert(t), e.options = removeStartChar(e.options); const a = K(e.html).find(".ant-collapse-header>div.ant-row>div.ant-col.ant-col-18>div:eq(1)").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(); switch (e.type) { case "0": case "1": e.answer = a.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.options = [], e.answer = judgeAnswer(a); } return e; } } ], Ze = [ { type: "ask", name: "\u826f\u5e08\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.host.includes("ls365.net") && (location.href.includes("student/examing.aspx") || location.href.includes("Student/myhomework.aspx")), types: [ "0", "1" ], question: { html: ".exam_question", question: ".exam_question_title", options: ".question_select .select_detail", type: ".exam_question_title strong", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist(".exam_question"); })); }, ischecked: isParentChecked, questionHook: e => { let t = K(e.html).find(".exam_question_title").clone(); t.find(".question_number").remove(), t.find("strong").remove(), t.find(".exam_feed_back").remove(), e.question = removeHtml(t.html()); let a = K(e.html).find(".exam_question_title strong").text(); return a = a.replace(/\[|\]/g, "").trim(), e.type = typeConvert(a), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("ls365.net") && location.href.includes("User/Student/ViewPaper.aspx"), question: { html: "[name^='anchor_']", question: ".title-img-ctr", options: ".pold .phtml", type: ".QuestionsType", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[name^='anchor_']"); })); }, answerHook: e => { let t = K(e.html).find(".QuestionsType").text(); t = t.replace(/\[|\]/g, "").trim(), e.type = typeConvert(t); let a = K(e.html).find(".my-work-answer>p").filter(((e, t) => t.innerText.includes("\u53c2\u8003\u7b54\u6848"))).map(((e, t) => K(t).find(".two").text())).get(); if (0 !== a.length) return e.answer = a[0].split("").map((t => e.options[t.charCodeAt(0) - 65])), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("ls365.net") && location.href.includes("Student/myhomework_after.aspx"), question: { html: "[name^='anchor_']", question: ".my-work-nav>.col-md-10", options: ".pold .phtml", type: ".QuestionsType", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[name^='anchor_']"); })); }, answerHook: e => { let t = K(e.html).find(".my-work-nav>div:eq(0)>span:eq(0)").text(); t = t.replace(/\[|\]/g, "").trim(), e.type = typeConvert(t); let a = K(e.html).find(".my-work-answer>p").filter(((e, t) => t.innerText.includes("\u53c2\u8003\u7b54\u6848"))).map(((e, t) => K(t).find(".two").text())).get(); if (0 !== a.length) return e.answer = a[0].split("").map((t => e.options[t.charCodeAt(0) - 65])), e; } }, { type: "hook", name: "hook", match: "hbnun.lsedu.vip" === location.host, main: e => { observeVuePageChange(K("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.href.includes("/#/homework/") && !location.href.includes("scene=history"), types: [ "0", "1" ], question: { html: "[id^='question-']", question: ".question-content", options: "button .flex-1.text-left", type: ".self-start.text-3.self-end", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[id^='question-']"); })); }, ischecked: e => K(e).closest("button").hasClass("is-checked") || K(e).closest("button").hasClass("el-button--primary"), questionHook: e => { let t = K(e.html).find(".self-start.text-3.self-end").text(); return t && (t = t.replace(/\[|\]/g, "").trim(), e.type = typeMatch(t)), e; } }, { type: "save", name: "\u826f\u5e08\u5728\u7ebf\u4f5c\u4e1a\u6536\u5f55", match: () => location.href.includes("/#/homework/") && location.href.includes("scene=history"), question: { html: "[id^='question-']", question: ".question-content", options: ".flex.flex-col.space-y-2 .f-c-c.space-x-3 .flex-1", type: ".self-start.text-3.self-end", workType: "ls365", pageType: "ls365" }, init: async () => { await waitUntil((function() { return isExist("[id^='question-']"); })); }, answerHook: e => { let t = K(e.html).find(".self-start.text-3.self-end").text(); t && (t = t.replace(/\[|\]/g, "").trim(), e.type = typeMatch(t)); let a = ""; if (K(e.html).find("div").each(((e, t) => { const n = K(t); if ((n.find("span").filter(((e, t) => K(t).text().trim().includes("\u6807\u51c6\u7b54\u6848\uff1a"))).length > 0 || n.text().trim().includes("\u6807\u51c6\u7b54\u6848\uff1a")) && (a = n.find(".question-content").text().trim(), a)) return !1; })), a) return e.answer = a.split("").map((t => { const a = t.charCodeAt(0) - 65; return e.options && e.options[a] ? e.options[a] : null; })).filter((e => null !== e)), e; } } ], et = [ { type: "hook", name: "hook", match: location.host.includes("jijiaox.com"), main: e => { observeVuePageChange(K("#app")[0], (() => K("#app")[0].__vue__.$route.path)); } }, { type: "ask", name: "\u7ee7\u6559\u4e91\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.host.includes("jijiaox.com") && (location.href.includes("/mg/studentindexexam/") || !location.href.includes("examrec")), types: [ "0", "1", "3", "4" ], question: { html: ".question>div", question: ".topic-title", options: ".ml_2 label", type: ".question-box .tag", workType: "jijiaox", pageType: "jijiaox" }, init: async () => { await waitUntil((function() { return isExist(".question>div"); })); }, ischecked: e => e.hasClass("is-checked"), questionHook: (e, t) => { const a = K(".page")[0].__vue__.$data.testInfo.studentPraxisList[t]; switch (e.options = a.options ? a.options : [], "string" == typeof e.options && (e.options = []), e.question = removeHtml(a.title), a.type) { case "single": e.type = "0"; break; case "muti": e.type = "1"; break; case "charge": e.type = "3"; break; case "text": e.type = "4"; break; default: console.log(a.type, "\u672a\u77e5\u7c7b\u578b"); } return e; }, setAnswer: e => "4" !== e.type || (K(e.html).find(".editor")[0].__vue__.editor.txt.html(e.answer[0]), !1) }, { type: "save", name: "\u7ee7\u6559\u4e91\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("jijiaox.com") && location.href.includes("/mg/studentindexexam/examrec/"), question: { html: ".question>div", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "jijiaox", pageType: "jijiaox" }, init: async () => { await waitUntil((function() { return isExist(".question>div"); })); }, answerHook: (e, t) => { const a = K(".page")[0].__vue__.$data.testInfo.studentPraxisList[t], n = a.answer; switch (e.options = a.options ? a.options : [], "string" == typeof e.options && (e.options = []), e.question = removeHtml(a.title), a.type) { case "single": e.type = "0"; break; case "muti": e.type = "1"; break; case "charge": e.type = "3", e.answer = "1" == n ? [ "\u6b63\u786e" ] : "-1" == n ? [ "\u9519\u8bef" ] : []; break; case "text": e.type = "4", e.answer = [ removeHtml(n) ]; break; default: console.log(a.type, "\u672a\u77e5\u7c7b\u578b"); } switch (e.type) { case "0": case "1": console.log("________", n), e.answer = "string" == typeof n ? n.split("").map((t => e.options[t.charCodeAt(0) - 65])) : n.map((t => (console.log(t), e.options[t.charCodeAt(0) - 65]))); } return console.log(e), e; } } ], tt = [ { type: "hook", name: "hook", match: location.host.includes("wencaischool.net") && K("#app").length, main: e => { observeVuePageChange(K("#app")[0], (() => K("#app")[0].__vue__.$route.path)); const t = document.createElement("style"); t.type = "text/css", t.innerHTML = "* {\n font-size: 13px !important;\n }", document.head.appendChild(t); } }, { type: "save", name: "\u67e0\u6aac\u6587\u624d\u8003\u8bd5\u6536\u5f55", match: () => location.host.includes("wencaischool.net") && location.href.includes("/separation/exam/index.html"), question: { html: ".tmList", question: ".tmTitleTxt", options: ".perRad .opCont", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist(".tmList") && K("#onlineExamArea")[0].__vue__._data.itemsList.length > 0; })); }, answerHook: (e, t) => { const a = K("#onlineExamArea")[0].__vue__._data.itemsList[t]; e.question = removeHtml(a.itemName), e.options = a.optionNodes.map((e => removeHtml(e.optionContent))); e.type = typeConvert({ 1: "\u586b\u7a7a\u9898", 2: "\u7b80\u7b54\u9898", 3: "\u5355\u9009\u9898", 4: "\u591a\u9009\u9898", 5: "\u9605\u8bfb\u7406\u89e3", 12: "\u5b8c\u5f62\u586b\u7a7a" }[a.itemType]); let n = a.itemAnswer[0].optionContent; switch (e.type) { case "0": case "1": e.answer = n.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "4": e.answer = removeHtml(n); break; case "2": e.answer = a.itemAnswer.map((e => removeHtml(e.optionContent))); } return e; } }, { type: "ask", name: "\u67e0\u6aac\u6587\u624d\u8003\u8bd5\u7b54\u9898", tips: "\u6b64\u5e73\u53f0\u7b54\u9898\u95f4\u9694\u5c3d\u91cf3s\u5de6\u53f3\uff0c\u5426\u5219\u53ef\u80fd\u9009\u4e0d\u4e0a\u7b54\u6848", match: () => location.host.includes("wencaischool.net") && location.href.includes("/separation/exam/index.html"), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "14" ], minDelay: 4e3, answerDelay: 1e3, question: { html: ".tmList", question: ".tmTitleTxt", options: ".perRad .opCont", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist(".tmList") && K("#onlineExamArea")[0].__vue__._data.itemsList.length > 0; })); }, ischecked: e => e[0].checked, questionHook: e => { let t = K(e.html).find(".tmc.tm").attr("ttype"); return e.type = typeConvert({ 1: "\u586b\u7a7a\u9898", 2: "\u7b80\u7b54\u9898", 3: "\u5355\u9009\u9898", 4: "\u591a\u9009\u9898", 5: "\u9605\u8bfb\u7406\u89e3", 12: "\u5b8c\u5f62\u586b\u7a7a" }[t]), e.$options = K(e.html).find(".perRad input"), e; }, setAnswer: e => { switch (e.type) { case "4": return K(e.html).find("textarea").focus(), document.execCommand("selectAll"), document.execCommand("insertText", !1, e.answer[0]), !1; case "2": K(e.html).find(".ansbox.inputAnswer input").each((async (t, a) => { a.focus(), document.execCommand("selectAll"); let n = e.answer[t]; document.execCommand("insertText", !1, n), await sleep(1e3); })); } return !0; } }, { type: "ask", name: "\u67e0\u6aac\u6587\u624d\u4f5c\u4e1a\u7b54\u9898", tips: "", match: () => location.host.includes("wencaischool.net") && location.href.includes("/exam/portal/exam.jsp"), types: [ "0", "1", "2", "3" ], question: { html: "table[id^='tblItem_'][islabel='0']", question: "table>tbody>tr:eq(0)>td:eq(0)", options: "table>tbody>tr:eq(1)>td:eq(0) table>tbody>tr>td>label", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => { await waitUntil((function() { return isExist("table[id^='tblItem_'][islabel=0]"); })), K(".aah_wrapper>div").css("z-index", 9999); }, ischecked: e => e[0].checked, questionHook: e => { let t = removeHtml(K(e.html).parent().parent().prevAll("tr").filter((function() { return K(this).find("table[islabel='1']").length > 0; })).first().html()); if (e.type = typeMatch(t), "8" == e.type && t.includes("\u9009\u62e9\u9898") && (e.type = "0"), "3" === e.type) e.options = []; return e; }, setAnswer: e => { if ("2" === e.type) { const t = K(e.html).find("table>tbody>tr:eq(0)>td:eq(0)>input"); t.length == e.answer.length && t.each((async (t, a) => { a.value = "", a.focus(), document.execCommand("selectAll"); let n = e.answer[t]; document.execCommand("insertText", !1, n), await sleep(1e3); })); } return !0; } }, { type: "save", name: "\u67e0\u6aac\u6587\u624d\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("wencaischool.net") && location.href.includes("/exam/portal/view_answer.jsp"), question: { html: "tr[id^='trScore_']", question: "table>tbody>tr:eq(0)>td:eq(0)", options: "table>tbody>tr:eq(1)>td:eq(0) table>tbody>tr>td>label", type: ".question-box .tag", workType: "wencai", pageType: "wencai" }, init: async () => {}, answerHook: (e, t) => { const a = removeHtml(K(e.html).prevAll("tr:not([id])").first().html()); switch (e.type = typeMatch(a), "8" == e.type && a.includes("\u9009\u62e9\u9898") && (e.type = "0"), e.type) { case "0": case "1": case "3": const t = K(e.html).find("table>tbody>tr:eq(1)>td:eq(0)>div[style='color:darkred;font-size:10pt']").text().split("\u7b54\u6848\uff1a")[1].split("]")[0]; e.answer = t.split("").map((t => e.options[t.charCodeAt(0) - 65])), "3" == e.type && (e.options = [], e.answer = judgeAnswer(e.answer[0])); break; case "2": const a = K(e.html).find("table>tbody>tr:eq(0)>td:eq(0)").clone(); a.find("input").remove(), e.answer = a.find("nobr").map(((e, t) => { const a = removeHtml(K(t).html()); return /\[\u53c2\u8003\u7b54\u6848\uff1a(.+?)\]/.exec(a)[1]; })).get(), a.find("nobr").remove(), a.find("font").remove(), e.question = removeHtml(a.html()); } return e; } } ], at = [ { type: "save", name: "yxlearning\u6536\u5f55", match: () => location.host.includes("yxlearning.com") && location.href.includes("exam/start?myExamRecordId"), question: { html: ".subject>.mb20.sub", question: ".ls1.lh30.text-f666", options: "ul.options>li.cursor-p", type: ".question-box .tag", workType: "yxlearning", pageType: "yxlearning" }, init: async () => { if (await waitUntil((function() { return isExist(".mb20.sub"); })), !ce.yxques) return !1; }, answerHook: (e, t) => { const a = []; ce.yxques.questionStemRPS.forEach(((e, t) => { e.listPaperQuestionRP.forEach(((e, t) => { a.push(e); })); })); const n = a[t]; e.question = titleClean(removeHtml(n.questionName)); const r = n.type, s = []; switch (e.options = removeStartChar(n.paperOptionRPS.map((e => removeHtml(e.context)))), n.paperOptionRPS.forEach(((t, a) => { 1 == t.standardAnswer && s.push(e.options[a]); })), e.answer = s, r) { case 1: e.type = "3", e.options = [], e.answer = judgeAnswer(e.answer[0]); break; case 2: e.type = "0"; break; case 3: e.type = "1"; } return e; } }, { type: "ask", name: "\u65e5\u7167\u4e13\u4e1a\u6280\u672f\u4eba\u5458\u7b54\u9898", tips: "", match: () => location.host.includes("yxlearning.com") && location.href.includes("exam/start?myExamRecordId"), types: [ "0", "1", "3" ], question: { html: ".mb20.sub", question: ".ls1.lh30.text-f666", options: ".cursor-p", type: ".question-box .tag", workType: "yxlearning", pageType: "yxlearning" }, init: async () => { await waitUntil((function() { return isExist(".mb20.sub"); })); }, ischecked: e => e.hasClass("active"), questionHook: e => { if (e.options = removeStartChar(K(e.html).find("ul>li").map(((e, t) => removeHtml(K(t).html()))).get()), e.$options = K(e.html).find("ul>li"), e.type = typeConvert(K(e.html).parent().prevAll(".title").first().find("[du-html='questionStemName']").text().trim()), "3" === e.type) e.options = [], e.$options = K(e.html).find("ul>li"); return e; } } ], nt = [ { type: "ask", name: "\u9ea6\u80fd\u7f51\u7b54\u9898", tips: "", match: () => location.href.includes("lms/web/onlineexam/exambegin"), types: [ "0", "1", "3" ], question: { html: "#exam_form>.sdiv", question: ".eptimu_name", options: ".ansdiv > .optiondiv", type: ".eptimu_title", workType: "cjnep", pageType: "cjnep" }, init: async () => { await waitUntil((function() { return isExist(".sdiv"); })); }, toquestion: e => { K(`.controldiv > a:eq(${e})`), K(`.epcl_circle:eq(${e})`)[0].click(); }, ischecked: isParentChecked, questionHook: e => { if (e.question = e.question.replace(/^[0-9]+\u3001/, "").trim(), e.question = titleClean(e.question), e.options = removeStartChar(e.options), e.type = typeMatch(K(e.html).find(".eptimu_title").text().trim()), e.$options = K(e.html).find(".ansdiv input"), "3" === e.type) e.options = []; return e; }, setAnswer: e => { switch (e.type) { case "3": let t = e.answer; return K(e.html).find(".ansdiv input").each(((e, a) => { isTrue(t) && "1" == K(a).val() && K(a).click(), isFalse(t) && "0" == K(a).val() && K(a).click(); })), !1; case "2": case "4": case "5": case "6": const a = K(e.html).find(".ansdiv textarea"), n = e.answer.join(";"); a.val(n), a.trigger("input"), a.trigger("keydown"), a.trigger("change"), a.trigger("blur"), a.trigger("focus"); const r = a[0]; if (r) { [ "input", "change", "blur", "focus" ].forEach((e => { const t = new Event(e, { bubbles: !0 }); r.dispatchEvent(t); })); } return !1; } return !0; } }, { type: "save", name: "\u9ea6\u80fd\u7f51\u7b54\u9898\u6536\u5f55", match: () => location.href.includes("lms/web/exam/examshow"), question: { html: "#exam_form>.sdiv", question: ".eptimu_name", options: ".ansdiv > .optiondiv", type: ".eptimu_title", workType: "cjnep", pageType: "cjnep" }, init: async () => { await waitUntil((function() { return isExist(".sdiv"); })); }, answerHook: e => { switch (e.type = typeMatch(K(e.html).find(".eptimu_title").text().trim()), e.question = e.question.replace(/^[0-9]+\u3001/, "").trim(), e.question = titleClean(e.question), e.options = removeStartChar(e.$options.map(((e, t) => { let a = K(t).clone(); return K(a).find("img").remove(), removeHtml(K(a).html()).trim(); })).get()), e.type) { case "0": case "1": e.answer = e.$options.map(((t, a) => { var n; return (null == (n = K(a).find("img").attr("src")) ? void 0 : n.includes("exam-yes")) && e.options[t]; })).get().filter((e => void 0 !== e)); break; case "3": e.answer = e.$options.map(((t, a) => { var n; return (null == (n = K(a).find("img").attr("src")) ? void 0 : n.includes("exam-yes")) && e.options[t]; })).get().filter((e => void 0 !== e)), e.answer = judgeAnswer(e.answer), e.options = []; break; case "4": e.options = []; let t = removeHtml(K(e.html).find(".eptimu_answer.ansdiv").html()).trim(); t.includes("\u6b63\u786e\u7b54\u6848\uff1a") ? e.answer = t.split("\u6b63\u786e\u7b54\u6848\uff1a")[1].trim() : e.answer = []; } return e; } } ], rt = [ { type: "ask", name: "\u9ea6\u80fd\u7f51\u7b54\u9898", tips: "", match: () => location.host.includes("mynep.com") && location.href.includes("my-exam/exambegin"), types: [ "0", "1" ], question: { html: ".et_test", question: ".et_title", options: "ul>.et_answer>label", type: ".question-box .tag", workType: "mynep", pageType: "mynep" }, init: async () => {}, toquestion: e => { ce.select_num(e + 1); }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { e.question = e.question.replace(/\u7b2c\d+\u9898\uff1a/, ""), e.options = removeStartChar(e.options); switch (K(e.html).find('input[id^="question-num-isdone"]').attr("question_num_type_id")) { case "1": e.type = "0"; break; case "2": e.type = "1"; } return e; } }, { type: "save", name: "\u9ea6\u80fd\u7f51\u6536\u5f55", match: () => location.host.includes("mynep.com") && location.href.includes("web/my-exam/examshow"), question: { html: ".et_test", question: ".et_title", options: "ul>.et_answer>label", type: ".question-box .tag", workType: "mynep", pageType: "mynep" }, init: async () => {}, answerHook: e => { const t = K(e.html).find(".et_title").clone(); t.find(".exam-btn").remove(), t.find("div").remove(), e.question = removeHtml(t.html()).replace(/\u7b2c\d+\u9898\uff1a/, "").trim(), e.options = []; const a = []; K(e.html).find(".et_answer>.et_answer>.et_answer>label").map(((t, n) => { e.options.push(removeHtml(K(n).html()).trim()), K(n).parent().find("input").prop("checked") && a.push(t); })).get(), e.options = removeStartChar(e.options), e.answer = a.map((t => e.options[t])); switch (K(e.html).find('input[id^="question-num-isdone"]').attr("question_num_type_id")) { case "1": e.type = "0"; break; case "2": e.type = "1"; break; default: return !1; } return e; } } ], st = [ { type: "hook", name: "hook", match: location.host.includes("91huayi.com"), main: e => { observeVuePageChange(K(".box")[0], (() => K(".dd_01").attr("questionid")), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === K(".el-loading-mask").length; })); } }); } }, { type: "ask", name: "\u534e\u533b\u7f51\u7b54\u9898", tips: "", match: () => location.host.includes("91huayi.com") && location.href.includes("/ExamInterface/ComputerExamIndex"), types: [ "0", "1" ], question: { html: "#exampage", question: ".dd_01", options: ".dd_02", type: ".big_type", workType: "huayi", pageType: "huayi" }, init: async () => {}, next: () => { var e; null == (e = K("#btnNext")) || e.click(); }, ischecked: e => e.prop("checked"), questionHook: e => { const t = K(e.html).find(".dd_01").clone(); return t.find(".dd_01_red").remove(), e.question = removeHtml(t.html()), e.options = removeStartChar(e.options), e.type = typeMatch(K(e.html).find(".big_type").text()), e.$options = K(e.html).find("dd.q-content input"), e; }, setAnswer: e => { switch (console.log(e), e.type) { case "0": case "1": return e.ques.$options.each(((t, a) => { if (e.answer.includes(t)) { if (e.rule.ischecked && e.rule.ischecked(K(a))) return; a.click(); } else e.rule.ischecked && e.rule.ischecked(K(a)) && a.click(); })), !1; } return !0; } }, { type: "ask", name: "\u534e\u533b\u7f51\u8003\u8bd5", tips: "", match: () => location.host.includes("91huayi.com") && location.href.includes("/pages/exam.aspx?cwid="), types: [ "0" ], question: { html: ".test>table", question: "thead", options: "tbody>tr>td>label", type: ".big_type", workType: "huayi", pageType: "huayi" }, init: async () => {}, next: () => { var e; null == (e = K("#btnNext")) || e.click(); }, ischecked: e => e.prop("checked"), questionHook: e => (e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\u3001/, ""), e.options = removeStartChar(e.options), 0 !== e.options.length && (e.type = "0"), e) } ], it = [ { type: "ask", name: "\u4e91\u5357\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => location.href.includes("hw/student/studentStartHomework.action") && location.host.includes("teach.ynou.edu.cn"), types: [ "0", "1", "3" ], question: { html: ".e_juan02biaoti", question: ".qcontent > p:first", options: ".signDefault>.label", type: ".question-box .tag", workType: "ynou", pageType: "ynou" }, init: async () => { await waitUntil((function() { return 0 !== K(".e_juan02biaoti").length; })), K("body").css("text-align", "left"); }, ischecked: e => (e.find("input").is(":checked"), e.find("input").is(":checked")), questionHook: e => { e.options = []; const t = K(e.html).find(".e_juan02daan").clone(); t.find(".clear").nextAll().remove(); const a = removeHtml(t.html()), n = a.split(/[A][\u3001\.\uff0e]/)[0].trim(); null !== n && (e.question = n), e.question = n, e.question = n; const r = a.match(/(?:[A-G](?:[\u3001.]|\s)?\s?.*?)(?=\s*[A-G](?:[\u3001.]|\s)?|\s*$)/gs); if (null !== r) { const t = removeOptionsStartChar(r.map((e => e.trim()))); !1 !== t && (e.options = t); } const s = K(e.html).find(".signDefault").attr("answer_control"); return "radio" === s && e.options.length > 1 && (e.type = "0"), "checkbox" === s && e.options.length > 1 && (e.type = "1"), "radio" === s && 0 === e.options.length && (e.type = "3"), e; }, setAnswer: e => { if (console.log(e), "3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, a) => { isTrue(t) && isTrue(removeHtml(K(a).html())) && K(a).click(), isFalse(t) && isFalse(removeHtml(K(a).html())) && K(a).click(); })), !1; } return !0; } }, { type: "save", name: "\u6536\u5f55", match: () => location.href.includes("/hw/student/studentViewHomework.action") && location.host.includes("teach.ynou.edu.cn"), question: { html: ".e_juan02biaoti", question: ".qcontent > p:first", options: ".signDefault>.label", type: ".question-box .tag", workType: "ynou", pageType: "ynou" }, init: async () => { await waitUntil((function() { return 0 !== K(".e_juan02biaoti").length; })), K("body").css("text-align", "left"); }, answerHook: e => { e.options = []; const t = K(e.html).find(".e_juan02daan").clone(); t.find(".clear").nextAll().remove(); const a = removeHtml(t.html()), n = a.split(/[A][\u3001\.\uff0e]/)[0].trim(); if (null === n) return null; e.question = n; const r = a.match(/(?:[A-G](?:[\u3001.]|\s)?\s?.*?)(?=\s*[A-G](?:[\u3001.]|\s)?|\s*$)/gs); if (null !== r) { const t = removeOptionsStartChar(r.map((e => e.trim()))); if (0 == t) return null; e.options = t; } const s = K(e.html).find(".signDefault").attr("answer_control"); "radio" === s && e.options.length > 1 && (e.type = "0"), "checkbox" === s && e.options.length > 1 && (e.type = "1"), "radio" === s && 0 === e.options.length && (e.type = "3"); const i = K(e.html).find(".right_answer>font").text(); switch (e.type) { case "0": case "1": e.answer = i.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.answer = isTrue(i) ? "\u6b63\u786e" : isFalse(i) ? "\u9519\u8bef" : ""; } return e; } } ], ot = [ { type: "hook", name: "hook", match: location.host.includes("21tb.com"), main: e => { observeVuePageChange(K("#examIngEmsRightPanel")[0], (() => K("#examIngEmsRightPanel").attr("class"))); } }, { type: "ask", name: "21tb\u7b54\u9898", tips: "", match: () => location.host.includes("21tb.com") && location.href.includes("exercise/newExercise.fullExerciseTemp.do"), types: [ "0", "1", "3" ], question: { html: ".paper-content > .question-panel-middle", question: ".question-stem>.name", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (K(".view-paper-content").length > 0) return !1; }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const t = K(e.html).attr("class") || ""; switch (console.log(t), !0) { case t.includes("SINGLE"): e.type = "0"; break; case t.includes("MULTIPLE"): e.type = "1"; break; case t.includes("JUDGMENT"): e.type = "3", e.options = []; } return e; } }, { type: "save", name: "21tb\u6536\u5f55", match: () => location.host.includes("21tb.com") && location.href.includes("exercise/newExercise.fullExerciseTemp.do"), question: { html: "form > .question-panel-middle", question: ".question-stem>.name", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (console.log(K(".view-paper-content").length), 0 == K(".view-paper-content").length) return !1; }, answerHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const t = K(e.html).attr("questtype") || "", a = K(e.html).find(".true-answer").text().split("\uff1a")[1].trim(); switch (!0) { case t.includes("SINGLE"): e.type = "0", e.answer = a.split(", ").map((t => e.options[t.charCodeAt(0) - 65])); break; case t.includes("MULTIPLE"): e.type = "1", e.answer = a.split(", ").map((t => e.options[t.charCodeAt(0) - 65])); break; case t.includes("JUDGMENT"): e.type = "3", e.options = [], e.answer = judgeAnswer(a); } return console.log(e), e; } }, { type: "ask", name: "21tb\u8003\u8bd5\u7b54\u9898", tips: "", match: () => location.host.includes("21tb.com") && location.href.includes("ems/html/examCenter/fullExamTemp.do"), types: [ "0", "1", "3" ], question: { html: ".paper-content > .question-panel-middle", question: ".question-stem", options: "ul.question-options>li>label", type: ".question-box .tag", workType: "21tb", pageType: "21tb" }, init: async () => { if (K(".view-paper-content").length > 0) return !1; }, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = K(e.html).find(".question-stem").clone(); t.find(".num").remove(), e.question = titleClean(removeHtml(t.html())).replace(/^\./, ""), e.question = e.question.replace(/\uff08\d+\u5206\uff09$/, "").trim(), e.options = e.options.map((e => e.replace(/^[A-Z]\s*\.\s*/, ""))), e.options = removeStartChar(e.options); const a = K(e.html).attr("class") || ""; switch (console.log(a), !0) { case a.includes("SINGLE"): e.type = "0"; break; case a.includes("MULTIPLE"): e.type = "1"; break; case a.includes("JUDGMENT"): e.type = "3", e.options = []; } return e; } } ], lt = [ { type: "hook", name: "hook", match: location.host.includes("168wangxiao.com"), main: e => { observeVuePageChange(K("#app")[0], (() => (K(".question-submit-btn").text(), K(".question-submit-btn").text() || K(".listTit>span").text())), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === K(".el-loading-mask").length; })); } }), K("#app").length >= 1 && K("#app")[0]; } }, { type: "ask", name: "168\u7f51\u6821\u7b54\u9898", tips: "168\u7f51\u6821\u76ee\u524d\u652f\u6301\u9009\u62e9\u3001\u5224\u65ad\u3001\u586b\u7a7a\u3001\u7b80\u7b54\uff0c\u5176\u4ed6\u9898\u578b\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/learningCenter/details/"), types: [ "0", "1", "2", "3", "4" ], question: { html: ".question-item-container", question: ".title-content", options: ".options .opt-content", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => (await waitUntil((function() { return 0 !== K(".question-item-container").length; })), !K(".question-submit-btn").text().includes("\u91cd\u65b0\u7b54\u9898")), ischecked: isParentChecked, questionHook: e => { const t = K(e.html).find(".type").text(); return e.type = typeMatch(t), e; }, setAnswer: e => "4" !== e.type || (K(e.html).find(".ql-editor"), K(e.html).find(".ql-editor")[0].innerHTML = e.answer[0], !1) }, { type: "save", name: "168\u7f51\u6821\u7b54\u9898", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/learningCenter/details/"), question: { html: ".question-item-container", question: ".title-content", options: ".options .opt-content", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => (await waitUntil((function() { return 0 !== K(".question-item-container").length; })), K(".question-submit-btn").text().includes("\u91cd\u65b0\u7b54\u9898")), answerHook: e => { const t = K(e.html).find(".type").text(); switch (e.type = typeMatch(t), e.answer = K(e.html).find(".options .opt-content.is-correct-answer").map(((e, t) => removeHtml(K(t).html()))).get(), e.type) { case "2": e.options = [], e.answer = K(e.html).find(".analyze-container>.answer>.text-container>p").map(((e, t) => removeHtml(K(t).html()))).get(); break; case "3": e.options = [], e.answer = [ judgeAnswer(e.answer[0]) ]; break; case "4": e.options = [], e.answer = K(e.html).find(".analyze-container>.answer>.text-container").map(((e, t) => removeHtml(K(t).html()))).get(); } return e; } }, { type: "ask", name: "168\u7f51\u6821\u8003\u8bd5", tips: "", match: () => location.host.includes("168wangxiao.com") && location.href.includes("/web/examination/answer"), types: [ "0", "1", "2", "3", "4" ], question: { html: ".Answer-area", question: ".listTit>span", options: ".el-checkbox-group>label", type: ".type", workType: "168wx", pageType: "168wx" }, init: async () => { await waitUntil((function() { return 0 !== K(".Answer-area").length; })); }, next: () => { K('button:contains("\u4e0b\u4e00\u9898")').click(); }, ischecked: isParentChecked, questionHook: e => (e.options = removeOptionsStartChar(e.options), e.type = typeMatch(K(".tit-type").text()), e), setAnswer: e => "4" !== e.type || (K(e.html).find(".ql-editor"), K(e.html).find(".ql-editor")[0].innerHTML = e.answer[0], !1) } ], ct = /^\/web\/cc-detail\/([^/]+)\/act\/quiz-answer\/([^/?#]+)/, pt = /^\/web(?:-old)?\/index\.php$/, ut = { SINGLE: "0", MULTI: "1", TF: "3" }, getMosoteachQuizIds = (e = location.href) => { try { const t = new URL(e); if ("www.mosoteach.cn" !== t.hostname) return null; const a = t.pathname.match(ct); return a ? { ccId: a[1], quizId: a[2] } : null; } catch { return null; } }, isMosoteachQuizAnswerUrl = (e = location.href) => null !== getMosoteachQuizIds(e), isMosoteachLegacyQuizReplyUrl = (e = location.href) => { try { const t = new URL(e); return "www.mosoteach.cn" === t.hostname && (!!pt.test(t.pathname) && ("interaction_quiz" === t.searchParams.get("c") && "reply" === t.searchParams.get("m"))); } catch { return !1; } }, isMosoteachAskUrl = (e = location.href) => isMosoteachQuizAnswerUrl(e) || isMosoteachLegacyQuizReplyUrl(e), getOptionNo = e => e.itemNo ?? e.item_no ?? 0, getSortedOptions = e => [ ...e.options || [] ].sort(((e, t) => getOptionNo(e) - getOptionNo(t))), getMosoteachTopicOptions = (e, t) => t(getSortedOptions(e).map((e => e.content || ""))), dt = ".topic-answer-align,.t-option.t-item label,.t-judge.t-item label", mt = ".v-chip__content,.t-type", ht = "__aiAskMosoteachRouteHook", ft = "__aiAskMosoteachHref", gt = "__aiAskMosoteachRouteTimer"; let vt = []; const yt = { cleanText: (e = "") => titleClean(removeHtml(e)), cleanOptions: e => removeStartChar(e.map((e => removeHtml(e)))), judgeAnswer: judgeAnswer }, getMosoteachQuestionType = (e = "", t = []) => ((e = "", t = []) => { const a = ut[e.trim()]; return "0" === a && (e => 2 === e.length && e.every((e => /^(\u6b63\u786e|\u9519\u8bef|\u5bf9|\u9519|\u662f|\u5426|T|F|true|false)$/i.test(e.trim()))))(t) ? "3" : a || ""; })(e, t) || typeMatch(e), getMosoteachQuestionElements = () => isMosoteachLegacyQuizReplyUrl() ? K(".topic-item") : K(".pt-10.d-flex.list-item:has(.topic-subject):has(.topic-answer-align)"), getMosoteachLegacyTopics = () => { var e, t; const a = K("#app")[0], n = null == (t = null == (e = null == a ? void 0 : a.__vue__) ? void 0 : e.$data) ? void 0 : t.topics; return Array.isArray(n) ? n : []; }, cacheMosoteachAnswer = e => { const t = ((e, t, a, n) => { const r = n.cleanText(e), s = ((e, t) => t(e).sort().join("\n"))(t, n.cleanOptions); return a.find((e => { const t = getMosoteachTopicOptions(e, n.cleanOptions).sort().join("\n"); return n.cleanText(e.subject || "") === r && t === s; })); })(e.question, e.options, vt, yt); if (!t) return; const a = ((e, t) => { const a = t.cleanOptions(getSortedOptions(e).map((e => e.content || ""))); return Array.isArray(e.answers) && e.answers.length > 0 ? e.answers.map((e => a[e] || "")).filter(Boolean) : "TF" === e.type ? t.judgeAnswer(e.tfAnswer || "") : []; })(t, yt); if (!a.length) return; const n = { type: e.type, question: e.question, options: "3" === e.type ? [] : e.options, answer: a }; Answer.cacheAnswer(n); }, parseMosoteachDomQuestion = e => { const t = K(e.html), a = t.find(".topic-subject").first().text(), n = t.find(".topic-answer-align"); if (!a || !n.length) return e; e.question = yt.cleanText(a); const r = n.map(((e, t) => K(t).find(".topic-answer").first().text() || K(t).text())).get(); return e.options = yt.cleanOptions(r), e.$options = (e => K(e.map(((e, t) => K(t).closest("label,.d-flex.align-start")[0] || t)).get()))(n), e.type = getMosoteachQuestionType(t.find(".v-chip__content").first().text(), e.options), cacheMosoteachAnswer(e), e; }, parseMosoteachLegacyQuestion = (e, t) => { const a = K(e.html), n = getMosoteachLegacyTopics()[t], r = a.find(dt), s = r.map(((e, t) => K(t).text())).get(); if (n) e.question = yt.cleanText(n.subject || ""), e.options = ((e, t, a) => { const n = a(t); return n.length ? n : getMosoteachTopicOptions(e || {}, a); })(n, s, yt.cleanOptions), e.type = getMosoteachQuestionType(n.type, e.options); else { const t = a.find(".t-subject").first().text(); e.question = yt.cleanText(t || e.question), e.options = yt.cleanOptions(s.length ? s : e.options), e.type = getMosoteachQuestionType(a.find(mt).first().text() || e.type, e.options); } return r.length && (e.$options = r), cacheMosoteachAnswer(e), e; }, watchMosoteachRouteChange = () => { const e = ce; if (e[ht]) return; e[ht] = !0, e[ft] = location.href; const checkRouteChange = () => { e[ft] !== location.href && (e[ft] = location.href, clearTimeout(e[gt]), e[gt] = setTimeout((() => vuePageChange()), 100)); }, bindHistoryChange = e => { const t = history[e]; history[e] = function(...e) { const a = t.apply(this, e); return setTimeout(checkRouteChange, 0), a; }; }; bindHistoryChange("pushState"), bindHistoryChange("replaceState"), window.addEventListener("popstate", (() => setTimeout(checkRouteChange, 0))); }, bt = [ { type: "hook", name: "\u4e91\u73ed\u8bfe\u8def\u7531\u76d1\u542c", match: () => "www.mosoteach.cn" === location.host, main: () => { watchMosoteachRouteChange(); } }, { type: "ask", name: "\u4e91\u73ed\u8bfe\u7b54\u9898", tips: "", match: () => "www.mosoteach.cn" === location.host && isMosoteachAskUrl(), types: [ "0", "1", "3" ], question: { html: getMosoteachQuestionElements, question: ".topic-subject,.t-subject", options: dt, type: mt, workType: "mosoteach", pageType: "mosoteach" }, init: async () => { if (await sleep(500), !isMosoteachAskUrl()) return vt = [], !1; return !!(await (async () => { for (let e = 0; e < 30; e++) { if (getMosoteachQuestionElements().length > 0) return !0; await sleep(200); } return !1; })()) && (vt = isMosoteachQuizAnswerUrl() ? await (async () => { const e = getMosoteachQuizIds(), t = localStorage.getItem("teach_token") || ""; if (!e || !t) return []; try { const a = await fetch(`https://coreapi.mosoteach.cn/ccs/${e.ccId}/quizzes/${e.quizId}/topics?_ts=${Date.now()}`, { headers: { accept: "application/json, text/plain, */*", "x-client-app-id": "MTWEB", "x-client-version": "6.0.0", "x-security-type": "SECURITY_TYPE_TOKEN", "x-token": t }, credentials: "omit" }); if (!a.ok) return []; const n = await a.json(); return Array.isArray(null == n ? void 0 : n.topics) ? n.topics : []; } catch (a) { return []; } })() : getMosoteachLegacyTopics(), !0); }, ischecked: e => { const t = e.find("input").add(e.closest("label,.d-flex.align-start").find("input")).first(); return e.hasClass("is-checked") || e.hasClass("v-item--active") || t.prop("checked") || "true" === t.attr("aria-checked"); }, questionHook: (e, t) => isMosoteachLegacyQuizReplyUrl() ? parseMosoteachLegacyQuestion(e, t) : parseMosoteachDomQuestion(e) } ], wt = [ { type: "hook", name: "hook", match: "www.learnin.com.cn" === location.host, main: e => { observeVuePageChange(K("#app")[0], (() => { try { return K(".page-student-course-topic-do-container")[0].__vue__.$data.topic.studentTopic.id; } catch (e) { return ""; } })); } }, { type: "save", name: "learnin\u6536\u5f55", match: () => "www.learnin.com.cn" === location.host && location.href.includes("/user/#/user/student/course/") && 0 == K("button:contains('\u63d0\u4ea4\u4f5c\u4e1a')").length, question: { html: ".store-question-item-container", question: ".question-title", options: ".question-info>.question-option-list>.option-item", type: ".item-question-header>.header-left", workType: "learnin", pageType: "learnin" }, init: async () => { await waitUntil((function() { return isExist(".store-question-item-container"); })); }, answerHook: (e, t) => { const a = K(".store-question-item-container").eq(t)[0].__vue__.question; switch (a.questionTypeCode) { case "judgment": e.type = "3"; break; case "single": e.type = "0"; break; case "multiple": e.type = "1"; break; default: return e; } e.question = titleClean(removeHtml(a.questionTitle)); let n = [], r = []; return a.optionList.forEach((e => { const t = removeHtml(e.content); e.isAnswer && r.push(t), n.push(t); })), e.options = n, e.answer = r, "3" == e.type && (e.options = [], e.answer = judgeAnswer(r[0])), e; } }, { type: "ask", name: "learnin\u7b54\u9898", tips: "", match: () => "www.learnin.com.cn" === location.host && location.href.includes("/user/#/user/student/course/") && 1 == K("button:contains('\u63d0\u4ea4\u4f5c\u4e1a')").length, types: [ "0", "1", "3" ], question: { html: ".store-question-item-container", question: ".question-title", options: ".question-info>.question-option-list>.option-item>.option-index", type: ".item-question-header>.header-left", workType: "learnin", pageType: "learnin" }, init: async () => { await waitUntil((function() { return isExist(".store-question-item-container"); })); }, ischecked: e => e.hasClass("active"), questionHook: (e, t) => { const a = K(e.html)[0].__vue__.question; switch (a.questionTypeCode) { case "judgment": e.type = "3"; break; case "single": e.type = "0"; break; case "multiple": e.type = "1"; break; default: return e; } e.question = titleClean(removeHtml(a.questionTitle)); let n = []; return a.optionList.forEach((e => { const t = removeHtml(e.content); n.push(t); })), e.options = n, "3" == e.type && (e.options = []), e; } } ], xt = [ { type: "hook", name: "hook", match: location.host.includes("ouchn.edu.cn"), main: e => { observeVuePageChange(K("#app")[0], (() => getUrl())); } }, { type: "ask", name: "\u7535\u5927\u7b54\u9898", tips: "", match: () => location.host.includes("ouchn.edu.cn") && location.href.includes("learningPlatform/#/myExamDetails/examQuestion"), types: [ "0" ], question: { html: ".everyQuest", question: ".topicTitle", options: ".optionList .topicTitle", type: ".question-box .tag", workType: "ouchn", pageType: "ouchn" }, init: async () => { await waitUntil((function() { return isExist(".everyQuest"); })); }, ischecked: isParentChecked, questionHook: e => (e.type = "0", e) }, { type: "save", name: "\u7535\u5927\u6536\u5f55", match: () => location.host.includes("ouchn.edu.cn") && location.href.includes("learningPlatform/#/myExamDetails/testPaper"), question: { html: ".everyQuest", question: ".topicTitle", options: ".optionList .topicTitle", type: ".question-box .tag", workType: "ouchn", pageType: "ouchn" }, init: async () => { await waitUntil((function() { return isExist(".everyQuest"); })); }, answerHook: e => { const t = K(e.html).find('.rightAndWrong>span:contains("\u6b63\u786e\u7b54\u6848")').text().replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), a = e.options; let n = []; return t.split("").forEach((e => { n.push(a[e.charCodeAt(0) - 65]); })), 1 == n.length ? e.type = "0" : e.type = "1", e.answer = n, e; } } ], kt = [ { type: "hook", name: "mooc", match: "www.icourse163.org" === location.host, main: e => { observeVuePageChange(K("#courseLearn-inner-box")[0], (() => K("#courseLearn-inner-box > div:eq(0)").attr("class")), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 === K(".el-loading-mask").length; })); } }); } }, { type: "ask", name: "mooc\u7b54\u9898", tips: "\u4e2d\u56fd\u5927\u5b66MOOC\u9650\u5236\u7b54\u9898\u901f\u5ea6\uff0c\u8bf7\u4e0d\u8981\u8fc7\u5feb", match: () => "www.icourse163.org" === location.host && location.href.includes("#/learn/quiz?id="), types: [ "0", "1", "2", "3" ], question: { html: ".u-questionItem", question: ".f-richEditorText", options: "ul.choices>li>input", type: ".qaCate.j-qacate.f-fl", workType: "mooc", pageType: "mooc" }, init: async () => { await waitUntil((function() { return K(".u-questionItem").length, 0 !== K(".u-questionItem").length; })); }, ischecked: isParentChecked, questionHook: (e, t) => { K(e.html).find(".qaCate.j-qacate.f-fl > span:eq(0)").attr("class"); const a = ce.learnUtilQuestionList[t]; switch (e.question = removeHtml(a.title), e.options = a.options.map((e => removeHtml(e.content))), a.type) { case 1: e.type = "0"; break; case 2: e.type = "1"; break; case 3: e.type = "2"; break; case 4: e.type = "3", e.options = []; break; default: a.type, e.type = "8"; } return e; }, setAnswer: e => { switch (e.type) { case "2": return K(e.html).find(".u-baseinputui>textarea").each(((t, a) => { K(a).val(e.answer[t]), K(a).focus(), K(a).blur(); })), !1; case "3": let t = e.answer; K(e.html).find("ul.choices>li").each(((e, a) => { isTrue(t) && K(a).find(".u-icon-correct").length > 0 && K(a).find("input").click(), isFalse(t) && K(a).find(".u-icon-wrong").length > 0 && K(a).find("input").click(); })); } return !0; } }, { type: "save", name: "\u4e2d\u56fd\u5927\u5b66mooc\u6536\u5f55", match: () => "www.icourse163.org" === location.host && location.href.includes("#/learn/quizscore?id="), question: { html: ".u-questionItem", question: ".f-richEditorText", options: "ul.choices li>input", type: ".qaCate.j-qacate.f-fl", workType: "mooc", pageType: "mooc" }, init: async () => { await waitUntil((function() { return K(".u-questionItem").length, 0 !== K(".u-questionItem").length; })); }, answerHook: (e, t) => { const a = ce.learnUtilQuestionList[t]; e.question = removeHtml(a.title); let n = [], r = []; switch (a.options.forEach((e => { n.push(removeHtml(e.content)), e.answer && r.push(removeHtml(e.content)); })), e.options = n, e.answer = r, a.type) { case 1: e.type = "0"; break; case 2: e.type = "1"; break; case 3: e.type = "2", e.answer = [ a.stdAnswer ]; break; case 4: e.type = "3", e.options = []; break; default: a.type; } return e; } } ], qt = [ { type: "ask", name: "\u897f\u8d22\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.href.includes("learnspace/course/test/coursewareTest_intoRedoTestPage.action") || location.href.includes("learnspace/learn/learn/templateeight/index.action") || location.href.includes("learnspace/course/test/coursewareTest_intoTestPage.action"), types: [ "0", "1", "3" ], question: { html: ".bank_test > .test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label, .test_item_theme>label", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { await waitUntil((function() { return isExist(".bank_test > .test_item"); })); }, ischecked: isParentChecked, questionHook: e => { const t = K(e.html).find(".test_item_tit").clone(); if (t.find(".tipNodo").remove(), e.question = removeHtml(t.html()), e.question = titleClean(e.question), e.type = typeMatch(K(e.html).prevAll(".test_item_type").first().text()), e.question = e.question.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim().replace(/^\d+ ./, "").trim(), e.options = removeStartChar(e.options), "3" === e.type) e.options = []; return e; } }, { type: "save", name: "\u897f\u8d22\u5728\u7ebf\u9636\u6bb5\u6d4b\u9a8c\u6536\u5f55", match: () => location.href.includes("learnspace/course/test/coursewareTest_intoTestAnswerPage.action") || location.href.includes("learnspace/learn/learn/templateeight/index.action"), question: { html: ".bank_test > .test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>.zdh_op_con", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => {}, answerHook: e => { e.type = typeMatch(K(e.html).prevAll(".test_item_type").first().text()), e.question = e.question.replace(/^[.*?]\s*/, "").replace(/^\u3010.*?\u3011\s*/, "").replace(/\s*\uff08\d+\.\d+\u5206\uff09$/, "").replace(/^\d+\./, "").trim().replace(/^\d+\uff0e/, "").trim().replace(/^\d+ ./, "").trim(), e.options = removeStartChar(e.options); const t = K(e.html).find(".test_item_key_tit").text().replace("\u53c2\u8003\u7b54\u6848\uff1a", "").trim(); switch (e.type) { case "0": case "1": e.answer = t.split("").map((t => { let a = t.charCodeAt() - 65; return e.options[a]; })); break; case "3": e.answer = judgeAnswer(t), e.options = []; } return e; } }, { type: "ask", name: "\u897f\u8d22\u5728\u7ebf\u7efc\u5408\u7ec3\u4e60\u7b54\u9898", tips: "\u897f\u8d22\u5728\u7ebf\u6536\u5f55\u8bf7\u91cd\u65b0\u70b9\u51fb\u9898\u578b\u5207\u6362\u89e6\u53d1", match: () => location.host.includes("swufe-online.com") && location.href.includes("/learnspace/userDefine/t_test.jsp?courseId="), types: [ "0", "1", "3" ], question: { html: ".timu_title", question: ".timu_title", options: ".test_item_theme>ul>li", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { if (await waitUntil((function() { return isExist(".timu_title"); })), !document.body.innerHTML.includes("\u63d0\u4ea4\u7b54\u9898\u540e\u663e\u793a")) return !1; K(".layui-tab-title>li").on("click", (function() { vuePageChange(); })); }, ischecked: isParentChecked, questionHook: (e, t) => { const a = K(e.html).attr("id"); return e.type = typeMatch(K(".layui-this").text()), e.question = removeHtml(K(e.html).html()), e.options = K(`#${a}`).map((function() { let t = [], a = K(this).next(), n = []; for (;a.length && a.hasClass("question-item-opt"); ) n.push(removeHtml(a[0].outerHTML)), t.push(a), a = a.next(); return e.$options = K(t.map((e => e[0]))).find("label"), n; })).get(), e.options = removeStartChar(e.options), e; } }, { type: "save", name: "\u897f\u8d22\u5728\u7ebf\u7efc\u5408\u4f5c\u4e1a\u6536\u5f55", match: () => location.host.includes("swufe-online.com") && location.href.includes("/learnspace/userDefine/t_test.jsp?courseId="), question: { html: ".timu_title", question: ".timu_title", options: ".test_item_theme>ul>li", type: ".question-box .tag", workType: "swufe", pageType: "swufe" }, init: async () => { if (await waitUntil((function() { return isExist(".timu_title"); })), document.body.innerHTML.includes("\u63d0\u4ea4\u7b54\u9898\u540e\u663e\u793a")) return !1; K(".layui-tab-title>li").on("click", (function() { vuePageChange(); })); }, answerHook: e => { const t = K(e.html).attr("id"); switch (e.type = typeMatch(K(".layui-this").text()), e.question = removeHtml(K(e.html).html()), e.options = K(`#${t}`).map((function() { let t = [], a = K(this).next(), n = []; for (;a.length && a.hasClass("question-item-opt"); ) n.push(removeHtml(a[0].outerHTML)), t.push(a), a = a.next(); return e.$options = K(t.map((e => e[0]))).find("label"), n; })).get(), e.options = removeStartChar(e.options), e.type) { case "0": case "1": const a = K(`#${t}`).nextAll(".ans").first().find("span:eq(0)").text(); e.answer = a.trim().split("").map((t => { let a = t.charCodeAt() - 65; return e.options[a]; })); break; case "3": e.answer = judgeAnswer(K(`#${t}`).nextAll(".ans").first().find("span:eq(0)").text().trim()), e.options = []; break; case "7": case "4": e.answer = removeHtml(K(`#${t}`).nextAll(".ans").first().html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(), e.options = []; break; default: e.type; } return e; } } ], _t = [ { type: "ask", name: "\u91cd\u5e86\u6cd5\u6cbb\u8003\u8bd5\u7b54\u9898", tips: "\u672c\u5e73\u53f0\u65e0\u7b54\u6848\u6536\u5f55\uff0c\u9700\u8981\u81ea\u884c\u8865\u5145\u9898\u5e93\uff0c\u5efa\u8bae\u4f7f\u7528\u9898\u5e93\u5bfc\u5165\u529f\u80fd", match: () => "ks.cqsdx.cn" === location.host && location.pathname.includes("/exam/user/bind"), types: [ "0", "1", "3" ], question: { html: ".qlist", question: "span:eq(1)", options: "label", type: ".badge.badge-danger", workType: "cqsdx", pageType: "cqsdx" }, init: async () => { await waitUntil((function() { return isExist(".qlist"); })); }, toquestion: e => { K(`#question_card button:eq(${e})`).click(); }, ischecked: e => e.find("div").hasClass("checked"), questionHook: e => { const t = K(e.html).find(".badge.badge-danger").text(); if (e.type = typeMatch(t), e.question = e.question.replace(/\u206B/g, "").trim(), e.options = e.options.map((e => e.replace(/\u206B/g, "").trim())), "3" === e.type) e.options = []; return e; } } ], At = [ { type: "hook", name: "hook", match: location.host.includes("telfri-edu.com"), main: e => { observeVuePageChange(K("#app")[0], (() => getUrl())); } }, { type: "ask", name: "olearn\u7b54\u9898", tips: "", match: () => location.host.includes("telfri-edu.com") && location.href.includes("/learn/homework/do/"), types: [ "0", "1", "3" ], question: { html: ".topic-group>.topic-container", question: ".topic-title", options: ".topic-answer .radio-wrap .radio-text", type: ".question-box .tag", workType: "olearn", pageType: "olearn" }, init: async () => { await waitUntil((function() { return isExist(".topic-group>.topic-container"); })); }, ischecked: e => e.hasClass("is-active"), questionHook: e => { let t = K(e.html).prevAll(".topic-title").first().find(".title-bold").text().trim(); return e.$options = K(e.html).find(".topic-answer .radio-wrap>label"), e.type = typeMatch(t), e; } }, { type: "save", name: "olearn\u6536\u5f55", match: () => location.host.includes("telfri-edu.com") && location.href.includes("/learn/homework/show/"), question: { html: ".topic-group>.topic-container", question: ".topic-title", options: ".topic-answer .radio-wrap .radio-text", type: ".question-box .tag", workType: "olearn", pageType: "olearn" }, init: async () => { await waitUntil((function() { return isExist(".topic-group>.topic-container"); })); }, answerHook: e => { let t = K(e.html).prevAll(".topic-title").first().find(".title-bold").text().trim(); e.type = typeMatch(t); const a = K(e.html).find(".standard-answer>.analysis-text").text().trim(); switch (e.type) { case "0": case "1": e.answer = a.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.options = [], e.answer = judgeAnswer(a); } return e; } } ], Tt = [ { type: "hook", name: "hook", match: location.host.includes("yxbyun.com"), main: e => { observeVuePageChange(K("#app")[0], (() => K("#app")[0].__vue__.$route.path)); } }, { type: "save", name: "\u4ebf\u5b66\u5b9d\u6536\u5f55", match: () => location.host.includes("yxbyun.com") && (location.href.includes("yxbstudent/#/testPaper") || location.href.includes("yxbstudent/#/finalExam")), question: { html: ".test_wrap", question: ".content", options: ".el-radio-group input", type: ".question-box .tag", workType: "yxbyun", pageType: "yxbyun" }, init: async () => { await waitUntil((function() { return isExist(".test_wrap"); })); }, answerHook: e => { var t; const a = K(e.html).find("div:eq(0)")[0].__vue__, n = (null == (t = a.pagerData) ? void 0 : t.question) || a.smallPaper.questionTopic; return e.type = typeMatch(a.queTypeName), e.question = titleClean(removeHtml(n.questionTitle)), e.options = (n.optionList || n.questionOptionList).map((e => removeHtml(e.questionContent))), [ "0", "1", "3" ].includes(e.type) && (e.answer = n.questionAnswer.split(",").map((t => e.options[t.charCodeAt(0) - 65]))), "3" === e.type && (e.options = [], e.answer = judgeAnswer(e.answer)), e; } }, { type: "ask", name: "\u4ebf\u5b66\u5b9d\u7b54\u9898", match: () => location.host.includes("yxbyun.com") && (location.href.includes("yxbstudent/#/testPaper") || location.href.includes("yxbstudent/#/finalExam")), types: [ "0", "1", "3" ], question: { html: ".test_wrap", question: ".content", options: ".answer>.daan,.el-radio-group>label", type: ".question-box .tag", workType: "yxbyun", pageType: "yxbyun" }, init: async () => { await waitUntil((function() { return isExist(".test_wrap"); })); }, ischecked: e => e.hasClass("active"), questionHook: e => { var t; const a = K(e.html).find("div:eq(0)")[0].__vue__, n = (null == (t = a.pagerData) ? void 0 : t.question) || a.smallPaper.questionTopic; if (e.type = typeMatch(a.queTypeName), e.question = titleClean(removeHtml(n.questionTitle)), e.options = (n.optionList || n.questionOptionList).map((e => removeHtml(e.questionContent))), "3" === e.type) e.options = []; return e; }, setAnswer: e => { if ("3" === e.type) { let t = e.answer; return e.ques.$options.each(((e, a) => { isTrue(t) && isTrue(removeHtml(K(a).parent().html())) && K(a).click(), isFalse(t) && isFalse(removeHtml(K(a).parent().html())) && K(a).click(), removeHtml(K(a).parent().html()); })), !1; } return !0; } } ], Ct = [ { type: "hook", name: "hook", match: location.host.includes("wdjycj.com") || location.host.includes("iwdjy.com"), main: e => { observeVuePageChange(K("#app")[0], (() => getUrl())); } }, { type: "save", name: "\u6587\u9876\u5728\u7ebf\u6536\u5f55", match: () => location.href.includes("/testpaper-test-result?resultId=") || location.href.includes("/testpaper-test?id"), question: { html: ".st-item", question: ".st-title", options: ".st-main>p", type: ".question-box .tag", workType: "wdzx", pageType: "wdzx" }, init: async () => { await waitUntil((function() { return isExist(".st-item"); })); let e = []; try { K(".exam-html")[0].__vue__.test.lists.forEach(((t, a) => { t.question_lists.forEach(((t, a) => { e.push(t); })); })); } catch (t) {} unsafeWindow.ques = e; }, answerHook: (e, t) => { var a; const n = unsafeWindow.ques[t], r = []; switch (e.question = titleClean(removeHtml(n.content)), e.options = (null == (a = n.appanswer) ? void 0 : a.map((e => { const t = removeHtml(e.text); return e.right && r.push(t), removeHtml(t); }))) || [], n.tm_type) { case 4: e.type = "3", e.answer = judgeAnswer("1" == n.answer ? "\u6b63\u786e" : "0" == n.answer ? "\u9519\u8bef" : ""); break; case 5: e.type = "2", e.question = e.question.replace(/{#answer}/g, "_____"), e.answer = n.answer.split("|").map((e => e.includes("\u203b") ? e.split("\u203b")[0] : e)); break; case 2: e.type = "0", e.answer = r; break; case 3: e.type = "1", e.answer = r; break; case 1: e.type = "4", e.answer = removeHtml(n.answer); break; default: n.tm_type; } return e; } }, { type: "ask", name: "\u6587\u9876\u5728\u7ebf\u7b54\u9898", tips: "", match: () => location.href.includes("/testpaper-test?id=") || location.href.includes("/final-exam"), types: [ "0", "1", "2", "3" ], question: { html: ".st-item", question: ".st-title", options: ".st-main>p", type: ".question-box .tag", workType: "wdzx", pageType: "wdzx" }, init: async () => { await waitUntil((function() { return isExist(".st-item"); })); }, toquestion: e => { K(`.card-box .bj:eq(${e})`).click(); }, ischecked: e => K(e).find("input").prop("checked"), questionHook: (e, t) => { e.options = removeOptionsStartChar(e.options); const a = K(e.html).find(".st-title").clone(); K(a).find("strong").remove(), e.question = removeHtml(K(a).html()); let n = K(e.html).prevAll(".title").first().text().trim(); return e.type = typeMatch(n), e.$options = K(e.html).find(".answer-box>.answer>label"), e; }, setAnswer: e => { switch (e.type) { case "4": case "5": case "6": case "7": return K(e.html).find(".answer-text>div")[0].__vue__.msg.yourAnswer = e.answer[0], K(e.html).find(".quill-editor").map(((t, a) => { a.__vue__.value = e.answer[t]; })), !1; case "2": let setYourAnswerById = function(e, t, a) { for (let n of e) if (Array.isArray(n.itemlists)) for (let e of n.itemlists) if (e.id === t) return e.yourAnswer = a, !0; return !1; }; const t = K(e.html).find("span.bj input").attr("name"); return setYourAnswerById(K(".exam-html")[0].__vue__.answerCard, Number(t), e.answer), e.answer, !1; } return !0; } } ], cleanOptionText = e => e.replace(/ /g, " ").replace(/\uff08\u60a8\u7684\u9009\u62e9\uff09/g, "").replace(/\uff08\u6b63\u786e\u7b54\u6848\uff09/g, "").replace(/^\s*[A-Z]\s*[\.\u3001\uff0e]\s*/, "").replace(/\s+/g, " ").trim(), getSectionType = e => { const t = K(e)[0]; if (!t) return typeMatch(""); const a = (t.closest(".exam-section") || document).querySelectorAll(".section-title, .exam-title"); let n = ""; for (let r = 0; r < a.length; r++) { const e = a[r]; if (!(e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING)) break; n = e.textContent || ""; } return typeMatch(n); }, St = [ { type: "ask", name: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u7b54\u9898", tips: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u4ec5\u652f\u6301\u9009\u62e9\u3001\u5224\u65ad\u9898\u5176\u4ed6\u9898\u578b\u6682\u4e0d\u652f\u6301\uff0c\u82e5\u6709\u9700\u8981\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005", match: () => location.href.includes("/student/study/examPage") && !location.href.includes("/student/study/examPageShow"), question: { html: ".question-item", question: ".question-content", options: ".answer-option", type: "", workType: "whut", pageType: "whut" }, init: async () => { await waitUntil((function() { return 0 !== K(".question-item").length; })); }, ischecked: e => e.find("input").is(":checked"), questionHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\s*[\u3001.\uff09)]/, "").trim(); const t = []; return e.$options.each(((e, a) => { const n = K(a).clone(); n.find(".el-radio__input, .el-checkbox__input, input").remove(), t.push(cleanOptionText(n.text())); })), e.options = t, e.type = getSectionType(e.html), e.type, e; } }, { type: "save", name: "\u6b66\u6c49\u7406\u5de5\u7ee7\u7eed\u6559\u80b2\u6536\u5f55", match: () => location.href.includes("/student/study/examPageShow"), question: { html: ".question-item", question: ".question-content", options: ".option-item", type: "", workType: "whut", pageType: "whut" }, init: async () => { await waitUntil((function() { return 0 !== K(".question-item").length && 0 !== K(".question-item .correct-answer, .question-item .option-item.correct").length; })); }, answerHook: e => { e.question = titleClean(e.question), e.question = e.question.replace(/^\d+\s*[\u3001.\uff09)]/, "").trim(); const t = []; e.$options.each(((e, a) => { const n = K(a).clone(); n.find(".option-label, .user-choice, .correct-answer").remove(), t.push(cleanOptionText(n.text())); })), e.options = t, e.type = getSectionType(e.html); const a = []; return e.$options.each(((t, n) => { (K(n).hasClass("correct") || K(n).find(".correct-answer").length > 0) && a.push(e.options[t]); })), "3" === e.type ? (e.answer = a.length ? a[0] : "", e.options = []) : e.answer = a, e; } } ], It = [ { type: "save", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u6536\u5f55", match: () => location.host.includes("dufe.edu.cn") && (location.href.includes("/HomeWorkPaper") || location.href.includes("/HomeWorkHistoryPaper") || location.href.includes("/ExercisesPaper")), question: { html: ".QuestTrunk,.HistoryQuestTrunk", question: ".CBTPaperMain-divInline", options: ".CBTPaperMain-options li", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => { await waitUntil((function() { return isExist(".QuestTrunk,.HistoryQuestTrunk"); })); }, answerHook: e => { const t = e.html.vtree[0].vmodel._trunks[0], a = e.html.vtree[0].vmodel._type; let n = [], r = []; const getOption = () => { t.QUESTION_OPTIONS.forEach((e => { const t = removeHtml(e.OPTION_CONTENT); "1" === e.ISTRUE && n.push(t), r.push(t); })); }; switch (a) { case "001": e.type = "0", getOption(); break; case "002": e.type = "1", getOption(); break; case "004": e.type = "3", e.options = [], n = "1" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u6b63\u786e" ] : "0" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u9519\u8bef" ] : []; break; case "005": e.type = "4", n = [ removeHtml(t.QUESTION_OPTIONS[0].OPTION_CONTENT) ]; } return e.question = titleClean(t.QUESTION_TITLE), e.options = r, e.answer = n, e; } }, { type: "ask", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u7b54\u9898", match: () => location.host.includes("dufe.edu.cn") && (location.href.includes("/HomeWorkPaper") || location.href.includes("/ExercisesPaper")), types: [ "0", "1", "3", "4" ], question: { html: ".QuestTrunk", question: ".CBTPaperMain-divInline", options: ".CBTPaperMain-options li>label", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => {}, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = e.html.vtree[0].vmodel._trunks[0], a = e.html.vtree[0].vmodel._type; let n = [], r = []; const getOption = () => { t.QUESTION_OPTIONS.forEach((e => { const t = removeHtml(e.OPTION_CONTENT); "1" === e.ISTRUE && n.push(t), r.push(t); })); }; switch (a) { case "001": e.type = "0", getOption(); break; case "002": e.type = "1", getOption(); break; case "004": e.type = "3", e.options = [], n = "1" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u6b63\u786e" ] : "0" === t.QUESTION_OPTIONS[0].ISTRUE ? [ "\u9519\u8bef" ] : []; break; case "005": e.type = "4", n = [ removeHtml(t.QUESTION_OPTIONS[0].OPTION_CONTENT) ]; } return e.question = titleClean(t.QUESTION_TITLE), e.options = r, e.answer = n, e; }, setAnswer: e => { if ("4" === e.type) { const t = K(e.html).find("textarea")[0]; return t._ms_context_._answer = e.answer[0], t._ms_context_._save(), !1; } return !0; } }, { type: "ask", name: "\u4e1c\u5317\u8d22\u7ecf\u5927\u5b66\u6210\u6559\u7b54\u9898(\u7efc\u5408)", match: () => location.host.includes("dufe.edu.cn") && location.href.includes("/CompHomeworkPaper"), types: [ "0", "1", "3", "4" ], question: { html: ".Question", question: ".CBTPaperMain-trunkTitle", options: "ul.Question-options>li", type: ".question-box .tag", workType: "dufe", pageType: "dufe" }, init: async () => {}, ischecked: e => e.parent().find("input").prop("checked"), questionHook: e => { const t = (e => { var t; if (e) { const a = Object.keys(e).find((e => e.startsWith("__reactEventHandlers"))); if (a) { const t = e[a]; return console.log("React \u4e8b\u4ef6\u5904\u7406\u5bf9\u8c61:", t), t; } if (!a) { const a = Object.keys(e).find((e => e.startsWith("__reactInternalInstance$") || e.startsWith("__reactFiber$"))); if (a && (null == (t = e[a]) ? void 0 : t.memoizedProps)) return console.log("React \u5185\u90e8\u6570\u636e:", e[a].memoizedProps), e[a].memoizedProps; } } else console.error("\u672a\u627e\u5230 .Question \u5143\u7d20"); })(e.html).children[0]._owner.memoizedProps; return e.type = { SingleChoice: "0", MultipleChoice: "1" }[t.type], e.options = removeStartChar(e.options), e; }, setAnswer: e => { if ("4" === e.type) { const t = K(e.html).find("textarea")[0]; return t._ms_context_._answer = e.answer[0], t._ms_context_._save(), !1; } return !0; } } ], Et = { single: "0", multiple: "1", judge: "3" }, Ut = [ { type: "hook", name: "hook", match: location.host.includes("lygtc.edu.cn"), main: () => { observeVuePageChange(K("#app")[0], (() => K("#app")[0].__vue__.$route.path)); } }, { type: "save", name: "\u6625\u98ce\u96e8\u6536\u5f55", match: () => location.host.includes("lygtc.edu.cn") && (location.href.includes("/student/#/my-study/homework/records/detail") || location.href.includes("/student/#/my-study/homework")), question: { html: ".questions>div>div[id],.question>div>div[id]", question: ".topic-title", options: ".el-radio-group label .label,.el-checkbox-group label .label", type: ".question-box .tag", workType: "cfy", pageType: "cfy" }, init: async () => { await waitUntil((() => 0 !== K(".questions>div>div[id],.question>div>div[id]").length)); }, answerHook: e => { const t = K(e.html).find(">div")[0].__vue__.question; return e.question = titleClean(removeHtml(t.title)), e.options = JSON.parse(t.options).map((e => e.content)), e.answer = t.answer.split("").map((t => e.options[t.charCodeAt(0) - 65])).filter(Boolean), e.type = Et[t.type] || "", "judge" === t.type && (e.options = [], e.answer = [ judgeAnswer(t.answer) ]), t.type, e; } }, { type: "ask", name: "\u6625\u98ce\u96e8\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("lygtc.edu.cn") && location.href.includes("/student/#/my-study/homework"), types: Object.values(Et), question: { html: ".question>div>div[id]", question: ".question-title>.title", options: ".radio-option", type: ".question-box .tag", workType: "cfy", pageType: "cfy" }, init: async () => { await waitUntil((() => 0 !== K(".question>div>div[id]").length)); }, ischecked: e => e.find(".el-radio__input.is-checked").length > 0, questionHook: e => { e.options = removeStartChar(e.options); const t = K(e.html).find(">div")[0].__vue__.question; return e.question = titleClean(removeHtml(t.title)), e.options = JSON.parse(t.options).map((e => e.content)), e.type = Et[t.type] || "", "judge" === t.type && (e.options = [], e.answer = [ judgeAnswer(t.answer) ]), e; } } ], Ht = [ { type: "hook", name: "hook", match: location.host.includes("jijiaool.com"), main: e => { observeVuePageChange(K(".contentIframe")[0], (() => K(".contentIframe").attr("src"))); } }, { type: "ask", name: "\u7ee7\u6559\u5728\u7ebf\u7b54\u9898", match: () => location.href.includes("jijiaool.com") && location.href.includes("/Learning/CourseOnlineExamination"), types: [ "0", "1" ], question: { html: ".bank_test>.test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label", type: ".question-box .tag", workType: "jijiaool", pageType: "jijiaool" }, init: async () => { await waitUntil((function() { return isExist(".bank_test>.test_item"); })); }, ischecked: isParentChecked, questionHook: e => { e.options = removeOptionsStartChar(e.options); const t = K(e.html).prevAll(".test_item_type").first().text().trim(); return e.type = typeMatch(t), e; } }, { type: "save", name: "\u7ee7\u6559\u5728\u7ebf\u6536\u5f55", match: () => location.href.includes("jijiaool.com") && location.href.includes("/Learning/CourseExamWorkPageDetail"), question: { html: ".bank_test>.test_item", question: ".test_item_tit", options: ".test_item_theme>ul>li>label", type: ".question-box .tag", workType: "jijiaool", pageType: "jijiaool" }, init: async () => { await waitUntil((function() { return isExist(".bank_test>.test_item"); })); }, answerHook: e => { const t = K(e.html).find(".test_item_tit").clone(); t.find(".tipNodo").remove(), e.question = titleClean(removeHtml(t.html())), e.options = removeOptionsStartChar(e.options); const a = removeHtml(K(e.html).find(".test_item_tit:eq(1)").html().replace(/ \u6b63\u786e\u7b54\u6848\uff1a/g, "").trim()), n = K(e.html).prevAll(".test_item_type").first().text().trim(); switch (e.type = typeMatch(n), e.type) { case "0": case "1": e.answer = a.split("").map((t => e.options[t.charCodeAt(0) - 65])); break; case "3": e.answer = judgeAnswer(a), e.options = []; } return e; } } ], Pt = [ { type: "save", name: "\u5317\u4eac\u8054\u5927\u5b66\u5802\u6536\u5f55", match: () => location.host.includes("jxjypt.cn") && location.href.includes("/paper/start?pid="), question: { html: "#questionModule>ul>li", question: ".sub-dotitle>pre", options: "dl.sub-answer>dd", type: ".sub-dotitle>i", workType: "jhjypt", pageType: "jhjypt" }, init: async () => {}, answerHook: e => { let t = removeHtml(K(e.html).find(".refer-answer>span>em.right ,.solution .so-timu .wenzi:eq(0)").html()); if (void 0 === t || "undefined" == t) return null; switch (e.options = removeStartChar(e.options), e.type = typeMatch(removeHtml(K(e.html).find(".sub-dotitle>i").text().replace("\n", "").replace(" ", ""))), e.type) { case "0": case "1": e.answer = [], t.split("").forEach((t => { e.answer.push(e.options[t.charCodeAt() - 65]); })); break; case "2": case "4": case "5": case "6": case "7": e.answer = t; } return e; } }, { type: "ask", name: "\u5317\u4eac\u8054\u5927\u5b66\u5802\u7b54\u9898", tips: "\u516c\u544a", match: () => location.host.includes("jxjypt.cn") && location.href.includes("/paper/start?pid="), types: [ "0", "1", "2", "3", "4", "5", "6", "7" ], minDelay: 1e3, answerDelay: 1e3, question: { html: "#questionModule>ul>li", question: ".sub-dotitle>pre", options: "dl.sub-answer>dd", type: ".sub-dotitle>i", workType: "jhjypt", pageType: "jhjypt" }, init: async () => { if (await waitUntil((function() { return 0 !== K("#questionModule>ul>li").length; })), !isExist("#btn_submit")) return !1; try { const e = ce.addEventListener; ce.addEventListener = function(t, a, n) { if ("visibilitychange" !== t) return e.call(this, t, a, n); }, ce.paper && void 0 !== ce.paper.isCut && (ce.paper.isCut = 0), Object.defineProperty(ce.document, "visibilityState", { get: function() { return "visible"; }, configurable: !0 }), Object.defineProperty(ce.document, "hidden", { get: function() { return !1; }, configurable: !0 }); } catch (e) {} }, ischecked: e => e.hasClass("cho-this"), questionHook: e => (e.options = removeStartChar(e.options), e.type = typeMatch(removeHtml(K(e.html).find(".sub-dotitle>i").text().replace("\n", "").replace(" ", ""))), e), setAnswer: e => { switch (e.type) { case "2": case "4": case "5": case "6": case "7": const t = K(e.html).find(".e__textarea"); if (t.length > 0) { const a = t[0]; a.value = e.answer, t.focus(); [ "input", "change", "keyup", "keydown", "blur", "paste" ].forEach((e => { const t = new Event(e, { bubbles: !0, cancelable: !0 }); a.dispatchEvent(t); })), t.trigger("input").trigger("change").trigger("keyup").trigger("blur"), setTimeout((() => { t.trigger("change"); }), 100), e.answer; } return !1; } return !0; } } ], jt = Object.freeze(Object.defineProperty({ __proto__: null, a21tb: ot, ahjxjy: Ne, cfy: Ut, chaoxing: Pe, chengjiaoyun: Oe, chutou: Ye, cjedu: Ge, cjnep: nt, cloudwis: Je, cnzx: De, cqsdx: _t, dufe: It, gkks: We, guokai: Me, huayi: st, jhjypt: Pt, jijiaool: Ht, jijiaox: et, jsou: $e, learnin: wt, ls365: Ze, mooc: kt, mosoteach: bt, mynep: rt, olearn: At, openha: Qe, ouchn: xt, qingshu: Re, sclecb: Xe, swufe: qt, uooc: Be, wdjycj: Ct, wencai: tt, whut: St, wx168: lt, xinwei: Le, xueqi: Ke, ynou: it, ytccr: Ve, yunmuxueyuan: _e, yxbyun: Tt, yxlearning: at, zhihuishu: je, zhijiaoyun: Fe }, Symbol.toStringTag, { value: "Module" })), resolveRuleHtml = e => "function" == typeof e ? e() : e; const cloneOptions = e => Array.isArray(e) ? e.map((e => e && "object" == typeof e ? { ...e } : e)) : [], normalizeFlatOptions = e => { const t = e.map((e => cleanQuestionText(e))); return removeOptionPrefixes(t).map((e => e.trim())).filter(Boolean); }, normalizeBaseQuestion = e => { const t = { ...e, question: cleanQuestionTitle(cleanQuestionText(e.question)), options: cloneOptions(e.options) }; return "15" == t.type ? (t.options = t.options.map((e => e && "object" == typeof e ? { ...e, question: cleanQuestionTitle(cleanQuestionText(e.question)), options: normalizeFlatOptions(cloneOptions(e.options)) } : e)), t) : (t.options = normalizeFlatOptions(t.options), t); }, createQuestionData = (e, t) => { const a = K(t), n = removeHtml(a.find(e.question).html()), r = a.find(e.options).map(((e, t) => removeHtml(K(t).html()))).get(); return { question: titleClean(n ?? ""), options: r, $options: a.find(e.options), type: a.find(e.type).val(), html: a[0], workType: e.workType, pageType: e.pageType }; }, Lt = []; for (const Td in jt) Lt.push(...jt[Td]); const isRuleMatched = e => "function" == typeof e.match ? e.match() : Boolean(e.match), parseRule = async e => { await waitUntil((() => void 0 !== ce[Dt + "app"])); const t = e.filter(isRuleMatched), a = getAppStore(), n = { app: a, ask: getAskStore(), ai: ce[Dt + "ai"] }; if (!t.length) return a.app.alert = "\u5f53\u524d\u6ca1\u6709\u4efb\u52a1", console.log("\u6ca1\u6709\u5339\u914d\u5230\u89c4\u5219", "error"), void addLog("\u6ca1\u6709\u5339\u914d\u5230\u89c4\u5219", "error"); for (const r of t) { if (console.log(`\u5339\u914d\u5230\u89c4\u5219\uff1a${r.name}`, "success"), addLog(`\u5339\u914d\u5230\u89c4\u5219\uff1a${r.name}`, "success"), r.init) { let e = await r.init(); if ("boolean" == typeof e && !1 === e) continue; } a.alert = `\u5f53\u524d\u4efb\u52a1:${r.name}`, "hook" === r.type && r.main(n), "ask" === r.type && askParser(r, n), "save" === r.type && await saveParser(r, n); } }, saveParser = async (e, t) => { const a = t.app, n = t.ask; n.rule = e, e.tips && (n.tips = e.tips); const r = questionSaveParser(e.question, e.answerHook || null).filter((e => null != e && 0 !== e.answer.length && "" !== e.answer && "8" != e.type)).map((e => (e.question = titleClean(e.question), e))); n.saveQuestionData = r, r.forEach((e => { 0 !== e.answer.length && Answer.cacheAnswer(e); })), await async function({questionList: e, pageType: t, paper: a, onPaperError: n, beforeSync: r, syncQuestionList: s}) { if (a) try { await a(e); } catch (o) { null == n || n(o); } const i = { questionList: e, pageType: t }; return null == r || r(i), e.length && await s(i), i; }({ questionList: r, pageType: e.question.pageType, paper: e.paper && "function" == typeof e.paper ? e.paper : void 0, onPaperError: () => addLog("\u6574\u5377\u7f13\u5b58\u5f02\u5e38", "error"), beforeSync: () => a.setPage("library", "manage"), syncQuestionList: e => Answer.syncQuestionList(e) }), a.app.alert = `\u9898\u5e93\u6536\u5f55\u5b8c\u6210\uff0c\u5171\u7f13\u5b58${r.length}\u9053\u9898\u76ee`, msg(`\u9898\u5e93\u6536\u5f55\u5b8c\u6210\uff0c\u5171\u7f13\u5b58${r.length}\u9053\u9898\u76ee`, "success"), e.next && e.next(); }, askParser = (e, t) => { const a = t.app, n = t.ask; n.rule = e, e.minDelay && (n.minDelay = e.minDelay, n.delay < n.minDelay && (n.delay = n.minDelay)), e.tips && (n.tips = e.tips), a.app.showFloat = !a.app.hideFloat, a.setPage("ask"), n.clearQuestion(); var r, s; (r = questionParser(e.question, e.questionHook || null), s = titleClean, r.filter((e => null != e)).map((e => (e.question = s(e.question), "3" == e.type && (e.options = []), e)))).map((e => (e => { const t = normalizeBaseQuestion(e); return "3" == t.type && (t.options = []), t; })(e))).forEach((e => { n.addQuestion(e); })), n.autoAnswer && n.toggleStart(); }, questionSaveParser = (e, t) => { const a = resolveRuleHtml(e.html); return K(a).map(((a, n) => { let r = { ...createQuestionData(e, n), $answer: K(n).find(e.answer), answer: [] }; try { t && (r = t(r, a)); } catch (i) { console.log("\u6536\u5f55hook\u62a5\u9519", i); } if (null == r || null == r) return null; const s = normalizeBaseQuestion(r); return { question: s.question, options: s.options, answer: s.answer, type: s.type, hash: questionHash(s.type, s.question, s.options) }; })).get(); }, questionParser = (e, t) => { const a = resolveRuleHtml(e.html), n = K(a).map(((a, n) => ((e, t, a, n = () => {}) => { if (!t) return e; try { return t(e, a) || null; } catch (r) { return n(r), null; } })(createQuestionData(e, n), t, a, (e => { console.log("\u7b54\u9898hook\u62a5\u9519", e); })))); return n.get(); }; class AnonymousIdentityOptimized { static generateShortId() { return Date.now().toString(36).padStart(8, "0").slice(-8) + Array.from({ length: 8 }, (() => "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[Math.floor(62 * Math.random())])).join(""); } static validateId(e) { return /^[0-9A-Za-z]{16}$/.test(e); } static getAnonymousId() { if (this.cachedAnonymousId) return this.cachedAnonymousId; let e = re(this.STORAGE_KEY); return e && this.validateId(e) || (e = this.generateShortId(), oe(this.STORAGE_KEY, e)), this.cachedAnonymousId = e, e; } static getStableCanvasFingerprint() { try { const e = document.createElement("canvas"); e.width = 220, e.height = 30; const t = e.getContext("2d", { willReadFrequently: !0 }); if (!t) return ""; t.textBaseline = "alphabetic", t.fillStyle = "#000", t.font = "16px Arial", t.fillText("AiAsk,\ud83c\udf10.\ud83d\ude00", 2, 20); const a = t.getImageData(0, 0, 220, 30).data; let n = 0; for (let r = 0; r < a.length; r += 40) n = (n << 5) - n + a[r], n |= 0; return n.toString(36); } catch (e) { return ""; } } static getWebGLFingerprint() { try { const e = document.createElement("canvas"), t = e.getContext("webgl") || e.getContext("experimental-webgl"); if (!t) return ""; const a = t.getExtension("WEBGL_debug_renderer_info"); if (!a) return t.getParameter(t.VERSION) + "|" + t.getParameter(t.VENDOR); const n = t.getParameter(a.UNMASKED_VENDOR_WEBGL); return n + "|" + t.getParameter(a.UNMASKED_RENDERER_WEBGL); } catch (e) { return ""; } } static getDeviceFingerprint() { if (this.cachedFingerprint) return this.cachedFingerprint; const e = re(this.FINGERPRINT_KEY); if (e && e.version === this.FP_VERSION && e.value) return this.cachedFingerprint = e.value, e.value, e.value; const t = [ this.normalizeUserAgent(navigator.userAgent), navigator.language, navigator.platform, screen.colorDepth, screen.pixelDepth || screen.colorDepth, (new Date).getTimezoneOffset(), navigator.hardwareConcurrency || 0, navigator.maxTouchPoints || 0, navigator.deviceMemory || 0, this.getWebGLFingerprint(), this.getStableCanvasFingerprint() ].filter(Boolean).join("|"), a = qe(t).substring(0, 12); return oe(this.FINGERPRINT_KEY, { value: a, version: this.FP_VERSION, createdAt: Date.now() }), this.cachedFingerprint = a, a; } static normalizeUserAgent(e) { return e.includes("Chrome") ? "Chrome" : e.includes("Firefox") ? "Firefox" : e.includes("Safari") ? "Safari" : e.includes("Edge") ? "Edge" : e.includes("Opera") ? "Opera" : "Unknown"; } static getIdentity() { return { anonymous_id: this.getAnonymousId(), device_fingerprint: this.getDeviceFingerprint() }; } static clear() { oe(this.STORAGE_KEY, null), oe(this.FINGERPRINT_KEY, null), this.cachedAnonymousId = null, this.cachedFingerprint = null; } static regenerateFingerprint() { return oe(this.FINGERPRINT_KEY, null), this.cachedFingerprint = null, this.getDeviceFingerprint(); } static getDebugInfo() { return { anonymous_id: this.getAnonymousId(), device_fingerprint: this.getDeviceFingerprint(), fingerprint_components: { browser: this.normalizeUserAgent(navigator.userAgent), language: navigator.language, platform: navigator.platform, screen_color: screen.colorDepth, timezone: (new Date).getTimezoneOffset(), hardware: navigator.hardwareConcurrency, webgl: this.getWebGLFingerprint() }, storage: { fp_stored: re(this.FINGERPRINT_KEY), id_stored: re(this.STORAGE_KEY) } }; } static async testStability(e = 10) { const t = []; for (let n = 0; n < e; n++) { this.cachedFingerprint = null; const e = this.getDeviceFingerprint(); t.push(e), await new Promise((e => setTimeout(e, 100))); } const a = new Set(t); a.size, a.size, Array.from(a), a.size, 1 === a.size || a.size; } } __publicField(AnonymousIdentityOptimized, "STORAGE_KEY", "anonymous_id"), __publicField(AnonymousIdentityOptimized, "FINGERPRINT_KEY", "device_fingerprint"), __publicField(AnonymousIdentityOptimized, "FP_VERSION", "v2"), __publicField(AnonymousIdentityOptimized, "cachedAnonymousId", null), __publicField(AnonymousIdentityOptimized, "cachedFingerprint", null); const normalizeRequestApiResponse = async (e, t) => { let a; try { a = JSON.parse(e.responseText); } catch { throw new Error("\u63a5\u53e3\u54cd\u5e94\u4e0d\u662f\u6709\u6548 JSON"); } if (!(null == a ? void 0 : a.encrypted)) return e; const n = await t(String(a.data ?? "")); if (!n) throw new Error("\u63a5\u53e3\u54cd\u5e94\u89e3\u5bc6\u5931\u8d25"); return { ...e, responseText: n }; }, zt = 864e5, Mt = [ { id: "492563", name: "GreasyFork", home: "https://greasyfork.org/zh-CN/scripts/492563-%E7%88%B1%E9%97%AE%E7%AD%94%E5%8A%A9%E6%89%8B", updateurl: "https://greasyfork.org/zh-CN/scripts/492563.json", getdata: e => { const t = JSON.parse(e[0].responseText); return { version: t.version, code_updated_at: formatDate(t.code_updated_at) }; } }, { id: "2384", name: "\u811a\u672c\u732b", home: "https://scriptcat.org/zh-CN/script-show-page/2384", updateurl: "https://scriptcat.org/api/v2/scripts/2384", getdata: e => { const t = JSON.parse(e[0].responseText); return { version: t.data.script.version, code_updated_at: formatDate(new Date(1e3 * t.data.updatetime).toISOString()) }; } } ]; function getAppStore() { return ce[Dt + "app"]; } function getAskStore() { return ce[Dt + "ask"]; } function request(e, t, a = void 0, n = void 0, r = 5e3) { "GET" === t && a && (e += `?${new URLSearchParams(a).toString()}`), "POST" === t && (n = { ...n }); const s = { "User-Agent": ce.navigator.userAgent, "Content-Type": "application/json", referer: location.href, ...n }; return new Promise(((n, i) => { const o = Date.now(); le({ method: t, url: e, headers: s, data: "GET" !== t ? JSON.stringify(a) : void 0, timeout: r, onload: function(e) { const t = Date.now(); n([ e, t - o ]); }, ontimeout: () => i(new Error("\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6")), onerror: e => { i(e); } }); })); } function requestApi(e, t, a = void 0, n = void 0, r = 5e3) { return "GET" === t && a && (e += `?${new URLSearchParams(a).toString()}`), new Promise((async (s, i) => { const o = Cache.get("user", {}), l = o && o.user && o.api_key; let c; if ("POST" === t) { if (!l) { const e = AnonymousIdentityOptimized.getIdentity(); a = { ...a, anonymous_id: e.anonymous_id, device_fingerprint: e.device_fingerprint }; } const e = get_t(a); n = { ...n, aka: e }, c = await encrypt(JSON.stringify(a), e); } else n = { ...n, aka: get_t({}) }; const p = { "User-Agent": ce.navigator.userAgent, "Content-Type": "application/json", referer: location.href, v: Nt.script.version, ...n }; if (l) p.Authorization = `Bearer ${o.api_key}`; else { const e = AnonymousIdentityOptimized.getIdentity(); p["X-Anonymous-ID"] = e.anonymous_id, p["X-Device-FP"] = e.device_fingerprint; } const u = Date.now(); JSON.stringify(a), le({ method: t, url: e, headers: p, data: "GET" !== t ? JSON.stringify({ data: c }) : void 0, timeout: r, onload: async function(e) { const t = Date.now() - u; try { const a = await normalizeRequestApiResponse(e, decrypt); JSON.parse(a.responseText), s([ a, t ]); } catch (a) { i(a); } }, ontimeout: () => i(new Error("\u63a5\u53e3\u8bf7\u6c42\u8d85\u65f6")), onerror: e => { i(e); } }); })); } const vuePageChange = async () => { if (ce.vuePageChangeLock) return; ce.vuePageChangeLock = !0; const e = getAppStore(), t = getAskStore(); t.questionInx = 0, e.app.showFloat = !1, e.setPage("overview"), t.clearQuestion(), await parseRule(Lt), ce.vuePageChangeLock = !1; }, observeVuePageChange = (e, t, a = {}) => { if (ce.mainClass = t(), !e) return; const n = new MutationObserver((async () => { const e = t(); ce.mainClass !== e && (ce.mainClass = e, a.beforeChange && await a.beforeChange(e), await vuePageChange(), n.disconnect()); })); n.observe(e, { subtree: !0, attributes: !0, childList: !0 }); }, addLog = (e, t = "info") => { const a = getAppStore(), n = (new Date).toLocaleString(); try { a.addLog({ time: n, type: t, content: e }); } catch (r) { console.log(e); } }, compareVersions = (e, t) => { const normalize = e => e.split(".").map(Number), a = normalize(e), n = normalize(t); for (let r = 0; r < Math.max(a.length, n.length); r++) { const e = a[r] || 0, t = n[r] || 0; if (t > e) return !0; if (t < e) return !1; } return !1; }, updateFn = async (e = !0) => { if (!getAppStore().app.checkUpdate) return; const t = Cache.get("lastCheckTime"); if (e && t && Date.now() - t < zt) { new Date(t + zt).toLocaleString(); } else try { const e = await Promise.allSettled(Mt.map((async e => { try { e.name, e.updateurl, addLog(`[${e.name}] \u5f00\u59cb\u68c0\u6d4b\u66f4\u65b0`, "info"); const t = await request(e.updateurl, "GET", {}, {}), a = e.getdata(t); return e.name, { script: e, updateInfo: a }; } catch (t) { throw e.name, String(t), addLog(`[${e.name}] \u66f4\u65b0\u68c0\u6d4b\u5931\u8d25: ${String(t)}`, "error"), t; } }))); Cache.set("lastCheckTime", Date.now()); const t = e.filter((e => "fulfilled" === e.status)); e.filter((e => "rejected" === e.status)); if (0 === t.length) return void msg("\u6240\u6709\u66f4\u65b0\u6e90\u68c0\u6d4b\u5931\u8d25\uff0c\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005\u3002", "error"); let a = !1, n = !0; for (const {value: r} of t) { const {script: e, updateInfo: t} = r; if (compareVersions(Nt.script.version, t.version)) { msg(`\n\u68c0\u6d4b\u5230\u65b0\u7248\u672c\uff1a${t.version}
\n\u811a\u672c\u6e90\uff1a${e.name}
\n\u66f4\u65b0\u65f6\u95f4\uff1a${t.code_updated_at}
\n \n")).replace(/<\/xmp>/g, ""); let n = (e = V.sanitize(e, { ALLOWED_TAGS: [ "img", "br", "sub", "sup" ], ALLOWED_ATTR: [ "src", "href" ], ALLOW_DATA_ATTR: !1, KEEP_CONTENT: !0 })).match(/
${escapeHtml(a.trim())}`))),
t = t.replace(/`([^`]+)`/g, ((e, t) => protect(`${escapeHtml(t)}`))),
t = t.replace(/\[([^\]]+)\]\(([^)]+)\)/g, ((e, t, a) => protect(`${t}`))),
t = t.replace(/\*\*(.+?)\*\*/g, "$1"), t = t.replace(/__(.+?)__/g, "$1"),
t = t.replace(/\*(.+?)\*/g, "$1"), t = t.replace(/_(.+?)_/g, "$1"),
t = t.replace(/^### (.+)$/gm, "