// ==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(`
${t.description}
`).clone(); if (i.find("span.__blank__").remove(), e.question = removeHtml(i.html()), e.options = t.options.map((e => removeHtml(e.content))), e.type = typeConvert(ze[t.type]), t.correctOptions && t.correctOptions.length > 0 && (e.answer = t.correctOptions.map((e => removeHtml(e.content))), a = !0), t.correct_answers && t.correct_answers.length > 0 && (e.answer = t.correct_answers.map((e => e.content)), a = !0), a || s) { switch (t.type) { case "single_selection": case "multiple_selection": case "true_or_false": if (a) "true_or_false" === t.type && (e.answer = judgeAnswer(e.answer[0]), e.options = []); else { if (t.options, e.answer = t.options.filter((e => e.isChosen)).map((e => removeHtml(e.content))), 0 === e.answer.length) return; "true_or_false" === t.type && (e.answer = judgeAnswer(e.answer[0]), e.options = []); } break; case "analysis": break; case "cloze": t.sub_subjects, e.options = t.sub_subjects.map((e => e.options.map((e => removeHtml(e.content))))); break; case "fill_in_blank": a || (e.answer = t.answers.map((e => e.content))); } return e; } }, paper: e => { const t = ce.globalData.course, a = ce.angular.element(K("body")).scope(), n = ce.angular.element(K(".hd")).scope().exam, r = a.submissionData.id; if (!a.examSubmissions.find((e => (e.id, String(e.id) === String(r))))) return; const s = { platform: "guokai" }; s.hash = t.id, s.name = t.name, s.info = {}, s.info.school = t.orgName, s.chapter = [ { hash: `${n.id}`, name: n.title, question: e } ], Ee.setPaper(s.hash, s); } }, { type: "save", name: "\u5e7f\u5f00\u7b54\u6848\u6536\u5f55", match: () => /mod\/quiz\/review\.php/i.test(location.pathname), question: { html: ".que", question: ".qtext", options: ".answer > div", type: "", answer: ".rightanswer", workType: "ougd", pageType: "ougd" }, init: async () => { K(".specificfeedback").remove(); }, next: async () => { !K(".qn_buttons > a").last().hasClass("thispage") && K(".arrow_text").click(); }, answerHook: e => { const t = K(e.html).find(".info .state").text(); if (e.type = (K(e.html).attr("class") || "").split(" ")[1], K(e.html).find(".qtext .accesshide").remove(), e.question = removeHtml(K(e.html).find(".qtext").html()), e.question.includes("egg")) { let t = K(e.html).clone(); t.find("img").each((function() { var e; (null == (e = K(this).attr("src")) ? void 0 : e.includes("egg")) && K(this).remove(); })), e.question = removeHtml(t.find(".qtext").html()); } switch (e.type, e.type) { case "truefalse": e.type = "3", e.$options = K(e.html).find("input[type=radio]"), e.options = K(e.html).find(".answer > div").map(((e, t) => removeHtml(K(t).html()).trim())).get(), e.answer = [], e.answer = K(e.html).find(".answer > div").map(((t, a) => e.$options.eq(t).prop("checked") ? e.options[t] : "")).get(), e.answer = e.answer.filter((e => "" !== e)), 0 === e.answer.length ? (e.temp = removeHtml(K(e.html).find(".rightanswer").html()).replace("\u6b63\u786e\u7b54\u6848\u662f", "").trim(), e.answer = [ e.temp ]) : t.includes("\u6b63\u786e") || (e.answer = e.options.filter((t => !t.includes(e.answer[0])))), isTrue(e.answer[0]) ? e.answer = [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? e.answer = [ "\u9519\u8bef" ] : e.answer = [], e.options = []; break; case "multichoice": case "multichoiceset": if (e.type = "1", e.$options = K(e.html).find("input[type=checkbox]"), 0 === e.$options.length && (e.type = "0", e.$options = K(e.html).find("input[type=radio]")), e.options = K(e.html).find(".answer > div").map(((e, t) => { let a = K(t).find(".answernumber").text().trim(), n = removeHtml(K(t).html()); return "" === a ? n.trim() : n.split(a)[1].trim(); })).get(), t.includes("\u6b63\u786e") && !t.includes("\u90e8\u5206\u6b63\u786e")) e.answer = [], e.answer = K(e.html).find(".answer > div").map(((t, a) => { let n = K(a).find(".answernumber").text().trim(), r = removeHtml(K(a).html()); return e.$options.eq(t).prop("checked") && K(a).find(".text-success").length > 0 ? "" === n ? r.trim() : r.split(n)[1].trim() : ""; })).get(), e.answer = e.answer.filter((e => "" !== e)); else { e.temp = removeHtml(K(e.html).find(".rightanswer").html(), !1).replace("\u6b63\u786e\u7b54\u6848\u662f\uff1a", "").trim(); const t = e.options.slice(0); t.sort(((e, t) => t.length - e.length)), e.answer = t.map((t => e.temp.includes(t) ? (e.temp = e.temp.replace(t, ""), t) : "")), e.answer = e.answer.filter((e => "" !== e)), e.answer.length; } break; case "shortanswer": e.type = "4", e.$options = K(e.html).find("input[type=text]"), e.answer = removeHtml(K(e.html).find(".rightanswer").html()).replace("\u6b63\u786e\u7b54\u6848\uff1a", "").trim(); break; case "match": e.type = "24", e.match = K(".answer tr td.text").map(((e, t) => removeHtml(K(t).html()))).get(), e.$options = K(".answer tr td.control select"), e.selects = K(".answer tr td.control select").map(((e, t) => [ K(t).find("option").map(((e, t) => ({ value: K(t).val(), text: K(t).text() }))).get() ])).get(); break; case "multianswer": e.type = "14"; let a = K(e.html).find(".formulation").clone(); a.find(".subquestion").remove(), a.find(".accesshide").remove(), e.question = removeHtml(a.html()); let n = [], r = []; K(e.html).find(".subquestion").map(((e, t) => { let a = K(t).find("select>option").map(((e, t) => removeHtml(K(t).html()))).get(); a = a.filter((e => "" !== e)), n.push(a); let s = K(t).find("select>option:selected").map(((e, t) => removeHtml(K(t).html()))).get(); r.push(s[0]); })), e.options = n; K(e.html).find(".text-success").length == e.options.length && (e.answer = r); break; case "description": return; } return e; }, paper: async e => { const t = { platform: "ougd" }; t.hash = (ce.document.body.innerHTML.match(/(?:courseid)=(\d+)/) || [])[1] || ""; const a = (ce.document.body.innerHTML.match(/(?:cmid)=(\d+)/) || [])[1] || ""; "" !== t.hash && "" !== a && (t.info = {}, t.name = K("h1").text().trim(), t.chapter = [ { hash: `${a}`, name: ce.document.title.trim(), question: e } ], Ee.setPaper(t.hash, t)); } }, { type: "ask", name: "\u5e7f\u5f00\u5f62\u8003", tips: "\u5e7f\u5f00\u4ec5\u652f\u6301\u57fa\u7840\u9898\u578b\uff0c\u7279\u6b8a\u9898\u578b\u8bf7\u624b\u52a8\u5b8c\u6210", match: () => /mod\/quiz\/attempt\.php/i.test(location.pathname), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9", "14", "24" ], question: { html: ".que", question: ".qtext", options: ".answer > div", type: "", workType: "ougd", pageType: "ougd" }, ischecked: e => Boolean(e.prop("checked")), questionHook: e => { if (e.type = (K(e.html).attr("class") || "").split(" ")[1], K(e.html).find(".qtext .accesshide").remove(), e.question = removeHtml(K(e.html).find(".qtext").html()), e.question.includes("egg")) { let t = K(e.html).clone(); t.find("img").each((function() { var e; (null == (e = K(this).attr("src")) ? void 0 : e.includes("egg")) && K(this).remove(); })), e.question = removeHtml(t.find(".qtext").html()); } switch (e.type) { case "truefalse": e.type = "3", e.$options = K(e.html).find("input[type=radio]"), e.options = []; break; case "multichoice": case "multichoiceset": e.type = "1", e.$options = K(e.html).find("input[type=checkbox]"), 0 === e.$options.length && (e.type = "0", e.$options = K(e.html).find("input[type=radio]")), e.options = K(e.html).find(".answer > div").map(((e, t) => { let a = K(t).find(".answernumber").text().trim(), n = removeHtml(K(t).html()); return "" === a ? n.trim() : n.split(a)[1].trim(); })).get(); break; case "shortanswer": e.type = "4", e.$options = K(e.html).find("input[type=text]"); break; case "match": e.type = "24", e.match = K(".answer tr td.text").map(((e, t) => removeHtml(K(t).html()))).get(), e.$options = K(".answer tr td.control select"), e.selects = K(".answer tr td.control select").map(((e, t) => [ K(t).find("option").map(((e, t) => ({ value: K(t).val(), text: K(t).text() }))).get() ])).get(); case "essay": e.type = "4", e.$options = K(e.html).find("iframe"); break; case "multianswer": e.type = "14"; let t = K(e.html).find(".formulation").clone(); t.find(".subquestion").remove(), t.find(".accesshide").remove(), e.question = removeHtml(t.html()); let a = []; K(e.html).find(".subquestion").map(((e, t) => { let n = K(t).find("select>option").map(((e, t) => removeHtml(K(t).html()))).get(); n = n.filter((e => "" !== e)), a.push(n), K(t).find("select>option:selected").map(((e, t) => removeHtml(K(t).html()))).get(); })), e.$options = K(e.html).find("select"), e.options = a; break; case "description": return; } return e; }, setAnswer: e => { switch (e.type) { case "4": return K(e.html).find("input.form-control").each((function(t, a) { K(a).val(e.answer[t]); })), K(e.html).find("iframe:eq(0)").contents().find("body").html(e.answer[0]), !1; case "3": e.ques.$options.each(((t, a) => { const n = K(a).parent().find("label").text(); return "object" == typeof e.answer && (e.answer = e.answer[0]), isTrue(e.answer) && isTrue(n) ? (K(a).click(), !1) : !isFalse(e.answer) || !isFalse(n) || (K(a).click(), !1); })); case "14": return K(e.html).find("select").each(((t, a) => { const n = e.answer[t]; K(a).find(`option:contains("${n}")`).prop("selected", !0); })), !1; default: return !0; } }, finish: e => { K(".submitbtns .btn-primary").click(); } }, { type: "ask", name: "\u56fd\u5f00\u4e13\u9898\u6d4b\u9a8c", match: () => /\/exam\/([0-9]+)\/subjects/i.test(location.pathname) && !/\/exam\/([0-9]+)\/subjects#\/submission\/([0-9]+)/i.test(location.href), types: [ "0", "1", "2", "3", "4", "5", "6", "7", "9", "14", "24" ], question: { html: "li.subject", question: ".summary-title .subject-description", options: ".subject-options li .option-content", type: ".summary-sub-title span:eq(0)", workType: "guokai", pageType: "guokai" }, init: async () => { await waitUntil((function() { return K(".loading-gif").hasClass("ng-hide") && "" === K(".hd .examinee .submit-label").eq(0).text(); })), await waitUntil((function() { return 0 !== K("li.subject").length; })); }, ischecked: e => Boolean(e.parent().find("input").eq(-1).prop("checked")), questionHook: e => { const t = ce.angular.element(e.html).scope(), a = t.subject; if ("text" === a.type) return; e.type = typeConvert(ze[a.type]); let n = K(`
${a.description}
`).clone(); switch (n.find("span.__blank__").remove(), e.question = removeHtml(n.html()), a.options = a.options.sort(((e, t) => e.sort - t.sort)), e.options = a.options.map((e => removeHtml(e.content))), e.type, a.type, a.type) { case "cloze": e.options = a.sub_subjects.map((e => e.options.map((e => removeHtml(e.content))))), e.$options = K(e.html).find("select"); case "true_or_false": e.options = []; } return e.subject = a, e.scope = t, e; }, setAnswer: e => { switch (e.ques, e.type) { case "2": return K(e.html).find(".___answer"), K(e.html).find(".___answer").each(((t, a) => { K(a).html(e.answer[t]), e.ques.scope.subject.answers[t].content = e.answer[t], e.ques.scope.onChangeSubmission(e.ques.subject); })), !1; case "4": return K(e.html).find(".simditor-body.needsclick>p").each((function(t, a) { K(a).html(e.answer[t]), e.ques.subject.answered_content = e.answer[t]; })), e.ques.scope.onChangeSubmission(e.ques.subject), !1; case "14": return e.ques.subject.sub_subjects.forEach(((t, a) => { let n = e.answer[a]; t.options.forEach(((r, s) => { r.content === n && (t.answeredOption = String(r.id), e.ques.scope.onChangeSubmission(t), K(e.html).find(`input[value="${r.id}"]`).click(), K(e.html).find(`button:eq(${a})>span:eq(1)`).text(n)); })); })), !1; } return !0; } }, { type: "save", name: "\u4e0a\u6d77\u5f00\u653e\u6536\u5f55", match: () => "l.shou.org.cn" === location.host && location.href.includes("assignment/history.aspx?homeWorkId"), question: { html: ".e-q-body", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "shou", pageType: "shou" }, init: async () => {}, answerHook: e => { e.$options = K(e.html).find("ul>li"); let t = K(e.html).find("ul>li.checked").map(((e, t) => removeHtml(K(t).find(".ErichText").html() || K(t).html()))).get(); const a = K(e.html).find(".e-q-right").length > 0; e.answer = t.filter((e => "" !== e)); let n = K(e.html).find(".e-ans-ref .e-ans-r").map(((e, t) => removeHtml(K(t).html()))).get().map((t => { let a = t.charCodeAt() - 65; return e.options[a]; })).filter((e => "" !== e && void 0 !== e)); switch (e.options = removeStartChar(e.options), K(e.html).attr("data-questiontype")) { 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 "8": e.type = "15"; const t = K(e.html).find(".e-q-quest form").map(((e, t) => { let a = removeHtml(K(t).find(".e-q-q .ErichText").html()), n = K(t).find("ul>li").map(((e, t) => removeHtml(K(t).find(".ErichText").html() || K(t).html()))).get(), r = "0"; n = removeStartChar(n); const s = K(t).find(".e-a-right").length > 0, i = K(t).find(".e-ans-ref .e-ans-r").map(((e, t) => removeHtml(K(t).html()))).get(); let o = i.map((e => { let t = e.charCodeAt() - 65; return n[t]; })).filter((e => "" !== e && void 0 !== e)); if (2 === n.length && 1 === i.length) { let e = judgeAnswer(i[0]); e.length > 0 && (o = e, n = [], r = "3"); } return o.length > 1 && (r = "1"), { question: a, options: n, answer: o, isT: s, type: r }; })).get(); if (t.some((e => !e.isT))) return; n = t.map((e => e.answer)).flat(), e.options = t.map((e => ({ question: e.question, options: e.options, type: e.type }))); break; case "11": e.type = "19"; const a = 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(); n = n.length > 0 ? judgeAnswer(n[0]) : [], e.options = a; break; default: return void K(e.html).attr("data-questiontype"); } return n.length > 0 ? (e.answer = n, e) : !a && "3" === e.type && e.answer.length > 0 || !a ? void 0 : e; }, paper: async e => { const t = { platform: "shou" }, a = K("input[name=CourseOpenId]").val(), n = K("input[name=WorkId]").val(); await request("https://l.shou.org.cn/student/CourseScoreNew-inside.aspx", "GET").then((e => { const n = K(e[0].responseText); t.name = n.find(`#courseSelect>option[data-xid="${a}"]`).text().trim(), t.info = {}; })), t.hash = a, t.info = {}, t.chapter = [ { hash: `${n}`, name: K(".mark_title").text().trim(), question: e } ], Ee.setPaper(t.hash, t); } }, { type: "ask", name: "\u4e0a\u6d77\u5f00\u653e\u4f5c\u4e1a", tips: "", match: () => "l.shou.org.cn" === location.host && (location.href.includes("assignment/preview.aspx?homeWorkId") || location.href.includes("study/assignment/continuation.aspx")), types: [ "0", "1", "3" ], question: { html: ".e-q-body", question: ".ErichText", options: "ul>li>.ErichText", type: ".question-box .tag", workType: "shou", pageType: "shou" }, init: async () => { await waitUntil((function() { return 0 !== K(".e-q-body").length; })); }, ischecked: isParentChecked, questionHook: e => { switch (K(e.html).attr("data-questiontype")) { 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 "8": e.type = "15", e.quesList = 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(); break; default: return void K(e.html).attr("data-questiontype"); } return e; } } ], Oe = [ { type: "ask", name: "\u6210\u6559\u4e91\u8003\u8bd5", tips: "", match: () => location.href.includes("student/exam/resource/paper_card"), types: [ "0", "1", "3" ], question: { html: ".ui-question", question: ".ui-question-content-wrapper", options: ".ui-question-options li .ui-question-content-wrapper", type: ".ui-question-group-title", workType: "chengjiaoyun", pageType: "chengjiaoyun" }, init: async () => { if (await waitUntil((function() { return isExist(".ui-question"); })), !ce.top.location.href.includes("student/exam2/doexam")) return !1; }, toquestion: async e => { K(ce.top.document).find(".ui-card-questions ul li:eq(" + e + ")").click(); }, next: async () => { K("#next-btn").click(); }, ischecked: e => e.hasClass("ui-option-selected"), questionHook: e => { if (e.type = typeMatch(K(e.html).parent().find(".ui-question-group-title").text()), e.$options = K(e.html).find(".ui-question-options li>span"), "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(); })), !1; } return !0; } }, { type: "save", name: "\u6210\u6559\u4e91\u6536\u5f55", match: () => location.href.includes("student/exam/resource/paper_card"), question: { html: ".ui-question", question: ".ui-question-content-wrapper", options: ".ui-question-options li .ui-question-content-wrapper", type: ".ui-question-group-title", workType: "chengjiaoyun", pageType: "chengjiaoyun" }, init: async () => { if (await waitUntil((function() { return isExist(".ui-question"); })), ce.top.location.href.includes("student/exam2/doexam")) return !1; }, answerHook: e => { if (e.type = typeMatch(K(e.html).parent().find(".ui-question-group-title").text()), e.$options = K(e.html).find(".ui-question-options li>span"), e.answer = K(e.html).find(".ui-question-options li.ui-correct-answer .ui-question-content-wrapper").map(((e, t) => removeHtml(K(t).html()))).get(), "3" === e.type) e.options = [], e.answer = isTrue(e.answer[0]) ? [ "\u6b63\u786e" ] : isFalse(e.answer[0]) ? [ "\u9519\u8bef" ] : []; return e; } } ], $e = [ { type: "hook", name: "hook", match: () => "xuexi.jsou.cn" === location.host && location.href.includes("newHomework/showHomeworkByStatus") && location.href.includes("checked=true"), main: e => { ce.mainClass = K("#homeworkHistory").find(".active").attr("id"); let t = new MutationObserver((async e => { ce.mainClass !== K("#homeworkHistory").find(".active").attr("id") && (ce.mainClass = K("#homeworkHistory").find(".active").attr("id"), await waitUntil((function() { return 0 === K(".layui-layer-shade").length; })), vuePageChange(), t.disconnect()); for (let a of e) "attributes" === a.type && "class" === a.attributeName && a.target.textContent && (a.target.textContent.includes("\u4e0b\u4e00\u9898") || a.target.textContent.includes("\u4e0a\u4e00\u9898")) && (t.disconnect(), vuePageChange()); })); K("body").length >= 1 && t.observe(K("body")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "ask", name: "\u6c5f\u82cf\u5f00\u653e\u5927\u5b66\u7b54\u9898", tips: "", match: () => "xuexi.jsou.cn" === location.host && location.href.includes("/showHomeworkByStatus") && location.href.includes("checked=false"), types: [ "0", "1", "2", "3" ], question: { html: ".insert", question: ".window-title", options: ".questionId-option li > div:not(.numberCover)", type: ".questionDiv >div:eq(0)", workType: "jsou", pageType: "jsou" }, init: async () => { document.addEventListener("copy", (function(e) { e.stopImmediatePropagation(), layer.msg("\u590d\u5236\u6210\u529f", { icon: 4 }), e.clipboardData.setData("text/plain", window.getSelection().toString()); })), document.addEventListener("paste", (() => { event.stopImmediatePropagation(); let e = (event.clipboardData || window.clipboardData).getData("text"); layer.msg("\u7c98\u8d34\u6210\u529f", { icon: 4 }), document.execCommand("insertText", !1, e); })); }, ischecked: isParentChecked, questionHook: e => (e.type = K(e.html).find(".questionDiv >div:eq(1)").text().trim(), e.type = typeConvert(e.type), e.$options = K(e.html).find(".questionId-option li .numberCover"), "3" == e.type && (e.options = []), e), setAnswer: e => { switch (e.type) { case "2": if (e.$options = K(e.html).find(".questionTitle input"), e.$options.length == e.answer.length) return e.$options.each(((t, a) => { K(a).val(e.answer[t]); })), !1; break; case "3": let t = e.answer; return K(e.html).find(".questionId-option>.default-option").each(((e, a) => { isTrue(t) && isTrue(removeHtml(K(a).find(".option-title>div:eq(1)").html())) && K(a).find("div.numberCover").click(), isFalse(t) && isFalse(removeHtml(K(a).find(".option-title>div:eq(1)").html())) && K(a).find("div.numberCover").click(); })), !1; case "4": const a = K(e.html).find(".jianda-answer>div").attr("id"); return ce.UE.getEditor(`${a}`).setContent(e.answer), !1; } return !0; } }, { type: "save", name: "\u6c5f\u82cf\u5f00\u653e\u5927\u5b66\u6536\u5f55", match: () => "xuexi.jsou.cn" === location.host && location.href.includes("newHomework/showHomeworkByStatus") && location.href.includes("checked=true"), question: { html: ".insert", question: ".window-title", options: "#questionId-option li > div:not(.numberCover)", type: ".questionDiv >div:eq(0)", workType: "jsou", pageType: "jsou" }, init: async () => {}, answerHook: e => { const t = K(e.html).find(".questionDiv >div").text(), a = t.match(/\u5206\u503c(\d+)\u5206/), n = t.match(/\u5f97\u5206\uff1a(\d+)/); if (!a || !n) return null; e.type = typeConvert(K(e.html).find(".questionDiv >div:eq(1)").text()); if (!(a[1] === n[1] && "0" !== n[1]) && "3" !== e.type) return null; switch (e.type) { case "0": case "1": case "3": if (e.answer = K(e.html).find(".answer .correctAnswer").text().trim().split("\uff1b").map((t => e.options[t.charCodeAt(0) - 65])), e.answer = e.answer.filter((e => e)), 0 == e.answer.length && (e.answer = K(e.html).find(".answer .studentAnswer").text().trim().split("\uff1b").map((t => e.options[t.charCodeAt(0) - 65]))), e.answer = e.answer.filter((e => e)), 3 == e.type) { e.options = []; let t = e.answer[0]; if (isFalse(t)) e.answer = "\u9519\u8bef"; else { if (!isTrue(t)) return; e.answer = "\u6b63\u786e"; } } break; case "2": e.options = [], e.answer = K(e.html).find(".answer .correctAnswer").text().trim().split("\uff1b"), e.answer = e.answer.filter((e => e)), 0 == e.answer.length && (e.answer = K(e.html).find(".answer .studentAnswer").text().trim().split("\uff1b")), e.answer = e.answer.filter((e => e)); break; default: return; } return e; }, paper: e => { const t = ce.homework, a = { platform: "jsou" }; 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); } } ], Fe = [ { type: "hook", name: "hook", match: "spoc-exam.icve.com.cn" === location.host || location.host.includes("exam.courshare.cn") || location.host.includes("webtrn.cn"), main: e => { ce.mainClass = K(".q_content").first().attr("id"); let t = new MutationObserver((async e => { ce.mainClass !== K(".q_content").first().attr("id") && (ce.mainClass = K(".q_content").first().attr("id"), "homework-detail-container" === ce.mainClass && await waitUntil((function() { return 0 !== K(".q_content").length; })), vuePageChange(), t.disconnect()); for (let a of e) "attributes" === a.type && "class" === a.attributeName && a.target.textContent && (a.target.textContent.includes("\u4e0b\u4e00\u9898") || a.target.textContent.includes("\u4e0a\u4e00\u9898")) && (t.disconnect(), vuePageChange()); })); K("#examPage").length >= 1 && t.observe(K("#examPage")[0], { subtree: !0, attributes: !0, childList: !0 }); } }, { type: "hook", name: "hook", match: "zjy2.icve.com.cn" === location.host || "zyk.icve.com.cn" === location.host || "ai.icve.com.cn" === location.host, main: e => { K(".minimized-dialog img").css({ "z-index": "999999" }); observeVuePageChange(K("#app")[0], (() => K("#app")[0].__vue__.$route.name), { beforeChange: async e => { "homework-detail-container" === e && await waitUntil((function() { return 0 !== K(".q_content").length; })); } }); } }, { type: "ask", name: "\u804c\u6559\u4e91\u4f5c\u4e1a", tips: "", match: () => location.href.includes("examflow_index.action"), types: [ "0", "2", "1", "3", "4" ], question: { html: ".q_content", question: ".divQuestionTitle", options: ".questionOptions > div", type: ".question-box .tag", workType: "zhijiaoyun", pageType: "zhijiaoyun" }, init: async () => { await waitUntil((function() { return 0 !== K(".q_content").length; })); }, finish: e => { K('.paging_next:contains("\u4e0b\u4e00\u9875")').click(); }, ischecked: e => 0 !== e.parent().find(".checkbox_on").length, questionHook: e => { var t, a; e.question = removeHtml(K(e.html).find(".divQuestionTitle").html()); let n = K(e.html).find("[name='quesId']").attr("id"), r = null == (a = null == (t = document.getElementById(`questionId[${n}]`)) ? void 0 : t.getAttribute("answertype")) ? void 0 : a.trim(), s = K(e.html).find("span[name^='questionIndex']").text().trim() + "\u3001", i = K(e.html).find(".q_score").text().trim(); switch (e.question = e.question.replace(s, "").replace(i, "").trim(), e.options = K(e.html).find(".questionOptions>div").map(((e, t) => { let a = K(t).find(".option_index").text().trim(); return removeHtml(K(t).html()).replace(a, "").trim(); })).get(), e.$options = K(e.html).find(".questionOptions>div input"), r) { 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", e.options = []; break; case "fillblank": e.type = "2", e.question = removeHtml(K(e.html).find("[name='fillblankTitle']").html()); break; case "cloze": 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(); break; case "textarea": e.type = "4", e.options = []; } return e; }, setAnswer: e => { switch (e.type) { case "2": return K(e.html).find(".fillblank_input > input").each(((t, a) => { K(a).val(e.answer[t]); })), !1; case "3": 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(); })), !1; case "4": let a = K(e.html).find("[name='quesId']").attr("id"); return ce.UE.getEditor(`_baidu_editor_${a}`).setContent(`

${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
\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

>> \u70b9\u6211\u5feb\u6377\u8df3\u8f6c\u66f4\u65b0 <<

\n
`, "warning"), addLog(`[${e.name}] \u68c0\u6d4b\u5230\u65b0\u7248\u672c\uff1a${t.version}`, "warning"), a = !0, n = !1; } else e.name, t.version, addLog(`[${e.name}] \u5df2\u662f\u6700\u65b0\u7248\uff1a${t.version}`, "info"); } !a && n && (msg("\u5f53\u524d\u5df2\u662f\u6700\u65b0\u7248", "success"), addLog("\u5f53\u524d\u5df2\u662f\u6700\u65b0\u7248", "success")); } catch (a) { console.error("\u66f4\u65b0\u68c0\u6d4b\u6d41\u7a0b\u5f02\u5e38", a), addLog(`\u66f4\u65b0\u68c0\u6d4b\u5931\u8d25: ${String(a)}`, "error"), msg("\u6240\u6709\u66f4\u65b0\u6e90\u5747\u68c0\u6d4b\u5931\u8d25\uff0c\u8bf7\u5c1d\u8bd5\u5207\u6362\u7f51\u7edc\u6216\u8005\u53cd\u9988\u7ed9\u4f5c\u8005", "error"); } }, ttfDownload1 = async e => new Promise((t => { le({ method: "GET", url: e, onload: function(e) { try { const a = e.responseText, n = JSON.parse(a); t(n); } catch (a) { msg("\u5b57\u4f53\u6587\u4ef6\u4e0b\u8f7d\u5931\u8d25", "error"), t(null); } }, onerror: function(e) { msg("\u5b57\u4f53\u6587\u4ef6\u4e0b\u8f7d\u5931\u8d25", "error"), t(null); } }); })), Ot = "aah-notice-global-style", $t = `\n#${Ot} {}\n#aah-notice-container {\n position: fixed;\n top: 20px;\n right: 20px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n z-index: 2147483647;\n pointer-events: none;\n}\n.aah-notice {\n min-width: 220px;\n padding: 12px 16px;\n border-radius: 10px;\n background: #ffffff;\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);\n color: #1f2937;\n font-size: 13px;\n transition: opacity 0.3s ease, transform 0.3s ease;\n}\n.aah-notice-success { border-left: 4px solid #10b981; }\n.aah-notice-error { border-left: 4px solid #ef4444; }\n.aah-notice-warning { border-left: 4px solid #f59e0b; }\n.aah-notice-info { border-left: 4px solid #3b82f6; }\n.aah-notice.hide {\n opacity: 0;\n transform: translateY(-6px);\n}`; function somd5(e) { return qe(e); } function removeHtml(e, t = !0) { const a = document.createElement("textarea"); a.innerHTML = e, e = (e = (e = (e = a.value).replace(/[\t\r\xa0]/g, " ")).replace(/[\u2000-\u200a]/g, " ")).replace(//g, "\n"), t && (e = e.replace(/<(\/)?(p|div).*?>/g, "\n")), e = (e = (e = (e = e.replace(/ {2,}/g, " ")).replace(/\n{2,}/g, "\n")).replace(//g, "
")).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(//g); return n && n.forEach((t => { let a = t.match(/src="(.*?)"/); if (a && -1 == a[1].indexOf("http") && !a[1].includes("data:image")) if (a[1].startsWith("/")) e = e.replace(a[1], location.origin + a[1]); else { const t = new URL(a[1], document.baseURI).href; e = e.replace(a[1], t); } })), e.trim(); } function titleClean(e) { return cleanQuestionTitle(e); } function sleep(e) { return new Promise((t => setTimeout(t, e))); } function typeConvert(e, t = !0) { return t ? Ft[e] || "8" : Object.keys(Ft).find((t => Ft[t] === e)) || "\u5176\u5b83"; } function typeMatch(e) { const t = { 0: [ "\u5355\u9009", "\u5355\u9879\u9009\u62e9", "A2", "A1" ], 1: [ "\u591a\u9009", "\u591a\u9879\u9009\u62e9" ], 2: [ "\u586b\u7a7a" ], 3: [ "\u5224\u65ad" ], 4: [ "\u7b80\u7b54", "\u95ee\u7b54", "\u7efc\u5408\u9898" ], 5: [ "\u540d\u8bcd\u89e3\u91ca" ], 6: [ "\u8bba\u8ff0", "\u4e3b\u89c2" ], 7: [ "\u8ba1\u7b97" ], 9: [ "\u5206\u5f55" ], 14: [ "\u5b8c\u5f62\u586b\u7a7a" ], 15: [ "\u9605\u8bfb\u7406\u89e3" ], 24: [ "\u9009\u8bcd\u586b\u7a7a" ] }; return Object.keys(t).find((a => t[a].some((t => e.includes(t))))) || "8"; } function isParentChecked(e) { return e.parent().parent().hasClass("is-checked"); } function msg(e, t = "info") { try { if (!document.getElementById(Ot)) { const e = document.createElement("style"); e.id = Ot, e.textContent = $t, document.head.appendChild(e); } const a = "aah-notice-container"; let n = document.getElementById(a); n || (n = document.createElement("div"), n.id = a, document.body.appendChild(n)); const r = document.createElement("div"); r.className = `aah-notice aah-notice-${t}`, r.innerHTML = V.sanitize(e), n.appendChild(r), setTimeout((() => { r.classList.add("hide"), setTimeout((() => r.remove()), 300); }), 2800), addLog(e, t); } catch (a) { addLog(`\u6d88\u606f\u901a\u77e5\u5931\u8d25\u3010${e}\u3011`, "error"); } } function isTrue(e) { return !isFalse(e) && /(\u6b63\u786e|\u662f|\u5bf9|\u221a|T|ri|true)/i.test(e); } function isFalse(e) { return /(\u4e0d\u6b63\u786e|\u9519\u8bef|\u5426|\u9519|\xd7|F|wr|false)/i.test(e); } const questionHash = (e, t, a, n = !0) => { if (("15" === e || 15 === e) && Array.isArray(a) && a.length > 0 && "object" == typeof a[0]) { let r = `${e}${t}${a.map((e => { if (e.question && e.options) { let t = Array.from(e.options); n && t.sort(); const a = t.join(""); return `${e.type || "0"}${e.question}${a}`; } return ""; })).filter(Boolean).join("")}`; r = r.replace(/\s/g, ""); return qe(r); } let r = Array.from(a); n && r.sort(); let s = `${e}${t}${r.join("")}`; s = s.replace(/\s/g, ""); return qe(s); }; function get_t(e = {}) { const {html: t, ...a} = e || {}, flatten = (e, t = "") => { const a = []; return Object.keys(e).sort().forEach((n => { const r = t ? `${t}.${n}` : n, s = e[n]; null != s && (Array.isArray(s) && 0 === s.length || ("object" != typeof s || Array.isArray(s) || 0 !== Object.keys(s).length) && (Array.isArray(s) ? s.every((e => "object" != typeof e)) ? a.push(`${r}=${s.sort().join(",")}`) : a.push(`${r}=${JSON.stringify(s)}`) : "object" == typeof s ? a.push(...flatten(s, r)) : a.push(`${r}=${s}`))); })), a; }, n = flatten(a).join("&"); return qe(n); } async function encrypt(e = "", t = "asdgdfghfghfghfg", a = "1234567890123456") { try { if (!e) return ""; if (t = t.substring(0, 16), a = a.substring(0, 16), !window.crypto || !window.crypto.subtle) { const n = W.enc.Utf8.parse(t), r = W.enc.Utf8.parse(a); return W.AES.encrypt(e, n, { iv: r, mode: W.mode.CBC, padding: W.pad.Pkcs7 }).toString(); } const r = new TextEncoder, s = r.encode(e), i = r.encode(t), o = r.encode(a), l = await crypto.subtle.importKey("raw", i, { name: "AES-CBC" }, !1, [ "encrypt" ]), c = await crypto.subtle.encrypt({ name: "AES-CBC", iv: o }, l, s), p = new Uint8Array(c), u = 1024; let d, m = ""; for (let e = 0; e < p.length; e += u) { const t = p.slice(e, Math.min(e + u, p.length)); m += String.fromCharCode.apply(null, Array.from(t)); } try { d = btoa(m); } catch (n) { d = m.split("").map((e => ("0" + e.charCodeAt(0).toString(16)).slice(-2))).join(""); } return d; } catch (r) { return addLog(`\u52a0\u5bc6\u5f02\u5e38: ${r instanceof Error ? r.message : "\u672a\u77e5\u9519\u8bef"}`, "error"), ""; } } async function decrypt(e = "", t = "asdgdfghfghfghfg", a = "1234567890123456") { try { if (!e) return ""; if (t = t.substring(0, 16), a = a.substring(0, 16), !window.crypto || !window.crypto.subtle) { const n = W.enc.Utf8.parse(t), r = W.enc.Utf8.parse(a); return W.AES.decrypt(e, n, { iv: r, mode: W.mode.CBC, padding: W.pad.Pkcs7 }).toString(W.enc.Utf8); } /^[A-Za-z0-9+/]*={0,2}$/.test(e); const r = new TextEncoder, s = r.encode(t), i = r.encode(a); let o; try { o = atob(e); } catch (n) { throw new Error("Base64 \u89e3\u7801\u5931\u8d25\uff0c\u6570\u636e\u683c\u5f0f\u4e0d\u6b63\u786e"); } const l = new Uint8Array(o.length); for (let e = 0; e < o.length; e++) l[e] = o.charCodeAt(e); if (l.length % 16 != 0) throw new Error("\u52a0\u5bc6\u6570\u636e\u957f\u5ea6\u4e0d\u6b63\u786e\uff0c\u4e0d\u662f16\u7684\u500d\u6570"); const c = await crypto.subtle.importKey("raw", s, { name: "AES-CBC" }, !1, [ "decrypt" ]), p = await crypto.subtle.decrypt({ name: "AES-CBC", iv: i }, c, l); return new TextDecoder("utf-8", { fatal: !0 }).decode(p); } catch (r) { return addLog(`\u89e3\u5bc6\u5f02\u5e38: ${r instanceof Error ? r.message : "\u672a\u77e5\u9519\u8bef"}`, "error"), ""; } } function simpleMarkdownToHtml(e) { if (!e) return ""; let t = e; const a = [], protect = e => { const t = `{{{{PLACEHOLDER${a.length}}}}}`; return a.push(e), t; }, escapeHtml = e => e.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); return t = t.replace(/```(\w*)\n([\s\S]*?)```/g, ((e, t, a) => protect(`
${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, "

$1

"), t = t.replace(/^## (.+)$/gm, "

$1

"), t = t.replace(/^# (.+)$/gm, "

$1

"), t = t.replace(/^\- (.+)$/gm, "
  • $1
  • "), t = t.replace(/(
  • .*<\/li>\n?)+/g, "
      $&
    "), t = t.replace(/^\d+\. (.+)$/gm, "
  • $1
  • "), t = t.replace(/\n/g, "
    "), t = t.replace(/
    <(pre|h1|h2|h3|ul|ol)/g, "<$1"), t = t.replace(/<\/(pre|h1|h2|h3|ul|ol)>
    /g, ""), t = t.replace(/\{\{\{\{PLACEHOLDER(\d+)\}\}\}\}/g, ((e, t) => a[parseInt(t)])), t; } function judgeAnswer(e) { return isTrue(e) ? [ "\u6b63\u786e" ] : isFalse(e) ? [ "\u9519\u8bef" ] : []; } function removeStartChar(e) { return removeOptionPrefixes(e, { removeBareLetter: !0 }); } function qc(e) { K(e).find(".answerBg, .textDIV, .eidtDiv").each((function() { (K(this).find(".check_answer").length || K(this).find(".check_answer_dx").length) && K(this).click(); })), K(e).find(".answerBg, .textDIV, .eidtDiv").find("textarea").each((function() { ce.UE.getEditor(K(this).attr("name")).ready((function() { this.setContent(""); })); })), K(e).find(":radio, :checkbox").prop("checked", !1), K(e).find("textarea").each((function() { ce.UE.getEditor(K(this).attr("name")).ready((function() { this.setContent(""); })); })); } function qc1(e) { K(e).find(".before-after,.before-after-checkbox, .textDIV, .eidtDiv").each((function() { (K(this).find(".check_answer").length || K(this).find(".check_answer_dx").length) && K(this).click(); })), K(e).find(".before-after, .textDIV, .eidtDiv").find("textarea").each((function() { ce.UE.getEditor(K(this).attr("name")).ready((function() { this.setContent(""); })); })), K(e).find(":radio, :checkbox").prop("checked", !1), K(e).find("textarea").each((function() { ce.UE.getEditor(K(this).attr("name")).ready((function() { this.setContent(""); })); })); } const waitUntil = (e, t = 100) => new Promise((a => { const n = setInterval((() => { e() && (clearInterval(n), a()); }), t); })); function isExist(e) { return K(e).length > 0; } function getUrl() { return location.href; } function removeOptionsStartChar(e) { for (let t = 0; t < e.length; t++) { let a = String.fromCharCode(65 + t) + ".", n = String.fromCharCode(65 + t) + "\u3001", r = String.fromCharCode(65 + t) + "\uff0e", s = String.fromCharCode(65 + t); const i = new RegExp(`^${a}|^${n}|^${r}|^${s}`); if (!e[t].match(i)) return !1; e[t] = e[t].replace(i, "").trim(); } return e; } const formatDate = e => new Date(e).toISOString().replace("T", " ").substring(0, 19); const Ft = { "\u5355\u9009\u9898": "0", "\u591a\u9009\u9898": "1", "\u586b\u7a7a\u9898": "2", "\u5224\u65ad\u9898": "3", "\u7b80\u7b54\u9898": "4", "\u95ee\u7b54\u9898": "4", "\u540d\u8bcd\u89e3\u91ca": "5", "\u8bba\u8ff0\u9898": "6", "\u8ba1\u7b97\u9898": "7", "\u5206\u5f55\u9898": "9", "\u8d44\u6599\u9898": "10", "\u8fde\u7ebf\u9898": "11", "\u5339\u914d\u9898": "11", "\u6392\u5e8f\u9898": "13", "\u5b8c\u578b\u586b\u7a7a": "14", "\u5b8c\u5f62\u586b\u7a7a\u9898": "14", "\u9605\u8bfb\u7406\u89e3": "15", "\u7a0b\u5e8f\u9898": "17", "\u53e3\u8bed\u9898": "18", "\u542c\u529b\u9898": "19", "\u5171\u7528\u9009\u9879\u9898": "20", "\u6d4b\u8bc4\u9898": "21", "\u949f\u8868\u9898": "23", "\u9009\u8bcd\u586b\u7a7a": "24", "\u9009\u505a\u9898": "25", "\u5176\u5b83": "8" }, Dt = function(e) { let t = ""; for (;t.length < e; t += Math.random().toString(36).substr(2)) ; return t.substr(0, e); }(9) + "_", Nt = se; ce.ksv = qe(Nt.script.author + Nt.script.name.replace(/server:/, "").trim()); const Rt = { home: { page: "overview", subPage: "" }, Base: { page: "system", subPage: "settings" }, question: { page: "library", subPage: "manage" }, preview: { page: "library", subPage: "preview" }, questionTool: { page: "library", subPage: "tool" }, log: { page: "system", subPage: "logs" }, user: { page: "system", subPage: "account" } }; function resolveNextPage(e, t) { return void 0 !== Rt[e] ? Rt[e] : { page: e, subPage: t ?? "" }; } function normalizeDialogWidth(e) { const t = "number" == typeof e ? e : Number(e); return Number.isFinite(t) ? Math.max(480, Math.min(1200, Math.round(t))) : 480; } const Bt = { debug: !0, searchApi: [], defaultShowFloat: !1, showFloat: !1, showBoard: !0, checkUpdate: !0, hideFloat: !1, alert: "\u70b9\u6211\u6709\u60ca\u559c", alertBubble: !0, iframe: !1, key: "", gpt: [], gptIndex: 0, askGpt: !1, hotkey: "Ctrl+Shift+H", hotkeyEnabled: !0, theme: "auto", page: "overview", subPage: "", dialogWidth: 480 }; const Gt = function() { const e = Cache.get("app") || {}, t = { ...Bt }; for (const [a, n] of Object.entries(e)) "gpt" !== a && "alert" !== a && void 0 !== n && (t[a] = n); if (e.gpt) { const a = new Map; e.gpt.forEach((e => { a.set(e.name, e.key); })), t.gpt = Bt.gpt.map((e => ({ ...e, key: a.get(e.name) || "" }))); } return t.alert = Bt.alert, t.gptIndex >= t.gpt.length && (t.gptIndex = 0), t.dialogWidth = normalizeDialogWidth(t.dialogWidth), t; }(); function getApp() { return Cache.get("app") || Bt; } !function(e) { const t = { ...Cache.get("app"), ...e }; Cache.set("app", t); }(Gt); const Vt = { display: [ { type: "switch", label: "\u9ed8\u8ba4\u663e\u793a\u60ac\u6d6e", name: "defaultShowFloat", value: Gt.defaultShowFloat, desc: "\u6253\u5f00\u9875\u9762\u65f6\u662f\u5426\u663e\u793a\u60ac\u6d6e\u7a97", options: [] }, { type: "switch", label: "\u5f3a\u5236\u9690\u85cf", name: "hideFloat", value: Gt.hideFloat, desc: "\u4ec5\u70ed\u952e\u6216\u70b9\u51fb\u53f3\u4e0b\u89d2\u56fe\u7247\u624d\u663e\u793a\u60ac\u6d6e\u7a97", options: [] }, { type: "switch", label: "\u6c14\u6ce1\u63d0\u793a", name: "alertBubble", value: Gt.alertBubble, desc: "\u53f3\u4e0b\u89d2\u6c14\u6ce1\u63d0\u793a\u662f\u5426\u5f00\u542f", options: [] } ], system: [ { type: "switch", label: "\u68c0\u6d4b\u66f4\u65b0", name: "checkUpdate", value: Gt.checkUpdate, desc: "\u6253\u5f00\u9875\u9762\u65f6\u662f\u5426\u68c0\u6d4b\u66f4\u65b0", options: [] }, { type: "switch", label: "iframe\u4f18\u5316(\u6d4b\u8bd5)", name: "iframe", value: Gt.iframe, desc: "\u9488\u5bf9\u6df1\u5ea6\u5d4c\u5957\u7f51\u9875\u7684\u4f18\u5316\uff0c\u9002\u5408\u5355\u4efb\u52a1\u9875\u4f7f\u7528\uff0c\u591a\u4efb\u52a1\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5f39\u7a97\u8fc7\u591a\u3002\n \u6ce8\u610f\uff1a\u8be5\u529f\u80fd\u4e3a\u6d4b\u8bd5\u529f\u80fd\uff0c\u53ef\u80fd\u5b58\u5728\u672a\u77e5\u95ee\u9898\uff0c\u8bf7\u8c28\u614e\u4f7f\u7528", options: [] } ], ai: [], hotkey: [ { type: "switch", label: "\u542f\u7528\u5feb\u6377\u952e", name: "hotkeyEnabled", value: Gt.hotkeyEnabled, desc: "\u662f\u5426\u542f\u7528\u5feb\u6377\u952e\u663e\u9690\u60ac\u6d6e\u7a97", options: [] }, { type: "hotkey", label: "\u5feb\u6377\u952e\u8bbe\u7f6e", name: "hotkey", value: Gt.hotkey, desc: "\u70b9\u51fb\u8f93\u5165\u6846\u540e\u6309\u4e0b\u60f3\u8981\u8bbe\u7f6e\u7684\u5feb\u6377\u952e\u7ec4\u5408\uff08\u652f\u6301Ctrl\u3001Shift\u3001Alt\u7ec4\u5408\u952e\uff09", options: [] } ] }, Kt = defineStore("app", { state: () => { const e = resolveNextPage(Gt.page, Gt.subPage); return { app: Gt, script: Nt.script, page: e.page, subPage: e.subPage, ConfigInput: Vt, activeSettingSection: "", logs: [ { time: (new Date).toLocaleString(), type: "success", content: "\u521d\u59cb\u5316\u65e5\u5fd7\u6210\u529f" } ] }; }, actions: { setConfig(e) { const t = { ...this.app, ...e }; "dialogWidth" in e && (t.dialogWidth = normalizeDialogWidth(e.dialogWidth)), this.app = t, Cache.set("app", this.app); }, setPage(e, t) { const a = resolveNextPage(e, t); this.page = a.page, this.subPage = a.subPage, this.app = { ...this.app, page: a.page, subPage: a.subPage }, Cache.set("app", this.app); }, setActiveSettingSection(e) { this.activeSettingSection = e; }, setDialogWidth(e) { const t = normalizeDialogWidth(e); this.app.dialogWidth = t, Cache.set("app", this.app); }, addLog(e) { this.logs.length > 100 && this.logs.shift(), this.logs.push(e); } } }), Wt = Cache.get("apiList", []), Qt = [ { name: "\u4e00\u4e4b\u9898\u5e93", url: "http://cx.icodef.com/wyn-nb?v=4", method: "POST", type: "json", headers: {}, params: [], data: { question: "$question", options: "$options", type: "$type" }, response: { type: "field", value: "data" }, weight: 0 } ], Jt = defineStore("api", { state: () => ({ apiList: Wt, defApiList: Qt }), actions: {}, getters: { getApiList() { return this.apiList.forEach(((e, t) => { e.name === this.defApiList[t].name && (this.defApiList[t] = e); })), this.apiList.concat(this.defApiList); } } }), Xt = [ "AI_CONFIG_MISSING", "AI_PROVIDER_DISABLED", "AI_CREDENTIAL_MISSING", "AI_AUTH_FAILED", "AI_REQUEST_TIMEOUT", "AI_NETWORK_FAILED", "AI_RESPONSE_PARSE_FAILED", "AI_SSE_PARSE_FAILED", "AI_OUTPUT_SCHEMA_INVALID", "AI_ANSWER_NOT_MATCHED", "AI_QUESTION_TYPE_UNSUPPORTED", "AI_IMAGE_UNSUPPORTED" ], Yt = { AI_CONFIG_MISSING: "AI \u914d\u7f6e\u4e0d\u5b58\u5728\uff0c\u8bf7\u5148\u5b8c\u6210\u914d\u7f6e", AI_PROVIDER_DISABLED: "AI \u5e73\u53f0\u5df2\u505c\u7528\uff0c\u8bf7\u542f\u7528\u540e\u91cd\u8bd5", AI_CREDENTIAL_MISSING: "AI \u51ed\u8bc1\u7f3a\u5931\uff0c\u8bf7\u586b\u5199 API Key \u6216\u6388\u6743\u4fe1\u606f", AI_AUTH_FAILED: "AI \u9274\u6743\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u51ed\u8bc1\u662f\u5426\u6709\u6548", AI_REQUEST_TIMEOUT: "AI \u8bf7\u6c42\u8d85\u65f6\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", AI_NETWORK_FAILED: "AI \u8bf7\u6c42\u7f51\u7edc\u5f02\u5e38\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u540e\u91cd\u8bd5", AI_RESPONSE_PARSE_FAILED: "AI \u54cd\u5e94\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", AI_SSE_PARSE_FAILED: "AI \u6d41\u5f0f\u54cd\u5e94\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", AI_OUTPUT_SCHEMA_INVALID: "AI \u8f93\u51fa\u683c\u5f0f\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u8bf7\u91cd\u8bd5", AI_ANSWER_NOT_MATCHED: "AI \u7b54\u6848\u672a\u80fd\u5339\u914d\u5f53\u524d\u9898\u76ee", AI_QUESTION_TYPE_UNSUPPORTED: "AI \u6682\u4e0d\u652f\u6301\u5f53\u524d\u9898\u578b", AI_IMAGE_UNSUPPORTED: "AI \u6682\u4e0d\u652f\u6301\u56fe\u7247\u9898\u76ee" }; function createAiError(e, t = {}) { const a = t.userMessage || Yt[e], n = new Error(`[${e}] ${a}`, void 0 === t.cause ? void 0 : { cause: t.cause }); return n.name = "AiError", n.code = e, n.userMessage = a, void 0 !== t.detail && (n.detail = t.detail), n; } const isAiError = e => "object" == typeof e && null !== e && "AiError" === e.name && "string" == typeof e.code && Xt.includes(e.code) && "string" == typeof e.message && "string" == typeof e.userMessage, getAiErrorMessage = e => isAiError(e) ? e.userMessage : e instanceof Error && e.message ? e.message : "AI \u8bf7\u6c42\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", parseSsePackets = e => { const t = []; for (const n of e.split(/\r?\n/)) { const e = n.trim(); if (!e.startsWith("data:")) continue; const r = e.slice(5).trim(); if (r && "[DONE]" !== r) try { t.push(JSON.parse(r)); } catch (a) { throw createAiError("AI_SSE_PARSE_FAILED", { detail: { payload: r }, cause: a }); } } return t; }, createSsePacketParser = () => { let e = ""; return { push: t => (e += t, (() => { const t = [], a = e.split(/\r?\n\r?\n/); e = a.pop() || ""; for (const e of a) t.push(...parseSsePackets(e)); return t; })()), flush: () => { if (!e.trim()) return e = "", []; const t = e; return e = "", parseSsePackets(t); } }; }, getRuntime = () => globalThis, getRuntimeGmXmlhttpRequest = () => { var e; const t = "function" == typeof GM_xmlhttpRequest ? GM_xmlhttpRequest : "undefined" != typeof GM && "function" == typeof GM.xmlHttpRequest ? GM.xmlHttpRequest : void 0; if (t) return t; const a = getRuntime(); return a.GM_xmlhttpRequest || (null == (e = a.GM) ? void 0 : e.xmlHttpRequest); }, readStream = async (e, t) => { if (!e || "function" != typeof e.getReader) return; const a = e.getReader(), n = new TextDecoder; for (;;) { const {done: e, value: r} = await a.read(); if (e) break; r && t(n.decode(r, { stream: !0 })); } const r = n.decode(); r && t(r); }, createHttpStatusError = e => { const t = { status: e.status, statusText: e.statusText, responseText: e.responseText }; if (401 === e.status || 403 === e.status) return createAiError("AI_AUTH_FAILED", { detail: t }); if (e.status < 200 || e.status >= 300) { const a = (e => { if (!e) return ""; try { const t = JSON.parse(e), a = "object" == typeof t && null !== t ? t.error : void 0; if ("object" == typeof a && null !== a) { const e = a.message; if ("string" == typeof e && e.trim()) return e.trim(); } const n = "object" == typeof t && null !== t ? t.message : void 0; if ("string" == typeof n && n.trim()) return n.trim(); } catch { return e.trim(); } return ""; })(e.responseText), n = `AI \u63a5\u53e3\u8fd4\u56de ${e.status} ${e.statusText || ""}`.trim(); return createAiError("AI_NETWORK_FAILED", { detail: t, userMessage: a ? `${n}\uff1a${a}` : `${n}\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5` }); } }, stringifyHeaders = e => { const t = []; return e.forEach(((e, a) => t.push(`${a}: ${e}`))), t.join("\r\n"); }, createAiTransportRequest = e => { var t; const a = (null == (t = e.resolveGmXmlhttpRequest) ? void 0 : t.call(e)) || getRuntimeGmXmlhttpRequest(); if (!a) { const t = (() => { const e = getRuntime(); if ("function" == typeof e.fetch) return e.fetch.bind(e); })(); return t ? ((e, t) => { const a = "function" == typeof AbortController ? new AbortController : void 0; let r, s, rejectTransport = () => {}; const createBaseResponse = (t, a, n = "") => ({ finalUrl: t.url || e.url, response: a, responseHeaders: stringifyHeaders(t.headers), responseText: n, status: t.status, statusText: t.statusText }); return { promise: new Promise(((i, o) => { rejectTransport = o, e.timeout && a && (s = setTimeout((() => { r = "timeout", a.abort(); }), e.timeout)), (async () => { try { const r = await t(e.url, { method: e.method, headers: e.headers, body: e.data ?? void 0, signal: null == a ? void 0 : a.signal }), s = createBaseResponse(r, void 0), l = createHttpStatusError(s); if (l) return void o(l); if ("stream" === e.responseType && e.onStreamChunk) { try { await readStream(r.body, e.onStreamChunk); } catch (n) { return void o(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u6d41\u5f0f\u54cd\u5e94\u8bfb\u53d6\u5931\u8d25", cause: n })); } return void i(createBaseResponse(r, r.body)); } const c = await r.text(); i(createBaseResponse(r, c, c)); } catch (n) { if ("timeout" === r) return void o(createAiError("AI_REQUEST_TIMEOUT")); if ("manual" === r) return void o(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })); o(createAiError("AI_NETWORK_FAILED", { cause: n })); } finally { s && clearTimeout(s); } })(); })), abort: () => { r = "manual", null == a || a.abort(), rejectTransport(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })); } }; })(e, t) : (n = createAiError("AI_NETWORK_FAILED", { userMessage: "\u5f53\u524d\u8fd0\u884c\u73af\u5883\u4e0d\u652f\u6301 GM_xmlhttpRequest" }), { promise: Promise.reject(n), abort: () => {} }); } var n; let r, s, i, rejectTransport = () => {}, o = !1, l = !1, c = !1; const p = new Promise(((t, n) => { const rejectOnce = e => { o || (o = !0, n(e)); }; rejectTransport = rejectOnce; const resolveOnce = e => { if (o) return; const a = createHttpStatusError(e); a ? rejectOnce(a) : (o = !0, t(e)); }; r = a({ method: e.method, url: e.url, headers: e.headers, data: e.data, timeout: e.timeout, responseType: e.responseType, onloadstart: t => { e.onStreamChunk && "stream" === e.responseType && (s = readStream(t.response, e.onStreamChunk).then((() => { l = !0; })).catch((e => { l = !0, c = !0, i = e; }))); }, onload: t => { const a = createHttpStatusError(t); if (a) return void rejectOnce(a); if ("stream" !== e.responseType || !e.onStreamChunk) return void resolveOnce(t); const n = s || readStream(t.response, e.onStreamChunk).then((() => { l = !0; })).catch((e => { l = !0, c = !0, i = e; })); if (s = n, l) return c ? void rejectOnce(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u6d41\u5f0f\u54cd\u5e94\u8bfb\u53d6\u5931\u8d25", cause: i })) : void resolveOnce(t); n.then((() => { c ? rejectOnce(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u6d41\u5f0f\u54cd\u5e94\u8bfb\u53d6\u5931\u8d25", cause: i })) : resolveOnce(t); })); }, onabort: () => rejectOnce(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })), ontimeout: () => rejectOnce(createAiError("AI_REQUEST_TIMEOUT")), onerror: e => rejectOnce(createAiError("AI_NETWORK_FAILED", { cause: e })) }); })); return { promise: p, abort: () => { null == r || r.abort(), rejectTransport(createAiError("AI_NETWORK_FAILED", { userMessage: "AI \u8bf7\u6c42\u5df2\u53d6\u6d88" })); } }; }, createAnthropicBody = e => { const t = e.messages.filter((e => "system" === e.role)).map((e => e.content)).join("\n"), a = { model: e.config.model, messages: e.messages.filter((e => "system" !== e.role)).map((e => ({ role: e.role, content: e.content }))), stream: !1 }; return t && (a.system = t), void 0 !== e.config.temperature && (a.temperature = e.config.temperature), a.max_tokens = e.config.maxTokens ?? 1024, a; }, createOpenAiBody = e => { const t = { model: e.config.model, messages: e.messages, stream: e.stream }; return void 0 !== e.config.temperature && (t.temperature = e.config.temperature), void 0 !== e.config.maxTokens && (t.max_tokens = e.config.maxTokens), t; }, normalizeOpenAiChunk = e => { const t = null == e ? void 0 : e.choices; return Array.isArray(t) ? t.map((e => { var t; return null == (t = e.delta) ? void 0 : t.content; })).filter((e => "string" == typeof e)).join("") : ""; }, Zt = ((e = {}) => { const t = e.transport || createAiTransportRequest; return { id: e.id || "openai-compatible", chat: async e => { var a, n; (e => { var t; if (!e.enabled) throw createAiError("AI_PROVIDER_DISABLED"); if (!(null == (t = e.credential) ? void 0 : t.value.trim())) throw createAiError("AI_CREDENTIAL_MISSING"); })(e.config); const r = Date.now(), s = `${(e => e.replace(/\/+$/, ""))(e.config.baseUrl)}/chat/completions`, i = { Authorization: `Bearer ${(null == (a = e.config.credential) ? void 0 : a.value) || ""}`, "Content-Type": "application/json", Accept: "application/json" }; let o = ""; const l = createSsePacketParser(), c = t({ method: "POST", url: s, headers: i, data: JSON.stringify(createOpenAiBody(e)), timeout: e.config.timeout, responseType: e.stream ? "stream" : "json", onStreamChunk: e.stream ? t => { var a; const n = l; for (const r of n.push(t)) { const t = normalizeOpenAiChunk(r); t && (o += t, null == (a = e.onToken) || a.call(e, t)); } } : void 0 }), p = ((e, t) => { if (!e) return; const abortRequest = () => t(); if (!e.aborted) return e.addEventListener("abort", abortRequest, { once: !0 }), () => e.removeEventListener("abort", abortRequest); abortRequest(); })(e.signal, c.abort); try { const t = await c.promise; if (e.stream) { for (const t of l.flush()) { const a = normalizeOpenAiChunk(t); a && (o += a, null == (n = e.onToken) || n.call(e, a)); } if (!o) throw createAiError("AI_RESPONSE_PARSE_FAILED"); } else o = (e => { var t, a, n; const r = null == (n = null == (a = null == (t = null == e ? void 0 : e.choices) ? void 0 : t[0]) ? void 0 : a.message) ? void 0 : n.content; if ("string" != typeof r || !r) throw createAiError("AI_RESPONSE_PARSE_FAILED"); return r; })((e => { try { if ("string" == typeof e.response) { if (!e.response) return; return JSON.parse(e.response); } return void 0 !== e.response && null !== e.response ? e.response : e.responseText ? JSON.parse(e.responseText) : void 0; } catch (t) { throw createAiError("AI_RESPONSE_PARSE_FAILED", { cause: t }); } })(t)); return { text: o, raw: t.response, duration: Date.now() - r }; } finally { null == p || p(); } } }; })(), ea = ((e = {}) => { const t = e.transport || createAiTransportRequest; return { id: "anthropic-messages", chat: async e => { var a; (e => { var t; if (!e.enabled) throw createAiError("AI_PROVIDER_DISABLED"); if (!(null == (t = e.credential) ? void 0 : t.value.trim())) throw createAiError("AI_CREDENTIAL_MISSING"); })(e.config); const n = Date.now(), r = t({ method: "POST", url: `${s = e.config.baseUrl, s.replace(/\/+$/, "")}/messages`, headers: { "x-api-key": (null == (a = e.config.credential) ? void 0 : a.value) || "", "anthropic-version": "2023-06-01", "Content-Type": "application/json" }, data: JSON.stringify(createAnthropicBody(e)), timeout: e.config.timeout, responseType: "json" }); var s; const i = ((e, t) => { if (!e) return; const abortRequest = () => t(); if (!e.aborted) return e.addEventListener("abort", abortRequest, { once: !0 }), () => e.removeEventListener("abort", abortRequest); abortRequest(); })(e.signal, r.abort); try { const e = await r.promise, t = (e => { const t = null == e ? void 0 : e.content; if (!Array.isArray(t)) throw createAiError("AI_RESPONSE_PARSE_FAILED"); const a = t.map((e => e.text)).filter((e => "string" == typeof e)).join(""); if (!a) throw createAiError("AI_RESPONSE_PARSE_FAILED"); return a; })((e => { try { if ("string" == typeof e.response) { if (!e.response) return; return JSON.parse(e.response); } return void 0 !== e.response && null !== e.response ? e.response : e.responseText ? JSON.parse(e.responseText) : void 0; } catch (t) { throw createAiError("AI_RESPONSE_PARSE_FAILED", { cause: t }); } })(e)); return { text: t, raw: e.response, duration: Date.now() - n }; } finally { null == i || i(); } } }; })(), ta = { 0: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u5355\u9009\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u9009\u9879\u5b57\u6bcd"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u9009\u9879\u5b57\u6bcd\u5fc5\u987b\u5927\u5199\uff0c\u6570\u7ec4\u4e2d\u53ea\u80fd\u6709 1 \u4e2a\u5143\u7d20\u3002\n2. \u4e0d\u591f\u786e\u5b9a\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 1: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u591a\u9009\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u9009\u9879\u5b57\u6bcd"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u9009\u9879\u5b57\u6bcd\u5fc5\u987b\u5927\u5199\uff0c\u5e76\u6309\u5b57\u6bcd\u5347\u5e8f\u6392\u5e8f\u3002\n2. \u81f3\u5c11\u4e24\u4e2a\u9009\u9879\u624d\u7b97\u6709\u6548\uff0c\u4e0d\u786e\u5b9a\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 2: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u586b\u7a7a\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":["\u7b54\u68481","\u7b54\u68482"]}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u7b54\u6848\u6570\u91cf\u5fc5\u987b\u5339\u914d\u9898\u76ee\u7a7a\u683c\u6570\uff0c\u4e0d\u5f97\u7f3a\u5931\u6216\u591a\u586b\u3002\n2. \u4e0d\u591f\u786e\u5b9a\u65f6\u8fd4\u56de\u7a7a\u6570\u7ec4\uff1a{"answer":[]}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 3: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u5224\u65ad\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":"\u6b63\u786e"}\n\u6216\n{"answer":"\u9519\u8bef"}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. answer \u53ea\u80fd\u662f\u201c\u6b63\u786e\u201d\u6216\u201c\u9519\u8bef\u201d\uff0c\u4e0d\u786e\u5b9a\u65f6\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\uff1a{"answer":""}\n2. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002', 4: '\u4f60\u53ea\u4f5c\u4e3a\u201cJSON \u8f93\u51fa\u673a\u5668\u201d\u5de5\u4f5c\uff0c\u56de\u7b54\u65f6\u4ec5\u8f93\u51fa\u4e00\u884c JSON\uff0c\u7981\u6b62\u51fa\u73b0\u9664 JSON \u4ee5\u5916\u7684\u4efb\u4f55\u7b26\u53f7\u3001\u8bf4\u660e\u6216\u7a7a\u884c\u3002\n\n\u3010\u9898\u578b\u3011\u7b80\u7b54\u9898\n\n\u3010\u552f\u4e00\u5141\u8bb8\u7684\u8f93\u51fa\u683c\u5f0f\u3011\n{"answer":"\u7cbe\u7b80\u7684\u7b54\u6848"}\n\n\u3010\u5f3a\u5236\u89c4\u5219\u3011\n1. \u76f4\u63a5\u7ed9\u51fa\u7cbe\u7b80\u7b54\u6848\uff0c\u4e0d\u8981\u8d58\u8ff0\u3002\n2. \u4e0d\u591f\u786e\u5b9a\u65f6\u8f93\u51fa\u7a7a\u5b57\u7b26\u4e32\uff1a{"answer":""}\n3. \u8f93\u51fa\u4f1a\u88ab JSON.parse \u76f4\u63a5\u89e3\u6790\uff0c\u51fa\u73b0\u4efb\u4f55\u975e JSON \u5185\u5bb9\u89c6\u4e3a\u5931\u8d25\u3002' }, buildAiMessages = (e, t, a = "4") => [ { role: "system", content: "ask" === e ? ta[a] || ta[4] : "repair" === e ? "\u4f60\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684\u7b54\u9898\u52a9\u624b\uff0c\u8bf7\u4fee\u590d\u7b54\u6848\u4e2d\u7f3a\u5931\u3001\u683c\u5f0f\u9519\u8bef\u6216\u8868\u8ff0\u4e0d\u6e05\u7684\u5185\u5bb9\u3002\u8f93\u51fa\u5e94\u4ee5\u4fee\u590d\u7b54\u6848\u4e3a\u4e3b\uff0c\u4fdd\u6301\u51c6\u786e\u3001\u7b80\u6d01\uff0c\u5e76\u907f\u514d\u65e0\u5173\u89e3\u91ca\u3002" : "\u4f60\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684\u7b54\u9898\u52a9\u624b\uff0c\u8bf7\u6839\u636e\u7528\u6237\u63d0\u4f9b\u7684\u9898\u76ee\u8fdb\u884c\u89e3\u7b54\u3002\u56de\u7b54\u5e94\u51c6\u786e\u3001\u7b80\u6d01\uff0c\u5fc5\u8981\u65f6\u7ed9\u51fa\u7b80\u8981\u7406\u7531\u3002" }, { role: "user", content: t } ], runAiScene = async (e, t, a, n = {}) => { var r; if (!t) return (() => { const e = createAiError("AI_CONFIG_MISSING", { userMessage: "AI \u914d\u7f6e\u7f3a\u5931\uff0c\u8bf7\u5148\u5b8c\u6210\u914d\u7f6e" }); return { success: !1, text: "", duration: 0, error: e, displayMessage: getAiErrorMessage(e) }; })(); try { const s = n.provider || (null == (r = n.resolveProvider) ? void 0 : r.call(n, t)) || (e => { switch (e) { case "openai-compatible": return Zt; case "anthropic-messages": return ea; } })(t.providerKind), i = await s.chat({ config: t, messages: buildAiMessages(e, a, n.questionType), stream: n.stream ?? t.stream, onToken: n.onToken, signal: n.signal }); return { success: !0, text: i.text, duration: i.duration }; } catch (s) { const e = isAiError(s) ? s : createAiError("AI_NETWORK_FAILED", { cause: s }); return { success: !1, text: "", duration: 0, error: e, displayMessage: getAiErrorMessage(e) }; } }, aa = new Set([ "4", "5", "6", "7" ]), invalid = (e, t, a) => ({ valid: !1, answer: [], raw: t, error: createAiError(e, { detail: a }) }), extractCodeBlockJson = e => { var t; const a = e.match(/```(?:json)?\s*([\s\S]*?)```/i); return null == (t = null == a ? void 0 : a[1]) ? void 0 : t.trim(); }, findJsonObjectText = e => { const t = e.indexOf("{"); if (t < 0) return; let a = 0, n = !1, r = !1; for (let s = t; s < e.length; s++) { const i = e[s]; if (r) r = !1; else if ("\\" !== i) if ('"' !== i) { if (!n && ("{" === i && a++, "}" === i && a--, 0 === a)) return e.slice(t, s + 1); } else n = !n; else r = !0; } return e.slice(t); }, normalizeTextAnswer = e => { if ("string" != typeof e) return; return e.trim() || void 0; }, normalizeTextArray = e => { if (!Array.isArray(e)) return; const t = e.map((e => "string" == typeof e ? e.trim() : "")).filter(Boolean); return t.length === e.length ? t : void 0; }, parseMultipleChoice = (e, t, a) => { const n = normalizeTextArray(e) || (e => { const t = normalizeTextAnswer(e); if (!t) return; const a = splitAnswerText(t, /[\n,\uff0c\u3001;\uff1b]+/); return a.length > 1 ? a : void 0; })(e); if (!n || n.length < 2) return invalid("AI_OUTPUT_SCHEMA_INVALID", t); if (new Set(n.map((e => e.trim().toUpperCase()))).size !== n.length) return invalid("AI_ANSWER_NOT_MATCHED", t, { answer: n }); const r = n.map((e => mapChoiceValueToOption(e, a.options))); return r.some((e => !e)) ? invalid("AI_ANSWER_NOT_MATCHED", t, { answer: n }) : { valid: !0, answer: r, raw: t }; }, parseAiAnswer = (e, t) => { const a = (e => { const t = [ e.trim(), extractCodeBlockJson(e), findJsonObjectText(e) ].filter((e => Boolean(e))); for (const n of t) try { return { ok: !0, value: JSON.parse(n) }; } catch (a) { if (n === t[t.length - 1]) return { ok: !1, cause: a }; } return { ok: !1 }; })(e); if (!a.ok) return { valid: !1, answer: [], error: createAiError("AI_RESPONSE_PARSE_FAILED", { cause: a.cause }) }; const n = a.value, r = (e => { if ("object" == typeof e && null !== e && "answer" in e) return e.answer; })(n); return void 0 === r ? invalid("AI_OUTPUT_SCHEMA_INVALID", n) : "0" === t.type ? ((e, t, a) => { const n = Array.isArray(e) ? normalizeTextArray(e) : [ normalizeTextAnswer(e) ].filter((e => Boolean(e))); if (!n || 1 !== n.length) return invalid("AI_OUTPUT_SCHEMA_INVALID", t); const r = mapChoiceValueToOption(n[0], a.options); return r ? { valid: !0, answer: [ r ], raw: t } : invalid("AI_ANSWER_NOT_MATCHED", t, { answer: n[0] }); })(r, n, t) : "1" === t.type ? parseMultipleChoice(r, n, t) : "2" === t.type ? ((e, t, a) => { const n = normalizeTextArray(e); return n ? a.blankCount > 0 && n.length !== a.blankCount || 0 === a.blankCount && 0 === n.length ? invalid("AI_OUTPUT_SCHEMA_INVALID", t) : { valid: !0, answer: n, raw: t } : invalid("AI_OUTPUT_SCHEMA_INVALID", t); })(r, n, t) : "3" === t.type ? ((e, t) => { const a = normalizeTextAnswer(e); return "\u6b63\u786e" !== a && "\u9519\u8bef" !== a ? invalid("AI_OUTPUT_SCHEMA_INVALID", t) : { valid: !0, answer: [ a ], raw: t }; })(r, n) : aa.has(t.type) ? ((e, t) => { const a = normalizeTextAnswer(e); return a ? { valid: !0, answer: [ a ], raw: t } : invalid("AI_OUTPUT_SCHEMA_INVALID", t); })(r, n) : invalid("AI_QUESTION_TYPE_UNSUPPORTED", n, { type: t.type }); }, hasUnsupportedMedia = e => /<\s*img\b/i.test(e) || /<\s*(?:svg|image)\b/i.test(e) || /<\s*math\b/i.test(e) || /<\s*script\b[^>]*type\s*=\s*["']?math\/tex/i.test(e) || hasUnsupportedMathClass(e) || /!\[[^\]]*]\([^)]*\)/.test(e) || /\$\$/.test(e) || /(^|[^\w\d])\$[^\s$][^$\n]*\$(?!\d)/.test(e) || /\\\(/.test(e) || /\\\[/.test(e), hasUnsupportedMathClass = e => { for (const t of e.matchAll(/class\s*=\s*["']([^"']*)["']/g)) { if (t[1].split(/\s+/).filter(Boolean).some((e => "MathJax" === e || e.startsWith("MathJax_") || "katex" === e || e.startsWith("katex-") || e.startsWith("mjx-")))) return !0; } return !1; }, na = /^([A-Ha-h\uff21-\uff28\uff41-\uff48])(?:\s*[.\uff0e\u3002\u3001)\uff09]\s*|\s+)(.+)$/, ra = /^(\u7b54\u6848|\u89e3\u6790|\u63d0\u793a)\s*[:\uff1a]/, sa = /^((\d+|[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e\u5343\u4e07]+)[\s.\uff0e\u3002\u3001)\uff09]+)+/, cleanQuestionPrefix = e => e.replace(sa, "").trim(), normalizeOption = e => e.replace(/\s+/g, ""), detectAiQuestionType = (e, t) => { const a = e.replace(/\s/g, ""); return (e => { if (2 !== e.length) return !1; const t = e.map(normalizeOption), a = new Set(t); return 2 === a.size && (a.has("\u6b63\u786e") && a.has("\u9519\u8bef") || a.has("\u5bf9") && a.has("\u9519")); })(t) ? "3" : /\u591a\u9009|\u591a\u9879|\u4e0d\u5b9a\u9879|\u9009\u62e9[\u4e24\u4e8c2]\u9879|\u9009\u62e9[\u4e24\u4e8c2]\u4e2a/.test(a) ? "1" : t.length > 0 ? "0" : (e => /(^|[\uff0c\u3002\uff1b;\uff01\uff1f?])\u5224\u65ad($|[\s\u3000\uff1a:\u9898]|\u4e0b\u5217|\u4ee5\u4e0b)/.test(e) || /\u8bf7\u5224\u65ad|\u6b63\u8bef|\u5bf9\u9519|\u662f\u975e/.test(e.replace(/\s/g, "")))(e) ? "3" : /\u586b\u7a7a|\u7a7a\u683c|\u586b\u8865|\u62ec\u53f7\u7a7a/.test(a) || /\uff08\s*\uff09|\(\s*\)/.test(e) ? "2" : /\u7b80\u7b54|\u7b80\u8ff0|\u8bba\u8ff0|\u8bf4\u660e|\u5206\u6790|\u4e3a\u4f55|\u4e3a\u4ec0\u4e48/.test(a) ? "4" : "8"; }, withKeyHelp = e => ({ ...e, keyHelp: e.keyHelp || `\u767b\u5f55 ${e.name} \u63a7\u5236\u53f0\uff0c\u5728 API Key \u9875\u9762\u521b\u5efa\u6216\u590d\u5236 API Key\u3002` }), ia = [ withKeyHelp({ id: "deepseek", name: "DeepSeek", providerKind: "openai-compatible", baseUrl: "https://api.deepseek.com", defaultModel: "deepseek-v4-flash", models: [ "deepseek-v4-flash", "deepseek-v4-pro", "deepseek-chat", "deepseek-reasoner" ], stream: !0, credentialType: "api-key", docUrl: "https://api-docs.deepseek.com/api/create-chat-completion", keyUrl: "https://platform.deepseek.com/api_keys", region: "domestic" }), withKeyHelp({ id: "qwen-dashscope", name: "\u901a\u4e49\u5343\u95ee / \u767e\u70bc", providerKind: "openai-compatible", baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1", defaultModel: "qwen3.6-plus", models: [ "qwen3.6-plus", "qwen3.6-flash", "qwen3.6-max-preview", "qwen-plus", "qwen-turbo" ], stream: !0, credentialType: "api-key", docUrl: "https://help.aliyun.com/zh/model-studio/use-qwen-by-calling-api", keyUrl: "https://help.aliyun.com/zh/model-studio/get-api-key", region: "domestic" }), withKeyHelp({ id: "zhipu-glm", name: "\u667a\u8c31 GLM", providerKind: "openai-compatible", baseUrl: "https://open.bigmodel.cn/api/paas/v4", defaultModel: "glm-4.7", models: [ "glm-4.7", "glm-4.7-flash", "glm-4.7-flashx", "glm-4.6", "glm-4.5-flash" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.bigmodel.cn/api-reference", keyUrl: "https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys", region: "domestic" }), withKeyHelp({ id: "baidu-qianfan", name: "\u767e\u5ea6\u5343\u5e06", providerKind: "openai-compatible", baseUrl: "https://qianfan.baidubce.com/v2", defaultModel: "ernie-4.5-turbo-128k", models: [ "ernie-4.5-turbo-128k", "ernie-5.0", "ernie-5.0-thinking-latest", "ernie-speed-pro-128k", "deepseek-v3.2" ], stream: !0, credentialType: "api-key", docUrl: "https://cloud.baidu.com/doc/qianfan-docs/s/7m95lyy43", keyUrl: "https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application", region: "domestic" }), withKeyHelp({ id: "volc-ark", name: "\u706b\u5c71\u65b9\u821f / \u8c46\u5305", providerKind: "openai-compatible", baseUrl: "https://ark.cn-beijing.volces.com/api/v3", defaultModel: "doubao-seed-1-6-251015", models: [ "doubao-seed-1-6-251015", "doubao-seed-1-6", "doubao-seed-1-6-thinking", "doubao-seed-1-6-flash", "doubao-seed-code" ], stream: !0, credentialType: "api-key", docUrl: "https://www.volcengine.com/docs/82379/1330310", keyUrl: "https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey", region: "domestic" }), withKeyHelp({ id: "tencent-hunyuan", name: "\u817e\u8baf\u6df7\u5143", providerKind: "openai-compatible", baseUrl: "https://api.hunyuan.cloud.tencent.com/v1", defaultModel: "hunyuan-2.0-instruct-20251111", models: [ "hunyuan-2.0-instruct-20251111", "hunyuan-2.0-thinking-20251109", "hunyuan-t1-latest", "hunyuan-turbos-latest" ], stream: !0, credentialType: "api-key", docUrl: "https://cloud.tencent.com/document/product/1729/111007", keyUrl: "https://console.cloud.tencent.com/hunyuan/api-key", region: "domestic" }), withKeyHelp({ id: "longcat", name: "LongCat", providerKind: "openai-compatible", baseUrl: "https://api.longcat.chat/openai", defaultModel: "LongCat-Flash-Chat", models: [ "LongCat-Flash-Chat", "LongCat-Flash-Thinking-2601", "LongCat-Flash-Lite", "LongCat-Flash-Omni-2603", "LongCat-Flash-Chat-2602-Exp", "LongCat-2.0-Preview" ], stream: !0, credentialType: "api-key", docUrl: "https://longcat.chat/platform/docs/zh/", keyUrl: "https://longcat.chat/platform/api_keys", keyHelp: "\u767b\u5f55 LongCat API \u5f00\u653e\u5e73\u53f0\uff0c\u5728 API Keys \u9875\u9762\u70b9\u51fb\u201c\u521b\u5efa API Key\u201d\u751f\u6210\u5bc6\u94a5\u3002", region: "domestic" }), withKeyHelp({ id: "kimi", name: "Kimi / Moonshot", providerKind: "openai-compatible", baseUrl: "https://api.moonshot.ai/v1", defaultModel: "kimi-k2.6", models: [ "kimi-k2.6" ], stream: !0, credentialType: "api-key", docUrl: "https://platform.kimi.ai/docs/api/overview", keyUrl: "https://platform.moonshot.cn/console/api-keys", region: "domestic" }), withKeyHelp({ id: "siliconflow", name: "SiliconFlow", providerKind: "openai-compatible", baseUrl: "https://api.siliconflow.com/v1", defaultModel: "Qwen/Qwen3-30B-A3B-Thinking-2507", models: [ "Qwen/Qwen3-30B-A3B-Thinking-2507", "Qwen/Qwen3-235B-A22B-Instruct-2507", "moonshotai/Kimi-K2.6", "deepseek-ai/DeepSeek-V3.1", "Qwen/QwQ-32B" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.siliconflow.com/en/api-reference/chat-completions/chat-completions", keyUrl: "https://cloud.siliconflow.cn/account/ak", region: "domestic" }), withKeyHelp({ id: "openai", name: "OpenAI", providerKind: "openai-compatible", baseUrl: "https://api.openai.com/v1", defaultModel: "gpt-5.2", models: [ "gpt-5.2", "gpt-5.2-pro", "gpt-5-mini", "gpt-5-nano" ], stream: !0, credentialType: "api-key", docUrl: "https://platform.openai.com/docs/models", keyUrl: "https://platform.openai.com/api-keys", region: "global" }), withKeyHelp({ id: "anthropic", name: "Anthropic Claude", providerKind: "anthropic-messages", baseUrl: "https://api.anthropic.com/v1", defaultModel: "claude-sonnet-4-20250514", models: [ "claude-sonnet-4-20250514", "claude-opus-4-1-20250805", "claude-opus-4-20250514", "claude-3-5-haiku-20241022" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.anthropic.com/en/docs/about-claude/models/all-models", keyUrl: "https://console.anthropic.com/settings/keys", region: "global" }), withKeyHelp({ id: "gemini", name: "Google Gemini", providerKind: "openai-compatible", baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai", defaultModel: "gemini-3-flash-preview", models: [ "gemini-3-flash-preview", "gemini-3-pro-preview", "gemini-2.5-flash", "gemini-2.5-pro", "gemini-2.5-flash-lite" ], stream: !0, credentialType: "api-key", docUrl: "https://ai.google.dev/gemini-api/docs/openai", keyUrl: "https://aistudio.google.com/app/apikey", region: "global" }), withKeyHelp({ id: "openrouter", name: "OpenRouter", providerKind: "openai-compatible", baseUrl: "https://openrouter.ai/api/v1", defaultModel: "openai/gpt-5.5", models: [ "openai/gpt-5.5", "openai/gpt-5.4", "google/gemini-3.1-flash-lite", "anthropic/claude-sonnet-4.6", "openai/gpt-5.2" ], stream: !0, credentialType: "api-key", docUrl: "https://openrouter.ai/docs/api-reference/chat-completion", keyUrl: "https://openrouter.ai/settings/keys", region: "global" }), withKeyHelp({ id: "groq", name: "Groq", providerKind: "openai-compatible", baseUrl: "https://api.groq.com/openai/v1", defaultModel: "openai/gpt-oss-120b", models: [ "openai/gpt-oss-120b", "openai/gpt-oss-20b", "llama-3.3-70b-versatile", "llama-3.1-8b-instant" ], stream: !0, credentialType: "api-key", docUrl: "https://console.groq.com/docs/models", keyUrl: "https://console.groq.com/keys", region: "global" }), withKeyHelp({ id: "together", name: "Together AI", providerKind: "openai-compatible", baseUrl: "https://api.together.ai/v1", defaultModel: "moonshotai/Kimi-K2.5", models: [ "moonshotai/Kimi-K2.5", "openai/gpt-oss-120b", "meta-llama/Llama-3.3-70B-Instruct-Turbo", "deepseek-ai/DeepSeek-V3.1", "zai-org/GLM-4.6" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.together.ai/docs/recommended-models", keyUrl: "https://api.together.ai/settings/api-keys", region: "global" }), withKeyHelp({ id: "mistral", name: "Mistral AI", providerKind: "openai-compatible", baseUrl: "https://api.mistral.ai/v1", defaultModel: "mistral-large-latest", models: [ "mistral-large-latest", "mistral-medium-latest", "mistral-small-latest", "magistral-medium-latest" ], stream: !0, credentialType: "api-key", docUrl: "https://docs.mistral.ai/getting-started/models", keyUrl: "https://console.mistral.ai/api-keys/", region: "global" }) ], getAiProviderPreset = e => ia.find((t => t.id === e)), createConfigFromPreset = (e, t = {}) => { const a = getAiProviderPreset(e); if (!a) throw new Error(`\u672a\u77e5 AI \u5e73\u53f0\u9884\u8bbe: ${e}`); return { id: t.id || a.id, name: t.name || a.name, providerId: a.id, providerKind: a.providerKind, baseUrl: t.baseUrl || a.baseUrl, model: t.model || a.defaultModel, enabled: t.enabled ?? !0, stream: t.stream ?? a.stream, credential: t.credential, timeout: t.timeout || 3e4, temperature: t.temperature, maxTokens: t.maxTokens }; }, createDefaultAiSettings = () => ({ configs: [ createConfigFromPreset("deepseek"), createConfigFromPreset("qwen-dashscope") ], defaultConfigId: "deepseek", enabledForAsk: !1, adoptionStrategy: "conservative", sceneOverrides: { enabled: !1 } }), oa = [ "openai-compatible", "anthropic-messages" ], la = [ "direct", "conservative", "preview" ], isRecord = e => "object" == typeof e && null !== e, isRemovedCookieProviderValue = e => "glm-cookie" === e || "spark-cookie" === e || "cookie-glm" === e || "cookie-spark" === e || "legacy-glm" === e || "legacy-spark" === e, isAdoptionStrategy = e => "string" == typeof e && la.includes(e), normalizeCredential = e => { if (isRecord(e) && "string" == typeof e.value) return { type: "api-key", value: e.value, updatedAt: "number" == typeof e.updatedAt ? e.updatedAt : void 0 }; }, normalizeAiConfig = e => { if (!isRecord(e) || "string" != typeof e.id || !e.id) return null; if (isRemovedCookieProviderValue(e.id) || isRemovedCookieProviderValue(e.providerId) || isRemovedCookieProviderValue(e.providerKind)) return null; const t = "string" == typeof e.providerId ? getAiProviderPreset(e.providerId) : getAiProviderPreset(e.id), a = (e => "string" == typeof e && oa.includes(e))(e.providerKind) ? e.providerKind : (null == t ? void 0 : t.providerKind) || "openai-compatible", n = (null == t ? void 0 : t.id) || "string" == typeof e.providerId && e.providerId || e.id, r = "number" == typeof e.timeout && Number.isFinite(e.timeout) && e.timeout > 0 ? e.timeout : 3e4; return { id: e.id, name: "string" == typeof e.name && e.name ? e.name : (null == t ? void 0 : t.name) || e.id, providerId: n, providerKind: a, baseUrl: "string" == typeof e.baseUrl && e.baseUrl ? e.baseUrl : (null == t ? void 0 : t.baseUrl) || "", model: "string" == typeof e.model && e.model ? e.model : (null == t ? void 0 : t.defaultModel) || "", enabled: "boolean" != typeof e.enabled || e.enabled, stream: "boolean" == typeof e.stream ? e.stream : (null == t ? void 0 : t.stream) ?? !0, credential: normalizeCredential(e.credential), timeout: r, temperature: "number" == typeof e.temperature ? e.temperature : void 0, maxTokens: "number" == typeof e.maxTokens ? e.maxTokens : void 0 }; }, normalizeAiSettings = e => { var t, a; if (!isRecord(e) || !Array.isArray(e.configs)) return null; const n = e.configs.map(normalizeAiConfig).filter((e => null !== e)), r = "string" == typeof e.defaultConfigId && n.some((t => t.id === e.defaultConfigId)) ? e.defaultConfigId : (null == (t = n.find((e => e.enabled))) ? void 0 : t.id) || (null == (a = n[0]) ? void 0 : a.id) || "", s = isRecord(e.sceneOverrides) ? e.sceneOverrides : {}; return { configs: n, defaultConfigId: r, enabledForAsk: n.length > 0 && "boolean" == typeof e.enabledForAsk && e.enabledForAsk, adoptionStrategy: isAdoptionStrategy(e.adoptionStrategy) ? e.adoptionStrategy : "conservative", sceneOverrides: { enabled: "boolean" == typeof s.enabled && s.enabled, search: "string" == typeof s.search ? s.search : void 0, ask: "string" == typeof s.ask ? s.ask : void 0, repair: "string" == typeof s.repair ? s.repair : void 0 } }; }, mergeLegacyAiCredentials = (e, t) => { const a = t.gpt; if (!(null == a ? void 0 : a.length)) return e; let n = !1; const r = e.configs.map((e => { var t, r; const s = ((e, t) => { const a = e.find((e => e.desc === t.name)); if (a) return a; })(a, e); if (!(null == s ? void 0 : s.key)) return e; return (null == (t = e.credential) ? void 0 : t.value) || (null == (r = e.credential) ? void 0 : r.value) === s.key ? e : (n = !0, { ...e, credential: { type: "api-key", value: s.key, updatedAt: Date.now() } }); })); return n ? { ...e, configs: r } : e; }, selectAiConfigForScene = (e, t) => { var a; const n = (null == (a = e.sceneOverrides) ? void 0 : a.enabled) ? e.sceneOverrides[t] : void 0; return e.configs.find((e => e.id === n && e.enabled)) || e.configs.find((t => t.id === e.defaultConfigId && t.enabled)) || e.configs.find((e => e.enabled)); }, markToHtml = e => simpleMarkdownToHtml(e); function getPreviewResumeAction(e, t) { const a = Math.max(t - 1, 0); return e >= a ? { shouldFinish: !0, nextIndex: a } : { shouldFinish: !1, nextIndex: e + 1 }; } function createNextRunToken(e) { return e.runToken = (e.runToken || 0) + 1, e.runToken; } function isRunTokenCurrent(e, t) { return e.runToken === t; } const noAnswerMatch = e => ({ res: [ e ], haveAnswer: !1 }), createFallbackResult = (e, t, a = 0, n = "") => { const r = { action: "mark-no-answer", answer: [] }, s = { form: e, answer: [], msg: t, duration: a, aiStatus: r.action, rawText: n }; return { res: s, matchResult: noAnswerMatch(s), action: r }; }, getBlankCount = e => { var t, a; const n = e.$options, r = "function" == typeof n ? n() : n; return Array.isArray(r) ? r.length : (null == (t = e.html) ? void 0 : t.querySelectorAll) ? e.html.querySelectorAll("textarea").length : "string" == typeof e.html && (null == (a = e.html.match(/ { const l = (null == n ? void 0 : n.name) || "AI"; if (hasUnsupportedMedia(e) || hasUnsupportedMedia((e => e.html ? "string" == typeof e.html ? e.html : "string" == typeof e.html.outerHTML ? e.html.outerHTML : "string" == typeof e.html.innerHTML ? e.html.innerHTML : "" : "")(a))) return createFallbackResult(l, getAiErrorMessage(createAiError("AI_IMAGE_UNSUPPORTED"))); const c = await i("ask", n, e, { questionType: t, stream: !1 }); if (!c.success) return createFallbackResult(l, c.displayMessage || "AI \u672a\u8fd4\u56de\u53ef\u7528\u7b54\u6848", c.duration, c.text); const p = parseAiAnswer(c.text, { type: t, options: a.options || [], blankCount: getBlankCount(a) }), u = ((e, t) => "preview" === e ? t.valid ? { action: "preview", answer: t.answer } : { action: "mark-no-answer", answer: [] } : "conservative" === e ? t.valid ? { action: "fill", answer: t.answer } : { action: "mark-no-answer", answer: [] } : t.answer.length > 0 ? { action: "fill", answer: t.answer } : { action: "mark-no-answer", answer: [] })(r, p), d = { form: l, answer: p.answer, msg: p.error ? getAiErrorMessage(p.error) : "", duration: c.duration, aiStatus: u.action, rawText: c.text }; if ("fill" !== u.action) return { res: d, matchResult: noAnswerMatch(d), action: u }; try { return { res: d, matchResult: s ? matchAnswerCandidates(normalizeAnswerCandidates([ d ]), a) : await o([ d ], a, !1), action: u }; } catch (m) { return createFallbackResult(l, "AI \u7b54\u6848\u586b\u5145\u5931\u8d25\uff0c\u8bf7\u624b\u52a8\u6838\u5bf9\u540e\u91cd\u8bd5", c.duration, c.text); } }, getErrorMessage = (e, t) => e instanceof Error && e.message ? `${t}\uff1a${e.message}` : "string" == typeof e && e ? `${t}\uff1a${e}` : t, legacyApiUrl = e => { const t = e.baseUrl.trim().replace(/\/+$/, ""); return /\/chat\/completions$/i.test(t) ? t : `${t}/chat/completions`; }, legacyProviderName = e => (e => e.id)(e), createLegacyAppAiConfig = e => { const t = normalizeAiSettings(e) || createDefaultAiSettings(), a = selectAiConfigForScene(t, "ask") || t.configs.find((e => e.id === t.defaultConfigId)) || t.configs[0]; return { gpt: t.configs.map((e => { var t, a; return { name: legacyProviderName(e), desc: e.name, api: legacyApiUrl(e), key: (null == (t = e.credential) ? void 0 : t.value) || "", msg: `AI\u54cd\u5e94\u5f02\u5e38\uff0c\u8bf7\u68c0\u67e5 AI \u8bbe\u7f6e\u4e2d\u7684\u300c${e.name}\u300d\u51ed\u8bc1\u6216\u6a21\u578b\u914d\u7f6e`, home: (null == (a = getAiProviderPreset(e.providerId)) ? void 0 : a.docUrl) || "", recommend: 0, model: e.model }; })), gptIndex: Math.max(t.configs.findIndex((e => e.id === (null == a ? void 0 : a.id))), 0), askGpt: t.enabledForAsk }; }; function loadAiSettings() { const e = Cache.get("ai_settings"), t = normalizeAiSettings(e); if (t) { const a = mergeLegacyAiCredentials(t, getApp()); return a !== e && Cache.set("ai_settings", a), a; } try { const e = mergeLegacyAiCredentials((e => { var t, a; const n = createDefaultAiSettings(); if (!(null == (t = e.gpt) ? void 0 : t.length)) return { ...n, enabledForAsk: !!e.askGpt }; const r = {}, s = e.gpt.map(((e, t) => ({ item: e, index: t }))).filter((({item: e}) => !(e => /glm|spark|\u661f\u706b/i.test(e.name))(e))); if (!s.length) return { ...n, enabledForAsk: !1 }; const i = s.map((({item: e, index: t}) => { var a; const n = "deepseek", s = ((e, t) => { const a = t[e] || 0; return t[e] = a + 1, 0 === a ? e : `${e}-${a}`; })(((e, t) => `legacy-ai-${t}`)(0, t), r); return createConfigFromPreset(n, { id: s, name: e.desc || e.name, baseUrl: (i = e.api, i.trim().split(/[?#]/)[0].replace(/\/+$/, "").replace(/\/chat\/completions$/, "").replace(/\/+$/, "") || (null == (a = getAiProviderPreset(n)) ? void 0 : a.baseUrl)), model: e.model, enabled: !0, credential: e.key ? { type: "api-key", value: e.key } : void 0 }); var i; })); return { configs: i, defaultConfigId: (null == (a = i[Math.min(Math.max(e.gptIndex || 0, 0), i.length - 1)]) ? void 0 : a.id) || n.defaultConfigId, enabledForAsk: !!e.askGpt, adoptionStrategy: "conservative", sceneOverrides: { enabled: !1 } }; })(getApp()), getApp()); return Cache.set("ai_settings", e), e; } catch (a) { const e = createDefaultAiSettings(); return Cache.set("ai_settings", e), e; } } const ca = defineStore("ai", { state: () => ({ aiMsg: "", aiLoading: !1, settings: loadAiSettings(), connectionTestingId: "", connectionMessage: "", connectionTestingIds: {}, connectionMessages: {}, connectionRequestTokens: {}, latestConnectionRequestToken: "" }), actions: { currentAiMd() { return simpleMarkdownToHtml(this.aiMsg); }, resetAi() { this.aiMsg = "", this.aiLoading = !1; }, saveSettings() { this.settings = normalizeAiSettings(this.settings) || createDefaultAiSettings(), Cache.set("ai_settings", this.settings); }, mergeLegacyCredentials(e = getApp()) { const t = mergeLegacyAiCredentials(this.settings, e); t !== this.settings && (this.settings = t, this.saveSettings()); }, selectConfig(e) { return selectAiConfigForScene(this.settings, e); }, updateCredential(e, t) { this.settings = ((e, t, a) => ({ ...e, configs: e.configs.map((e => e.id === t ? { ...e, credential: { ...a, updatedAt: Date.now() } } : e)) }))(this.settings, e, t), this.saveSettings(); }, removeConfig(e) { this.settings = ((e, t) => { var a, n; const r = e.configs.filter((e => e.id !== t)), s = r.some((t => t.id === e.defaultConfigId)) ? e.defaultConfigId : (null == (a = r.find((e => e.enabled))) ? void 0 : a.id) || (null == (n = r[0]) ? void 0 : n.id) || ""; return { ...e, configs: r, defaultConfigId: s, enabledForAsk: r.length > 0 && e.enabledForAsk, sceneOverrides: { enabled: e.sceneOverrides.enabled, search: e.sceneOverrides.search === t ? void 0 : e.sceneOverrides.search, ask: e.sceneOverrides.ask === t ? void 0 : e.sceneOverrides.ask, repair: e.sceneOverrides.repair === t ? void 0 : e.sceneOverrides.repair } }; })(this.settings, e), delete this.connectionTestingIds[e], delete this.connectionMessages[e], delete this.connectionRequestTokens[e], this.connectionTestingId === e && (this.connectionTestingId = ""), this.saveSettings(); }, async testConfig(e) { const t = this.settings.configs.find((t => t.id === e)), a = `${Date.now()}-${Math.random()}`; this.connectionTestingId = e, this.connectionMessage = "", this.connectionTestingIds[e] = !0, this.connectionMessages[e] = "", this.connectionRequestTokens[e] = a, this.latestConnectionRequestToken = a; const updateConnectionMessage = t => { const n = t.success ? `\u8fde\u63a5\u6210\u529f\uff0c\u8017\u65f6 ${t.duration}ms` : t.displayMessage || "\u8fde\u63a5\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u914d\u7f6e"; this.connectionRequestTokens[e] === a && (this.connectionMessages[e] = n), this.latestConnectionRequestToken === a && (this.connectionMessage = n); }; try { const e = await (async e => runAiScene("search", e, "\u8bf7\u53ea\u56de\u590d\u201c\u8fde\u63a5\u6210\u529f\u201d", { stream: !1 }))(t); return updateConnectionMessage(e), e; } catch (n) { const e = { success: !1, text: "", duration: 0, displayMessage: "\u8fde\u63a5\u6d4b\u8bd5\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5" }; return updateConnectionMessage(e), e; } finally { this.connectionRequestTokens[e] === a && (delete this.connectionTestingIds[e], delete this.connectionRequestTokens[e]), this.latestConnectionRequestToken === a && (this.connectionTestingId = "", this.latestConnectionRequestToken = ""); } } } }), pa = defineStore("ask", { state: () => ({ questionList: [], questionInx: 0, inx: 0, Interval: 0, start: !1, skipFinish: Cache.get("skipFinish", !1), autoNext: Cache.get("autoNext", !1), autoAnswer: Cache.get("autoAnswer", !0), freeFirst: !0, randomAnswer: Cache.get("randomAnswer", !1), lock: !1, runToken: 0, formMap: {}, type: "cx", loading: !1, loadingText: "\u52a0\u8f7d\u4e2d....", loadingRunToken: 0, aiLoadingIndex: -1, aiPreview: null, aiFailureMap: {}, restartPending: !1, tips: "\u672c\u811a\u672c\u4ec5\u4f9b\u5b66\u4e60\u7814\u7a76\uff0c\u8bf7\u52ff\u7528\u4e8e\u975e\u6cd5\u7528\u9014", delay: Cache.get("delay", 1e3), minDelay: Cache.get("minDelay", 0), saveQuestionData: [] }), actions: { addQuestion(e) { this.questionList.push({ ...e, answer: [], status: 0, aiMsg: "" }); }, clearQuestion() { this.questionList = []; }, getQuestion() { return this.questionList[this.questionInx]; }, nextQuestion() { if (this.questionInx === this.questionList.length - 1) return clearInterval(this.Interval), void (this.start = !1); this.questionInx++; }, prevQuestion() { 0 !== this.questionInx && this.questionInx--; }, toQuestion(e) { this.questionInx = e; let t = this.questionList[e]; this.rule.toquestion && this.rule.toquestion(e); try { if (t.html.scrollIntoView({ block: "center" }), ce.self !== ce.top) { let a = document.querySelector(".el-dialog"); if (a) { a.style.transform = "none"; let n = t.html.getBoundingClientRect(); a.style.top = n.top - 700 + "px", 0 === e && (a.style.top = "0px"), e === this.questionList.length - 1 && document.documentElement.scrollHeight > 2e3 && (a.style.top = n.top - 900 + "px"); } } t.html.style.boxShadow = "0 0 10px rgba(0, 0, 0, 0.15)", setTimeout((() => { t.html.style.boxShadow = ""; }), 500); } catch (a) {} }, setQuestionStatus(e, t) { this.questionList[e] && null != this.questionList[e].status && (this.questionList[e].status = t); }, async toggleStart() { const e = getAppStore(); let t = 0; try { const a = await async function(e, t) { const a = function(e) { return e.lock ? "noop" : e.start ? "stop" : "start"; }(e); if ("noop" === a) return a; if ("stop" === a) return e.start = !1, a; e.start = !0, e.lock = !0; try { return await t(), e.start ? a : "stop"; } finally { e.start = !1, e.lock = !1; } }(this, (async () => { var a; const n = createNextRunToken(this); t = n; for (let t = this.questionInx; t < this.questionList.length && this.start; t++) { if (this.skipFinish && 1 === this.questionList[t].status) continue; if (this.questionInx = t, "8" !== this.questionList[t].type) { if ((null == (a = this.rule) ? void 0 : a.answerDelay) && (await sleep(this.rule.answerDelay), !isRunTokenCurrent(this, n))) { this.start = !1; break; } if (await this.reAnswer(t, n), !isRunTokenCurrent(this, n)) { this.start = !1; break; } if (!this.start) break; if (e.app.alert = `\u5f53\u524d\u8fdb\u5ea6:${t + 1}/${this.questionList.length}`, await sleep(this.delay + 1e3 * Math.random()), !isRunTokenCurrent(this, n)) { this.start = !1; break; } this.rule.toquestion && this.rule.toquestion(this.questionInx + 1), this.autoNext && this.rule.next && this.rule.next(); } else this.setQuestionStatus(t, 2); } })); if (this.restartPending && "noop" !== a) return this.restartPending = !1, this.loadingRunToken === t && (this.loading = !1), void (await this.toggleStart()); if ("start" !== a) return; this.finishRun(e); } catch (a) { e.app.alert = "\u7b54\u9898\u4e2d\u65ad\uff0c\u8bf7\u91cd\u8bd5"; } finally { if (this.restartPending && !this.lock) return this.restartPending = !1, this.loadingRunToken === t && (this.loading = !1), void (await this.toggleStart()); this.lock || this.start || this.loadingRunToken !== t || (this.loading = !1); } }, finishRun(e = getAppStore()) { this.autoNext && this.rule.finish && this.rule.finish({ question: this.questionList }), this.formMap = {}, this.questionList.forEach((t => { var a; if (null == (a = t.form) ? void 0 : a.form) { let e = t.form.form; e && (this.formMap[e] = this.formMap[e] ? this.formMap[e] + 1 : 1); } else this.formMap["\u65e0\u7b54\u6848"] = this.formMap["\u65e0\u7b54\u6848"] ? this.formMap["\u65e0\u7b54\u6848"] + 1 : 1; e.app.alert = "\u7b54\u9898\u5b8c\u6210~"; })); }, async reAnswer(e, t) { var a; const n = t ?? createNextRunToken(this), r = getAppStore(); let s = this.questionList[e]; delete this.aiFailureMap[e], (null == (a = this.aiPreview) ? void 0 : a.index) === e && (this.aiPreview = null), this.loading = !0, this.loadingRunToken = n; try { this.loadingText = "\u52a0\u8f7d\u4e2d...."; const t = await (async ({question: e, runToken: t, isCurrentRun: a, askAiEnabled: n, randomAnswerEnabled: r, getCacheAnswer: s, getRemoteAnswers: i, getAiAnswer: o, getRandomFillPlan: l}) => { var c, p, u; let d = "", m = "", h = []; try { const n = await s(e); if (!a(t)) return { status: "stale", displayAnswers: [] }; h = normalizeAnswerCandidates([ n ]); const r = matchAnswerCandidates(h, e); if (r.haveAnswer && r.source && r.fillPlan) return { status: "answered", displayAnswers: h, adoptedSource: r.source, fillPlan: r.fillPlan }; } catch (y) { if (!a(t)) return { status: "stale", displayAnswers: [] }; d = getErrorMessage(y, "\u7f13\u5b58\u7b54\u6848\u8bfb\u53d6\u5931\u8d25"); } let f = []; try { const n = await i(e); if (!a(t)) return { status: "stale", displayAnswers: [] }; f = normalizeAnswerCandidates(n); const r = matchAnswerCandidates(f, e); if (r.haveAnswer && r.source && r.fillPlan) return { status: "answered", displayAnswers: f, adoptedSource: r.source, fillPlan: r.fillPlan }; } catch (y) { if (!a(t)) return { status: "stale", displayAnswers: [] }; d = getErrorMessage(y, "\u8fdc\u7aef\u9898\u5e93\u8bf7\u6c42\u5931\u8d25"); } let g = f.length ? f : h; if (n && o) try { const n = await o(e); if (!a(t)) return { status: "stale", displayAnswers: [] }; if ((e => { var t; return !!e && "object" == typeof e && "preview" === (null == (t = e.action) ? void 0 : t.action); })(n)) return { status: "preview", displayAnswers: g, preview: { answer: (null == (c = n.res) ? void 0 : c.answer) || [], rawText: (null == (p = n.res) ? void 0 : p.rawText) || "", reason: "\u7b49\u5f85\u7528\u6237\u786e\u8ba4 AI \u5efa\u8bae" } }; const r = normalizeAnswerCandidates([ (v = n, v && "object" == typeof v && "res" in v ? v.res : v) ]); g = [ ...g, ...r ]; const s = matchAnswerCandidates(r, e); if (s.haveAnswer && s.source && s.fillPlan) return { status: "answered", displayAnswers: g, adoptedSource: s.source, fillPlan: s.fillPlan }; m = (null == (u = r.find((e => e.msg))) ? void 0 : u.msg) || m; } catch (y) { if (!a(t)) return { status: "stale", displayAnswers: [] }; d = getErrorMessage(y, "AI \u7b54\u6848\u83b7\u53d6\u5931\u8d25"); } var v; if (r && l) { const t = l(e); if (t) return { status: "answered", displayAnswers: g, adoptedSource: { source: "\u968f\u673a\u7b54\u9898", answer: [], valid: !0, priority: 999 }, fillPlan: t }; } return { status: d && !m ? "failed" : "no-answer", displayAnswers: g, failureReason: m || d || "\u672a\u627e\u5230\u53ef\u5339\u914d\u7b54\u6848" }; })({ question: s, runToken: n, isCurrentRun: e => isRunTokenCurrent(this, e), askAiEnabled: r.app.askGpt, randomAnswerEnabled: this.randomAnswer, getCacheAnswer: e => Answer.getCacheAnswer(e), getRemoteAnswers: e => (this.loadingText = "\u6b63\u5728\u4ece\u63a5\u53e3\u4e2d\u83b7\u53d6\u7b54\u6848", Answer.getAnswersFree(e)), getAiAnswer: async e => { this.loadingText = "\u6b63\u5728\u4eceAI\u4e2d\u83b7\u53d6\u7b54\u6848"; let t = this.buildAIQuestionText(e); return this.fetchAIAnswer(t, s); }, getRandomFillPlan: e => ((e, t = Math.random) => { switch (e.type) { case "0": case "1": if (!Array.isArray(e.options) || 0 === e.options.length) return; return { kind: "choice", indexes: [ randomIndex(e.options.length, t) ] }; case "3": return { kind: "judge", value: t() > .5 ? "\u6b63\u786e" : "\u9519\u8bef" }; case "15": if (!Array.isArray(e.options) || 0 === e.options.length) return; const a = e.options.map((e => Array.isArray(null == e ? void 0 : e.options) && 0 !== e.options.length ? { kind: "choice", indexes: [ randomIndex(e.options.length, t) ] } : { kind: "unsupported", reason: "\u5b50\u9898\u9009\u9879\u4e3a\u7a7a\uff0c\u65e0\u6cd5\u968f\u673a\u7b54\u9898" })); return a.some((e => "choice" === e.kind)) ? { kind: "reading", subPlans: a } : void 0; default: return; } })(e) }); if ("stale" === t.status) return; const a = t.displayAnswers.map((e => e.raw || e)), i = t.adoptedSource && t.fillPlan ? createLegacyMatchResult({ haveAnswer: !0, source: t.adoptedSource, fillPlan: t.fillPlan, displayAnswers: t.displayAnswers }) : createLegacyMatchResult({ haveAnswer: !1, displayAnswers: t.displayAnswers }); if ("preview" === t.status && t.preview) return this.aiPreview = { index: e, answer: t.preview.answer, rawText: t.preview.rawText, reason: t.preview.reason }, this.start = !1, void (s.answer = a); if (t.fillPlan) { if (resolveQuestionOptions(s), !isRunTokenCurrent(this, n)) return; const a = await applyFillPlan(t.fillPlan, s, this.rule, applyAnswerResult, { shouldContinue: () => isRunTokenCurrent(this, n) }); if (!isRunTokenCurrent(this, n)) return; a.success || (this.aiFailureMap[e] = a.reason || "\u7b54\u6848\u586b\u5145\u5931\u8d25"); } s.answer = a, s.form = i.form, t.failureReason && (this.aiFailureMap[e] = t.failureReason), t.status, this.setQuestionStatus(e, (e => "answered" === e.status ? 1 : "no-answer" === e.status || "failed" === e.status ? 2 : 0)(t)); } finally { this.loadingRunToken === n && (this.loading = !1); } }, buildAIQuestionText(e) { var t; let a = `[${typeConvert(e.type, !1)}]${e.question}\n`; return e.options && e.options.forEach(((e, t) => { a += `${String.fromCharCode(65 + t)}\u3001${e}\n`; })), "24" === e.type && (e.match.forEach((e => { a += `\u7b2c\u4e00\u5217${e}\n`; })), null == (t = e.selects[0]) || t.forEach((e => { a += `\u7b2c\u4e8c\u5217${e.text}\n`; }))), a; }, async fetchAIAnswer(e, t) { const a = ca(); return await runAskAiFallback({ text: e, type: t.type, question: t, config: a.selectConfig("ask"), adoptionStrategy: a.settings.adoptionStrategy, usePureMatcher: !0, matchAnswer: ApiAnswerMatch }); }, async confirmAiPreview() { if (!this.aiPreview) return; const e = this.aiPreview, t = this.questionList[e.index]; if (!t) return void (this.aiPreview = null); const a = { form: "AI \u9884\u89c8", answer: e.answer, duration: 0, msg: "", aiStatus: "confirmed", rawText: e.rawText }; t.answer.push(a); const n = await ApiAnswerMatch([ a ], t, !1); t.form = n.form, n.haveAnswer ? (delete this.aiFailureMap[e.index], this.setQuestionStatus(e.index, 1)) : (this.aiFailureMap[e.index] = "AI \u5efa\u8bae\u65e0\u6cd5\u5339\u914d\u5f53\u524d\u9898\u76ee", this.setQuestionStatus(e.index, 2)), this.aiPreview = null; const r = getPreviewResumeAction(e.index, this.questionList.length); this.questionInx = r.nextIndex, r.shouldFinish ? this.finishRun() : this.toggleStart(); }, skipAiPreview() { if (!this.aiPreview) return; const e = this.aiPreview; this.aiFailureMap[e.index] = "\u7528\u6237\u8df3\u8fc7 AI \u5efa\u8bae", this.setQuestionStatus(e.index, 2), this.aiPreview = null; const t = getPreviewResumeAction(e.index, this.questionList.length); this.questionInx = t.nextIndex, t.shouldFinish ? this.finishRun() : this.toggleStart(); }, async aiAnswer(e) { const t = "AI\u54cd\u5e94\u5f02\u5e38\uff0c\u8bf7\u5148\u5728 AI \u8bbe\u7f6e\u4e2d\u586b\u5199 API Key\u3001\u6a21\u578b\u548c Base URL"; let a = this.questionList[e]; const n = ca(); this.loadingText = "AI\u601d\u8003\u4e2d.....", this.loading = !0, this.aiLoadingIndex = e; const r = this.buildAIQuestionText(a); a.aiMsg = ""; try { const s = await runAskAiFallback({ text: r, type: a.type, question: a, config: n.selectConfig("ask"), adoptionStrategy: n.settings.adoptionStrategy, matchAnswer: ApiAnswerMatch }); if ("preview" === s.action.action) return this.aiPreview = { index: e, answer: s.res.answer, rawText: s.res.rawText, reason: "\u7b49\u5f85\u7528\u6237\u786e\u8ba4 AI \u5efa\u8bae" }, void (a.aiMsg = s.res.rawText); a.answer.push(s.res), a.form = s.matchResult.form, s.matchResult.haveAnswer ? (delete this.aiFailureMap[e], this.setQuestionStatus(e, 1)) : (this.aiFailureMap[e] = s.res.msg || "AI \u672a\u91c7\u7eb3\u8be5\u7b54\u6848", this.setQuestionStatus(e, 2)), a.aiMsg = ((e, t, a) => e && t.trim() ? t : a)(s.matchResult.haveAnswer, s.res.rawText || s.res.answer.join("\u3001"), s.res.msg || t); } catch { a.aiMsg = t, this.aiFailureMap[e] = t, this.setQuestionStatus(e, 2); } finally { this.loading = !1, this.aiLoadingIndex = -1; } }, pause() { this.start = !1, createNextRunToken(this); }, restart() { const e = { questionInx: 0, start: !1 }; this.questionInx = e.questionInx, this.start = e.start, this.aiPreview = null, createNextRunToken(this), this.lock ? this.restartPending = !0 : this.toggleStart(); } }, getters: { current() { return this.questionList[this.questionInx]; }, currentAiMd() { return markToHtml(this.questionList[this.questionInx].aiMsg); }, tipsMd() { const e = this.rule; if (!e) return '\u8be5\u9875\u9762\u6682\u65e0\u89c4\u5219'; const t = []; return t.push(`${e.name}${e.tips || "\u6709\u95ee\u9898\u53ef\u4ee5\u53cd\u9988\u7ed9\u4f5c\u8005"}`), t.join("
    "); }, typesMd() { const e = this.rule; if (!e || !e.types) return '\u8be5\u9875\u9762\u6682\u65e0\u89c4\u5219'; const t = e.types, a = []; for (const n in t) { const e = t[n]; a.push(`${typeConvert(e, !1)} \u2705`); } return a.push('\u4e0d\u652f\u6301\u7684\u9898\u578b\u53ef\u4ee5\u53cd\u9988\u7ed9\u4f5c\u8005\u517c\u5bb9'), a.join("
    "); } } }), ua = Cache.get("user", {}), da = defineStore("user", { state: () => ({ user: ua.user || null, notice: "", apiKey: ua.api_key || "", stats: { course_count: 0, chapter_count: 0, question_count: 0 }, afdianUrl: ua.afdian_url || "", isLoggedIn: !!ua.user, loginTime: ua.login_time || 0 }), getters: { username: e => { var t; return (null == (t = e.user) ? void 0 : t.username) || "\u672a\u767b\u5f55"; }, nickname: e => { var t; return (null == (t = e.user) ? void 0 : t.nickname) || "\u6e38\u5ba2"; }, avatar: () => "", score: e => { var t; return (null == (t = e.user) ? void 0 : t.score) || 0; }, level: e => { var t; return (null == (t = e.user) ? void 0 : t.level) || 0; }, isVip: e => { var t; return ((null == (t = e.user) ? void 0 : t.level) || 0) > 0; } }, actions: { async loginByPassword(e, t) { try { const a = "https://www.aiask.site/v1/user/login", [n] = await requestApi(a, "POST", { username: e, password: t, login_type: "password" }), r = JSON.parse(n.responseText); return 200 === r.code ? (this.user = r.data.user, this.apiKey = r.data.api_key, this.afdianUrl = r.data.afdian_url || "", this.isLoggedIn = !0, this.loginTime = Date.now(), this.saveToCache(), await this.fetchUserInfo(), r.data, { success: !0, message: "\u767b\u5f55\u6210\u529f" }) : { success: !1, message: r.message || "\u767b\u5f55\u5931\u8d25" }; } catch (a) { return { success: !1, message: a.message || "\u767b\u5f55\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5" }; } }, async loginByApiKey(e) { try { const t = "https://www.aiask.site/v1/user/login", [a] = await requestApi(t, "POST", { api_key: e, login_type: "apikey" }), n = JSON.parse(a.responseText); return 200 === n.code ? (this.user = n.data.user, this.apiKey = n.data.api_key, this.afdianUrl = n.data.afdian_url || "", this.isLoggedIn = !0, this.loginTime = Date.now(), this.saveToCache(), await this.fetchUserInfo(), n.data, { success: !0, message: "\u767b\u5f55\u6210\u529f" }) : { success: !1, message: n.message || "API Key \u767b\u5f55\u5931\u8d25" }; } catch (t) { return { success: !1, message: t.message || "API Key \u767b\u5f55\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5" }; } }, async register(e) { try { const t = "https://www.aiask.site/v1/user/register", [a] = await requestApi(t, "POST", e), n = JSON.parse(a.responseText); return 200 === n.code ? (this.user = n.data.user, this.apiKey = n.data.api_key, this.afdianUrl = n.data.afdian_url || "", this.isLoggedIn = !0, this.loginTime = Date.now(), this.saveToCache(), n.data, { success: !0, message: "\u6ce8\u518c\u6210\u529f" }) : { success: !1, message: n.message || "\u6ce8\u518c\u5931\u8d25" }; } catch (t) { return { success: !1, message: t.message || "\u6ce8\u518c\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5" }; } }, async fetchUserInfo() { if (this.isLoggedIn) try { const e = "https://www.aiask.site/v1/user/info", [t] = await requestApi(e, "GET", void 0, { Authorization: `Bearer ${this.apiKey}` }), a = JSON.parse(t.responseText); 200 === a.code && (this.user = a.data.user, this.stats = a.data.stats, this.afdianUrl = a.data.afdian_url || "", this.saveToCache(), a.data); } catch (e) {} }, async logout() { try { if (this.apiKey) { const e = "https://www.aiask.site/v1/user/logout"; await requestApi(e, "POST", void 0, { Authorization: `Bearer ${this.apiKey}` }); } } catch (e) {} finally { this.user = null, this.apiKey = "", this.stats = { course_count: 0, chapter_count: 0, question_count: 0 }, this.afdianUrl = "", this.isLoggedIn = !1, this.loginTime = 0, Cache.remove("user"); } }, async refreshApiKey() { try { const e = "https://www.aiask.site/v1/user/refresh-apikey", [t] = await requestApi(e, "POST", void 0, { Authorization: `Bearer ${this.apiKey}` }), a = JSON.parse(t.responseText); return 200 === a.code ? (this.apiKey = a.data.api_key, this.saveToCache(), a.data.api_key, { success: !0, message: "API Key \u5237\u65b0\u6210\u529f", api_key: a.data.api_key }) : { success: !1, message: a.message || "API Key \u5237\u65b0\u5931\u8d25" }; } catch (e) { return { success: !1, message: e.message || "API Key \u5237\u65b0\u5931\u8d25" }; } }, async updateUserInfo(e) { try { const t = "https://www.aiask.site/v1/user/update", [a] = await requestApi(t, "POST", e, { Authorization: `Bearer ${this.apiKey}` }), n = JSON.parse(a.responseText); return 200 === n.code ? (this.user && (this.user = { ...this.user, ...n.data.user }), this.saveToCache(), n.data, { success: !0, message: "\u66f4\u65b0\u6210\u529f" }) : { success: !1, message: n.message || "\u66f4\u65b0\u5931\u8d25" }; } catch (t) { return { success: !1, message: t.message || "\u66f4\u65b0\u5931\u8d25" }; } }, async changePassword(e, t) { try { const a = "https://www.aiask.site/v1/user/change-password", [n] = await requestApi(a, "POST", { old_password: e, new_password: t }, { Authorization: `Bearer ${this.apiKey}` }), r = JSON.parse(n.responseText); return 200 === r.code ? { success: !0, message: "\u5bc6\u7801\u4fee\u6539\u6210\u529f" } : { success: !1, message: r.message || "\u5bc6\u7801\u4fee\u6539\u5931\u8d25" }; } catch (a) { return { success: !1, message: a.message || "\u5bc6\u7801\u4fee\u6539\u5931\u8d25" }; } }, async fuzzySearchQuestion(e) { var t; try { const t = "https://www.aiask.site/v1/question/fuzzy", a = { question: e.question, type: e.type ?? 8, options: e.options ?? [] }, [n] = await requestApi(t, "POST", a), r = JSON.parse(n.responseText), s = 401 === r.code || 401 === n.status; return 200 === r.code ? { success: !0, message: r.message || "success", data: r.data || [] } : s ? { success: !1, message: r.message || "\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u4f7f\u7528\u5b98\u65b9\u9898\u5e93\uff0c\u8bf7\u5148\u767b\u5f55", data: [], needLogin: !0 } : { success: !1, message: r.message || "\u5b98\u65b9\u9898\u5e93\u641c\u7d22\u5931\u8d25", data: [] }; } catch (a) { const e = 401 === (null == a ? void 0 : a.status) || 401 === (null == (t = null == a ? void 0 : a.response) ? void 0 : t.status); return { success: !1, message: e ? "\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u4f7f\u7528\u5b98\u65b9\u9898\u5e93\uff0c\u8bf7\u5148\u767b\u5f55" : (null == a ? void 0 : a.message) || "\u5b98\u65b9\u9898\u5e93\u641c\u7d22\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5", data: [], needLogin: e }; } }, async fetchNotice() { var e; try { const t = "https://www.aiask.site", [a] = await requestApi(`${t}/v1/aiAskNotice`, "GET"), n = JSON.parse(a.responseText), r = (null == (e = null == n ? void 0 : n.data) ? void 0 : e.notice) ?? (null == n ? void 0 : n.data); return 200 === n.code && r ? (this.notice = r, { success: !0, notice: r, message: n.message }) : { success: !1, message: n.message || "\u516c\u544a\u83b7\u53d6\u5931\u8d25" }; } catch (t) { return { success: !1, message: (null == t ? void 0 : t.message) || "\u516c\u544a\u83b7\u53d6\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5" }; } }, saveToCache() { const e = { user: this.user || void 0, api_key: this.apiKey || void 0, login_time: this.loginTime || void 0, afdian_url: this.afdianUrl || void 0 }; Cache.set("user", e); }, loadFromCache() { const e = Cache.get("user", {}); e.user && (this.user = e.user, this.apiKey = e.api_key || "", this.loginTime = e.login_time || 0, this.afdianUrl = e.afdian_url || "", this.isLoggedIn = !0); } } }), ma = [ "tabindex", "disabled" ], ha = { class: "stat-label" }, fa = { class: "stat-value" }, ga = { key: 0, class: "stat-meta" }, va = { key: 1, class: "stat-progress" }, ya = vue.defineComponent({ __name: "StatCard", props: { label: {}, iconColor: {}, value: {}, meta: {}, progress: {}, clickable: { type: Boolean } }, emits: [ "click" ], setup: e => (e, t) => (vue.openBlock(), vue.createElementBlock("button", { type: "button", class: vue.normalizeClass([ "stat-card", { "stat-card-clickable": e.clickable } ]), tabindex: e.clickable ? 0 : -1, disabled: !e.clickable, onClick: t[0] || (t[0] = t => e.$emit("click")) }, [ vue.createElementVNode("div", ha, [ vue.createElementVNode("span", { class: "stat-icon", style: vue.normalizeStyle({ background: e.iconColor || "var(--c-primary)" }) }, null, 4), vue.createElementVNode("span", null, vue.toDisplayString(e.label), 1) ]), vue.createElementVNode("div", fa, vue.toDisplayString(e.value), 1), e.meta ? (vue.openBlock(), vue.createElementBlock("div", ga, vue.toDisplayString(e.meta), 1)) : vue.createCommentVNode("", !0), "number" == typeof e.progress ? (vue.openBlock(), vue.createElementBlock("div", va, [ vue.createElementVNode("i", { style: vue.normalizeStyle({ width: e.progress + "%" }) }, null, 4) ])) : vue.createCommentVNode("", !0) ], 10, ma)) }), ba = { class: "overview-page" }, wa = { class: "aah-card overview-user" }, xa = { class: "ov-avatar" }, ka = [ "src" ], qa = { class: "ov-user-meta" }, _a = { key: 0, class: "ov-tags" }, Aa = { class: "aah-tag aah-tag-success" }, Ta = { key: 0, class: "aah-tag aah-tag-warning" }, Ca = { key: 1, class: "ov-muted" }, Sa = { key: 0, class: "aah-card overview-notice" }, Ia = [ "innerHTML" ], Ea = { class: "overview-stats" }, Ua = { class: "overview-actions" }, Ha = { class: "overview-version" }, Pa = { class: "ov-version-text" }, ja = vue.defineComponent({ __name: "Overview", setup(e) { const t = Kt(), n = da(), r = pa(), s = ca(), i = vue.ref(""); vue.onMounted((async () => { const e = await n.fetchNotice(); e.success && e.notice ? i.value = V.sanitize(e.notice) : e.message && msg(e.message, "warning"); })); const o = vue.computed((() => { var e; const t = (null == (e = r.questionList) ? void 0 : e.length) ?? 0, a = r.questionInx ?? 0; return { total: t, done: a, percent: t ? Math.round(a / t * 100) : 0 }; })), l = vue.computed((() => { const {total: e, done: t} = o.value; return e ? `${t} / ${e}` : "\u7a7a\u95f2"; })), c = vue.computed((() => Cache.match("ques1_").length)), p = vue.computed((() => { const e = s.selectConfig("search"), t = (null == e ? void 0 : e.model) ?? ""; return { ready: !!t, model: t || "\u672a\u914d\u7f6e" }; })); return (e, a) => (vue.openBlock(), vue.createElementBlock("div", ba, [ vue.createElementVNode("div", wa, [ vue.createElementVNode("div", xa, [ vue.unref(n).avatar ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, src: vue.unref(n).avatar, alt: "avatar" }, null, 8, ka)) : (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), { key: 1, icon: "mdi:account" })) ]), vue.createElementVNode("div", qa, [ vue.createElementVNode("h3", null, vue.toDisplayString(vue.unref(n).nickname || "\u6e38\u5ba2"), 1), vue.unref(n).isLoggedIn ? (vue.openBlock(), vue.createElementBlock("p", _a, [ vue.createElementVNode("span", Aa, "\u79ef\u5206 " + vue.toDisplayString(vue.unref(n).score), 1), vue.unref(n).isVip ? (vue.openBlock(), vue.createElementBlock("span", Ta, "VIP Lv." + vue.toDisplayString(vue.unref(n).level), 1)) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("p", Ca, "\u672a\u767b\u5f55\uff0c\u767b\u5f55\u540e\u53ef\u4eab\u53d7\u66f4\u591a\u529f\u80fd")) ]), vue.createElementVNode("button", { class: vue.normalizeClass([ "aah-btn", vue.unref(n).isLoggedIn ? "" : "aah-btn-primary" ]), onClick: a[0] || (a[0] = e => vue.unref(t).setPage("system", "account")) }, vue.toDisplayString(vue.unref(n).isLoggedIn ? "\u4e2a\u4eba\u4e2d\u5fc3" : "\u767b\u5f55 / \u6ce8\u518c"), 3) ]), i.value ? (vue.openBlock(), vue.createElementBlock("div", Sa, [ vue.createElementVNode("div", { class: "ov-notice-content", innerHTML: i.value }, null, 8, Ia) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Ea, [ vue.createVNode(ya, { label: "\u7b54\u9898", "icon-color": o.value.total ? "var(--c-success)" : "var(--c-text-muted)", value: l.value, progress: o.value.total ? o.value.percent : void 0, meta: o.value.total ? "" : "\u6682\u672a\u5f00\u59cb", clickable: "", onClick: a[1] || (a[1] = e => vue.unref(t).setPage("ask")) }, null, 8, [ "icon-color", "value", "progress", "meta" ]), vue.createVNode(ya, { label: "\u9898\u5e93", "icon-color": "var(--c-primary)", value: c.value.toLocaleString(), meta: "\u5df2\u6536\u5f55\u9898\u76ee", clickable: "", onClick: a[2] || (a[2] = e => vue.unref(t).setPage("library", "manage")) }, null, 8, [ "value" ]), vue.createVNode(ya, { label: "AI", "icon-color": p.value.ready ? "var(--c-warning)" : "var(--c-text-muted)", value: p.value.model, meta: p.value.ready ? "\u5df2\u5c31\u7eea" : "\u672a\u914d\u7f6e", clickable: "", onClick: a[3] || (a[3] = e => vue.unref(t).setPage("ai")) }, null, 8, [ "icon-color", "value", "meta" ]) ]), vue.createElementVNode("div", Ua, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", onClick: a[4] || (a[4] = e => vue.unref(t).setPage("ask")) }, "\u5f00\u59cb\u7b54\u9898"), vue.createElementVNode("button", { class: "aah-btn", onClick: a[5] || (a[5] = e => vue.unref(t).setPage("ai")) }, "AI \u641c\u9898"), vue.createElementVNode("button", { class: "aah-btn", onClick: a[6] || (a[6] = e => vue.unref(t).setPage("library", "tool")) }, "\u9898\u5e93\u5bfc\u5165") ]), vue.createElementVNode("div", Ha, [ vue.createElementVNode("span", Pa, "v" + vue.toDisplayString(vue.unref(Nt).script.version), 1), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", onClick: a[7] || (a[7] = e => vue.unref(updateFn)(!1)) }, "\u68c0\u67e5\u66f4\u65b0") ]) ])); } }), La = { key: 0, class: "page-loader" }, za = vue.createElementVNode("div", { class: "spinner" }, null, -1), Ma = [ za ], Oa = { key: 0, class: "aah-page-footer" }, $a = vue.defineComponent({ __name: "PageContainer", props: { loading: { type: Boolean, default: !1 }, noPadding: { type: Boolean, default: !1 } }, setup: e => (e, t) => (vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass([ "aah-page", { "is-loading": e.loading } ]) }, [ vue.createElementVNode("main", { class: vue.normalizeClass([ "aah-page-content", { "no-padding": e.noPadding } ]) }, [ vue.renderSlot(e.$slots, "default"), e.loading ? (vue.openBlock(), vue.createElementBlock("div", La, Ma)) : vue.createCommentVNode("", !0) ], 2), e.$slots.footer ? (vue.openBlock(), vue.createElementBlock("footer", Oa, [ vue.renderSlot(e.$slots, "footer") ])) : vue.createCommentVNode("", !0) ], 2)) }), Fa = { class: "segmented", role: "tablist" }, Da = [ "aria-selected", "onClick" ], Na = vue.defineComponent({ __name: "SegmentedControl", props: { segments: {}, modelValue: {} }, emits: [ "update:modelValue" ], setup: e => (e, t) => (vue.openBlock(), vue.createElementBlock("div", Fa, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.segments, (t => (vue.openBlock(), vue.createElementBlock("button", { key: t.key, type: "button", role: "tab", "aria-selected": e.modelValue === t.key, class: vue.normalizeClass([ "segment-item", { active: e.modelValue === t.key } ]), onClick: a => e.$emit("update:modelValue", t.key) }, vue.toDisplayString(t.label), 11, Da)))), 128)) ])) }), Ra = [ "checked", "disabled" ], Ba = vue.createElementVNode("span", { class: "switch-slider", "aria-hidden": "true" }, null, -1), Ga = vue.defineComponent({ __name: "Switch", props: { modelValue: { type: Boolean }, disabled: { type: Boolean } }, emits: [ "update:modelValue" ], setup: e => (e, t) => (vue.openBlock(), vue.createElementBlock("label", { class: vue.normalizeClass([ "switch", { disabled: e.disabled } ]) }, [ vue.createElementVNode("input", { type: "checkbox", checked: e.modelValue, disabled: e.disabled, onChange: t[0] || (t[0] = t => e.$emit("update:modelValue", t.target.checked)) }, null, 40, Ra), Ba ], 2)) }), Va = { class: "config-item" }, Ka = { class: "config-item-content" }, Wa = { class: "config-label" }, Qa = { class: "label-wrapper" }, Ja = { class: "label-text" }, Xa = { key: 0, class: "label-desc" }, Ya = { class: "config-control" }, Za = [ "value" ], en = { key: 4, class: "hotkey-input-wrapper" }, tn = [ "value", "placeholder" ], an = { key: 0, class: "hotkey-hint danger" }, nn = { key: 1, class: "hotkey-hint" }, rn = { key: 5, class: "checkbox-group" }, sn = [ "value" ], on = { key: 6, class: "radio-group" }, ln = [ "value" ], cn = [ "min", "max", "step" ], pn = vue.defineComponent({ __name: "ConfigItem", props: { item: {}, recordingHotkey: {} }, emits: [ "start-recording", "hotkey-keydown" ], setup(e, {emit: t}) { const a = e, n = t, r = vue.computed((() => a.item.kind ?? a.item.type)), handleStartRecording = () => { "hotkey" === r.value && n("start-recording", a.item.name); }, handleHotkeyKeydown = e => { n("hotkey-keydown", e, a.item); }; return (e, t) => (vue.openBlock(), vue.createElementBlock("div", Va, [ vue.createElementVNode("div", Ka, [ vue.createElementVNode("div", Wa, [ vue.createElementVNode("div", Qa, [ vue.createElementVNode("span", Ja, vue.toDisplayString(e.item.label), 1), e.item.desc ? (vue.openBlock(), vue.createElementBlock("span", Xa, vue.toDisplayString(e.item.desc), 1)) : vue.createCommentVNode("", !0) ]) ]), vue.createElementVNode("div", Ya, [ "switch" === r.value ? (vue.openBlock(), vue.createBlock(Ga, { key: 0, modelValue: e.item.value, "onUpdate:modelValue": t[0] || (t[0] = t => e.item.value = t) }, null, 8, [ "modelValue" ])) : "input" === r.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", { key: 1, "onUpdate:modelValue": t[1] || (t[1] = t => e.item.value = t), class: "aah-input", type: "text" }, null, 512)), [ [ vue.vModelText, e.item.value ] ]) : "number" === r.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", { key: 2, "onUpdate:modelValue": t[2] || (t[2] = t => e.item.value = t), class: "aah-input", type: "number" }, null, 512)), [ [ vue.vModelText, e.item.value, void 0, { number: !0 } ] ]) : "select" === r.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", { key: 3, "onUpdate:modelValue": t[3] || (t[3] = t => e.item.value = t), class: "aah-select" }, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.item.options, (e => (vue.openBlock(), vue.createElementBlock("option", { key: e.value, value: e.value }, vue.toDisplayString(e.label), 9, Za)))), 128)) ], 512)), [ [ vue.vModelSelect, e.item.value ] ]) : "hotkey" === r.value ? (vue.openBlock(), vue.createElementBlock("div", en, [ vue.createElementVNode("input", { class: vue.normalizeClass([ "aah-input", { recording: e.recordingHotkey === e.item.name } ]), value: e.item.value, placeholder: e.recordingHotkey === e.item.name ? "\u8bf7\u6309\u4e0b\u5feb\u6377\u952e..." : "\u70b9\u51fb\u540e\u6309\u4e0b\u5feb\u6377\u952e\u7ec4\u5408", readonly: "", onFocus: handleStartRecording, onKeydown: handleHotkeyKeydown }, null, 42, tn), e.recordingHotkey === e.item.name ? (vue.openBlock(), vue.createElementBlock("span", an, "\u5f55\u5236\u4e2d...")) : (vue.openBlock(), vue.createElementBlock("span", nn, "\u70b9\u51fb\u5f55\u5236")) ])) : "checkbox" === r.value ? (vue.openBlock(), vue.createElementBlock("div", rn, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.item.options, (a => (vue.openBlock(), vue.createElementBlock("label", { key: a.value, class: "checkbox-item" }, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", value: a.value, "onUpdate:modelValue": t[4] || (t[4] = t => e.item.value = t) }, null, 8, sn), [ [ vue.vModelCheckbox, e.item.value ] ]), vue.createElementVNode("span", null, vue.toDisplayString(a.label), 1) ])))), 128)) ])) : "radio" === r.value ? (vue.openBlock(), vue.createElementBlock("div", on, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.item.options, (a => (vue.openBlock(), vue.createElementBlock("label", { key: a.value, class: "radio-item" }, [ vue.withDirectives(vue.createElementVNode("input", { type: "radio", value: a.value, "onUpdate:modelValue": t[5] || (t[5] = t => e.item.value = t) }, null, 8, ln), [ [ vue.vModelRadio, e.item.value ] ]), vue.createElementVNode("span", null, vue.toDisplayString(a.label), 1) ])))), 128)) ])) : "segment" === r.value ? (vue.openBlock(), vue.createBlock(Na, { key: 7, modelValue: e.item.value, "onUpdate:modelValue": t[6] || (t[6] = t => e.item.value = t), segments: (e.item.options ?? []).map((e => ({ key: String(e.value), label: e.label }))) }, null, 8, [ "modelValue", "segments" ])) : "slider" === r.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", { key: 8, type: "range", "onUpdate:modelValue": t[7] || (t[7] = t => e.item.value = t), min: e.item.min ?? 0, max: e.item.max ?? 100, step: e.item.step ?? 1, class: "aah-slider" }, null, 8, cn)), [ [ vue.vModelText, e.item.value, void 0, { number: !0 } ] ]) : vue.createCommentVNode("", !0) ]) ]) ])); } }), un = { class: "ai-config-panel" }, dn = { class: "ai-config-summary" }, mn = vue.createElementVNode("h3", null, "AI \u8bbe\u7f6e", -1), hn = { class: "native-checkbox ai-config-checkbox" }, fn = vue.createElementVNode("span", null, "\u542f\u7528 AI \u8f85\u52a9\u7b54\u9898", -1), gn = { class: "ai-config-manager" }, vn = { class: "ai-config-list-panel" }, yn = { class: "ai-config-field ai-preset-select" }, bn = vue.createElementVNode("span", null, "\u6dfb\u52a0\u5e73\u53f0\u9884\u8bbe", -1), wn = vue.createElementVNode("option", { value: "" }, "\u9009\u62e9\u5e73\u53f0", -1), xn = [ "value" ], kn = { class: "ai-config-list custom-scroll" }, qn = [ "onClick" ], _n = { class: "ai-config-list-text" }, An = { key: 0, class: "ai-config-default" }, Tn = { key: 1, class: "ai-config-enabled-dot", "aria-label": "\u5df2\u542f\u7528" }, Cn = { key: 0, class: "ai-config-detail" }, Sn = { class: "ai-config-detail-header" }, In = { class: "ai-config-section" }, En = vue.createElementVNode("h5", null, "\u57fa\u7840\u4fe1\u606f", -1), Un = { class: "ai-config-form-grid" }, Hn = { class: "ai-config-field" }, Pn = vue.createElementVNode("span", null, "\u540d\u79f0", -1), jn = { class: "ai-config-field" }, Ln = vue.createElementVNode("span", null, "Base URL", -1), zn = { class: "ai-config-field" }, Mn = vue.createElementVNode("span", null, "\u6a21\u578b", -1), On = { class: "ai-config-field" }, $n = [ "value" ], Fn = { class: "ai-config-field-help" }, Dn = [ "href" ], Nn = { class: "ai-config-section" }, Rn = vue.createElementVNode("h5", null, "\u4f7f\u7528\u7b56\u7565", -1), Bn = { class: "ai-config-options" }, Gn = { class: "native-checkbox" }, Vn = vue.createElementVNode("span", null, "\u542f\u7528\u8be5\u914d\u7f6e", -1), Kn = { class: "ai-config-field ai-config-strategy" }, Wn = vue.createElementVNode("span", null, "AI \u91c7\u7eb3\u7b56\u7565", -1), Qn = vue.createElementVNode("option", { value: "conservative" }, "\u4fdd\u5b88\u586b", -1), Jn = vue.createElementVNode("option", { value: "direct" }, "\u76f4\u63a5\u586b", -1), Xn = vue.createElementVNode("option", { value: "preview" }, "\u9884\u89c8\u786e\u8ba4", -1), Yn = [ Qn, Jn, Xn ], Zn = [ "open" ], er = { class: "ai-config-form-grid" }, tr = { class: "native-checkbox ai-config-stream" }, ar = vue.createElementVNode("span", null, "\u542f\u7528\u6d41\u5f0f\u54cd\u5e94", -1), nr = { class: "ai-config-field" }, rr = vue.createElementVNode("span", null, "\u8bf7\u6c42\u8d85\u65f6\uff08\u6beb\u79d2\uff09", -1), sr = { class: "ai-config-actions" }, ir = { class: "ai-config-primary-actions" }, or = [ "disabled" ], lr = { key: 0, class: "aah-alert aah-alert-info" }, cr = { key: 1, class: "ai-config-empty" }, pr = vue.createElementVNode("p", null, "\u8fd8\u6ca1\u6709 AI \u914d\u7f6e\uff0c\u8bf7\u5148\u6dfb\u52a0\u4e00\u4e2a\u5e73\u53f0\u9884\u8bbe\u3002", -1), ur = { class: "modal-panel ai-config-delete-modal" }, dr = vue.createElementVNode("h3", { id: "ai-config-delete-title" }, "\u786e\u8ba4\u5220\u9664", -1), mr = { class: "modal-body" }, hr = { class: "ai-config-delete-text" }, fr = vue.defineComponent({ __name: "AiConfigPanel", setup(e) { var t; const n = Kt(), r = ca(), s = vue.ref(r.settings.defaultConfigId || (null == (t = r.settings.configs[0]) ? void 0 : t.id) || ""), o = vue.ref(!1), l = vue.ref(null), c = vue.computed((() => r.settings.configs.find((e => e.id === s.value)) || r.settings.configs[0])), p = vue.computed((() => c.value ? ia.find((e => e.id === c.value.providerId)) : void 0)), u = vue.computed((() => r.settings.configs.filter((e => e.enabled)))), d = vue.computed((() => c.value ? r.connectionMessages[c.value.id] : "")), m = vue.computed((() => !!c.value && Boolean(r.connectionTestingIds[c.value.id]))), h = vue.computed((() => c.value ? "API Key" : "\u672a\u9009\u62e9\u914d\u7f6e")), g = vue.computed((() => { var e, t; return (null == (e = p.value) ? void 0 : e.keyUrl) || (null == (t = p.value) ? void 0 : t.docUrl) || ""; })), x = vue.computed((() => { var e; return (null == (e = p.value) ? void 0 : e.keyHelp) || "\u8bf7\u5728\u5bf9\u5e94\u5e73\u53f0\u63a7\u5236\u53f0\u521b\u5efa API Key\uff0c\u518d\u7c98\u8d34\u5230\u8fd9\u91cc\u3002"; })), syncLegacyAppConfig = (e = !1) => { e && r.mergeLegacyCredentials(n.app), n.setConfig(createLegacyAppAiConfig(r.settings)); }, save = () => { (() => { const e = r.settings.configs.find((e => e.id === r.settings.defaultConfigId)); if (null == e ? void 0 : e.enabled) return; const t = r.settings.configs.find((e => e.enabled)); t && (r.settings.defaultConfigId = t.id); })(), r.saveSettings(), syncLegacyAppConfig(); }, saveEnabledForAsk = () => { save(); }, handlePresetChange = e => { const t = e.target; (e => { const t = ia.find((t => t.id === e)); if (!t) return; const a = `${t.id}-${Date.now()}`; r.settings.configs.push({ id: a, name: t.name, providerId: t.id, providerKind: t.providerKind, baseUrl: t.baseUrl, model: t.defaultModel, enabled: !0, stream: t.stream, timeout: 3e4 }), s.value = a, r.settings.defaultConfigId || (r.settings.defaultConfigId = a), save(); })(t.value), t.value = ""; }, closeDeleteConfirm = () => { l.value = null; }, deleteConfig = () => { const e = l.value; if (!e) return; const t = r.settings.configs.findIndex((t => t.id === e.id)); r.removeConfig(e.id); const a = r.settings.configs[t] || r.settings.configs[t - 1] || r.settings.configs[0]; s.value = (null == a ? void 0 : a.id) || "", o.value = !1, closeDeleteConfirm(), syncLegacyAppConfig(), msg("AI \u914d\u7f6e\u5df2\u5220\u9664", "success"); }; return vue.watch(s, (() => { o.value = !1; })), vue.onMounted((() => { syncLegacyAppConfig(!0); })), (e, t) => { var a; return vue.openBlock(), vue.createElementBlock("div", un, [ vue.createElementVNode("header", dn, [ vue.createElementVNode("div", null, [ mn, vue.createElementVNode("p", null, "\u5df2\u542f\u7528 " + vue.toDisplayString(u.value.length) + " \u4e2a\u914d\u7f6e\uff0c\u9ed8\u8ba4\u7528\u4e8e AI \u641c\u9898\u548c\u8f85\u52a9\u7b54\u9898\u3002", 1) ]), vue.createElementVNode("label", hn, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": t[0] || (t[0] = e => vue.unref(r).settings.enabledForAsk = e), onChange: saveEnabledForAsk }, null, 544), [ [ vue.vModelCheckbox, vue.unref(r).settings.enabledForAsk ] ]), fn ]) ]), vue.createElementVNode("div", gn, [ vue.createElementVNode("aside", vn, [ vue.createElementVNode("label", yn, [ bn, vue.createElementVNode("select", { class: "aah-select", onChange: handlePresetChange }, [ wn, (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(ia), (e => (vue.openBlock(), vue.createElementBlock("option", { key: e.id, value: e.id }, vue.toDisplayString(e.name), 9, xn)))), 128)) ], 32) ]), vue.createElementVNode("div", kn, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(r).settings.configs, (e => (vue.openBlock(), vue.createElementBlock("button", { key: e.id, type: "button", class: vue.normalizeClass([ "ai-config-list-item", { active: e.id === s.value } ]), onClick: t => s.value = e.id }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:robot", class: "ai-config-list-icon" }), vue.createElementVNode("span", _n, [ vue.createElementVNode("strong", null, vue.toDisplayString(e.name), 1), vue.createElementVNode("small", null, vue.toDisplayString(e.model || "\u672a\u586b\u5199\u6a21\u578b"), 1) ]), e.id === vue.unref(r).settings.defaultConfigId ? (vue.openBlock(), vue.createElementBlock("span", An, "\u9ed8\u8ba4")) : e.enabled ? (vue.openBlock(), vue.createElementBlock("span", Tn)) : vue.createCommentVNode("", !0) ], 10, qn)))), 128)) ]) ]), c.value ? (vue.openBlock(), vue.createElementBlock("section", Cn, [ vue.createElementVNode("div", Sn, [ vue.createElementVNode("div", null, [ vue.createElementVNode("h4", null, vue.toDisplayString(c.value.name), 1), vue.createElementVNode("p", null, vue.toDisplayString(c.value.providerKind) + " \xb7 " + vue.toDisplayString(c.value.baseUrl), 1) ]), vue.createElementVNode("span", { class: vue.normalizeClass([ "aah-tag", c.value.enabled ? "aah-tag-success" : "aah-tag-warning" ]) }, vue.toDisplayString(c.value.enabled ? "\u5df2\u542f\u7528" : "\u672a\u542f\u7528"), 3) ]), vue.createElementVNode("section", In, [ En, vue.createElementVNode("div", Un, [ vue.createElementVNode("label", Hn, [ Pn, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[1] || (t[1] = e => c.value.name = e), class: "aah-input", onChange: save }, null, 544), [ [ vue.vModelText, c.value.name ] ]) ]), vue.createElementVNode("label", jn, [ Ln, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[2] || (t[2] = e => c.value.baseUrl = e), class: "aah-input", onChange: save }, null, 544), [ [ vue.vModelText, c.value.baseUrl ] ]) ]), vue.createElementVNode("label", zn, [ Mn, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[3] || (t[3] = e => c.value.model = e), class: "aah-input", onChange: save }, null, 544), [ [ vue.vModelText, c.value.model ] ]) ]), vue.createElementVNode("label", On, [ vue.createElementVNode("span", null, vue.toDisplayString(h.value), 1), vue.createElementVNode("input", { value: (null == (a = c.value.credential) ? void 0 : a.value) || "", class: "aah-input", type: "password", autocomplete: "off", onChange: t[4] || (t[4] = e => { return t = c.value, a = e.target.value, r.updateCredential(t.id, { type: "api-key", value: a }), void syncLegacyAppConfig(); var t, a; }) }, null, 40, $n), vue.createElementVNode("p", Fn, [ vue.createTextVNode(vue.toDisplayString(x.value) + " ", 1), g.value ? (vue.openBlock(), vue.createElementBlock("a", { key: 0, href: g.value, target: "_blank", rel: "noopener noreferrer" }, "\u5982\u4f55\u83b7\u53d6 API Key", 8, Dn)) : vue.createCommentVNode("", !0) ]) ]) ]) ]), vue.createElementVNode("section", Nn, [ Rn, vue.createElementVNode("div", Bn, [ vue.createElementVNode("label", Gn, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": t[5] || (t[5] = e => c.value.enabled = e), onChange: save }, null, 544), [ [ vue.vModelCheckbox, c.value.enabled ] ]), Vn ]), vue.createElementVNode("label", Kn, [ Wn, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": t[6] || (t[6] = e => vue.unref(r).settings.adoptionStrategy = e), class: "aah-select", onChange: save }, Yn, 544), [ [ vue.vModelSelect, vue.unref(r).settings.adoptionStrategy ] ]) ]) ]) ]), vue.createElementVNode("details", { class: "ai-config-section ai-config-advanced", open: o.value }, [ vue.createElementVNode("summary", { onClick: t[7] || (t[7] = vue.withModifiers((e => o.value = !o.value), [ "prevent" ])) }, "\u9ad8\u7ea7\u8bbe\u7f6e"), vue.createElementVNode("div", er, [ vue.createElementVNode("label", tr, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": t[8] || (t[8] = e => c.value.stream = e), onChange: save }, null, 544), [ [ vue.vModelCheckbox, c.value.stream ] ]), ar ]), vue.createElementVNode("label", nr, [ rr, vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[9] || (t[9] = e => c.value.timeout = e), class: "aah-input", type: "number", min: "1000", step: "1000", onChange: save }, null, 544), [ [ vue.vModelText, c.value.timeout, void 0, { number: !0 } ] ]) ]) ]) ], 8, Zn), vue.createElementVNode("div", sr, [ vue.createElementVNode("div", ir, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-plain", type: "button", onClick: t[10] || (t[10] = e => (e => { const t = r.settings.configs.find((t => t.id === e)); t && (t.enabled = !0), r.settings.defaultConfigId = e, save(); })(c.value.id)) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:star-outline", class: "icon-inline" }), vue.createTextVNode(" \u8bbe\u4e3a\u9ed8\u8ba4 ") ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-danger", type: "button", onClick: t[11] || (t[11] = e => { return t = c.value, void (l.value = t); var t; }) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:delete-outline", class: "icon-inline" }), vue.createTextVNode(" \u5220\u9664\u914d\u7f6e ") ]) ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", disabled: m.value, onClick: t[12] || (t[12] = e => vue.unref(r).testConfig(c.value.id)) }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:connection", class: "icon-inline" }), vue.createTextVNode(" " + vue.toDisplayString(m.value ? "\u6d4b\u8bd5\u4e2d..." : "\u6d4b\u8bd5\u8fde\u63a5"), 1) ], 8, or) ]), d.value ? (vue.openBlock(), vue.createElementBlock("div", lr, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:information-outline", class: "alert-icon" }), vue.createElementVNode("span", null, vue.toDisplayString(d.value), 1) ])) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("section", cr, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:robot-outline" }), pr ])) ]), l.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "modal-mask", role: "dialog", "aria-modal": "true", "aria-labelledby": "ai-config-delete-title", onClick: vue.withModifiers(closeDeleteConfirm, [ "self" ]) }, [ vue.createElementVNode("div", ur, [ vue.createElementVNode("div", { class: "modal-header" }, [ dr, vue.createElementVNode("button", { class: "modal-close", type: "button", "aria-label": "\u5173\u95ed\u5220\u9664\u786e\u8ba4", onClick: closeDeleteConfirm }, "\xd7") ]), vue.createElementVNode("div", mr, [ vue.createElementVNode("p", hr, " \u786e\u5b9a\u8981\u5220\u9664 AI \u914d\u7f6e\u300c" + vue.toDisplayString(l.value.name) + "\u300d\u5417\uff1f\u6b64\u64cd\u4f5c\u4e0d\u53ef\u6062\u590d\u3002 ", 1) ]), vue.createElementVNode("div", { class: "modal-footer" }, [ vue.createElementVNode("button", { class: "aah-btn", type: "button", onClick: closeDeleteConfirm }, "\u53d6\u6d88"), vue.createElementVNode("button", { class: "aah-btn aah-btn-danger", type: "button", onClick: deleteConfig }, "\u5220\u9664") ]) ]) ])) : vue.createCommentVNode("", !0) ]); }; } }), gr = { class: "settings-sidebar" }, vr = { class: "sidebar-header" }, yr = { class: "settings-search-input-wrapper" }, br = { class: "sidebar-nav custom-scroll", role: "tablist", "aria-orientation": "vertical" }, wr = [ "onClick", "aria-selected" ], xr = { class: "sidebar-footer" }, kr = { class: "aah-alert aah-alert-info" }, qr = vue.createElementVNode("span", null, "\u914d\u7f6e\u81ea\u52a8\u4fdd\u5b58", -1), _r = { class: "settings-content custom-scroll", role: "tabpanel" }, Ar = { class: "settings-content-header" }, Tr = vue.createElementVNode("span", { class: "aah-tag aah-tag-success" }, "\u81ea\u52a8\u4fdd\u5b58", -1), Cr = { key: 0, class: "group-header" }, Sr = { class: "group-title" }, Ir = { key: 2, class: "aah-card settings-section settings-config-section" }, Er = { key: 0, class: "empty-search" }, Ur = { class: "settings-empty-text" }, Hr = "ai ai\u8bbe\u7f6e \u6a21\u578b \u5e73\u53f0 api key base url \u51ed\u8bc1 \u8f85\u52a9\u7b54\u9898 \u91c7\u7eb3\u7b56\u7565 \u6d4b\u8bd5\u8fde\u63a5", Pr = vue.defineComponent({ __name: "Base", setup(e) { const t = Kt(), n = [ { id: "display", label: "\u663e\u793a\u8bbe\u7f6e", icon: "mdi:palette" }, { id: "system", label: "\u7cfb\u7edf\u8bbe\u7f6e", icon: "mdi:cog" }, { id: "ai", label: "AI\u8bbe\u7f6e", icon: "mdi:robot" }, { id: "hotkey", label: "\u5feb\u6377\u952e", icon: "mdi:keyboard" } ], r = vue.ref("display"), s = vue.ref(""), o = vue.computed((() => s.value.trim().length > 0)), normalizeSearchText = e => e.toLowerCase().replace(/\s+/g, ""), l = vue.ref(null), handleHotkeyKeydown = (e, t) => { if (e.preventDefault(), e.stopPropagation(), [ "Control", "Shift", "Alt", "Meta" ].includes(e.key)) return; const a = []; e.ctrlKey && a.push("Ctrl"), e.shiftKey && a.push("Shift"), e.altKey && a.push("Alt"); let n = e.key; n = " " === n ? "Space" : e.code.startsWith("Key") ? e.code.replace("Key", "") : e.code.startsWith("Digit") ? e.code.replace("Digit", "") : e.code.startsWith("Arrow") ? e.code : e.key.toUpperCase(), a.push(n); const r = a.join("+"); t.value = r, l.value = null, msg(`\u5feb\u6377\u952e\u5df2\u8bbe\u7f6e\u4e3a: ${r}`, "success"); }, startRecording = e => { l.value = e; }, c = vue.computed((() => { const e = s.value.trim().toLowerCase(), a = t.ConfigInput; if (o.value) return n.map((t => { if ("ai" === t.id) { const a = normalizeSearchText(e), n = normalizeSearchText(Hr), r = Hr.toLowerCase().includes(e) || n.includes(a) ? [ { type: "switch", label: "AI\u8bbe\u7f6e", name: "aiSettingsSearch", value: !1, desc: Hr, options: [] } ] : []; return { ...t, items: r }; } const n = (a[t.id] || []).filter((t => t.label.toLowerCase().includes(e) || t.desc && t.desc.toLowerCase().includes(e))); return { ...t, items: n }; })).filter((e => e.items.length > 0)); const i = n.find((e => e.id === r.value)); return i ? [ { ...i, items: a[i.id] || [] } ] : []; })), p = vue.computed((() => n.find((e => e.id === r.value)) || n[0])); return vue.watch(t.app, (e => { t.setConfig(e); })), vue.watch(t.ConfigInput, (e => { for (let a in e) for (let n in e[a]) { let r = e[a][n]; t.app[r.name] = r.value; } msg("\u914d\u7f6e\u4fee\u6539\u6210\u529f", "success"), t.app, t.setConfig(t.app); })), vue.onMounted((() => { t.activeSettingSection && (r.value = t.activeSettingSection, t.setActiveSettingSection("")); })), (e, t) => (vue.openBlock(), vue.createBlock($a, { class: "settings-page" }, { default: vue.withCtx((() => [ vue.createElementVNode("div", { class: vue.normalizeClass([ "settings-layout", { "settings-layout-ai": !o.value && "ai" === r.value } ]) }, [ vue.createElementVNode("aside", gr, [ vue.createElementVNode("div", vr, [ vue.createElementVNode("div", yr, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:magnify", class: "search-icon" }), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t[0] || (t[0] = e => s.value = e), placeholder: "\u641c\u7d22\u8bbe\u7f6e...", class: "aah-input settings-search-input", "aria-label": "\u641c\u7d22\u8bbe\u7f6e" }, null, 512), [ [ vue.vModelText, s.value ] ]) ]) ]), vue.withDirectives(vue.createElementVNode("nav", br, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(n, (e => vue.createElementVNode("button", { key: e.id, type: "button", class: vue.normalizeClass([ "nav-item", { active: r.value === e.id } ]), onClick: t => r.value = e.id, role: "tab", "aria-selected": r.value === e.id }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: e.icon, class: "nav-icon" }, null, 8, [ "icon" ]), vue.createElementVNode("span", null, vue.toDisplayString(e.label), 1) ], 10, wr))), 64)) ], 512), [ [ vue.vShow, !o.value ] ]), vue.createElementVNode("div", xr, [ vue.createElementVNode("div", kr, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:information", class: "alert-icon" }), qr ]) ]) ]), vue.createElementVNode("main", _r, [ vue.createElementVNode("header", Ar, [ vue.createElementVNode("div", null, [ vue.createElementVNode("h2", null, vue.toDisplayString(o.value ? "\u641c\u7d22\u8bbe\u7f6e" : p.value.label), 1), vue.createElementVNode("p", null, vue.toDisplayString(o.value ? `\u6b63\u5728\u641c\u7d22\u201c${s.value}\u201d` : "\u4fee\u6539\u540e\u4f1a\u81ea\u52a8\u4fdd\u5b58\u5230\u672c\u5730\u7f13\u5b58"), 1) ]), Tr ]), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(c.value, (e => (vue.openBlock(), vue.createElementBlock("div", { key: e.id, class: "setting-group" }, [ o.value ? (vue.openBlock(), vue.createElementBlock("div", Cr, [ vue.createElementVNode("h3", Sr, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: e.icon, class: "icon-inline" }, null, 8, [ "icon" ]), vue.createTextVNode(" " + vue.toDisplayString(e.label), 1) ]) ])) : vue.createCommentVNode("", !0), "ai" === e.id ? (vue.openBlock(), vue.createBlock(fr, { key: 1 })) : (vue.openBlock(), vue.createElementBlock("div", Ir, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.items, ((e, t) => (vue.openBlock(), vue.createBlock(pn, { key: t, item: e, "recording-hotkey": l.value, onStartRecording: startRecording, onHotkeyKeydown: handleHotkeyKeydown }, null, 8, [ "item", "recording-hotkey" ])))), 128)) ])) ])))), 128)), o.value && 0 === c.value.length ? (vue.openBlock(), vue.createElementBlock("div", Er, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:magnify-close", class: "settings-empty-icon" }), vue.createElementVNode("p", Ur, '\u672a\u627e\u5230\u4e0e "' + vue.toDisplayString(s.value) + '" \u76f8\u5173\u7684\u8bbe\u7f6e', 1) ])) : vue.createCommentVNode("", !0) ]) ], 2) ])), _: 1 })); } }), jr = { class: "ask-page" }, Lr = { key: 0, class: "ask-toolbar" }, zr = { class: "ask-toolbar__primary" }, Mr = { class: "ask-toolbar__progress" }, Or = { class: "ask-progress-text" }, $r = { class: "ask-progress-bar" }, Fr = { class: "ask-toolbar__actions" }, Dr = { key: 1, class: "ask-nav", open: "" }, Nr = vue.createElementVNode("summary", null, "\u9898\u76ee\u5bfc\u822a", -1), Rr = vue.createElementVNode("div", { class: "ask-nav-legend" }, [ vue.createElementVNode("span", { class: "legend-item legend-current" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u5f53\u524d") ]), vue.createElementVNode("span", { class: "legend-item legend-done" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u5df2\u7b54") ]), vue.createElementVNode("span", { class: "legend-item legend-error" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u65e0\u7b54\u6848") ]), vue.createElementVNode("span", { class: "legend-item legend-unanswered" }, [ vue.createElementVNode("i"), vue.createTextVNode("\u672a\u7b54") ]) ], -1), Br = { class: "ask-nav-grid" }, Gr = [ "onClick" ], Vr = { key: 2, class: "ask-card" }, Kr = { class: "ask-card__header" }, Wr = vue.createElementVNode("h3", { class: "ask-card__title" }, "\u5f53\u524d\u9898\u76ee", -1), Qr = { class: "ask-card__actions" }, Jr = { class: "ask-card__body" }, Xr = [ "innerHTML" ], Yr = [ "innerHTML" ], Zr = { class: "reading-questions" }, es = [ "innerHTML" ], ts = [ "innerHTML" ], as = [ "innerHTML" ], ns = [ "innerHTML" ], rs = { key: 0 }, ss = { class: "ask-match-table" }, is = [ "innerHTML" ], os = [ "value" ], ls = { key: 2, class: "ask-form-note ask-form-note--success" }, cs = { key: 3, class: "ask-form-note ask-form-note--danger" }, ps = { key: 3, class: "ask-card" }, us = { class: "ask-loading" }, ds = { key: 4, class: "ask-card" }, ms = vue.createElementVNode("header", { class: "ask-card__header" }, [ vue.createElementVNode("h3", { class: "ask-card__title" }, "\u7b54\u6848 / AI") ], -1), hs = { class: "ask-card__body" }, fs = { class: "answer-header" }, gs = { class: "aah-tag aah-tag-primary" }, vs = { key: 0, class: "answer-meta" }, ys = { key: 0 }, bs = [ "innerHTML" ], ws = { key: 1 }, xs = { key: 0 }, ks = [ "innerHTML" ], qs = [ "innerHTML" ], _s = { key: 1, class: "answer-block ai-preview-block" }, As = { class: "answer-header" }, Ts = vue.createElementVNode("span", { class: "aah-tag aah-tag-warning" }, "AI \u5efa\u8bae", -1), Cs = { class: "answer-meta" }, Ss = { class: "ask-preview-actions" }, Is = { key: 2, class: "aah-alert aah-alert-warning" }, Es = { key: 3, class: "answer-block ai-answer-block" }, Us = { class: "ai-answer-divider" }, Hs = { class: "ai-answer-title" }, Ps = { key: 0, class: "ai-streaming-tag" }, js = vue.createElementVNode("span", { class: "ai-dot" }, null, -1), Ls = vue.createElementVNode("span", { class: "ai-dot" }, null, -1), zs = vue.createElementVNode("span", { class: "ai-dot" }, null, -1), Ms = [ "innerHTML" ], Os = { key: 1, class: "ai-stream-placeholder" }, $s = { key: 5, class: "ask-empty" }, Fs = vue.createElementVNode("p", null, "\u6682\u65e0\u9898\u76ee\u6570\u636e", -1), Ds = { class: "modal-panel" }, Ns = { class: "modal-header" }, Rs = vue.createElementVNode("h3", { id: "settings-title", class: "modal-title" }, "\u7b54\u9898\u8bbe\u7f6e", -1), Bs = { class: "modal-body" }, Gs = { class: "ask-settings" }, Vs = { class: "native-checkbox" }, Ks = vue.createElementVNode("span", null, "\u8df3\u8fc7\u5df2\u4f5c\u7b54", -1), Ws = { class: "native-checkbox" }, Qs = vue.createElementVNode("span", null, "\u81ea\u52a8\u7b54\u9898", -1), Js = { class: "native-checkbox" }, Xs = vue.createElementVNode("span", null, "\u81ea\u52a8\u8df3\u8f6c", -1), Ys = { class: "native-checkbox" }, Zs = vue.createElementVNode("span", null, "\u65e0\u7b54\u6848\u968f\u673a\u7b54\u9898", -1), ei = { class: "native-checkbox" }, ti = vue.createElementVNode("span", null, [ vue.createTextVNode("\u4f7f\u7528AI\u8f85\u52a9\u7b54\u9898 "), vue.createElementVNode("small", null, "(AI\u6b63\u786e\u7387\u4e0d\u4fdd\u8bc1)") ], -1), ai = { key: 0, class: "aah-alert aah-alert-warning" }, ni = { class: "range-row" }, ri = [ "min" ], si = { key: 0, class: "ask-tags" }, ii = { class: "modal-panel" }, oi = { class: "modal-header" }, li = vue.createElementVNode("h3", { id: "tips-title", class: "modal-title" }, "\u4f7f\u7528\u63d0\u793a", -1), ci = { class: "modal-body" }, pi = { class: "info-banner ask-info" }, ui = [ "innerHTML" ], di = { class: "ask-types" }, mi = vue.createElementVNode("summary", null, "\u67e5\u770b\u652f\u6301\u9898\u578b", -1), hi = [ "innerHTML" ], fi = vue.defineComponent({ __name: "Ask", setup(e) { const t = pa(), n = Kt(), r = ca(), s = vue.ref(!1), o = vue.ref(!1), handleKeydown = e => { "Escape" === e.key && (s.value && (s.value = !1), o.value && (o.value = !1)); }; vue.watch([ s, o ], (([e, t]) => { e || t ? document.addEventListener("keydown", handleKeydown) : document.removeEventListener("keydown", handleKeydown); })); const l = vue.computed((() => t.aiLoadingIndex === t.questionInx)), c = vue.computed((() => Boolean(t.current && (t.current.aiMsg || l.value)))), getOptionIndex = e => String.fromCharCode(65 + e); vue.watch(n.app, (e => { n.setConfig(e); })); const watchAutoNext = () => { Cache.set("autoNext", t.autoNext); }, watchSkipFinish = () => { Cache.set("skipFinish", t.skipFinish); }, watchAutoAnswer = () => { Cache.set("autoAnswer", t.autoAnswer); }, watchRandomAnswer = () => { Cache.set("randomAnswer", t.randomAnswer); }, watchAskGpt = () => { msg("\u8bf7\u5148\u53bbAI\u641c\u9898\u9875\u9762\u6d4b\u8bd5AI\u662f\u5426\u53ef\u7528\uff0c\u518d\u542f\u7528\u7b54\u9898\uff0c\u7b54\u9898\u6b63\u786e\u7387\u65e0\u6cd5\u4fdd\u8bc1"), r.settings.enabledForAsk = n.app.askGpt, r.saveSettings(), Cache.set("askGpt", n.app.askGpt); }, watchDelay = () => { Cache.set("delay", t.delay); }; return (e, a) => (vue.openBlock(), vue.createBlock($a, null, { default: vue.withCtx((() => [ vue.createElementVNode("div", jr, [ vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("div", Lr, [ vue.createElementVNode("div", zr, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: a[0] || (a[0] = e => vue.unref(t).start ? vue.unref(t).pause() : vue.unref(t).toggleStart()) }, vue.toDisplayString(vue.unref(t).start ? "\u6682\u505c\u7b54\u9898" : "\u5f00\u59cb\u7b54\u9898"), 1), vue.createElementVNode("button", { class: "aah-btn", type: "button", onClick: a[1] || (a[1] = e => vue.unref(t).restart()) }, "\u91cd\u65b0\u7b54\u9898") ]), vue.createElementVNode("div", Mr, [ vue.createElementVNode("span", Or, vue.toDisplayString(vue.unref(t).questionInx + 1) + " / " + vue.toDisplayString(vue.unref(t).questionList.length), 1), vue.createElementVNode("div", $r, [ vue.createElementVNode("i", { style: vue.normalizeStyle({ width: vue.unref(t).questionList.length ? (vue.unref(t).questionInx + 1) / vue.unref(t).questionList.length * 100 + "%" : "0%" }) }, null, 4) ]) ]), vue.createElementVNode("div", Fr, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: a[2] || (a[2] = e => o.value = !0), "aria-label": "\u4f7f\u7528\u63d0\u793a" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:information-outline" }) ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: a[3] || (a[3] = e => s.value = !0), "aria-label": "\u7b54\u9898\u8bbe\u7f6e" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:cog-outline" }) ]) ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("details", Dr, [ Nr, Rr, vue.createElementVNode("div", Br, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).questionList, ((e, a) => (vue.openBlock(), vue.createElementBlock("button", { key: a, type: "button", class: vue.normalizeClass([ "ask-nav-cell", [ a === vue.unref(t).questionInx ? "is-current" : "", 1 === e.status ? "is-done" : 2 === e.status ? "is-error" : "" ] ]), onClick: e => vue.unref(t).toQuestion(a) }, vue.toDisplayString(a + 1), 11, Gr)))), 128)) ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("section", Vr, [ vue.createElementVNode("header", Kr, [ Wr, vue.createElementVNode("div", Qr, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: a[4] || (a[4] = e => vue.unref(t).reAnswer(vue.unref(t).questionInx)) }, "\u91cd\u7b54"), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: a[5] || (a[5] = e => vue.unref(t).aiAnswer(vue.unref(t).questionInx)) }, "AI \u7b54\u9898") ]) ]), vue.createElementVNode("div", Jr, [ "15" == vue.unref(t).current.type ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createElementVNode("div", { class: "aah_title", innerHTML: "[" + vue.unref(typeConvert)(vue.unref(t).current.type ?? "", !1) + "]\u9605\u8bfb\u7406\u89e3" }, null, 8, Xr), vue.createElementVNode("div", { class: "reading-passage", innerHTML: vue.unref(t).current.question }, null, 8, Yr), vue.createElementVNode("div", Zr, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.options, ((e, a) => (vue.openBlock(), vue.createElementBlock("div", { key: a, class: "reading-sub-question" }, [ vue.createElementVNode("div", { class: "sub-question-title", innerHTML: a + 1 + ". " + e.question }, null, 8, es), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((e, n) => (vue.openBlock(), vue.createElementBlock("p", { class: vue.normalizeClass([ "aah_options", { active: vue.unref(t).current.form && vue.unref(t).current.form.match && vue.unref(t).current.form.match[a] && vue.unref(t).current.form.match[a].includes(n) } ]), key: n, innerHTML: getOptionIndex(n) + ". " + e }, null, 10, ts)))), 128)) ])))), 128)) ]) ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.createElementVNode("div", { class: "aah_title", innerHTML: "[" + vue.unref(typeConvert)(vue.unref(t).current.type ?? "", !1) + "]" + vue.unref(t).current.question }, null, 8, as), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.options, ((e, a) => (vue.openBlock(), vue.createElementBlock("p", { class: vue.normalizeClass([ "aah_options", { active: vue.unref(t).current.form && vue.unref(t).current.form.match && vue.unref(t).current.form.match.includes(a) } ]), key: a, innerHTML: getOptionIndex(a) + ". " + e }, null, 10, ns)))), 128)), "24" == vue.unref(t).current.type ? (vue.openBlock(), vue.createElementBlock("div", rs, [ vue.createElementVNode("table", ss, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.match, ((e, a) => (vue.openBlock(), vue.createElementBlock("tr", { key: a }, [ vue.createElementVNode("td", { innerHTML: e }, null, 8, is), vue.createElementVNode("td", null, [ vue.createElementVNode("select", null, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).current.selects[a], (e => (vue.openBlock(), vue.createElementBlock("option", { key: e.value, value: e.value }, vue.toDisplayString(e.text), 9, os)))), 128)) ]) ]) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0) ], 64)), vue.unref(t).current.form ? (vue.openBlock(), vue.createElementBlock("p", ls, " \u91c7\u7528\u3010" + vue.toDisplayString(vue.unref(t).current.form.form) + "\u3011\u7684\u7b54\u6848 ", 1)) : vue.createCommentVNode("", !0), "8" != vue.unref(t).current.type && vue.unref(t).current.type ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("p", cs, " \u5f53\u524d\u9898\u578b\u6682\u4e0d\u652f\u6301\uff0c\u8bf7\u53cd\u9988\u7ed9\u4f5c\u8005\u5427 ")) ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).loading ? (vue.openBlock(), vue.createElementBlock("section", ps, [ vue.createElementVNode("div", us, vue.toDisplayString(vue.unref(t).loadingText), 1) ])) : vue.createCommentVNode("", !0), vue.unref(t).current ? (vue.openBlock(), vue.createElementBlock("section", ds, [ ms, vue.createElementVNode("div", hs, [ vue.unref(t).current.answer ? (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(t).current.answer, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: t, class: "answer-block" }, [ vue.createElementVNode("div", fs, [ vue.createElementVNode("span", gs, vue.toDisplayString(e.form), 1), e.duration ? (vue.openBlock(), vue.createElementBlock("span", vs, vue.toDisplayString(e.duration) + "ms", 1)) : vue.createCommentVNode("", !0) ]), "object" == typeof e.answer && e.answer ? (vue.openBlock(), vue.createElementBlock("div", ys, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.answer, ((e, t) => { return vue.openBlock(), vue.createElementBlock("div", { key: t, class: "answer-field-html", innerHTML: (a = "string" == typeof e ? e : String(e), markToHtml(a ?? "")) }, null, 8, bs); var a; })), 128)) ])) : (vue.openBlock(), vue.createElementBlock("div", ws, [ e.needLogin ? (vue.openBlock(), vue.createElementBlock("div", xs, [ vue.createElementVNode("span", { innerHTML: e.msg }, null, 8, ks), vue.createElementVNode("button", { class: "aah-btn aah-btn-small aah-btn-primary", type: "button", onClick: a[6] || (a[6] = e => vue.unref(n).setPage("system", "account")) }, "\u70b9\u51fb\u767b\u5f55") ])) : (vue.openBlock(), vue.createElementBlock("div", { key: 1, innerHTML: e.answer ? e.answer : e.msg ?? "\u6682\u65e0\u7b54\u6848" }, null, 8, qs)) ])) ])))), 128)) : vue.createCommentVNode("", !0), vue.unref(t).aiPreview && vue.unref(t).aiPreview.index === vue.unref(t).questionInx ? (vue.openBlock(), vue.createElementBlock("div", _s, [ vue.createElementVNode("div", As, [ Ts, vue.createElementVNode("span", Cs, vue.toDisplayString(vue.unref(t).aiPreview.reason), 1) ]), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).aiPreview.answer, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { class: "answer-field-html", key: t }, vue.toDisplayString(e), 1)))), 128)), vue.createElementVNode("div", Ss, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-primary aah-btn-small", type: "button", onClick: a[7] || (a[7] = e => vue.unref(t).confirmAiPreview()) }, "\u786e\u8ba4\u586b\u5165"), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: a[8] || (a[8] = e => vue.unref(t).skipAiPreview()) }, "\u8df3\u8fc7") ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).aiFailureMap[vue.unref(t).questionInx] ? (vue.openBlock(), vue.createElementBlock("div", Is, vue.toDisplayString(vue.unref(t).aiFailureMap[vue.unref(t).questionInx]), 1)) : vue.createCommentVNode("", !0), c.value ? (vue.openBlock(), vue.createElementBlock("div", Es, [ vue.createElementVNode("div", Us, [ vue.createElementVNode("span", Hs, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:sparkles", class: "ai-icon" }), vue.createTextVNode(" AI \u6df1\u5ea6\u89e3\u6790 ") ]), l.value ? (vue.openBlock(), vue.createElementBlock("span", Ps, [ js, Ls, zs, vue.createTextVNode(" \u6b63\u5728\u751f\u6210... ") ])) : vue.createCommentVNode("", !0) ]), vue.unref(t).current.aiMsg ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, innerHTML: vue.unref(t).currentAiMd, class: "ai-answer-markdown" }, null, 8, Ms)) : (vue.openBlock(), vue.createElementBlock("div", Os, " AI \u6b63\u5728\u601d\u8003\uff0c\u6d41\u5f0f\u5185\u5bb9\u4f1a\u5b9e\u65f6\u586b\u5145\uff0c\u8bf7\u7a0d\u5019... ")) ])) : vue.createCommentVNode("", !0) ]) ])) : vue.createCommentVNode("", !0), vue.unref(t).current ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("div", $s, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit", class: "ask-empty__icon" }), Fs ])) ]), s.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "modal-mask", onClick: a[16] || (a[16] = vue.withModifiers((e => s.value = !1), [ "self" ])), role: "dialog", "aria-modal": "true", "aria-labelledby": "settings-title" }, [ vue.createElementVNode("div", Ds, [ vue.createElementVNode("div", Ns, [ Rs, vue.createElementVNode("button", { class: "modal-close", onClick: a[9] || (a[9] = e => s.value = !1), "aria-label": "\u5173\u95ed\u8bbe\u7f6e" }, "\xd7") ]), vue.createElementVNode("div", Bs, [ vue.createElementVNode("div", Gs, [ vue.createElementVNode("label", Vs, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": a[10] || (a[10] = e => vue.unref(t).skipFinish = e), onChange: watchSkipFinish }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).skipFinish ] ]), Ks ]), vue.createElementVNode("label", Ws, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": a[11] || (a[11] = e => vue.unref(t).autoAnswer = e), onChange: watchAutoAnswer }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).autoAnswer ] ]), Qs ]), vue.createElementVNode("label", Js, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": a[12] || (a[12] = e => vue.unref(t).autoNext = e), onChange: watchAutoNext }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).autoNext ] ]), Xs ]), vue.createElementVNode("label", Ys, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": a[13] || (a[13] = e => vue.unref(t).randomAnswer = e), onChange: watchRandomAnswer }, null, 544), [ [ vue.vModelCheckbox, vue.unref(t).randomAnswer ] ]), Zs ]), vue.createElementVNode("label", ei, [ vue.withDirectives(vue.createElementVNode("input", { type: "checkbox", "onUpdate:modelValue": a[14] || (a[14] = e => vue.unref(n).app.askGpt = e), onChange: watchAskGpt }, null, 544), [ [ vue.vModelCheckbox, vue.unref(n).app.askGpt ] ]), ti ]), vue.unref(t).minDelay > 0 ? (vue.openBlock(), vue.createElementBlock("div", ai, " \u7531\u4e8e\u89c4\u5219\u9650\u5236\uff0c\u5f53\u524d\u5e73\u53f0\u7b54\u9898\u95f4\u9694\u6700\u5c0f\u4e3a " + vue.toDisplayString(vue.unref(t).minDelay) + "ms ", 1)) : vue.createCommentVNode("", !0), vue.createElementVNode("div", ni, [ vue.createElementVNode("label", null, "\u95f4\u9694\uff08" + vue.toDisplayString(vue.unref(t).delay) + "ms\uff09", 1), vue.withDirectives(vue.createElementVNode("input", { type: "range", min: vue.unref(t).minDelay, max: 5e3, step: "100", "onUpdate:modelValue": a[15] || (a[15] = e => vue.unref(t).delay = e), onInput: watchDelay }, null, 40, ri), [ [ vue.vModelText, vue.unref(t).delay, void 0, { number: !0 } ] ]) ]) ]), vue.unref(t).formMap ? (vue.openBlock(), vue.createElementBlock("div", si, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(t).formMap, ((e, t) => (vue.openBlock(), vue.createElementBlock("span", { class: "aah-tag", key: t }, vue.toDisplayString(t) + ":" + vue.toDisplayString(e) + " \u6b21", 1)))), 128)) ])) : vue.createCommentVNode("", !0) ]) ]) ])) : vue.createCommentVNode("", !0), o.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "modal-mask", onClick: a[18] || (a[18] = vue.withModifiers((e => o.value = !1), [ "self" ])), role: "dialog", "aria-modal": "true", "aria-labelledby": "tips-title" }, [ vue.createElementVNode("div", ii, [ vue.createElementVNode("div", oi, [ li, vue.createElementVNode("button", { class: "modal-close", onClick: a[17] || (a[17] = e => o.value = !1), "aria-label": "\u5173\u95ed\u63d0\u793a" }, "\xd7") ]), vue.createElementVNode("div", ci, [ vue.createElementVNode("div", pi, [ vue.createElementVNode("div", { class: "info-body", innerHTML: vue.unref(t).tipsMd }, null, 8, ui), vue.createElementVNode("details", di, [ mi, vue.createElementVNode("div", { innerHTML: vue.unref(t).typesMd }, null, 8, hi) ]) ]) ]) ]) ])) : vue.createCommentVNode("", !0) ])), _: 1 })); } }), gi = { class: "modal-panel" }, vi = { class: "modal-header" }, yi = { class: "modal-body" }, bi = { class: "form-row" }, wi = vue.createElementVNode("label", null, "\u9898\u578b", -1), xi = [ "value" ], ki = { class: "form-row" }, qi = vue.createElementVNode("label", null, "\u9898\u5e72", -1), _i = { key: 0, class: "form-row" }, Ai = vue.createElementVNode("label", null, "\u9009\u9879", -1), Ti = { class: "option-list" }, Ci = [ "onClick" ], Si = [ "onUpdate:modelValue" ], Ii = [ "onClick" ], Ei = { key: 1, class: "form-row" }, Ui = vue.createElementVNode("label", null, "\u7b54\u6848", -1), Hi = { class: "option-list" }, Pi = [ "onUpdate:modelValue" ], ji = [ "onClick" ], Li = vue.defineComponent({ __name: "QuestionEdit", props: { ques: {}, visible: { type: Boolean } }, emits: [ "handleClose" ], setup(e, {emit: t}) { const n = e, r = vue.ref(n.visible); vue.watch((() => n.visible), (e => { r.value = e; })); const s = t, closeDialog = () => { r.value = !1, s("handleClose"); }, handleCancel = () => { closeDialog(); }, handleSave = () => { Answer.cacheAnswer(n.ques), Cache.matchRemove(n.ques.key), msg("\u9898\u76ee\u4fee\u6539\u6210\u529f", "success"), closeDialog(); }, handleDelete = e => { n.ques.options.splice(e, 1), n.ques.answer.includes(n.ques.options[e]) && (n.ques.answer = n.ques.answer.filter((t => t !== n.ques.options[e]))); }, handleAdd = () => { n.ques.options.push(""); }; return (e, t) => { var a; return r.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "modal-mask", onClick: vue.withModifiers(handleCancel, [ "self" ]) }, [ vue.createElementVNode("div", gi, [ vue.createElementVNode("div", vi, [ vue.createElementVNode("h3", null, "\u9898\u76ee\u7f16\u8f91 [" + vue.toDisplayString(null == (a = e.ques) ? void 0 : a.type) + "]", 1), vue.createElementVNode("button", { class: "modal-close", type: "button", onClick: handleCancel }, "\xd7") ]), vue.createElementVNode("div", yi, [ vue.createElementVNode("div", bi, [ wi, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": t[0] || (t[0] = t => e.ques.type = t), class: "base-select" }, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(Ft), ((e, t) => (vue.openBlock(), vue.createElementBlock("option", { key: e, value: e }, vue.toDisplayString(t), 9, xi)))), 128)) ], 512), [ [ vue.vModelSelect, e.ques.type ] ]) ]), vue.createElementVNode("div", ki, [ qi, vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": t[1] || (t[1] = t => e.ques.question = t), class: "base-input", rows: "5" }, null, 512), [ [ vue.vModelText, e.ques.question ] ]) ]), e.ques.options && Array.isArray(e.ques.options) && e.ques.options.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _i, [ Ai, vue.createElementVNode("div", Ti, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.ques.options, ((t, a) => (vue.openBlock(), vue.createElementBlock("div", { key: a, class: "option-row" }, [ vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "option-selector", { active: e.ques.answer.includes(t) } ]), onClick: e => (e => { n.ques.answer = n.ques.answer.includes(e) ? n.ques.answer.filter((t => t !== e)) : [ ...n.ques.answer, e ], n.ques.answer.sort(((e, t) => n.ques.options.indexOf(e) - n.ques.options.indexOf(t))); })(t) }, vue.toDisplayString(String.fromCharCode(65 + a)), 11, Ci), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.ques.options[a] = t, class: "base-input flex-grow" }, null, 8, Si), [ [ vue.vModelText, e.ques.options[a] ] ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: e => 0 !== a ? handleDelete(a) : handleAdd() }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 !== a ? "mdi:minus" : "mdi:plus" }, null, 8, [ "icon" ]) ], 8, Ii) ])))), 128)) ]) ])) : Array.isArray(e.ques.answer) && 0 === e.ques.options.length ? (vue.openBlock(), vue.createElementBlock("div", Ei, [ Ui, vue.createElementVNode("div", Hi, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.ques.answer, ((t, a) => (vue.openBlock(), vue.createElementBlock("div", { key: a, class: "option-row" }, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.ques.answer[a] = t, class: "base-input flex-grow" }, null, 8, Pi), [ [ vue.vModelText, e.ques.answer[a] ] ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: e => 0 !== a ? handleDelete(a) : handleAdd() }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 !== a ? "mdi:minus" : "mdi:plus" }, null, 8, [ "icon" ]) ], 8, ji) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0) ]), vue.createElementVNode("div", { class: "modal-footer" }, [ vue.createElementVNode("button", { class: "aah-btn", type: "button", onClick: handleCancel }, "\u53d6\u6d88"), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: handleSave }, "\u4fdd\u5b58") ]) ]) ])) : vue.createCommentVNode("", !0); }; } }), zi = { class: "modal-panel modal-panel-large" }, Mi = vue.createElementVNode("h3", null, "\u9605\u8bfb\u7406\u89e3\u9898\u76ee\u7f16\u8f91", -1), Oi = { class: "modal-body" }, $i = { class: "reading-form-section" }, Fi = { class: "reading-section-header" }, Di = vue.createElementVNode("h4", null, "\u9605\u8bfb\u6750\u6599", -1), Ni = { class: "form-row" }, Ri = vue.createElementVNode("label", null, "\u9898\u5e72\u5185\u5bb9", -1), Bi = { class: "reading-form-section" }, Gi = { class: "reading-section-header" }, Vi = vue.createElementVNode("h4", null, "\u5b50\u9898\u76ee\u5217\u8868", -1), Ki = { class: "reading-sub-questions-editor" }, Wi = { class: "reading-sub-question-header" }, Qi = { class: "reading-sub-question-number" }, Ji = [ "onUpdate:modelValue" ], Xi = [ "value" ], Yi = [ "onClick", "disabled" ], Zi = { class: "form-row" }, eo = vue.createElementVNode("label", null, "\u9898\u76ee\u5185\u5bb9", -1), to = [ "onUpdate:modelValue", "placeholder" ], ao = { key: 0, class: "form-row" }, no = vue.createElementVNode("label", null, "\u9009\u9879\u8bbe\u7f6e", -1), ro = { class: "option-list" }, so = [ "onClick" ], io = [ "onUpdate:modelValue", "placeholder" ], oo = [ "onClick" ], lo = { key: 1, class: "form-row" }, co = vue.createElementVNode("label", null, "\u53c2\u8003\u7b54\u6848", -1), po = { class: "reading-answer-list" }, uo = [ "onUpdate:modelValue", "placeholder" ], mo = [ "onClick" ], ho = vue.defineComponent({ __name: "ReadingComprehensionEdit", props: { ques: {}, visible: { type: Boolean } }, emits: [ "handleClose" ], setup(e, {emit: t}) { const n = e, r = t, s = vue.ref(n.visible), o = vue.ref(JSON.parse(JSON.stringify(n.ques || {}))); vue.watch((() => n.visible), (e => { s.value = e, e && n.ques && (o.value = JSON.parse(JSON.stringify(n.ques)), o.value.options || (o.value.options = []), o.value.options.forEach((e => { e.answer || (e.answer = []), e.options || (e.options = []), e.type || (e.type = "0"); }))); })); const closeDialog = () => { s.value = !1, r("handleClose"); }, handleCancel = () => { closeDialog(); }, handleSave = () => { if (o.value.question.trim()) if (0 !== o.value.options.length) { for (let e = 0; e < o.value.options.length; e++) { const t = o.value.options[e]; if (!t.question.trim()) return void msg(`\u7b2c ${e + 1} \u9898\u7684\u9898\u76ee\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a`, "error"); if ([ "0", "1" ].includes(t.type) && t.options.length < 2) return void msg(`\u7b2c ${e + 1} \u9898\u81f3\u5c11\u9700\u89812\u4e2a\u9009\u9879`, "error"); if (0 === t.answer.length) return void msg(`\u7b2c ${e + 1} \u9898\u5fc5\u987b\u8bbe\u7f6e\u7b54\u6848`, "error"); } Object.assign(n.ques, o.value), Answer.cacheAnswer(n.ques), Cache.matchRemove(n.ques.key), msg("\u9605\u8bfb\u7406\u89e3\u9898\u76ee\u4fee\u6539\u6210\u529f", "success"), closeDialog(); } else msg("\u81f3\u5c11\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a\u5b50\u9898\u76ee", "error"); else msg("\u8bf7\u586b\u5199\u9605\u8bfb\u6750\u6599\u5185\u5bb9", "error"); }, addSubQuestion = () => { o.value.options.push({ type: "0", question: "", options: [ "", "" ], answer: [] }); }; return (e, t) => s.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: "modal-mask", onClick: vue.withModifiers(handleCancel, [ "self" ]) }, [ vue.createElementVNode("div", zi, [ vue.createElementVNode("div", { class: "modal-header" }, [ Mi, vue.createElementVNode("button", { class: "modal-close", type: "button", onClick: handleCancel }, "\xd7") ]), vue.createElementVNode("div", Oi, [ vue.createElementVNode("div", $i, [ vue.createElementVNode("div", Fi, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-variant", class: "reading-section-icon" }), Di ]), vue.createElementVNode("div", Ni, [ Ri, vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": t[0] || (t[0] = e => o.value.question = e), class: "base-input", rows: "8", placeholder: "\u8bf7\u8f93\u5165\u9605\u8bfb\u7406\u89e3\u7684\u4e3b\u8981\u6750\u6599\u5185\u5bb9..." }, "\n ", 512), [ [ vue.vModelText, o.value.question ] ]) ]) ]), vue.createElementVNode("div", Bi, [ vue.createElementVNode("div", Gi, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:help-circle", class: "reading-section-icon" }), Vi, vue.createElementVNode("button", { class: "aah-btn aah-btn-primary aah-btn-small", type: "button", onClick: addSubQuestion }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:plus" }), vue.createTextVNode(" \u6dfb\u52a0\u9898\u76ee ") ]) ]), vue.createElementVNode("div", Ki, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(o.value.options, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: t, class: "reading-sub-question-editor" }, [ vue.createElementVNode("div", Wi, [ vue.createElementVNode("span", Qi, vue.toDisplayString(t + 1), 1), vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": t => e.type = t, class: "base-select reading-base-select-small" }, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(Ft), ((e, t) => (vue.openBlock(), vue.createElementBlock("option", { key: e, value: e }, vue.toDisplayString(t), 9, Xi)))), 128)) ], 8, Ji), [ [ vue.vModelSelect, e.type ] ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-danger aah-btn-small", type: "button", onClick: e => (e => { o.value.options.length > 1 && o.value.options.splice(e, 1); })(t), disabled: o.value.options.length <= 1 }, " \u5220\u9664 ", 8, Yi) ]), vue.createElementVNode("div", Zi, [ eo, vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": t => e.question = t, class: "base-input", rows: "3", placeholder: `\u8bf7\u8f93\u5165\u7b2c ${t + 1} \u9898\u7684\u9898\u76ee\u5185\u5bb9...` }, "\n ", 8, to), [ [ vue.vModelText, e.question ] ]) ]), [ "0", "1" ].includes(e.type) ? (vue.openBlock(), vue.createElementBlock("div", ao, [ no, vue.createElementVNode("div", ro, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((a, n) => (vue.openBlock(), vue.createElementBlock("div", { key: n, class: "option-row" }, [ vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "option-selector", { active: e.answer.includes(a) } ]), onClick: e => ((e, t) => { const a = o.value.options[e], n = a.answer.indexOf(t); n > -1 ? a.answer.splice(n, 1) : "0" === a.type ? a.answer = [ t ] : (a.answer.push(t), a.answer.sort(((e, t) => a.options.indexOf(e) - a.options.indexOf(t)))); })(t, a) }, vue.toDisplayString(String.fromCharCode(65 + n)), 11, so), vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.options[n] = t, class: "base-input flex-grow", placeholder: `\u9009\u9879 ${String.fromCharCode(65 + n)}` }, null, 8, io), [ [ vue.vModelText, e.options[n] ] ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: e => { return 0 === n ? (a = t, void o.value.options[a].options.push("")) : ((e, t) => { const a = o.value.options[e], n = a.options[t]; a.options.splice(t, 1); const r = a.answer.indexOf(n); r > -1 && a.answer.splice(r, 1); })(t, n); var a; } }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 === n ? "mdi:plus" : "mdi:minus" }, null, 8, [ "icon" ]) ], 8, oo) ])))), 128)) ]) ])) : (vue.openBlock(), vue.createElementBlock("div", lo, [ co, vue.createElementVNode("div", po, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.answer, ((a, n) => (vue.openBlock(), vue.createElementBlock("div", { key: n, class: "reading-answer-row" }, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": t => e.answer[n] = t, class: "base-input flex-grow", placeholder: `\u7b54\u6848 ${n + 1}` }, null, 8, uo), [ [ vue.vModelText, e.answer[n] ] ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", type: "button", onClick: e => { return 0 === n ? (a = t, void o.value.options[a].answer.push("")) : ((e, t) => { o.value.options[e].answer.length > 1 && o.value.options[e].answer.splice(t, 1); })(t, n); var a; } }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: 0 === n ? "mdi:plus" : "mdi:minus" }, null, 8, [ "icon" ]) ], 8, mo) ])))), 128)) ]) ])) ])))), 128)) ]) ]) ]), vue.createElementVNode("div", { class: "modal-footer" }, [ vue.createElementVNode("button", { class: "aah-btn", type: "button", onClick: handleCancel }, "\u53d6\u6d88"), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: handleSave }, "\u4fdd\u5b58\u4fee\u6539") ]) ]) ])) : vue.createCommentVNode("", !0); } }), fo = { class: "question-page" }, go = vue.createElementVNode("div", { class: "watermark-bg" }, [ vue.createElementVNode("span", null, "AiAskHelper"), vue.createElementVNode("span", null, "\u7231\u95ee\u7b54\u52a9\u624b") ], -1), vo = vue.createElementVNode("div", { class: "info-banner" }, [ vue.createElementVNode("div", { class: "info-title" }, "\u9898\u5e93\u7f13\u5b58\u8bf4\u660e"), vue.createElementVNode("div", { class: "info-body" }, [ vue.createTextVNode(" \u672c\u811a\u672c\u652f\u6301\u5c06\u5b58\u5728\u7b54\u6848\u7684\u9898\u76ee\u6536\u5f55\u5230\u672c\u5730\uff0c\u4ee5\u4f9b\u540e\u7eed\u7b54\u9898\u68c0\u7d22\uff0c\u53ef\u51cf\u5c11\u63a5\u53e3\u8bf7\u6c42\u6b21\u6570\uff0c\u63d0\u9ad8\u7b54\u6848\u6b63\u786e\u7387\u3002"), vue.createElementVNode("br"), vue.createTextVNode(" \u5728\u652f\u6301\u91cd\u590d\u7b54\u9898\u4e14\u7b54\u5b8c\u9898\u663e\u793a\u7b54\u6848\u7684\u60c5\u51b5\u4e0b\u53ef\u4ee5\u65e0\u9700\u4f7f\u7528\u63a5\u53e3\u641c\u7d22\u7b54\u6848\u3002"), vue.createElementVNode("br"), vue.createElementVNode("span", { class: "warn-text" }, "\u5e76\u975e\u6240\u6709\u7f51\u7ad9\u90fd\u652f\u6301\uff0c\u9700\u8981\u4f5c\u8005\u9002\u914d\uff0c\u5982\u9047\u4e0d\u652f\u6301\u7684\u5e73\u53f0\u8bf7\u53cd\u9988\u3002") ]) ], -1), yo = { class: "q-stats-row" }, bo = { class: "q-stat-card" }, wo = vue.createElementVNode("div", { class: "q-stat-label" }, "\u7f13\u5b58\u9898\u76ee\u6570\u91cf", -1), xo = { class: "q-stat-value" }, ko = { class: "upload-text" }, qo = vue.createElementVNode("span", { class: "upload-icon" }, "\u2601\ufe0f", -1), _o = vue.createElementVNode("div", { class: "upload-desc" }, [ vue.createElementVNode("strong", null, "\u62d6\u62fd\u5907\u4efd\u6587\u4ef6"), vue.createTextVNode(" \u6216 "), vue.createElementVNode("em", null, "\u70b9\u51fb\u4e0a\u4f20"), vue.createTextVNode(" \u6062\u590d\u5907\u4efd ") ], -1), Ao = { key: 0, class: "upload-hint" }, To = { class: "search-filter-row" }, Co = { class: "question-search-box" }, So = { key: 0, class: "filter-chips" }, Io = [ "onClick" ], Eo = { class: "actions-row" }, Uo = { class: "data-stats" }, Ho = { class: "stats-text" }, Po = { class: "question-table-wrapper" }, jo = { key: 0, class: "table-empty" }, Lo = { class: "table-empty-text" }, zo = { key: 1, class: "qc-cards" }, Mo = { class: "qc-row qc-row-meta" }, Oo = { class: "aah-tag aah-tag-primary" }, $o = { class: "qc-num" }, Fo = [ "onClick" ], Do = vue.createElementVNode("span", null, "\u7f16\u8f91", -1), No = [ "innerHTML" ], Ro = { class: "qc-answer" }, Bo = vue.createElementVNode("span", { class: "qc-answer-label" }, "\u7b54\u6848", -1), Go = [ "innerHTML" ], Vo = { key: 1, class: "question-pagination-wrapper" }, Ko = { class: "question-pagination" }, Wo = [ "disabled" ], Qo = { class: "page-numbers" }, Jo = [ "onClick" ], Xo = { key: 0, class: "page-ellipsis" }, Yo = [ "disabled" ], Zo = { class: "page-size-selector" }, el = vue.createElementVNode("label", null, "\u6bcf\u9875\u663e\u793a\uff1a", -1), tl = vue.createElementVNode("option", { value: 10 }, "10 \u6761", -1), al = vue.createElementVNode("option", { value: 20 }, "20 \u6761", -1), nl = vue.createElementVNode("option", { value: 50 }, "50 \u6761", -1), rl = vue.createElementVNode("option", { value: 100 }, "100 \u6761", -1), sl = [ tl, al, nl, rl ], il = vue.defineComponent({ __name: "Question", setup(e) { const t = vue.ref(null), n = vue.ref(!1), r = vue.ref(!1), handleEditClose = () => { n.value = !1; }, handleReadingEditClose = () => { r.value = !1; }, s = vue.ref(0), i = vue.ref(null), o = vue.ref(!1), l = vue.ref(1), c = vue.ref(20), p = vue.ref(""), u = vue.ref(""); let d; window.addEventListener("keydown", (e => { "`" === e.key && s.value++; })); try { d = Nt.script.updateURL.match(/scripts\/(\d+)/)[1]; } catch (L) { d = "492563"; } const m = `https://greasyfork.org/zh-CN/scripts/${d}`, h = pa(), g = Cache.match("ques1_"), exportHtml = async e => { const t = e.map(((e, t) => `\n

    \u7231\u95ee\u7b54\u52a9\u624b

    \n

    ${t + 1}\u3001[${typeConvert(e.type, !1)}]${e.question}

    \n

    ${formatOptionsForExport(e.options)}

    \n

    \u7b54\u6848\uff1a${formatAnswerForExport(e.answer)}

    \n \n `)).join("
    "), a = new Blob([ ` \u7231\u95ee\u7b54\u52a9\u624b\u7b54\u6848\u5bfc\u51fa ${t} ` ], { type: "text/html" }), n = document.createElement("a"); n.href = URL.createObjectURL(a), n.download = "\u7231\u95ee\u7b54\u52a9\u624b.html", n.click(); }, exportData = async () => { try { const e = Cache.matchGet("ques1_") || []; if (0 === e.length) return void msg("\u6682\u65e0\u9898\u76ee\u53ef\u5bfc\u51fa", "warning"); msg(`\u6b63\u5728\u6253\u5305${e.length}\u9898\uff0c\u8bf7\u7a0d\u540e...`, "info"); const t = await encrypt(JSON.stringify(e)); if (!t) return void msg("\u52a0\u5bc6\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\u6216\u8054\u7cfb\u5f00\u53d1\u8005", "error"); const a = new Blob([ t ], { type: "application/text" }); msg(`\u6253\u5305\u5b8c\u6210\uff0c\u5171\u8ba1${e.length}\u9898\uff0c\u51c6\u5907\u4e0b\u8f7d`, "success"); const n = document.createElement("a"); n.href = URL.createObjectURL(a); const r = (new Date).toLocaleDateString().replace(/\//g, "-"); n.download = `\u7231\u95ee\u7b54\u52a9\u624b\u5907\u4efd-${r}.bak`, n.click(), setTimeout((() => URL.revokeObjectURL(n.href)), 100); } catch (e) { msg(`\u5bfc\u51fa\u5931\u8d25\uff1a${e}`, "error"); } }, exportDocx = async () => { exportHtml(h.saveQuestionData); }, exportDocx1 = async () => { const e = Cache.matchGet("ques1_") || []; exportHtml(e); }, answerFormat = (e, t) => e ? Array.isArray(e) && e.length > 0 && Array.isArray(e[0]) ? e.map(((e, t) => `
    \n ${t + 1}.\n ${Array.isArray(e) ? e.join(", ") : String(e)}\n
    `)).join("") : Array.isArray(e) ? e.join("
    ") : "string" == typeof e ? e : "object" == typeof e ? JSON.stringify(e) : String(e) : "", formatOptionsForExport = e => e ? Array.isArray(e) && e.length > 0 && "string" == typeof e[0] ? function(e) { return "object" != typeof e ? "" : e.map(((e, t) => String.fromCharCode(65 + t) + "." + e)).join("
    "); }(e) : Array.isArray(e) && e.length > 0 && "object" == typeof e[0] ? e.map(((e, t) => { let a = `

    ${t + 1}. ${e.question || ""}

    `; return e.options && Array.isArray(e.options) && e.options.forEach(((e, t) => { const n = String.fromCharCode(65 + t); a += `

    ${n}. ${e}

    `; })), e.answer && Array.isArray(e.answer) && (a += `

    \u7b54\u6848: ${e.answer.join(", ")}

    `), a; })).join("
    ") : Array.isArray(e) ? e.join("
    ") : String(e) : "", formatAnswerForExport = e => e ? Array.isArray(e) && e.length > 0 && Array.isArray(e[0]) ? e.map(((e, t) => `${t + 1}. ${Array.isArray(e) ? e.join(", ") : String(e)}`)).join("
    ") : Array.isArray(e) ? e.join("
    ") : String(e) : "", beforeUpload = e => { if (!e) return !1; o.value = !0; const t = new FileReader; return t.onload = async e => { var t; const a = null == (t = e.target) ? void 0 : t.result; try { const e = JSON.parse(await decrypt(a)); e.forEach((e => { Answer.cacheAnswer(e); })), msg(`\u9898\u5e93\u5bfc\u5165\u6210\u529f\uff0c\u5171\u8ba1${e.length}\u9898\n \u8fc7\u591a\u9898\u76ee\u5bfc\u5165\u540e\u9875\u9762\u4f1a\u5361\u4e3b\u8bf7\u76f4\u63a5\u5173\u95ed\u9875\u9762\u91cd\u65b0\u6253\u5f00`, "success"); } catch (n) { msg("\u6587\u4ef6\u683c\u5f0f\u9519\u8bef", "error"); } o.value = !1; }, t.onerror = () => { msg("\u8bfb\u53d6\u6587\u4ef6\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5", "error"), o.value = !1; }, t.readAsText(e), !1; }, handleFileChange = e => { var t; const a = null == (t = e.target.files) ? void 0 : t[0]; a && beforeUpload(a), i.value && (i.value.value = ""); }, handleDrop = e => { var t, a; e.preventDefault(); const n = null == (a = null == (t = e.dataTransfer) ? void 0 : t.files) ? void 0 : a[0]; n && beforeUpload(n); }, handleDragOver = e => { e.preventDefault(); }, x = vue.computed((() => { let e = h.saveQuestionData; if (p.value) { const t = p.value.toLowerCase(); e = e.filter((e => { var a; return (null == (a = e.question) ? void 0 : a.toLowerCase().includes(t)) || !!Array.isArray(e.options) && e.options.some((e => "string" == typeof e ? e.toLowerCase().includes(t) : JSON.stringify(e).toLowerCase().includes(t))) || !!Array.isArray(e.answer) && e.answer.some((e => "string" == typeof e ? e.toLowerCase().includes(t) : JSON.stringify(e).toLowerCase().includes(t))); })); } return u.value && (e = e.filter((e => e.type === u.value))), e; })), _ = vue.computed((() => { const e = (l.value - 1) * c.value, t = e + c.value; return x.value.slice(e, t); })), S = vue.computed((() => Math.ceil(x.value.length / c.value))), j = [ { value: "0", label: "\u5355\u9009" }, { value: "1", label: "\u591a\u9009" }, { value: "3", label: "\u5224\u65ad" }, { value: "2", label: "\u586b\u7a7a" } ], resetSearch = () => { p.value = "", u.value = "", l.value = 1; }, handlePageChange = e => { l.value = e; }; return (e, a) => (vue.openBlock(), vue.createBlock($a, null, { default: vue.withCtx((() => [ vue.createElementVNode("div", fo, [ go, vo, vue.createElementVNode("div", yo, [ vue.createElementVNode("div", bo, [ wo, vue.createElementVNode("div", xo, vue.toDisplayString(vue.unref(g).length), 1) ]) ]), vue.createElementVNode("div", { class: "upload-box", onDrop: handleDrop, onDragover: handleDragOver, onClick: a[0] || (a[0] = e => { var t; return null == (t = i.value) ? void 0 : t.click(); }) }, [ vue.createElementVNode("input", { ref_key: "uploadInput", ref: i, type: "file", accept: ".bak", class: "upload-input", onChange: handleFileChange }, null, 544), vue.createElementVNode("div", ko, [ qo, _o, o.value ? (vue.openBlock(), vue.createElementBlock("div", Ao, "\u6b63\u5728\u5bfc\u5165\uff0c\u8bf7\u7a0d\u5019\u2026")) : vue.createCommentVNode("", !0) ]) ], 32), vue.createElementVNode("div", To, [ vue.createElementVNode("div", Co, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": a[1] || (a[1] = e => p.value = e), type: "text", placeholder: "\u641c\u7d22\u9898\u76ee\u3001\u9009\u9879\u6216\u7b54\u6848...", class: "question-search-input" }, null, 512), [ [ vue.vModelText, p.value ] ]), p.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, onClick: a[2] || (a[2] = e => p.value = ""), class: "search-clear" }, "\xd7")) : vue.createCommentVNode("", !0) ]), vue.createElementVNode("button", { onClick: resetSearch, class: "aah-btn aah-btn-plain aah-btn-small" }, "\u91cd\u7f6e") ]), j.length ? (vue.openBlock(), vue.createElementBlock("div", So, [ vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "aah-tag", u.value ? "" : "aah-tag-primary" ]), onClick: a[3] || (a[3] = e => u.value = "") }, "\u5168\u90e8", 2), (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(j, (e => vue.createElementVNode("button", { key: e.value, type: "button", class: vue.normalizeClass([ "aah-tag", u.value === e.value ? "aah-tag-primary" : "" ]), onClick: t => u.value = e.value }, vue.toDisplayString(e.label), 11, Io))), 64)) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Eo, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-danger", type: "button", onClick: a[4] || (a[4] = e => window.confirm("\u786e\u5b9a\u8981\u6e05\u7a7a\u672c\u5730\u7f13\u5b58\u5417\uff1f") && (Cache.matchRemove("ques1_"), void msg("\u6e05\u9664\u6210\u529f", "success"))) }, "\u6e05\u9664\u7f13\u5b58"), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: exportData }, "\u5bfc\u51fa\u5907\u4efd"), s.value > 10 ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "aah-btn aah-btn-primary", type: "button", onClick: exportDocx }, "\u5bfc\u51fa\u5f53\u524d")) : vue.createCommentVNode("", !0), s.value > 10 ? (vue.openBlock(), vue.createElementBlock("button", { key: 1, class: "aah-btn aah-btn-primary", type: "button", onClick: exportDocx1 }, "\u5bfc\u51fa\u6240\u6709")) : vue.createCommentVNode("", !0) ]), vue.createElementVNode("div", Uo, [ vue.createElementVNode("span", Ho, " \u5171 " + vue.toDisplayString(vue.unref(h).saveQuestionData.length) + " \u9898\uff0c \u7b5b\u9009\u540e " + vue.toDisplayString(x.value.length) + " \u9898\uff0c \u5f53\u524d\u663e\u793a\u7b2c " + vue.toDisplayString(l.value) + " \u9875 ", 1) ]), vue.createElementVNode("div", Po, [ 0 === _.value.length ? (vue.openBlock(), vue.createElementBlock("div", jo, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit", class: "table-empty-icon" }), vue.createElementVNode("div", Lo, vue.toDisplayString(p.value || u.value ? "\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u9898\u76ee" : "\u5f53\u524d\u9875\u6682\u65e0\u6570\u636e"), 1), p.value || u.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, onClick: resetSearch, class: "aah-btn aah-btn-primary aah-btn-small" }, "\u6e05\u9664\u7b5b\u9009")) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("div", zo, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(_.value, ((e, a) => { return vue.openBlock(), vue.createElementBlock("div", { key: a, class: "aah-card aah-card-compact qc-card" }, [ vue.createElementVNode("div", Mo, [ vue.createElementVNode("span", Oo, vue.toDisplayString((s = e, typeConvert(s.type, !1))), 1), vue.createElementVNode("span", $o, "# " + vue.toDisplayString((l.value - 1) * c.value + a + 1), 1), vue.createElementVNode("button", { class: "aah-btn aah-btn-small qc-edit-btn", onClick: a => (e => { t.value = e, "15" === e.type ? r.value = !0 : n.value = !0; })(e), type: "button" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:pencil-outline" }), Do ], 8, Fo) ]), vue.createElementVNode("div", { class: "qc-question", innerHTML: e.question }, null, 8, No), vue.createElementVNode("div", Ro, [ Bo, vue.createElementVNode("span", { class: "qc-answer-value", innerHTML: answerFormat(e.answer) }, null, 8, Go) ]) ]); var s; })), 128)) ])) ]), S.value > 1 ? (vue.openBlock(), vue.createElementBlock("div", Vo, [ vue.createElementVNode("div", Ko, [ vue.createElementVNode("button", { onClick: a[5] || (a[5] = e => handlePageChange(l.value - 1)), disabled: l.value <= 1, class: "question-page-btn page-prev" }, " \u2039 \u4e0a\u4e00\u9875 ", 8, Wo), vue.createElementVNode("div", Qo, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(Math.min(S.value, 7), (e => (vue.openBlock(), vue.createElementBlock("button", { key: e, onClick: t => handlePageChange(e), class: vue.normalizeClass([ "page-number", { active: e === l.value } ]) }, vue.toDisplayString(e), 11, Jo)))), 128)), S.value > 7 ? (vue.openBlock(), vue.createElementBlock("span", Xo, "...")) : vue.createCommentVNode("", !0), S.value > 7 ? (vue.openBlock(), vue.createElementBlock("button", { key: 1, onClick: a[6] || (a[6] = e => handlePageChange(S.value)), class: vue.normalizeClass([ "page-number", { active: S.value === l.value } ]) }, vue.toDisplayString(S.value), 3)) : vue.createCommentVNode("", !0) ]), vue.createElementVNode("button", { onClick: a[7] || (a[7] = e => handlePageChange(l.value + 1)), disabled: l.value >= S.value, class: "question-page-btn page-next" }, " \u4e0b\u4e00\u9875 \u203a ", 8, Yo) ]), vue.createElementVNode("div", Zo, [ el, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": a[8] || (a[8] = e => c.value = e), onChange: a[9] || (a[9] = e => l.value = 1) }, sl, 544), [ [ vue.vModelSelect, c.value ] ]) ]) ])) : vue.createCommentVNode("", !0) ]), vue.createVNode(Li, { visible: n.value, ques: t.value, onHandleClose: handleEditClose }, null, 8, [ "visible", "ques" ]), vue.createVNode(ho, { visible: r.value, ques: t.value, onHandleClose: handleReadingEditClose }, null, 8, [ "visible", "ques" ]) ])), _: 1 })); } }), ol = { class: "preview-container" }, ll = { class: "toolbar" }, cl = { class: "toolbar-left" }, pl = { class: "page-title" }, ul = { class: "toolbar-right" }, dl = { class: "preview-search-box" }, ml = vue.createElementVNode("option", { value: 5 }, "5\u9898/\u9875", -1), hl = vue.createElementVNode("option", { value: 10 }, "10\u9898/\u9875", -1), fl = vue.createElementVNode("option", { value: 20 }, "20\u9898/\u9875", -1), gl = [ ml, hl, fl ], vl = { key: 0, class: "search-info" }, yl = { class: "preview-questions-container" }, bl = { key: 0, class: "loading" }, wl = vue.createElementVNode("div", { class: "preview-spinner" }, null, -1), xl = vue.createElementVNode("span", null, "\u641c\u7d22\u4e2d...", -1), kl = [ wl, xl ], ql = { key: 1, class: "empty" }, _l = { key: 2, class: "questions-list" }, Al = { class: "question-header" }, Tl = { class: "question-info" }, Cl = { class: "question-num" }, Sl = { class: "question-type" }, Il = { class: "question-actions" }, El = [ "onClick" ], Ul = [ "onClick" ], Hl = { class: "preview-question-content" }, Pl = [ "innerHTML" ], jl = { key: 0, class: "options" }, Ll = { key: 0, class: "reading-type" }, zl = { class: "reading-title" }, Ml = { class: "preview-sub-questions" }, Ol = { class: "sub-num" }, $l = { class: "sub-type" }, Fl = [ "innerHTML" ], Dl = { key: 0, class: "more-subs" }, Nl = { key: 1, class: "complex-type" }, Rl = { key: 2, class: "normal-options" }, Bl = { class: "option-label" }, Gl = [ "innerHTML" ], Vl = { key: 0, class: "correct-mark" }, Kl = { class: "answer" }, Wl = vue.createElementVNode("span", { class: "preview-answer-label" }, "\u7b54\u6848\uff1a", -1), Ql = { key: 0, class: "preview-answer-list" }, Jl = [ "innerHTML" ], Xl = { key: 2, class: "no-answer" }, Yl = { key: 1, class: "preview-pagination" }, Zl = [ "disabled" ], ec = { class: "page-info" }, tc = [ "max" ], ac = [ "disabled" ], nc = { class: "total-info" }, rc = vue.defineComponent({ __name: "Preview", setup(e) { const t = vue.ref(Cache.matchGet("ques1_") || []), n = vue.ref(!1), r = vue.ref(""), s = vue.ref(1), i = vue.ref(10), o = function(e) { const t = new Blob([ `(${e.toString()})()` ], { type: "application/javascript" }), a = URL.createObjectURL(t); return new Worker(a); }((() => { self.importScripts("https://cdn.bootcdn.net/ajax/libs/fuse.js/7.1.0/fuse.min.js"), self.onmessage = function(e) { const {data: t, options: a} = e.data, n = new Fuse(t, a).search(e.data.keyword).map((e => e.item)); n.forEach((t => { t.question1 = t.question, e.data.keyword.split("").forEach((e => { /[\u4e00-\u9fa5a-zA-Z0-9]/.test(e) && (t.question1 = t.question1.replace(new RegExp(e, "g"), `${e}`)); })); })), self.postMessage(n); }; })), l = vue.computed((() => t.value.length)), c = vue.computed((() => 0 === l.value ? 0 : Math.ceil(l.value / i.value))), p = vue.computed((() => { const e = (s.value - 1) * i.value, a = e + i.value; return t.value.slice(e, a); })), cl_img_format = e => { if (!e.trim()) return e; return e.replace(/]*>/gi, (e => e.replace(/\/?>$/, ' referrerPolicy="no-referrer">'))); }, getOptionIndex = e => String.fromCharCode(65 + e), handlePageChange = e => { if (0 === c.value) return; const t = Math.min(Math.max(1, e), c.value); s.value = t; }, goPrev = () => handlePageChange(s.value - 1), goNext = () => handlePageChange(s.value + 1), onKeydown = e => { const t = e.target; t && [ "INPUT", "TEXTAREA", "SELECT" ].includes(t.tagName) || e.metaKey || e.ctrlKey || e.altKey || ("ArrowLeft" === e.key ? goPrev() : "ArrowRight" === e.key && goNext()); }; vue.onMounted((() => window.addEventListener("keydown", onKeydown))), vue.onUnmounted((() => window.removeEventListener("keydown", onKeydown))); const search = () => { const e = { keys: [ "question" ], threshold: .3 }, a = r.value.trim(); n.value = !0, a ? (o.onmessage = e => { const a = e.data; t.value = a, n.value = !1, s.value = 1; }, o.postMessage({ data: Cache.matchGet("ques1_"), options: e, keyword: a })) : (t.value = Cache.matchGet("ques1_") || [], n.value = !1, s.value = 1); }, u = vue.ref(null), d = vue.ref(!1), m = vue.ref(!1), handleClose = () => { d.value = !1; }, handleReadingClose = () => { m.value = !1; }; return (e, a) => (vue.openBlock(), vue.createBlock($a, null, { default: vue.withCtx((() => [ vue.createElementVNode("div", ol, [ vue.createVNode(Li, { visible: d.value, ques: u.value, onHandleClose: handleClose }, null, 8, [ "visible", "ques" ]), vue.createVNode(ho, { visible: m.value, ques: u.value, onHandleClose: handleReadingClose }, null, 8, [ "visible", "ques" ]), vue.createElementVNode("div", ll, [ vue.createElementVNode("div", cl, [ vue.createElementVNode("h3", pl, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-page-variant", class: "icon-inline" }), vue.createTextVNode(" \u9898\u5e93\u9884\u89c8 (" + vue.toDisplayString(l.value) + " \u9898)", 1) ]) ]), vue.createElementVNode("div", ul, [ vue.createElementVNode("div", dl, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": a[0] || (a[0] = e => r.value = e), class: "preview-search-input", type: "text", placeholder: "\u641c\u7d22\u9898\u76ee...", onInput: search }, null, 544), [ [ vue.vModelText, r.value ] ]), r.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "clear-btn", onClick: a[1] || (a[1] = e => { r.value = "", search(); }) }, "\xd7")) : vue.createCommentVNode("", !0) ]), vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": a[2] || (a[2] = e => i.value = e), onChange: a[3] || (a[3] = e => s.value = 1), class: "page-size" }, gl, 544), [ [ vue.vModelSelect, i.value ] ]) ]) ]), r.value ? (vue.openBlock(), vue.createElementBlock("div", vl, [ vue.createTextVNode(" \u627e\u5230 "), vue.createElementVNode("strong", null, vue.toDisplayString(t.value.length), 1), vue.createTextVNode(" \u9053\u76f8\u5173\u9898\u76ee ") ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", yl, [ n.value ? (vue.openBlock(), vue.createElementBlock("div", bl, kl)) : 0 === p.value.length ? (vue.openBlock(), vue.createElementBlock("div", ql, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit", class: "preview-empty-icon" }), vue.createElementVNode("p", null, vue.toDisplayString(r.value ? "\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u9898\u76ee" : "\u6682\u65e0\u9898\u76ee\u6570\u636e"), 1), r.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "btn-clear", onClick: a[4] || (a[4] = e => { r.value = "", search(); }) }, "\u6e05\u9664\u641c\u7d22")) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("div", _l, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(p.value, ((e, a) => (vue.openBlock(), vue.createElementBlock("div", { key: e.key || a, class: "question-item" }, [ vue.createElementVNode("div", Al, [ vue.createElementVNode("div", Tl, [ vue.createElementVNode("span", Cl, vue.toDisplayString((s.value - 1) * i.value + a + 1), 1), vue.createElementVNode("span", Sl, vue.toDisplayString(vue.unref(typeConvert)(e.type ?? "", !1)), 1) ]), vue.createElementVNode("div", Il, [ vue.createElementVNode("button", { class: "btn-edit", onClick: t => (e => { u.value = e, "15" === e.type ? m.value = !0 : d.value = !0; })(e), title: "\u7f16\u8f91" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:pencil" }) ], 8, El), vue.createElementVNode("button", { class: "btn-delete", onClick: a => (e => { t.value = t.value.filter((t => t.key !== e.key)), Cache.matchRemove(e.key); })(e), title: "\u5220\u9664" }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:delete" }) ], 8, Ul) ]) ]), vue.createElementVNode("div", Hl, [ vue.createElementVNode("div", { class: "preview-question-text", innerHTML: cl_img_format(e.question1 || e.question) }, null, 8, Pl), e.options && e.options.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", jl, [ "15" === e.type && "object" == typeof e.options[0] ? (vue.openBlock(), vue.createElementBlock("div", Ll, [ vue.createElementVNode("div", zl, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-variant", class: "icon-inline" }), vue.createTextVNode(" \u9605\u8bfb\u7406\u89e3 (" + vue.toDisplayString(e.options.length) + " \u9898)", 1) ]), vue.createElementVNode("div", Ml, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options.slice(0, 3), ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: t, class: "preview-sub-question" }, [ vue.createElementVNode("span", Ol, vue.toDisplayString(t + 1) + ".", 1), vue.createElementVNode("span", $l, "[" + vue.toDisplayString(vue.unref(typeConvert)(e.type ?? "", !1)) + "]", 1), vue.createElementVNode("div", { class: "sub-text", innerHTML: cl_img_format(e.question) }, null, 8, Fl) ])))), 128)), e.options.length > 3 ? (vue.openBlock(), vue.createElementBlock("div", Dl, " \u8fd8\u6709 " + vue.toDisplayString(e.options.length - 3) + " \u4e2a\u5b50\u9898\u76ee... ", 1)) : vue.createCommentVNode("", !0) ]) ])) : "object" == typeof e.options[0] ? (vue.openBlock(), vue.createElementBlock("div", Nl, " \u26a0\ufe0f \u590d\u5408\u9898\u578b\uff0c\u70b9\u51fb\u7f16\u8f91\u67e5\u770b\u8be6\u60c5 ")) : (vue.openBlock(), vue.createElementBlock("div", Rl, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((t, a) => (vue.openBlock(), vue.createElementBlock("div", { key: a, class: vue.normalizeClass([ "option", { correct: e.answer && e.answer.includes(t) } ]) }, [ vue.createElementVNode("span", Bl, vue.toDisplayString(getOptionIndex(a)) + ".", 1), vue.createElementVNode("span", { class: "option-text", innerHTML: cl_img_format(t) }, null, 8, Gl), e.answer && e.answer.includes(t) ? (vue.openBlock(), vue.createElementBlock("span", Vl, "\u2713")) : vue.createCommentVNode("", !0) ], 2)))), 128)) ])) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Kl, [ Wl, Array.isArray(e.answer) ? (vue.openBlock(), vue.createElementBlock("div", Ql, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.answer, ((e, t) => (vue.openBlock(), vue.createElementBlock("span", { key: t, class: "preview-answer-item" }, vue.toDisplayString(e), 1)))), 128)) ])) : e.answer ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: "preview-answer-text", innerHTML: cl_img_format(e.answer) }, null, 8, Jl)) : (vue.openBlock(), vue.createElementBlock("span", Xl, "\u6682\u65e0\u7b54\u6848")) ]) ]) ])))), 128)) ])) ]), l.value > 0 ? (vue.openBlock(), vue.createElementBlock("div", Yl, [ vue.createElementVNode("button", { class: "preview-page-btn", disabled: s.value <= 1, onClick: goPrev }, "\u4e0a\u4e00\u9875", 8, Zl), vue.createElementVNode("span", ec, [ vue.createTextVNode(" \u7b2c "), vue.withDirectives(vue.createElementVNode("input", { type: "number", class: "page-input", min: 1, max: c.value || 1, "onUpdate:modelValue": a[5] || (a[5] = e => s.value = e), onChange: a[6] || (a[6] = e => handlePageChange(s.value)) }, null, 40, tc), [ [ vue.vModelText, s.value, void 0, { number: !0 } ] ]), vue.createTextVNode(" / " + vue.toDisplayString(c.value || 1) + " \u9875 ", 1) ]), vue.createElementVNode("button", { class: "preview-page-btn", disabled: s.value >= (c.value || 1), onClick: goNext }, "\u4e0b\u4e00\u9875", 8, ac), vue.createElementVNode("span", nc, "\u5171 " + vue.toDisplayString(l.value) + " \u9898", 1) ])) : vue.createCommentVNode("", !0) ]) ])), _: 1 })); } }), sc = { class: "log-page" }, ic = { class: "log-header" }, oc = vue.createElementVNode("h2", null, "\u8fd0\u884c\u65e5\u5fd7", -1), lc = { class: "log-actions" }, cc = { class: "log-toolbar" }, pc = { class: "log-filter" }, uc = [ "onClick" ], dc = { key: 0, class: "log-list custom-scroll" }, mc = { class: "log-time" }, hc = { class: "log-msg" }, fc = { key: 1, class: "log-empty" }, gc = [ vue.createElementVNode("span", { class: "log-empty-icon" }, "i", -1), vue.createElementVNode("p", null, "\u5f53\u524d\u6ca1\u6709\u65e5\u5fd7\u8bb0\u5f55", -1) ], vc = vue.defineComponent({ __name: "Log", setup(e) { const t = Kt(), n = [ { key: "all", label: "\u5168\u90e8", tone: "primary" }, { key: "success", label: "\u4fe1\u606f", tone: "success" }, { key: "warning", label: "\u8b66\u544a", tone: "warning" }, { key: "error", label: "\u9519\u8bef", tone: "danger" } ], r = vue.ref("all"), s = vue.computed((() => "all" === r.value ? t.logs : t.logs.filter((e => e.type === r.value)))), i = vue.computed((() => { var e; return (null == (e = n.find((e => e.key === r.value))) ? void 0 : e.label) || "\u5168\u90e8"; })), o = vue.computed((() => t.logs.length)), exportLogs = () => { const e = new Blob([ JSON.stringify(t.logs, null, 2) ], { type: "application/json" }), a = URL.createObjectURL(e), n = document.createElement("a"); n.href = a, n.download = `aiask-logs-${Date.now()}.json`, n.click(), URL.revokeObjectURL(a); }; return (e, a) => (vue.openBlock(), vue.createBlock($a, { "no-padding": !0 }, { default: vue.withCtx((() => [ vue.createElementVNode("div", sc, [ vue.createElementVNode("header", ic, [ vue.createElementVNode("div", null, [ oc, vue.createElementVNode("p", null, "\u5171 " + vue.toDisplayString(o.value) + " \u6761\u8bb0\u5f55\uff0c\u5f53\u524d\u7b5b\u9009\uff1a" + vue.toDisplayString(i.value), 1) ]), vue.createElementVNode("div", lc, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-small", onClick: a[0] || (a[0] = e => vue.unref(t).logs = []) }, "\u6e05\u7a7a"), vue.createElementVNode("button", { class: "aah-btn aah-btn-small", onClick: exportLogs }, "\u5bfc\u51fa") ]) ]), vue.createElementVNode("div", cc, [ vue.createElementVNode("div", pc, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(n, (e => vue.createElementVNode("button", { key: e.key, class: vue.normalizeClass([ "aah-tag", r.value === e.key ? `aah-tag-${e.tone}` : "" ]), type: "button", onClick: t => r.value = e.key }, vue.toDisplayString(e.label), 11, uc))), 64)) ]) ]), s.value.length ? (vue.openBlock(), vue.createElementBlock("ul", dc, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(s.value, ((e, t) => (vue.openBlock(), vue.createElementBlock("li", { key: t, class: vue.normalizeClass([ "log-row", `log-row-${e.type}` ]) }, [ vue.createElementVNode("span", mc, vue.toDisplayString(e.time), 1), vue.createElementVNode("span", { class: vue.normalizeClass([ "aah-tag", "aah-tag-" + ("error" === e.type ? "danger" : "warning" === e.type ? "warning" : "success") ]) }, vue.toDisplayString(e.type), 3), vue.createElementVNode("span", hc, vue.toDisplayString(e.content), 1) ], 2)))), 128)) ])) : (vue.openBlock(), vue.createElementBlock("div", fc, gc)) ]) ])), _: 1 })); } }), yc = { class: "ai-workbench" }, bc = { class: "ai-status-panel" }, wc = { class: "ai-status-main" }, xc = { class: "aah-card ai-input-panel" }, kc = { class: "ai-section-heading" }, _c = vue.createElementVNode("div", null, [ vue.createElementVNode("h3", null, "\u9898\u76ee\u8f93\u5165"), vue.createElementVNode("p", null, "\u7c98\u8d34\u9898\u5e72\u3001\u9009\u9879\u6216\u5b8c\u6574\u9898\u76ee\u5185\u5bb9") ], -1), Ac = { class: "ai-mode-switch" }, Tc = [ "onClick" ], Cc = { key: 0, class: "ai-question-type-row" }, Sc = { class: "ai-config-field" }, Ic = vue.createElementVNode("span", null, "\u9898\u578b\u9009\u62e9", -1), Ec = [ "value" ], Uc = vue.createElementVNode("p", { class: "ai-helper-text" }, "\u7c98\u8d34\u9898\u5e72\u53ca\u9009\u9879\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u89e3\u6790\u5e76\u641c\u7d22\u5b98\u65b9\u9898\u5e93", -1), Hc = { class: "ai-command-row" }, Pc = [ "disabled" ], jc = { class: "aah-card ai-result-panel" }, Lc = { class: "ai-section-heading" }, zc = { class: "ai-result-actions" }, Mc = { key: 1, class: "aah-tag aah-tag-success" }, Oc = { key: 0, class: "ai-loading-text" }, $c = [ "innerHTML" ], Fc = { key: 2, class: "ai-empty" }, Dc = vue.createElementVNode("p", { class: "ai-empty-text" }, "\u8f93\u5165\u9898\u76ee\u540e\u5f00\u59cb\u641c\u7d22\uff0cAI \u89e3\u7b54\u4f1a\u663e\u793a\u5728\u8fd9\u91cc", -1), Nc = { key: 0, class: "ai-loading-text" }, Rc = { key: 1, class: "aah-alert aah-alert-warning" }, Bc = [ "innerHTML" ], Gc = { key: 2, class: "official-meta" }, Vc = { class: "official-meta-row" }, Kc = vue.createElementVNode("div", { class: "official-meta-label" }, "\u89e3\u6790\u9898\u5e72", -1), Wc = [ "innerHTML" ], Qc = { key: 0, class: "official-meta-row" }, Jc = vue.createElementVNode("div", { class: "official-meta-label" }, "\u89e3\u6790\u9009\u9879", -1), Xc = { class: "official-meta-options" }, Yc = { class: "official-option-label" }, Zc = [ "innerHTML" ], ep = { key: 3, class: "official-result-list" }, tp = { class: "official-result-header" }, ap = { class: "official-result-title" }, np = vue.createElementVNode("span", { class: "official-result-subtitle" }, "\u6839\u636e\u9898\u5e72\u76f8\u4f3c\u5ea6\u6392\u5e8f", -1), rp = { class: "aah-tag aah-tag-primary" }, sp = { class: "official-section" }, ip = vue.createElementVNode("div", { class: "official-section-label" }, "\u9898\u5e72", -1), op = [ "innerHTML" ], lp = { key: 0, class: "official-section" }, cp = vue.createElementVNode("div", { class: "official-section-label" }, "\u9009\u9879", -1), pp = { class: "official-options" }, up = { class: "official-option-label" }, dp = [ "innerHTML" ], mp = { class: "official-section" }, hp = vue.createElementVNode("div", { class: "official-section-label" }, "\u53c2\u8003\u7b54\u6848", -1), fp = { class: "official-answer-chips" }, gp = { key: 0, class: "official-answer-empty" }, vp = { key: 4, class: "ai-empty" }, yp = vue.createElementVNode("p", { class: "ai-empty-text" }, "\u672a\u5339\u914d\u5230\u7ed3\u679c\uff0c\u8bd5\u8bd5\u4f18\u5316\u9898\u5e72\u6216\u8c03\u6574\u9898\u578b", -1), bp = { key: 5, class: "ai-empty" }, wp = vue.createElementVNode("p", { class: "ai-empty-text" }, "\u8f93\u5165\u9898\u5e72\u5e76\u70b9\u51fb\u641c\u7d22\uff0c\u5373\u53ef\u5339\u914d\u5b98\u65b9\u9898\u5e93", -1), xp = { key: 0, class: "ai-service-details" }, kp = vue.createElementVNode("summary", null, "\u670d\u52a1\u8bf4\u660e", -1), qp = [ "innerHTML" ], _p = vue.defineComponent({ __name: "Ai", setup(e) { const t = ca(), n = Kt(), r = da(), s = vue.ref(""), o = vue.ref("1"), l = vue.ref(""), c = [ { label: "\u5355\u9009\u9898", value: "0" }, { label: "\u591a\u9009\u9898", value: "1" }, { label: "\u586b\u7a7a\u9898", value: "2" }, { label: "\u5224\u65ad\u9898", value: "3" }, { label: "\u7b80\u7b54\u9898", value: "4" }, { label: "\u5176\u5b83/\u81ea\u52a8", value: "8" } ], p = vue.ref(c[0].value), u = vue.ref(!1), d = vue.ref([]), m = vue.ref(!1), h = vue.ref(""), g = vue.ref(!1), x = vue.ref({ question: "", options: [] }), _ = vue.ref(!1), S = vue.computed((() => "1" === o.value)), j = vue.computed((() => S.value ? t.aiLoading : m.value)), L = vue.computed((() => j.value ? "\u641c\u7d22\u4e2d..." : "\u5f00\u59cb\u641c\u7d22")), M = vue.computed((() => t.selectConfig("search"))), $ = vue.computed((() => M.value ? getAiProviderPreset(M.value.providerId) : void 0)), F = vue.computed((() => { const e = M.value; return e ? { tone: e.enabled ? "success" : "warning", title: e.enabled ? "AI \u641c\u9898\u5df2\u5c31\u7eea" : "\u5f53\u524d\u914d\u7f6e\u672a\u542f\u7528", desc: `${e.name} \xb7 ${e.baseUrl}`, model: e.model || "\u672a\u586b\u5199\u6a21\u578b" } : { tone: "warning", title: "\u672a\u914d\u7f6e AI \u641c\u9898", desc: "\u8fdb\u5165 AI \u8bbe\u7f6e\u540e\u542f\u7528\u4e00\u4e2a\u5e73\u53f0\uff0c\u5373\u53ef\u4f7f\u7528 AI \u68c0\u7d22\u3002", model: "\u672a\u914d\u7f6e" }; })), D = vue.computed((() => Boolean(t.aiMsg || t.aiLoading))), N = vue.computed((() => m.value || h.value || x.value.question || d.value.length || g.value)), R = vue.computed((() => { var e; const t = M.value; if (!t) return "\u5f53\u524d\u6ca1\u6709\u542f\u7528\u7684 AI \u641c\u9898\u914d\u7f6e\uff0c\u8bf7\u5148\u8fdb\u5165 AI \u8bbe\u7f6e\u542f\u7528\u4e00\u4e2a\u5e73\u53f0\u3002"; const a = (null == (e = $.value) ? void 0 : e.docUrl) || t.baseUrl; return `\u5f53\u524d\u91c7\u7528\u7684\u662f **${t.name}**\uff08${t.model}\uff09\u670d\u52a1\uff0c\u4ec5\u4f9b\u6d4b\u8bd5\u4f7f\u7528\uff0c\u4e0d\u4fdd\u8bc1\u51c6\u786e\u6027\u3002\n\n\u5982\u6709\u4fb5\u6743\uff0c\u8bf7\u8054\u7cfb\u6211\u4eec\u5220\u9664\u3002\n\n\u5e73\u53f0\u6587\u6863\uff1a[${a}](${a})`; })), B = c.reduce(((e, t) => (e[t.value] = t.label.replace("/\u81ea\u52a8", ""), e)), {}), formatAnswer = e => { if (Array.isArray(e)) return e.map((e => "string" == typeof e ? e.trim() : String(e).trim())).filter(Boolean); if ("object" == typeof e && null !== e) return Object.values(e).map((e => "string" == typeof e ? e.trim() : String(e).trim())).filter(Boolean); if ("string" == typeof e) { const t = e.replace(/[\r\n]+/g, " ").trim(); return t ? /[,\uff0c\u3001/;\uff1b\s]/.test(t) ? t.split(/[,\uff0c\u3001/;\uff1b\s]+/).map((e => e.trim())).filter(Boolean) : [ t ] : []; } return []; }; vue.watch(o, (e => { "1" === e ? (d.value = [], h.value = "", g.value = !1, x.value = { question: "", options: [] }, m.value = !1, u.value = !1, p.value = c[0].value, _.value = !1) : (l.value = `${Date.now()}-${Math.random()}`, t.resetAi()); })); const clearAiResult = () => { l.value = `${Date.now()}-${Math.random()}`, t.resetAi(); }, openAiSettings = () => { n.setActiveSettingSection("ai"), n.setPage("system", "settings"); }, handleAiSearch = async e => { const a = `${Date.now()}-${Math.random()}`; l.value = a, t.resetAi(), t.aiLoading = !0; try { const n = await (async ({query: e, config: t, onToken: a, runScene: n = runAiScene}) => { let r = ""; const s = await n("search", t, e, { stream: (null == t ? void 0 : t.stream) ?? !0, onToken: e => { r += e, null == a || a(e); } }); return s.success ? (!r && s.text && (r = s.text, null == a || a(s.text)), { ...s, text: r || s.text }) : { ...s, displayMessage: s.displayMessage || "AI \u641c\u9898\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5" }; })({ query: e, config: M.value, onToken: e => { l.value === a && (t.aiLoading = !1, t.aiMsg += e); } }); if (l.value !== a) return; n.success ? t.aiMsg || (t.aiMsg = n.text) : t.aiMsg = n.displayMessage || "AI \u641c\u9898\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"; } catch (n) { if (l.value !== a) return; t.aiMsg = "AI \u641c\u9898\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"; } finally { l.value === a && (t.aiLoading = !1); } }, handleOfficialSearch = async e => { const t = (e => { const t = e.replace(/\r\n?/g, "\n").split("\n").map((e => e.trim())).filter(Boolean), a = [], n = []; let r = !1, s = !1; return t.forEach((e => { if (s) return; if (r && ra.test(e)) return void (s = !0); const t = e.match(na); if (t) return r = !0, void n.push(t[2].trim()); r && n.length ? n[n.length - 1] = `${n[n.length - 1]} ${e}`.trim() : a.push(e); })), { question: cleanQuestionPrefix(a.join(" ")), options: n.filter(Boolean) }; })(e); if (t.question) { var a, n; a = t.question, n = t.options, u.value || (p.value = detectAiQuestionType(a, n)), x.value = t, g.value = !0, m.value = !0, h.value = "", _.value = !1, d.value = []; try { const {success: e, message: a, data: n, needLogin: s} = await r.fuzzySearchQuestion({ question: t.question, type: Number(p.value), options: t.options }); e ? (d.value = n, n.length || (h.value = "\u5b98\u65b9\u9898\u5e93\u6682\u672a\u6536\u5f55\u8be5\u9898\uff0c\u53ef\u5c1d\u8bd5\u8865\u5145\u9898\u5e72\u6216\u8c03\u6574\u9898\u578b"), _.value = !1) : (h.value = a, _.value = !!s || /\u767b\u5f55/.test(a), msg(a, "warning")); } catch (s) { const e = (null == s ? void 0 : s.message) || "\u5b98\u65b9\u9898\u5e93\u641c\u7d22\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5"; h.value = e, _.value = /\u767b\u5f55/.test(e), msg(e, "error"); } finally { m.value = !1; } } else msg("\u8bf7\u5148\u8f93\u5165\u5b8c\u6574\u7684\u9898\u5e72\u5185\u5bb9", "warning"); }, search = async () => { const e = s.value.trim(); e ? S.value ? await handleAiSearch(e) : await handleOfficialSearch(e) : msg("\u8bf7\u8f93\u5165\u9898\u76ee\u6216\u95ee\u9898\u5185\u5bb9", "warning"); }, onQuestionTypeChange = () => { u.value = !0; }, copyAiResult = () => { t.aiMsg && (!function(e) { const t = document.createElement("input"); t.value = e, document.body.appendChild(t), t.select(), document.execCommand("Copy"), document.body.removeChild(t); }(t.aiMsg), msg("AI \u7ed3\u679c\u5df2\u590d\u5236", "success")); }, V = [ { label: "AI\u68c0\u7d22", value: "1", key: "ai" }, { label: "\u7231\u95ee\u7b54\u9898\u5e93", value: "2", key: "ask" } ]; return (e, a) => (vue.openBlock(), vue.createBlock($a, null, { default: vue.withCtx((() => [ vue.createElementVNode("div", yc, [ vue.createElementVNode("section", bc, [ vue.createElementVNode("div", wc, [ vue.createElementVNode("span", { class: vue.normalizeClass([ "aah-tag", "success" === F.value.tone ? "aah-tag-success" : "aah-tag-warning" ]) }, vue.toDisplayString(F.value.title), 3), vue.createElementVNode("strong", null, vue.toDisplayString(F.value.model), 1), vue.createElementVNode("p", null, vue.toDisplayString(F.value.desc), 1) ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-plain aah-btn-small", type: "button", onClick: openAiSettings }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:cog-outline", class: "icon-inline" }), vue.createTextVNode(" AI \u8bbe\u7f6e ") ]) ]), vue.createElementVNode("section", xc, [ vue.createElementVNode("div", kc, [ _c, vue.createElementVNode("div", Ac, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(V, (e => vue.createElementVNode("button", { key: e.value, type: "button", class: vue.normalizeClass([ "ai-mode-btn", { active: o.value === e.value } ]), onClick: t => o.value = e.value }, vue.toDisplayString(e.label), 11, Tc))), 64)) ]) ]), vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": a[0] || (a[0] = e => s.value = e), class: "ai-textarea", placeholder: "\u8bf7\u8f93\u5165\u9898\u76ee\u6216\u95ee\u9898\uff0cAI \u5c06\u4e3a\u60a8\u63d0\u4f9b\u8be6\u7ec6\u89e3\u7b54...", rows: "7" }, null, 512), [ [ vue.vModelText, s.value ] ]), "2" === o.value ? (vue.openBlock(), vue.createElementBlock("div", Cc, [ vue.createElementVNode("label", Sc, [ Ic, vue.withDirectives(vue.createElementVNode("select", { "onUpdate:modelValue": a[1] || (a[1] = e => p.value = e), class: "aah-select", onChange: onQuestionTypeChange }, [ (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(c, (e => vue.createElementVNode("option", { key: e.value, value: e.value }, vue.toDisplayString(e.label), 9, Ec))), 64)) ], 544), [ [ vue.vModelSelect, p.value ] ]) ]), Uc ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", Hc, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", onClick: search, disabled: j.value }, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:magnify", class: "icon-inline" }), vue.createElementVNode("span", null, vue.toDisplayString(L.value), 1) ], 8, Pc), "1" === o.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "aah-btn aah-btn-plain", type: "button", onClick: clearAiResult }, "\u6e05\u7a7a\u7ed3\u679c")) : vue.createCommentVNode("", !0) ]) ]), vue.createElementVNode("section", jc, [ vue.createElementVNode("div", Lc, [ vue.createElementVNode("div", null, [ vue.createElementVNode("h3", null, vue.toDisplayString("1" === o.value ? "AI \u89e3\u7b54" : "\u7231\u95ee\u7b54\u9898\u5e93"), 1), vue.createElementVNode("p", null, vue.toDisplayString("1" === o.value ? "\u7ed3\u679c\u4ec5\u4f9b\u53c2\u8003\uff0c\u8bf7\u7ed3\u5408\u9898\u76ee\u81ea\u884c\u6838\u5bf9" : "\u6839\u636e\u9898\u5e72\u76f8\u4f3c\u5ea6\u8fd4\u56de\u5b98\u65b9\u9898\u5e93\u5339\u914d\u7ed3\u679c"), 1) ]), vue.createElementVNode("div", zc, [ "1" === o.value && vue.unref(t).aiMsg ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "aah-btn aah-btn-plain aah-btn-small", type: "button", onClick: copyAiResult }, "\u590d\u5236\u7ed3\u679c")) : vue.createCommentVNode("", !0), "1" === o.value && vue.unref(t).aiMsg && !vue.unref(t).aiLoading ? (vue.openBlock(), vue.createElementBlock("span", Mc, "\u89e3\u7b54\u5b8c\u6210")) : vue.createCommentVNode("", !0), "2" === o.value ? (vue.openBlock(), vue.createElementBlock("span", { key: 2, class: vue.normalizeClass([ "aah-tag", d.value.length ? "aah-tag-success" : "aah-tag-primary" ]) }, vue.toDisplayString(d.value.length ? "\u5339\u914d\u5b8c\u6210" : "\u7b49\u5f85\u641c\u7d22"), 3)) : vue.createCommentVNode("", !0) ]) ]), "1" === o.value ? (vue.openBlock(), vue.createElementBlock("div", { key: 0, class: vue.normalizeClass([ "ai-result-content", { "ai-result-content-active": D.value } ]) }, [ vue.unref(t).aiLoading ? (vue.openBlock(), vue.createElementBlock("div", Oc, "AI \u6b63\u5728\u751f\u6210...")) : vue.unref(t).aiMsg ? (vue.openBlock(), vue.createElementBlock("div", { key: 1, innerHTML: vue.unref(t).currentAiMd(), class: "markdown-body" }, null, 8, $c)) : (vue.openBlock(), vue.createElementBlock("div", Fc, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:robot-outline", class: "ai-empty-icon" }), Dc ])) ], 2)) : (vue.openBlock(), vue.createElementBlock("div", { key: 1, class: vue.normalizeClass([ "ai-result-content", { "ai-result-content-active": N.value } ]) }, [ m.value ? (vue.openBlock(), vue.createElementBlock("div", Nc, "\u641c\u7d22\u4e2d...")) : vue.createCommentVNode("", !0), h.value ? (vue.openBlock(), vue.createElementBlock("div", Rc, [ vue.createElementVNode("span", { innerHTML: h.value }, null, 8, Bc), _.value ? (vue.openBlock(), vue.createElementBlock("button", { key: 0, class: "ai-link-btn", type: "button", onClick: a[2] || (a[2] = e => vue.unref(n).setPage("system", "account")) }, " \u70b9\u51fb\u767b\u5f55 ")) : vue.createCommentVNode("", !0) ])) : vue.createCommentVNode("", !0), x.value.question ? (vue.openBlock(), vue.createElementBlock("div", Gc, [ vue.createElementVNode("div", Vc, [ Kc, vue.createElementVNode("div", { class: "official-meta-value", innerHTML: x.value.question }, null, 8, Wc) ]), x.value.options.length ? (vue.openBlock(), vue.createElementBlock("div", Qc, [ Jc, vue.createElementVNode("div", Xc, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(x.value.options, ((e, t) => (vue.openBlock(), vue.createElementBlock("div", { key: `parsed-${t}`, class: "official-meta-option" }, [ vue.createElementVNode("span", Yc, vue.toDisplayString(String.fromCharCode(65 + t)) + ".", 1), vue.createElementVNode("span", { class: "official-option-text", innerHTML: e }, null, 8, Zc) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0) ])) : vue.createCommentVNode("", !0), d.value.length ? (vue.openBlock(), vue.createElementBlock("div", ep, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(d.value, ((e, t) => { return vue.openBlock(), vue.createElementBlock("div", { key: `official-${t}`, class: "official-result-item" }, [ vue.createElementVNode("div", tp, [ vue.createElementVNode("div", null, [ vue.createElementVNode("span", ap, "\u5339\u914d\u9898\u76ee " + vue.toDisplayString(t + 1), 1), np ]), vue.createElementVNode("span", rp, vue.toDisplayString((a = e.type, B[String(a)] || "\u5176\u5b83\u9898\u578b")), 1) ]), vue.createElementVNode("div", sp, [ ip, vue.createElementVNode("div", { class: "official-question", innerHTML: e.question }, null, 8, op) ]), e.options && e.options.length ? (vue.openBlock(), vue.createElementBlock("div", lp, [ cp, vue.createElementVNode("ul", pp, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.options, ((e, a) => (vue.openBlock(), vue.createElementBlock("li", { key: `opt-${t}-${a}` }, [ vue.createElementVNode("span", up, vue.toDisplayString(String.fromCharCode(65 + a)) + ".", 1), vue.createElementVNode("span", { class: "official-option-text", innerHTML: e }, null, 8, dp) ])))), 128)) ]) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", mp, [ hp, vue.createElementVNode("div", fp, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(formatAnswer(e.answer), ((e, a) => (vue.openBlock(), vue.createElementBlock("span", { key: `answer-${t}-${a}`, class: "aah-tag aah-tag-success" }, vue.toDisplayString(e), 1)))), 128)), formatAnswer(e.answer).length ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("span", gp, "\u6682\u65e0\u7b54\u6848\u4fe1\u606f")) ]) ]) ]); var a; })), 128)) ])) : !g.value || h.value || m.value ? h.value || m.value ? vue.createCommentVNode("", !0) : (vue.openBlock(), vue.createElementBlock("div", bp, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-document-outline", class: "ai-empty-icon" }), wp ])) : (vue.openBlock(), vue.createElementBlock("div", vp, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:magnify", class: "ai-empty-icon" }), yp ])) ], 2)) ]), "1" === o.value ? (vue.openBlock(), vue.createElementBlock("details", xp, [ kp, vue.createElementVNode("div", { class: "copyright-content", innerHTML: vue.unref(markToHtml)(R.value) }, null, 8, qp) ])) : vue.createCommentVNode("", !0) ]) ])), _: 1 })); } }), Ap = { class: "user-page" }, Tp = { key: 0, class: "user-page__login-section" }, Cp = { class: "user-page__login-box" }, Sp = { class: "user-page__login-header" }, Ip = vue.createElementVNode("span", { class: "aah-tag aah-tag-primary" }, "\u7528\u6237\u4e2d\u5fc3", -1), Ep = vue.createElementVNode("h2", null, "\u767b\u5f55\u7231\u95ee\u7b54\u8d26\u53f7", -1), Up = vue.createElementVNode("p", null, "\u767b\u5f55\u540e\u53ef\u4f7f\u7528\u4e91\u540c\u6b65\u3001\u79ef\u5206\u548c\u4f1a\u5458\u6743\u76ca", -1), Hp = { class: "user-page__login-switch" }, Pp = { key: 0 }, jp = { class: "form-item" }, Lp = { class: "form-item" }, zp = { key: 1 }, Mp = { class: "form-item" }, Op = vue.createElementVNode("p", { class: "user-page__helper" }, "\u53ef\u5728\u5b98\u7f51\u300c\u4e2a\u4eba\u4e2d\u5fc3\u300d\u5237\u65b0 API Key \u540e\u7c98\u8d34\u4f7f\u7528", -1), $p = [ "disabled" ], Fp = vue.createElementVNode("p", { class: "user-page__helper" }, "\u82e5\u5fd8\u8bb0\u5bc6\u7801\uff0c\u53ef\u5728\u5b98\u7f51\u627e\u56de\uff1b\u4e5f\u53ef\u4f7f\u7528 API Key \u5feb\u901f\u767b\u5f55", -1), Dp = { key: 1, class: "user-page__dashboard" }, Np = { class: "user-page__header-card" }, Rp = { class: "user-page__avatar" }, Bp = [ "src" ], Gp = { class: "user-page__info-text" }, Vp = { class: "user-page__username" }, Kp = { key: 0, class: "aah-tag aah-tag-warning" }, Wp = { key: 1, class: "aah-tag" }, Qp = { class: "user-page__stats-grid" }, Jp = { class: "user-page__stat-card" }, Xp = { class: "user-page__stat-icon user-page__stat-icon--coin" }, Yp = { class: "user-page__stat-content" }, Zp = vue.createElementVNode("p", { class: "user-page__stat-label" }, "\u79ef\u5206", -1), eu = { class: "user-page__stat-value" }, tu = { class: "user-page__stat-card" }, au = { class: "user-page__stat-icon user-page__stat-icon--course" }, nu = { class: "user-page__stat-content" }, ru = vue.createElementVNode("p", { class: "user-page__stat-label" }, "\u8d21\u732e\u8bfe\u7a0b", -1), su = { class: "user-page__stat-value" }, iu = { class: "user-page__stat-card" }, ou = { class: "user-page__stat-icon user-page__stat-icon--question" }, lu = { class: "user-page__stat-content" }, cu = vue.createElementVNode("p", { class: "user-page__stat-label" }, "\u8d21\u732e\u9898\u76ee", -1), pu = { class: "user-page__stat-value" }, uu = { class: "user-page__apikey-section" }, du = vue.createElementVNode("div", { class: "user-page__section-header" }, [ vue.createElementVNode("div", null, [ vue.createElementVNode("h3", null, "API Key"), vue.createElementVNode("p", null, "\u7528\u4e8e API Key \u767b\u5f55\u548c\u5b98\u65b9\u9898\u5e93\u8bf7\u6c42\u9274\u6743\uff0c\u8bf7\u52ff\u6cc4\u9732\u7ed9\u4ed6\u4eba") ]) ], -1), mu = { class: "user-page__apikey-display" }, hu = { class: "user-page__apikey-value" }, fu = { class: "user-page__apikey-actions" }, gu = [ "disabled" ], vu = { key: 0, class: "user-page__support-card" }, yu = { class: "user-page__support-icon" }, bu = vue.createElementVNode("div", { class: "user-page__support-content" }, [ vue.createElementVNode("p", { class: "user-page__support-title" }, "\u7231\u53d1\u7535\u8ba2\u9605"), vue.createElementVNode("p", { class: "user-page__support-desc" }, "\u652f\u6301\u9879\u76ee\u6301\u7eed\u8fed\u4ee3\uff0c\u89e3\u9501\u66f4\u591a\u4f1a\u5458\u6743\u76ca") ], -1), wu = [ "href" ], xu = vue.createElementVNode("div", { class: "user-page__tips" }, [ vue.createElementVNode("p", null, "\u5f53\u524d\u7528\u6237\u4f53\u7cfb\u4ec5\u7528\u4e8e\u9898\u5e93\u7f13\u5b58\u4e91\u540c\u6b65\uff0c\u66f4\u591a\u529f\u80fd\u5f00\u53d1\u4e2d") ], -1), ku = vue.defineComponent({ __name: "User", setup(e) { const t = da(), n = vue.ref("password"), r = vue.ref({ username: "", password: "" }), s = vue.ref(""), i = vue.ref(!1), o = vue.ref(!1), l = vue.computed((() => t.isLoggedIn)), c = vue.computed((() => { const e = t.apiKey || ""; return e ? e.length <= 12 ? e : `${e.slice(0, 6)}...${e.slice(-6)}` : "\u672a\u83b7\u53d6"; })), handleLogin = async () => { i.value = !0; try { if ("password" === n.value) { if (!r.value.username || !r.value.password) return void msg("\u8bf7\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801", "warning"); const e = await t.loginByPassword(r.value.username, r.value.password); e.success ? (msg(e.message, "success"), r.value = { username: "", password: "" }) : msg(e.message, "error"); } else { if (!s.value) return void msg("\u8bf7\u8f93\u5165 API Key", "warning"); const e = await t.loginByApiKey(s.value.trim()); e.success ? (msg(e.message, "success"), s.value = "") : msg(e.message, "error"); } } finally { i.value = !1; } }, handleLogout = async () => { window.confirm("\u786e\u5b9a\u8981\u9000\u51fa\u767b\u5f55\u5417\uff1f") && (await t.logout(), msg("\u5df2\u9000\u51fa\u767b\u5f55", "success")); }, handleRefreshApiKey = async () => { if (window.confirm("\u786e\u5b9a\u8981\u5237\u65b0 API Key \u5417\uff1f\u65e7 Key \u5c06\u5931\u6548\u3002")) { o.value = !0; try { const e = await t.refreshApiKey(); msg(e.message, e.success ? "success" : "error"); } finally { o.value = !1; } } }, goToRegister = () => { window.open("https://www.aiask.site/user/register", "_blank"); }, goToScoreLog = () => { window.open("https://www.aiask.site/user/score-log", "_blank"); }, switchMethod = e => { n.value = e; }; return vue.onMounted((() => { l.value && t.fetchUserInfo(); })), (e, a) => (vue.openBlock(), vue.createBlock($a, null, { default: vue.withCtx((() => [ vue.createElementVNode("div", Ap, [ l.value ? (vue.openBlock(), vue.createElementBlock("div", Dp, [ vue.createElementVNode("div", Np, [ vue.createElementVNode("div", Rp, [ vue.unref(t).avatar ? (vue.openBlock(), vue.createElementBlock("img", { key: 0, src: vue.unref(t).avatar, alt: "avatar" }, null, 8, Bp)) : (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), { key: 1, icon: "mdi:account", class: "user-page__avatar-icon" })) ]), vue.createElementVNode("div", Gp, [ vue.createElementVNode("h2", null, vue.toDisplayString(vue.unref(t).nickname), 1), vue.createElementVNode("p", Vp, "@" + vue.toDisplayString(vue.unref(t).username), 1), vue.unref(t).isVip ? (vue.openBlock(), vue.createElementBlock("span", Kp, " VIP Lv." + vue.toDisplayString(vue.unref(t).level), 1)) : (vue.openBlock(), vue.createElementBlock("span", Wp, "\u666e\u901a\u7528\u6237")) ]) ]), vue.createElementVNode("div", { class: "user-page__actions" }, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-plain aah-btn-small", type: "button", onClick: goToScoreLog }, "\u67e5\u770b\u79ef\u5206\u660e\u7ec6"), vue.createElementVNode("button", { class: "aah-btn aah-btn-danger aah-btn-small", type: "button", onClick: handleLogout }, "\u9000\u51fa\u767b\u5f55") ]), vue.createElementVNode("div", Qp, [ vue.createElementVNode("div", Jp, [ vue.createElementVNode("div", Xp, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:star" }) ]), vue.createElementVNode("div", Yp, [ Zp, vue.createElementVNode("p", eu, vue.toDisplayString(vue.unref(t).score), 1) ]) ]), vue.createElementVNode("div", tu, [ vue.createElementVNode("div", au, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:book-open-page-variant" }) ]), vue.createElementVNode("div", nu, [ ru, vue.createElementVNode("p", su, vue.toDisplayString(vue.unref(t).stats.course_count), 1) ]) ]), vue.createElementVNode("div", iu, [ vue.createElementVNode("div", ou, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:file-edit" }) ]), vue.createElementVNode("div", lu, [ cu, vue.createElementVNode("p", pu, vue.toDisplayString(vue.unref(t).stats.question_count), 1) ]) ]) ]), vue.createElementVNode("div", uu, [ du, vue.createElementVNode("div", mu, [ vue.createElementVNode("div", hu, vue.toDisplayString(c.value), 1), vue.createElementVNode("div", fu, [ vue.createElementVNode("button", { class: "aah-btn aah-btn-primary aah-btn-small", type: "button", disabled: o.value, onClick: handleRefreshApiKey }, vue.toDisplayString(o.value ? "\u5237\u65b0\u4e2d..." : "\u5237\u65b0 API Key"), 9, gu) ]) ]) ]), vue.unref(t).afdianUrl ? (vue.openBlock(), vue.createElementBlock("div", vu, [ vue.createElementVNode("div", yu, [ vue.createVNode(vue.unref(vue$1.Icon), { icon: "mdi:gift-outline" }) ]), bu, vue.createElementVNode("a", { class: "aah-btn aah-btn-primary aah-btn-small user-page__support-btn", href: vue.unref(t).afdianUrl, target: "_blank", rel: "noopener noreferrer" }, " \u524d\u5f80\u67e5\u770b ", 8, wu) ])) : vue.createCommentVNode("", !0) ])) : (vue.openBlock(), vue.createElementBlock("div", Tp, [ vue.createElementVNode("div", Cp, [ vue.createElementVNode("div", Sp, [ Ip, Ep, Up, vue.createElementVNode("div", Hp, [ vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "aah-btn aah-btn-plain aah-btn-small", { "is-active": "password" === n.value } ]), onClick: a[0] || (a[0] = e => switchMethod("password")) }, " \u8d26\u53f7\u767b\u5f55 ", 2), vue.createElementVNode("button", { type: "button", class: vue.normalizeClass([ "aah-btn aah-btn-plain aah-btn-small", { "is-active": "apikey" === n.value } ]), onClick: a[1] || (a[1] = e => switchMethod("apikey")) }, " API Key \u767b\u5f55 ", 2) ]) ]), vue.createElementVNode("form", { class: "user-page__login-form", onSubmit: vue.withModifiers(handleLogin, [ "prevent" ]) }, [ "password" === n.value ? (vue.openBlock(), vue.createElementBlock("div", Pp, [ vue.createElementVNode("div", jp, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": a[2] || (a[2] = e => r.value.username = e), class: "aah-input", type: "text", placeholder: "\u8bf7\u8f93\u5165\u7528\u6237\u540d" }, null, 512), [ [ vue.vModelText, r.value.username ] ]) ]), vue.createElementVNode("div", Lp, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": a[3] || (a[3] = e => r.value.password = e), class: "aah-input", type: "password", placeholder: "\u8bf7\u8f93\u5165\u5bc6\u7801", onKeyup: vue.withKeys(handleLogin, [ "enter" ]) }, null, 544), [ [ vue.vModelText, r.value.password ] ]) ]) ])) : (vue.openBlock(), vue.createElementBlock("div", zp, [ vue.createElementVNode("div", Mp, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": a[4] || (a[4] = e => s.value = e), class: "aah-input", type: "text", placeholder: "\u8bf7\u8f93\u5165 API Key" }, null, 512), [ [ vue.vModelText, s.value ] ]), Op ]) ])), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary user-page__login-btn", type: "submit", disabled: i.value }, vue.toDisplayString(i.value ? "\u767b\u5f55\u4e2d..." : "\u7acb\u5373\u767b\u5f55"), 9, $p) ], 32), vue.createElementVNode("div", { class: "user-page__register-tip" }, [ vue.createTextVNode(" \u8fd8\u6ca1\u6709\u8d26\u53f7\uff1f "), vue.createElementVNode("button", { class: "user-page__link-btn", type: "button", onClick: goToRegister }, "\u524d\u5f80\u5b98\u7f51\u6ce8\u518c"), Fp ]) ]) ])), xu ]) ])), _: 1 })); } }), qu = { 0: "\u5355\u9009\u9898", 1: "\u591a\u9009\u9898", 2: "\u586b\u7a7a\u9898", 3: "\u5224\u65ad\u9898", 4: "\u7b80\u7b54\u9898", 8: "\u5176\u5b83" }, _u = /^\s*(?:(\d+)[.\u3001\uff0e)]|[\uff08(](\d+)[\uff09)])\s*(.*)$/, Au = /^(?:[\[\u3010]\s*)?(?:\u53c2\u8003\u7b54\u6848|\u6807\u51c6\u7b54\u6848|\u6b63\u786e\u7b54\u6848|\u7b54\u6848)(?:\s*[\]\u3011])?\s*[\uff1a:]\s*(.*)$/, Tu = /^\s*([\[\u3010]\s*([^\]\u3011]+?)\s*[\]\u3011])\s*/, Cu = /^\s*(\u5355\u9009\u9898|\u5355\u9879\u9009\u62e9\u9898|\u591a\u9009\u9898|\u591a\u9879\u9009\u62e9\u9898|\u5224\u65ad\u9898|\u586b\u7a7a\u9898|\u7b80\u7b54\u9898|\u7b80\u7b54|\u95ee\u7b54\u9898|\u95ee\u7b54|\u5176\u5b83|\u5176\u4ed6)\s*[\uff1a:]\s*/, Su = /([A-Za-z])\s*[.\u3001\uff0e)\uff09]\s*/g, splitQuestionBlocks = e => { var t; const a = []; let n = null; const pushCurrent = () => { if (!n) return; const e = n.lines.map((e => e.trim())).filter(Boolean); e.length > 0 && a.push({ titleNo: n.titleNo, lines: e }), n = null; }; for (const r of e.replace(/\r\n?/g, "\n").split("\n")) { const e = r.trim(); if (!e) { (null == n ? void 0 : n.lines.some((e => Au.test(e)))) && pushCurrent(); continue; } const a = e.match(_u); a ? (pushCurrent(), n = { titleNo: a[1] || a[2] || "", lines: [ (null == (t = a[3]) ? void 0 : t.trim()) || "" ] }) : (n ? n.lines.some((e => Au.test(e))) && (pushCurrent(), n = { titleNo: "", lines: [] }) : n = { titleNo: "", lines: [] }, n.lines.push(e)); } return pushCurrent(), a; }, parseQuestionBlock = (e, t) => { const a = [], n = [], r = []; let s = "", i = { type: null, label: "" }; e.lines.forEach(((e, t) => { var a; const o = e.match(Au); if (o) return void (s = (null == (a = o[1]) ? void 0 : a.trim()) || ""); let l = e; if (0 === t) { const e = extractTypeLabel(l); i = e.typeInfo, l = e.content; } !i.type || isChoiceType$1(i.type) ? appendQuestionAndOptions(l, r, n) : r.push(l); })); const o = normalizeSpaces(r.join(" ")), l = i.type || inferQuestionType(o, n, s), c = normalizeAnswer(l, s, n, a); return validateParsedQuestion(o, l, n, c, a), s || a.push("\u7f3a\u5c11\u7b54\u6848"), { id: `question-import-${t + 1}`, sourceIndex: t, titleNo: e.titleNo, type: l, typeLabel: i.label || qu[l], question: o, options: n, answer: c, rawAnswer: s, errors: a }; }, validateParsedQuestion = (e, t, a, n, r) => { if (e || r.push("\u7f3a\u5c11\u9898\u5e72"), ("0" === t || "1" === t) && a.length < 2 && r.push("\u9009\u62e9\u9898\u9009\u9879\u5c11\u4e8e 2 \u4e2a"), "8" === t && r.push("\u6682\u4e0d\u652f\u6301\u8be5\u9898\u578b"), "2" === t) { const t = countBlankPlaceholders(e); t > 0 && n.length !== t && r.push("\u586b\u7a7a\u7b54\u6848\u6570\u91cf\u4e0e\u7a7a\u6570\u91cf\u4e0d\u4e00\u81f4"); } }, extractTypeLabel = e => { let t = e.trim(); const a = []; for (;t; ) { const e = t.match(Tu); if (e) { const n = (e[2] || "").trim(), r = typeFromLabel(n); if (t = t.slice(e[0].length).trim(), r) return { content: joinQuestionParts(a, t), typeInfo: { type: r, label: n } }; a.push((e[1] || "").trim()); continue; } const n = t.match(Cu); if (n) { const e = (n[1] || "").trim(), r = typeFromLabel(e); if (t = t.slice(n[0].length).trim(), r) return { content: joinQuestionParts(a, t), typeInfo: { type: r, label: e } }; } break; } return { content: e.trim(), typeInfo: { type: null, label: "" } }; }, joinQuestionParts = (e, t) => [ ...e, t ].filter(Boolean).join(" ").trim(), typeFromLabel = e => /\u591a\u9009|\u591a\u9879/.test(e) ? "1" : /\u5355\u9009|\u5355\u9879/.test(e) ? "0" : /\u586b\u7a7a/.test(e) ? "2" : /\u5224\u65ad/.test(e) ? "3" : /\u7b80\u7b54|\u95ee\u7b54/.test(e) ? "4" : /\u5176\u5b83|\u5176\u4ed6/.test(e) ? "8" : null, isChoiceType$1 = e => "0" === e || "1" === e, appendQuestionAndOptions = (e, t, a) => { const n = parseOptionsFromLine(e); if (0 === n.length) return void t.push(e); const r = n[0], s = e.slice(0, r.start).trim(); s && t.push(s), n.forEach((e => { e.value && a.push({ label: e.label, value: e.value }); })); }, parseOptionsFromLine = e => { const t = Array.from(e.matchAll(Su)).filter((t => { const a = t.index || 0; return 0 === a || !/[A-Za-z0-9]/.test(e[a - 1] || ""); })); return 0 === t.length ? [] : t.map(((a, n) => { const r = a.index || 0, s = (a.index || 0) + a[0].length, i = n + 1 < t.length && t[n + 1].index || e.length; return { label: (a[1] || "").toUpperCase(), value: e.slice(s, i).trim(), start: r }; })); }, inferQuestionType = (e, t, a) => t.length > 0 ? countChoiceAnswers(a, t) > 1 ? "1" : "0" : normalizeJudgeAnswer(a) ? "3" : hasBlankPlaceholder(e) || a.includes("|") ? "2" : "4", normalizeAnswer = (e, t, a, n) => { const r = t.trim(); if (!r) return []; if ("3" === e) { const e = normalizeJudgeAnswer(r); return e ? [ e ] : (n.push("\u5224\u65ad\u9898\u7b54\u6848\u4e0d\u6b63\u786e"), []); } if ("0" === e || "1" === e) { const t = normalizeChoiceAnswer(r, a, n); return "0" === e && t.length > 1 && n.push("\u5355\u9009\u9898\u7b54\u6848\u53ea\u80fd\u6709\u4e00\u4e2a"), t; } return "2" === e ? splitAnswerText(r, /\|/) : [ r ]; }, normalizeChoiceAnswer = (e, t, a) => { const n = matchChoiceAnswerTexts(e, t); if (n.length > 0) return n; const r = parseChoiceAnswerLabels(e), s = []; return r.length > 0 ? (r.forEach((e => { const n = t.find((t => t.label === e)); n ? s.push(n.value) : a.push(`\u7b54\u6848\u4e0d\u5728\u9009\u9879\u4e2d\uff1a${e}`); })), s) : (splitAnswerText(e, /[|,\uff0c\u3001;\uff1b]/).forEach((e => { const n = t.find((t => t.value === e)); n ? s.push(n.value) : a.push(`\u7b54\u6848\u4e0d\u5728\u9009\u9879\u4e2d\uff1a${e}`); })), s); }, countChoiceAnswers = (e, t) => { const a = matchChoiceAnswerTexts(e, t); if (a.length > 0) return a.length; const n = parseChoiceAnswerLabels(e); return n.length > 0 ? n.length : splitAnswerText(e, /[|,\uff0c\u3001;\uff1b]/).filter((e => t.some((t => t.value === e)))).length; }, matchChoiceAnswerTexts = (e, t) => { const a = e.trim(), n = t.find((e => e.value === a)); if (n) return [ n.value ]; const r = splitAnswerText(e, /[|,\uff0c\u3001;\uff1b]/); if (0 === r.length) return []; const s = []; for (const i of r) { const e = t.find((e => e.value === i)); if (!e) return []; s.push(e.value); } return s; }, parseChoiceAnswerLabels = e => { const t = e.trim().toUpperCase(); if (!t) return []; if (/^[A-Z]+$/.test(t)) return Array.from(t); const a = t.split(/[\s|,\uff0c\u3001;\uff1b]+/).map((e => e.trim())).filter(Boolean); return a.every((e => /^[A-Z]$/.test(e))) ? a : []; }, hasBlankPlaceholder = e => countBlankPlaceholders(e) > 0, countBlankPlaceholders = e => Array.from(e.matchAll(/\uff08\s*\uff09|\(\s*\)|_{2,}|-{2,}|\[\s*\]/g)).length, normalizeSpaces = e => e.replace(/\s+/g, " ").trim(), isChoiceType = e => "0" === e || "1" === e, normalizeImportText = e => e.replace(/<[^>]*>/g, "").replace(/ /gi, " ").replace(/\s+/g, " ").trim(), Iu = "ques1_", Eu = "AiAsk_ques1_", buildQuestionImportPlan = (e, t, a) => { const n = new Set(t.map(getHashFromCacheKey).filter(Boolean)), r = { total: e.length, valid: 0, error: 0, create: 0, overwrite: 0, skip: 0 }, s = e.map((e => { const t = (e => { if (e.errors.length > 0) return null; const t = normalizeImportText(e.question), a = isChoiceType(e.type) ? e.options.map((e => normalizeImportText(e.value))).filter(Boolean) : [], n = e.answer.map((e => normalizeImportText(e))).filter(Boolean); return t && 0 !== n.length ? { type: e.type, question: t, options: a, answer: n } : null; })(e); if (!t) return r.error += 1, { parsed: e, question: t, cacheKey: "", status: "error", errors: e.errors.length > 0 ? e.errors : [ "\u9898\u5e72\u6216\u7b54\u6848\u4e3a\u7a7a" ] }; r.valid += 1; const s = (e => { const t = Array.from(e.options); t.sort(); const a = `${e.type}${e.question}${t.join("")}`.replace(/\s/g, ""); return qe(a); })(t), i = `${Iu}${s}`, o = n.has(s) ? a : "create"; return r[o] += 1, n.add(s), { parsed: e, question: t, cacheKey: i, status: o, errors: [] }; })); return { strategy: a, items: s, stats: r }; }, getHashFromCacheKey = e => e.startsWith(Eu) ? e.slice(12) : e.startsWith(Iu) ? e.slice(6) : "", Uu = { class: "question-tool" }, Hu = vue.createElementVNode("div", { class: "info-banner" }, [ vue.createElementVNode("div", { class: "info-title" }, "\u9898\u5e93\u5bfc\u5165\u8bf4\u660e"), vue.createElementVNode("div", { class: "info-body" }, " \u9898\u5e93\u5bfc\u5165\u540e\u53ef\u5728\u672c\u5730\u7f13\u5b58\u4e2d\u5339\u914d\u641c\u7d22\uff0c\u8bf7\u786e\u4fdd\u9898\u5e93\u4e0e\u7b54\u9898\u4e00\u81f4\uff0c\u5426\u5219\u65e0\u6cd5\u5339\u914d\u3002 ") ], -1), Pu = { class: "qt-toolbar" }, ju = { class: "qt-strategy" }, Lu = vue.createElementVNode("span", { class: "qt-strategy-label" }, "\u91cd\u590d\u9898", -1), zu = { class: "qt-radio" }, Mu = { class: "qt-radio" }, Ou = [ "disabled" ], $u = { class: "qt-stats" }, Fu = { class: "qt-stat" }, Du = { class: "qt-stat success" }, Nu = { class: "qt-stat danger" }, Ru = { class: "qt-stat" }, Bu = { class: "qt-stat warning" }, Gu = { class: "qt-stat muted" }, Vu = { class: "qt-grid" }, Ku = { class: "qt-editor" }, Wu = { class: "qt-preview" }, Qu = { class: "import_question" }, Ju = { key: 0, class: "qt-empty" }, Xu = { class: "qt-card-head" }, Yu = { class: "qt-title-no" }, Zu = { class: "qt-tag danger" }, ed = { class: "qt-question" }, td = vue.createElementVNode("span", { class: "label" }, "\u9898\u76ee:", -1), ad = { key: 0, class: "qt-options" }, nd = { key: 1, class: "qt-answer" }, rd = vue.createElementVNode("span", { class: "label" }, "\u7b54\u6848:", -1), sd = { key: 2, class: "qt-error" }, id = vue.defineComponent({ __name: "QuestionTool", setup(e) { const t = vue.ref(""), n = vue.ref("overwrite"), r = vue.ref(Cache.match("ques1_")), s = vue.computed((() => (e => splitQuestionBlocks(e).map(((e, t) => parseQuestionBlock(e, t))))(t.value))), i = vue.computed((() => buildQuestionImportPlan(s.value, r.value, n.value))), o = vue.computed((() => i.value.items.filter((e => e.question && "skip" !== e.status)))), l = { create: "\u5c06\u65b0\u589e", overwrite: "\u5c06\u8986\u76d6", skip: "\u5c06\u8df3\u8fc7", error: "\u9519\u8bef" }, statusClass = e => ({ "qt-card-error": "error" === e.status, "qt-card-warning": "overwrite" === e.status || "skip" === e.status }), formatOptions = e => e.parsed.options.map((t => ({ label: `${t.label}. ${t.value}`, isTrue: e.parsed.answer.includes(t.value) }))), importQuestion = () => { const e = i.value, t = e.items.filter((e => e.question && "skip" !== e.status)); if (0 === t.length) return void msg("\u6682\u65e0\u53ef\u5bfc\u5165\u9898\u76ee\uff0c\u8bf7\u5148\u4fee\u6b63\u9519\u8bef\u9898\u6216\u8c03\u6574\u91cd\u590d\u9898\u7b56\u7565", "warning"); t.forEach((e => { e.question && Answer.cacheAnswer(e.question); })), r.value = Cache.match("ques1_"); const a = e.stats; msg(`\u5bfc\u5165\u5b8c\u6210\uff1a\u65b0\u589e ${a.create} \u9898\uff0c\u8986\u76d6 ${a.overwrite} \u9898\uff0c\u8df3\u8fc7 ${a.skip} \u9898\uff0c\u9519\u8bef ${a.error} \u9898`, "success"); }; return (e, a) => (vue.openBlock(), vue.createElementBlock("div", Uu, [ Hu, vue.createElementVNode("div", Pu, [ vue.createElementVNode("div", ju, [ Lu, vue.createElementVNode("label", zu, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": a[0] || (a[0] = e => n.value = e), type: "radio", value: "overwrite" }, null, 512), [ [ vue.vModelRadio, n.value ] ]), vue.createTextVNode(" \u8986\u76d6 ") ]), vue.createElementVNode("label", Mu, [ vue.withDirectives(vue.createElementVNode("input", { "onUpdate:modelValue": a[1] || (a[1] = e => n.value = e), type: "radio", value: "skip" }, null, 512), [ [ vue.vModelRadio, n.value ] ]), vue.createTextVNode(" \u8df3\u8fc7 ") ]) ]), vue.createElementVNode("button", { class: "aah-btn aah-btn-primary", type: "button", disabled: 0 === o.value.length, onClick: importQuestion }, "\u5bfc\u5165\u6709\u6548\u9898", 8, Ou) ]), vue.createElementVNode("div", $u, [ vue.createElementVNode("span", Fu, "\u5171 " + vue.toDisplayString(i.value.stats.total) + " \u9898", 1), vue.createElementVNode("span", Du, "\u6709\u6548 " + vue.toDisplayString(i.value.stats.valid) + " \u9898", 1), vue.createElementVNode("span", Nu, "\u9519\u8bef " + vue.toDisplayString(i.value.stats.error) + " \u9898", 1), vue.createElementVNode("span", Ru, "\u65b0\u589e " + vue.toDisplayString(i.value.stats.create) + " \u9898", 1), vue.createElementVNode("span", Bu, "\u8986\u76d6 " + vue.toDisplayString(i.value.stats.overwrite) + " \u9898", 1), vue.createElementVNode("span", Gu, "\u8df3\u8fc7 " + vue.toDisplayString(i.value.stats.skip) + " \u9898", 1) ]), vue.createElementVNode("div", Vu, [ vue.createElementVNode("div", Ku, [ vue.withDirectives(vue.createElementVNode("textarea", { "onUpdate:modelValue": a[2] || (a[2] = e => t.value = e), class: "qt-textarea", placeholder: "\u652f\u6301\u9898\u578b\uff1a\u5355\u9009\u3001\u591a\u9009\u3001\u5224\u65ad\u3001\u586b\u7a7a\u3001\u7b80\u7b54\n\n\u57fa\u7840\u89c4\u5219\uff1a\n1. \u63a8\u8350\u4f7f\u7528\u9898\u53f7\uff0c\u5982 1. 1\u30011\uff0e\uff081\uff09\u6216 (1)\n2. \u65e0\u9898\u53f7\u65f6\uff0c\u7cfb\u7edf\u4f1a\u6309\u7a7a\u884c\u548c\u7b54\u6848\u884c\u63a8\u65ad\u9898\u5757\n3. \u7b54\u6848\u884c\u652f\u6301\uff1a\u7b54\u6848\uff1a\u53c2\u8003\u7b54\u6848\uff1a\u6b63\u786e\u7b54\u6848\uff1a\u6807\u51c6\u7b54\u6848\uff1a\n4. \u9009\u9879\u652f\u6301\uff1aA. A\u3001A\uff0eA) A\uff09\n5. \u652f\u6301\u884c\u5185\u9009\u9879\uff1aA.\u7532 B.\u4e59 C.\u4e19 D.\u4e01\n6. \u586b\u7a7a\u9898\u591a\u4e2a\u7b54\u6848\u7528 | \u5206\u9694\n7. \u5224\u65ad\u9898\u652f\u6301\uff1a\u6b63\u786e\u3001\u9519\u8bef\u3001\u5bf9\u3001\u9519\u3001\u662f\u3001\u5426\u3001\u221a\u3001\xd7\u3001T\u3001F\n\n\u793a\u4f8b\uff1a\n1. [\u5355\u9009\u9898] \u9a7e\u9a76\u4eba\u6709\u4e0b\u5217\u54ea\u79cd\u8fdd\u6cd5\u884c\u4e3a\u4e00\u6b21\u8bb06\u5206\uff1f\nA\u3001\u4f7f\u7528\u5176\u4ed6\u8f66\u8f86\u884c\u9a76\u8bc1\nB\u3001\u996e\u9152\u540e\u9a7e\u9a76\u673a\u52a8\u8f66\nC\u3001\u8f66\u901f\u8d85\u8fc7\u89c4\u5b9a\u65f6\u901f50%\u4ee5\u4e0a\nD\u3001\u8fdd\u6cd5\u5360\u7528\u5e94\u6025\u8f66\u9053\u884c\u9a76\n\u7b54\u6848:D\n\n2\u3001\u3010\u591a\u9009\u9898\u3011 \u4e0b\u5217\u5c5e\u4e8e\u6625\u5b63\u7684\u6708\u4efd\u662f\uff1f\nA.\u4e00\u6708 B.\u4e09\u6708 C.\u56db\u6708 D.\u5341\u4e8c\u6708\n\u53c2\u8003\u7b54\u6848\uff1aBC\n\n3\uff0e\u56fd\u9645\u8c61\u68cb\u8d77\u6e90\u4e8e\u82f1\u56fd\u5417\uff1f\n\u7b54\u6848: \u5bf9\n\n\uff084\uff09\u6211\u56fd\u53e4\u5178\u56db\u5927\u540d\u8457\u662f\uff08\uff09\uff08\uff09\uff08\uff09\uff08\uff09\n\u7b54\u6848: \u7ea2\u697c\u68a6|\u6c34\u6d52\u4f20|\u4e09\u56fd\u6f14\u4e49|\u897f\u6e38\u8bb0\n\n(5) \u5982\u4f55\u4fdd\u6301\u8eab\u4f53\u5065\u5eb7\uff1f\n\u6807\u51c6\u7b54\u6848: \u89c4\u5f8b\u996e\u98df\u3001\u575a\u6301\u953b\u70bc\uff0c\u65e9\u7761\u65e9\u8d77\uff0c\u5b9a\u671f\u4f53\u68c0\u3002", rows: "24" }, null, 512), [ [ vue.vModelText, t.value ] ]) ]), vue.createElementVNode("div", Wu, [ vue.createElementVNode("div", Qu, [ 0 === i.value.items.length ? (vue.openBlock(), vue.createElementBlock("div", Ju, "\u8f93\u5165\u9898\u76ee\u540e\u5c06\u81ea\u52a8\u89e3\u6790\u5e76\u9884\u89c8")) : vue.createCommentVNode("", !0), (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(i.value.items, (e => (vue.openBlock(), vue.createElementBlock("div", { key: e.parsed.id, class: vue.normalizeClass([ "qt-card", statusClass(e) ]) }, [ vue.createElementVNode("div", Xu, [ vue.createElementVNode("span", Yu, "#" + vue.toDisplayString(e.parsed.titleNo || e.parsed.sourceIndex + 1), 1), vue.createElementVNode("span", Zu, vue.toDisplayString(e.parsed.typeLabel), 1), vue.createElementVNode("span", { class: vue.normalizeClass([ "qt-tag", e.status ]) }, vue.toDisplayString(l[e.status]), 3) ]), vue.createElementVNode("p", ed, [ td, vue.createTextVNode(vue.toDisplayString(e.parsed.question), 1) ]), e.parsed.options.length ? (vue.openBlock(), vue.createElementBlock("div", ad, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(formatOptions(e), (e => (vue.openBlock(), vue.createElementBlock("span", { key: e.label, class: vue.normalizeClass([ "qt-tag", { success: e.isTrue } ]) }, vue.toDisplayString(e.label), 3)))), 128)) ])) : vue.createCommentVNode("", !0), e.parsed.answer.length ? (vue.openBlock(), vue.createElementBlock("p", nd, [ rd, vue.createTextVNode(vue.toDisplayString(e.parsed.answer.join(" | ")), 1) ])) : vue.createCommentVNode("", !0), e.errors.length ? (vue.openBlock(), vue.createElementBlock("div", sd, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.errors, (e => (vue.openBlock(), vue.createElementBlock("p", { key: e }, vue.toDisplayString(e), 1)))), 128)) ])) : vue.createCommentVNode("", !0) ], 2)))), 128)) ]) ]) ]) ])); } }), od = { class: "tabs-bar", role: "tablist" }, ld = [ "aria-selected", "onClick" ], cd = vue.defineComponent({ __name: "TabsBar", props: { tabs: {}, modelValue: {} }, emits: [ "update:modelValue" ], setup: e => (e, t) => (vue.openBlock(), vue.createElementBlock("div", od, [ (vue.openBlock(!0), vue.createElementBlock(vue.Fragment, null, vue.renderList(e.tabs, (t => (vue.openBlock(), vue.createElementBlock("button", { key: t.key, type: "button", role: "tab", "aria-selected": e.modelValue === t.key, class: vue.normalizeClass([ "tab-item", { active: e.modelValue === t.key } ]), onClick: a => e.$emit("update:modelValue", t.key) }, vue.toDisplayString(t.label), 11, ld)))), 128)) ])) }), pd = vue.defineComponent({ __name: "ThemeSwitcher", props: { compact: { type: Boolean, default: !1 } }, setup(e) { const t = e, a = Kt(), n = [ { key: "light", label: "\u6d45\u8272" }, { key: "dark", label: "\u6df1\u8272" }, { key: "auto", label: "\u8ddf\u968f\u7cfb\u7edf" } ], r = [ { key: "light", label: "\u6d45" }, { key: "dark", label: "\u6df1" }, { key: "auto", label: "\u7cfb\u7edf" } ], s = vue.computed((() => t.compact ? r : n)), i = vue.computed({ get: () => a.app.theme, set: e => a.setConfig({ theme: e }) }); return (e, t) => (vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass([ "theme-switcher", { "theme-switcher-compact": e.compact } ]) }, [ vue.createVNode(Na, { modelValue: i.value, "onUpdate:modelValue": t[0] || (t[0] = e => i.value = e), segments: s.value }, null, 8, [ "modelValue", "segments" ]) ], 2)); } }); function useTheme(e) { const t = Kt(), n = function() { const e = vue.ref(!1); if ("undefined" == typeof window || !window.matchMedia) return { isDark: e, attach: () => {}, detach: () => {} }; const t = window.matchMedia("(prefers-color-scheme: dark)"); e.value = t.matches; const onChange = t => { e.value = t.matches; }; return { isDark: e, attach: () => t.addEventListener("change", onChange), detach: () => t.removeEventListener("change", onChange) }; }(); vue.onMounted((() => { n.attach(), vue.watchEffect((() => { const a = e.value; if (!a) return; const r = (s = t.app.theme, i = n.isDark.value, "light" === s || "dark" === s ? s : i ? "dark" : "light"); var s, i; a.setAttribute("data-theme", r), a.style.visibility = "visible"; })); })), vue.onBeforeUnmount((() => { n.detach(); })); } const ud = { class: "el_wrapper", style: { "z-index": "9999999 !important" } }, dd = { class: "floating-title" }, md = [ "src" ], hd = { class: "floating-name" }, fd = { class: "floating-version" }, gd = { class: "floating-actions" }, vd = { key: 0, class: "sub-segmented-row" }, yd = { class: "floating-body" }, bd = { class: "floating-scroll custom-scroll" }, wd = { class: "mini-tooltip-wrapper" }, xd = [ "src" ], kd = { key: 0, class: "mini-tooltip" }, qd = vue.defineComponent({ __name: "App", setup(e) { const t = Kt(), n = pa(), r = Jt(), s = da(), l = ca(); l.mergeLegacyCredentials(t.app), t.setConfig(createLegacyAppAiConfig(l.settings)), t.app.showFloat = t.app.defaultShowFloat; const c = vue.ref(null), p = vue.ref(null); useTheme(p); const u = [ { key: "overview", label: "\u6982\u89c8" }, { key: "ask", label: "\u7b54\u9898" }, { key: "library", label: "\u9898\u5e93" }, { key: "ai", label: "AI" }, { key: "system", label: "\u7cfb\u7edf" } ], d = [ { key: "manage", label: "\u7ba1\u7406" }, { key: "preview", label: "\u9884\u89c8" }, { key: "tool", label: "\u9898\u76ee\u5de5\u5177" } ], m = [ { key: "settings", label: "\u8bbe\u7f6e" }, { key: "logs", label: "\u65e5\u5fd7" }, { key: "account", label: "\u7528\u6237" } ], h = vue.computed({ get: () => t.page, set: e => { t.setPage(e, { library: "manage", system: "settings" }[e] ?? ""); } }), g = vue.computed({ get: () => t.subPage, set: e => t.setPage(t.page, e) }), b = vue.reactive({ dragging: !1, offsetX: 0, offsetY: 0 }), _ = vue.reactive({ top: "15vh", left: "50%", useTransform: !0 }); ce[Dt + "app"] = t, ce[Dt + "ask"] = n, ce[Dt + "api"] = r, ce[Dt + "user"] = s, ce[Dt + "ai"] = l; const showOrHide = () => { t.app.showFloat = !t.app.showFloat; }; document.onkeydown = function(e) { if (!t.app.hotkeyEnabled) return; const a = (e => { const t = e.split("+"); return { ctrl: t.includes("Ctrl"), shift: t.includes("Shift"), alt: t.includes("Alt"), key: t[t.length - 1] }; })(t.app.hotkey), n = "ArrowUp" === (r = a.key) ? "ArrowUp" : 1 === r.length ? "Key" + r.toUpperCase() : r; var r; e.ctrlKey === a.ctrl && e.shiftKey === a.shift && e.altKey === a.alt && e.code === n && (e.preventDefault(), t.app.showFloat = !t.app.showFloat); }, "c0400763e1c557daa3e02d0bcb13ae6a" !== ksv && (() => { const e = document.createElement("a"); e.href = location.href, e.style.display = "none", document.body.appendChild(e), e.click(); })(); const S = vue.computed((() => ({ width: `min(${t.app.dialogWidth}px, calc(100vw - 32px))`, maxHeight: "calc(100vh - 80px)", top: _.top, left: _.left, transform: _.useTransform ? "translateX(-50%)" : "none" }))), E = vue.reactive({ resizing: !1, startX: 0, startWidth: 0 }), handleResizeMove = e => { if (!E.resizing) return; const a = e.clientX - E.startX; t.setDialogWidth(E.startWidth + a); }, stopResize = () => { E.resizing && (E.resizing = !1, window.removeEventListener("pointermove", handleResizeMove), window.removeEventListener("pointerup", stopResize)); }, startResize = e => { e.preventDefault(), e.stopPropagation(), E.resizing = !0, E.startX = e.clientX, E.startWidth = t.app.dialogWidth, window.addEventListener("pointermove", handleResizeMove), window.addEventListener("pointerup", stopResize); }, handleDragMove = e => { if (!b.dragging || !c.value) return; const t = c.value, {clientX: a, clientY: n} = e, r = t.offsetWidth, s = t.offsetHeight, i = window.innerWidth - r, o = window.innerHeight - s; let l = a - b.offsetX, p = n - b.offsetY; l = Math.min(Math.max(0, l), Math.max(0, i)), p = Math.min(Math.max(0, p), Math.max(0, o)), _.left = `${l}px`, _.top = `${p}px`, _.useTransform = !1; }, stopDrag = () => { b.dragging && (b.dragging = !1, window.removeEventListener("pointermove", handleDragMove), window.removeEventListener("pointerup", stopDrag)); }, startDrag = e => { if ((e => { if (!(e instanceof HTMLElement)) return !1; const t = e.tagName; return [ "BUTTON", "A", "INPUT", "TEXTAREA", "SELECT", "OPTION" ].includes(t) || !!e.closest(".floating-btn"); })(e.target)) return; if (!c.value) return; e.preventDefault(); const t = c.value.getBoundingClientRect(); _.useTransform && (_.left = `${t.left}px`, _.top = `${t.top}px`), b.dragging = !0, b.offsetX = e.clientX - t.left, b.offsetY = e.clientY - t.top, _.useTransform = !1, window.addEventListener("pointermove", handleDragMove), window.addEventListener("pointerup", stopDrag); }; return vue.watch((() => t.app.showFloat), (e => { e ? (_.top = "15vh", _.left = "50%", _.useTransform = !0) : stopDrag(); })), vue.onBeforeUnmount((() => { window.removeEventListener("pointermove", handleDragMove), window.removeEventListener("pointerup", stopDrag), window.removeEventListener("pointermove", handleResizeMove), window.removeEventListener("pointerup", stopResize); })), updateFn(), (e, a) => (vue.openBlock(), vue.createElementBlock("div", ud, [ vue.withDirectives(vue.createElementVNode("div", { ref_key: "wrapperRef", ref: p, class: "floating-wrapper" }, [ vue.createElementVNode("div", { class: "floating-dialog", style: vue.normalizeStyle(S.value), ref_key: "floatRef", ref: c }, [ vue.createElementVNode("div", { class: "floating-header", onPointerdown: startDrag }, [ vue.createElementVNode("div", dd, [ vue.createElementVNode("img", { src: vue.unref(Nt).script.icon, alt: "icon" }, null, 8, md), vue.createElementVNode("span", hd, vue.toDisplayString(vue.unref(Nt).script.name), 1), vue.createElementVNode("span", fd, "v" + vue.toDisplayString(vue.unref(Nt).script.version), 1) ]), vue.createElementVNode("div", gd, [ vue.createVNode(pd, { compact: "" }), vue.createElementVNode("button", { class: "floating-close", "aria-label": "\u5173\u95ed", onClick: a[0] || (a[0] = e => vue.unref(t).app.showFloat = !1), type: "button" }, "\xd7") ]) ], 32), vue.createVNode(cd, { modelValue: h.value, "onUpdate:modelValue": a[1] || (a[1] = e => h.value = e), tabs: u }, null, 8, [ "modelValue" ]), "library" === vue.unref(t).page || "system" === vue.unref(t).page ? (vue.openBlock(), vue.createElementBlock("div", vd, [ "library" === vue.unref(t).page ? (vue.openBlock(), vue.createBlock(Na, { key: 0, modelValue: g.value, "onUpdate:modelValue": a[2] || (a[2] = e => g.value = e), segments: d }, null, 8, [ "modelValue" ])) : (vue.openBlock(), vue.createBlock(Na, { key: 1, modelValue: g.value, "onUpdate:modelValue": a[3] || (a[3] = e => g.value = e), segments: m }, null, 8, [ "modelValue" ])) ])) : vue.createCommentVNode("", !0), vue.createElementVNode("div", yd, [ vue.createElementVNode("div", bd, [ "overview" === vue.unref(t).page ? (vue.openBlock(), vue.createBlock(ja, { key: 0 })) : "ask" === vue.unref(t).page ? (vue.openBlock(), vue.createBlock(fi, { key: 1 })) : "library" === vue.unref(t).page ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [ "manage" === vue.unref(t).subPage ? (vue.openBlock(), vue.createBlock(il, { key: 0 })) : "preview" === vue.unref(t).subPage ? (vue.openBlock(), vue.createBlock(rc, { key: 1 })) : "tool" === vue.unref(t).subPage ? (vue.openBlock(), vue.createBlock(id, { key: 2 })) : vue.createCommentVNode("", !0) ], 64)) : "ai" === vue.unref(t).page ? (vue.openBlock(), vue.createBlock(_p, { key: 3 })) : "system" === vue.unref(t).page ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [ "settings" === vue.unref(t).subPage ? (vue.openBlock(), vue.createBlock(Pr, { key: 0 })) : "logs" === vue.unref(t).subPage ? (vue.openBlock(), vue.createBlock(vc, { key: 1 })) : "account" === vue.unref(t).subPage ? (vue.openBlock(), vue.createBlock(ku, { key: 2 })) : vue.createCommentVNode("", !0) ], 64)) : vue.createCommentVNode("", !0) ]) ]), vue.createElementVNode("div", { class: "floating-resize-handle", onPointerdown: startResize, "aria-label": "\u62d6\u52a8\u4ee5\u8c03\u6574\u9762\u677f\u5bbd\u5ea6", role: "separator" }, null, 32) ], 4) ], 512), [ [ vue.vShow, vue.unref(t).app.showFloat ] ]), vue.withDirectives(vue.createElementVNode("div", { class: "minimized-dialog", onClick: showOrHide }, [ vue.createElementVNode("div", { onClick: showOrHide }, [ vue.createElementVNode("div", wd, [ vue.createElementVNode("img", { src: vue.unref("data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20xmlns='http://www.w3.org/2000/svg'%20width='200'%20height='200'%3e%3cpath%20d='m253.36%201024-115.278-58.836v-53.206c-64.889-68.266-62.918-94.729%2014.075-153.424-23.506-17.594-63.762%202.675-77.275-36.315%2047.435-42.93%2070.378-101.063%2087.973-162.01a326.695%20326.695%200%200%201%20208.037-226.617c4.645-89.38%2086.847-143.43%20178.479-112.605l-35.612%2090.365c105.145%207.32%20192.414%2045.042%20256.317%20123.303%2040.538%2015.483%2038.849-34.767%2069.252-40.82l11.964%2058.273%2050.391-27.306c28.151%2018.72-5.208%2031.951-10.416%2052.22%2014.78%2020.128%2028.996%2040.538%2044.479%2060.244a142.867%20142.867%200%200%201%2028.996%20114.153c-12.528%2077.838-30.263%20154.831-41.101%20233.092A1276.939%201276.939%200%200%200%20918.433%201024H897.32l-89.24-70.378%209.994-10.416-17.735%2036.878-68.408-20.128-39.411%2023.788-42.227-21.114c-28.151%2014.076-52.502%2036.034-86.565%2027.307l-9.009-37.863H332.747L306.144%201024zm-9.993-380.041-.844.985%20126.68%2019.706%2010.838%2010.979c-29.277%2032.374-19.846%2074.178-29.7%20110.493l34.064%2030.263-35.19%2094.87a412.274%20412.274%200%200%200%20233.515%202.11l9.712-26.602%2012.809%2015.905-11.824%2050.672%205.35%204.645c16.749-11.682%2033.218-24.21%2050.812-34.626a84.454%2084.454%200%200%201%2026.04-5.348l7.46%2033.922%2048.842-23.788%2052.925%2014.076c-1.83-43.212-2.956-80.935-5.912-118.517%200-4.926-9.853-9.29-15.061-14.075l-5.63-23.225%2014.075-100.922h18.72l3.238-1.267c-11.964%20106.412%208.023%20202.266%2087.128%20281.512%208.727-48.842%2016.61-93.321%2024.632-137.66%207.46-40.96%2015.061-81.92%2022.521-122.88%2010.557-48.42%2025.477-97.262-10.979-140.755l-30.825%2038.004c0-16.469%201.126-33.078%201.126-49.546%200-70.378-53.206-104.723-115.983-76.29a232.951%20232.951%200%200%201-32.937%209.43c16.046-32.373-3.519-52.924-25.477-70.377a292.21%20292.21%200%200%200-209.304-70.378c-11.401.703-22.802%200-40.256%200l45.183-104.582c-40.397%2010.979-74.038%2014.78-94.73%2045.464s14.92%2045.886%2020.833%2069.674c-110.212%204.364-202.69%2080.513-236.611%20193.117l-70.378%20172.708%2049.124%203.519%205.63%2054.191c32.514-26.04%2026.04-61.088%2030.262-92.899h17.876v58.414l30.967%206.334c1.407-6.616%202.393-11.683%203.66-16.469%209.148-34.626-19.706-59.117-22.38-91.491zm-37.863%20178.9-6.475%2020.833-25.336%2084.453c1.548%208.868%200%2023.225%205.067%2025.477%2032.374%2016.046%2065.733%2029.277%20104.16%2045.746%2021.113-65.452%2063.621-114.435%2069.533-180.872-37.3-16.187-70.941-31.53-104.722-44.338-17.032-6.756-36.315-10.979-35.049%2019.002zm121.754-38.848%2010.556-90.225-48.138-6.193v78.964zm-168.907%2096.98%2023.084-73.474c-28.152-10.416-47.576-9.29-56.303%2015.483s2.674%2042.79%2032.937%2057.992z'%20fill='%23353947'/%3e%3cpath%20d='M198.607%20548.948c33.922-112.604%20126.68-188.472%20235.907-192.272-5.912-23.788-41.1-39.553-20.832-69.674s54.332-34.486%2094.729-45.465L463.228%20346.12h40.256a292.21%20292.21%200%200%201%20209.304%2070.378c21.958%2017.735%2042.227%2038.286%2025.477%2070.378l.986-.985c-30.967%2026.743-32.797%2059.399-19.847%2095.15L744.599%20622l-40.819-6.192-103.174-14.076-62.214-93.04-31.67%2050.672c-19.425-5.63-26.603.845-20.691%2020.692l-21.536-.845a165.67%20165.67%200%200%200-100.078-17.172l-10.416-86.565-37.44%2031.248-44.339%2042.226zm255.19-62.917-10.556-10.557c-17.173-17.032-35.049-15.061-47.294%203.378s-4.786%2036.737%2012.105%2050.25c20.128%2016.046%2034.907%209.712%2045.745-11.542%2014.217-10.838%2015.202-21.395%200-31.811z'%20fill='%23F5F5F6'%20data-spm-anchor-id='a313x.search_index.0.i5.dc0f3a810XA6r8'%20class='selected'/%3e%3cpath%20d='m592.442%20886.763-9.712%2026.603a412.274%20412.274%200%200%201-233.514-2.112l35.189-94.87-34.063-30.543c9.853-36.315%200-78.12%2029.7-110.494a198.184%20198.184%200%200%200%20105.425-94.87c16.328%202.394%2026.04-1.688%2020.692-20.69l31.67-4.927%2063.058%2078.542c0%207.882-1.97%2018.017%201.971%2023.084%2030.966%2038.708%2023.788%2080.935%2014.076%20123.865-8.587%2036.034-16.469%2071.364-24.492%20106.412zm-149.624-223.24c0%2014.076-2.815%2023.648%200%2026.885%2020.27%2020.691%2020.832%2045.605%2019.566%2071.927a96.84%2096.84%200%200%200%203.237%2031.107c5.912%2020.41%2012.668%2041.382%2038.426%2044.056a48.56%2048.56%200%200%200%2053.347-35.189%20696.602%20696.602%200%200%200%2018.58-80.371c6.052-6.475%2035.47-2.534%2018.157-36.597z'%20fill='%23F5F5F6'/%3e%3cpath%20d='M600.606%20602.013%20703.78%20616.09l40.82%205.349c37.863%209.993%2022.943%2041.241%2026.461%2065.17L756.986%20787.53l-49.828%2078.12-21.395%2031.529-10.134%2021.395a84.454%2084.454%200%200%200-26.04%205.348c-17.594%2010.416-34.063%2022.944-50.813%2034.626v-5.208h-5.067l11.823-50.672c16.047-61.932%2032.937-123.724%2047.717-185.938%205.348-22.662-25.477-68.267-51.94-82.624zM927.3%20706.736c-7.46%2040.96-15.061%2081.92-22.521%20122.88-8.023%2044.338-15.906%2088.817-24.633%20137.66-79.105-79.387-98.529-175.242-87.128-281.513z'%20fill='%23B3DCF8'/%3e%3cpath%20d='m199.029%20843.692%206.475-20.832h45.605c2.111-39.271-20.973-30.263-38.427-30.122-1.548-29.981%2018.017-25.758%2035.049-18.58%2034.063%2013.231%2067.422%2028.151%20104.722%2044.479-5.912%2066.437-48.42%20115.42-69.533%20180.871-38.427-16.186-71.927-29.418-104.16-45.182-4.786-2.252-3.519-16.61-5.067-25.477h33.5l26.321-70.378z'%20fill='%2387BC85'/%3e%3cpath%20d='M738.265%20486.03a232.951%20232.951%200%200%200%2032.937-9.43c62.777-28.151%20116.405%206.615%20115.983%2076.29%200%2016.468-.704%2033.077-1.126%2049.546l1.126-.986-12.105-2.674-21.536%2016.75-29.98%208.305a86.565%2086.565%200%200%201-91.633-59.259c2.393-26.462%204.645-52.924%207.038-79.527zm113.731%2061.792-61.37-52.502c-3.94%2035.752-6.615%2059.822-10.275%2093.18z'%20fill='%23F5F5F6'%20data-spm-anchor-id='a313x.search_index.0.i3.dc0f3a810XA6r8'/%3e%3cpath%20d='M198.607%20548.948h73.615c-28.151%2042.227-74.178%2076.853-59.117%20137.66-4.223%2031.81%202.252%2066.859-30.263%2092.899l-6.052-54.473-49.124-3.519z'%20fill='%23AED4EF'/%3e%3cpath%20d='m927.3%20706.736-134.28-21.113-3.238%201.266%206.897-37.863%2027.025-7.742%2031.248-8.867%2029.84-20.691%202.393-10.276-.422.986%2030.262-36.738c35.752%2043.776%2020.832%2092.618%2010.276%20141.038zm-557.675-42.79-126.68-19.706a171.3%20171.3%200%200%201%2016.75-41.1c21.817-29.278%2046.168-56.303%2069.533-84.454%203.238%209.15%206.757%2018.157%209.572%2027.307q15.624%2049.123%2030.966%2098.529z'%20fill='%23F5F5F6'/%3e%3cpath%20d='M763.18%20810.473c5.207%204.645%2014.075%209.009%2015.06%2014.076%202.956%2037.582%204.082%2075.304%205.912%20118.516l-52.925-14.075-47.997%2023.787-7.601-34.766c14.075-1.97%2020.55-7.883%2010.979-21.817%2021.395%2011.682%2023.788-9.994%2033.359-19.003z'%20fill='%23AED4EF'/%3e%3cpath%20d='M601.169%20634.106c26.462%2014.075%2057.288%2059.962%2051.939%2082.624-14.076%2062.214-31.67%20124.006-47.716%20185.938l-12.95-15.905c8.023-35.33%2015.905-70.378%2024.35-105.99%2010.135-42.93%2017.314-85.157-14.075-123.865-3.519-4.785-.985-14.92-1.548-22.802zM328.806%20518.404c-23.365%2028.152-47.716%2055.458-69.533%2084.454a171.3%20171.3%200%200%200-16.75%2041.1l.844-.985-12.386%2043.072h-17.876c-15.061-60.385%2030.403-94.87%2059.117-137.097l44.338-42.226z'%20fill='%23484F5E'/%3e%3cpath%20d='m327.258%20784.011-37.582-17.454v-78.964l48.138%206.193z'%20fill='%23D55375'/%3e%3cpath%20d='m823.704%20641.284-27.025%207.742-6.897%2037.863h-18.72c-3.52-23.928%2011.4-55.176-26.463-65.17l-25.195-40.96%2012.527-16.187a86.565%2086.565%200%200%200%2091.35%2059.259zm-454.079%2022.662V644.1l12.246-12.95c8.445%201.267%2020.41%206.897%2024.773%203.237%2020.55-17.031%2038.99-36.455%2058.132-55.176l20.973%201.548a198.184%20198.184%200%200%201-105.708%2094.87z'%20fill='%23484F5E'/%3e%3cpath%20d='m199.029%20843.692%2034.485%2014.075-26.321%2070.378h-33.5z'%20fill='%23CAE7AF'/%3e%3cpath%20d='m230.98%20686.326%2012.387-43.071c2.675%2031.67%2031.53%2056.302%2022.24%2091.35-1.267%204.786-2.252%209.854-3.66%2016.47l-30.966-6.335z'%20fill='%23F5F5F6'/%3e%3cpath%20d='m763.18%20810.473-44.058%2067.704-11.964-12.528%2050.39-78.4z'%20fill='%23484F5E'/%3e%3cpath%20d='M212.682%20792.738c17.454%200%2040.538-9.15%2038.427%2030.122h-45.605z'%20fill='%23CDEAB1'/%3e%3cpath%20d='m598.917%20957.985-5.349-4.645h5.067z'%20fill='%23484F5E'/%3e%3cpath%20d='M464.495%20579.211c-19.143%2018.72-37.582%2038.145-58.132%2055.176-4.364%203.66-16.328-1.97-24.773-3.237l-17.173-69.111a165.67%20165.67%200%200%201%20100.078%2017.172z'%20fill='%23AED4EF'/%3e%3cpath%20d='m364.417%20562.039%2017.173%2069.111-12.246%2012.95Q354%20594.976%20338.377%20545.57c-2.815-9.149-6.334-18.157-9.571-27.306l-12.246-11.542%2037.441-30.967z'%20fill='%23353947'/%3e%3cpath%20d='M600.606%20602.013v31.67l-62.214-79.245-31.67%204.926%2031.388-50.39z'%20fill='%23484F5E'/%3e%3cpath%20d='M453.797%20517.278c-10.838%2021.255-25.617%2028.152-45.745%2011.542-16.891-14.075-24.633-31.529-12.105-50.25s30.121-20.41%2047.294-3.378c-23.507.986-34.767%2011.542-29.137%2039.412l39.693%203.097z'%20fill='%23AED4EF'/%3e%3cpath%20d='m731.931%20564.572-12.809%2015.624c-12.95-35.752-11.12-68.407%2019.847-95.15-2.111%2026.602-4.363%2053.064-7.038%2079.526z'%20fill='%23353947'/%3e%3cpath%20d='M506.722%20559.787c5.348%2019.002-4.364%2023.084-20.691%2020.69-6.194-19.846.985-26.32%2020.69-20.69z'%20fill='%23484F5E'/%3e%3cpath%20d='M453.797%20485.749c15.202%2010.416%2014.076%2020.973%200%2031.53v-31.812zm-10.556-10.557%2010.556%2010.557-10.556-10.557z'%20fill='%23AED4EF'/%3e%3cpath%20d='m442.818%20663.524%20151.313%2022.099c17.313%2034.062-12.105%2030.121-18.157%2036.596a696.602%20696.602%200%200%201-18.58%2080.09%2048.56%2048.56%200%200%201-52.784%2034.908c-25.758-2.675-32.514-23.647-38.426-44.057a96.84%2096.84%200%200%201-3.237-31.107c1.266-26.321%200-51.235-19.566-71.926-3.378-2.956-.563-12.387-.563-26.603zm66.297%20153.987c41.523-26.462%2042.226-60.384%2034.766-98.53l-55.317-10.274c-.422%2038.707-15.202%2075.163%2020.55%20108.804zm198.043%2048.138%2011.964%2012.528c-9.57%209.008-11.964%2030.685-33.359%2019.002z'%20fill='%23353947'/%3e%3cpath%20d='M686.186%20896.757c9.571%2014.075%202.955%2019.846-10.98%2021.817zm165.81-348.935-71.645%2040.679c3.66-33.36%206.334-57.429%2010.276-93.18z'%20fill='%23353947'/%3e%3cpath%20d='m884.792%20611.726-29.84%2020.69-1.408-16.89%2021.536-16.75z'%20fill='%23484F5E'%20data-spm-anchor-id='a313x.search_index.0.i4.dc0f3a810XA6r8'%20class='selected'/%3e%3cpath%20d='m853.544%20615.526%201.408%2016.89-31.248%208.868v-17.453zm31.248-3.8-9.712-12.95%2012.105%202.674z'%20fill='%23353947'/%3e%3cpath%20d='m443.522%20474.91%2010.557%2010.557v31.952l-39.693-3.097c-6.194-27.87%205.63-38.426%2029.136-39.411z'%20fill='%23F5F5F6'/%3e%3cpath%20d='M509.115%20817.51c-35.753-33.64-20.973-70.377-20.55-108.803l55.316%2010.275c7.883%2038.145%206.757%2072.067-34.766%2098.529z'%20fill='%23E25679'/%3e%3c/svg%3e"), onClick: showOrHide }, null, 8, xd), !vue.unref(t).app.showFloat && vue.unref(t).app.alertBubble ? (vue.openBlock(), vue.createElementBlock("div", kd, vue.toDisplayString(vue.unref(t).app.alert), 1)) : vue.createCommentVNode("", !0) ]) ]) ], 512), [ [ vue.vShow, !vue.unref(t).app.showFloat ] ]) ])); } }), _d = [ '.floating-wrapper{--c-primary: #0071e3;--c-primary-hover: #0077ed;--c-primary-active: #0062cc;--c-primary-soft: rgba(0, 113, 227, .1);--c-primary-ring: rgba(0, 113, 227, .18);--c-success: #34c759;--c-success-soft: rgba(52, 199, 89, .12);--c-warning: #ff9f0a;--c-warning-soft: rgba(255, 159, 10, .12);--c-danger: #ff3b30;--c-danger-soft: rgba(255, 59, 48, .1);--c-info: #5ac8fa;--c-info-soft: rgba(90, 200, 250, .12);--c-bg-base: #f5f5f7;--c-bg-surface: #ffffff;--c-bg-subtle: #fbfbfd;--c-bg-hover: #f0f0f3;--c-text-primary: #1d1d1f;--c-text-secondary: #424245;--c-text-muted: #86868b;--c-text-disabled: #c7c7cc;--c-border-subtle: rgba(0, 0, 0, .06);--c-border-base: rgba(0, 0, 0, .1);--c-border-strong: rgba(0, 0, 0, .16);--s-1: 4px;--s-2: 8px;--s-3: 10px;--s-4: 12px;--s-5: 16px;--s-6: 20px;--s-8: 24px;--s-10: 32px;--r-xs: 4px;--r-sm: 8px;--r-md: 12px;--r-lg: 16px;--r-full: 9999px;--shadow-1: 0 1px 2px rgba(0, 0, 0, .04);--shadow-2: 0 2px 8px rgba(0, 0, 0, .06);--shadow-3: 0 4px 16px rgba(0, 0, 0, .1);--shadow-4: 0 12px 32px rgba(0, 0, 0, .16);--font-xs: 11px;--font-sm: 12px;--font-base: 13px;--font-md: 14px;--font-lg: 16px;--font-xl: 19px;--fw-regular: 400;--fw-medium: 500;--fw-semibold: 600;--font-numeric: tabular-nums;--ease-out: cubic-bezier(.33, 1, .68, 1);--ease-spring: cubic-bezier(.34, 1.56, .64, 1);--dur-fast: .15s;--dur-base: .2s;--dur-slow: .28s;--z-base: 1;--z-sticky: 10;--z-overlay: 20;--z-modal: 30;--z-toast: 40;--z-tooltip: 50;color:var(--c-text-primary);color-scheme:light;font-size:var(--font-base);line-height:1.5;text-align:left}.floating-wrapper[data-theme=dark]{color-scheme:dark;--c-primary: #0a84ff;--c-primary-hover: #409cff;--c-primary-active: #0a6acf;--c-primary-soft: rgba(10, 132, 255, .18);--c-primary-ring: rgba(10, 132, 255, .28);--c-success: #30d158;--c-success-soft: rgba(48, 209, 88, .18);--c-warning: #ffd60a;--c-warning-soft: rgba(255, 214, 10, .18);--c-danger: #ff453a;--c-danger-soft: rgba(255, 69, 58, .18);--c-info: #64d2ff;--c-info-soft: rgba(100, 210, 255, .18);--c-bg-base: #1c1c1e;--c-bg-surface: #2c2c2e;--c-bg-subtle: #232325;--c-bg-hover: #3a3a3c;--c-text-primary: #f5f5f7;--c-text-secondary: #d1d1d6;--c-text-muted: #98989d;--c-text-disabled: #48484a;--c-border-subtle: rgba(255, 255, 255, .08);--c-border-base: rgba(255, 255, 255, .14);--c-border-strong: rgba(255, 255, 255, .22);--shadow-1: 0 1px 2px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 255, 255, .04);--shadow-2: 0 2px 8px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .06);--shadow-3: 0 4px 16px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .06);--shadow-4: 0 12px 32px rgba(0, 0, 0, .7),inset 0 0 0 1px rgba(255, 255, 255, .08)}.floating-wrapper:not([data-theme]){visibility:hidden}.floating-wrapper,.floating-wrapper *{box-sizing:border-box}.floating-wrapper button,.floating-wrapper input,.floating-wrapper select,.floating-wrapper textarea{font:inherit}.custom-scroll{scrollbar-width:thin;scrollbar-color:var(--c-border-strong) transparent}.custom-scroll::-webkit-scrollbar-thumb{background:var(--c-border-strong)}.custom-scroll::-webkit-scrollbar-thumb:hover{background:var(--c-text-muted)}*{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.fade-in{animation:fadeIn .3s cubic-bezier(.25,.1,.25,1)}.fade-slide-enter-active,.fade-slide-leave-active{transition:all .25s ease}.fade-slide-enter-from,.fade-slide-leave-to{opacity:0;transform:translateY(6px)}@keyframes pulse{0%,to{box-shadow:0 0 #cc33334d}50%{box-shadow:0 0 0 6px #c330}}@keyframes ai-bounce{0%,80%,to{transform:scale(.8);opacity:.6}40%{transform:scale(1.15);opacity:1}}.mb-10{margin-bottom:10px!important}.mt-10{margin-top:10px!important}.mt-20{margin-top:20px!important}.small{font-size:13px}.muted-text{color:#6b7280;font-size:13px}.green{color:#059669}.red{color:#dc2626}.flex-grow{flex:1}.ghost{box-shadow:none}.aah_breadcrumb{margin-bottom:24px;padding:0;background:transparent;border:none;border-radius:0}.breadcrumb{display:inline-flex;align-items:center;gap:8px;font-size:14px;white-space:nowrap;line-height:1.2}.breadcrumb-link{color:#0071e3;cursor:pointer;display:inline-flex;align-items:center;gap:4px;text-decoration:none;white-space:nowrap}.breadcrumb-link:hover{color:#0077ed;text-decoration:underline}.breadcrumb-sep,.breadcrumb-text{color:#86868b}.aah_title{font-size:var(--font-md);font-weight:var(--fw-medium);line-height:1.6;color:var(--c-text-primary);margin-bottom:var(--s-3);padding:var(--s-3);background:var(--c-bg-subtle);border-radius:var(--r-sm);border:1px solid var(--c-border-subtle);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.aah_title img{max-width:100%;height:auto;overflow:hidden;border-radius:var(--r-sm);margin:var(--s-3) 0}.aah_options{transition:background-color var(--dur-fast) var(--ease-out),border-color var(--dur-fast) var(--ease-out);cursor:pointer;color:var(--c-text-primary)}.aah_options:hover{border-color:var(--c-primary-ring);background:var(--c-bg-hover)}.aah_options[style*="color:green"]{background:var(--c-success-soft)!important;border-color:var(--c-success)!important;font-weight:var(--fw-medium);color:var(--c-success)!important}.aah_active{box-shadow:0 0 0 2px var(--c-primary)}.aah_bomHet50{padding:13px 0 13px 10px}.aah_bomHet50 span{display:inline-block;line-height:24px;padding-left:14px;color:#86868b;font-size:13px}.aah_bomHet50 span i{display:inline-block;width:10px;height:10px;border:1px solid #d2d2d7;border-radius:2px;vertical-align:middle;margin-right:4px;margin-top:-2px}.aah_bomHet50 .dq i{background-color:#0071e31a;box-shadow:0 0 0 2px #0071e34d;border-color:#0071e3}.aah_bomHet50 .yp i{background-color:#00cc331a;border-color:#0c3}.aah_bomHet50 .wp i{background-color:#cc33331a;border-color:#c33}.is-error{box-shadow:0 0 0 2px #cc33334d inset!important}.error-message{color:#c33;margin-top:8px;font-size:13px;font-weight:400}.icon-inline{display:inline-block;width:1em;height:1em;margin-right:6px;vertical-align:middle;position:relative;top:-.05em}.home-avatar-icon{width:48px;height:48px;color:#9ca3af}.home-page-icon{width:24px;height:24px;flex-shrink:0}.aah-card{background:var(--c-bg-surface);border-radius:var(--r-md);border:1px solid var(--c-border-subtle);box-shadow:var(--shadow-1);padding:var(--s-3);transition:box-shadow var(--dur-base) var(--ease-out),border-color var(--dur-base) var(--ease-out)}.aah-card:hover{box-shadow:var(--shadow-2);border-color:var(--c-border-base)}.aah-card-compact{padding:var(--s-2) var(--s-3)}.aah-card-spacious{padding:var(--s-4) var(--s-5)}.aah-btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--s-2);padding:var(--s-2) var(--s-3);border-radius:var(--r-md);border:1px solid var(--c-border-base);background:var(--c-bg-base);color:var(--c-text-primary);font-size:var(--font-base);font-weight:var(--fw-medium);cursor:pointer;transition:all var(--dur-base) var(--ease-out)}.aah-btn:hover:enabled{box-shadow:var(--shadow-2)}.aah-btn:disabled{opacity:.6;cursor:not-allowed}.aah-btn-primary{background:linear-gradient(135deg,#6fb1fc,#4364f7);color:#fff;border-color:transparent}.aah-btn-primary:hover:enabled{filter:brightness(.95);box-shadow:var(--shadow-4)}.aah-btn-plain{background:var(--c-bg-surface)}.aah-btn-small{padding:var(--s-2) var(--s-3);font-size:var(--font-sm);border-radius:var(--r-sm)}.aah-btn-danger{background:var(--c-danger-soft);color:var(--c-danger);border-color:var(--c-border-base)}.aah-tag{display:inline-flex;align-items:center;gap:var(--s-2);padding:var(--s-2) var(--s-3);border-radius:var(--r-sm);font-size:var(--font-sm);font-weight:var(--fw-semibold);border:1px solid transparent}.aah-tag-primary{background:#0071e31a;color:var(--c-primary);border-color:#0071e329}.aah-tag-success{background:#34c7591f;color:var(--c-success);border-color:#34c75933}.aah-tag-warning{background:#ff9f0a1f;color:var(--c-warning);border-color:#ff9f0a33}.aah-input{width:100%;padding:var(--s-2) var(--s-3);border-radius:var(--r-md);border:1px solid var(--c-border-base);background:var(--c-bg-subtle);color:var(--c-text-primary);font-size:var(--font-base);transition:all var(--dur-base) var(--ease-out)}.aah-input:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px #0071e31a}.aah-input:disabled{opacity:.6;cursor:not-allowed;background:var(--c-bg-base)}.aah-input.recording{border-color:var(--c-primary);box-shadow:0 0 0 3px #0071e326}.aah-select{width:100%;padding:var(--s-2) var(--s-3);border-radius:var(--r-md);border:1px solid var(--c-border-base);background:var(--c-bg-subtle);color:var(--c-text-primary);font-size:var(--font-base);cursor:pointer;transition:all var(--dur-base) var(--ease-out)}.aah-select:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px #0071e31a}.aah-select:disabled{opacity:.6;cursor:not-allowed;background:var(--c-bg-base)}.aah-alert{display:flex;align-items:flex-start;gap:var(--s-3);padding:var(--s-3);border-radius:var(--r-md);font-size:var(--font-base);line-height:1.6;border:1px solid transparent}.aah-alert-info{background:#3b82f61a;color:#1d4ed8;border-color:#3b82f633}.aah-alert-success{background:#34c7591a;color:#0f5132;border-color:#34c75933}.aah-alert-warning{background:#ff9f0a1a;color:#92400e;border-color:#ff9f0a33}.aah-alert-danger{background:#ef44441a;color:#b91c1c;border-color:#ef444433}.aah-page{display:flex;flex-direction:column;height:100%;overflow:hidden}.page-title{margin:0;font-size:var(--font-lg);font-weight:var(--fw-semibold);color:var(--c-text-primary);letter-spacing:-.022em}.aah-page-content{flex:1;overflow-y:auto;overflow-x:hidden;padding:var(--s-3)}.aah-page-content.no-padding{padding:0}.aah-page-footer{padding:var(--s-3) var(--s-4);border-top:1px solid var(--c-border-subtle);background:var(--c-bg-surface);flex-shrink:0}.aah-page.is-loading .aah-page-content{position:relative;pointer-events:none;opacity:.6}.page-loader{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;background:#fffc;z-index:100}.spinner{width:32px;height:32px;border:3px solid var(--c-border-subtle);border-top-color:var(--c-primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}.aah-slider{width:100%;accent-color:var(--c-primary)}.radio-group{display:flex;gap:var(--s-3)}.radio-item{display:inline-flex;align-items:center;gap:var(--s-1);cursor:pointer}', ".floating-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:999999}.el_wrapper>.floating-wrapper{pointer-events:none!important}.el_wrapper>div{pointer-events:none;z-index:999999!important}.el_wrapper>div>div{pointer-events:none;z-index:999999!important}.el_wrapper>.minimized-dialog{pointer-events:auto!important}.minimized-dialog{position:fixed;bottom:20px;right:20px;z-index:9999999}.floating-dialog{position:fixed;display:flex;flex-direction:column;pointer-events:auto;border-radius:var(--r-md);overflow:hidden;box-shadow:var(--shadow-3);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);max-width:calc(100vw - 32px);max-height:calc(100vh - 80px);z-index:999999}.floating-dialog:has(.ai-config-panel){width:min(960px,calc(100vw - 32px))!important}.el_wrapper>.floating-wrapper>.floating-dialog{pointer-events:auto!important}.floating-header{display:flex;align-items:center;justify-content:space-between;background:var(--c-bg-subtle);color:var(--c-text-primary);padding:var(--s-2) var(--s-3);border-bottom:1px solid var(--c-border-subtle);cursor:move;-webkit-user-select:none;user-select:none;gap:var(--s-2)}.floating-title{display:flex;align-items:center;gap:var(--s-2);min-width:0;font-size:var(--font-base);font-weight:var(--fw-semibold);color:var(--c-text-primary);letter-spacing:-.022em}.floating-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.floating-title img{width:16px;height:16px;vertical-align:middle;border-radius:4px}.floating-version{margin-left:var(--s-2);background:transparent;border:none;color:var(--c-text-muted);padding:0;font-size:var(--font-xs);font-weight:var(--fw-regular);font-variant-numeric:var(--font-numeric)}.floating-actions{display:flex;align-items:center;gap:var(--s-1);flex-shrink:0}.floating-actions .theme-switcher{display:inline-flex}.floating-actions .segmented{background:var(--c-bg-surface)}.floating-actions .segment-item{padding:2px 6px;font-size:var(--font-xs);line-height:1.4}.floating-close{width:28px;height:28px;border:none;border-radius:50%;background:var(--c-bg-hover);color:var(--c-text-secondary);font-size:var(--font-lg);line-height:1;cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out),color var(--dur-fast) var(--ease-out)}.floating-close:hover{background:var(--c-border-base);color:var(--c-text-primary)}.floating-body{flex:1 1 auto;min-height:0;overflow:hidden;background:var(--c-bg-base)}.floating-resize-handle{position:absolute;right:0;bottom:0;width:16px;height:16px;cursor:ew-resize;-webkit-user-select:none;user-select:none;background-image:linear-gradient(135deg,transparent 50%,var(--c-text-muted) 50%,var(--c-text-muted) 60%,transparent 60%);background-size:6px 6px;background-position:bottom right;background-repeat:no-repeat;opacity:.45;transition:opacity var(--dur-fast) var(--ease-out)}.floating-resize-handle:hover{opacity:.9}.floating-scroll{min-height:0;background:var(--c-bg-base);padding:0;max-height:50vh;overflow:auto}@media (max-width: 600px){.floating-scroll{max-height:45vh}}@media (min-width: 601px){.floating-scroll{max-height:62vh}}.minimized-dialog img{pointer-events:auto;width:56px!important;height:56px!important;z-index:9999999!important;display:block;cursor:pointer}.mini-tooltip-wrapper{position:relative;display:inline-block}.mini-tooltip{position:absolute;bottom:calc(100% + 10px);right:0;background:var(--c-text-primary);color:var(--c-bg-surface);padding:var(--s-2) var(--s-3);border-radius:var(--r-sm);font-size:var(--font-sm);box-shadow:var(--shadow-2);white-space:nowrap}", ".modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:grid;place-items:center;z-index:var(--z-modal, 1000000);padding:var(--s-4)}.modal-panel{background:var(--c-bg-surface);border-radius:var(--r-md);width:min(600px,100%);max-height:80vh;display:flex;flex-direction:column;box-shadow:var(--shadow-4);border:1px solid var(--c-border-subtle)}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:var(--s-2) var(--s-3);border-bottom:1px solid var(--c-border-subtle)}.modal-header h3{margin:0;color:var(--c-text-primary);font-size:var(--font-lg);font-weight:var(--fw-semibold)}.modal-close{border:none;background:transparent;font-size:var(--font-xl);cursor:pointer;color:var(--c-text-muted);transition:color var(--dur-fast) var(--ease-out)}.modal-close:hover{color:var(--c-text-primary)}.modal-body{padding:var(--s-3);overflow-y:auto;display:flex;flex-direction:column;gap:var(--s-3)}.modal-footer{padding:var(--s-2) var(--s-3);border-top:1px solid var(--c-border-subtle);display:flex;justify-content:flex-end;gap:var(--s-2)}.modal-panel-large{width:min(1000px,90vw);max-height:90vh}.form-row{display:flex;flex-direction:column;gap:var(--s-1)}.form-row label{color:var(--c-text-secondary);font-size:var(--font-sm);font-weight:var(--fw-medium)}.option-list{display:flex;flex-direction:column;gap:var(--s-2)}.option-row{display:flex;gap:var(--s-2);align-items:center}.option-selector{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;border:1px solid var(--c-border-base);background:var(--c-bg-base);color:var(--c-text-muted);font-weight:var(--fw-semibold);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out),border-color var(--dur-fast) var(--ease-out),color var(--dur-fast) var(--ease-out)}.option-selector:hover{border-color:var(--c-primary);color:var(--c-primary)}.option-selector.active{background:var(--c-primary);color:#fff;border-color:var(--c-primary)}.reading-form-section{padding:var(--s-3);background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);border-radius:var(--r-md)}.reading-section-header{display:flex;align-items:center;gap:var(--s-2);margin-bottom:var(--s-3);padding-bottom:var(--s-3);border-bottom:1px solid var(--c-border-subtle)}.reading-section-icon{font-size:var(--font-xl);color:var(--c-primary)}.reading-section-header h4{margin:0;color:var(--c-text-primary);font-size:var(--font-md);font-weight:var(--fw-semibold)}.reading-sub-questions-editor{display:flex;flex-direction:column;gap:var(--s-3)}.reading-sub-question-editor{padding:var(--s-3);background:var(--c-bg-surface);border:1px solid var(--c-border-base);border-radius:var(--r-md)}.reading-sub-question-header{display:flex;align-items:center;gap:var(--s-2);margin-bottom:var(--s-3);padding-bottom:var(--s-3);border-bottom:1px solid var(--c-border-subtle)}.reading-sub-question-number{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex-shrink:0;background:var(--c-primary);color:#fff;border-radius:var(--r-full);font-size:var(--font-sm);font-weight:var(--fw-semibold);font-variant-numeric:var(--font-numeric)}.reading-base-select-small{min-width:120px;padding:6px var(--s-2);font-size:var(--font-sm)}.reading-answer-list{display:flex;flex-direction:column;gap:var(--s-2)}.reading-answer-row{display:flex;align-items:center;gap:var(--s-2)}", ".hljs{display:block;overflow-x:auto;padding:var(--s-3);border-radius:var(--r-sm);font-family:ui-monospace,SF Mono,Consolas,monospace;font-size:var(--font-sm);line-height:1.5}.floating-wrapper:not([data-theme=dark]) .hljs{background:#f6f8fa;color:#24292f;box-shadow:var(--shadow-1)}.floating-wrapper:not([data-theme=dark]) .hljs-keyword,.floating-wrapper:not([data-theme=dark]) .hljs-selector-tag,.floating-wrapper:not([data-theme=dark]) .hljs-built_in{color:#cf222e}.floating-wrapper:not([data-theme=dark]) .hljs-string,.floating-wrapper:not([data-theme=dark]) .hljs-attr{color:#0a3069}.floating-wrapper:not([data-theme=dark]) .hljs-number,.floating-wrapper:not([data-theme=dark]) .hljs-literal{color:#0550ae}.floating-wrapper:not([data-theme=dark]) .hljs-comment{color:#6e7781;font-style:italic}.floating-wrapper:not([data-theme=dark]) .hljs-title,.floating-wrapper:not([data-theme=dark]) .hljs-name{color:#8250df}.floating-wrapper[data-theme=dark] .hljs{background:#1f1f23;color:#f0f6fc;box-shadow:var(--shadow-1)}.floating-wrapper[data-theme=dark] .hljs-keyword,.floating-wrapper[data-theme=dark] .hljs-selector-tag,.floating-wrapper[data-theme=dark] .hljs-built_in{color:#ff7b72}.floating-wrapper[data-theme=dark] .hljs-string,.floating-wrapper[data-theme=dark] .hljs-attr{color:#a5d6ff}.floating-wrapper[data-theme=dark] .hljs-number,.floating-wrapper[data-theme=dark] .hljs-literal{color:#79c0ff}.floating-wrapper[data-theme=dark] .hljs-comment{color:#8b949e;font-style:italic}.floating-wrapper[data-theme=dark] .hljs-title,.floating-wrapper[data-theme=dark] .hljs-name{color:#d2a8ff}", ".tabs-bar{display:flex;gap:3px;padding:5px 8px;border-bottom:1px solid var(--c-border-subtle);background:var(--c-bg-subtle);overflow-x:auto}.tabs-bar::-webkit-scrollbar{display:none}.tab-item{flex-shrink:0;padding:4px 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--c-text-muted);font-size:var(--font-sm);font-weight:var(--fw-medium);cursor:pointer;transition:color var(--dur-fast) var(--ease-out),background-color var(--dur-fast) var(--ease-out)}.tab-item:hover:not(.active){color:var(--c-text-secondary)}.tab-item.active{background:var(--c-bg-surface);color:var(--c-primary);border-color:var(--c-primary-soft);box-shadow:var(--shadow-1)}.tab-item:focus-visible{outline:2px solid var(--c-primary-ring);outline-offset:2px}.sub-segmented-row{padding:6px var(--s-2) 0}", ".segmented{display:inline-flex;padding:2px;gap:2px;background:var(--c-bg-base);border:1px solid var(--c-border-subtle);border-radius:var(--r-sm)}.segment-item{padding:var(--s-1) var(--s-3);border:none;border-radius:calc(var(--r-sm) - 2px);background:transparent;color:var(--c-text-muted);font-size:var(--font-sm);font-weight:var(--fw-medium);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out),color var(--dur-fast) var(--ease-out)}.segment-item.active{background:var(--c-bg-surface);color:var(--c-primary);box-shadow:var(--shadow-1)}.segment-item:focus-visible{outline:2px solid var(--c-primary-ring);outline-offset:2px}", ".stat-card{text-align:left;padding:10px 12px;background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:10px;cursor:default;box-shadow:var(--shadow-1);transition:transform var(--dur-base) var(--ease-out),box-shadow var(--dur-base) var(--ease-out)}.stat-card-clickable{cursor:pointer}.stat-card-clickable:hover{transform:translateY(-1px);box-shadow:var(--shadow-2)}.stat-card-clickable:focus-visible{outline:2px solid var(--c-primary-ring);outline-offset:2px}.stat-label{display:flex;align-items:center;gap:var(--s-1);font-size:var(--font-xs);color:var(--c-text-muted)}.stat-icon{width:12px;height:12px;border-radius:3px;flex-shrink:0}.stat-value{font-size:18px;font-weight:var(--fw-semibold);margin-top:var(--s-1);font-variant-numeric:var(--font-numeric);line-height:1.3}.stat-meta{font-size:var(--font-xs);color:var(--c-text-muted);margin-top:2px}.stat-progress{height:4px;border-radius:2px;background:var(--c-bg-hover);overflow:hidden;margin-top:var(--s-2)}.stat-progress>i{display:block;height:100%;background:var(--c-primary);transition:width var(--dur-base) var(--ease-out)}", '.switch{position:relative;display:inline-block;width:44px;height:26px;cursor:pointer}.switch.disabled{cursor:not-allowed;opacity:.6}.switch input{opacity:0;width:0;height:0}.switch-slider{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--c-bg-hover);border-radius:var(--r-full);transition:background-color var(--dur-base) var(--ease-out)}.switch-slider:before{content:"";position:absolute;top:2px;left:2px;width:22px;height:22px;background:#fff;border-radius:50%;box-shadow:var(--shadow-1);transition:transform var(--dur-base) var(--ease-spring)}.switch input:checked+.switch-slider{background:var(--c-primary)}.switch input:checked+.switch-slider:before{transform:translate(18px)}.switch input:focus-visible+.switch-slider{box-shadow:0 0 0 3px var(--c-primary-ring)}', '.overview-page{display:flex;flex-direction:column;gap:var(--s-3);padding:var(--s-3)}.overview-user{display:flex;align-items:center;gap:var(--s-3)}.ov-avatar{width:48px;height:48px;border-radius:50%;background:linear-gradient(135deg,var(--c-primary-soft),var(--c-bg-subtle));border:1px solid var(--c-border-subtle);display:grid;place-items:center;color:var(--c-primary);overflow:hidden;font-weight:var(--fw-semibold);flex-shrink:0}.ov-avatar img{width:100%;height:100%;object-fit:cover}.ov-user-meta{flex:1;min-width:0}.ov-user-meta h3{margin:0;font-size:var(--font-lg);font-weight:var(--fw-semibold);color:var(--c-text-primary)}.ov-user-meta p{margin:var(--s-1) 0 0;font-size:var(--font-sm);color:var(--c-text-muted)}.ov-tags{display:flex;gap:var(--s-1);flex-wrap:wrap}.ov-muted{color:var(--c-text-muted)}.overview-notice{background:var(--c-primary-soft);border:1px solid var(--c-primary-ring);padding:10px 12px}.ov-notice-content{font-size:var(--font-sm);color:var(--c-text-secondary);line-height:1.5}.ov-notice-content a{color:var(--c-primary)}.ov-notice-content:before{content:"\ud83d\udce3 "}.overview-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--s-2)}.overview-actions{display:flex;flex-wrap:wrap;gap:var(--s-2)}.overview-actions .aah-btn{flex:1;min-width:96px}.overview-version{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);border-radius:10px}.ov-version-text{font-size:var(--font-sm);color:var(--c-text-muted);font-variant-numeric:var(--font-numeric)}@media (max-width: 480px){.overview-stats{grid-template-columns:1fr}.overview-actions .aah-btn{flex:1 0 100%}}', ".settings-layout{display:grid;grid-template-columns:minmax(112px,124px) minmax(0,1fr);flex:1;min-height:0;gap:1px;background:var(--c-border-subtle);border:1px solid var(--c-border-subtle);border-radius:var(--r-lg);overflow:hidden}.settings-page .aah-page-content{overflow-x:auto}.settings-layout:has(.ai-config-panel),.settings-layout.settings-layout-ai{min-width:900px}.settings-layout:has(.ai-config-panel) .ai-config-manager,.settings-layout-ai .ai-config-manager{grid-template-columns:minmax(180px,200px) minmax(0,1fr)}.settings-sidebar{display:flex;flex-direction:column;background:var(--c-bg-surface);height:100%;min-width:0;overflow-y:auto}.sidebar-header{padding:var(--s-2);border-bottom:1px solid var(--c-border-subtle);flex-shrink:0}.settings-search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:var(--s-2);color:var(--c-text-muted);font-size:16px;pointer-events:none}.settings-search-input{padding-left:28px!important;width:100%}.sidebar-nav{flex:1;padding:var(--s-1);overflow-y:auto}.sidebar-nav .nav-item{display:flex;align-items:center;gap:var(--s-1);padding:var(--s-2);border-radius:var(--r-md);color:var(--c-text-primary);font-size:var(--font-base);font-weight:var(--fw-medium);cursor:pointer;transition:all var(--dur-base) var(--ease-out);text-decoration:none;margin-bottom:var(--s-1);width:100%;text-align:left;border:none;background:transparent}.sidebar-nav .nav-item:hover{background:var(--c-bg-hover)}.sidebar-nav .nav-item.active{background:var(--c-primary-soft);color:var(--c-primary);font-weight:var(--fw-semibold)}.nav-icon{font-size:20px;flex-shrink:0}.sidebar-footer{padding:var(--s-3);border-top:1px solid var(--c-border-subtle);flex-shrink:0}.sidebar-footer .aah-alert{font-size:var(--font-sm);padding:var(--s-2) var(--s-3)}.settings-content{background:var(--c-bg-surface);height:100%;min-width:0;overflow-y:auto;padding:var(--s-4)}.settings-content-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--s-3);margin-bottom:var(--s-3);padding-bottom:var(--s-3);border-bottom:1px solid var(--c-border-subtle)}.settings-content-header h2{margin:0;color:var(--c-text-primary);font-size:var(--font-xl);font-weight:var(--fw-semibold)}.settings-content-header p{margin:var(--s-1) 0 0;color:var(--c-text-muted);font-size:var(--font-sm)}.settings-section.settings-config-section{gap:var(--s-3)}.setting-group{margin-bottom:var(--s-4)}.group-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--s-3);padding-bottom:var(--s-2);border-bottom:1px solid var(--c-border-subtle)}.group-title{display:flex;align-items:center;gap:var(--s-2);margin:0;font-size:var(--font-lg);font-weight:var(--fw-semibold);color:var(--c-text-primary);letter-spacing:-.022em}.group-items{display:flex;flex-direction:column;gap:var(--s-2)}.empty-search{text-align:center;padding:var(--s-6) var(--s-3);color:var(--c-text-muted)}.settings-empty-icon{font-size:48px;margin-bottom:var(--s-3);opacity:.5}.settings-empty-text{margin:0;font-size:var(--font-base)}.config-item{padding:10px;background:var(--c-bg-surface);border-radius:10px;transition:all .3s cubic-bezier(.25,.1,.25,1);border:1px solid var(--c-border-subtle)}.config-item:hover{background:var(--c-bg-subtle);box-shadow:0 2px 8px var(--c-border-subtle);border-color:var(--c-border-base)}.config-item-content{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.config-label{display:flex;align-items:flex-start;gap:8px;flex:1;min-width:180px}.label-wrapper{display:flex;flex-direction:column;gap:4px}.label-text{font-size:15px;font-weight:500;color:var(--c-text-primary)}.label-desc{font-size:13px;font-weight:400;color:var(--c-text-muted);line-height:1.5}.info-icon{color:var(--c-text-muted);cursor:help;font-size:16px;transition:color .2s ease}.info-icon:hover{color:var(--c-primary)}.config-control{display:flex;align-items:center;flex-shrink:0;gap:10px;flex-wrap:wrap;justify-content:flex-end}.checkbox-group{display:flex;flex-wrap:wrap;gap:10px}.base-alert{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;border:1px solid var(--c-border-subtle);background:var(--c-bg-subtle);color:var(--c-text-primary);font-size:14px}.base-alert-info{background:var(--c-primary-soft);border-color:var(--c-primary-ring)}.alert-icon{font-size:16px}.base-tag{display:inline-flex;align-items:center;padding:4px 8px;border-radius:8px;font-size:12px;font-weight:600;border:1px solid transparent}.base-tag-success{background:var(--c-success-soft);color:var(--c-success);border-color:var(--c-success-soft)}.base-input,.base-select{min-width:180px;padding:8px 10px;border:1px solid var(--c-border-base);border-radius:8px;background:var(--c-bg-surface);color:var(--c-text-primary);font-size:14px;transition:border-color .2s ease,box-shadow .2s ease}.base-input:focus,.base-select:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px var(--c-primary-ring)}.base-select{min-width:160px}.checkbox-item{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:8px;background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle)}.hotkey-input-wrapper{position:relative;display:inline-flex;align-items:center;gap:8px}.hotkey-input-wrapper .hotkey-hint{font-size:12px;color:var(--c-text-muted);background:var(--c-bg-subtle);padding:4px 8px;border-radius:8px}.hotkey-input-wrapper .hotkey-hint.danger{color:var(--c-danger);background:var(--c-danger-soft)}.hotkey-input-wrapper .base-input.recording{border-color:var(--c-danger);box-shadow:0 0 0 3px var(--c-danger-soft)}.hotkey-input-wrapper .base-input{cursor:pointer}.ai-config-panel{display:flex;flex-direction:column;gap:var(--s-3)}.ai-config-summary{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--s-3);padding:var(--s-3);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);background:var(--c-bg-surface)}.ai-config-summary h3,.ai-config-detail-header h4,.ai-config-section h5{margin:0;color:var(--c-text-primary)}.ai-config-summary p,.ai-config-detail-header p{margin:4px 0 0;color:var(--c-text-muted);font-size:var(--font-xs);overflow-wrap:anywhere}.ai-config-manager{display:grid;grid-template-columns:minmax(180px,220px) minmax(0,1fr);gap:var(--s-3)}.ai-config-list-panel,.ai-config-detail,.ai-config-empty{border:1px solid var(--c-border-subtle);border-radius:var(--r-md);background:var(--c-bg-surface)}.ai-config-list-panel{display:flex;flex-direction:column;gap:var(--s-3);padding:var(--s-3);min-width:0}.ai-config-list{display:flex;flex-direction:column;gap:var(--s-2);max-height:420px;overflow:auto}.ai-config-list-item{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--s-2);padding:var(--s-2);border:1px solid var(--c-border-subtle);border-radius:var(--r-sm);background:var(--c-bg-surface);color:var(--c-text-secondary);text-align:left;cursor:pointer}.ai-config-list-item.active{border-color:var(--c-primary);background:var(--c-primary-soft);color:var(--c-text-primary)}.ai-config-list-icon{color:var(--c-primary)}.ai-config-list-text{min-width:0;display:flex;flex-direction:column;gap:2px}.ai-config-list-text strong,.ai-config-list-text small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-config-list-text small{color:var(--c-text-muted)}.ai-config-default,.ai-config-enabled-dot{justify-self:end}.ai-config-default{color:var(--c-primary);font-size:var(--font-xs);font-weight:var(--fw-semibold)}.ai-config-enabled-dot{width:8px;height:8px;border-radius:var(--r-full);background:var(--c-success)}.ai-config-detail{min-width:0;display:flex;flex-direction:column;gap:var(--s-3);padding:var(--s-3)}.ai-config-detail-header,.ai-config-actions,.ai-config-options{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);flex-wrap:wrap}.ai-config-primary-actions{display:flex;align-items:center;gap:var(--s-2);flex-wrap:wrap}.ai-config-delete-modal{width:min(420px,100%)}.ai-config-delete-text{margin:0;color:var(--c-text-secondary);line-height:1.6}.ai-config-section{display:flex;flex-direction:column;gap:var(--s-3);padding-top:var(--s-3);border-top:1px solid var(--c-border-subtle)}.ai-config-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s-3)}.ai-config-field{min-width:0;display:flex;flex-direction:column;gap:6px}.ai-config-field span{color:var(--c-text-secondary);font-size:var(--font-xs);font-weight:var(--fw-medium)}.ai-config-field-help{margin:0;color:var(--c-text-muted);font-size:var(--font-xs);line-height:1.5}.ai-config-field-help a{margin-left:var(--s-1);color:var(--c-primary);font-weight:var(--fw-medium);text-decoration:none}.ai-config-field-help a:hover{text-decoration:underline}.ai-config-advanced summary{cursor:pointer;color:var(--c-text-primary);font-weight:var(--fw-semibold)}.ai-config-empty{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--s-2);padding:var(--s-4);color:var(--c-text-muted);text-align:center}.ai-config-empty svg{font-size:36px;color:var(--c-primary)}@media (max-width: 720px){.ai-config-manager,.ai-config-form-grid{grid-template-columns:1fr}.ai-config-summary{flex-direction:column}}@media (max-width: 768px){.settings-layout{display:flex;flex-direction:column;height:auto;min-width:0;border:none;background:transparent}.settings-sidebar{position:sticky;top:0;z-index:10;height:auto;border-bottom:1px solid var(--c-border-subtle);border-radius:var(--r-lg) var(--r-lg) 0 0}.sidebar-footer{display:none}.sidebar-nav{flex-direction:row;overflow-x:auto;padding:0 var(--s-4);gap:var(--s-4)}.sidebar-nav .nav-item{white-space:nowrap;border-radius:0;border-bottom:2px solid transparent;padding:var(--s-4) var(--s-2);margin-bottom:0}.sidebar-nav .nav-item.active{background:transparent;border-bottom-color:var(--c-primary);color:var(--c-primary)}.settings-content{padding:var(--s-4)}.settings-content-header,.config-item-content{flex-direction:column;align-items:flex-start}.config-control{width:100%;justify-content:flex-start}}.settings-section{display:flex;flex-direction:column;gap:var(--s-2);margin-bottom:var(--s-3)}", ".user-page{display:flex;flex-direction:column;gap:var(--s-3);padding:0;max-width:100%}.user-page__login-section{display:flex;justify-content:center;padding:var(--s-3) 0;background:transparent}.user-page__login-box,.user-page__header-card,.user-page__apikey-section,.user-page__support-card,.user-page__tips{border:1px solid var(--c-border-subtle);border-radius:var(--r-md);background:var(--c-bg-surface);box-shadow:var(--shadow-1)}.user-page__login-box{width:min(100%,460px);padding:var(--s-4)}.user-page__login-header{display:flex;flex-direction:column;align-items:center;gap:var(--s-2);margin-bottom:var(--s-3);text-align:center}.user-page__login-header h2{margin:var(--s-1) 0 0;color:var(--c-text-primary);font-size:var(--font-xl);font-weight:600}.user-page__login-header p{margin:0;color:var(--c-text-muted);font-size:var(--font-sm)}.user-page__login-switch{display:inline-flex;flex-wrap:wrap;justify-content:center;gap:var(--s-2);margin-top:var(--s-2)}.user-page__login-switch .aah-btn{min-width:92px}.user-page__login-switch .aah-btn.is-active{color:var(--c-primary);border-color:var(--c-primary-ring);background:var(--c-primary-soft)}.user-page__login-form,.user-page__login-form .form-item{margin-bottom:var(--s-3)}.user-page__login-btn{width:100%;min-height:38px}.user-page__register-tip{color:var(--c-text-muted);font-size:var(--font-sm);text-align:center}.user-page__link-btn{margin-left:var(--s-1);padding:0;border:0;background:transparent;color:var(--c-primary);font:inherit;cursor:pointer}.user-page__link-btn:hover{color:var(--c-primary-hover)}.user-page__helper{margin:var(--s-2) 0 0;color:var(--c-text-muted);font-size:var(--font-xs);line-height:1.5}.user-page__dashboard{display:flex;flex-direction:column;gap:var(--s-3);padding:0;max-width:100%;margin:0 auto}.user-page__header-card{display:flex;align-items:center;gap:var(--s-3);padding:var(--s-3)}.user-page__avatar{display:grid;flex-shrink:0;width:56px;height:56px;place-items:center;overflow:hidden;border:1px solid var(--c-border-subtle);border-radius:50%;background:var(--c-bg-subtle);color:var(--c-text-muted)}.user-page__avatar img{width:100%;height:100%;object-fit:cover}.user-page__avatar-icon{width:28px;height:28px}.user-page__info-text{display:flex;flex:1;min-width:0;flex-direction:column;align-items:flex-start;gap:var(--s-1)}.user-page__info-text h2{margin:0;color:var(--c-text-primary);font-size:var(--font-lg);font-weight:600}.user-page__username{margin:0;color:var(--c-text-muted);font-size:var(--font-sm)}.user-page__actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:var(--s-2)}.user-page__stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s-3)}.user-page__stat-card{display:flex;align-items:center;gap:var(--s-3);min-width:0;padding:var(--s-3);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);background:var(--c-bg-surface);box-shadow:var(--shadow-1)}.user-page__stat-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:36px;height:36px;border-radius:var(--r-sm);font-size:18px}.user-page__stat-icon--coin{background:var(--c-warning-soft);color:var(--c-warning)}.user-page__stat-icon--course{background:var(--c-danger-soft);color:var(--c-danger)}.user-page__stat-icon--question{background:var(--c-success-soft);color:var(--c-success)}.user-page__stat-content{flex:1;min-width:0}.user-page__stat-label{margin:0 0 var(--s-1);color:var(--c-text-muted);font-size:var(--font-xs)}.user-page__stat-value{margin:0;color:var(--c-text-primary);font-size:var(--font-lg);font-weight:600}.user-page__apikey-section{display:flex;flex-direction:column;gap:var(--s-3);padding:var(--s-3)}.user-page__section-header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--s-3)}.user-page__section-header h3{margin:0;color:var(--c-text-primary);font-size:var(--font-base);font-weight:600}.user-page__section-header p{margin:var(--s-1) 0 0;color:var(--c-text-muted);font-size:var(--font-xs);line-height:1.5}.user-page__apikey-display{display:flex;align-items:center;gap:var(--s-3)}.user-page__apikey-value{flex:1;min-width:0;padding:var(--s-3);border:1px solid var(--c-border-base);border-radius:var(--r-sm);background:var(--c-bg-subtle);color:var(--c-text-primary);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:var(--font-sm);line-height:1.4;overflow-wrap:anywhere}.user-page__apikey-actions{display:flex;flex-shrink:0;justify-content:flex-end}.user-page__support-card{display:flex;align-items:center;gap:var(--s-3);padding:var(--s-3)}.user-page__support-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:36px;height:36px;border-radius:var(--r-sm);background:var(--c-primary-soft);color:var(--c-primary);font-size:18px}.user-page__support-content{flex:1;min-width:0}.user-page__support-title{margin:0 0 var(--s-1);color:var(--c-text-primary);font-size:var(--font-sm);font-weight:600}.user-page__support-desc{margin:0;color:var(--c-text-muted);font-size:var(--font-xs);line-height:1.5}.user-page__support-btn{flex-shrink:0;white-space:nowrap}.user-page__tips{padding:var(--s-3);color:var(--c-text-muted);font-size:var(--font-xs)}.user-page__tips p{margin:0}@media (max-width: 768px){.user-page__login-section{padding:var(--s-3) 0}.user-page__login-box{padding:var(--s-4)}.user-page__header-card{align-items:flex-start}.user-page__actions{justify-content:stretch}.user-page__actions .aah-btn{flex:1 1 140px}.user-page__stats-grid{grid-template-columns:1fr}.user-page__support-card{align-items:flex-start;flex-wrap:wrap}.user-page__apikey-display{align-items:stretch;flex-direction:column}.user-page__apikey-actions{justify-content:stretch}.user-page__apikey-actions .aah-btn,.user-page__support-btn{width:100%}}", ".ai-workbench{display:flex;flex-direction:column;gap:var(--s-4)}.ai-status-panel{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);padding:var(--s-3);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);background:var(--c-bg-surface)}.ai-status-main{min-width:0;display:flex;flex-direction:column;gap:4px}.ai-status-main strong{color:var(--c-text-primary);font-size:var(--font-md)}.ai-status-main p{margin:0;color:var(--c-text-muted);font-size:var(--font-xs);overflow-wrap:anywhere}.ai-input-panel,.ai-result-panel{display:flex;flex-direction:column;gap:var(--s-3)}.ai-section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--s-3)}.ai-section-heading h3{margin:0;color:var(--c-text-primary);font-size:var(--font-lg)}.ai-section-heading p,.ai-helper-text{margin:4px 0 0;color:var(--c-text-muted);font-size:var(--font-xs)}.ai-mode-switch,.ai-command-row,.ai-result-actions{display:flex;align-items:center;flex-wrap:wrap;gap:var(--s-2)}.ai-mode-btn{border:1px solid var(--c-border-base);background:var(--c-bg-surface);color:var(--c-text-secondary);padding:7px 10px;border-radius:var(--r-full);font-size:var(--font-xs);cursor:pointer;transition:border-color .2s ease,background-color .2s ease,color .2s ease}.ai-mode-btn.active{background:var(--c-primary);border-color:var(--c-primary);color:#fff}.ai-question-type-row{display:grid;grid-template-columns:minmax(180px,240px) 1fr;align-items:end;gap:var(--s-3)}.ai-textarea{width:100%;min-height:160px;border:1px solid var(--c-border-base);border-radius:var(--r-md);padding:var(--s-3);background:var(--c-bg-surface);color:var(--c-text-primary);font-size:var(--font-base);line-height:1.6;resize:vertical;outline:none}.ai-textarea:focus{border-color:var(--c-primary-ring);box-shadow:0 0 0 3px var(--c-primary-soft)}.ai-result-content{min-height:140px;padding:var(--s-3);background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);border-radius:var(--r-md)}.ai-result-content-active{border-color:var(--c-border-base)}.ai-loading-text{text-align:center;padding:var(--s-4) var(--s-2);color:var(--c-text-muted)}.ai-empty{text-align:center;padding:var(--s-8) var(--s-4);color:var(--c-text-muted)}.ai-empty-icon{font-size:48px;margin-bottom:var(--s-2);opacity:.5}.ai-empty-text{margin:0;font-size:var(--font-base)}.ai-link-btn{background:transparent;border:none;cursor:pointer;margin-left:8px;color:var(--c-primary)}.ai-service-details{border:1px solid var(--c-border-subtle);border-radius:var(--r-md);background:var(--c-bg-surface);padding:var(--s-3)}.ai-service-details summary{cursor:pointer;color:var(--c-text-secondary);font-weight:var(--fw-semibold)}.ai-service-details .copyright-content{margin-top:var(--s-3);color:var(--c-text-secondary);line-height:1.7}.official-meta{border:1px solid var(--c-border-subtle);border-radius:10px;overflow:hidden;margin-bottom:12px}.official-meta-row{display:grid;grid-template-columns:120px 1fr;border-bottom:1px solid var(--c-border-subtle)}.official-meta-row:last-child{border-bottom:none}.official-meta-label{background:var(--c-bg-base);padding:10px 12px;font-weight:700;color:var(--c-text-primary)}.official-meta-value{padding:10px 12px;color:var(--c-text-primary);line-height:1.6}.official-meta-options{padding:10px 12px;display:flex;flex-direction:column;gap:8px}.official-meta-option{display:flex;gap:8px;align-items:flex-start}.official-meta-option .official-option-label{font-weight:700;color:var(--c-text-muted)}.official-meta-option .official-option-text{flex:1;color:var(--c-text-primary);line-height:1.6}.official-result-list{display:flex;flex-direction:column;gap:12px}.official-result-item{border:1px solid var(--c-border-subtle);border-radius:10px;padding:12px;background:var(--c-bg-surface);box-shadow:var(--shadow-1)}.official-result-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.official-result-title{font-weight:700;color:var(--c-text-primary)}.official-result-subtitle{color:var(--c-text-muted);margin-left:10px;font-size:12px}.official-section{margin-top:10px}.official-section-label{font-weight:700;color:var(--c-text-secondary);margin-bottom:6px}.official-question{background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:6px;padding:8px;line-height:1.6;color:var(--c-text-primary)}.official-options{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.official-options li{display:flex;gap:8px;align-items:flex-start;background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:6px;padding:8px}.official-options .official-option-label{font-weight:700;color:var(--c-text-muted)}.official-options .official-option-text{color:var(--c-text-primary);line-height:1.5}.official-answer-chips{display:flex;flex-wrap:wrap;gap:8px}.official-answer-empty{color:var(--c-text-muted)}@media (max-width: 680px){.ai-status-panel,.ai-section-heading,.ai-question-type-row{display:flex;flex-direction:column;align-items:stretch}.ai-status-panel .aah-btn{align-self:flex-start}.ai-command-row .aah-btn{flex:1 1 auto;justify-content:center}}", ".ask-page{display:flex;flex-direction:column;gap:var(--s-3);padding:0}.ask-toolbar{position:sticky;top:0;z-index:var(--z-sticky);display:flex;align-items:center;gap:var(--s-3);padding:var(--s-2) var(--s-3);background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);box-shadow:var(--shadow-1);flex-wrap:wrap}.ask-toolbar__primary{display:flex;gap:var(--s-2)}.ask-toolbar__progress{flex:1;display:flex;align-items:center;gap:var(--s-2);font-size:var(--font-sm);color:var(--c-text-muted);min-width:140px}.ask-progress-text{font-variant-numeric:var(--font-numeric);white-space:nowrap}.ask-progress-bar{flex:1;height:4px;border-radius:2px;background:var(--c-bg-hover);overflow:hidden}.ask-progress-bar>i{display:block;height:100%;background:var(--c-primary);transition:width var(--dur-base) var(--ease-out)}.ask-toolbar__actions{display:flex;gap:var(--s-1)}.ask-toolbar__actions .aah-btn{display:inline-flex;align-items:center;gap:4px}.ask-nav{background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);padding:var(--s-2) var(--s-3)}.ask-nav summary{cursor:pointer;font-size:var(--font-sm);color:var(--c-text-secondary);font-weight:var(--fw-medium)}.ask-nav-legend{display:flex;gap:var(--s-3);flex-wrap:wrap;margin:var(--s-2) 0;font-size:var(--font-xs);color:var(--c-text-muted)}.legend-item{display:inline-flex;align-items:center;gap:4px}.legend-item i{width:8px;height:8px;border-radius:2px;display:inline-block}.legend-current i{background:var(--c-primary)}.legend-done i{background:var(--c-success)}.legend-error i{background:var(--c-danger)}.legend-unanswered i{background:var(--c-bg-hover);border:1px solid var(--c-border-base)}.ask-nav-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(32px,1fr));gap:var(--s-1)}.ask-nav-cell{height:28px;border-radius:var(--r-xs);background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);color:var(--c-text-muted);font-size:var(--font-xs);font-variant-numeric:var(--font-numeric);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out),border-color var(--dur-fast) var(--ease-out)}.ask-nav-cell:hover{border-color:var(--c-border-base)}.ask-nav-cell.is-done{background:var(--c-success-soft);color:var(--c-success);border-color:var(--c-success)}.ask-nav-cell.is-error{background:var(--c-danger-soft);color:var(--c-danger);border-color:var(--c-danger)}.ask-nav-cell.is-current{box-shadow:0 0 0 2px var(--c-primary-ring)}.ask-card{background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);box-shadow:var(--shadow-1)}.ask-card__header{display:flex;align-items:center;justify-content:space-between;padding:var(--s-2) var(--s-3);border-bottom:1px solid var(--c-border-subtle)}.ask-card__title{margin:0;font-size:var(--font-md);font-weight:var(--fw-semibold);color:var(--c-text-primary)}.ask-card__actions{display:flex;gap:var(--s-1)}.ask-card__body{padding:var(--s-3)}.ask-card__body .aah_title{font-size:var(--font-base);line-height:1.6;color:var(--c-text-primary);margin-bottom:var(--s-2)}.ask-card__body .aah_options{margin:var(--s-1) 0;padding:var(--s-2) var(--s-3);border:1px solid var(--c-border-subtle);border-radius:var(--r-sm);background:var(--c-bg-subtle);cursor:pointer;transition:background-color var(--dur-fast) var(--ease-out),border-color var(--dur-fast) var(--ease-out)}.ask-card__body .aah_options:hover{border-color:var(--c-border-base)}.ask-card__body .aah_options.active{background:var(--c-primary-soft);border-color:var(--c-primary);color:var(--c-primary)}.reading-passage{padding:var(--s-2) var(--s-3);background:var(--c-bg-subtle);border-radius:var(--r-sm);font-size:var(--font-sm);line-height:1.6;color:var(--c-text-secondary);margin-bottom:var(--s-3);white-space:pre-wrap}.reading-questions{display:flex;flex-direction:column;gap:var(--s-3);margin-top:var(--s-3)}.reading-sub-question{margin-top:var(--s-3)}.sub-question-title{font-size:var(--font-sm);font-weight:var(--fw-medium);color:var(--c-text-primary);margin-bottom:var(--s-1)}.ask-match-table{width:100%;border-collapse:separate;border-spacing:var(--s-1);margin-top:var(--s-2)}.ask-match-table td{padding:var(--s-2);background:var(--c-bg-subtle);border-radius:var(--r-sm);font-size:var(--font-sm)}.ask-form-note{margin:var(--s-2) 0 0;font-size:var(--font-sm)}.ask-form-note--success{color:var(--c-success)}.ask-form-note--danger{color:var(--c-danger)}.ask-loading{padding:var(--s-3);text-align:center;color:var(--c-text-muted);font-size:var(--font-sm)}.answer-block{padding:var(--s-2) var(--s-3);background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);border-radius:var(--r-sm);margin-bottom:var(--s-2)}.answer-block:last-child{margin-bottom:0}.answer-header{display:flex;align-items:center;justify-content:space-between;gap:var(--s-2);margin-bottom:var(--s-1)}.answer-meta{font-size:var(--font-xs);color:var(--c-text-muted);font-variant-numeric:var(--font-numeric)}.answer-field-html{font-size:var(--font-sm);color:var(--c-text-primary);line-height:1.6}.answer-field-html img{max-width:100%;height:auto;border-radius:var(--r-sm);margin:var(--s-1) 0}.answer-field-html table{width:100%;overflow-x:auto;display:block;border-collapse:collapse}.answer-field-html p{margin:var(--s-1) 0}.ai-preview-block{border-color:var(--c-warning);background:var(--c-warning-soft)}.ai-answer-block{background:var(--c-bg-subtle)}.ask-preview-actions{display:flex;gap:var(--s-1);margin-top:var(--s-2);flex-wrap:wrap}.ai-answer-divider{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--s-2)}.ai-answer-title{display:inline-flex;align-items:center;gap:var(--s-1);font-size:var(--font-sm);font-weight:var(--fw-semibold);color:var(--c-primary)}.ai-icon{font-size:16px}.ai-streaming-tag{display:inline-flex;align-items:center;gap:4px;font-size:var(--font-xs);color:var(--c-text-muted)}.ai-dot{width:4px;height:4px;border-radius:50%;background:var(--c-primary);display:inline-block;animation:ai-bounce 1s infinite}.ai-dot:nth-child(2){animation-delay:.15s}.ai-dot:nth-child(3){animation-delay:.3s}@keyframes ai-bounce{0%,80%,to{transform:translateY(0);opacity:.6}40%{transform:translateY(-3px);opacity:1}}.ai-stream-placeholder{font-size:var(--font-sm);color:var(--c-text-muted);padding:var(--s-2) 0}.ai-answer-markdown{font-size:var(--font-sm);color:var(--c-text-primary);line-height:1.6}.ask-empty{padding:var(--s-8) var(--s-3);text-align:center;color:var(--c-text-muted)}.ask-empty__icon{font-size:48px;width:48px;height:48px;margin:0 auto var(--s-2);display:block}.modal-title{margin:0;font-size:var(--font-md);font-weight:var(--fw-semibold);color:var(--c-text-primary)}.ask-settings{display:flex;flex-wrap:wrap;gap:var(--s-2);padding:var(--s-3);background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);align-items:center}.native-checkbox{display:inline-flex;align-items:center;gap:var(--s-1);font-size:var(--font-sm);color:var(--c-text-primary);cursor:pointer}.native-checkbox input{width:16px;height:16px;accent-color:var(--c-primary)}.range-row{display:flex;flex-direction:column;gap:var(--s-1);flex:1;min-width:200px;font-size:var(--font-sm);color:var(--c-text-secondary)}.range-row input[type=range]{width:100%;accent-color:var(--c-primary)}.ask-tags{display:flex;flex-wrap:wrap;gap:var(--s-1);margin-top:var(--s-2)}.ask-info{display:flex;flex-direction:column;gap:var(--s-2);font-size:var(--font-sm);color:var(--c-text-secondary);line-height:1.6}.ask-info .info-body{color:var(--c-text-primary)}.ask-types{margin-top:var(--s-2)}.ask-types summary{cursor:pointer;font-size:var(--font-sm);font-weight:var(--fw-semibold);color:var(--c-primary)}.ask-types summary:hover{color:var(--c-primary-hover)}@media (max-width: 480px){.ask-settings{flex-direction:column;align-items:flex-start}}", ".question-page{position:relative;padding:0}.question-page .watermark-bg{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;display:grid;place-items:center;gap:6px;font-size:18px;color:#0000000d;text-transform:uppercase;z-index:0}.question-page>*:not(.watermark-bg){position:relative;z-index:1}.qc-card{margin-bottom:var(--s-3);animation:fadeIn .3s ease-out}.info-banner{background:var(--c-bg-surface);border-radius:var(--r-md);border:1px solid var(--c-border-subtle);box-shadow:var(--shadow-1);padding:var(--s-3);margin-bottom:var(--s-3)}.info-title{font-size:15px;font-weight:700;color:var(--c-text-primary);margin-bottom:6px}.info-body{font-size:var(--font-base);color:var(--c-text-secondary);line-height:1.6}.warn-text{color:var(--c-danger);font-weight:600}.q-stats-row{display:flex;gap:var(--s-3);margin-bottom:var(--s-3)}.q-stat-card{flex:1;min-width:0;background:linear-gradient(135deg,var(--c-primary-soft),rgba(99,139,255,.08));border:1px solid var(--c-primary-ring);border-radius:var(--r-md);padding:var(--s-3);box-shadow:var(--shadow-1)}.q-stat-label{font-size:var(--font-sm);color:var(--c-text-secondary);margin-bottom:6px}.q-stat-value{font-size:26px;font-weight:800;color:var(--c-text-primary);letter-spacing:-.02em;font-variant-numeric:var(--font-numeric)}.upload-box{background:var(--c-bg-surface);border:1px dashed var(--c-border-strong);border-radius:var(--r-md);padding:var(--s-4);text-align:center;cursor:pointer;margin-bottom:var(--s-3);transition:all .2s ease}.upload-box:hover{border-color:var(--c-primary);box-shadow:var(--shadow-3)}.upload-input{display:none}.upload-text{display:flex;flex-direction:column;gap:6px;align-items:center;color:var(--c-text-secondary);font-size:var(--font-md)}.upload-icon{font-size:22px}.upload-desc em{color:var(--c-primary);font-style:normal;font-weight:700}.upload-hint{font-size:var(--font-sm);color:var(--c-text-muted)}.actions-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:var(--s-3)}.question-table{background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);overflow:hidden;box-shadow:var(--shadow-1)}.table-head,.table-row{display:grid;grid-template-columns:120px 1.3fr 1fr 1fr}.table-head{background:var(--c-bg-base);font-weight:700;color:var(--c-text-primary);border-bottom:1px solid var(--c-border-subtle)}.table-row:nth-child(2n){background:var(--c-bg-subtle)}.cell{padding:var(--s-2) var(--s-3);border-right:1px solid var(--c-border-subtle);font-size:var(--font-base);color:var(--c-text-primary);line-height:1.6;word-break:break-word}.table-head .cell{padding:var(--s-2) var(--s-3)}.cell:last-child{border-right:none}.table-empty{padding:var(--s-4);text-align:center;color:var(--c-text-muted);font-size:var(--font-base)}.table-empty-icon{font-size:40px;margin-bottom:8px;opacity:.5}.table-empty-text{margin:0 0 8px;color:var(--c-text-muted);font-size:var(--font-sm)}@media (max-width: 900px){.table-head,.table-row{grid-template-columns:100px 1fr}.cell-options,.cell-answer,.cell-question{grid-column:1 / -1}.cell-type{border-right:none;border-bottom:1px solid var(--c-border-subtle)}}.search-filter-row{display:flex;gap:var(--s-3);align-items:center;margin-bottom:var(--s-4);flex-wrap:wrap}.question-search-box{position:relative;flex:1;min-width:200px}.question-search-input{width:100%;padding:var(--s-2) 36px var(--s-2) var(--s-3);border:1px solid var(--c-border-base);border-radius:var(--r-sm);background:var(--c-bg-surface);font-size:var(--font-md);color:var(--c-text-primary);transition:all .2s ease}.question-search-input:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px var(--c-primary-ring)}.question-search-input::placeholder{color:var(--c-text-muted)}.search-clear{position:absolute;right:var(--s-3);top:50%;transform:translateY(-50%);background:none;border:none;font-size:18px;color:var(--c-text-muted);cursor:pointer;width:var(--s-5);height:var(--s-5);display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all .2s ease}.search-clear:hover{background:var(--c-bg-hover);color:var(--c-text-primary)}.filter-select{padding:var(--s-2) var(--s-3);border:1px solid var(--c-border-base);border-radius:var(--r-sm);background:var(--c-bg-surface);font-size:var(--font-md);color:var(--c-text-primary);min-width:120px;cursor:pointer}.filter-select:focus{outline:none;border-color:var(--c-primary);box-shadow:0 0 0 3px var(--c-primary-ring)}.data-stats{margin-bottom:var(--s-4);padding:var(--s-3) var(--s-4);background:var(--c-bg-subtle);border-radius:var(--r-sm);border:1px solid var(--c-border-subtle)}.stats-text{font-size:var(--font-base);color:var(--c-text-muted);font-variant-numeric:var(--font-numeric)}.question-table-wrapper{margin-bottom:var(--s-4)}.qc-cards{display:flex;flex-direction:column;gap:var(--s-3)}.qc-card{background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);box-shadow:var(--shadow-1);overflow:hidden;transition:all .2s ease}.qc-card:hover{box-shadow:var(--shadow-3);border-color:var(--c-border-base)}.question-pagination-wrapper{display:flex;align-items:center;justify-content:space-between;gap:var(--s-4);flex-wrap:wrap;margin-top:var(--s-4)}.question-pagination{display:flex;align-items:center;gap:var(--s-2)}.question-page-btn{display:inline-flex;align-items:center;padding:var(--s-2) var(--s-3);border:1px solid var(--c-border-base);border-radius:var(--r-sm);background:var(--c-bg-surface);color:var(--c-text-secondary);font-size:var(--font-md);cursor:pointer;transition:all .2s ease}.question-page-btn:hover:not(:disabled){background:var(--c-bg-hover);border-color:var(--c-border-strong)}.question-page-btn:disabled{opacity:.5;cursor:not-allowed}.page-numbers{display:flex;align-items:center;gap:var(--s-1)}.page-number{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--c-border-base);border-radius:var(--r-sm);background:var(--c-bg-surface);color:var(--c-text-secondary);font-size:var(--font-md);cursor:pointer;transition:all .2s ease;font-variant-numeric:var(--font-numeric)}.page-number:hover{background:var(--c-bg-hover);border-color:var(--c-border-strong)}.page-number.active{background:var(--c-primary);border-color:var(--c-primary);color:var(--c-bg-surface)}.page-ellipsis{padding:0 var(--s-2);color:var(--c-text-muted)}.page-size-selector{display:flex;align-items:center;gap:var(--s-2);font-size:var(--font-md);color:var(--c-text-secondary)}.page-size-selector select{padding:6px 10px;border:1px solid var(--c-border-base);border-radius:6px;background:var(--c-bg-surface);font-size:var(--font-base);cursor:pointer;color:var(--c-text-primary)}.qc-sub-question{margin-bottom:var(--s-3);padding:var(--s-3);background:var(--c-bg-subtle);border-radius:var(--r-sm);border:1px solid var(--c-border-subtle)}.qc-sub-question:last-child{margin-bottom:0}.qc-sub-question-title{font-size:var(--font-md);font-weight:600;color:var(--c-text-primary);margin-bottom:var(--s-3);line-height:1.5}.qc-sub-question-options{margin-bottom:var(--s-3)}.sub-option{padding:6px 0;font-size:var(--font-base);color:var(--c-text-secondary);line-height:1.5}.qc-sub-question-answer{padding:var(--s-2) var(--s-3);background:var(--c-success-soft);border-radius:6px;border-left:3px solid var(--c-success);font-size:var(--font-base);font-weight:600;color:var(--c-success)}.sub-answer-item{display:flex;align-items:flex-start;gap:var(--s-2);padding:6px 0;border-bottom:1px solid var(--c-success-soft)}.sub-answer-item:last-child{border-bottom:none}.sub-answer-num{display:inline-flex;align-items:center;justify-content:center;min-width:var(--s-6);height:var(--s-6);background:var(--c-success);color:var(--c-bg-surface);border-radius:50%;font-size:var(--font-sm);font-weight:700;flex-shrink:0;font-variant-numeric:var(--font-numeric)}.sub-answer-text{flex:1;font-size:var(--font-md);font-weight:600;color:var(--c-success);line-height:1.5;padding-top:2px}@media (max-width: 768px){.search-filter-row{flex-direction:column;align-items:stretch}.question-search-box{min-width:0}.question-pagination-wrapper{flex-direction:column;gap:var(--s-4)}.question-pagination{flex-wrap:wrap;justify-content:center}.qc-sub-question{padding:var(--s-3)}.qc-sub-question-title{font-size:var(--font-base)}.sub-option{font-size:var(--font-sm)}}.qc-cards>*{content-visibility:auto;contain-intrinsic-size:80px}.filter-chips{display:flex;flex-wrap:wrap;gap:var(--s-1);margin:var(--s-2) 0}.filter-chips .aah-tag{cursor:pointer;border:1px solid var(--c-border-subtle);-webkit-user-select:none;user-select:none;transition:background-color var(--dur-fast) var(--ease-out),border-color var(--dur-fast) var(--ease-out)}.filter-chips .aah-tag:hover{border-color:var(--c-border-base)}.qc-card{display:flex;flex-direction:column;gap:var(--s-1)}.qc-row-meta{display:flex;align-items:center;gap:var(--s-2)}.qc-row-meta .aah-tag{flex-shrink:0}.qc-num{font-size:var(--font-xs);color:var(--c-text-muted);font-variant-numeric:var(--font-numeric)}.qc-edit-btn{margin-left:auto;display:inline-flex;align-items:center;gap:4px}.qc-question{font-size:var(--font-base);color:var(--c-text-primary);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}.qc-question img{max-width:100%;height:auto}.qc-answer{display:flex;align-items:baseline;gap:var(--s-2);font-size:var(--font-sm);color:var(--c-success);line-height:1.5}.qc-answer-label{flex-shrink:0;font-size:var(--font-xs);color:var(--c-text-muted)}.qc-answer-value{flex:1;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}", ".question-tool{padding:0}.qt-actions{margin:var(--s-3) 0}.qt-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--s-4);align-items:start}.qt-editor,.qt-preview{background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);box-shadow:var(--shadow-1);padding:var(--s-3)}.qt-textarea{width:100%;min-height:480px;border:1px solid var(--c-border-base);border-radius:var(--r-sm);padding:var(--s-3);font-size:var(--font-md);line-height:1.6;resize:vertical;outline:none;background:var(--c-bg-surface);color:var(--c-text-primary)}.qt-textarea:focus{border-color:var(--c-primary);box-shadow:0 0 0 3px var(--c-primary-ring)}.qt-preview{max-height:640px;overflow:auto}.qt-empty{text-align:center;color:var(--c-text-muted);padding:var(--s-6) var(--s-3)}.qt-card{border:1px solid var(--c-border-subtle);border-radius:var(--r-sm);padding:var(--s-3);margin-bottom:var(--s-3);background:var(--c-bg-subtle)}.qt-card-error{border-color:var(--c-danger);background:var(--c-danger-soft)}.qt-card-head{display:flex;align-items:center;gap:10px;margin-bottom:var(--s-2)}.qt-title-no{font-weight:700;color:var(--c-text-primary)}.qt-tag{display:inline-flex;align-items:center;padding:var(--s-1) 10px;border-radius:var(--r-full);font-size:var(--font-sm);background:var(--c-bg-hover);color:var(--c-text-primary)}.qt-tag.danger{background:var(--c-danger-soft);color:var(--c-danger)}.qt-tag.success{background:var(--c-success-soft);color:var(--c-success)}.qt-question,.qt-answer{margin:6px 0;font-size:var(--font-md);color:var(--c-text-primary);line-height:1.6}.qt-options{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.qt-error{margin-top:var(--s-2);padding:10px;border-radius:var(--r-sm);background:var(--c-danger-soft);color:var(--c-danger);font-size:var(--font-base)}.label{color:var(--c-text-muted);margin-right:var(--s-1)}.qt-toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);margin:var(--s-3) 0}.qt-strategy{display:inline-flex;align-items:center;gap:var(--s-2);color:var(--c-text-secondary);font-size:var(--font-base)}.qt-strategy-label{color:var(--c-text-muted)}.qt-radio{display:inline-flex;align-items:center;gap:4px;cursor:pointer}.qt-stats{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:var(--s-3)}.qt-stat{display:inline-flex;align-items:center;border-radius:var(--r-full);padding:var(--s-1) 10px;background:var(--c-bg-hover);color:var(--c-text-primary);font-size:var(--font-sm);font-variant-numeric:tabular-nums}.qt-stat.success,.qt-tag.create{background:var(--c-success-soft);color:var(--c-success)}.qt-stat.danger,.qt-tag.error{background:var(--c-danger-soft);color:var(--c-danger)}.qt-stat.warning,.qt-tag.overwrite,.qt-tag.skip{background:var(--c-warning-soft);color:var(--c-warning)}.qt-stat.muted{color:var(--c-text-muted)}.qt-card-warning{border-color:var(--c-warning);background:var(--c-warning-soft)}.question-tool .aah-btn:disabled{cursor:not-allowed;opacity:.55}@media (max-width: 960px){.qt-grid{grid-template-columns:1fr}.qt-textarea{min-height:360px}}", ".preview-container{padding:0;background:var(--c-bg-base);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:var(--font-md);line-height:1.5}.toolbar{display:flex;justify-content:space-between;align-items:center;background:var(--c-bg-surface);padding:var(--s-2) var(--s-3);border-radius:var(--r-sm);box-shadow:var(--shadow-2);margin-bottom:var(--s-3);gap:var(--s-3)}.toolbar-left .page-title{margin:0;font-size:var(--font-lg);font-weight:600;color:var(--c-text-primary)}.toolbar-right{display:flex;align-items:center;gap:var(--s-3)}.preview-search-box{position:relative;display:flex;align-items:center}.preview-search-input{width:200px;padding:6px var(--s-3);border:1px solid var(--c-border-base);border-radius:var(--r-xs);font-size:var(--font-base);outline:none;background:var(--c-bg-surface);color:var(--c-text-primary)}.preview-search-input:focus{border-color:var(--c-primary)}.clear-btn{position:absolute;right:var(--s-1);width:var(--s-5);height:var(--s-5);border:none;background:var(--c-danger);color:var(--c-bg-surface);border-radius:50%;cursor:pointer;font-size:var(--font-sm);display:flex;align-items:center;justify-content:center}.page-size{padding:var(--s-1) var(--s-2);border:1px solid var(--c-border-base);border-radius:var(--r-xs);font-size:var(--font-sm);background:var(--c-bg-surface);color:var(--c-text-primary)}.search-info{background:var(--c-info-soft);color:var(--c-info);padding:var(--s-2) var(--s-3);border-radius:var(--r-xs);margin-bottom:var(--s-3);font-size:var(--font-base)}.preview-questions-container{background:var(--c-bg-surface);border-radius:var(--r-sm);box-shadow:var(--shadow-2);overflow:hidden}.loading{display:flex;align-items:center;justify-content:center;padding:var(--s-10);gap:var(--s-3);color:var(--c-text-muted)}.preview-spinner{width:var(--s-5);height:var(--s-5);border:2px solid var(--c-border-subtle);border-top:2px solid var(--c-primary);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.empty{text-align:center;padding:var(--s-10) var(--s-5);color:var(--c-text-muted)}.preview-empty-icon{font-size:48px;margin-bottom:var(--s-3)}.empty p{margin:0 0 var(--s-4) 0}.btn-clear{background:var(--c-primary);color:var(--c-bg-surface);border:none;padding:var(--s-2) var(--s-4);border-radius:var(--r-xs);cursor:pointer;font-size:var(--font-base)}.btn-clear:hover{background:var(--c-primary-hover)}.questions-list{display:flex;flex-direction:column}.question-item{border-bottom:1px solid var(--c-border-subtle);padding:var(--s-3)}.question-item:last-child{border-bottom:none}.question-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--s-3)}.question-info{display:flex;align-items:center;gap:var(--s-2)}.question-num{background:var(--c-primary);color:var(--c-bg-surface);padding:2px var(--s-2);border-radius:var(--r-md);font-size:var(--font-sm);font-weight:500;min-width:var(--s-6);text-align:center;font-variant-numeric:var(--font-numeric)}.question-type{background:var(--c-bg-subtle);color:var(--c-text-secondary);padding:2px var(--s-2);border-radius:var(--r-md);font-size:var(--font-xs);border:1px solid var(--c-border-subtle)}.question-actions{display:flex;gap:var(--s-1)}.btn-edit,.btn-delete{width:28px;height:28px;border:none;border-radius:var(--r-xs);cursor:pointer;font-size:var(--font-md);display:flex;align-items:center;justify-content:center}.btn-edit{background:var(--c-info-soft);color:var(--c-info)}.btn-edit:hover{background:var(--c-primary-soft)}.btn-delete{background:var(--c-danger-soft);color:var(--c-danger)}.btn-delete:hover{background:var(--c-danger-soft);filter:brightness(.95)}.preview-question-content{line-height:1.6}.preview-question-text{margin-bottom:var(--s-3);color:var(--c-text-primary)}.preview-question-text img{max-width:100%;height:auto;border-radius:var(--r-sm);margin:var(--s-2) 0;background:var(--c-bg-subtle)}.options{margin-bottom:var(--s-3)}.reading-type{background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);border-radius:6px;padding:var(--s-3)}.reading-title{font-weight:600;color:var(--c-text-secondary);margin-bottom:var(--s-2);font-size:var(--font-base)}.preview-sub-questions{display:flex;flex-direction:column;gap:var(--s-2)}.preview-sub-question{background:var(--c-bg-surface);padding:var(--s-2);border-radius:var(--r-xs);border:1px solid var(--c-border-subtle);font-size:var(--font-base)}.sub-num{color:var(--c-primary);font-weight:600;margin-right:var(--s-1);font-variant-numeric:var(--font-numeric)}.sub-type{color:var(--c-text-muted);font-size:var(--font-xs);margin-right:var(--s-2)}.sub-text{color:var(--c-text-secondary);margin-top:var(--s-1);display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.sub-text img{background:var(--c-bg-subtle);border-radius:var(--r-sm)}.more-subs{text-align:center;color:var(--c-text-muted);font-size:var(--font-sm);font-style:italic;padding:var(--s-1)}.complex-type{background:var(--c-warning-soft);color:var(--c-warning);padding:var(--s-2) var(--s-3);border-radius:var(--r-xs);font-size:var(--font-base);border:1px solid var(--c-warning-soft)}.normal-options{display:flex;flex-direction:column;gap:6px}.option{display:flex;align-items:flex-start;gap:var(--s-2);padding:6px var(--s-2);border-radius:var(--r-xs);background:var(--c-bg-subtle);position:relative}.option.correct{background:var(--c-success-soft);border:1px solid var(--c-success-soft)}.option-label{color:var(--c-text-secondary);font-weight:500;min-width:var(--s-5)}.option-text{flex:1;color:var(--c-text-primary)}.option-text img{background:var(--c-bg-subtle);border-radius:var(--r-sm)}.correct-mark{color:var(--c-success);font-weight:700;font-size:var(--font-lg)}.answer{background:var(--c-success-soft);border:1px solid var(--c-success-soft);border-radius:var(--r-xs);padding:var(--s-2) var(--s-3);margin-top:var(--s-2)}.preview-answer-label{color:var(--c-success);font-weight:600;margin-right:var(--s-2)}.preview-answer-list{display:inline-flex;flex-wrap:wrap;gap:var(--s-1)}.preview-answer-item{background:var(--c-success);color:var(--c-bg-surface);padding:2px var(--s-2);border-radius:var(--r-md);font-size:var(--font-sm)}.preview-answer-text{color:var(--c-success);display:inline}.preview-answer-text img{background:var(--c-bg-subtle);border-radius:var(--r-sm)}.no-answer{color:var(--c-text-muted);font-style:italic}.preview-pagination{display:flex;justify-content:center;align-items:center;gap:var(--s-3);padding:var(--s-3);background:var(--c-bg-surface);border-top:1px solid var(--c-border-subtle);margin-top:var(--s-3);border-radius:var(--r-sm);box-shadow:var(--shadow-2);font-variant-numeric:var(--font-numeric)}.preview-page-btn{background:var(--c-bg-subtle);border:1px solid var(--c-border-subtle);color:var(--c-text-secondary);padding:6px var(--s-3);border-radius:var(--r-xs);cursor:pointer;font-size:var(--font-base)}.preview-page-btn:hover:not(:disabled){background:var(--c-bg-hover)}.preview-page-btn:disabled{opacity:.5;cursor:not-allowed}.page-info{display:flex;align-items:center;gap:var(--s-1);color:var(--c-text-secondary);font-size:var(--font-base);font-variant-numeric:var(--font-numeric)}.page-input{width:var(--s-10);text-align:center;border:1px solid var(--c-border-subtle);border-radius:var(--r-xs);padding:2px var(--s-1);font-size:var(--font-base);background:var(--c-bg-surface);color:var(--c-text-primary);font-variant-numeric:var(--font-numeric)}.total-info{color:var(--c-text-muted);font-size:var(--font-sm);font-variant-numeric:var(--font-numeric)}.highlight{background:var(--c-warning-soft);color:var(--c-warning);padding:1px 2px;border-radius:2px}@media (max-width: 600px){.toolbar{flex-direction:column;align-items:stretch;gap:var(--s-3)}.toolbar-right{justify-content:space-between}.preview-search-input{width:150px}.question-header{flex-direction:column;align-items:flex-start;gap:var(--s-2)}.preview-pagination{flex-wrap:wrap;gap:var(--s-2)}}", ".log-page{display:flex;flex-direction:column;gap:var(--s-3);padding:var(--s-4)}.log-header,.log-toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--s-3);flex-wrap:wrap}.log-header h2{margin:0;color:var(--c-text-primary);font-size:var(--font-xl)}.log-header p{margin:4px 0 0;color:var(--c-text-muted);font-size:var(--font-xs)}.log-actions,.log-filter{display:flex;align-items:center;gap:var(--s-2);flex-wrap:wrap}.log-list{display:flex;flex-direction:column;gap:var(--s-2);max-height:420px;margin:0;padding:0;list-style:none;overflow:auto}.log-row{display:grid;grid-template-columns:88px auto minmax(0,1fr);align-items:start;gap:var(--s-2);padding:var(--s-2) var(--s-3);border:1px solid var(--c-border-subtle);border-left-width:4px;border-radius:var(--r-sm);background:var(--c-bg-surface)}.log-row-success{border-left-color:var(--c-success)}.log-row-warning{border-left-color:var(--c-warning)}.log-row-error{border-left-color:var(--c-danger)}.log-time{color:var(--c-text-muted);font-size:var(--font-xs);font-variant-numeric:tabular-nums}.log-msg{min-width:0;color:var(--c-text-primary);line-height:1.5;overflow-wrap:anywhere}.log-empty{min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--s-2);border:1px solid var(--c-border-subtle);border-radius:var(--r-md);background:var(--c-bg-surface);color:var(--c-text-muted)}.log-empty-icon{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--r-full);background:var(--c-primary-soft);color:var(--c-primary);font-weight:var(--fw-semibold)}", ".paper-library-container{padding:0;display:flex;flex-direction:column;gap:var(--s-3)}.search-card{display:flex;flex-direction:column;gap:10px}.search-header{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.input-wrap{flex:1;display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--c-bg-base);border-radius:10px;border:1px solid transparent;transition:border-color .2s ease,box-shadow .2s ease}.input-wrap:focus-within{border-color:var(--c-primary-ring);box-shadow:var(--shadow-1)}.input-prefix{font-size:16px}.input-field{flex:1;border:none;background:transparent;font-size:14px;outline:none;color:var(--c-text-primary)}.search-stats{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.param-table-card{background:var(--c-bg-surface);border:1px solid var(--c-border-subtle);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:8px}.param-table-header,.param-table-row{display:grid;grid-template-columns:180px 1fr 90px;gap:10px;align-items:center}.param-table-header{font-weight:600;color:var(--c-text-secondary);font-size:13px}.param-table-row{padding:6px 0;border-bottom:1px solid var(--c-border-subtle)}.param-table-row:last-child{border-bottom:none}.param-value-group{display:flex;gap:8px;flex-wrap:wrap}.param-type{width:120px}.param-value{flex:1;min-width:160px}.param-code-wrapper{flex:1;min-width:200px;display:flex;flex-direction:column;gap:6px}.param-code{width:100%;min-height:80px}.param-error{color:var(--c-danger);font-size:12px}.papers-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:var(--s-3);margin-bottom:8px}.papers-grid .pl-loading{grid-column:1 / -1;padding:24px 0;text-align:center;color:var(--c-text-muted)}.pl-loading{text-align:center;padding:var(--s-4) var(--s-2);color:var(--c-text-muted)}.pl-empty{grid-column:1 / -1;text-align:center;padding:var(--s-8) var(--s-4);background:var(--c-bg-surface);border-radius:var(--r-lg);border:1px dashed var(--c-border-base)}.pl-empty-icon{font-size:40px;margin-bottom:var(--s-2);opacity:.5}.pl-empty-text{margin:0;color:var(--c-text-muted);font-size:var(--font-base)}.pl-info-card{display:flex;gap:var(--s-3);align-items:flex-start}.pl-info-icon{font-size:18px;opacity:.7;flex-shrink:0}.pl-info-text{font-size:var(--font-base);color:var(--c-text-secondary);line-height:1.6}.pl-info-highlight{color:var(--c-warning);margin-left:4px;font-weight:600}.paper-card{cursor:pointer;transition:all .2s cubic-bezier(.25,.1,.25,1);height:100%;display:flex;flex-direction:column}.paper-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-3);border-color:var(--c-border-base)}.paper-header{display:flex;align-items:flex-start;gap:var(--s-3);margin-bottom:var(--s-3)}.paper-icon{flex-shrink:0;width:44px;height:44px;display:grid;place-items:center;background:var(--c-primary-soft);border-radius:10px;font-size:20px}.paper-info{flex:1;min-width:0}.paper-title{margin:0 0 8px;font-size:16px;font-weight:600;color:var(--c-text-primary);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:1.4}.paper-meta{display:flex;gap:6px;flex-wrap:wrap}.paper-footer{display:flex;justify-content:space-between;align-items:center;margin-top:auto;padding-top:var(--s-3);border-top:1px solid var(--c-border-subtle)}.paper-actions{display:flex;align-items:center;gap:8px}.chevron{color:var(--c-text-muted);font-size:18px;transition:transform .2s ease,color .2s ease}.paper-card:hover .chevron{transform:translate(2px);color:var(--c-primary)}.header-card{display:flex;flex-direction:column;gap:var(--s-3)}.pl-header-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:space-between;align-items:center;padding-bottom:10px;border-bottom:1px solid var(--c-border-subtle)}.header-action-group{display:flex;gap:8px;flex-wrap:wrap}.course-info h2,.chapter-info-header h2{margin:0;font-size:22px;font-weight:700;color:var(--c-text-primary);letter-spacing:-.02em}.course-stats,.chapter-info-header{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px}.chapters-list{display:flex;flex-direction:column;gap:var(--s-3)}.chapter-card{cursor:pointer;transition:all .3s cubic-bezier(.25,.1,.25,1)}.chapter-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-3);border-color:var(--c-border-base)}.chapter-header{display:flex;align-items:center;gap:14px}.chapter-number{width:36px;height:36px;border-radius:10px;background:var(--c-primary);color:#fff;display:grid;place-items:center;font-size:15px;font-weight:700;flex-shrink:0;box-shadow:var(--shadow-2)}.chapter-info{flex:1;min-width:0}.chapter-title{margin:0;font-size:17px;font-weight:600;color:var(--c-text-primary);line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.chapter-meta{margin-top:6px}.chapter-actions{display:flex;align-items:center;gap:10px;margin-left:auto;flex-shrink:0}.pl-questions-container{display:flex;flex-direction:column;gap:var(--s-3)}.pl-question-card{transition:all .2s cubic-bezier(.25,.1,.25,1)}.pl-question-card:hover{transform:translateY(-1px);box-shadow:var(--shadow-3);border-color:var(--c-border-base)}.question-number{display:inline-block;padding:4px 12px;background:var(--c-primary);color:#fff;border-radius:6px;font-size:12px;font-weight:700;margin-bottom:12px;box-shadow:var(--shadow-1)}.question-title{font-size:15px;line-height:1.6;color:var(--c-text-primary);margin-bottom:var(--s-3);word-break:break-word;padding:var(--s-3);background:var(--c-bg-base);border-radius:10px}.question-title img{max-width:100%;height:auto;border-radius:8px;margin:12px 0}.question-options{margin-bottom:16px}.option-item{display:flex;align-items:flex-start;padding:var(--s-2) var(--s-3);margin-bottom:8px;background:var(--c-bg-base);border-radius:10px;transition:all .2s ease;border:1px solid transparent}.option-item:last-child{margin-bottom:0}.option-item:hover{background:var(--c-bg-hover);transform:translate(2px);border-color:var(--c-primary-ring)}.option-item.is-answer{background:var(--c-success-soft);border:1px solid rgba(16,185,129,.35);color:var(--c-text-primary);font-weight:500}.option-item .option-label{flex-shrink:0;font-weight:700;margin-right:10px;min-width:24px;color:var(--c-text-muted)}.option-item.is-answer .option-label{color:var(--c-success)}.option-content{flex:1;line-height:1.6;word-break:break-word}.option-content img{max-width:100%;height:auto;border-radius:6px;margin:8px 0}.question-answer{margin-top:14px;padding-top:12px;border-top:1px solid var(--c-border-subtle)}.answer-divider{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:8px;background:var(--c-success-soft);color:var(--c-success);font-weight:700;font-size:13px}.answer-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.pl-answer-content{padding:12px;background:var(--c-success-soft);border-radius:10px;color:var(--c-text-primary);line-height:1.6;word-break:break-word;border:1px solid rgba(16,185,129,.2);margin-top:10px}.pl-answer-content img{max-width:100%;height:auto;border-radius:6px;margin:8px 0}@media (max-width: 768px){.pl-header-actions{flex-direction:column;align-items:flex-start}.papers-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}.paper-footer{flex-direction:column;align-items:flex-start;gap:10px}.chapter-header{align-items:flex-start}}" ].join("\n"), Ad = "__aiAskHookedXHRSend", installXHRHook = (e, t) => { const a = Object.getOwnPropertyDescriptor(e.prototype, "send"), n = (null == a ? void 0 : a.value) ?? e.prototype.send; if ("function" == typeof (r = n) && !0 === r[Ad]) return !1; var r; if ("function" != typeof n) return !1; if (!1 === (null == a ? void 0 : a.configurable) && !1 === a.writable) return !1; const s = n, hookedSend = function(e) { return this.addEventListener("readystatechange", (function() { t.call(this, this); })), s.call(this, e); }; return Object.defineProperty(hookedSend, Ad, { value: !0 }), Object.defineProperty(e.prototype, "send", { configurable: !1, writable: !1, value: hookedSend }), !0; }, get_href = () => location.href, hookXHR = () => { installXHRHook(XMLHttpRequest, (function() { switch (!0) { case /onlineexamh5new.zhihuishu.com/i.test(get_href()): break; case /icve.com.cn/i.test(location.host): 4 === this.readyState && this.responseURL && (this.responseURL.includes("examRecordPaperList") || this.responseURL.includes("queryXsDtjgSjInfo")) && JSON.parse(this.response); break; case /qingshuxuetang.com/i.test(get_href()): if (4 === this.readyState && (this.responseURL.includes("Student/DetailData") || this.responseURL.includes("Student/SimulationExercise/DetailData") || this.responseURL.includes("Student/Quiz/DetailData"))) { const e = JSON.parse(this.response); ce.qsques = e.data.paperDetail.questions, e.data.paperDetail.questions; } break; case /cce.org.uooconline.com/i.test(get_href()): if (4 === this.readyState && this.responseURL.includes("/exam/view?cid=")) { const e = JSON.parse(this.response); ce.cceques = e.data.questions, e.data.questions; } break; case /cj-edu.com/i.test(get_href()): if (4 === this.readyState && this.responseURL.includes("api/student/getHomeworkStudentInfo.do")) { const e = JSON.parse(this.response); ce.cjques = e.data, e.data; } break; case /gxk.yxlearning.com/i.test(get_href()): if (4 === this.readyState && this.responseURL.includes("cms/paper/start-do-paper-or-test.gson")) { const e = JSON.parse(this.response); ce.yxques = e.attribute.data, e.data; } } })); }; (e => { if ("function" != typeof e) return; const t = e, a = getRuntime(); "function" != typeof a.GM_xmlhttpRequest && (a.GM_xmlhttpRequest = t), a.GM || (a.GM = {}), "function" != typeof a.GM.xmlHttpRequest && (a.GM.xmlHttpRequest = t); })(le); const loadVue = () => { var e; const r = function() { const e = vue.effectScope(!0), r = e.run((() => vue.ref({}))); let s = [], i = []; const o = vue.markRaw({ install(e) { setActivePinia(o), o._a = e, e.provide(J, o), e.config.globalProperties.$pinia = o, i.forEach((e => s.push(e))), i = []; }, use(e) { return this._a ? s.push(e) : i.push(e), this; }, _p: s, _a: null, _e: e, _s: new Map, state: r }); return o; }(), s = vue.createApp(qd); s.use(r); const i = document.createElement("div"), o = document.createElement("div"); o.id = "AiAskApp", ((e, t) => { var a, n; if (!t || e.self === e.top) return !1; try { return (null == (n = null == (a = e.top) ? void 0 : a.location) ? void 0 : n.origin) === e.location.origin; } catch { return !1; } })(window, Gt.iframe) ? (o.id = "AiAskAppTop", null == (e = window.top) || e.document.body.appendChild(i)) : document.body.append(i); const l = i.attachShadow({ mode: "closed" }); l.appendChild(o); try { const e = document.createElement("style"); e.textContent = _d, l.appendChild(e); } catch (c) { console.error("\u5e94\u7528\u6837\u5f0f\u8868\u65f6\u51fa\u9519:", c); } s.mount(o); }, run = async () => { var e; (e = document.createElement("iframe")).style.display = "none", document.body.appendChild(e), window.console = e.contentWindow.console; (ce === ce.top || [ /\/work\/doHomeWorkNew/i, /selectWorkQuestionYiPiYue/i, /page\/quiz\/stu\/answerQuestion2/i, /page\/active\/stuActiveList/i, /uooconline.com/i, /edu-edu.com/i, /hblearning\/exam\/portal\/exam.jsp/i ].some((e => e.test(location.href))) || Lt.some((e => "hook" !== e.type && isRuleMatched(e)))) && (loadVue(), parseRule(Lt)); }; (() => { if (hookXHR(), /onlineexamh5new.zhihuishu.com/i.test(get_href())) { const e = ce.yxyz; ce.yxyz = function(t, a) { !ce.yxyzpush && (ce.yxyzpush = []); let n = e(t, a); return ce.yxyzpush.push({ ...t, data: n }), n; }; } if (/icve.com.cn/i.test(get_href()) || /courshare.cn/i.test(get_href()) || /webtrn.cn/i.test(get_href())) { const e = ce.open; ce.open = function() { return arguments[2] = "", e.apply(this, arguments); }; } if (/ytccr.com/i.test(get_href())) { const e = localStorage.getItem; localStorage.getItem = function(t) { if ("_debugger" === t) return !0; return e.apply(this, arguments); }; } if (/91huayi.com/i.test(get_href())) { const e = ce.$.cookie; ce.$.cookie = function(t, a, n) { return console.log("Cookie\u64cd\u4f5c:", t, a, n), t.startsWith("switchTime") && void 0 !== a ? (a = void 0, e.apply(this, [ t, a, n ])) : e.apply(this, arguments); }; } })(), Lt.filter((e => isRuleMatched(e) && e.hook)).forEach((e => { e.hook(); })), "complete" === document.readyState ? run() : window.addEventListener("load", run); })(Vue, Icon, DOMPurify, $, CryptoJS);