test.js 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. !function (t) {
  2. function e(e) {
  3. for (var n, a, l = e[0], u = e[1], h = e[2], c = 0, A = []; c < l.length; c++) a = l[c], Object.prototype.hasOwnProperty.call(r, a) && r[a] && A.push(r[a][0]), r[a] = 0;
  4. for (n in u) Object.prototype.hasOwnProperty.call(u, n) && (t[n] = u[n]);
  5. for (o && o(e); A.length;) A.shift()();
  6. return i.push.apply(i, h || []), s()
  7. }
  8. function s() {
  9. for (var t, e = 0; e < i.length; e++) {
  10. for (var s = i[e], n = !0, l = 1; l < s.length; l++) {
  11. var u = s[l];
  12. 0 !== r[u] && (n = !1)
  13. }
  14. n && (i.splice(e--, 1), t = a(a.s = s[0]))
  15. }
  16. return t
  17. }
  18. var n = {}, r = {22: 0}, i = [];
  19. function a(e) {
  20. if (n[e]) return n[e].exports;
  21. var s = n[e] = {i: e, l: !1, exports: {}};
  22. return t[e].call(s.exports, s, s.exports, a), s.l = !0, s.exports
  23. }
  24. a.m = t, a.c = n, a.d = function (t, e, s) {
  25. a.o(t, e) || Object.defineProperty(t, e, {enumerable: !0, get: s})
  26. }, a.r = function (t) {
  27. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(t, "__esModule", {value: !0})
  28. }, a.t = function (t, e) {
  29. if (1 & e && (t = a(t)), 8 & e) return t;
  30. if (4 & e && "object" == typeof t && t && t.__esModule) return t;
  31. var s = Object.create(null);
  32. if (a.r(s), Object.defineProperty(s, "default", {
  33. enumerable: !0,
  34. value: t
  35. }), 2 & e && "string" != typeof t) for (var n in t) a.d(s, n, function (e) {
  36. return t[e]
  37. }.bind(null, n));
  38. return s
  39. }, a.n = function (t) {
  40. var e = t && t.__esModule ? function () {
  41. return t.default
  42. } : function () {
  43. return t
  44. };
  45. return a.d(e, "a", e), e
  46. }, a.o = function (t, e) {
  47. return Object.prototype.hasOwnProperty.call(t, e)
  48. }, a.p = "";
  49. var l = window.webpackJsonp = window.webpackJsonp || [], u = l.push.bind(l);
  50. l.push = e, l = l.slice();
  51. for (var h = 0; h < l.length; h++) e(l[h]);
  52. var o = u;
  53. i.push([153, 0]), s()
  54. }({
  55. 153: function (t, e, s) {
  56. "use strict";
  57. s.r(e);
  58. var n = s(25), r = s.n(n), i = s(3), a = s(21);
  59. class l {
  60. constructor() {
  61. var t, e, s;
  62. s = {
  63. A: 0,
  64. B: 1,
  65. C: 2,
  66. D: 3,
  67. E: 4
  68. }, (e = "ANSWERS_LETTERS_TO_INDEX") in (t = this) ? Object.defineProperty(t, e, {
  69. value: s,
  70. enumerable: !0,
  71. configurable: !0,
  72. writable: !0
  73. }) : t[e] = s
  74. }
  75. update(t) {
  76. this.answers = t
  77. }
  78. getAnswers(t) {
  79. return this.answers[t - 1]
  80. }
  81. aggregateAnswers() {
  82. const t = {};
  83. return this.ANSWERS_LETTERS.forEach(e => t[e] = 0), this.answers.forEach(e => {
  84. e && (t[e] || (t[e] = 0), t[e]++)
  85. }), t
  86. }
  87. mapAnswerToValue(t, e) {
  88. return e[this.ANSWERS_LETTERS_TO_INDEX[t]]
  89. }
  90. consecutives() {
  91. const t = [], e = this.answers;
  92. for (var s = 0; s < e.length - 1; s++) t.push(!(e[s] !== e[s + 1] || !e[s]));
  93. return t
  94. }
  95. }
  96. function u(t, e, s) {
  97. return e in t ? Object.defineProperty(t, e, {
  98. value: s,
  99. enumerable: !0,
  100. configurable: !0,
  101. writable: !0
  102. }) : t[e] = s, t
  103. }
  104. function h(t, e, s) {
  105. return e in t ? Object.defineProperty(t, e, {
  106. value: s,
  107. enumerable: !0,
  108. configurable: !0,
  109. writable: !0
  110. }) : t[e] = s, t
  111. }
  112. function o(t, e, s) {
  113. return e in t ? Object.defineProperty(t, e, {
  114. value: s,
  115. enumerable: !0,
  116. configurable: !0,
  117. writable: !0
  118. }) : t[e] = s, t
  119. }
  120. function c(t, e, s) {
  121. return e in t ? Object.defineProperty(t, e, {
  122. value: s,
  123. enumerable: !0,
  124. configurable: !0,
  125. writable: !0
  126. }) : t[e] = s, t
  127. }
  128. function A(t, e, s) {
  129. return e in t ? Object.defineProperty(t, e, {
  130. value: s,
  131. enumerable: !0,
  132. configurable: !0,
  133. writable: !0
  134. }) : t[e] = s, t
  135. }
  136. function d(t, e, s) {
  137. return e in t ? Object.defineProperty(t, e, {
  138. value: s,
  139. enumerable: !0,
  140. configurable: !0,
  141. writable: !0
  142. }) : t[e] = s, t
  143. }
  144. function w(t, e, s) {
  145. return e in t ? Object.defineProperty(t, e, {
  146. value: s,
  147. enumerable: !0,
  148. configurable: !0,
  149. writable: !0
  150. }) : t[e] = s, t
  151. }
  152. function g(t, e, s) {
  153. return e in t ? Object.defineProperty(t, e, {
  154. value: s,
  155. enumerable: !0,
  156. configurable: !0,
  157. writable: !0
  158. }) : t[e] = s, t
  159. }
  160. function v(t, e, s) {
  161. return e in t ? Object.defineProperty(t, e, {
  162. value: s,
  163. enumerable: !0,
  164. configurable: !0,
  165. writable: !0
  166. }) : t[e] = s, t
  167. }
  168. function f(t, e, s) {
  169. return e in t ? Object.defineProperty(t, e, {
  170. value: s,
  171. enumerable: !0,
  172. configurable: !0,
  173. writable: !0
  174. }) : t[e] = s, t
  175. }
  176. function Q(t, e, s) {
  177. return e in t ? Object.defineProperty(t, e, {
  178. value: s,
  179. enumerable: !0,
  180. configurable: !0,
  181. writable: !0
  182. }) : t[e] = s, t
  183. }
  184. function p(t, e, s) {
  185. return e in t ? Object.defineProperty(t, e, {
  186. value: s,
  187. enumerable: !0,
  188. configurable: !0,
  189. writable: !0
  190. }) : t[e] = s, t
  191. }
  192. function T(t, e, s) {
  193. return e in t ? Object.defineProperty(t, e, {
  194. value: s,
  195. enumerable: !0,
  196. configurable: !0,
  197. writable: !0
  198. }) : t[e] = s, t
  199. }
  200. const m = {
  201. "basic-1": class extends l {
  202. constructor() {
  203. super(), u(this, "ANSWERS_LETTERS", "ABCD".split("")), u(this, "TOTAL_ANSWERS", 4), u(this, "TOTAL_QUESTIONS", 3)
  204. }
  205. validade() {
  206. return [this.validateQ1(), this.validateQ2(), this.validateQ3()]
  207. }
  208. validateQ1() {
  209. const t = this.getAnswers(1);
  210. return t ? t === this.getAnswers(2) : null
  211. }
  212. validateQ2() {
  213. const t = this.getAnswers(2);
  214. return t ? this.aggregateAnswers().B == this.mapAnswerToValue(t, [0, 1, 2, 3]) : null
  215. }
  216. validateQ3() {
  217. const t = this.getAnswers(3);
  218. return t ? this.aggregateAnswers().A == this.mapAnswerToValue(t, [0, 1, 2, 3]) : null
  219. }
  220. }, "basic-2": class extends l {
  221. constructor() {
  222. super(), h(this, "ANSWERS_LETTERS", "ABCDE".split("")), h(this, "TOTAL_ANSWERS", 5), h(this, "TOTAL_QUESTIONS", 4)
  223. }
  224. validade() {
  225. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4()]
  226. }
  227. validateQ1() {
  228. const t = this.getAnswers(1);
  229. return t ? this.aggregateAnswers().A == this.mapAnswerToValue(t, [0, 1, 2, 3, 4]) : null
  230. }
  231. validateQ2() {
  232. const t = this.getAnswers(2);
  233. if (!t) return null;
  234. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, -1]);
  235. if ("E" === t) {
  236. return 0 == this.aggregateAnswers().A
  237. }
  238. return this.answers.indexOf("A") === e - 1
  239. }
  240. validateQ3() {
  241. const t = this.getAnswers(3);
  242. return t ? this.mapAnswerToValue(t, ["C", "D", "E", "A", "B"]) === this.getAnswers(2) : null
  243. }
  244. validateQ4() {
  245. const t = this.getAnswers(4);
  246. if (!t) return null;
  247. const e = this.aggregateAnswers(), s = this.mapAnswerToValue(t, ["C", "B", "A", "E", "D"]),
  248. n = 1 === Object(i.filter)(e, t => t >= 2).length;
  249. return e[s] >= 2 && n
  250. }
  251. }, "the-incredible-eight": class extends l {
  252. constructor() {
  253. super(), o(this, "ANSWERS_LETTERS", "ABCD".split("")), o(this, "TOTAL_ANSWERS", 4), o(this, "TOTAL_QUESTIONS", 8)
  254. }
  255. validade() {
  256. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8()]
  257. }
  258. validateQ1() {
  259. const t = this.getAnswers(1);
  260. if (!t) return null;
  261. const e = this.aggregateAnswers().C;
  262. return this.mapAnswerToValue(t, [1, 2, 3, 4]) === e
  263. }
  264. validateQ2() {
  265. const t = this.getAnswers(2);
  266. if (!t) return null;
  267. const e = this.mapAnswerToValue(t, ["D", "B", "C", "A"]), s = this.aggregateAnswers(), n = s[e];
  268. return 3 == Object(i.filter)(s, (t, e) => t > n).length
  269. }
  270. validateQ3() {
  271. const t = this.getAnswers(3);
  272. if (!t) return null;
  273. const e = this.mapAnswerToValue(t, ["D", "C", "B", "A"]), s = this.aggregateAnswers(), n = s[e];
  274. return 3 == Object(i.filter)(s, (t, e) => t < n).length
  275. }
  276. validateQ4() {
  277. const t = this.getAnswers(4);
  278. if (!t) return null;
  279. const e = this.aggregateAnswers();
  280. switch (t) {
  281. case"A":
  282. return 4 === e.A;
  283. case"B":
  284. return 1 === e.A;
  285. case"C":
  286. return 0 === e.B;
  287. case"D":
  288. return e.A === e.C
  289. }
  290. }
  291. validateQ5() {
  292. const t = this.getAnswers(5);
  293. if (!t) return null;
  294. const e = this.mapAnswerToValue(t, [5, 6, 7, 1]);
  295. return this.answers.indexOf("A") === e - 1
  296. }
  297. validateQ6() {
  298. const t = this.getAnswers(6);
  299. if (!t) return null;
  300. const e = this.aggregateAnswers();
  301. return Object(i.map)(e, (t, e) => t).sort().reverse()[0] === this.mapAnswerToValue(t, [3, 4, 5, 6])
  302. }
  303. validateQ7() {
  304. const t = this.getAnswers(7);
  305. if (!t) return null;
  306. const e = [], s = this.answers;
  307. for (var n = 0; n < s.length - 1; n++) e.push(!(s[n] !== s[n + 1] || !s[n]));
  308. const r = 1 === Object(i.filter)(e, t => t).length, a = this.mapAnswerToValue(t, [1, 6, 0, 3]);
  309. return r && e[a]
  310. }
  311. validateQ8() {
  312. const t = this.getAnswers(8);
  313. if (!t) return null;
  314. const e = this.aggregateAnswers(), s = this.mapAnswerToValue(t, [4, 2, 3, 7]);
  315. return t === this.getAnswers(s) && 2 === e[t]
  316. }
  317. }, "srq-1": class extends l {
  318. constructor() {
  319. super(), c(this, "ANSWERS_LETTERS", "ABCDE".split("")), c(this, "TOTAL_ANSWERS", 5), c(this, "TOTAL_QUESTIONS", 10)
  320. }
  321. validade() {
  322. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8(), this.validateQ9(), this.validateQ10()]
  323. }
  324. validateQ1() {
  325. const t = this.getAnswers(1);
  326. if (!t) return null;
  327. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  328. return this.answers.indexOf("E") === e - 1
  329. }
  330. validateQ2() {
  331. const t = this.getAnswers(2);
  332. if (!t) return null;
  333. this.aggregateAnswers();
  334. const e = this.mapAnswerToValue(t, [9, 7, 5, 3, 1]), s = this.getAnswers(e),
  335. n = Object(i.filter)([9, 7, 5, 3, 1], t => "B" === this.getAnswers(t));
  336. return "B" === s && 1 === n.length
  337. }
  338. validateQ3() {
  339. const t = this.getAnswers(3);
  340. if (!t) return null;
  341. const e = this.consecutives(), s = 1 === Object(i.filter)(e, t => t).length,
  342. n = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  343. return s && e[n]
  344. }
  345. validateQ4() {
  346. const t = this.getAnswers(4);
  347. if (!t) return null;
  348. this.aggregateAnswers();
  349. const e = this.mapAnswerToValue(t, [2, 4, 6, 8, 10]), s = this.getAnswers(e),
  350. n = Object(i.filter)([2, 4, 6, 8, 10], t => "A" === this.getAnswers(t));
  351. return "A" === s && 1 === n.length
  352. }
  353. validateQ5() {
  354. const t = this.getAnswers(5);
  355. return t ? this.aggregateAnswers().B === this.mapAnswerToValue(t, [5, 4, 3, 2, 1]) : null
  356. }
  357. validateQ6() {
  358. const t = this.getAnswers(6);
  359. if (!t) return null;
  360. const e = Object(i.range)(1, 10, 2).map(t => this.getAnswers(t)),
  361. s = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), n = e.lastIndexOf(t);
  362. return -1 !== n && n === s
  363. }
  364. validateQ7() {
  365. const t = this.getAnswers(7);
  366. if (!t) return null;
  367. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  368. return t === this.getAnswers(e)
  369. }
  370. validateQ8() {
  371. const t = this.getAnswers(8);
  372. if (!t) return null;
  373. const e = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), s = this.getAnswers(9);
  374. if (!s) return !1;
  375. const n = this.mapAnswerToValue(s, [0, 1, 2, 3, 4]), r = this.mapAnswerToValue(t, [4, 3, 2, 1, 0]);
  376. return Math.abs(n - e) === r
  377. }
  378. validateQ9() {
  379. const t = this.getAnswers(9);
  380. if (!t) return null;
  381. const e = this.aggregateAnswers(), s = e.B + e.C + e.D;
  382. switch (t) {
  383. case"A":
  384. return -1 !== [1, 2, 3, 5, 7].indexOf(s);
  385. case"B":
  386. return -1 !== [1, 4, 9].indexOf(s);
  387. case"C":
  388. return -1 !== [1, 8].indexOf(s);
  389. case"D":
  390. return -1 !== [5, 10].indexOf(s);
  391. case"E":
  392. return -1 !== [1, 2, 6].indexOf(s)
  393. }
  394. }
  395. validateQ10() {
  396. return !!this.getAnswers(10) || null
  397. }
  398. }, "srq-2": class extends l {
  399. constructor() {
  400. super(), A(this, "ANSWERS_LETTERS", "ABCDE".split("")), A(this, "TOTAL_ANSWERS", 5), A(this, "TOTAL_QUESTIONS", 10)
  401. }
  402. validade() {
  403. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8(), this.validateQ9(), this.validateQ10()]
  404. }
  405. validateQ1() {
  406. const t = this.getAnswers(1);
  407. if (!t) return null;
  408. const e = this.mapAnswerToValue(t, [8, 7, 6, 5, 4]);
  409. return this.answers.indexOf("D") === e - 1
  410. }
  411. validateQ2() {
  412. const t = this.getAnswers(2);
  413. return t ? this.consecutives()[this.mapAnswerToValue(t, [2, 3, 4, 5, 6])] : null
  414. }
  415. validateQ3() {
  416. const t = this.getAnswers(3);
  417. return t ? this.aggregateAnswers().E === this.mapAnswerToValue(t, [1, 2, 3, 4, 5]) : null
  418. }
  419. validateQ4() {
  420. const t = this.getAnswers(4);
  421. return t ? this.aggregateAnswers().A === this.mapAnswerToValue(t, [1, 2, 3, 4, 5]) : null
  422. }
  423. validateQ5() {
  424. const t = this.getAnswers(5);
  425. if (!t) return null;
  426. const e = this.aggregateAnswers(), s = this.mapAnswerToValue(t, ["A", "B", "C", "D", "E"]);
  427. return e.A === e[s]
  428. }
  429. validateQ6() {
  430. const t = this.getAnswers(6);
  431. if (!t) return null;
  432. const e = Object(i.range)(5, 10, 1).map(t => this.getAnswers(t)),
  433. s = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), n = e.lastIndexOf("B");
  434. return -1 !== n && n === s
  435. }
  436. validateQ7() {
  437. const t = this.getAnswers(7);
  438. if (!t) return null;
  439. const e = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), s = this.getAnswers(8);
  440. if (!s) return !1;
  441. const n = this.mapAnswerToValue(s, [0, 1, 2, 3, 4]), r = this.mapAnswerToValue(t, [4, 3, 2, 1, 0]);
  442. return Math.abs(n - e) === r
  443. }
  444. validateQ8() {
  445. const t = this.getAnswers(8);
  446. if (!t) return null;
  447. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  448. return t === this.getAnswers(e)
  449. }
  450. validateQ9() {
  451. const t = this.getAnswers(9);
  452. if (!t) return null;
  453. const e = this.aggregateAnswers();
  454. return this.mapAnswerToValue(t, [3, 4, 5, 6, 7]) === e.B + e.C + e.D
  455. }
  456. validateQ10() {
  457. return !!this.getAnswers(10) || null
  458. }
  459. }, "srq-3": class extends l {
  460. constructor() {
  461. super(), d(this, "ANSWERS_LETTERS", "ABCD".split("")), d(this, "TOTAL_ANSWERS", 4), d(this, "TOTAL_QUESTIONS", 10)
  462. }
  463. validade() {
  464. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8(), this.validateQ9(), this.validateQ10()]
  465. }
  466. validateQ1() {
  467. return !!this.getAnswers(1) || null
  468. }
  469. validateQ2() {
  470. const t = this.getAnswers(2);
  471. if (!t) return null;
  472. const e = this.getAnswers(1), s = this.getAnswers(3);
  473. if (!e || !s) return !1;
  474. switch (t) {
  475. case"A":
  476. return t === s && t !== e;
  477. case"B":
  478. return t === e && t !== s;
  479. case"C":
  480. return t === e && t === s;
  481. case"D":
  482. return t !== e && t !== s
  483. }
  484. }
  485. validateQ3() {
  486. const t = this.getAnswers(3);
  487. return t ? this.mapAnswerToValue(t, [0, 1, 2, 3]) === this.aggregateAnswers().A : null
  488. }
  489. validateQ4() {
  490. const t = this.getAnswers(4);
  491. if (!t) return null;
  492. const e = this.mapAnswerToValue(t, [0, 1, 2, 3]), s = this.consecutives();
  493. return e === Object(i.filter)(s, t => t).length
  494. }
  495. validateQ5() {
  496. const t = this.getAnswers(5);
  497. if (!t) return null;
  498. const e = this.getAnswers(4);
  499. return !!e && this.mapAnswerToValue(t, ["C", "B", "A", "D"]) === e
  500. }
  501. validateQ6() {
  502. const t = this.getAnswers(6);
  503. return t ? 0 === this.aggregateAnswers()[this.mapAnswerToValue(t, ["A", "C", "D", "B"])] : null
  504. }
  505. validateQ7() {
  506. const t = this.getAnswers(7);
  507. return t ? "B" === t : null
  508. }
  509. validateQ8() {
  510. const t = this.getAnswers(8);
  511. if (!t) return null;
  512. const e = this.mapAnswerToValue(t, [1, 2, 2, 4]);
  513. return this.aggregateAnswers()[t] - 1 === e
  514. }
  515. validateQ9() {
  516. const t = this.getAnswers(9);
  517. if (!t) return null;
  518. switch (t) {
  519. case"A":
  520. return !0;
  521. case"B":
  522. return !1;
  523. case"C":
  524. return !0;
  525. case"D":
  526. return !1
  527. }
  528. }
  529. validateQ10() {
  530. const t = this.getAnswers(10);
  531. return t ? "D" !== t : null
  532. }
  533. }, "simple-srq-1": class extends l {
  534. constructor() {
  535. super(), w(this, "ANSWERS_LETTERS", "ABCD".split("")), w(this, "TOTAL_ANSWERS", 4), w(this, "TOTAL_QUESTIONS", 5)
  536. }
  537. validade() {
  538. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5()]
  539. }
  540. validateQ1() {
  541. const t = this.getAnswers(1);
  542. return t ? 1 === this.aggregateAnswers()[t] : null
  543. }
  544. validateQ2() {
  545. const t = this.getAnswers(2);
  546. if (!t) return null;
  547. const e = this.aggregateAnswers(), s = this.mapAnswerToValue(t, [3, 1, 5, 4]);
  548. return t === this.getAnswers(s) && 2 === e[t]
  549. }
  550. validateQ3() {
  551. const t = this.getAnswers(3);
  552. return t ? this.mapAnswerToValue(t, ["B", "D", "A", "C"]) === this.getAnswers(5) : null
  553. }
  554. validateQ4() {
  555. const t = this.getAnswers(4);
  556. if (!t) return null;
  557. const e = this.mapAnswerToValue(t, [2, 3, 4, 5]);
  558. return this.answers.indexOf("A") === e - 1
  559. }
  560. validateQ5() {
  561. const t = this.getAnswers(5);
  562. return t ? this.mapAnswerToValue(t, ["C", "B", "D", "A"]) === this.getAnswers(3) : null
  563. }
  564. }, "simple-srq-2": class extends l {
  565. constructor() {
  566. super(), g(this, "ANSWERS_LETTERS", "ABCDE".split("")), g(this, "TOTAL_ANSWERS", 5), g(this, "TOTAL_QUESTIONS", 10)
  567. }
  568. validade() {
  569. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8(), this.validateQ9(), this.validateQ10()]
  570. }
  571. validateQ1() {
  572. return !!this.getAnswers(1) || null
  573. }
  574. validateQ2() {
  575. const t = this.getAnswers(2);
  576. if (!t) return null;
  577. const e = this.aggregateAnswers(), s = this.mapAnswerToValue(t, ["B", "C", "D", "E", "A"]);
  578. return "E" === t ? e.A === e.B && e.A === e.C && e.A === e.D && e.A === e.E : e.A === e[s]
  579. }
  580. validateQ3() {
  581. const t = this.getAnswers(3);
  582. return t ? this.mapAnswerToValue(t, ["E", "D", "C", "B", "A"]) === this.getAnswers(10) : null
  583. }
  584. validateQ4() {
  585. const t = this.getAnswers(4);
  586. return t ? this.mapAnswerToValue(t, ["A", "B", "C", "D", "E"]) === this.getAnswers(6) : null
  587. }
  588. validateQ5() {
  589. const t = this.getAnswers(5);
  590. if (!t) return null;
  591. const e = this.mapAnswerToValue(t, [3, 4, 5, 6, 7]);
  592. return t === this.getAnswers(e)
  593. }
  594. validateQ6() {
  595. const t = this.getAnswers(6);
  596. if (!t) return null;
  597. const e = this.mapAnswerToValue(t, [3, 4, 5, 6, 7]);
  598. return this.answers.indexOf("B") === e - 1
  599. }
  600. validateQ7() {
  601. const t = this.getAnswers(7);
  602. return t ? this.mapAnswerToValue(t, [0, 1, 2, 3, 4]) === this.aggregateAnswers().C : null
  603. }
  604. validateQ8() {
  605. const t = this.getAnswers(8);
  606. if (!t) return null;
  607. const e = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), s = this.getAnswers(9);
  608. if (!s) return !1;
  609. const n = this.mapAnswerToValue(s, [0, 1, 2, 3, 4]), r = this.mapAnswerToValue(t, [4, 3, 2, 1, 0]);
  610. return Math.abs(n - e) === r
  611. }
  612. validateQ9() {
  613. const t = this.getAnswers(9);
  614. if (!t) return null;
  615. const e = this.aggregateAnswers(), s = e.A + e.E;
  616. switch (t) {
  617. case"A":
  618. return -1 !== [0, 2, 4, 6, 8, 10].indexOf(s);
  619. case"B":
  620. return -1 !== [1, 3, 5, 7, 9].indexOf(s);
  621. case"C":
  622. return -1 !== [1, 2, 3, 5, 7].indexOf(s);
  623. case"D":
  624. return -1 !== [1, 4, 9].indexOf(s);
  625. case"E":
  626. return -1 !== [5, 10].indexOf(s)
  627. }
  628. }
  629. validateQ10() {
  630. const t = this.getAnswers(10);
  631. return t ? this.mapAnswerToValue(t, ["C", "D", "A", "B", "E"]) === this.getAnswers(3) : null
  632. }
  633. }, "simple-srq-3": class extends l {
  634. constructor() {
  635. super(), v(this, "ANSWERS_LETTERS", "ABCDE".split("")), v(this, "TOTAL_ANSWERS", 5), v(this, "TOTAL_QUESTIONS", 5)
  636. }
  637. validade() {
  638. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5()]
  639. }
  640. validateQ1() {
  641. const t = this.getAnswers(1);
  642. if (!t) return null;
  643. if ("E" === t) {
  644. return 0 == this.aggregateAnswers().A
  645. }
  646. {
  647. const e = Object(i.range)(2, 6, 1).map(t => this.getAnswers(t)).indexOf("A");
  648. return this.mapAnswerToValue(t, [0, 1, 2, 3]) === e
  649. }
  650. }
  651. validateQ2() {
  652. const t = this.getAnswers(2);
  653. if (!t) return null;
  654. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]), s = this.aggregateAnswers();
  655. return e === s.A + s.E
  656. }
  657. validateQ3() {
  658. const t = this.getAnswers(3);
  659. if (!t) return null;
  660. const e = this.mapAnswerToValue(t, [[2, 5], [2, 4], [1, 3], [1, 4], [3, 5]]),
  661. s = this.aggregateAnswers(), n = this.getAnswers(e[0]), r = this.getAnswers(e[1]);
  662. return "C" === n && "C" === r && 2 === s.C
  663. }
  664. validateQ4() {
  665. const t = this.getAnswers(4);
  666. return t ? this.mapAnswerToValue(t, ["A", "C", "B", "D", "E"]) === this.getAnswers(5) : null
  667. }
  668. validateQ5() {
  669. const t = this.getAnswers(5);
  670. return t ? this.mapAnswerToValue(t, ["A", "C", "D", "B", "E"]) === this.getAnswers(4) : null
  671. }
  672. }, "simple-srq-4": class extends l {
  673. constructor() {
  674. super(), f(this, "ANSWERS_LETTERS", "ABCDE".split("")), f(this, "TOTAL_ANSWERS", 5), f(this, "TOTAL_QUESTIONS", 6)
  675. }
  676. validade() {
  677. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6()]
  678. }
  679. validateQ1() {
  680. const t = this.getAnswers(1);
  681. return t ? this.mapAnswerToValue(t, ["E", "D", "C", "B", "A"]) === this.getAnswers(2) : null
  682. }
  683. validateQ2() {
  684. const t = this.getAnswers(2);
  685. if (!t) return null;
  686. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]), s = this.getAnswers(e),
  687. n = Object(i.filter)([1, 2, 3, 4, 5], t => "C" === this.getAnswers(t));
  688. return "C" === s && 1 === n.length
  689. }
  690. validateQ3() {
  691. return !!this.getAnswers(3) || null
  692. }
  693. validateQ4() {
  694. const t = this.getAnswers(4);
  695. if (!t) return null;
  696. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  697. return this.aggregateAnswers().B === e
  698. }
  699. validateQ5() {
  700. const t = this.getAnswers(5);
  701. if (!t) return null;
  702. const e = this.consecutives();
  703. return e[this.mapAnswerToValue(t, [0, 1, 2, 3, 4])] && 1 === e.filter(t => t).length
  704. }
  705. validateQ6() {
  706. const t = this.getAnswers(6);
  707. if (!t) return null;
  708. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  709. return t === this.getAnswers(e)
  710. }
  711. }, srat: class extends l {
  712. constructor() {
  713. super(), Q(this, "ANSWERS_LETTERS", "ABCDE".split("")), Q(this, "TOTAL_ANSWERS", 5), Q(this, "TOTAL_QUESTIONS", 20)
  714. }
  715. validade() {
  716. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8(), this.validateQ9(), this.validateQ10(), this.validateQ11(), this.validateQ12(), this.validateQ13(), this.validateQ14(), this.validateQ15(), this.validateQ16(), this.validateQ17(), this.validateQ18(), this.validateQ19(), this.validateQ20()]
  717. }
  718. validateQ1() {
  719. const t = this.getAnswers(1);
  720. if (!t) return null;
  721. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  722. return this.answers.indexOf("B") === e - 1
  723. }
  724. validateQ2() {
  725. const t = this.getAnswers(2);
  726. if (!t) return null;
  727. const e = this.consecutives(), s = 1 === Object(i.filter)(e, t => t).length,
  728. n = this.mapAnswerToValue(t, [5, 6, 7, 8, 9]);
  729. return s && e[n]
  730. }
  731. validateQ3() {
  732. const t = this.getAnswers(3);
  733. if (!t) return null;
  734. const e = this.aggregateAnswers().E;
  735. return this.mapAnswerToValue(t, [0, 1, 2, 3, 4]) === e
  736. }
  737. validateQ4() {
  738. const t = this.getAnswers(4);
  739. if (!t) return null;
  740. const e = this.aggregateAnswers().A;
  741. return this.mapAnswerToValue(t, [4, 5, 6, 7, 8]) === e
  742. }
  743. validateQ5() {
  744. const t = this.getAnswers(5);
  745. if (!t) return null;
  746. const e = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  747. return t === this.getAnswers(e)
  748. }
  749. validateQ6() {
  750. const t = this.getAnswers(6);
  751. if (!t) return null;
  752. const e = this.getAnswers(17);
  753. switch (t) {
  754. case"D":
  755. if ("C" !== e && "D" !== e && "E" !== e) return !0;
  756. case"E":
  757. return !1;
  758. default:
  759. return this.mapAnswerToValue(t, ["C", "D", "E", "A", "B"]) === e
  760. }
  761. }
  762. validateQ7() {
  763. const t = this.getAnswers(7);
  764. if (!t) return null;
  765. const e = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), s = this.getAnswers(8);
  766. if (!s) return !1;
  767. const n = this.mapAnswerToValue(s, [0, 1, 2, 3, 4]), r = this.mapAnswerToValue(t, [4, 3, 2, 1, 0]);
  768. return Math.abs(n - e) === r
  769. }
  770. validateQ8() {
  771. const t = this.getAnswers(8);
  772. if (!t) return null;
  773. const e = this.mapAnswerToValue(t, [4, 5, 6, 7, 8]), s = this.aggregateAnswers();
  774. return e === s.A + s.E
  775. }
  776. validateQ9() {
  777. const t = this.getAnswers(9);
  778. if (!t) return null;
  779. const e = Object(i.range)(10, 15, 1).map(t => this.getAnswers(t)).indexOf(t);
  780. return this.mapAnswerToValue(t, [0, 1, 2, 3, 4]) === e
  781. }
  782. validateQ10() {
  783. const t = this.getAnswers(10);
  784. return t ? this.mapAnswerToValue(t, ["D", "A", "E", "B", "C"]) === this.getAnswers(16) : null
  785. }
  786. validateQ11() {
  787. const t = this.getAnswers(11);
  788. if (!t) return null;
  789. const e = Object(i.range)(1, 11, 1).map(t => this.getAnswers(t));
  790. return this.mapAnswerToValue(t, [0, 1, 2, 3, 4]) === Object(i.filter)(e, t => "B" === t).length
  791. }
  792. validateQ12() {
  793. const t = this.getAnswers(12);
  794. if (!t) return null;
  795. const e = this.aggregateAnswers(), s = e.B + e.C + e.D;
  796. switch (t) {
  797. case"A":
  798. return -1 !== [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20].indexOf(s);
  799. case"B":
  800. return -1 !== [1, 3, 5, 7, 9, 11, 13, 15, 17, 19].indexOf(s);
  801. case"C":
  802. return -1 !== [1, 4, 9, 16].indexOf(s);
  803. case"D":
  804. return -1 !== [1, 2, 3, 5, 7, 11, 13, 17].indexOf(s);
  805. case"E":
  806. return -1 !== [5, 10, 15, 20].indexOf(s)
  807. }
  808. }
  809. validateQ13() {
  810. const t = this.getAnswers(13);
  811. if (!t) return null;
  812. this.aggregateAnswers();
  813. const e = this.mapAnswerToValue(t, [9, 11, 13, 15, 17]), s = this.getAnswers(e),
  814. n = Object(i.filter)([19, 17, 15, 13, 11, 9, 7, 5, 3, 1], t => "A" === this.getAnswers(t));
  815. return "A" === s && 1 === n.length
  816. }
  817. validateQ14() {
  818. const t = this.getAnswers(14);
  819. if (!t) return null;
  820. const e = this.aggregateAnswers().D;
  821. return this.mapAnswerToValue(t, [6, 7, 8, 9, 10]) === e
  822. }
  823. validateQ15() {
  824. const t = this.getAnswers(15);
  825. return t ? this.mapAnswerToValue(t, ["A", "B", "C", "D", "E"]) === this.getAnswers(12) : null
  826. }
  827. validateQ16() {
  828. const t = this.getAnswers(16);
  829. return t ? this.mapAnswerToValue(t, ["D", "C", "B", "A", "E"]) === this.getAnswers(10) : null
  830. }
  831. validateQ17() {
  832. const t = this.getAnswers(17);
  833. if (!t) return null;
  834. const e = this.getAnswers(6);
  835. switch (t) {
  836. case"D":
  837. if ("C" !== e && "D" !== e && "E" !== e) return !0;
  838. case"E":
  839. return !1;
  840. default:
  841. return this.mapAnswerToValue(t, ["C", "D", "E", "A", "B"]) === e
  842. }
  843. }
  844. validateQ18() {
  845. const t = this.getAnswers(18);
  846. if (!t) return null;
  847. const e = this.aggregateAnswers(), s = this.mapAnswerToValue(t, ["B", "C", "D", "E", "A"]);
  848. return "E" === t ? e.A !== e.B && e.A !== e.C && e.A !== e.D && e.A !== e.E : e.A === e[s]
  849. }
  850. validateQ19() {
  851. return !!this.getAnswers(19) || null
  852. }
  853. validateQ20() {
  854. const t = this.getAnswers(20);
  855. return t ? "E" === t : null
  856. }
  857. }, "dont-be-puzzled": class extends l {
  858. constructor() {
  859. super(), p(this, "ANSWERS_LETTERS", "ABCDE".split("")), p(this, "TOTAL_ANSWERS", 5), p(this, "TOTAL_QUESTIONS", 10)
  860. }
  861. validade() {
  862. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8(), this.validateQ9(), this.validateQ10()]
  863. }
  864. validateQ1() {
  865. const t = this.getAnswers(1);
  866. if (!t) return null;
  867. const e = this.mapAnswerToValue(t, [4, 3, 2, 1, 1]), s = this.answers.indexOf("A");
  868. return "E" === t ? s > 3 || -1 === s : s === e - 1
  869. }
  870. validateQ2() {
  871. const t = this.getAnswers(2);
  872. return t ? this.consecutives()[this.mapAnswerToValue(t, [2, 3, 4, 5, 6])] : null
  873. }
  874. validateQ3() {
  875. const t = this.getAnswers(3);
  876. if (!t) return null;
  877. const e = Object(i.range)(4, 9, 1).map(t => this.getAnswers(t)).indexOf("A");
  878. return this.mapAnswerToValue(t, [0, 1, 2, 3, 4]) === e
  879. }
  880. validateQ4() {
  881. const t = this.getAnswers(4);
  882. if (!t) return null;
  883. [2, 4, 6, 8, 10].map(t => this.getAnswers(t));
  884. const e = this.mapAnswerToValue(t, [2, 4, 6, 8, 10]);
  885. return this.answers.indexOf("B") === e - 1
  886. }
  887. validateQ5() {
  888. const t = this.getAnswers(5);
  889. if (!t) return null;
  890. this.aggregateAnswers();
  891. const e = this.mapAnswerToValue(t, [1, 3, 5, 7, 9]), s = this.getAnswers(e),
  892. n = Object(i.filter)([1, 3, 5, 7, 9], t => "C" === this.getAnswers(t));
  893. return "C" === s && 1 === n.length
  894. }
  895. validateQ6() {
  896. const t = this.getAnswers(6);
  897. if (!t) return null;
  898. const e = Object(i.filter)([1, 2, 3, 4, 5], t => "D" === this.getAnswers(t)),
  899. s = Object(i.filter)([7, 8, 9, 10], t => "D" === this.getAnswers(t)), n = e.length >= 1,
  900. r = s.length >= 1;
  901. switch (t) {
  902. case"A":
  903. return n && !r;
  904. case"B":
  905. return !n && r;
  906. case"C":
  907. return n && r;
  908. case"D":
  909. case"E":
  910. return !1
  911. }
  912. }
  913. validateQ7() {
  914. const t = this.getAnswers(7);
  915. if (!t) return null;
  916. const e = Object(i.range)(5, 10, 1).map(t => this.getAnswers(t)),
  917. s = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), n = e.lastIndexOf("E");
  918. return -1 !== n && n === s
  919. }
  920. validateQ8() {
  921. const t = this.getAnswers(8);
  922. if (!t) return null;
  923. const e = this.aggregateAnswers();
  924. return this.mapAnswerToValue(t, [7, 6, 5, 4, 3]) === e.B + e.C + e.D
  925. }
  926. validateQ9() {
  927. const t = this.getAnswers(9);
  928. if (!t) return null;
  929. const e = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), s = this.aggregateAnswers();
  930. return e === s.A + s.E
  931. }
  932. validateQ10() {
  933. return !!this.getAnswers(10) || null
  934. }
  935. }, "small-srat": class extends l {
  936. constructor() {
  937. super(), T(this, "ANSWERS_LETTERS", "ABCDE".split("")), T(this, "TOTAL_ANSWERS", 5), T(this, "TOTAL_QUESTIONS", 10)
  938. }
  939. validade() {
  940. return [this.validateQ1(), this.validateQ2(), this.validateQ3(), this.validateQ4(), this.validateQ5(), this.validateQ6(), this.validateQ7(), this.validateQ8(), this.validateQ9(), this.validateQ10()]
  941. }
  942. validateQ1() {
  943. const t = this.getAnswers(1);
  944. if (!t) return null;
  945. const e = this.mapAnswerToValue(t, [2, 3, 4, 5, 6]);
  946. return this.answers.indexOf("B") === e - 1
  947. }
  948. validateQ2() {
  949. const t = this.getAnswers(2);
  950. if (!t) return null;
  951. const e = this.consecutives(), s = 1 === Object(i.filter)(e, t => t).length,
  952. n = this.mapAnswerToValue(t, [1, 2, 3, 4, 5]);
  953. return s && e[n]
  954. }
  955. validateQ3() {
  956. const t = this.getAnswers(3);
  957. if (!t) return null;
  958. const e = Object(i.range)(6, 11, 1).map(t => this.getAnswers(t)),
  959. s = this.mapAnswerToValue(t, [4, 3, 2, 1, 0]), n = e.lastIndexOf(t);
  960. return -1 !== n && n === s
  961. }
  962. validateQ4() {
  963. const t = this.getAnswers(4);
  964. if (!t) return null;
  965. const e = this.aggregateAnswers().A;
  966. return this.mapAnswerToValue(t, [0, 1, 2, 3, 4]) === e
  967. }
  968. validateQ5() {
  969. const t = this.getAnswers(5);
  970. if (!t) return null;
  971. const e = this.mapAnswerToValue(t, [10, 9, 8, 7, 6]);
  972. return t === this.getAnswers(e)
  973. }
  974. validateQ6() {
  975. const t = this.getAnswers(6);
  976. if (!t) return null;
  977. const e = this.aggregateAnswers(), s = this.mapAnswerToValue(t, ["B", "C", "D", "E", "A"]);
  978. return "E" === t ? e.A !== e.B && e.A !== e.C && e.A !== e.D && e.A !== e.E : e.A === e[s]
  979. }
  980. validateQ7() {
  981. const t = this.getAnswers(7);
  982. if (!t) return null;
  983. const e = this.mapAnswerToValue(t, [0, 1, 2, 3, 4]), s = this.getAnswers(8);
  984. if (!s) return !1;
  985. const n = this.mapAnswerToValue(s, [0, 1, 2, 3, 4]), r = this.mapAnswerToValue(t, [4, 3, 2, 1, 0]);
  986. return Math.abs(n - e) === r
  987. }
  988. validateQ8() {
  989. const t = this.getAnswers(8);
  990. if (!t) return null;
  991. const e = this.mapAnswerToValue(t, [2, 3, 4, 5, 6]), s = this.aggregateAnswers();
  992. return e === s.A + s.E
  993. }
  994. validateQ9() {
  995. const t = this.getAnswers(9);
  996. if (!t) return null;
  997. const e = this.aggregateAnswers(), s = e.B + e.C + e.D;
  998. switch (t) {
  999. case"A":
  1000. return -1 !== [1, 2, 3, 5, 7].indexOf(s);
  1001. case"B":
  1002. return -1 !== [1, 2, 6].indexOf(s);
  1003. case"C":
  1004. return -1 !== [1, 4, 9].indexOf(s);
  1005. case"D":
  1006. return -1 !== [1, 8].indexOf(s);
  1007. case"E":
  1008. return -1 !== [5, 10].indexOf(s)
  1009. }
  1010. }
  1011. validateQ10() {
  1012. return !!this.getAnswers(10) || null
  1013. }
  1014. }
  1015. };
  1016. class E {
  1017. constructor(t) {
  1018. this.won = !1, this.puzzle = t, this.$questions = r()("div[data-question]"), this.setupListeners();
  1019. const e = new m[this.puzzle.slug];
  1020. this.quiz = e, this.answers_state = Object(i.range)(e.TOTAL_QUESTIONS).map(() => Object(i.range)(e.TOTAL_ANSWERS).map(() => null))
  1021. }
  1022. canToggle(t, e) {
  1023. const {answers_state: s} = this;
  1024. return !0 === s[t][e] || !Object(i.some)(s[t])
  1025. }
  1026. toggle(t, e) {
  1027. if (!this.canToggle(t, e)) return;
  1028. const {answers_state: s} = this;
  1029. s[t][e] = {null: !1, true: null, false: !0}[s[t][e]]
  1030. }
  1031. onClick(t, e) {
  1032. this.toggle(t, e), this.update()
  1033. }
  1034. update() {
  1035. const t = this.getAnswers();
  1036. this.quiz.update(t);
  1037. const e = this.quiz.validade();
  1038. this.updateUI(e), Object(i.every)(e) && !this.won && (this.won = !0, a.a.modalEndGame(), amplitude.getInstance().logEvent("srq-win", {slug: puzzle.slug}))
  1039. }
  1040. updateUI(t) {
  1041. Object(i.forEach)(this.$questions, (e, s) => {
  1042. const n = r()(e);
  1043. n.removeClass("correct wrong");
  1044. const i = t[s];
  1045. null !== i && n.addClass(i ? "correct" : "wrong")
  1046. }), Object(i.forEach)(this.$questions, (t, e) => {
  1047. const s = r()(t).find("ul > li"), n = Object(i.some)(this.answers_state[e]);
  1048. Object(i.forEach)(s, (t, s) => {
  1049. const i = r()(t);
  1050. i.removeClass();
  1051. const a = this.answers_state[e][s];
  1052. !0 === a ? i.addClass("correct") : ((!1 === a || n) && i.addClass("wrong"), n && i.addClass("inactive"))
  1053. })
  1054. })
  1055. }
  1056. setupListeners() {
  1057. this.$questions.on("click", "ul > li", t => {
  1058. const e = r()(t.currentTarget);
  1059. this.onClick(e.data("question"), e.data("alternative"))
  1060. })
  1061. }
  1062. getAnswers() {
  1063. return this.answers_state.map(t => {
  1064. const e = t.indexOf(!0);
  1065. return -1 != e ? this.quiz.ANSWERS_LETTERS[e] : null
  1066. })
  1067. }
  1068. }
  1069. let O = null;
  1070. window.loadSRQ = t => {
  1071. O = new E(t)
  1072. }
  1073. }, 16: function (t, e) {
  1074. var s;
  1075. s = function () {
  1076. return this
  1077. }();
  1078. try {
  1079. s = s || new Function("return this")()
  1080. } catch (t) {
  1081. "object" == typeof window && (s = window)
  1082. }
  1083. t.exports = s
  1084. }, 21: function (t, e, s) {
  1085. "use strict";
  1086. s.d(e, "b", (function () {
  1087. return i
  1088. })), s.d(e, "a", (function () {
  1089. return a
  1090. }));
  1091. var n = s(3);
  1092. function r(t, e, s) {
  1093. return e in t ? Object.defineProperty(t, e, {
  1094. value: s,
  1095. enumerable: !0,
  1096. configurable: !0,
  1097. writable: !0
  1098. }) : t[e] = s, t
  1099. }
  1100. class i {
  1101. constructor(t) {
  1102. r(this, "$div", void 0), r(this, "$overlay", void 0), this.$div = t, this.$overlay = $('\n <div class="overlay-endgame">\n <div class="brand-wrapper">\n <div class="brand"></div>\n </div>\n </div>')
  1103. }
  1104. show() {
  1105. return this.$div.append(this.$overlay)
  1106. }
  1107. hide() {
  1108. return this.$overlay.remove()
  1109. }
  1110. }
  1111. class a {
  1112. static modalBase(t, e) {
  1113. const s = $("#modal-".concat(t));
  1114. if (s.data("has-template")) {
  1115. const r = s.find(".modal-body"), i = $("#templateBody-".concat(t)),
  1116. a = Object(n.template)(i[0].innerHTML);
  1117. r.html(a(e))
  1118. }
  1119. return s.modal("show")
  1120. }
  1121. static modalEndGame(t) {
  1122. const e = this.modalBase("end-game", t);
  1123. return new Promise(t => {
  1124. e.on("hidden.bs.modal", () => t())
  1125. })
  1126. }
  1127. }
  1128. }, 24: function (t, e) {
  1129. t.exports = function (t) {
  1130. return t.webpackPolyfill || (t.deprecate = function () {
  1131. }, t.paths = [], t.children || (t.children = []), Object.defineProperty(t, "loaded", {
  1132. enumerable: !0,
  1133. get: function () {
  1134. return t.l
  1135. }
  1136. }), Object.defineProperty(t, "id", {
  1137. enumerable: !0, get: function () {
  1138. return t.i
  1139. }
  1140. }), t.webpackPolyfill = 1), t
  1141. }
  1142. }
  1143. });
  1144. console.log(1);