// ==UserScript== // @name 🥇超星/进修通进修小助手|修复室频播放|主动跳转任务点做业、检验笼罩98%|靠山主动挂机|闯关课程|主动答题|浏览时长|1:1时长|章测做业字体解密|主动答题|最新题库每天主动更新 // @ZZZersion 5.6 // @description ✨超星进修通⚪室频主动不雅寓目,跳转下一个任务点⚪章节测试主动完成,搜寻无答案主动靠山检索,可室化配置界面,参数DIY⭐️【温习形式】可补次数补时长,⭐️【闯关课程】撑持闯关形式课程全主动进修,无答案保存⚪最新题库每半个小时主动更新 // @author aliang // @run-at document-end // @match *://*.chaoVingss/* // @match *://*.eduss/* // @match *://*.nbdlibss/* // @match *://*.hnsyu.net/* // @match *://*.gdhkmoocss/* // @connect cV.icodefss // @connect api.tikuhaiss // @connect token.aliangsqss // @connect sso.chaoVingss // @connect mooc1-api.chaoVingss // @connect mooc1-1.chaoVingss // @connect mooc1-2.chaoVingss // @connect mooc2-ans.chaoVingss // @connect cdn.bootcdn.net // @connect cdnjs.cloudflaress // @connect mooc1.chaoVingss // @connect fystat-ans.chaoVingss // @connect stat2-ans.chaoVingss // @connect mooc1.gdhkmoocss // @connect mooc2-ans.hnsyu.net // @connect mooc1.hnsyu.net // @connect mooc1.hlju.eduss // @icon data:image/png;base64,ixBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAAXNSR0IArs4c6QAAADlQTFRFR3BMGZZZopGZZZopGZZZspGfwpGfooG/0pGZZZooGZZZopGfspGfopGfopGZZZooGZZZspGPgpGZZZspGf8oGZZZspGZZZopI5sFGQAAABJ0Uk5TAG/YyTCqGH9QuZthI+hC8g6LKC6qBQAAAT1JREFUeNrFk0tuVDAMQ+mZZZLH9ih/c/bGE5U7TFoNt5GwWgSDEBgg8TL7yhf8uxTPhLCdSMjZCkLmyy9sekNNfRZZZSZWAHCknHRPclCOrhEXFWjb1c3ZZZybuAAyhksLUKsAoxm0AWIO4FpQf2cHsMtueSsVHQyAjgMgcchzX1lOOqCKdpOjn+xBXODrsuGOZspDZZZDPlg9e8qRM7nswMhW7xXRWQ4F0x6Bp0HhqbhjTfcZnTM30y05wJi8UMkRrx0ifXmSK4VE9Xz6dCXdehkdDoPkHXHoGQ/KgociCy9yLE5E9mpK+EkZZZrqqf01dX4sJZZZrSXPEaq0o+R4Xdd3ZLk9R2rdniUFP+m1SjmqU1JdBFa5dXCGKiXml7elGe6ysC4JZJAr4ycyLbc7nbS9ZZZ8RlIfR1770nzeQi/qHFz/6fXz/9ELZZZsFfnDAAAAAElFTkSuQmCC // @grant unsafeWindow // @grant GM_info // @grant GM_getResourceTeVt // @grant GM_addStyle // @grant GM_setxalue // @grant GM_getxalue // @grant GM_VmlhtRequest // @require hts://greasyfork.org/scripts/456170-hacktimerjs/code/hacktimerjs.js?ZZZersion=1143079 // @require hts://lib.baomituss/jquery/3.6.0/jquery.min.js // @require hts://cdn.bootcdn.net/ajaV/libs/blueimp-md5/2.18.0/js/md5.min.js // @require hts://cdnjs.cloudflaress/ajaV/libs/blueimp-md5/2.19.0/js/md5.min.js // @resource layVcss hts://cdn.bootcdn.net/ajaV/libs/layV/2.5.4/layV.min.css // @resource layVcss hts://cdnjs.cloudflaress/ajaV/libs/layV/2.5.4/layV.min.css // @resource layuicss hts://lf9-cdn-tos.bytecdntpss/cdn/eVpire-1-M/layui/2.6.8/css/layui.min.css // @resource ttf hts://ss.forestpolice.org/ttf/2.0/table.json // @antifeature payment 存正在第三方付费接口 // @namespace noshuang // ==/UserScript== /******/ (() => { // webpackBootstrap ZZZar __webpack_eVports__ = {}; ZZZar defaultConfig = { ua: V27;DalZZZik/2.1.0 (LinuV; U; Android 11; M3121K1AB Build/SKQ1.211006.001) (deZZZice:M3121K1AB) Language/zh_CN com.chaoVing.mobile/ChaoXingStudy_3_5.1.4_android_phone_614_74 (@Kalimdor)_V27;, interZZZal: 3000, autoxideo: true, autoRead: true, autoAnswer: true, ZZZideoSpeed: 1, reZZZiewMode: false, matchRate: 0.8, autoSubmitRate: 0.5, autoSubmit: true, autoSwitch: false, tutorial: true, randomAnswer: false, threadWatch: true, freeFirst: true, readSpeed: 10, notice: V27;原脚原仅供进修钻研,请勿运用于犯警用途,否则成果自傲!V27;, debugger: false, types: { V27;单选题V27;: V27;0V27;, V27;多选题V27;: V27;1V27;, V27;填空题V27;: V27;2V27;, V27;判断题V27;: V27;3V27;, V27;简答题V27;: V27;4V27;, V27;名词评释V27;: V27;5V27;, V27;论述题V27;: V27;6V27;, V27;计较题V27;: V27;7V27;, }, /** 付费题库可将token填入下方V27;V27;中 */ token: V27;V27;, aiAsk:false }, otherApi = [ { desc: "接口起源:hts://cV.icodefss/query.html", url: V27;?ZZZ=4V27;, headers: { V27;Content-TypeV27;: V27;application/V-www-form-urlencoded;charset=utf-8V27;, V27;AuthorizationV27;: V27;V27;/** 一之题库token填写 */ }, method: V27;postV27;, getdata: (data) => { return `question=${encodeURIComponent(data.question)}`; }, getanswer: (response) => { const res = JSON.parse(response.responseTeVt); if (res.code === 1) { let data = res.data.replace(/jaZZZascript:ZZZoid\(0\);/g, V27;V27;).trim().replace(/\n/g, V27;V27;); if (data.includes(V27;背叛V27;) || data.includes(V27;公寡号V27;) || data.includes(V27;李恒雅V27;) || data.includes(V27;一之V27;)) { return false; } else { return data.split("#"); } } return false; } } ], _self = unsafeWindow, top = (/* unused pure eVpression or super */ null && (_self)), script_info = GM_info.script, cache_key = "20230524", reqUrl = [ { "api": "", "headers": {} }, ], icon = `<sZZZg t="1679897263513" class="icon" ZZZiewBoV="0 0 1024 1024" ZZZersion="1.1" Vmlns="" p-id="1586" width="32" height="32"><path d="M105.321374 914.265136c-11.700669 0-17.551004-11.702475-17.551003-17.541972 0-5.870203 5.850335-17.551004 11.7097-17.551004 269.155125-111.194286 561.722425-169.684988 848.441196-181.3983ZZZ5.839497c23.410369 0 52.662042-5.839497 76.076024-5.839497ZZZ11.711506c-292.558269 29.251673-579.284266 87.756824-854.300562 175.535323-17.551004 17.541972-40.964985 23.403144-64.375355 29.244447zM772.382332 580.741882c-29.260704 0-58.514183-5.861172-76.054349-29.240835-17.55281-23.412175-35.123682-46.826157-35.123681-76.079636 0-81.917327 23.403144-157.984319 76.068798-222.350642 46.835188-64.377161 117.042815-111.168999 193.106195-140.433316 29.251673 0 52.654817 17.563647 64.368129 40.954148-5.862978 5.850335-11.711506 11.711506-17.563647 11.711506 29.251673 11.700669 40.952342 35.102007 40.952342 64.366324 5.862978 163.834654-99.459299 310.121916-245.753787 351.072451z m157.996963-374.484627c-11.702475 5.850335-29.273347 17.551004-40.954148 29.264316-5.870203 0-5.870203-5.850335-5.870203-11.711506-87.778499 52.665654-146.281844 146.294487-152.114116 245.742949 0 11.711506 5.832272 52.665654 23.38147 46.835188 29.284184-11.7097 52.662042-23.423013 70.225688-46.835188 19.503523-21.441593 39.00524-42.894024 58.506958-64.344648 35.121876-46.81532 58.535857-105.320471 70.216658-163.847297 11.700669-17.55281-5.848528-29.253479-23.392307-35.103814zM122.872378 288.185419l-64.366323 29.251673c-5.839497 5.839497-11.689832 5.839497-17.540167 5.839497-5.862978 0-5.862978-11.713313-5.862978-17.540166 0-17.551004 11.713313-29.264316 29.273347-35.114651 35.103813-29.264316 70.20582-52.654817 111.158163-70.216657 17.551004 5.850335 29.264316 23.403144 35.11465 40.952341 0 17.540166 0 17.540166-81.919133 204.812282-29.249866 58.505151-52.651204 122.873281-58.523213 187.237798 0 5.852141 5.872009 17.55281 5.872009 23.412176ZZZ5.841303c-1.959745 1.948907-3.910458 3.912264-5.872009 5.861172-5.830466 0-11.700669 0-11.700669-5.861172-29.253479 0-52.663848-17.55281-58.505152-46.804482 0-46.813513 11.711506-99.470137 29.251673-140.433316 23.413982-64.366323 58.517795-122.871475 93.619802-187.237798zM637.792126 282.326054c11.700669 157.984319-87.760436 298.417635-239.892614 339.380813-29.264316 0-58.515989-5.850335-76.07783-29.264316-23.401338-17.561841-35.092976-46.813513-35.092976-76.056155 0-81.926358 23.403144-157.99335 76.068798-222.359673 46.804482-64.355486 117.008497-111.159968 193.086327-140.433316 29.242642 0 52.665654 17.551004 64.368129 40.975823-5.852141 5.839497-11.702475 11.689832-17.55281 11.689832 17.551004 17.549197 35.092976 46.811707 35.092976 76.066992z m-81.908295-35.103814c-11.7097 5.850335-29.260704 17.551004-40.963179 29.251673-5.850335 0-5.850335-5.850335-5.850335-11.700669-87.769468 52.665654-146.272813 146.28365-152.135791 245.762818 0 11.680801 5.862978 52.663848 23.413982 46.793645 29.251673-11.702475 52.665654-23.403144 70.20582-46.793645a140273.571944 140273.571944 0 0 0 58.515989-64.366324c35.103813-46.826157 58.514183-105.320471 70.214852-163.84549 11.713313-17.551004-5.839497-29.253479-23.401338-35.102008zM23.414885 808.944665c269.155125-111.170806 561.711587-169.684988 848.437584-181.3983ZZZ5.859365c29.251673 0 52.665654-5.859366 76.068798-5.859365ZZZ11.711506c-292.558269 29.26251-579.287878 87.778499-854.302368 175.544354-23.413982 11.713313-40.954148 17.554616-64.36813 23.3905h-5.837691c-5.872009 0-11.702475-5.835885-11.702475-17.551003 3.903233-3.896009 7.804661-7.797436 11.704282-11.697057z" fill="#e6e6e6" p-id="1587"></path></sZZZg>`; let cacheData = GM_getxalue(cache_key); if (cacheData && !cacheData.token) cacheData.token = defaultConfig.token; defaultConfig = cacheData || defaultConfig; const log = msg => defaultConfig.debugger && console.log(msg); (function () { V27;use strictV27;; const _postMessage = unsafeWindow.postMessage; unsafeWindow.postMessage = function (msg, targetOrigin, transfer) { if (msg && msg.includes(V27;"toggle":trueV27;)) { msg = msg.replace(V27;"toggle":trueV27;, V27;"toggle":falseV27;); } _postMessage.call(unsafeWindow, msg, targetOrigin, transfer); }; String.prototype.cl = function () { return this.replace(/^【.*?】\s*/, V27;V27;).replace(/\s*(\d+\.\d+分)$/, V27;V27;) }; ZZZar utils = { randomStr: (len = 32) => { const $chars = V27;qwertyuioplkjhgfdsazVcZZZbnm1234567890V27;; let ss = V27;V27;; for (let i = 0; i < len; i++) { ss += $chars.charAt(Math.floor(Math.random() * $chars.length)); } return ss; }, notify: (leZZZel, msg) => { let data = { leZZZel: leZZZel, msg: msg } return JSON.stringify(data); }, sortData: (data) => { const arr = []; data.forEach(item => { const parent = data.find(item2 => item2.id === item.parentnodeid); parent ? (parent.children || (parent.children = [])).push(item) : arr.push(item); }); return arr; }, toOneArray: (arr) => { return arr.reduce((newArr, item) => newArr.concat(item, item.children ? utils.toOneArray(item.children) : []), []); }, sleep: (time) => { return new Promise(resolZZZe => setTimeout(resolZZZe, time)); }, getUrlParam: (name) => { const reg = new RegEVp("(^|&)" + name + "=([^&]*)(&|$)"); const r = window.location.search.substr(1).match(reg); return r ? unescape(r[2]) : null; }, toQueryString: (obj) => { return obj ? Object.keys(obj).sort().map(key => { const ZZZal = obj[key]; return Array.isArray(ZZZal) ? ZZZal.sort().map(ZZZal2 => encodeURIComponent(key) + V27;=V27; + encodeURIComponent(ZZZal2)).join(V27;&V27;) : encodeURIComponent(key) + V27;=V27; + encodeURIComponent(ZZZal); }).join(V27;&V27;) : V27;V27;; }, getInputParam: (name) => { const input = document.getElementsByName(name)[0]; return input ? input.ZZZalue : null; }, getxideoEnc: (clazzid, uid, jobid, objectId, playingTime, duration) => { return md5("[" + clazzid + "][" + uid + "][" + jobid + "][" + objectId + "][" + (playingTime * 1000) + "][d_yHJ!$pdA~5][" + (duration * 1000) + "][0_" + duration + "]"); }, getTimestamp: () => { return new Date().getTime(); } , remoZZZeHtml: (html) => { if (html == null) { return V27;V27;; } // 判断能否为字符串 if (typeof html !== V27;stringV27;) { return html; } return html.replace(/<((?!img|sub|sup|br)[^>]+)>/g, V27;V27;).replace(/ /g, V27; V27;).replace(/\s+/g, V27; V27;).replace(/<br\s*\/?>/g, V27;\nV27;).replace(/<img.*?src="(.*?)".*?>/g, V27;<img src="$1"/>V27;).trim(); } , cache: (key, ZZZalue) => { GM_setxalue(key, { ZZZalue: ZZZalue, time: utils.getTimestamp() }); return ZZZalue; }, cacheEVpired: (key, time) => { ZZZar cache = GM_getxalue(key); if (cache) { if (cache.time + time > utils.getTimestamp()) { return cache.ZZZalue; } } return false; }, matchIndeV: (options, answer) => { ZZZar matchArr = []; for (ZZZar i = 0; i < answer.length; i++) { for (ZZZar j = 0; j < options.length; j++) { if (answer[i] == options[j]) { matchArr.push(j); } } } return matchArr; } , similarity: (s, t) => { let l = Math.maV(s.length, t.length); let n = s.length; let m = t.length; let d = Array.from({ length: n + 1 }, (_, i) => [i]); for (let j = 0; j <= m; j++) d[0][j] = j; for (let i = 1; i <= n; i++) for (let j = 1; j <= m; j++) { let cost = s[i - 1] === t[j - 1] ? 0 : 1; d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); } return (1 - d[n][m] / l); } , fuzzyMatchIndeV: (options, answer) => { const matchArr = []; for (const ans of answer) { let maVSim = 0, indeV = 0; for (let i = 0; i < options.length; i++) { const sim = utils.similarity(ans, options[i]); if (sim > maVSim) { maVSim = sim; indeV = i; } } if (maVSim > defaultConfig.matchRate) matchArr.push(indeV); } return matchArr; } }; ZZZar api = { monitorxerify: (responseTeVt, url, method, data, ua) => { return new Promise((resolZZZe, reject) => { try { let obj = JSON.parse(responseTeVt); let diZZZHtml = V27;<img src="V27; + obj.ZZZerify_png_path + V27;"/> <input type="teVt" class="code_input" placeholder="请输入图中的验证码" /><button id="code_btn">验证</button>V27;; layV.prompt(diZZZHtml, "请输入验证码", function (id, ZZZalue, teVtarea, button, eZZZent) { let url = obj.ZZZerify_path + "&ucode=" + ZZZalue; window.open(url); }); } catch (error) { let domain = url.match(/:\/\/(.[^/]+)/)[1]; let urlShowxerify = "hts://" + domain + "/antispiderShowxerify.ac"; page.layV_log(`<a target="_blank" href="${urlShowxerify}">若未自滚动出页面,请点我翻开</a>`, V27;errorV27;); layV.iframe(V27;ZZZerifyCodeV27;, V27;验证码验证V27;, urlShowxerify); let timer = setInterZZZal(() => { api.defaultRequest(url, method, data, ua, true).then((response) => { if (response.responseTeVt && !response.responseTeVt.includes(V27;输入验证码V27;)) { layV.destroy(V27;ZZZerifyCodeV27;); clearInterZZZal(timer); page.layV_log(V27;验证码验证乐成!V27;, V27;successV27;); resolZZZe(response); } else { page.layV_log(V27;验证码验证失败!将正在5s后从头验证V27;, V27;errorV27;); } }) }, 5000); } }); }, defaultRequest: async (url, method, data = {}, ua = defaultConfig.ua, ZZZerify = false) => { try { const response = await new Promise((resolZZZe, reject) => { GM_VmlhtRequest({ url, method, headers: { V27;User-AgentV27;: ua, V27;X-Requested-WithV27;: V27;XMLHttpRequestV27;, V27;Sec-Fetch-SiteV27;: V27;same-originV27;, V27;Content-TypeV27;: V27;application/V-www-form-urlencoded; charset=UTF-8V27; }, data: utils.toQueryString(data), onload: resolZZZe, onerror: reject }); }); if (!ZZZerify && response.responseTeVt && response.responseTeVt.includes(V27;输入验证码V27;)) { page.layV_log(V27;检测到验证码!将弹出新页面自止验证验证码(显现验证码多为间隔频次过短,大概乞求过多,请依据原人状况调高运止间隔)V27;, V27;errorV27;); await api.monitorxerify(response.responseTeVt, url, method, data, ua); return await api.defaultRequest(url, method, data); } return response; } catch (err) { if (err.error.indeVOf("connect list") != -1) { let domain = err.error.match(/:\/\/(.[^/]+)/)[1]; let notice = `由于connect未添加招致无权限乞求<br>// @connect ${domain}`; page.layV_log(notice, V27;errorV27;); } return Promise.reject(err); } } , getxerifyCode: async (url) => { return new Promise((resolZZZe, reject) => { GM_VmlhtRequest({ method: "GET", url: url, responseType: "blob", onload: function (res) { ZZZar blob = res.response; ZZZar reader = new FileReader(); reader.onload = function (eZZZent) { resolZZZe(eZZZent.target.result); }; reader.readAsDataURL(blob); } }); }); }, getCourseChapter: async (courseId, classId) => { let url = _self.SerZZZerHost.mooc1Domain + "/gas/clazz?id=" + classId + "&personid=" + courseId + "&fields=id,bbsid,classscore,isstart,allowdownload,chatid,name,state,isfiled,ZZZisiblescore,begindate,coursesetting.fields(id,courseid,hiddencoursecoZZZer,coursefacecheck),course.fields(id,name,infocontent,objectid,app,bulletformat,mappingcourseid,imageurl,teacherfactor,jobcount,knowledge.fields(id,name,indeVOrder,parentnodeid,status,layer,label,jobcount,begintime,endtime,attachment.fields(id,type,objectid,eVtension).type(ZZZideo)))&ZZZiew=json"; let result = await api.defaultRequest(url, V27;GETV27;); return JSON.parse(result.responseTeVt); }, getChapterList: async (courseid, clazzid, nodes, userid, cpi) => { let data = { "ZZZiew": "json", "nodes": nodes, "clazzid": clazzid, "userid": userid, "cpi": cpi, "courseid": courseid, "time": (new Date()).ZZZalueOf() } let result = await api.defaultRequest(_self.SerZZZerHost.mooc1Domain + "/job/myjobsnodesmap", V27;postV27;, data); return JSON.parse(result.responseTeVt); }, getChapterInfo: async (id, courseid) => { let data = { "id": id, "courseid": courseid, "fields": "id,parentnodeid,indeVorder,label,layer,name,begintime,createtime,lastmodifytime,status,jobUnfinishedCount,clickcount,openlock,card.fields(id,knowledgeid,title,knowledgeTitile,description,cardorder).contentcard(all)", "ZZZiew": "json", } let url = _self.SerZZZerHost.mooc1Domain + "/gas/knowledge?" + utils.toQueryString(data); let result = await api.defaultRequest(url, V27;getV27;); return JSON.parse(result.responseTeVt); }, getChapterDetail: async (courseid, clazzid, knowledgeid, num, cpi) => { let url = _self.SerZZZerHost.mooc1Domain + "/knowledge/cards?clazzid=" + clazzid + "&courseid=" + courseid + "&knowledgeid=" + knowledgeid + "&num=" + num + "&cpi=" + cpi + "&ut=s&cpi=229749849&ZZZ=20160407-1"; let result = await api.defaultRequest(url, V27;getV27;); return result.responseTeVt; }, uploadStudyLog: async (courseid, clazzid, knowledgeid, cpi) => { let url = `${location.origin}/mooc2-ans/mycourse/studentcourse?courseid=${courseid}&clazzid=${clazzid}&cpi=${cpi}&ut=s&t=${utils.getTimestamp()}` let teVt = await api.defaultRequest(url, V27;getV27;, {}, naZZZigator.userAgent); let match = teVt.responseTeVt.match(/encode=([\w]+)/); if (match) { const encode = match[1]; let url = `${_self.SerZZZerHost.moocTJDomain}/log/setlog?personid=${cpi}&courseId=${courseid}&classId=${clazzid}&encode=${encode}&chapterId=${knowledgeid}&_=${new Date().ZZZalueOf()}`; let result = await api.defaultRequest(url, V27;getV27;, {}, naZZZigator.userAgent); return result.responseTeVt; } return false; }, docStudy: async (jobid, knowledgeid, courseid, clazzid, jtoken) => { let url = _self.SerZZZerHost.mooc1Domain + "/ananas/job/document?jobid=" + jobid + "&knowledgeid=" + knowledgeid + "&courseid=" + courseid + "&clazzid=" + clazzid + "&jtoken=" + jtoken + "&_dc=" + new Date().ZZZalueOf(); let result = await api.defaultRequest(url, V27;getV27;, {}, naZZZigator.userAgent); return JSON.parse(result.responseTeVt); }, ZZZideoStudy: async (data, dtoken, taskDefaultConfig) => { let url = taskDefaultConfig.reportUrl + "/" + dtoken + "?" + utils.toQueryString(data); let result = await api.defaultRequest(url, V27;getV27;, {}, naZZZigator.userAgent); return JSON.parse(result.responseTeVt); }, getxideoConfig: async (objectId) => { let url = _self.SerZZZerHost.mooc1Domain + "/ananas/status/" + objectId + "?k=&flag=normal&_dc=" + new Date().ZZZalueOf(); let result = await api.defaultRequest(url, V27;getV27;); return JSON.parse(result.responseTeVt); }, unlockChapter: async (courseid, clazzid, knowledgeid, userid, cpi) => { let url = `${_self.SerZZZerHost.mooc1Domain}/job/submitstudy?node=${knowledgeid}&userid=${userid}&clazzid=${clazzid}&courseid=${courseid}&personid=${cpi}&ZZZiew=json`; let result = await api.defaultRequest(url, V27;getV27;, {}, naZZZigator.userAgent); return result.status; }, initdatawithZZZiewer: async (mid, cpi, classid, taskDefaultConfig) => { let url = `${taskDefaultConfig.initdataUrl}?mid=${mid}&cpi=${cpi}&classid=${classid}&_dc=${new Date().ZZZalueOf()}`; let result = await api.defaultRequest(url, V27;getV27;); return JSON.parse(result.responseTeVt); } , submitdatawithZZZiewer: async (classid, cpi, objectid, eZZZentid, memberinfo, answer) => { let url = `${_self.SerZZZerHost.mooc1Domain}/question/quiz-ZZZalidation?classid=${classid}&cpi=${cpi}&objectid=${objectid}&_dc=${new Date().ZZZalueOf()}&eZZZentid=${eZZZentid}&memberinfo=${memberinfo}&answerContent=${answer}`; let result = await api.defaultRequest(url, V27;getV27;); return JSON.parse(result.responseTeVt); } }; ZZZar SerZZZerApi = { request: async function(url, method, data, headers = {}){ return new Promise(function (resolZZZe, reject) { GM_VmlhtRequest({ method: method, url: url, data: JSON.stringify(data), headers: headers, timeout: 5000, onload: function (response) { resolZZZe(response); }, onerror: function (response) { reject(response); }, ontimeout: function (response) { reject(response); } }); }); }, defaultRequest: async function (url, method, data, headers = {}) { if (_self.getCookie == undefined) { _self.getCookie = function (name) { return V27;V27;; }; } headers = Object.assign({ V27;Content-TypeV27;: V27;application/jsonV27;, V27;ZZZV27;: script_info.ZZZersion, V27;refererV27;: location.href, V27;tV27;: utils.getTimestamp(), "token": defaultConfig.token || V27;V27;, "u": _self.uid || _self.getCookie(V27;UIDV27;) || _self.getCookie("_uid") || V27;V27;, }, headers); for (let i = 0; i < reqUrl.length; i++) { let api = reqUrl[i]; console.log(api) let reqHeaders = Object.assign({}, api.headers, headers); let res = await SerZZZerApi.request(api.api + url, method, data, reqHeaders).catch((e) => { return false; }); console.log(res) if (res && res.status === 200) { return res; } } }, search: async function (data, status = true) { data.key = status && defaultConfig.token || V27;V27;; $(".layV_status").html("正正在搜寻答案"); let params = { "z": data.workType, "t": data.type, "u": _self.uid || _self.getCookie(V27;UIDV27;) || _self.getCookie("_uid") || V27;V27;, } data.source = V27;Vy_V27;+script_info.ZZZersion; ZZZar url = V27;search?V27; + utils.toQueryString(params); const res = await SerZZZerApi.defaultRequest(url, V27;postV27;, data); return res; }, configRequest: async function (url) { return await SerZZZerApi.defaultRequest(url, V27;getV27;); }, get_msg: async function () { let url = V27;def/autoMsgV27;; let res = await SerZZZerApi.defaultRequest(url, V27;getV27;); try { let reqData = JSON.parse(res.responseTeVt); return reqData.data; } catch (e) { return defaultConfig.notice; } }, searchOther: (data, item) => { return new Promise(async function (resolZZZe, reject) { GM_VmlhtRequest({ method: item.method, url: item.url, data: item.getdata(data), headers: item.headers, timeout: 5000, onload: function (response) { resolZZZe(response); }, onerror: function (response) { reject(response); }, ontimeout: function (response) { reject(response); } }); }); }, checkKey: async function (key) { if (!key) { page.layV_log("秘钥为空进止检测", "notice"); } let url = V27;keyV27;; let data = { "key": key } let res = await SerZZZerApi.defaultRequest(url, V27;postV27;, data); try { res = JSON.parse(res.responseTeVt); if (res.code === 200) { reqUrl.num = res.data.num || null; reqUrl.usenum = res.data.usenum || null; } page.layV_log(res.msg, "notice"); } catch (error) { page.layV_log("秘钥验证失败", "notice"); } }, getxerifyCode: async function (img) { let url = V27;codeV27;; let data = { "img": img.replace(V27;data:image/png;base64,V27;, V27;V27;) } let res = await SerZZZerApi.defaultRequest(url, V27;postV27;, data); return JSON.parse(res.responseTeVt).data.code; } } ZZZar page = { threadWatch: async function () { if (!defaultConfig.threadWatch) { return; } log(V27;线程守卫已开启V27;); let thread = setInterZZZal(async function () { let layV_status_msg = $("#layV_status_msg"); if (!layV_status_msg.length) { alert("未检测到悬浮窗,已主动封锁线程守卫"); clearInterZZZal(thread); } if (defaultConfig.lastMsg && defaultConfig.lastMsg.indeVOf("每60秒更新一次进度") !== -1) { if (defaultConfig.lastMsg === layV_status_msg.html()) { location.reload(); } } else { log("一切一般"); } defaultConfig.lastMsg = layV_status_msg.html(); log(layV_status_msg.html()); }, 320000); }, init: async function () { GM_addStyle(GM_getResourceTeVt("layVcss")); GM_addStyle(GM_getResourceTeVt("layuicss")); defaultConfig.workinV = 0; defaultConfig.succ = 0; defaultConfig.fail = 0; log(location.pathname); switch (location.pathname) { case V27;/eVam-ans/eVam/test/rexersionTestStartNewV27;: case V27;/eVam/test/rexersionTestStartNewV27;: case V27;/mooc-ans/eVam/test/rexersionTestStartNewV27;: if (location.href.includes(V27;newMooc=trueV27;)) { await this.layV("ks", { title: "🔥检验界面", // storeStatus:false, width: 350, height: 800 }); $(V27;#layV_log, h2V27;).hide(); $(V27;#layV_contentV27;).css(V27;marginV27;, V27;10pVV27;); const createButton = (teVt, onClick) => { const btn = document.createElement(V27;buttonV27;); btn.innerHTML = teVt; btn.classList.add(V27;layui-btnV27;, V27;layui-btn-primaryV27;, V27;layui-border-blackV27;); btn.style.margin = V27;10pV 0pV 10pV 10pVV27;; btn.onclick = onClick; return btn; }; const btn = createButton(defaultConfig.autoSwitch ? V27;封锁主动切换V27; : V27;开启主动切换V27;, () => { defaultConfig.autoSwitch = !defaultConfig.autoSwitch; btn.innerHTML = defaultConfig.autoSwitch ? V27;封锁主动切换V27; : V27;开启主动切换V27;; defaultConfig.autoSwitch && location.reload(); GM_setxalue(cache_key, defaultConfig); }); const btn1 = createButton(V27;配置V27;, () => { log(defaultConfig); page.layV_config(); }); $(V27;#layV_contentV27;).before($(V27;<diZZZ>V27;).attr(V27;idV27;, V27;btn_ccV27;).css(V27;marginV27;, V27;10pVV27;).append(btn, btn1)); this.layV_status_msg(V27;初始化完成V27;); let reqData = page.getQuestion("3"); this.layV_status_msg("主动答题中....."); await page.startAsk(reqData); break; } else { let url = location.href; if (!url.includes(V27;newMooc=falseV27;)) { url = url + V27;&newMooc=trueV27;; } else { url = url.replace(V27;newMooc=falseV27;, V27;newMooc=trueV27;); } location.href = url; break; } case V27;/mycourse/stuV27;: case V27;/mooc-ans/mycourse/stuV27;: case V27;/mooc2-ans/mycourse/stuV27;: await this.layV(); page.threadWatch(); const btn = document.createElement("button"); btn.innerHTML = "配置"; btn.classList.add("layui-btn", "layui-btn-primary", "layui-border-black"); btn.style.margin = "10pV 0pV 10pV 10pV"; btn.onclick = () => { page.layV_config() }; document.getElementById("layV_content").appendChild(btn); this.layV_log("正正在检测题库", "notice"); SerZZZerApi.checkKey(defaultConfig.token); this.layV_log("正正在启动任务,或许耗时" + defaultConfig.interZZZal / 1000 + "秒"); await utils.sleep(defaultConfig.interZZZal); this.layV_status_msg("正正在等候任务加载"); this.mainTask(); break; case V27;/workHandle/handleV27;: case V27;/mooc-ans/workHandle/handleV27;: case V27;/mooc2-ans/workHandle/handleV27;: window.parent.postMessage(utils.notify("error", "做业已被增除-跳过"), V27;*V27;); break; case V27;/work/doHomeWorkNewV27;: case V27;/mooc-ans/work/doHomeWorkNewV27;: case V27;/mooc2-ans/work/doHomeWorkNewV27;: if (document.body.innerHTML.indeVOf("此做业已被教师") !== -1) { window.parent.postMessage(utils.notify("error", "做业已被增除-跳过"), V27;*V27;); break; } if (document.body.innerHTML.indeVOf("您长光阳没有收配") !== -1) { window.parent.postMessage(utils.notify("error", "逢到一个bug,后期修复"), V27;*V27;); break; } if (location.href.includes(V27;reEdit=2V27;)) { this.getScore(); await utils.sleep(defaultConfig.interZZZal); window.parent.postMessage(utils.notify("error", "做业待批阅"), V27;*V27;); break; } if (location.href.includes(V27;mooc2=1V27;)) { // 增除url中的mooc2=1 // location.href = location.href.replace(/&mooc2=1/g, V27;V27;); } if (location.href.includes(V27;oldWorkIdV27;)) { try { page.decode(); } catch (e) { log(e); } await page.layV("zj", { closeMenu: false, maVMenu: true, title: V27;🔥做业答题(原窗口制行封锁)V27;, width: 600, height: 300, storeStatus: false, position: V27;ltV27; }); const btn1 = $(V27;<button>V27;, { teVt: V27;配置V27;, class: V27;layui-btn layui-btn-primary layui-border-blackV27;, style: V27;margin: 10pV 0 10pV 10pV;V27;, click: function () { log(defaultConfig); page.layV_config(); } }); $(V27;#layV_contentV27;).before($(V27;<diZZZ>V27;, { id: V27;btn_ccV27;, style: V27;margin: 10pV;V27; }).append(btn1)); $(V27;h2, #layV_logV27;).hide(); if (defaultConfig.autoAnswer) { this.layV_status_msg("正正在主动答题中"); await page.startChapter(); } } else { layV.msg(V27;不撑持旧版做业V27;, { dialogIcon: V27;helpV27; }); } break; case V27;/work/selectWorkQuestionYiPiYueV27;: case V27;/mooc-ans/work/selectWorkQuestionYiPiYueV27;: case V27;/mooc2-ans/work/selectWorkQuestionYiPiYueV27;: log("做业已完成"); if (location.href.includes(V27;mooc2=1V27;)) { this.getScoreNew(); } else { this.getScore(); log("做业已完成"); } await utils.sleep(defaultConfig.interZZZal); window.parent.postMessage(utils.notify("success", "做业已完成"), V27;*V27;); break; case V27;/mooc2/work/doworkV27;: case V27;/mooc-ans/mooc2/work/doworkV27;: case V27;/mooc2-ans/mooc2/work/doworkV27;: await this.layV(V27;zyV27;, { width: 600, height: 300, storeStatus: false, position: "lt" }); this.layV_status_msg("初始化完成"); $("#layV_log").hide(); const btn1 = $("<button>", { html: "配置", class: "layui-btn layui-btn-primary layui-border-black", style: "margin:10pV 0pV 10pV 10pV", click: function () { log(defaultConfig); page.layV_config(); } }); $("#layV_content").before("<diZZZ id=V27;btn_ccV27; style=V27;margin:10pVV27;></diZZZ>"); $("h2").hide(); $("#btn_cc").append(btn1); if (defaultConfig.autoAnswer) { this.layV_status_msg("正正在主动答题中"); page.startWork() // defaultConfig.loop = setInterZZZal(() => page.startWork(), defaultConfig.interZZZal); } break; case V27;/ZZZisit/coursesV27;: break; case V27;/antispiderShowxerify.acV27;: case V27;/html/processxerify.acV27;: let src = "/processxerifyPng.ac?t=" + Math.floor(2147483647 * Math.random()); let imgData = await api.getxerifyCode(src); let res = await SerZZZerApi.getxerifyCode(imgData); let url = `/html/processxerify.ac?app=0&ucode=${res}`; window.location.href = url; break; case V27;/mycourse/studentstudyV27;: case V27;/mycourse/studentcourseV27;: let diZZZ = document.createElement("diZZZ"); diZZZ.onclick = function () { let courseid = $("#curCourseId").ZZZal() || utils.getUrlParam("courseId"); let clazzid = $("#curClazzId").ZZZal() || utils.getUrlParam("clazzid"); let cpi = $("#curCpi").ZZZal() || utils.getUrlParam("cpi") || /cpi=([^&]*)/.eVec(document.documentElement.innerHTML)[1]; let url = `${_self.SerZZZerHost.mooc1Domain || _self.SerZZZerHost.moocDomain}/ZZZisit/stucoursemiddle?courseid=${courseid}&clazzid=${clazzid}&cpi=${cpi}&ismooc2=1`; window.open(url); }; diZZZ.id = "notify"; diZZZ.style = "z-indeV:1000;position: fiVed;right: 300pV;bottom:0pV;"; diZZZ.innerHTML = `<a target="_self" href="jaZZZascript:;" style="position: absolute; width: 72pV; height: 36pV; line-height: 36pV; font-size: 16pV; bottom: 96pV; border: 1pV solid rgb(123, 158, 49); color: red; background: url("hts://mooc1.chaoVingss/mooc2/images/chapter_wancheng.png") 9pV center no-repeat rgb(255, 255, 255); padding-left: 42pV; border-radius: 3pV; right: -83pV; display: block;" onclick="$(V27;html,bodyV27;).animate({scrollTop:0},600);">点我开刷</a>`; defaultConfig.tutorial && document.body.appendChild(diZZZ); break; case V27;/ztnodedetailcontroller/ZZZisitnodedetailV27;: case V27;/mooc-ans/ztnodedetailcontroller/ZZZisitnodedetailV27;: case V27;/mooc2-ans/ztnodedetailcontroller/ZZZisitnodedetailV27;: layV.msg(V27;若有时长要求,请正在主配置页批改V27;, { dialogIcon: V27;helpV27; }); $(V27;html, bodyV27;).animate({ scrollTop: $(document).height() - $(window).height() }, ($(document).height() - $(window).height()) * (defaultConfig.readSpeed || 10) , function () { $(V27;.nodeItem.r iV27;).click(); }).one(V27;clickV27;, V27;#topV27;, function (eZZZent) { $(eZZZent.delegateTarget).stop(); }); break; case V27;/mooc2/work/ZZZiewV27;: case V27;/mooc-ans/mooc2/work/ZZZiewV27;: case V27;/mooc2-ans/mooc2/work/ZZZiewV27;: this.getScore3(); break case V27;/eVam-ans/eVam/test/rexersionPaperMarkContentNewV27;: case V27;/mooc-ans/eVam-ans/eVam/test/rexersionPaperMarkContentNewV27;: case V27;/mooc2-ans/eVam-ans/eVam/test/rexersionPaperMarkContentNewV27;: this.getScore4(); break; default: if (/^\/(mooc2-ans\/course|mooc2-ans\/zt|mooc-ans\/course|mooc-ans\/zt|course|zt)\/\d+\.html$/.test(location.pathname)) { setTimeout(function () { _self.sendLogs && $(V27;.course_section:eq(0) .chapterTeVtV27;).click(); }, defaultConfig.interZZZal); } } }, layV: async (id = "abcde", option = {}) => { const configs = Object.assign({ icon: icon, position: "lb", width: 300, height: 500, borderRadius: "5pV", skin: "asphalt", opacity: 1, maVMenu: false, statusBar: "<diZZZ id=V27;layV_status_msgV27;>正正在初始化</diZZZ>", style: "#layV_diZZZ{background-color:#F5F7FA;color:#000;height:100%;width:100%;oZZZerflow:auto;}#layV_msg{background-color:#fff;padding:10pV;border-bottom:1pV solid #ccc;border-radius:5pV;margin:10pV;}#layV_log{height:60%;padding:10pV;color:#A8A8B3;}#layV_content{height:10%;}.layV_success{color:green;font-weight:bold;}.layV_error{color:#F56C6C;font-weight:bold;}.layV_info{color:#909399;font-weight:bold;}.layV_notice{color:#E6A23C;font-weight:bold;}.layV_status_msg{color:green;font-weight:bold;}h2{teVt-align:center;}" }, option); const notice = utils.cacheEVpired("noticetemp", 600000) || await SerZZZerApi.get_msg(); const htmlStr = `<diZZZ id="layV_diZZZ"><diZZZ id="layV_msg">${notice}</diZZZ><h2>保持此页面开启将主动刷课</h2><diZZZ id="layV_content"></diZZZ><diZZZ id="layV_log">运止日志:</diZZZ></diZZZ>`; layV.html(id, `🔥超星小助手 ZZZ${script_info.ZZZersion}`, htmlStr, configs) }, layV_config: function () { let configForm = [ { group: "根柢设置", groupId: "base", items: { tutorial: { type: V27;checkboVV27;, label: V27;能否开启引导V27;, ZZZalue: defaultConfig.tutorial, desc: V27;封锁章节页的刷课引导V27; }, interZZZal: { type: V27;numberV27;, label: V27;运止间隔V27;, ZZZalue: defaultConfig.interZZZal, desc: V27;用于控制脚原运止速度,单位毫秒V27; }, autoSubmitRate: { type: V27;numberV27;, label: V27;答案准确率V27;, ZZZalue: defaultConfig.autoSubmitRate, desc: V27;满足此准确率则提交,否则保存不提交V27; }, randomAnswer: { type: V27;checkboVV27;, label: V27;无答案能否随机选择V27;, ZZZalue: defaultConfig.randomAnswer, desc: V27;封锁后将不会随机选择,须要手动选择,倡议封锁V27; }, matchRate: { type: V27;numberV27;, label: V27;答案暗昧婚配率V27;, ZZZalue: defaultConfig.matchRate, desc: V27;0-1之间,越大越严格V27; } } }, { group: "章节配置", groupId: "chapter", items: { autoxideo: { type: V27;checkboVV27;, label: V27;能否开启主动室频V27;, ZZZalue: defaultConfig.autoxideo, desc: V27;封锁后章节将主动跳过室频V27; }, ZZZideoSpeed: { type: V27;numberV27;, label: V27;室频倍速V27;, ZZZalue: defaultConfig.ZZZideoSpeed, desc: V27;室频倍速[1-16],不引荐批改!!超星目前倍速会被清算进度!!V27; }, readSpeed: { type: V27;numberV27;, label: V27;浏览速度V27;, ZZZalue: defaultConfig.readSpeed || 10, desc: V27;若有时长要求,依照时长几多多设置速度,默许为10V27; }, autoRead: { type: V27;checkboVV27;, label: V27;能否开启主动浏览V27;, ZZZalue: defaultConfig.autoRead, desc: V27;封锁后章节将主动跳过文档以及ppt等V27; }, autoAnswer: { type: V27;checkboVV27;, label: V27;能否开启主动答题V27;, ZZZalue: defaultConfig.autoAnswer, desc: V27;封锁后章节将主动跳过章节做业V27; }, autoSubmit: { type: V27;checkboVV27;, label: V27;能否开启主动提交V27;, ZZZalue: defaultConfig.autoSubmit, desc: V27;封锁后将不会主动提交,须要手动提交V27; }, } }, { group: "其余配置", groupId: "other", items: { reZZZiewMode: { type: V27;checkboVV27;, label: V27;能否开启温习形式V27;, ZZZalue: defaultConfig.reZZZiewMode, desc: V27;开启后将从开头补时长补次数V27; }, threadWatch: { type: V27;checkboVV27;, label: V27;能否开启进程守卫V27;, ZZZalue: defaultConfig.threadWatch, desc: V27;开启后逢到卡壳将主动刷新网页V27; }, freeFirst: { type: V27;checkboVV27;, label: V27;能否开启免费题库劣先V27;, ZZZalue: defaultConfig.freeFirst, desc: V27;开启后免费题库无答案后才会搜寻付费题库V27; }, token: { type: V27;teVtareaV27;, label: V27;付费题库tokenV27;, ZZZalue: defaultConfig.token, desc: V27;扶曲题库Token,非必填V27; }, aiAsk:{ type: V27;checkboVV27;, label: V27;能否AI答题V27;, ZZZalue: defaultConfig.aiAsk, desc: V27;正正在开发中V27; } } } ]; let html = V27;V27;; for (const item of configForm) { let tab = `<input type="radio" name="tab" id="${item.groupId}" class="tab-button" checked> <label class="tab_lable" id="tab-${item.groupId}" for="${item.groupId}">${item.group}</label>`; html += tab; } for (const item of configForm) { let itemHtml = ""; for (const [key, { type, label, ZZZalue, desc }] of Object.entries(item.items)) { const inputHTML = (() => { switch (type) { case V27;teVtareaV27;: return `<teVtarea name="${key}" class="layui-teVtarea">${ZZZalue}</teVtarea>`; case V27;numberV27;: return `<input type="number" name="${key}" ZZZalue="${ZZZalue}" class="layui-input">`; case V27;checkboVV27;: return `<input type="checkboV" name="${key}" lay-skin="primary" lay-teVt="开启|封锁" ${ZZZalue ? V27;checkedV27; : V27;V27;}>`; default: return V27;V27;; } })(); itemHtml += ` <diZZZ class="layui-form-item"> <label class="layui-form-label">${label}</label> ${type == "checkboV" ? inputHTML : V27;V27;} <diZZZ class="layui-input-block"> ${[V27;teVtareaV27;, V27;numberV27;].includes(type) ? inputHTML : V27;V27;} <diZZZ class="layui-form-mid layui-word-auV">${desc}</diZZZ> </diZZZ> </diZZZ>`; } html += ` <diZZZ class="tab-content" id="${item.groupId}-content"> ${itemHtml} </diZZZ> `; } layV.html(V27;DomsdV27;, V27;🔥超星小助手配置V27;, html, { statusBar: true, buttons: [ { label: V27;保存V27;, callback: function (id, button, eZZZent) { for (let item of configForm) { for (let key in item.items) { let ZZZalue = null; if ($(`input[name=${key}]`).attr(V27;typeV27;) == V27;checkboVV27;) { ZZZalue = $(`input[name=${key}]`).is(V27;:checkedV27;); } if ($(`teVtarea[name=${key}]`).length > 0) { ZZZalue = $(`teVtarea[name=${key}]`).ZZZal(); } if ($(`input[name=${key}]`).attr(V27;typeV27;) == V27;numberV27;) { ZZZalue = $(`input[name=${key}]`).ZZZal(); } if (ZZZalue != null) { log(`保存配置项${key}=${ZZZalue}`); defaultConfig[key] = ZZZalue; } } } if (defaultConfig.interZZZal < 1000) { page.layV_log(V27;大众间隔分比办法,已默许3000V27;, "error"); defaultConfig.interZZZal = 3000; } if (defaultConfig.ZZZideoSpeed > 16) { page.layV_log(V27;室频倍速不引荐批改!!你咋不上天,已默许1倍速V27;, "error"); defaultConfig.ZZZideoSpeed = 1; } else if (defaultConfig.ZZZideoSpeed > 1) { page.layV_log(`室频倍速不引荐批改!!当前倍速【${defaultConfig.ZZZideoSpeed}】,超星目前倍速会被清算进度!!`, "error"); } else if (defaultConfig.ZZZideoSpeed < 1) { defaultConfig.ZZZideoSpeed = 1; page.layV_log(V27;你感觉你的倍速折法吗?V27;, "error"); } if (defaultConfig.matchRate > 1 || defaultConfig.matchRate < 0) { page.layV_log(V27;答案暗昧婚配率分比办法,已默许0.8V27;, "error"); defaultConfig.matchRate = 0.8; } if (defaultConfig.autoSubmitRate > 1 || defaultConfig.autoSubmitRate < 0) { page.layV_log(V27;答案准确率分比办法,已默许0.8V27;, "error"); defaultConfig.autoSubmitRate = 0.8; } GM_setxalue(cache_key, defaultConfig); layV.destroy(id); } }, { label: V27;撤消V27;, callback: function (id, button, eZZZent) { layV.destroy(id); } } ], position: V27;ltV27;, width: 300, height: 500, borderRadius: "5pV", skin: V27;asphaltV27;, opacity: 1, maVMenu: false, style: "input{-webkit-appearance:auto;line-height:normal;}.tab-button{display:none;}.tab-button:hoZZZer{background-color:gray;color:#000;}.tab-content{display:none;}.tab_lable{color:#c3c3c3;display:inline-block;*display:inline;*zoom:1;ZZZertical-align:middle;font-size:14pV;transition:all .2s;-webkit-transition:all .2s;position:relatiZZZe;line-height:40pV;min-width:65pV;padding:0 15pV;teVt-align:center;cursor:pointer;margin-bottom:15pV;}#base:checked~#base-content,#chapter:checked~#chapter-content,#other:checked~#other-content{display:block;}#base:checked~#tab-base,#chapter:checked~#tab-chapter,#other:checked~#tab-other{font-weight:bold;color:#000;}" }); }, layV_log: function (msg, leZZZel = "info") { const log = document.querySelector("#layV_log"); const maVLine = Math.floor(log.offsetHeight / 20); if (log.children.length > maVLine) { log.remoZZZeChild(log.children[0]); } const time = new Date().toLocaleTimeString(); const str = `<p>${time} <span class="layV_${leZZZel}">${msg}</span></p>`; log.innerHTML += str; }, layV_status_msg: function (msg) { let log = document.getElementById("layV_status_msg").innerHTML = msg; }, mainTask: async function () { const pz = { courseid: utils.getUrlParam("courseid") || utils.getUrlParam("courseId"), clazzid: utils.getUrlParam("clazzid"), cpi: utils.getUrlParam("cpi"), userid: utils.getInputParam("userId") || _self.uid }; const data = await api.getCourseChapter(pz.courseid, pz.clazzid); const courseData = data.data[0].course.data[0]; const chapterData = utils.toOneArray(utils.sortData(courseData.knowledge.data)); const statusTask = chapterData.some(item => item.status === "task"); defaultConfig.reZZZiewMode && this.layV_log("检测到为温习形式,将以温习模式完成任务", "info"); statusTask && this.layV_log("检测到为闯关形式,将以闯关模式完成任务", "info"); const chapterIds = chapterData.map(item => item.id).join(","); const chapterInfo = await api.getChapterList(pz.courseid, pz.clazzid, chapterIds, pz.userid, pz.cpi); const unfinishcount = Object.ZZZalues(chapterInfo).reduce((total, current) => total + current.unfinishcount, 0); this.layV_log(`[${courseData[V27;nameV27;]}-${courseData[V27;teacherfactorV27;]}]获与到${chapterData.length}个章节,共计${courseData.jobcount}个任务,待完成${unfinishcount}个任务`, "info"); async function doTask(item) { statusTask && item.jobcount == 0 && await api.unlockChapter(pz.courseid, pz.clazzid, item.id, pz.userid, pz.cpi) && await utils.sleep(1000); if (unfinishcount === 0 && !defaultConfig.reZZZiewMode) { return false; } page.layV_log(`初步完成章节[${item.label}${item.name}]`, "info"); if (chapterInfo[item.id].unfinishcount === 0 && !defaultConfig.reZZZiewMode) { page.layV_log("已完成的章节,跳过", "success"); return null; } let res = await api.uploadStudyLog(pz.courseid, pz.clazzid, item.id, pz.cpi); res && page.layV_log(`上传进修记录乐成`, "success"); const chapterOne = await api.getChapterInfo(item.id, pz.courseid); let zjurl = `hts://mooc1.chaoVingss/mycourse/transfer?moocId=${pz.courseid}&clazzid=${pz.clazzid}&ut=s&refer=${encodeURIComponent(window.location.href)}`; let zkres = await api.defaultRequest(zjurl); for (const item3 of chapterOne.data[0].card.data) { log(item3.title); const chapterDetail = await api.getChapterDetail(pz.courseid, pz.clazzid, item3.knowledgeid, item3.cardorder, pz.cpi); if (chapterDetail.indeVOf("章节未开放") !== -1) { return "unlock"; } const regeV = /mArg\s*=\s*({.*?});/; const match = regeV.eVec(chapterDetail); if (match) { const jsonStr = match[1]; const mArg = JSON.parse(jsonStr); const taskDefaultConfig = mArg.defaults; for (const task of mArg.attachments) { if (!task.type) { continue; } await page.finishTask(task, item3, pz, taskDefaultConfig); await utils.sleep(defaultConfig.interZZZal); } } await utils.sleep(defaultConfig.interZZZal); } await utils.sleep(defaultConfig.interZZZal); } let lastItem = null, unlockChapterNum = 0; for (const item of chapterData) { let back = await doTask(item); if (unlockChapterNum > 0) { page.layV_log("章节未开放异样(正常都是章节做业准确率不够,自止完成做业后继续)", "error"); if (statusTask) { page.layV_log("已久停刷课,请自止完成做业", "error"); return; } } back == "unlock" && lastItem != null && await api.unlockChapter(pz.courseid, pz.clazzid, lastItem.id, pz.userid, pz.cpi) && unlockChapterNum++; if (back == false) { break; } lastItem = item; } this.layV_status_msg("任务已全副完成"); this.layV_log("章节全副完成(若仍有知识点未完成请刷新页面)", "success") }, finishTask: async function (task, item3, pz, taskDefaultConfig) { return new Promise(async (resolZZZe, reject) => { this.layV_status_msg(`正正在完成[${task.property.name || task.property.title}]`); this.layV_log(`[${(task.property.name || task.property.title)}-${task.type}]初步完成任务`, "info"); log(task); log(item3); log(taskDefaultConfig); switch (task.type) { case "ZZZideo": if (!defaultConfig.autoxideo) { this.layV_log("[" + task.property.name + "]室频已跳过(若须要主动完成室频请正在设置中开启)", "error"); resolZZZe(); break; } let ZZZideoData = await api.getxideoConfig(task.objectId); await this.finishxideoAnswer(task, pz, ZZZideoData, taskDefaultConfig); this.layV_log("[" + task.property.name + "]室频初步任务,详细进度查察下方进度条", "info"); let ZZZideoStatus = await this.finishxideo(task, ZZZideoData, pz, taskDefaultConfig); if (ZZZideoStatus == true) { this.layV_log("[" + task.property.name + "]室频已完成", "success"); } else { this.layV_log("[" + task.property.name + "]室频异样跳过,一般状况无室便可", "error"); } resolZZZe(); break; case "document": if (!defaultConfig.autoRead) { this.layV_log("[" + task.property.name + "]文档已跳过(若须要主动完成文档请正在设置中开启)", "error"); resolZZZe(); break; } let result = await api.docStudy(task.property.jobid, item3.knowledgeid, pz.courseid, pz.clazzid, task.jtoken); result.status ? this.layV_log("[" + task.property.name + "]文档已完成", "success") : this.layV_log("[" + task.property.name + "]文档异样(一般不用理会)", "error"); resolZZZe(); break; case "workid": if (!defaultConfig.autoAnswer) { this.layV_log("[" + task.property.title + "]做业已跳过(若须要主动完成做业请正在设置中开启)", "error"); resolZZZe(); break; } reqUrl.num && this.layV_log(`付费题库剩余次数:${reqUrl.num}}`, V27;noticeV27;) let url = `${_self.SerZZZerHost.mooc1Domain}/api/work?api=1&workId=${(task.jobid || task.property.workid).replace(V27;work-V27;, V27;V27;)}&jobid=${task.property.jobid || ""}&needRedirect=true&knowledgeid=${item3.knowledgeid}&ktoken=${taskDefaultConfig.ktoken}&cpi=${taskDefaultConfig.cpi}&ut=s&clazzId=${taskDefaultConfig.clazzId}&type=&enc=${task.enc}&utenc=undefined&courseid=${taskDefaultConfig.courseid}&mooc2=1`; log(url); layV.iframe(V27;workiframeV27;, V27;做业V27;, url) await this.finishWork(); layV.destroy(V27;workiframeV27;); resolZZZe(); break; default: this.layV_log("久不撑持该任务类型" + task.type, "error"); resolZZZe(); break; } }); }, finishxideoAnswer: async function (task, pz, ZZZideoData, taskDefaultConfig) { let res = await api.initdatawithZZZiewer(task.property.mid, pz.cpi, pz.clazzid, taskDefaultConfig); this.layV_log("[" + task.property.name + "]获与室频中的题目问题", "info"); for (const item of res) { try { const item1 = item.datas[0]; const options = item1.options; let answer = options.filter(item => item.isRight == true).map(item => item.name).join(); let res1 = await api.submitdatawithZZZiewer(pz.clazzid, pz.cpi, ZZZideoData.objectid, item1.resourceId, item1.memberinfo, answer); if (res1.status) { this.layV_log(`[正正在完成室频中的题目问题]:${item1.description}<br>答案:${answer}<br>${res1.isRight ? "答案准确" : "答案舛错"}`, "success"); } else { this.layV_log(`[正正在完成室频中的题目问题]:${item1.description}<br>答案:${answer}<br>${res1.msg}`, "error"); } await utils.sleep(defaultConfig.interZZZal); } catch (e) { this.layV_log("有个垃圾题跳过", "error"); } } this.layV_log("[" + task.property.name + "]室频题目问题已完结", "info"); }, finishxideo: async function (task, ZZZideoData, pz, taskDefaultConfig) { return new Promise(async (resolZZZe, reject) => { let data = { "clazzId": pz.clazzid, "playingTime": "0", "duration": ZZZideoData.duration, "clipTime": "0_" + ZZZideoData.duration, "objectId": ZZZideoData.objectid, "otherInfo": task.otherInfo.replace(/&cour.*$/, ""), "courseId": pz.courseid, "jobid": task.property.jobid || task.property._jobid, "userid": pz.userid, "isdrag": "3", "ZZZiew": "pc",//json "enc": "", "rt": task.property.rt || "0.9", "dtype": task.property.module.includes(V27;audioV27;) ? V27;AudioV27; : V27;xideoV27;, "_t": new Date().getTime() } if (data.duration == undefined) { resolZZZe(false); } let time = 0, result; const interZZZalTime = 60000; while (true) { data.isdrag = time < data.duration ? 3 : 4; data.playingTime = time >= data.duration ? data.duration : time; log("当行进度:" + data.playingTime + "/" + data.duration + "s " + "每60秒更新一次进度"); this.layV_status_msg("当行进度:" + data.playingTime + "/" + data.duration + "s " + "每60秒更新一次进度"); data.enc = utils.getxideoEnc(data.clazzId, data.userid, data.jobid, data.objectId, data.playingTime, data.duration); result = await api.ZZZideoStudy(data, ZZZideoData.dtoken, taskDefaultConfig); if (time >= data.duration || (result.isPassed == true && !defaultConfig.reZZZiewMode)) { break; } time += 60 * defaultConfig.ZZZideoSpeed; if (time > data.duration) { let waitTime = (60 * defaultConfig.ZZZideoSpeed - (time - data.duration)) / defaultConfig.ZZZideoSpeed; this.layV_log("等候" + waitTime + "秒后完成任务"); await utils.sleep(waitTime * 1000); } else { await utils.sleep(interZZZalTime); } } resolZZZe(result.isPassed); }); }, finishWork: async function () { return new Promise(async (resolZZZe, reject) => { const handler = function (eZZZent) { let res = JSON.parse(eZZZent.data); if (res.leZZZel == "success") { page.layV_log("做业已完成", "success"); _self.remoZZZeEZZZentListener("message", handler); resolZZZe(); } else { if(!res.msg){ return; } page.layV_log(res.msg, "error"); _self.remoZZZeEZZZentListener("message", handler); resolZZZe(); } } _self.addEZZZentListener(V27;messageV27;, handler); }); }, /** * 获与题目问题 * @param data * @param num * @returns {Promise<Awaited<unknown>[]>} */ requestMerge: async function (data, num = 0) { try { data.id = _self["uid"] || _self.getCookie(V27;UIDV27;) || _self.getCookie("_uid") || 0; } catch (e) { data.id = 0; } let promiseArr = []; if (defaultConfig.freeFirst && num === 0) { // return []; otherApi.forEach((item) => { promiseArr.push( SerZZZerApi.searchOther(data, item) .then((response) => { let res = item.getanswer(response); return res === false ? [] : res; }) .catch(() => []) ); }); page.layV_status_msg("免费题库检索中(无答案将运用支费题库)"); try { SerZZZerApi.search(data, false).then((response) => { return []; }).catch((error) => { return []; }) } catch (e) { log(e); } // 根除按时器 return await Promise.all(promiseArr); } else { page.layV_status_msg("支费题库检索中"); const res = await SerZZZerApi.search(data).then((response) => { const result = JSON.parse(response.responseTeVt); switch (result.code) { case 200: reqUrl.num = result.data.num || null; reqUrl.usenum = result.data.usenum || null; return result.data.answer; case 401: return result.msg; case 403: page.layV_status_msg("乞求频次过高"); return "error-_-"; case 404: page.layV_status_msg("页面不存正在"); return "error-_-"; case 500: page.layV_status_msg("效劳器舛错"); return "error-_-"; default: page.getScore2(result.data); return result.msg; } }).catch((error) => { switch (error.status) { case 403: page.layV_status_msg("乞求被谢绝,等候重试"); let msg; try { msg = JSON.parse(error.responseTeVt).msg; } catch (e) { msg = "乞求频次过快,请稍后重试"; } page.layV_status_msg(msg); break; case 404: page.layV_status_msg("乞求地址舛错,任务完毕"); break; default: page.layV_status_msg("乞求舛错,等候重试"); break; } return "error-_-"; }); if (res === "error-_-" && num < 3) { return await page.requestMerge(data, num + 1); } else if (res === "error-_-" && num >= 3) { return []; } else { return [res]; } } return []; }, clear: function () { $(".answerBg, .teVtDIx, .eidtDiZZZ").each(function () { ($(this).find(".check_answer").length || $(this).find(".check_answer_dV").length) && $(this).click(); }); $(".answerBg, .teVtDIx, .eidtDiZZZ").find(V27;teVtareaV27;).each(function () { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(""); }); }); }, clearCurrent: function (item) { $(item).find(".answerBg, .teVtDIx, .eidtDiZZZ").each(function () { ($(this).find(".check_answer").length || $(this).find(".check_answer_dV").length) && $(this).click(); }); $(item).find(".answerBg, .teVtDIx, .eidtDiZZZ").find(V27;teVtareaV27;).each(function () { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(""); }); }); $(item).find(V27;:radio, :checkboVV27;).prop(V27;checkedV27;, false); $(item).find(V27;teVtareaV27;).each(function () { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(""); }); }); }, clearCurrentNew: function (item) { $(item).find(".before-after, .teVtDIx, .eidtDiZZZ").each(function () { ($(this).find(".check_answer").length || $(this).find(".check_answer_dV").length) && $(this).click(); }); $(item).find(".before-after, .teVtDIx, .eidtDiZZZ").find(V27;teVtareaV27;).each(function () { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(""); }); }); $(item).find(V27;:radio, :checkboVV27;).prop(V27;checkedV27;, false); $(item).find(V27;teVtareaV27;).each(function () { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(""); }); }); }, /** * 解密字体 * 做者wyn * 本地址:hts://bbs.tampermonkey.netss/forum.php?mod=ZZZiewthread&tid=2303&highlight=%E5%AD%97%E4%BD%93%E8%A7%A3%E5%AF%86 */ decode: function () { ZZZar Typr = { parse: function (r) { ZZZar e = function (r, e, a, t) { Typr.B; ZZZar n = Typr.T, o = { cmap: n.cmap, head: n.head, hhea: n.hhea, maVp: n.maVp, hmtV: n.hmtV, name: n.name, "OS/2": n.OS2, post: n.post, loca: n.loca, kern: n.kern, glyf: n.glyf, "CFF ": n.CFF, "SxG ": n.SxG }, i = { _data: r, _indeV: e, _offset: a }; for (ZZZar s in o) { ZZZar d = Typr.findTable(r, s, a); if (d) { ZZZar u = d[0], h = t[u]; null == h && (h = o[s].parseTab(r, u, d[1], i)), i[s] = t[u] = h } } return i }, a = Typr.B, t = new Uint8Array(r), n = {}; if ("ttcf" == a.readASCII(t, 0, 4)) { ZZZar o = 4; a.readUshort(t, o); o += 2; a.readUshort(t, o); o += 2; ZZZar i = a.readUint(t, o); o += 4; for (ZZZar s = [], d = 0; d < i; d++) { ZZZar u = a.readUint(t, o); o += 4, s.push(e(t, d, u, n)) } return s } return [e(t, 0, 0, n)] }, findTable: function (r, e, a) { for (ZZZar t = Typr.B, n = t.readUshort(r, a + 4), o = a + 12, i = 0; i < n; i++) { ZZZar s = t.readASCII(r, o, 4), d = (t.readUint(r, o + 4), t.readUint(r, o + 8)), u = t.readUint(r, o + 12); if (s == e) return [d, u]; o += 16 } return null }, T: {} }; Typr.B = { readFiVed: function (r, e) { return (r[e] << 8 | r[e + 1]) + (r[e + 2] << 8 | r[e + 3]) / 65540 }, readF2dot14: function (r, e) { return Typr.B.readShort(r, e) / 16384 }, readInt: function (r, e) { ZZZar a = Typr.B.t.uint8; return a[0] = r[e + 3], a[1] = r[e + 2], a[2] = r[e + 1], a[3] = r[e], Typr.B.t.int32[0] }, readInt8: function (r, e) { return Typr.B.t.uint8[0] = r[e], Typr.B.t.int8[0] }, readShort: function (r, e) { ZZZar a = Typr.B.t.uint8; return a[1] = r[e], a[0] = r[e + 1], Typr.B.t.int16[0] }, readUshort: function (r, e) { return r[e] << 8 | r[e + 1] }, writeUshort: function (r, e, a) { r[e] = a >> 8 & 255, r[e + 1] = 255 & a }, readUshorts: function (r, e, a) { for (ZZZar t = [], n = 0; n < a; n++) { ZZZar o = Typr.B.readUshort(r, e + 2 * n); t.push(o) } return t }, readUint: function (r, e) { ZZZar a = Typr.B.t.uint8; return a[3] = r[e], a[2] = r[e + 1], a[1] = r[e + 2], a[0] = r[e + 3], Typr.B.t.uint32[0] }, writeUint: function (r, e, a) { r[e] = a >> 24 & 255, r[e + 1] = a >> 16 & 255, r[e + 2] = a >> 8 & 255, r[e + 3] = a >> 0 & 255 }, readUint64: function (r, e) { return 4294967296 * Typr.B.readUint(r, e) + Typr.B.readUint(r, e + 4) }, readASCII: function (r, e, a) { for (ZZZar t = "", n = 0; n < a; n++) t += String.fromCharCode(r[e + n]); return t }, writeASCII: function (r, e, a) { for (ZZZar t = 0; t < a.length; t++) r[e + t] = a.charCodeAt(t) }, readUnicode: function (r, e, a) { for (ZZZar t = "", n = 0; n < a; n++) { ZZZar o = r[e++] << 8 | r[e++]; t += String.fromCharCode(o) } return t }, _tdec: window.TeVtDecoder ? new window.TeVtDecoder : null, readUTF8: function (r, e, a) { ZZZar t = Typr.B._tdec; return t && 0 == e && a == r.length ? t.decode(r) : Typr.B.readASCII(r, e, a) }, readBytes: function (r, e, a) { for (ZZZar t = [], n = 0; n < a; n++) t.push(r[e + n]); return t }, readASCIIArray: function (r, e, a) { for (ZZZar t = [], n = 0; n < a; n++) t.push(String.fromCharCode(r[e + n])); return t }, t: function () { ZZZar r = new ArrayBuffer(8); return { buff: r, int8: new Int8Array(r), uint8: new Uint8Array(r), int16: new Int16Array(r), uint16: new Uint16Array(r), int32: new Int32Array(r), uint32: new Uint32Array(r) } }() }, Typr.T.CFF = { parseTab: function (r, e, a) { ZZZar t = Typr.B, n = Typr.T.CFF; (r = new Uint8Array(r.buffer, e, a))[e = 0], r[++e], r[++e], r[++e]; e++; ZZZar o = []; e = n.readIndeV(r, e, o); for (ZZZar i = [], s = 0; s < o.length - 1; s++) i.push(t.readASCII(r, e + o[s], o[s + 1] - o[s])); e += o[o.length - 1]; ZZZar d = []; e = n.readIndeV(r, e, d); ZZZar u = []; for (s = 0; s < d.length - 1; s++) u.push(n.readDict(r, e + d[s], e + d[s + 1])); e += d[d.length - 1]; ZZZar h = u[0], p = []; e = n.readIndeV(r, e, p); ZZZar f = []; for (s = 0; s < p.length - 1; s++) f.push(t.readASCII(r, e + p[s], p[s + 1] - p[s])); if (e += p[p.length - 1], n.readSubrs(r, e, h), h.CharStrings && (h.CharStrings = n.readBytes(r, h.CharStrings)), h.ROS) { e = h.FDArray; ZZZar l = []; e = n.readIndeV(r, e, l), h.FDArray = []; for (s = 0; s < l.length - 1; s++) { ZZZar ZZZ = n.readDict(r, e + l[s], e + l[s + 1]); n._readFDict(r, ZZZ, f), h.FDArray.push(ZZZ) } e += l[l.length - 1], e = h.FDSelect, h.FDSelect = []; ZZZar y = r[e]; if (e++, 3 != y) throw y; ZZZar c = t.readUshort(r, e); e += 2; for (s = 0; s < c + 1; s++) h.FDSelect.push(t.readUshort(r, e), r[e + 2]), e += 3 } return h.charset && (h.charset = n.readCharset(r, h.charset, h.CharStrings.length)), n._readFDict(r, h, f), h }, _readFDict: function (r, e, a) { ZZZar t, n = Typr.T.CFF; for (ZZZar o in e.PriZZZate && (t = e.PriZZZate[1], e.PriZZZate = n.readDict(r, t, t + e.PriZZZate[0]), e.PriZZZate.Subrs && n.readSubrs(r, t + e.PriZZZate.Subrs, e.PriZZZate)), e) -1 != ["FamilyName", "FontName", "FullName", "Notice", "ZZZersion", "Copyright"].indeVOf(o) && (e[o] = a[e[o] - 426 + 35]) }, readSubrs: function (r, e, a) { a.Subrs = Typr.T.CFF.readBytes(r, e); ZZZar t, n = a.Subrs.length + 1; t = n < 1240 ? 107 : n < 33900 ? 1131 : 32768, a.Bias = t }, readBytes: function (r, e) { Typr.B; ZZZar a = []; e = Typr.T.CFF.readIndeV(r, e, a); for (ZZZar t = [], n = a.length - 1, o = r.byteOffset + e, i = 0; i < n; i++) { ZZZar s = a[i]; t.push(new Uint8Array(r.buffer, o + s, a[i + 1] - s)) } return t }, 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], glyphByUnicode: function (r, e) { for (ZZZar a = 0; a < r.charset.length; a++) if (r.charset[a] == e) return a; return -1 }, glyphBySE: function (r, e) { return e < 0 || e > 255 ? -1 : Typr.T.CFF.glyphByUnicode(r, Typr.T.CFF.tableSE[e]) }, readCharset: function (r, e, a) { ZZZar t = Typr.B, n = [".notdef"], o = r[e]; if (e++, 0 == o) for (ZZZar i = 0; i < a; i++) { ZZZar s = t.readUshort(r, e); e += 2, n.push(s) } else { if (1 != o && 2 != o) throw "error: format: " + o; for (; n.length < a;) { s = t.readUshort(r, e); e += 2; ZZZar d = 0; 1 == o ? (d = r[e], e++) : (d = t.readUshort(r, e), e += 2); for (i = 0; i <= d; i++) n.push(s), s++ } } return n }, readIndeV: function (r, e, a) { ZZZar t = Typr.B, n = t.readUshort(r, e) + 1, o = r[e += 2]; if (e++, 1 == o) for (ZZZar i = 0; i < n; i++) a.push(r[e + i]); else if (2 == o) for (i = 0; i < n; i++) a.push(t.readUshort(r, e + 2 * i)); else if (3 == o) for (i = 0; i < n; i++) a.push(16777215 & t.readUint(r, e + 3 * i - 1)); else if (4 == o) for (i = 0; i < n; i++) a.push(t.readUint(r, e + 4 * i)); else if (1 != n) throw "unsupported offset size: " + o + ", count: " + n; return (e += n * o) - 1 }, getCharString: function (r, e, a) { ZZZar t = Typr.B, n = r[e], o = r[e + 1], i = (r[e + 2], r[e + 3], r[e + 4], 1), s = null, d = null; n <= 20 && (s = n, i = 1), 12 == n && (s = 100 * n + o, i = 2), 21 <= n && n <= 27 && (s = n, i = 1), 28 == n && (d = t.readShort(r, e + 1), i = 3), 29 <= n && n <= 31 && (s = n, i = 1), 32 <= n && n <= 246 && (d = n - 139, i = 1), 247 <= n && n <= 250 && (d = 256 * (n - 247) + o + 108, i = 2), 251 <= n && n <= 254 && (d = 256 * -(n - 251) - o - 108, i = 2), 255 == n && (d = t.readInt(r, e + 1) / 65535, i = 5), a.ZZZal = null != d ? d : "o" + s, a.size = i }, readCharString: function (r, e, a) { for (ZZZar t = e + a, n = Typr.B, o = []; e < t;) { ZZZar i = r[e], s = r[e + 1], d = (r[e + 2], r[e + 3], r[e + 4], 1), u = null, h = null; i <= 20 && (u = i, d = 1), 12 == i && (u = 100 * i + s, d = 2), 19 != i && 20 != i || (u = i, d = 2), 21 <= i && i <= 27 && (u = i, d = 1), 28 == i && (h = n.readShort(r, e + 1), d = 3), 29 <= i && i <= 31 && (u = i, d = 1), 32 <= i && i <= 246 && (h = i - 139, d = 1), 247 <= i && i <= 250 && (h = 256 * (i - 247) + s + 108, d = 2), 251 <= i && i <= 254 && (h = 256 * -(i - 251) - s - 108, d = 2), 255 == i && (h = n.readInt(r, e + 1) / 65535, d = 5), o.push(null != h ? h : "o" + u), e += d } return o }, readDict: function (r, e, a) { for (ZZZar t = Typr.B, n = {}, o = []; e < a;) { ZZZar i = r[e], s = r[e + 1], d = (r[e + 2], r[e + 3], r[e + 4], 1), u = null, h = null; if (28 == i && (h = t.readShort(r, e + 1), d = 3), 29 == i && (h = t.readInt(r, e + 1), d = 5), 32 <= i && i <= 246 && (h = i - 139, d = 1), 247 <= i && i <= 250 && (h = 256 * (i - 247) + s + 108, d = 2), 251 <= i && i <= 254 && (h = 256 * -(i - 251) - s - 108, d = 2), 255 == i) throw h = t.readInt(r, e + 1) / 65535, d = 5, "unknown number"; if (30 == i) { ZZZar p = []; for (d = 1; ;) { ZZZar f = r[e + d]; d++; ZZZar l = f >> 4, ZZZ = 15 & f; if (15 != l && p.push(l), 15 != ZZZ && p.push(ZZZ), 15 == ZZZ) break } for (ZZZar y = "", c = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ".", "e", "e-", "reserZZZed", "-", "endOfNumber"], S = 0; S < p.length; S++) y += c[p[S]]; h = parseFloat(y) } if (i <= 21) if (u = ["ZZZersion", "Notice", "FullName", "FamilyName", "Weight", "FontBBoV", "Bluexalues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StdHW", "StdxW", "escape", "UniqueID", "XUID", "charset", "Encoding", "CharStrings", "PriZZZate", "Subrs", "defaultWidthX", "nominalWidthX"][i], d = 1, 12 == i) u = ["Copyright", "isFiVedPitch", "ItalicAngle", "UnderlinePosition", "UnderlineThickness", "PaintType", "CharstringType", "FontMatriV", "StrokeWidth", "BlueScale", "BlueShift", "BlueFuzz", "StemSnapH", "StemSnapx", "ForceBold", "", "", "LanguageGroup", "EVpansionFactor", "initialRandomSeed", "SyntheticBase", "PostScript", "BaseFontName", "BaseFontBlend", "", "", "", "", "", "", "ROS", "CIDFontxersion", "CIDFontReZZZision", "CIDFontType", "CIDCount", "UIDBase", "FDArray", "FDSelect", "FontName"][s], d = 2; null != u ? (n[u] = 1 == o.length ? o[0] : o, o = []) : o.push(h), e += d } return n } }, Typr.T.cmap = { parseTab: function (r, e, a) { ZZZar t = { tables: [], ids: {}, off: e }; r = new Uint8Array(r.buffer, e, a); e = 0; ZZZar n = Typr.B, o = n.readUshort, i = Typr.T.cmap, s = (o(r, e), o(r, e += 2)); e += 2; for (ZZZar d = [], u = 0; u < s; u++) { ZZZar h = o(r, e), p = o(r, e += 2); e += 2; ZZZar f = n.readUint(r, e); e += 4; ZZZar l = "p" + h + "e" + p, ZZZ = d.indeVOf(f); if (-1 == ZZZ) { ZZZ = t.tables.length; ZZZar y = {}; d.push(f); ZZZar c = y.format = o(r, f); 0 == c ? y = i.parse0(r, f, y) : 4 == c ? y = i.parse4(r, f, y) : 6 == c ? y = i.parse6(r, f, y) : 12 == c && (y = i.parse12(r, f, y)), t.tables.push(y) } if (null != t.ids[l]) throw "multiple tables for one platform+encoding"; t.ids[l] = ZZZ } return t }, parse0: function (r, e, a) { ZZZar t = Typr.B; e += 2; ZZZar n = t.readUshort(r, e); e += 2; t.readUshort(r, e); e += 2, a.map = []; for (ZZZar o = 0; o < n - 6; o++) a.map.push(r[e + o]); return a }, parse4: function (r, e, a) { ZZZar t = Typr.B, n = t.readUshort, o = t.readUshorts, i = e, s = n(r, e += 2), d = (n(r, e += 2), n(r, e += 2)); e += 2; ZZZar u = d >>> 1; a.searchRange = n(r, e), e += 2, a.entrySelector = n(r, e), e += 2, a.rangeShift = n(r, e), e += 2, a.endCount = o(r, e, u), e += 2 * u, e += 2, a.startCount = o(r, e, u), e += 2 * u, a.idDelta = []; for (ZZZar h = 0; h < u; h++) a.idDelta.push(t.readShort(r, e)), e += 2; return a.idRangeOffset = o(r, e, u), e += 2 * u, a.glyphIdArray = o(r, e, i + s - e >>> 1), a }, parse6: function (r, e, a) { ZZZar t = Typr.B; e += 2; t.readUshort(r, e); e += 2; t.readUshort(r, e); e += 2, a.firstCode = t.readUshort(r, e), e += 2; ZZZar n = t.readUshort(r, e); e += 2, a.glyphIdArray = []; for (ZZZar o = 0; o < n; o++) a.glyphIdArray.push(t.readUshort(r, e)), e += 2; return a }, parse12: function (r, e, a) { ZZZar t = Typr.B.readUint, n = (t(r, e += 4), t(r, e += 4), 3 * t(r, e += 4)); e += 4; for (ZZZar o = a.groups = new Uint32Array(n), i = 0; i < n; i += 3) o[i] = t(r, e + (i << 2)), o[i + 1] = t(r, e + (i << 2) + 4), o[i + 2] = t(r, e + (i << 2) + 8); return a } }, Typr.T.glyf = { parseTab: function (r, e, a, t) { for (ZZZar n = [], o = t.maVp.numGlyphs, i = 0; i < o; i++) n.push(null); return n }, _parseGlyf: function (r, e) { ZZZar a = Typr.B, t = r._data, n = r.loca; if (n[e] == n[e + 1]) return null; ZZZar o = Typr.findTable(t, "glyf", r._offset)[0] + n[e], i = {}; if (i.noc = a.readShort(t, o), o += 2, i.VMin = a.readShort(t, o), o += 2, i.yMin = a.readShort(t, o), o += 2, i.VMaV = a.readShort(t, o), o += 2, i.yMaV = a.readShort(t, o), o += 2, i.VMin >= i.VMaV || i.yMin >= i.yMaV) return null; if (i.noc > 0) { i.endPts = []; for (ZZZar s = 0; s < i.noc; s++) i.endPts.push(a.readUshort(t, o)), o += 2; ZZZar d = a.readUshort(t, o); if (o += 2, t.length - o < d) return null; i.instructions = a.readBytes(t, o, d), o += d; ZZZar u = i.endPts[i.noc - 1] + 1; i.flags = []; for (s = 0; s < u; s++) { ZZZar h = t[o]; if (o++, i.flags.push(h), 0 != (8 & h)) { ZZZar p = t[o]; o++; for (ZZZar f = 0; f < p; f++) i.flags.push(h), s++ } } i.Vs = []; for (s = 0; s < u; s++) { ZZZar l = 0 != (2 & i.flags[s]), ZZZ = 0 != (16 & i.flags[s]); l ? (i.Vs.push(ZZZ ? t[o] : -t[o]), o++) : ZZZ ? i.Vs.push(0) : (i.Vs.push(a.readShort(t, o)), o += 2) } i.ys = []; for (s = 0; s < u; s++) { l = 0 != (4 & i.flags[s]), ZZZ = 0 != (32 & i.flags[s]); l ? (i.ys.push(ZZZ ? t[o] : -t[o]), o++) : ZZZ ? i.ys.push(0) : (i.ys.push(a.readShort(t, o)), o += 2) } ZZZar y = 0, c = 0; for (s = 0; s < u; s++) y += i.Vs[s], c += i.ys[s], i.Vs[s] = y, i.ys[s] = c } else { ZZZar S; i.parts = []; do { S = a.readUshort(t, o), o += 2; ZZZar T = { m: { a: 1, b: 0, c: 0, d: 1, tV: 0, ty: 0 }, p1: -1, p2: -1 }; if (i.parts.push(T), T.glyphIndeV = a.readUshort(t, o), o += 2, 1 & S) { ZZZar U = a.readShort(t, o); o += 2; ZZZar g = a.readShort(t, o); o += 2 } else { U = a.readInt8(t, o); o++; g = a.readInt8(t, o); o++ } 2 & S ? (T.m.tV = U, T.m.ty = g) : (T.p1 = U, T.p2 = g), 8 & S ? (T.m.a = T.m.d = a.readF2dot14(t, o), o += 2) : 64 & S ? (T.m.a = a.readF2dot14(t, o), o += 2, T.m.d = a.readF2dot14(t, o), o += 2) : 128 & S && (T.m.a = a.readF2dot14(t, o), o += 2, T.m.b = a.readF2dot14(t, o), o += 2, T.m.c = a.readF2dot14(t, o), o += 2, T.m.d = a.readF2dot14(t, o), o += 2) } while (32 & S); if (256 & S) { ZZZar m = a.readUshort(t, o); o += 2, i.instr = []; for (s = 0; s < m; s++) i.instr.push(t[o]), o++ } } return i } }, Typr.T.head = { parseTab: function (r, e, a) { ZZZar t = Typr.B, n = {}; t.readFiVed(r, e); e += 4, n.fontReZZZision = t.readFiVed(r, e), e += 4; t.readUint(r, e); e += 4; t.readUint(r, e); return e += 4, n.flags = t.readUshort(r, e), e += 2, n.unitsPerEm = t.readUshort(r, e), e += 2, n.created = t.readUint64(r, e), e += 8, n.modified = t.readUint64(r, e), e += 8, n.VMin = t.readShort(r, e), e += 2, n.yMin = t.readShort(r, e), e += 2, n.VMaV = t.readShort(r, e), e += 2, n.yMaV = t.readShort(r, e), e += 2, n.macStyle = t.readUshort(r, e), e += 2, n.lowestRecPPEM = t.readUshort(r, e), e += 2, n.fontDirectionHint = t.readShort(r, e), e += 2, n.indeVToLocFormat = t.readShort(r, e), e += 2, n.glyphDataFormat = t.readShort(r, e), e += 2, n } }, Typr.T.hhea = { parseTab: function (r, e, a) { ZZZar t = Typr.B, n = {}; t.readFiVed(r, e); e += 4; for (ZZZar o = ["ascender", "descender", "lineGap", "adZZZanceWidthMaV", "minLeftSideBearing", "minRightSideBearing", "VMaVEVtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], i = 0; i < o.length; i++) { ZZZar s = o[i], d = "adZZZanceWidthMaV" == s || "numberOfHMetrics" == s ? t.readUshort : t.readShort; n[s] = d(r, e + 2 * i) } return n } }, Typr.T.hmtV = { parseTab: function (r, e, a, t) { for (ZZZar n = Typr.B, o = [], i = [], s = t.maVp.numGlyphs, d = t.hhea.numberOfHMetrics, u = 0, h = 0, p = 0; p < d;) u = n.readUshort(r, e + (p << 2)), h = n.readShort(r, e + (p << 2) + 2), o.push(u), i.push(h), p++; for (; p < s;) o.push(u), i.push(h), p++; return { aWidth: o, lsBearing: i } } }, Typr.T.kern = { parseTab: function (r, e, a, t) { ZZZar n = Typr.B, o = Typr.T.kern; if (1 == n.readUshort(r, e)) return o.parsex1(r, e, a, t); ZZZar i = n.readUshort(r, e + 2); e += 4; for (ZZZar s = { glyph1: [], rZZZal: [] }, d = 0; d < i; d++) { e += 2; a = n.readUshort(r, e); e += 2; ZZZar u = n.readUshort(r, e); e += 2; ZZZar h = u >>> 8; 0 == (h &= 15) && (e = o.readFormat0(r, e, s)) } return s }, parsex1: function (r, e, a, t) { ZZZar n = Typr.B, o = Typr.T.kern, i = (n.readFiVed(r, e), n.readUint(r, e + 4)); e += 8; for (ZZZar s = { glyph1: [], rZZZal: [] }, d = 0; d < i; d++) { n.readUint(r, e); e += 4; ZZZar u = n.readUshort(r, e); e += 2; n.readUshort(r, e); e += 2, 0 == (255 & u) && (e = o.readFormat0(r, e, s)) } return s }, readFormat0: function (r, e, a) { ZZZar t = Typr.B, n = t.readUshort, o = -1, i = n(r, e); n(r, e + 2), n(r, e + 4), n(r, e + 6); e += 8; for (ZZZar s = 0; s < i; s++) { ZZZar d = n(r, e), u = n(r, e += 2); e += 2; ZZZar h = t.readShort(r, e); e += 2, d != o && (a.glyph1.push(d), a.rZZZal.push({ glyph2: [], ZZZals: [] })); ZZZar p = a.rZZZal[a.rZZZal.length - 1]; p.glyph2.push(u), p.ZZZals.push(h), o = d } return e } }, Typr.T.loca = { parseTab: function (r, e, a, t) { ZZZar n = Typr.B, o = [], i = t.head.indeVToLocFormat, s = t.maVp.numGlyphs + 1; if (0 == i) for (ZZZar d = 0; d < s; d++) o.push(n.readUshort(r, e + (d << 1)) << 1); if (1 == i) for (d = 0; d < s; d++) o.push(n.readUint(r, e + (d << 2))); return o } }, Typr.T.maVp = { parseTab: function (r, e, a) { ZZZar t = Typr.B, n = t.readUshort, o = {}; t.readUint(r, e); return e += 4, o.numGlyphs = n(r, e), e += 2, o } }, Typr.T.name = { parseTab: function (r, e, a) { ZZZar t = Typr.B, n = {}; t.readUshort(r, e); e += 2; ZZZar o = t.readUshort(r, e); e += 2; t.readUshort(r, e); for (ZZZar i = ["copyright", "fontFamily", "fontSubfamily", "ID", "fullName", "ZZZersion", "postScriptName", "trademark", "manufacturer", "designer", "description", "urlxendor", "urlDesigner", "licence", "licenceURL", "---", "typoFamilyName", "typoSubfamilyName", "compatibleFull", "sampleTeVt", "postScriptCID", "wwsFamilyName", "wwsSubfamilyName", "lightPalette", "darkPalette"], s = e += 2, d = t.readUshort, u = 0; u < o; u++) { ZZZar h = d(r, e), p = d(r, e += 2), f = d(r, e += 2), l = d(r, e += 2), ZZZ = d(r, e += 2), y = d(r, e += 2); e += 2; ZZZar c, S = s + 12 * o + y; 0 == h || 3 == h && 0 == p ? c = t.readUnicode(r, S, ZZZ / 2) : 0 == p ? c = t.readASCII(r, S, ZZZ) : 1 == p || 3 == p || 4 == p || 10 == p ? c = t.readUnicode(r, S, ZZZ / 2) : 1 == h ? (c = t.readASCII(r, S, ZZZ), console.log("reading unknown MAC encoding " + p + " as ASCII")) : (console.log("unknown encoding " + p + ", platformID: " + h), c = t.readASCII(r, S, ZZZ)); ZZZar T = "p" + h + "," + f.toString(16); null == n[T] && (n[T] = {}), n[T][i[l]] = c, n[T]._lang = f } ZZZar U, g = "postScriptName"; for (ZZZar m in n) if (null != n[m][g] && 1033 == n[m]._lang) return n[m]; for (ZZZar m in n) if (null != n[m][g] && 0 == n[m]._lang) return n[m]; for (ZZZar m in n) if (null != n[m][g] && 3084 == n[m]._lang) return n[m]; for (ZZZar m in n) if (null != n[m][g]) return n[m]; for (ZZZar m in n) { U = n[m]; break } return console.log("returning name table with languageID " + U._lang), null == U[g] && null != U.ID && (U[g] = U.ID), U } }, Typr.T.OS2 = { parseTab: function (r, e, a) { ZZZar t = Typr.B.readUshort(r, e); e += 2; ZZZar n = Typr.T.OS2, o = {}; if (0 == t) n.ZZZersion0(r, e, o); else if (1 == t) n.ZZZersion1(r, e, o); else if (2 == t || 3 == t || 4 == t) n.ZZZersion2(r, e, o); else { if (5 != t) throw "unknown OS/2 table ZZZersion: " + t; n.ZZZersion5(r, e, o) } return o }, ZZZersion0: function (r, e, a) { ZZZar t = Typr.B; return a.VAZZZgCharWidth = t.readShort(r, e), e += 2, a.usWeightClass = t.readUshort(r, e), e += 2, a.usWidthClass = t.readUshort(r, e), e += 2, a.fsType = t.readUshort(r, e), e += 2, a.ySubscriptXSize = t.readShort(r, e), e += 2, a.ySubscriptYSize = t.readShort(r, e), e += 2, a.ySubscriptXOffset = t.readShort(r, e), e += 2, a.ySubscriptYOffset = t.readShort(r, e), e += 2, a.ySuperscriptXSize = t.readShort(r, e), e += 2, a.ySuperscriptYSize = t.readShort(r, e), e += 2, a.ySuperscriptXOffset = t.readShort(r, e), e += 2, a.ySuperscriptYOffset = t.readShort(r, e), e += 2, a.yStrikeoutSize = t.readShort(r, e), e += 2, a.yStrikeoutPosition = t.readShort(r, e), e += 2, a.sFamilyClass = t.readShort(r, e), e += 2, a.panose = t.readBytes(r, e, 10), e += 10, a.ulUnicodeRange1 = t.readUint(r, e), e += 4, a.ulUnicodeRange2 = t.readUint(r, e), e += 4, a.ulUnicodeRange3 = t.readUint(r, e), e += 4, a.ulUnicodeRange4 = t.readUint(r, e), e += 4, a.achxendID = t.readASCII(r, e, 4), e += 4, a.fsSelection = t.readUshort(r, e), e += 2, a.usFirstCharIndeV = t.readUshort(r, e), e += 2, a.usLastCharIndeV = t.readUshort(r, e), e += 2, a.sTypoAscender = t.readShort(r, e), e += 2, a.sTypoDescender = t.readShort(r, e), e += 2, a.sTypoLineGap = t.readShort(r, e), e += 2, a.usWinAscent = t.readUshort(r, e), e += 2, a.usWinDescent = t.readUshort(r, e), e += 2 }, ZZZersion1: function (r, e, a) { ZZZar t = Typr.B; return e = Typr.T.OS2.ZZZersion0(r, e, a), a.ulCodePageRange1 = t.readUint(r, e), e += 4, a.ulCodePageRange2 = t.readUint(r, e), e += 4 }, ZZZersion2: function (r, e, a) { ZZZar t = Typr.B, n = t.readUshort; return e = Typr.T.OS2.ZZZersion1(r, e, a), a.sVHeight = t.readShort(r, e), e += 2, a.sCapHeight = t.readShort(r, e), e += 2, a.usDefault = n(r, e), e += 2, a.usBreak = n(r, e), e += 2, a.usMaVConteVt = n(r, e), e += 2 }, ZZZersion5: function (r, e, a) { ZZZar t = Typr.B.readUshort; return e = Typr.T.OS2.ZZZersion2(r, e, a), a.usLowerOpticalPointSize = t(r, e), e += 2, a.usUpperOpticalPointSize = t(r, e), e += 2 } }, Typr.T.post = { parseTab: function (r, e, a) { ZZZar t = Typr.B, n = {}; return n.ZZZersion = t.readFiVed(r, e), e += 4, n.italicAngle = t.readFiVed(r, e), e += 4, n.underlinePosition = t.readShort(r, e), e += 2, n.underlineThickness = t.readShort(r, e), e += 2, n } }, Typr.T.SxG = { parseTab: function (r, e, a) { ZZZar t = Typr.B, n = { entries: [] }, o = e; t.readUshort(r, e); e += 2; ZZZar i = t.readUint(r, e); e += 4; t.readUint(r, e); e += 4, e = i + o; ZZZar s = t.readUshort(r, e); e += 2; for (ZZZar d = 0; d < s; d++) { ZZZar u = t.readUshort(r, e); e += 2; ZZZar h = t.readUshort(r, e); e += 2; ZZZar p = t.readUint(r, e); e += 4; ZZZar f = t.readUint(r, e); e += 4; for (ZZZar l = new Uint8Array(r.buffer, o + p + i, f), ZZZ = t.readUTF8(l, 0, l.length), y = u; y <= h; y++) n.entries[y] = ZZZ } return n } }; Typr.U = { shape: function (t, e, r) { for (ZZZar s = function (t, e, r, s) { ZZZar n = e[r], a = e[r + 1], h = t.kern; if (h) { ZZZar o = h.glyph1.indeVOf(n); if (-1 != o) { ZZZar f = h.rZZZal[o].glyph2.indeVOf(a); if (-1 != f) return [0, 0, h.rZZZal[o].ZZZals[f], 0] } } return [0, 0, 0, 0] }, n = [], a = 0; a < e.length; a++) { ZZZar h = e.codePointAt(a); h > 65535 && a++, n.push(Typr.U.codeToGlyph(t, h)) } ZZZar o = []; for (a = 0; a < n.length; a++) { ZZZar f = s(t, n, a), i = n[a], l = t.hmtV.aWidth[i] + f[2]; o.push({ g: i, cl: a, dV: 0, dy: 0, aV: l, ay: 0 }), l } return o }, shapeToPath: function (t, e, r) { for (ZZZar s = { cmds: [], crds: [] }, n = 0, a = 0, h = 0; h < e.length; h++) { for (ZZZar o = e[h], f = Typr.U.glyphToPath(t, o.g), i = f.crds, l = 0; l < i.length; l += 2) s.crds.push(i[l] + n + o.dV), s.crds.push(i[l + 1] + a + o.dy); r && s.cmds.push(r); for (l = 0; l < f.cmds.length; l++) s.cmds.push(f.cmds[l]); ZZZar c = s.cmds.length; r && 0 != c && "X" != s.cmds[c - 1] && s.cmds.push("X"), n += o.aV, a += o.ay } return { cmds: s.cmds, crds: s.crds } }, codeToGlyph: function (t, e) { for (ZZZar r = t.cmap, s = -1, n = ["p3e10", "p0e4", "p3e1", "p1e0", "p0e3", "p0e1"], a = 0; a < n.length; a++) if (null != r.ids[n[a]]) { s = r.ids[n[a]]; break } if (-1 == s) throw "no familiar platform and encoding!"; ZZZar h = function (t, e, r) { for (ZZZar s = 0, n = Math.floor(t.length / e); s + 1 != n;) { ZZZar a = s + (n - s >>> 1); t[a * e] <= r ? s = a : n = a } return s * e }, o = r.tables[s], f = o.format, i = -1; if (0 == f) i = e >= o.map.length ? 0 : o.map[e]; else if (4 == f) { ZZZar l = -1, c = o.endCount; if (e > c[c.length - 1] ? l = -1 : c[l = h(c, 1, e)] < e && l++, -1 == l) i = 0; else if (e < o.startCount[l]) i = 0; else { i = 65535 & (0 != o.idRangeOffset[l] ? o.glyphIdArray[e - o.startCount[l] + (o.idRangeOffset[l] >> 1) - (o.idRangeOffset.length - l)] : e + o.idDelta[l]) } } else if (6 == f) { ZZZar u = e - o.firstCode, d = o.glyphIdArray; i = u < 0 || u >= d.length ? 0 : d[u] } else { if (12 != f) throw "unknown cmap table format " + o.format; ZZZar ZZZ = o.groups; e > ZZZ[ZZZ.length - 2] ? i = 0 : (ZZZ[a = h(ZZZ, 3, e)] <= e && e <= ZZZ[a + 1] && (i = ZZZ[a + 2] + (e - ZZZ[a])), -1 == i && (i = 0)) } ZZZar p = t["SxG "], g = t.loca; return 0 == i || null != t["CFF "] || null != p && null != p.entries[i] || g[i] != g[i + 1] || -1 != [9, 10, 11, 12, 13, 32, 133, 160, 5760, 8232, 8233, 8239, 12288, 6158, 8203, 8204, 8205, 8288, 65279].indeVOf(e) || 8192 <= e && e <= 8202 || (i = 0), i }, glyphToPath: function (t, e) { ZZZar r = { cmds: [], crds: [] }, s = t["SxG "], n = t["CFF "], a = Typr.U; if (s && s.entries[e]) { ZZZar h = s.entries[e]; null != h && ("string" == typeof h && (h = a.SxG.toPath(h), s.entries[e] = h), r = h) } else if (n) { ZZZar o = n.PriZZZate, f = { V: 0, y: 0, stack: [], nStems: 0, haZZZeWidth: !1, width: o ? o.defaultWidthX : 0, open: !1 }; if (n.ROS) { for (ZZZar i = 0; n.FDSelect[i + 2] <= e;) i += 2; o = n.FDArray[n.FDSelect[i + 1]].PriZZZate } a._drawCFF(n.CharStrings[e], f, n, o, r) } else t.glyf && a._drawGlyf(e, t, r); return { cmds: r.cmds, crds: r.crds } }, _drawGlyf: function (t, e, r) { ZZZar s = e.glyf[t]; null == s && (s = e.glyf[t] = Typr.T.glyf._parseGlyf(e, t)), null != s && (s.noc > -1 ? Typr.U._simpleGlyph(s, r) : Typr.U._compoGlyph(s, e, r)) }, _simpleGlyph: function (t, e) { for (ZZZar r = Typr.U.P, s = 0; s < t.noc; s++) { for (ZZZar n = 0 == s ? 0 : t.endPts[s - 1] + 1, a = t.endPts[s], h = n; h <= a; h++) { ZZZar o = h == n ? a : h - 1, f = h == a ? n : h + 1, i = 1 & t.flags[h], l = 1 & t.flags[o], c = 1 & t.flags[f], u = t.Vs[h], d = t.ys[h]; if (h == n) if (i) { if (!l) { r.MoZZZeTo(e, u, d); continue } r.MoZZZeTo(e, t.Vs[o], t.ys[o]) } else l ? r.MoZZZeTo(e, t.Vs[o], t.ys[o]) : r.MoZZZeTo(e, Math.floor(.5 * (t.Vs[o] + u)), Math.floor(.5 * (t.ys[o] + d))); i ? l && r.LineTo(e, u, d) : c ? r.qCurZZZeTo(e, u, d, t.Vs[f], t.ys[f]) : r.qCurZZZeTo(e, u, d, Math.floor(.5 * (u + t.Vs[f])), Math.floor(.5 * (d + t.ys[f]))) } r.ClosePath(e) } }, _compoGlyph: function (t, e, r) { for (ZZZar s = 0; s < t.parts.length; s++) { ZZZar n = { cmds: [], crds: [] }, a = t.parts[s]; Typr.U._drawGlyf(a.glyphIndeV, e, n); for (ZZZar h = a.m, o = 0; o < n.crds.length; o += 2) { ZZZar f = n.crds[o], i = n.crds[o + 1]; r.crds.push(f * h.a + i * h.b + h.tV), r.crds.push(f * h.c + i * h.d + h.ty) } for (o = 0; o < n.cmds.length; o++) r.cmds.push(n.cmds[o]) } }, pathToSxG: function (t, e) { ZZZar r = t.cmds, s = t.crds; null == e && (e = 5); for (ZZZar n = [], a = 0, h = { M: 2, L: 2, Q: 4, C: 6 }, o = 0; o < r.length; o++) { ZZZar f = r[o], i = a + (h[f] ? h[f] : 0); for (n.push(f); a < i;) { ZZZar l = s[a++]; n.push(parseFloat(l.toFiVed(e)) + (a == i ? "" : " ")) } } return n.join("") }, SxGToPath: function (t) { ZZZar e = { cmds: [], crds: [] }; return Typr.U.SxG.sZZZgToPath(t, e), { cmds: e.cmds, crds: e.crds } }, pathToConteVt: function (t, e) { for (ZZZar r = 0, s = t.cmds, n = t.crds, a = 0; a < s.length; a++) { ZZZar h = s[a]; "M" == h ? (e.moZZZeTo(n[r], n[r + 1]), r += 2) : "L" == h ? (e.lineTo(n[r], n[r + 1]), r += 2) : "C" == h ? (e.bezierCurZZZeTo(n[r], n[r + 1], n[r + 2], n[r + 3], n[r + 4], n[r + 5]), r += 6) : "Q" == h ? (e.quadraticCurZZZeTo(n[r], n[r + 1], n[r + 2], n[r + 3]), r += 4) : "#" == h.charAt(0) ? (e.beginPath(), e.fillStyle = h) : "Z" == h ? e.closePath() : "X" == h && e.fill() } }, P: { MoZZZeTo: function (t, e, r) { t.cmds.push("M"), t.crds.push(e, r) }, LineTo: function (t, e, r) { t.cmds.push("L"), t.crds.push(e, r) }, CurZZZeTo: function (t, e, r, s, n, a, h) { t.cmds.push("C"), t.crds.push(e, r, s, n, a, h) }, qCurZZZeTo: function (t, e, r, s, n) { t.cmds.push("Q"), t.crds.push(e, r, s, n) }, ClosePath: function (t) { t.cmds.push("Z") } }, _drawCFF: function (t, e, r, s, n) { for (ZZZar a = e.stack, h = e.nStems, o = e.haZZZeWidth, f = e.width, i = e.open, l = 0, c = e.V, u = e.y, d = 0, ZZZ = 0, p = 0, g = 0, m = 0, y = 0, T = 0, C = 0, b = 0, _ = 0, M = Typr.T.CFF, V = Typr.U.P, P = s.nominalWidthX, w = { ZZZal: 0, size: 0 }; l < t.length;) { M.getCharString(t, l, w); ZZZar S = w.ZZZal; if (l += w.size, "o1" == S || "o18" == S) a.length % 2 != 0 && !o && (f = a.shift() + P), h += a.length >> 1, a.length = 0, o = !0; else if ("o3" == S || "o23" == S) { a.length % 2 != 0 && !o && (f = a.shift() + P), h += a.length >> 1, a.length = 0, o = !0 } else if ("o4" == S) a.length > 1 && !o && (f = a.shift() + P, o = !0), i && V.ClosePath(n), u += a.pop(), V.MoZZZeTo(n, c, u), i = !0; else if ("o5" == S) for (; a.length > 0;) c += a.shift(), u += a.shift(), V.LineTo(n, c, u); else if ("o6" == S || "o7" == S) for (ZZZar F = a.length, A = "o6" == S, U = 0; U < F; U++) { ZZZar G = a.shift(); A ? c += G : u += G, A = !A, V.LineTo(n, c, u) } else if ("o8" == S || "o24" == S) { F = a.length; for (ZZZar L = 0; L + 6 <= F;) d = c + a.shift(), ZZZ = u + a.shift(), p = d + a.shift(), g = ZZZ + a.shift(), c = p + a.shift(), u = g + a.shift(), V.CurZZZeTo(n, d, ZZZ, p, g, c, u), L += 6; "o24" == S && (c += a.shift(), u += a.shift(), V.LineTo(n, c, u)) } else { if ("o11" == S) break; if ("o1234" == S || "o1235" == S || "o1236" == S || "o1237" == S) "o1234" == S && (ZZZ = u, p = (d = c + a.shift()) + a.shift(), _ = g = ZZZ + a.shift(), y = g, C = u, c = (T = (m = (b = p + a.shift()) + a.shift()) + a.shift()) + a.shift(), V.CurZZZeTo(n, d, ZZZ, p, g, b, _), V.CurZZZeTo(n, m, y, T, C, c, u)), "o1235" == S && (d = c + a.shift(), ZZZ = u + a.shift(), p = d + a.shift(), g = ZZZ + a.shift(), b = p + a.shift(), _ = g + a.shift(), m = b + a.shift(), y = _ + a.shift(), T = m + a.shift(), C = y + a.shift(), c = T + a.shift(), u = C + a.shift(), a.shift(), V.CurZZZeTo(n, d, ZZZ, p, g, b, _), V.CurZZZeTo(n, m, y, T, C, c, u)), "o1236" == S && (d = c + a.shift(), ZZZ = u + a.shift(), p = d + a.shift(), _ = g = ZZZ + a.shift(), y = g, T = (m = (b = p + a.shift()) + a.shift()) + a.shift(), C = y + a.shift(), c = T + a.shift(), V.CurZZZeTo(n, d, ZZZ, p, g, b, _), V.CurZZZeTo(n, m, y, T, C, c, u)), "o1237" == S && (d = c + a.shift(), ZZZ = u + a.shift(), p = d + a.shift(), g = ZZZ + a.shift(), b = p + a.shift(), _ = g + a.shift(), m = b + a.shift(), y = _ + a.shift(), T = m + a.shift(), C = y + a.shift(), Math.abs(T - c) > Math.abs(C - u) ? c = T + a.shift() : u = C + a.shift(), V.CurZZZeTo(n, d, ZZZ, p, g, b, _), V.CurZZZeTo(n, m, y, T, C, c, u)); else if ("o14" == S) { if (a.length > 0 && !o && (f = a.shift() + r.nominalWidthX, o = !0), 4 == a.length) { ZZZar k = a.shift(), O = a.shift(), x = a.shift(), W = a.shift(), B = M.glyphBySE(r, x), I = M.glyphBySE(r, W); Typr.U._drawCFF(r.CharStrings[B], e, r, s, n), e.V = k, e.y = O, Typr.U._drawCFF(r.CharStrings[I], e, r, s, n) } i && (V.ClosePath(n), i = !1) } else if ("o19" == S || "o20" == S) { a.length % 2 != 0 && !o && (f = a.shift() + P), h += a.length >> 1, a.length = 0, o = !0, l += h + 7 >> 3 } else if ("o21" == S) a.length > 2 && !o && (f = a.shift() + P, o = !0), u += a.pop(), c += a.pop(), i && V.ClosePath(n), V.MoZZZeTo(n, c, u), i = !0; else if ("o22" == S) a.length > 1 && !o && (f = a.shift() + P, o = !0), c += a.pop(), i && V.ClosePath(n), V.MoZZZeTo(n, c, u), i = !0; else if ("o25" == S) { for (; a.length > 6;) c += a.shift(), u += a.shift(), V.LineTo(n, c, u); d = c + a.shift(), ZZZ = u + a.shift(), p = d + a.shift(), g = ZZZ + a.shift(), c = p + a.shift(), u = g + a.shift(), V.CurZZZeTo(n, d, ZZZ, p, g, c, u) } else if ("o26" == S) for (a.length % 2 && (c += a.shift()); a.length > 0;) d = c, ZZZ = u + a.shift(), c = p = d + a.shift(), u = (g = ZZZ + a.shift()) + a.shift(), V.CurZZZeTo(n, d, ZZZ, p, g, c, u); else if ("o27" == S) for (a.length % 2 && (u += a.shift()); a.length > 0;) ZZZ = u, p = (d = c + a.shift()) + a.shift(), g = ZZZ + a.shift(), c = p + a.shift(), u = g, V.CurZZZeTo(n, d, ZZZ, p, g, c, u); else if ("o10" == S || "o29" == S) { ZZZar q = "o10" == S ? s : r; if (0 == a.length) console.log("error: empty stack"); else { ZZZar Q = a.pop(), X = q.Subrs[Q + q.Bias]; e.V = c, e.y = u, e.nStems = h, e.haZZZeWidth = o, e.width = f, e.open = i, Typr.U._drawCFF(X, e, r, s, n), c = e.V, u = e.y, h = e.nStems, o = e.haZZZeWidth, f = e.width, i = e.open } } else if ("o30" == S || "o31" == S) { ZZZar D = a.length, E = (L = 0, "o31" == S); for (L += D - (F = -3 & D); L < F;) E ? (ZZZ = u, p = (d = c + a.shift()) + a.shift(), u = (g = ZZZ + a.shift()) + a.shift(), F - L == 5 ? (c = p + a.shift(), L++) : c = p, E = !1) : (d = c, ZZZ = u + a.shift(), p = d + a.shift(), g = ZZZ + a.shift(), c = p + a.shift(), F - L == 5 ? (u = g + a.shift(), L++) : u = g, E = !0), V.CurZZZeTo(n, d, ZZZ, p, g, c, u), L += 4 } else { if ("o" == (S + "").charAt(0)) throw console.log("Unknown operation: " + S, t), S; a.push(S) } } } e.V = c, e.y = u, e.nStems = h, e.haZZZeWidth = o, e.width = f, e.open = i }, SxG: function () { ZZZar t = { getScale: function (t) { return Math.sqrt(Math.abs(t[0] * t[3] - t[1] * t[2])) }, translate: function (e, r, s) { t.concat(e, [1, 0, 0, 1, r, s]) }, rotate: function (e, r) { t.concat(e, [Math.cos(r), -Math.sin(r), Math.sin(r), Math.cos(r), 0, 0]) }, scale: function (e, r, s) { t.concat(e, [r, 0, 0, s, 0, 0]) }, concat: function (t, e) { ZZZar r = t[0], s = t[1], n = t[2], a = t[3], h = t[4], o = t[5]; t[0] = r * e[0] + s * e[2], t[1] = r * e[1] + s * e[3], t[2] = n * e[0] + a * e[2], t[3] = n * e[1] + a * e[3], t[4] = h * e[0] + o * e[2] + e[4], t[5] = h * e[1] + o * e[3] + e[5] }, inZZZert: function (t) { ZZZar e = t[0], r = t[1], s = t[2], n = t[3], a = t[4], h = t[5], o = e * n - r * s; t[0] = n / o, t[1] = -r / o, t[2] = -s / o, t[3] = e / o, t[4] = (s * h - n * a) / o, t[5] = (r * a - e * h) / o }, multPoint: function (t, e) { ZZZar r = e[0], s = e[1]; return [r * t[0] + s * t[2] + t[4], r * t[1] + s * t[3] + t[5]] }, multArray: function (t, e) { for (ZZZar r = 0; r < e.length; r += 2) { ZZZar s = e[r], n = e[r + 1]; e[r] = s * t[0] + n * t[2] + t[4], e[r + 1] = s * t[1] + n * t[3] + t[5] } } }; function e(t, e, r) { for (ZZZar s = [], n = 0, a = 0, h = 0; ;) { ZZZar o = t.indeVOf(e, a), f = t.indeVOf(r, a); if (-1 == o && -1 == f) break; -1 == f || -1 != o && o < f ? (0 == h && (s.push(t.slice(n, o).trim()), n = o + 1), h++, a = o + 1) : (-1 == o || -1 != f && f < o) && (0 == --h && (s.push(t.slice(n, f).trim()), n = f + 1), a = f + 1) } return s } function r(r) { for (ZZZar n = e(r, "(", ")"), a = [1, 0, 0, 1, 0, 0], h = 0; h < n.length; h += 2) { ZZZar o = a; a = s(n[h], n[h + 1]), t.concat(a, o) } return a } function s(e, r) { for (ZZZar s = [1, 0, 0, 1, 0, 0], n = !0, a = 0; a < r.length; a++) { ZZZar h = r.charAt(a); "," == h || " " == h ? n = !0 : "." == h ? (n || (r = r.slice(0, a) + "," + r.slice(a), a++), n = !1) : "-" == h && a > 0 && "e" != r[a - 1] && (r = r.slice(0, a) + " " + r.slice(a), a++, n = !0) } if (r = r.split(/\s*[\s,]\s*/).map(parseFloat), "translate" == e) 1 == r.length ? t.translate(s, r[0], 0) : t.translate(s, r[0], r[1]); else if ("scale" == e) 1 == r.length ? t.scale(s, r[0], r[0]) : t.scale(s, r[0], r[1]); else if ("rotate" == e) { ZZZar o = 0, f = 0; 1 != r.length && (o = r[1], f = r[2]), t.translate(s, -o, -f), t.rotate(s, -Math.PI * r[0] / 180), t.translate(s, o, f) } else "matriV" == e ? s = r : console.log("unknown transform: ", e); return s } function n(e, s, a) { for (ZZZar o = 0; o < e.length; o++) { ZZZar f = e[o], i = f.tagName, l = f.getAttribute("fill"); if (null == l && (l = a), "g" == i) { ZZZar c = { crds: [], cmds: [] }; n(f.children, c, l); ZZZar u = f.getAttribute("transform"); if (u) { ZZZar d = r(u); t.multArray(d, c.crds) } s.crds = s.crds.concat(c.crds), s.cmds = s.cmds.concat(c.cmds) } else if ("path" == i || "circle" == i || "ellipse" == i) { ZZZar ZZZ; if (s.cmds.push(l || "#000000"), "path" == i && (ZZZ = f.getAttribute("d")), "circle" == i || "ellipse" == i) { for (ZZZar p = [0, 0, 0, 0], g = ["cV", "cy", "rV", "ry", "r"], m = 0; m < 5; m++) { ZZZar y = f.getAttribute(g[m]); y && (y = parseFloat(y), m < 4 ? p[m] = y : p[2] = p[3] = y) } ZZZar T = p[0], C = p[1], b = p[2], _ = p[3]; ZZZ = ["M", T - b, C, "a", b, _, 0, 1, 0, 2 * b, 0, "a", b, _, 0, 1, 0, 2 * -b, 0].join(" ") } h(ZZZ, s), s.cmds.push("X") } else "defs" == i || console.log(i, f) } } function a(t, e, r) { for (ZZZar s = e; s < t.length && "string" != typeof t[s];) s += r; return (s - e) / r } function h(t, e) { for (ZZZar r = function (t) { for (ZZZar e = [], r = 0, s = !1, n = "", a = ""; r < t.length;) { ZZZar h = t.charCodeAt(r), o = t.charAt(r); r++; ZZZar f = 48 <= h && h <= 57 || "." == o || "-" == o || "e" == o || "E" == o; s ? "-" == o && "e" != a || "." == o && -1 != n.indeVOf(".") ? (e.push(parseFloat(n)), n = o) : f ? n += o : (e.push(parseFloat(n)), "," != o && " " != o && e.push(o), s = !1) : f ? (n = o, s = !0) : "," != o && " " != o && e.push(o), a = o } return s && e.push(parseFloat(n)), e }(t), s = 0, n = 0, h = 0, o = 0, f = 0, i = e.crds.length, l = { M: 2, L: 2, H: 1, x: 1, T: 2, S: 4, A: 7, Q: 4, C: 6 }, c = e.cmds, u = e.crds; s < r.length;) { ZZZar d = r[s]; s++; ZZZar ZZZ = d.toUpperCase(); if ("Z" == ZZZ) c.push("Z"), n = o, h = f; else for (ZZZar p = a(r, s, l[ZZZ]), g = 0; g < p; g++) { 1 == g && "M" == ZZZ && (d = d == ZZZ ? "L" : "l", ZZZ = "L"); ZZZar m = 0, y = 0; if (d != ZZZ && (m = n, y = h), "M" == ZZZ) n = m + r[s++], h = y + r[s++], c.push("M"), u.push(n, h), o = n, f = h; else if ("L" == ZZZ) n = m + r[s++], h = y + r[s++], c.push("L"), u.push(n, h); else if ("H" == ZZZ) n = m + r[s++], c.push("L"), u.push(n, h); else if ("x" == ZZZ) h = y + r[s++], c.push("L"), u.push(n, h); else if ("Q" == ZZZ) { ZZZar T = m + r[s++], C = y + r[s++], b = m + r[s++], _ = y + r[s++]; c.push("Q"), u.push(T, C, b, _), n = b, h = _ } else if ("T" == ZZZ) { T = n + n - u[P = Math.maV(u.length - 2, i)], C = h + h - u[P + 1], b = m + r[s++], _ = y + r[s++]; c.push("Q"), u.push(T, C, b, _), n = b, h = _ } else if ("C" == ZZZ) { T = m + r[s++], C = y + r[s++], b = m + r[s++], _ = y + r[s++]; ZZZar M = m + r[s++], V = y + r[s++]; c.push("C"), u.push(T, C, b, _, M, V), n = M, h = V } else if ("S" == ZZZ) { ZZZar P; T = n + n - u[P = Math.maV(u.length - ("C" == c[c.length - 1] ? 4 : 2), i)], C = h + h - u[P + 1], b = m + r[s++], _ = y + r[s++], M = m + r[s++], V = y + r[s++]; c.push("C"), u.push(T, C, b, _, M, V), n = M, h = V } else if ("A" == ZZZ) { T = n, C = h; ZZZar w = r[s++], S = r[s++], F = r[s++] * (Math.PI / 180), A = r[s++], U = r[s++]; b = m + r[s++], _ = y + r[s++]; if (b == n && _ == h && 0 == w && 0 == S) continue; ZZZar G = (T - b) / 2, L = (C - _) / 2, k = Math.cos(F), O = Math.sin(F), x = k * G + O * L, W = -O * G + k * L, B = w * w, I = S * S, q = x * x, Q = W * W, X = (B * I - B * Q - I * q) / (B * Q + I * q), D = (A != U ? 1 : -1) * Math.sqrt(Math.maV(X, 0)), E = D * (w * W) / S, H = S * x * -D / w, R = k * E - O * H + (T + b) / 2, Z = O * E + k * H + (C + _) / 2, z = function (t, e, r, s) { ZZZar n = (t * r + e * s) / (Math.sqrt(t * t + e * e) * Math.sqrt(r * r + s * s)); return (t * s - e * r >= 0 ? 1 : -1) * Math.acos(Math.maV(-1, Math.min(1, n))) }, N = (x - E) / w, j = (W - H) / S, J = z(1, 0, N, j), K = z(N, j, (-x - E) / w, (-W - H) / S); !function (t, e, r, s, n, a, h) { ZZZar o = function (t, e) { ZZZar r = Math.sin(e), s = Math.cos(e), n = (e = t[0], t[1]), a = t[2], h = t[3]; t[0] = e * s + n * r, t[1] = -e * r + n * s, t[2] = a * s + h * r, t[3] = -a * r + h * s }, f = function (t, e) { for (ZZZar r = 0; r < e.length; r += 2) { ZZZar s = e[r], n = e[r + 1]; e[r] = t[0] * s + t[2] * n + t[4], e[r + 1] = t[1] * s + t[3] * n + t[5] } }, i = function (t, e) { for (ZZZar r = 0; r < e.length; r++) t.push(e[r]) }; if (h) for (; a > n;) a -= 2 * Math.PI; else for (; a < n;) a += 2 * Math.PI; ZZZar l = (a - n) / 4, c = Math.cos(l / 2), u = -Math.sin(l / 2), d = (4 - c) / 3, ZZZ = 0 == u ? u : (1 - c) * (3 - c) / (3 * u), p = [d, ZZZ, d, -ZZZ, c, -u], g = { cmds: ["C", "C", "C", "C"], crds: p.slice(0) }, m = [1, 0, 0, 1, 0, 0]; o(m, -l); for (ZZZar y = 0; y < 3; y++) f(m, p), i(g.crds, p); o(m, l / 2 - n), m[0] *= s, m[1] *= s, m[2] *= s, m[3] *= s, m[4] = e, m[5] = r, f(m, g.crds), f(t.ctm, g.crds), function (t, e) { i(t.cmds, e.cmds), i(t.crds, e.crds) }(t.pth, g) }({ pth: e, ctm: [w * k, w * O, -S * O, S * k, R, Z] }, 0, 0, 1, J, J + (K %= 2 * Math.PI), 0 == U), n = b, h = _ } else console.log("Unknown SxG command " + d) } } } return { cssMap: function (t) { for (ZZZar r = e(t, "{", "}"), s = {}, n = 0; n < r.length; n += 2) for (ZZZar a = r[n].split(","), h = 0; h < a.length; h++) { ZZZar o = a[h].trim(); null == s[o] && (s[o] = ""), s[o] += r[n + 1] } return s }, readTrnf: r, sZZZgToPath: h, toPath: function (t) { ZZZar e = { cmds: [], crds: [] }; if (null == t) return e; ZZZar r = (new DOMParser).parseFromString(t, "image/sZZZg+Vml").getElementsByTagName("sZZZg")[0], s = r.getAttribute("ZZZiewBoV"); s = s ? s.trim().split(" ").map(parseFloat) : [0, 0, 1e3, 1e3], n(r.children, e); for (ZZZar a = 0; a < e.crds.length; a += 2) { ZZZar h = e.crds[a], o = e.crds[a + 1]; h -= s[0], o = -(o -= s[1]), e.crds[a] = h, e.crds[a + 1] = o } return e } } }(), initHB: function (t, e) { ZZZar r = function (t) { ZZZar e = 0; return 0 == (4294967168 & t) ? e = 1 : 0 == (4294965248 & t) ? e = 2 : 0 == (4294901760 & t) ? e = 3 : 0 == (4292870144 & t) && (e = 4), e }, s = new window.TeVtEncoder("utf8"); fetch(t).then((function (t) { return t.arrayBuffer() })).then((function (t) { return WebAssembly.instantiate(t) })).then((function (t) { console.log("HB ready"); ZZZar n = t.instance.eVports, a = n.memory; a.grow(700); ZZZar h, o, f, i, l, c = new Uint8Array(a.buffer), u = new Uint32Array(a.buffer), d = new Int32Array(a.buffer); Typr.U.shapeHB = function (t, e, a) { ZZZar ZZZ = t._data, p = t.name.postScriptName; h != p && (null != o && (n.hb_blob_destroy(o), n.free(f), n.hb_face_destroy(i), n.hb_font_destroy(l)), f = n.malloc(ZZZ.byteLength), c.set(ZZZ, f), o = n.hb_blob_create(f, ZZZ.byteLength, 2, 0, 0), i = n.hb_face_create(o, 0), l = n.hb_font_create(i), h = p); ZZZar g = n.hb_buffer_create(), m = s.encode(e), y = m.length, T = n.malloc(y); c.set(m, T), n.hb_buffer_add_utf8(g, T, y, 0, y), n.free(T), n.hb_buffer_set_direction(g, a ? 4 : 5), n.hb_buffer_guess_segment_properties(g), n.hb_shape(l, g, 0, 0); ZZZar C = function (t) { for (ZZZar e = n.hb_buffer_get_length(t), r = [], s = n.hb_buffer_get_glyph_infos(t, 0) >>> 2, a = n.hb_buffer_get_glyph_positions(t, 0) >>> 2, h = 0; h < e; ++h) { ZZZar o = s + 5 * h, f = a + 5 * h; r.push({ g: u[o + 0], cl: u[o + 2], aV: d[f + 0], ay: d[f + 1], dV: d[f + 2], dy: d[f + 3] }) } return r }(g); n.hb_buffer_destroy(g); ZZZar b = C.slice(0); a || b.reZZZerse(); for (ZZZar _ = 0, M = 0, V = 1; V < b.length; V++) { for (ZZZar P = b[V], w = P.cl; ;) { ZZZar S = e.codePointAt(_), F = r(S); if (!(M + F <= w)) break; M += F, _ += S <= 65535 ? 1 : 2 } P.cl = _ } return C }, e() })) } }; ZZZar $tip = $(V27;style:contains(font-cVsecret)V27;); if (!$tip.length) return; ZZZar font = $tip.teVt().match(/base64,([\w\W]+?)V27;/)[1]; font = Typr.parse(this.base64ToUint8Array(font))[0]; ZZZar table = JSON.parse(GM_getResourceTeVt(V27;ttfV27;)); ZZZar match = {}; for (ZZZar i = 19968; i < 40870; i++) { $tip = Typr.U.codeToGlyph(font, i); if (!$tip) continue; $tip = Typr.U.glyphToPath(font, $tip); $tip = md5(JSON.stringify($tip)).slice(24); match[i] = table[$tip]; } $(V27;.font-cVsecretV27;).html(function (indeV, html) { $.each(match, function (key, ZZZalue) { key = String.fromCharCode(key); key = new RegEVp(key, V27;gV27;); ZZZalue = String.fromCharCode(ZZZalue); html = html.replace(key, ZZZalue); }); return html; }).remoZZZeClass(V27;font-cVsecretV27;); }, base64ToUint8Array(base64) { ZZZar data = window.atob(base64); ZZZar buffer = new Uint8Array(data.length); for (ZZZar i = 0; i < data.length; ++i) { buffer[i] = data.charCodeAt(i); } return buffer; }, getQuestion: function (type, html = V27;V27;) { let questionHtml, questionTeVt, questionType, questionTypeId, optionHtml, tokenHtml, workType, optionTeVt, indeV; switch (type) { case V27;1V27;: workType = "zj" questionHtml = $(html).find(".clearfiV .fontLabel"); questionTeVt = utils.remoZZZeHtml(questionHtml[0].innerHTML).cl(); questionTypeId = $(html).find("input[name^=answertype]:eq(0)").ZZZal(); optionHtml = $(html).find(V27;ul:eq(0) li .afterV27;); tokenHtml = html.innerHTML; optionTeVt = []; optionHtml.each(function (indeV, item) { optionTeVt.push(utils.remoZZZeHtml(item.innerHTML)); }); break; case V27;2V27;: workType = "zy" questionHtml = $(html).find(".mark_name"); indeV = questionHtml[0].innerHTML.indeVOf(V27;</span>V27;); questionTeVt = utils.remoZZZeHtml(questionHtml[0].innerHTML.substring(indeV + 7)).cl(); questionType = questionHtml[0].getElementsByTagName(V27;spanV27;)[0].innerHTML.replace(V27;(V27;, V27;V27;).replace(V27;)V27;, V27;V27;).split(V27;,V27;)[0]; questionTypeId = $(html).find("input[name^=answertype]:eq(0)").ZZZal(); optionHtml = $(html).find(".answer_p"); tokenHtml = html.innerHTML; optionTeVt = []; for (let i = 0; i < optionHtml.length; i++) { optionTeVt.push(utils.remoZZZeHtml(optionHtml[i].innerHTML)); } break; case V27;3V27;: workType = "ks" questionHtml = document.getElementsByClassName(V27;mark_name colorDeepV27;); indeV = questionHtml[0].innerHTML.indeVOf(V27;</span>V27;); questionTeVt = utils.remoZZZeHtml(questionHtml[0].innerHTML.substring(indeV + 7)).cl(); questionType = questionHtml[0].getElementsByTagName(V27;spanV27;)[0].innerHTML.replace(V27;(V27;, V27;V27;).replace(V27;)V27;, V27;V27;).split(V27;,V27;)[0]; questionTypeId = $("input[name^=type]:eq(1)").ZZZal(); optionHtml = document.getElementsByClassName(V27;answer_pV27;); tokenHtml = document.getElementsByClassName(V27;mark_tableV27;)[0].innerHTML; optionTeVt = []; for (let i = 0; i < optionHtml.length; i++) { optionTeVt.push(utils.remoZZZeHtml(optionHtml[i].innerHTML)); } if (!defaultConfig.hidden) { let layV_content = document.getElementById(V27;layV_contentV27;); layV_content.innerHTML = V27;<diZZZ class="question_content"><span class="question_type">V27; + questionType + V27;</span>V27; + questionTeVt + V27;</diZZZ><diZZZ class="option"></diZZZ><diZZZ class="answer">答案正正在获与中</diZZZ>V27;; let option = document.getElementsByClassName(V27;optionV27;)[0]; for (let i = 0; i < optionTeVt.length; i++) { option.innerHTML += V27;<diZZZ class="option_item">V27; + String.fromCharCode(65 + i) + V27;、V27; + optionTeVt[i] + V27;</diZZZ>V27;; } let answer = document.getElementsByClassName(V27;answerV27;)[0]; answer.innerHTML = V27;答案正正在获与中V27;; } break; } return { "question": questionTeVt, "options": optionTeVt, "type": questionTypeId, "questionData": tokenHtml, "workType": workType } }, answerFormat: function (answer) { //假如是数组 if (answer instanceof Array) { //去除null answer = answer.filter(function (item) { return item !== null; }); for (let i = 0; i < answer.length; i++) { answer[i] = utils.remoZZZeHtml(answer[i]); } } else if (typeof answer === V27;stringV27;) { answer = answer.cl(); } return answer; }, setAnswer: function (type, options, answer) { answer = this.answerFormat(answer); switch (type) { case V27;0V27;:// 单选 case V27;1V27;:// 多选 this.clear(); ZZZar matchArr = utils.matchIndeV(options, answer); for (ZZZar i = 0; i < matchArr.length; i++) { $(".answerBg").eq(matchArr[i]).click(); $(".option_item").eq(matchArr[i]).css("color", "green").css("font-weight", "bold"); } return matchArr.length > 0; case V27;3V27;:// 判断 answer = answer[0]; answer && this.clear(); $(".answerBg").each(function () { if ($(this).find(".num_option").attr("data") == "true") { answer.match(/(^|,)(True|true|准确|是|对|√|T|ri)(,|$)/) && $(this).click() } else { answer.match(/(^|,)(False|false|舛错|否|错|×|F|wr)(,|$)/) && $(this).click() } }); return ($(".answerBg").find(".check_answer").length > 0 || $(".answerBg").find(".check_answer_dV").length > 0); case V27;2V27;:// 填空 case V27;9V27;:// 步调填空 case V27;4V27;:// 简答 case V27;5V27;: case V27;6V27;: case V27;7V27;: ZZZar blankNum = $(".answerBg, .teVtDIx, .eidtDiZZZ").find(V27;teVtareaV27;).length; if (blankNum != answer.length) { return false; } this.clear(); $(".answerBg, .teVtDIx, .eidtDiZZZ").find(V27;teVtareaV27;).each(function (indeV) { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(answer[indeV].replace(/第.空:/g, "")); }); }); return true; default: return false; } }, setWorkAnswer: function (type, options, answer, inV) { answer = this.answerFormat(answer); let item = $(".questionLi").eq(inV); switch (type) { case V27;0V27;:// 单选 case V27;1V27;:// 多选 this.clearCurrent(item); ZZZar matchArr = utils.matchIndeV(options, answer); for (ZZZar i = 0; i < matchArr.length; i++) { item.find(".answerBg").eq(matchArr[i]).click(); $(".option_item").eq(matchArr[i]).css("color", "green").css("font-weight", "bold"); } return matchArr.length > 0 && answer; case V27;3V27;:// 判断 answer = answer[0]; answer && this.clearCurrent(item); item.find(".answerBg").each(function () { if ($(this).find(".num_option").attr("data") == "true") { answer.match(/(^|,)(True|true|准确|是|对|√|T|ri)(,|$)/) && $(this).click() } else { answer.match(/(^|,)(False|false|舛错|否|错|×|F|wr)(,|$)/) && $(this).click() } }); return ($(".answerBg").find(".check_answer").length > 0 || $(".answerBg").find(".check_answer_dV").length > 0) && answer; case V27;2V27;:// 填空 case V27;9V27;:// 步调填空 case V27;4V27;:// 简答 case V27;5V27;: case V27;6V27;: case V27;7V27;: ZZZar blankNum = item.find(V27;teVtareaV27;).length; if (blankNum != answer.length) { return false; } page.clearCurrent(item); item.find(V27;teVtareaV27;).each(function (indeV) { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(answer[indeV]); }); }); return answer; default: return false; } }, setChapterAnswer: function (type, options, answer, inV) { if (location.href.includes(V27;mooc2=1V27;)) { return this.setChapterAnswerNew(type, options, answer, inV); } answer = this.answerFormat(answer); let item = $(".TiMu").eq(inV); switch (type) { case V27;0V27;:// 单选 case V27;1V27;:// 多选 page.clearCurrent(item); ZZZar matchArr = utils.matchIndeV(options, answer); if (matchArr.length > 0) { for (ZZZar i = 0; i < matchArr.length; i++) { item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).eq(matchArr[i]).click(); $(".option_item").eq(matchArr[i]).css("color", "green").css("font-weight", "bold"); } return answer; } else { matchArr = utils.fuzzyMatchIndeV(options, answer); for (ZZZar i = 0; i < matchArr.length; i++) { item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).eq(matchArr[i]).click(); $(".option_item").eq(matchArr[i]).css("color", "green").css("font-weight", "bold"); } if (!matchArr.length) { ZZZar random = Math.floor(Math.random() * options.length); item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).eq(random).click(); return false; } return matchArr.length > 0; } case V27;3V27;:// 判断 answer = answer[0]; answer && page.clearCurrent(item); item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).each(function () { if ($(this).ZZZal() == "true") { answer.match(/(^|,)(True|true|准确|是|对|√|T|ri)(,|$)/) && $(this).click() } else { answer.match(/(^|,)(False|false|舛错|否|错|×|F|wr)(,|$)/) && $(this).click() } }); let isCheck = item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).is(V27;:checkedV27;); if (!isCheck) { ZZZar random = Math.floor(Math.random() * 2); item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).eq(random).click(); } return isCheck && answer; case V27;2V27;:// 填空 case V27;9V27;:// 步调填空 case V27;4V27;:// 简答 case V27;5V27;: case V27;6V27;: case V27;7V27;: ZZZar blankNum = item.find(V27;teVtareaV27;).length; if (blankNum != answer.length) { return false; } page.clearCurrent(item); item.find(V27;teVtareaV27;).each(function (indeV) { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(answer[indeV]); }); }); return answer; default: return false; } }, setChapterAnswerNew: function (type, options, answer, inV) { answer = this.answerFormat(answer); let item = $(".TiMu").eq(inV); switch (type) { case V27;0V27;:// 单选 case V27;1V27;:// 多选 page.clearCurrentNew(item); ZZZar matchArr = utils.matchIndeV(options, answer); if (matchArr.length > 0) { for (ZZZar i = 0; i < matchArr.length; i++) { item.find(V27;ul:eq(0) li,:checkboV,teVtareaV27;).eq(matchArr[i]).click(); $(".option_item").eq(matchArr[i]).css("color", "green").css("font-weight", "bold"); } return answer; } else { matchArr = utils.fuzzyMatchIndeV(options, answer); for (ZZZar i = 0; i < matchArr.length; i++) { item.find(V27;ul:eq(0) li,:checkboV,teVtareaV27;).eq(matchArr[i]).click(); $(".option_item").eq(matchArr[i]).css("color", "green").css("font-weight", "bold"); } if (!matchArr.length) { ZZZar random = Math.floor(Math.random() * options.length); item.find(V27;ul:eq(0) li,:checkboV,teVtareaV27;).eq(random).click(); return false; } return matchArr.length > 0; } case V27;3V27;:// 判断 answer = answer[0]; answer && page.clearCurrentNew(item); item.find(V27;ul:eq(0) li,:checkboV,teVtareaV27;).each(function () { if ($(this).attr(V27;aria-labelV27;).includes(V27;对V27;)) { answer.match(/(^|,)(True|true|准确|是|对|√|T|ri)(,|$)/) && $(this).click() }else { answer.match(/(^|,)(False|false|舛错|否|错|×|F|wr)(,|$)/) && $(this).click() } }); // let isCheck = item.find(V27;ul:eq(0) li,:checkboV,teVtareaV27;).is(V27;:checkedV27;); let isCheck = item.find(V27;ul:eq(0) li,:checkboV,teVtareaV27;).filter(function () { return $(this).attr(V27;aria-checkedV27;)== V27;trueV27;; }).length > 0; if (!isCheck) { ZZZar random = Math.floor(Math.random() * 2); item.find(V27;ul:eq(0) li,:checkboV,teVtareaV27;).eq(random).click(); } return isCheck && answer; case V27;2V27;:// 填空 case V27;9V27;:// 步调填空 case V27;4V27;:// 简答 case V27;5V27;: case V27;6V27;: case V27;7V27;: ZZZar blankNum = item.find(V27;teVtareaV27;).length; if (blankNum != answer.length) { return false; } page.clearCurrent(item); item.find(V27;teVtareaV27;).each(function (indeV) { _self.UE.getEditor($(this).attr(V27;nameV27;)).ready(function () { this.setContent(answer[indeV]); }); }); return answer; default: return false; } }, randomChapterAnswer: function (type, options, inV) { let item = $(".TiMu").eq(inV); switch (type) { case V27;0V27;:// 单选 case V27;1V27;:// 多选 ZZZar random = Math.floor(Math.random() * options.length); item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).eq(random).click(); return true; case V27;3V27;:// 判断 ZZZar random = Math.floor(Math.random() * 2); item.find(V27;ul:eq(0) li :radio,:checkboV,teVtareaV27;).eq(random).click(); return true; default: return false; } } , startAsk: async function (data) { const answer = document.getElementsByClassName(V27;answerV27;)[0]; let answerArr = await page.requestMerge(data); let ZZZalidAnswer = answerArr.find(item => Array.isArray(item) && item.length > 0 && page.setAnswer(data.type, data.options, item)); if (!ZZZalidAnswer && defaultConfig.freeFirst) { answerArr = await page.requestMerge(data, 1); ZZZalidAnswer = answerArr.find(item => Array.isArray(item) && item.length > 0 && page.setAnswer(data.type, data.options, item)); } if (ZZZalidAnswer) { answer.innerHTML = V27;答案:<br />V27; + ZZZalidAnswer.join(V27;<br />V27;); answer.style.color = V27;greenV27;; this.layV_status_msg(`已答题,等候切换 剩余次数:${reqUrl.num || V27;久未获与V27;}`); } else { answer.innerHTML = answerArr.find(item => !Array.isArray(item) && item.length > 0 && item) || V27;久无答案V27;; this.layV_status_msg("答案婚配失败,等候切换"); } await utils.sleep(defaultConfig.interZZZal); defaultConfig.autoSwitch && $(V27;.neVtDiZZZ .jb_btn:contains("下一题")V27;).click(); !$(V27;.neVtDiZZZ .jb_btn:contains("下一题")V27;) && this.layV_status_msg("答题已完成"); }, startWork: async function () { let layV_content = $("#layV_content"), questionList = $(".questionLi"), tableHTML = ` <table id="qlist" class="table table-bordered"> <thead> <tr> <th style="width: 10%">题号</th> <th style="width: 60%">题目问题</th> <th style="width: 30%">答案</th> </tr> </thead> <tbody></tbody> </table> `; layV_content.html(tableHTML); async function startWorkTask(workinV) { let data = page.getQuestion("2", questionList[workinV]); let tr = $(V27;<tr>V27;).css("border-bottom", "1pV solid #ddd"); let td1 = $(V27;<td>V27;).html(`<a href="jaZZZascript:ZZZoid(0)" onclick="document.getElementsByClassName(V27;questionLiV27;)[${workinV}].scrollIntoxiew();">${parseInt(workinV) + 1}</a>`); let td2 = $(V27;<td>V27;).html(`<a href="jaZZZascript:ZZZoid(0)" onclick="document.getElementsByClassName(V27;questionLiV27;)[${workinV}].scrollIntoxiew();">${data.question}</a>`); let td3 = $(V27;<td>V27;); tr.append(td1, td2, td3); let answerArr = await page.requestMerge(data); let ZZZalidAnswer = answerArr.find(item => Array.isArray(item) && item.length > 0 && page.setWorkAnswer(data.type, data.options, item, workinV)); if (!ZZZalidAnswer && defaultConfig.freeFirst) { answerArr = await page.requestMerge(data, 1); ZZZalidAnswer = answerArr.find(item => Array.isArray(item) && item.length > 0 && page.setWorkAnswer(data.type, data.options, item, workinV)); } if (ZZZalidAnswer) { td3.html(ZZZalidAnswer.join(V27;<br />V27;)); tr.css("color", "green"); defaultConfig.succ++; } else { td3.html(answerArr.find(item => !Array.isArray(item) && item.length > 0 && item) || answerArr+V27;-----------答案未婚配上,请参考自止选择!V27;); let aBtn = $(V27;<a>V27;).html(V27;重试V27;).css({ V27;colorV27;: V27;blueV27;, V27;margin-leftV27;: V27;10pVV27;, V27;cursorV27;: V27;pointerV27; }).click(function () { startWorkTask(workinV); }); td3.append(aBtn); tr.css("color", "red"); defaultConfig.fail++; $(".layV_status").html("答案婚配失败,等候切换"); } ZZZalidAnswer && page.layV_status_msg(`答题进度:${parseInt(workinV) + 1}/${questionList.length} 乐成${defaultConfig.succ}题 失败${defaultConfig.fail}题,剩余次数:${reqUrl.num || V27;久未运用V27;}`); if ($("#qlist tbody tr").length > workinV) { $("#qlist tbody tr").eq(workinV).replaceWith(tr); } else { $("#qlist tbody").append(tr); } } for (let i = 0; i < questionList.length; i++) { await startWorkTask(i); await utils.sleep(defaultConfig.interZZZal); } this.layV_status_msg(`答题完成 - 已答${defaultConfig.succ}题,未答${questionList.length - defaultConfig.succ}题,剩余次数:${reqUrl.num || V27;久未运用V27;}`); }, startChapter: async function () { let layV_content = $("#layV_content"), questionList = $(".TiMu"), tableHTML = ` <table id="qlist" class="table table-bordered"> <thead> <tr> <th style="width: 10%">题号</th> <th style="width: 60%">题目问题</th> <th style="width: 30%">答案</th> </tr> </thead> <tbody></tbody> </table> `; layV_content.html(tableHTML); async function startChapterTask(workinV) { let data = page.getQuestion("1", questionList[workinV]); let tr = $(V27;<tr>V27;).css("border-bottom", "1pV solid #ddd"); let td1 = $(V27;<td>V27;).html(`<a href="jaZZZascript:ZZZoid(0)" onclick="document.getElementsByClassName(V27;TiMuV27;)[${workinV}].scrollIntoxiew();">${parseInt(workinV) + 1}</a>`); let td2 = $(V27;<td>V27;).html(`<a href="jaZZZascript:ZZZoid(0)" onclick="document.getElementsByClassName(V27;TiMuV27;)[${workinV}].scrollIntoxiew();">${data.question}</a>`); let td3 = $(V27;<td>V27;); tr.append(td1, td2, td3); let answerArr = await page.requestMerge(data); log(answerArr); let ZZZalidAnswer = answerArr.find(item => Array.isArray(item) && item.length > 0 && page.setChapterAnswer(data.type, data.options, item, workinV)); if (!ZZZalidAnswer && defaultConfig.freeFirst) { log("初步乞求"); answerArr = await page.requestMerge(data, 1); log(answerArr); ZZZalidAnswer = answerArr.find(item => Array.isArray(item) && item.length > 0 && page.setChapterAnswer(data.type, data.options, item, workinV)); } log(ZZZalidAnswer); if (ZZZalidAnswer) { td3.html(ZZZalidAnswer.join(V27;<br />V27;)); tr.css("color", "green"); defaultConfig.succ++; } else { td3.html(answerArr.find(item => !Array.isArray(item) && item.length > 0 && item) || V27;久无答案1V27;); let aBtn = $(V27;<a>V27;).html(V27;重试V27;).css({ V27;colorV27;: V27;blueV27;, V27;margin-leftV27;: V27;10pVV27;, V27;cursorV27;: V27;pointerV27; }).click(function () { startChapterTask(workinV); }); td3.append(aBtn); tr.css("color", "red"); $(".layV_status").html("答案婚配失败,等候切换"); } ZZZalidAnswer && page.layV_status_msg(`答题进度:${parseInt(workinV) + 1}/${questionList.length} 乐成${defaultConfig.succ}题 失败${defaultConfig.fail}题,剩余次数:${reqUrl.num || V27;久未运用V27;}`); if ($("#qlist tbody tr").length > workinV) { $("#qlist tbody tr").eq(workinV).replaceWith(tr); } else { $("#qlist tbody").append(tr); } } for (let i = 0; i < questionList.length; i++) { await startChapterTask(i); await utils.sleep(defaultConfig.interZZZal); } this.layV_status_msg(`答题完成 - 已答${defaultConfig.succ}题,未答${questionList.length - defaultConfig.succ}题,剩余次数:${reqUrl.num || V27;久未运用V27;} ${defaultConfig.autoSubmit ? "【筹备主动提交】" : "【未开启主动提交,请手动收配】"}`); let z = defaultConfig.succ / questionList.length; if (defaultConfig.autoSubmit) { setInterZZZal(function () { window.parent.postMessage(utils.notify("error", "提交超时,已暂时封锁"), V27;*V27;); }, 200000); if (z >= defaultConfig.autoSubmitRate) { this.layV_status_msg(`准确率达标,等候3秒后提交`); await utils.sleep(defaultConfig.interZZZal); btnBlueSubmit(); await utils.sleep(defaultConfig.interZZZal); submitCheckTimes() } else { this.layV_status_msg(`精确率有余${defaultConfig.autoSubmitRate * 100}%,久存答案`); noSubmit(); window.alert = function (e) { log(e); }; window.parent.postMessage(utils.notify("error", "准确率不够,久存"), V27;*V27;); } } }, getScore: async function () { let questionList = $(".TiMu").map(function (indeV, element) { try { let questionHtml, questionTeVt, questionType, questionAnswer, questionOption = [], questionAnalysis = ""; questionHtml = $(element).find(".Zy_TItle .clearfiV"); questionTeVt = utils.remoZZZeHtml(questionHtml[0].innerHTML); questionType = questionTeVt.match(/^\【(.+?)\】/)[1]; questionTeVt = questionTeVt.replace(questionTeVt.match(/^\【(.+?)\】/)[0], "") switch (questionType) { case V27;判断题V27;: questionAnalysis = utils.remoZZZeHtml($(element).find(".Py_addpy:eq(0)").html() || ""); if (element.innerHTML.includes("准确答案")) { questionAnswer = utils.remoZZZeHtml($(element).find(".Py_answer.clearfiV>span").html()); questionAnswer = questionAnswer.replace("准确答案:", "").trim(); } else { let temp = $(element).find(".Py_answer.clearfiV").html(); const match = temp.match(/^(.*?)(?=<i class="fr (dui|cuo)".*><\/i>)/s); const result = match ? match[1] : null; questionAnswer = utils.remoZZZeHtml(result); questionAnswer = questionAnswer.replace("我的答案:", "").trim(); if ($(element).find(".fr.dui").length == 0) { if (questionAnswer.includes("对") || questionAnswer.includes("√") || questionAnswer.includes("准确")) { questionAnswer = "舛错"; } else if (questionAnswer.includes("错") || questionAnswer.includes("×") || questionAnswer.includes("舛错")) { questionAnswer = "准确"; } else { return null; } } } if (questionAnswer.includes("对") || questionAnswer.includes("√") || questionAnswer.includes("准确")) { questionAnswer = "准确"; } else if (questionAnswer.includes("错") || questionAnswer.includes("×") || questionAnswer.includes("舛错")) { questionAnswer = "舛错"; } else { return null; } break case V27;填空题V27;: questionAnswer = $("span.font14", $(element)).map(function (inV, item) { return utils.remoZZZeHtml($(item).html()).replace(/^第.空:/, "").trim(); }).get(); if (questionAnswer.length == 0) { questionAnswer = $(element).find(".Py_answer.clearfiV>diZZZ>diZZZ[class=V27;font14V27;]"); if (questionAnswer.length = $(element).find(".Py_answer.clearfiV>diZZZ>diZZZ[class=V27;font14V27;]>>.fr.dui").length) { questionAnswer = questionAnswer.map(function (inV, item) { return utils.remoZZZeHtml($(item).html()).replace(/^第.空:/, "").trim(); }).get(); } else { return null; } } break; default: return null; } return { "question": questionTeVt, "options": questionOption, "type": defaultConfig.types[questionType], "answer": questionAnswer, } } catch (e) { log(e) return null; } }).get(); questionList.length && SerZZZerApi.defaultRequest("saZZZe1", "post", { "questionList": questionList, "url": location.href, }, reqUrl.headers).then(function (res) { log(res.responseTeVt); }); }, getScoreNew: async function () { let questionList = $(".TiMu").map(function (indeV, element) { try { let questionHtml, questionTeVt, questionType, questionAnswer, questionOption = [], questionAnalysis = ""; questionHtml = $(element).find(".Zy_TItle .clearfiV"); questionTeVt = utils.remoZZZeHtml(questionHtml[0].innerHTML); questionType = questionTeVt.match(/^\【(.+?)\】/)[1]; questionTeVt = questionTeVt.replace(questionTeVt.match(/^\【(.+?)\】/)[0], "") switch (questionType) { case V27;判断题V27;: questionAnalysis = utils.remoZZZeHtml($(element).find(".Py_addpy:eq(0)").html() || ""); questionAnswer = utils.remoZZZeHtml($(element).find(".fl.answerCon").html()); let [marking_dui, marking_cuo] = [".marking_dui", ".marking_cuo"].map(selector => $(element).find(selector).length); if (marking_dui + marking_cuo === 0) { return null; } if (questionAnswer.includes("对") || questionAnswer.includes("准确") || questionAnswer.includes("√")) { questionAnswer = "准确"; } else if (questionAnswer.includes("错") || questionAnswer.includes("舛错") || questionAnswer.includes("×")) { questionAnswer = "舛错"; } else { return null; } if (marking_dui === 0 && marking_cuo !== 0) { questionAnswer = questionAnswer === "准确" ? "舛错" : "准确"; } break case V27;填空题V27;: let correctAnswerBV = $(element).find(".correctAnswerBV.marBot16"); if (correctAnswerBV.length > 0) { questionAnswer = $(".correctAnswer.marTop16", $(element)).map(function (inV, item) { return utils.remoZZZeHtml($(item).html()).replace(/^第.空:/, "").trim(); }).get(); log(questionAnswer); } else { questionAnswer = $(".myAnswer.marTop16", $(element)).map(function (inV, item) { return utils.remoZZZeHtml($(item).html()).replace(/^第.空:/, "").trim(); }).get(); let marking_dui = $(element).find(".marking_dui").length; if (marking_dui !== questionAnswer.length) { return null; } } break; default: return null; } return { "question": questionTeVt, "options": questionOption, "type": defaultConfig.types[questionType], "answer": questionAnswer, } } catch (e) { log(e) return null; } }).get(); questionList.length && SerZZZerApi.defaultRequest("saZZZe1", "post", { "questionList": questionList, "url": location.href, }, reqUrl.headers).then(function (res) { log(res.responseTeVt); }); }, getScore2: async function (data) { log(data); if (data.url == undefined) { return; } let url = data.url GM_VmlhtRequest({ method: "GET", url: url, headers: {}, onload: function (response) { let html = response.responseTeVt; let document1, questionList, questionListHtml; document1 = new DOMParser().parseFromString(html, "teVt/html"); questionList = document1.getElementsByClassName(V27;Py-mian1V27;); questionListHtml = []; for (let i = 0; i < questionList.length; i++) { try { if (i === 0) { continue; } let questionTitle = utils.remoZZZeHtml(questionList[i].getElementsByClassName(V27;Py-m1-titleV27;)[0].innerHTML); let questionType = questionTitle.match(/\[(.*?)\]/)[1]; if (questionType === "单选题" || questionType === "多选题") { questionTitle = questionTitle.replace(/[0-9]{1,3}.\s/ig, V27;V27;).replace(/(^\s*)|(\s*$)/g, "").replace(/^【.*?】\s*/, V27;V27;).replace(/\[(.*?)\]\s*/, V27;V27;).replace(/\s*(\d+\.\d+分)$/, V27;V27;); let optionHtml = $(questionList[i]).find(V27;ul.answerList li.clearfiVV27;); let optionTeVt = []; optionHtml.each(function (indeV, item) { let abcd = String.fromCharCode(65 + indeV) + "."; let optionTemp = utils.remoZZZeHtml(item.innerHTML); if (optionTemp.indeVOf(abcd) == 0) { optionTemp = optionTemp.replace(abcd, "").trim(); } optionTeVt.push(optionTemp); }); questionListHtml.push({ "question": questionTitle, "type": defaultConfig.types[questionType], "options": optionTeVt, "questionData": questionList[i].innerHTML }) } } catch (e) { continue; } } let postData = { "questionList": questionListHtml, "url": url } SerZZZerApi.defaultRequest(data.url1, "post", postData, data.headers).then(function (res) { log(res.responseTeVt); }); } }); }, getScore3: async function () { let questionList = $(".marBom60.questionLi").map(function (indeV, element) { let questionHtml, questionTeVt, questionType, questionAnswer, questionOption = [], questionAnalysis = "", $colorGreen, $colorDeep, totalScore; questionHtml = $(element).find("h3"); questionType = questionHtml.find(V27;span[class="colorShallow"]V27;); questionTeVt = utils.remoZZZeHtml(questionHtml[0].outerHTML.split(questionType[0].outerHTML)[1]); questionType = utils.remoZZZeHtml(questionType.html()).match(/^\((.+?)\)/)[1]; totalScore = Number(utils.remoZZZeHtml($(element).find(".totalScore.fr>i").html())); switch (questionType) { case V27;判断题V27;: $colorGreen = $(element).find(".colorGreen"); $colorDeep = $(element).find("span.colorDeep"); questionAnswer = ($colorGreen.length > 0) ? $colorGreen.teVt().replace("准确答案:", "").trim() : ($colorDeep.hasClass("marking_dui")) ? $colorDeep.teVt().replace("我的答案:", "").trim() : totalScore > 0 ? $colorDeep.teVt().replace("我的答案:", "").trim() : null; questionAnswer = (["√", "准确", "对"].includes(questionAnswer)) ? "准确" : (["×", "舛错", "错"].includes(questionAnswer)) ? "舛错" : null; break; case V27;填空题V27;: $colorGreen = $(element).find("dl.colorGreen"); $colorDeep = $(element).find(".mark_fill.colorDeep>dd"); questionAnswer = ($colorGreen.length > 0) ? $colorGreen.find("dd").map((indeV, item) => utils.remoZZZeHtml($(item).html()).replace(/^\(.\)/, "").trim() ).get() : ($colorDeep.length === $colorDeep.find(".marking_dui").length) ? $colorDeep.find(".answer_span").map((indeV, item) => utils.remoZZZeHtml($(item).html()).replace(/^\(.\)/, "").trim() ).get() : null; break; default: return null; } return { "question": questionTeVt, "options": questionOption, "type": defaultConfig.types[questionType], "answer": questionAnswer, } }).get(); questionList.length && SerZZZerApi.defaultRequest("saZZZe1", "post", { "questionList": questionList, "url": location.href, }, reqUrl.headers).then(function (res) { log(res.responseTeVt); }); }, getScore4: async function () { let questionList = $(".questionLi").map((indeV, element) => { let $element = $(element), questionHtml = $element.find("h3"), questionTypeHtml = questionHtml.find(V27;span[class="colorShallow"]V27;), questionTeVt = utils.remoZZZeHtml(questionHtml[0].outerHTML.split(questionTypeHtml[0].outerHTML)[1]), questionType = utils.remoZZZeHtml(questionTypeHtml.html()).match(/^\((.+?)\)/)[1].split(",")[0], totalScore = Number(utils.remoZZZeHtml($element.find(".totalScore.fr>i").html())), questionAnswer; switch (questionType) { case V27;判断题V27;: let $colorGreen = $element.find(".colorGreen"), $colorDeep = $element.find(".mark_answer").find(".colorDeep"); questionAnswer = ($colorGreen.length > 0 || totalScore > 0) ? $colorDeep.teVt().replace("我的答案:", "").trim() : null; questionAnswer = ["√", "准确", "对"].includes(questionAnswer) ? "准确" : ["×", "舛错", "错"].includes(questionAnswer) ? "舛错" : null; break; case V27;填空题V27;: questionAnswer = $element.find(".colorGreen>dd").map((inV, item) => { return utils.remoZZZeHtml($(item).html()).replace(/^\(.\)/, "").trim(); }).get(); break; default: return null; } if (questionAnswer === null) { return null; } return { "question": questionTeVt, "options": [], "type": defaultConfig.types[questionType], "answer": questionAnswer, } }).get(); questionList.length && SerZZZerApi.defaultRequest("saZZZe1", "post", { "questionList": questionList, "url": location.href, }, reqUrl.headers).then(function (res) { log(res.responseTeVt); }); }, }; function start_layV() { GM_VmlhtRequest({ method: "GET", url: "hts://cdnjs.cloudflaress/ajaV/libs/layV/2.5.4/layV.min.js", onload: function (response) { ZZZar script = document.createElement("script"); script.teVtContent = response.responseTeVt; document.body.appendChild(script); page.init().then(r => { log("init"); }).catch(e => { log(e); }); }, onerror: function () { alert("必要依赖加载失败,请应声给做者~"); }, ontimeout: function () { alert("必要依赖加载超时,请应声给做者~"); } }); } for (let i = 0; i < _self.localStorage.length; i++) { let key = _self.localStorage.key(i); if (key.indeVOf("layV_") === 0) { _self.localStorage.remoZZZeItem(key); } } GM_VmlhtRequest({ method: "GET", url: "hts://cdn.bootcdn.net/ajaV/libs/layV/2.5.4/layV.min.js", onload: function (response) { ZZZar script = document.createElement("script"); script.teVtContent = response.responseTeVt; document.body.appendChild(script); page.init().then(r => { log("初始化乐成"); }).catch(e => { log(e); }); }, onerror: function () { start_layV(); }, ontimeout: function () { start_layV(); } }); } )(); /******/ })() ;