daily-question 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +38 -26
- package/client.js +250 -144
- package/cordis.patch.yml +1 -1
- package/icon.svg +10 -7
- package/index.js +6 -6
- package/lib/bank.js +53 -36
- package/lib/exam-dates.js +101 -67
- package/lib/generate.js +62 -25
- package/lib/generation-history.js +8 -0
- package/lib/paper-types.js +47 -0
- package/lib/reference-reader.js +11 -8
- package/lib/references.js +72 -26
- package/lib/research.js +22 -13
- package/lib/routes.js +62 -95
- package/lib/service.js +73 -72
- package/lib/store.js +3 -8
- package/lib/subjects.js +12 -0
- package/package.json +2 -2
- package/vendor/mathjax/a11y/assistive-mml.js +1 -0
- package/vendor/mathjax/input/tex/extensions/action.js +1 -0
- package/vendor/mathjax/input/tex/extensions/ams.js +1 -0
- package/vendor/mathjax/input/tex/extensions/amscd.js +1 -0
- package/vendor/mathjax/input/tex/extensions/autoload.js +1 -0
- package/vendor/mathjax/input/tex/extensions/bbm.js +1 -0
- package/vendor/mathjax/input/tex/extensions/bboldx.js +1 -0
- package/vendor/mathjax/input/tex/extensions/bbox.js +1 -0
- package/vendor/mathjax/input/tex/extensions/begingroup.js +1 -0
- package/vendor/mathjax/input/tex/extensions/boldsymbol.js +1 -0
- package/vendor/mathjax/input/tex/extensions/braket.js +1 -0
- package/vendor/mathjax/input/tex/extensions/bussproofs.js +1 -0
- package/vendor/mathjax/input/tex/extensions/cancel.js +1 -0
- package/vendor/mathjax/input/tex/extensions/cases.js +1 -0
- package/vendor/mathjax/input/tex/extensions/centernot.js +1 -0
- package/vendor/mathjax/input/tex/extensions/color.js +1 -0
- package/vendor/mathjax/input/tex/extensions/colortbl.js +1 -0
- package/vendor/mathjax/input/tex/extensions/colorv2.js +1 -0
- package/vendor/mathjax/input/tex/extensions/configmacros.js +1 -0
- package/vendor/mathjax/input/tex/extensions/dsfont.js +1 -0
- package/vendor/mathjax/input/tex/extensions/empheq.js +1 -0
- package/vendor/mathjax/input/tex/extensions/enclose.js +1 -0
- package/vendor/mathjax/input/tex/extensions/extpfeil.js +1 -0
- package/vendor/mathjax/input/tex/extensions/fontsizev3.js +1 -0
- package/vendor/mathjax/input/tex/extensions/gensymb.js +1 -0
- package/vendor/mathjax/input/tex/extensions/html.js +1 -0
- package/vendor/mathjax/input/tex/extensions/mathtools.js +1 -0
- package/vendor/mathjax/input/tex/extensions/mhchem.js +34 -0
- package/vendor/mathjax/input/tex/extensions/newcommand.js +1 -0
- package/vendor/mathjax/input/tex/extensions/noerrors.js +1 -0
- package/vendor/mathjax/input/tex/extensions/noundefined.js +1 -0
- package/vendor/mathjax/input/tex/extensions/physics.js +1 -0
- package/vendor/mathjax/input/tex/extensions/require.js +1 -0
- package/vendor/mathjax/input/tex/extensions/setoptions.js +1 -0
- package/vendor/mathjax/input/tex/extensions/tagformat.js +1 -0
- package/vendor/mathjax/input/tex/extensions/texhtml.js +1 -0
- package/vendor/mathjax/input/tex/extensions/textcomp.js +1 -0
- package/vendor/mathjax/input/tex/extensions/textmacros.js +1 -0
- package/vendor/mathjax/input/tex/extensions/unicode.js +1 -0
- package/vendor/mathjax/input/tex/extensions/units.js +1 -0
- package/vendor/mathjax/input/tex/extensions/upgreek.js +1 -0
- package/vendor/mathjax/input/tex/extensions/verb.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/PUA.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/accents-b-i.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/accents.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/arabic.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/arrows.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/braille-d.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/braille.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/calligraphic.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/cherokee.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/cyrillic-ss.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/cyrillic.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/devanagari.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/double-struck.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/fraktur.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/greek-ss.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/greek.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/hebrew.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/latin-b.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/latin-bi.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/latin-i.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/latin.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/marrows.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/math.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/monospace-ex.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/monospace-l.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/monospace.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/mshapes.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/phonetics-ss.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/phonetics.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/sans-serif-b.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/sans-serif-bi.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/sans-serif-ex.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/sans-serif-i.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/sans-serif-r.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/sans-serif.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/script.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/shapes.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/symbols-b-i.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/symbols.js +1 -0
- package/vendor/mathjax/newcm/svg/dynamic/variants.js +1 -0
- package/vendor/mathjax/tex-svg.js +1 -34
package/lib/service.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto'
|
|
2
|
-
import { findSubject, allSubjects, QUESTION_TYPE_LABEL, CHOICE_TYPES, subjectTypes, REFERENCE_EXAMS } from './subjects.js'
|
|
2
|
+
import { findSubject, allSubjects, QUESTION_TYPE_LABEL, CHOICE_TYPES, hasChoiceOptions, validChoiceKey, subjectTypes, REFERENCE_EXAMS } from './subjects.js'
|
|
3
3
|
import { computeCountdown, resolveExamDate, todayISO, verifyExamDateOnline, yearOptions } from './exam-dates.js'
|
|
4
4
|
import { createVerifiedQuestion, QuestionGenerationError, reviseAnswer } from './generate.js'
|
|
5
5
|
import { answerFollowup } from './tutor.js'
|
|
6
|
-
import { parseBankText, extractBankPdf } from './bank.js'
|
|
6
|
+
import { parseBankText, extractBankPdf, isUsableBankItem } from './bank.js'
|
|
7
7
|
import { Store, resolveDataDir } from './store.js'
|
|
8
8
|
import { createUpdateChecker, PLUGIN_VERSION } from './updates.js'
|
|
9
9
|
import { withTimeout } from './async.js'
|
|
@@ -56,6 +56,8 @@ function normalizeChoice(value, question) {
|
|
|
56
56
|
for (const letter of upper) {
|
|
57
57
|
if (!keys.includes(letter)) throw new Error(`选项 ${letter} 不在本题选项中`)
|
|
58
58
|
}
|
|
59
|
+
if (question.type !== 'multiple' && upper.length !== 1) throw new Error('本题只能选择一个选项')
|
|
60
|
+
if (new Set(upper).size !== upper.length) throw new Error('选项不能重复')
|
|
59
61
|
return upper.split('').sort().join('')
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -204,7 +206,7 @@ export class DailyQuestionService {
|
|
|
204
206
|
enabled: enabled.has(subject.id),
|
|
205
207
|
source: data.settings.subjectSource[subject.id] || 'auto',
|
|
206
208
|
bankItemCount: usableBanks.reduce((total, bank) => total
|
|
207
|
-
+ bank.items.filter((item) => item
|
|
209
|
+
+ bank.items.filter((item) => isUsableBankItem(item) && (!item.type || allowed.has(item.type))).length, 0),
|
|
208
210
|
}
|
|
209
211
|
})
|
|
210
212
|
}
|
|
@@ -218,23 +220,22 @@ export class DailyQuestionService {
|
|
|
218
220
|
subjectId: bank.subjectId || '',
|
|
219
221
|
importedAt: bank.importedAt,
|
|
220
222
|
itemCount: bank.items.length,
|
|
221
|
-
usable: bank.items.filter(
|
|
223
|
+
usable: bank.items.filter(isUsableBankItem).length,
|
|
222
224
|
pendingAnswers: bank.items.filter((item) => item.answerStatus !== 'verified').length,
|
|
223
225
|
}))
|
|
224
226
|
}
|
|
225
227
|
|
|
226
228
|
counts(data) {
|
|
227
|
-
const result =
|
|
228
|
-
const
|
|
229
|
-
for(const id of enabled)result[id]={all:0,favorite:0,wrong:0}
|
|
229
|
+
const result = Object.create(null)
|
|
230
|
+
for (const id of data.settings.subjects) result[id] = { all: 0, favorite: 0, wrong: 0 }
|
|
230
231
|
for(const question of Object.values(data.questions)) {
|
|
231
|
-
if(!
|
|
232
|
-
const count=result[question.subjectId]
|
|
232
|
+
if (!question.subjectId) continue
|
|
233
|
+
const count = result[question.subjectId] ??= { all: 0, favorite: 0, wrong: 0 }
|
|
233
234
|
count.all++
|
|
234
235
|
if(question.favoriteAt)count.favorite++
|
|
235
236
|
if(this.isWrong(question,this.attemptsOf(data,question.id)))count.wrong++
|
|
236
237
|
}
|
|
237
|
-
return result
|
|
238
|
+
return { ...result }
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
isWrong(question, attempts) {
|
|
@@ -419,6 +420,7 @@ export class DailyQuestionService {
|
|
|
419
420
|
|
|
420
421
|
await this.store.update((draft) => {
|
|
421
422
|
signal?.throwIfAborted()
|
|
423
|
+
if (!draft.settings.subjects.includes(subject.id)) throw new Error('该科目已停用')
|
|
422
424
|
const history=Object.values(draft.questions).filter(question=>question.subjectId===subject.id)
|
|
423
425
|
if(findQuestionRepeat(generated,indexQuestionHistory(history)))throw new Error('题目与已发布题目重复,已阻止发布,请重试生成新题')
|
|
424
426
|
draft.questions[qid] = record
|
|
@@ -433,8 +435,7 @@ export class DailyQuestionService {
|
|
|
433
435
|
? error.message
|
|
434
436
|
: `在线出题失败:${error?.message || error}`
|
|
435
437
|
await this.store.update((draft) => {
|
|
436
|
-
draft.failures[subject.id] = { at: nowISO(), message }
|
|
437
|
-
return draft
|
|
438
|
+
if (draft.settings.subjects.includes(subject.id)) draft.failures[subject.id] = { at: nowISO(), message }
|
|
438
439
|
}).catch(() => {})
|
|
439
440
|
throw new Error(message)
|
|
440
441
|
}
|
|
@@ -446,7 +447,7 @@ export class DailyQuestionService {
|
|
|
446
447
|
for (const bank of data.banks) {
|
|
447
448
|
if (bank.subjectId && bank.subjectId !== subject.id) continue
|
|
448
449
|
for (const item of bank.items) {
|
|
449
|
-
if (!item
|
|
450
|
+
if (!isUsableBankItem(item)) continue
|
|
450
451
|
const qid = bankQuestionId(bank.id, item.id)
|
|
451
452
|
const existing = data.questions[qid]
|
|
452
453
|
if (existing && existing.subjectId !== subject.id) continue
|
|
@@ -467,6 +468,7 @@ export class DailyQuestionService {
|
|
|
467
468
|
const stamp = nowISO()
|
|
468
469
|
await this.store.update((draft) => {
|
|
469
470
|
signal?.throwIfAborted()
|
|
471
|
+
if (!draft.settings.subjects.includes(subject.id)) throw new Error('该科目已停用')
|
|
470
472
|
const existing = draft.questions[qid]
|
|
471
473
|
if (existing) {
|
|
472
474
|
existing.assignedCount = (existing.assignedCount || 1) + 1
|
|
@@ -546,6 +548,8 @@ export class DailyQuestionService {
|
|
|
546
548
|
const revealed = currentAttempts.length > 0
|
|
547
549
|
const last = (attemptId ? currentAttempts.find((attempt) => attempt.id === attemptId) : currentAttempts[currentAttempts.length - 1]) || null
|
|
548
550
|
const answer = question.currentAnswer
|
|
551
|
+
const isChoice = CHOICE_TYPES.has(question.type)
|
|
552
|
+
const canSelect = isChoice && hasChoiceOptions(question.options)
|
|
549
553
|
return {
|
|
550
554
|
id: question.id,
|
|
551
555
|
subjectId: question.subjectId,
|
|
@@ -553,7 +557,8 @@ export class DailyQuestionService {
|
|
|
553
557
|
type: question.type,
|
|
554
558
|
typeLabel: QUESTION_TYPE_LABEL[question.type] || question.type,
|
|
555
559
|
/** 完形填空 / 阅读理解按选择题判分,前端据此渲染选项而不是“作答完毕”。 */
|
|
556
|
-
isChoice
|
|
560
|
+
isChoice,
|
|
561
|
+
canSelect,
|
|
557
562
|
stem: question.stem,
|
|
558
563
|
options: question.options || [],
|
|
559
564
|
knowledge: question.knowledge || [],
|
|
@@ -566,7 +571,7 @@ export class DailyQuestionService {
|
|
|
566
571
|
paperEvidence: revealed ? question.examAlignment.paperEvidence : [],
|
|
567
572
|
} : null,
|
|
568
573
|
source: question.source,
|
|
569
|
-
assignedDate: isToday?date:question.assignedDate,
|
|
574
|
+
assignedDate: isToday ? date : question.lastAssignedDate || question.assignedDate,
|
|
570
575
|
practiceDate:isToday?date:null,
|
|
571
576
|
todayAttemptCount:isToday?currentAttempts.length:0,
|
|
572
577
|
createdAt: question.createdAt,
|
|
@@ -602,7 +607,7 @@ export class DailyQuestionService {
|
|
|
602
607
|
? {
|
|
603
608
|
versionId: answer.versionId,
|
|
604
609
|
answer: answer.answer,
|
|
605
|
-
answerKey: answer.answerKey
|
|
610
|
+
answerKey: canSelect && validChoiceKey(question.type, answer.answerKey, question.options) ? answer.answerKey : '',
|
|
606
611
|
explanation: answer.explanation,
|
|
607
612
|
verified: Boolean(answer.verified),
|
|
608
613
|
basis: answer.basis,
|
|
@@ -638,12 +643,13 @@ export class DailyQuestionService {
|
|
|
638
643
|
typeLabel: QUESTION_TYPE_LABEL[question.type] || question.type,
|
|
639
644
|
summary: summariseStem(question.stem),
|
|
640
645
|
stem: question.stem,
|
|
641
|
-
assignedDate: question.assignedDate,
|
|
646
|
+
assignedDate: question.lastAssignedDate || question.assignedDate,
|
|
642
647
|
attemptCount: attempts.length,
|
|
643
648
|
favorite: Boolean(question.favoriteAt),
|
|
644
649
|
wrongEver: this.isWrong(question, attempts),
|
|
645
650
|
mastered: last ? last.result === 'correct' : false,
|
|
646
651
|
difficulty: question.difficulty || 3,
|
|
652
|
+
difficultyUnverified: question.examAlignment?.status === 'difficulty-unverified',
|
|
647
653
|
knowledge: question.knowledge || [],
|
|
648
654
|
answerStatus: question.answerStatusRaw || 'verified',
|
|
649
655
|
}
|
|
@@ -666,7 +672,7 @@ export class DailyQuestionService {
|
|
|
666
672
|
const record = data.daily[`${todayISO()}|${subjectId}`]
|
|
667
673
|
questions = questions.filter((question) => question.id === record?.questionId)
|
|
668
674
|
}
|
|
669
|
-
questions.sort((a, b) => String(b.assignedDate).localeCompare(String(a.assignedDate))
|
|
675
|
+
questions.sort((a, b) => String(b.lastAssignedDate || b.assignedDate).localeCompare(String(a.lastAssignedDate || a.assignedDate))
|
|
670
676
|
|| String(b.createdAt).localeCompare(String(a.createdAt)) || String(b.id).localeCompare(String(a.id)))
|
|
671
677
|
const total=questions.length,totalPages=Math.max(1,Math.ceil(total/pageSize))
|
|
672
678
|
if(idsOnly===true)return {ok:true,kind,subjectId,total,ids:questions.map(q=>q.id)}
|
|
@@ -680,14 +686,14 @@ export class DailyQuestionService {
|
|
|
680
686
|
}
|
|
681
687
|
}
|
|
682
688
|
|
|
683
|
-
async getQuestion({ qid }) {
|
|
689
|
+
async getQuestion({ qid, attemptId }) {
|
|
684
690
|
const data = await this.data()
|
|
685
691
|
const question = data.questions[qid]
|
|
686
692
|
if (!question) throw new Error('题目不存在(可能已随题库删除而失效)')
|
|
687
693
|
const thread = this.threadView(data, qid)
|
|
688
694
|
const date=todayISO()
|
|
689
695
|
const isToday = data.daily[`${date}|${question.subjectId}`]?.questionId === qid
|
|
690
|
-
return { ok: true, question: this.questionView(data, question, {date}), thread, isToday }
|
|
696
|
+
return { ok: true, question: this.questionView(data, question, { date, attemptId }), thread, isToday }
|
|
691
697
|
}
|
|
692
698
|
|
|
693
699
|
threadView(data, qid) {
|
|
@@ -703,58 +709,46 @@ export class DailyQuestionService {
|
|
|
703
709
|
/* ------------------------------ 作答 ------------------------------ */
|
|
704
710
|
|
|
705
711
|
async reveal({ qid, mode = 'submit', choice = '', attemptId }) {
|
|
706
|
-
const
|
|
707
|
-
const question = data.questions[qid]
|
|
708
|
-
if (!question) throw new Error('题目不存在')
|
|
709
|
-
const isChoice = CHOICE_TYPES.has(question.type)
|
|
710
|
-
let result = 'pending'
|
|
711
|
-
let normalizedChoice = ''
|
|
712
|
-
if (mode === 'submit') {
|
|
713
|
-
if (!isChoice) throw new Error('主观题不支持提交选项')
|
|
714
|
-
normalizedChoice = normalizeChoice(choice, question)
|
|
715
|
-
const key = sortLetters(question.currentAnswer?.answerKey)
|
|
716
|
-
const canGrade = key && key.split('').every((letter) => question.options?.some((option) => option.key === letter))
|
|
717
|
-
&& (question.type !== 'single' || key.length === 1)
|
|
718
|
-
result = canGrade ? (normalizedChoice === key ? 'correct' : 'wrong') : 'pending'
|
|
719
|
-
} else if (mode === 'giveup') {
|
|
720
|
-
result = 'wrong'
|
|
721
|
-
} else if (mode === 'done') {
|
|
722
|
-
result = 'pending'
|
|
723
|
-
} else {
|
|
724
|
-
throw new Error(`未知的作答方式:${mode}`)
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
const stamp = nowISO()
|
|
728
|
-
const attempt = {
|
|
729
|
-
id: attemptId || randomUUID(),
|
|
730
|
-
questionId: qid,
|
|
731
|
-
at: stamp,
|
|
732
|
-
practiceDate:todayISO(new Date(stamp)),
|
|
733
|
-
type: question.type,
|
|
734
|
-
mode,
|
|
735
|
-
choice: normalizedChoice,
|
|
736
|
-
result,
|
|
737
|
-
revealedAt: stamp,
|
|
738
|
-
judgedAt: result === 'pending' ? null : stamp,
|
|
739
|
-
}
|
|
740
|
-
|
|
712
|
+
const id = attemptId || randomUUID()
|
|
741
713
|
const duplicated = await this.store.update((draft) => {
|
|
742
|
-
const
|
|
743
|
-
if (!
|
|
744
|
-
const existing = draft.attempts.find((item) => item.id ===
|
|
714
|
+
const question = draft.questions[qid]
|
|
715
|
+
if (!question) throw new Error('题目不存在')
|
|
716
|
+
const existing = draft.attempts.find((item) => item.id === id)
|
|
745
717
|
if (existing) {
|
|
746
718
|
if (existing.questionId !== qid) throw new Error('作答 ID 已用于其他题目')
|
|
719
|
+
if (existing.mode !== mode || (existing.choice || '') !== (mode === 'submit' ? sortLetters(choice) : '')) {
|
|
720
|
+
throw Object.assign(new Error('本轮已保存另一份作答,请查看已保存的结果'), { code: 'ATTEMPT_CONFLICT' })
|
|
721
|
+
}
|
|
747
722
|
return true
|
|
748
723
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
724
|
+
let result = 'pending'
|
|
725
|
+
let normalizedChoice = ''
|
|
726
|
+
if (mode === 'submit') {
|
|
727
|
+
if (!CHOICE_TYPES.has(question.type)) throw new Error('主观题不支持提交选项')
|
|
728
|
+
if (!hasChoiceOptions(question.options)) throw new Error('选项不完整,请使用“作答完毕”查看答案')
|
|
729
|
+
normalizedChoice = normalizeChoice(choice, question)
|
|
730
|
+
const key = question.currentAnswer?.answerKey
|
|
731
|
+
if (validChoiceKey(question.type, key, question.options)) result = normalizedChoice === sortLetters(key) ? 'correct' : 'wrong'
|
|
732
|
+
} else if (mode === 'giveup') {
|
|
733
|
+
result = 'wrong'
|
|
734
|
+
} else if (mode !== 'done') {
|
|
735
|
+
throw new Error(`未知的作答方式:${mode}`)
|
|
752
736
|
}
|
|
753
|
-
|
|
737
|
+
const stamp = nowISO()
|
|
738
|
+
draft.attempts.push({
|
|
739
|
+
id, questionId: qid, at: stamp, practiceDate: todayISO(new Date(stamp)),
|
|
740
|
+
type: question.type, mode, choice: normalizedChoice, result,
|
|
741
|
+
revealedAt: stamp, judgedAt: result === 'pending' ? null : stamp,
|
|
742
|
+
})
|
|
743
|
+
if (question.currentAnswer && !question.currentAnswer.firstShownAt) {
|
|
744
|
+
question.currentAnswer.firstShownAt = stamp
|
|
745
|
+
}
|
|
746
|
+
question.updatedAt = stamp
|
|
754
747
|
return false
|
|
755
748
|
})
|
|
756
749
|
const fresh = await this.data()
|
|
757
|
-
|
|
750
|
+
if (!fresh.questions[qid]) throw new Error('题目已删除')
|
|
751
|
+
return { ok: true, question: this.questionView(fresh, fresh.questions[qid], { attemptId: id }), duplicated }
|
|
758
752
|
}
|
|
759
753
|
|
|
760
754
|
async judge({ qid, verdict, attemptId }) {
|
|
@@ -1115,12 +1109,13 @@ export class DailyQuestionService {
|
|
|
1115
1109
|
knowledge: item.knowledge,
|
|
1116
1110
|
difficulty: item.difficulty,
|
|
1117
1111
|
issues: item.issues,
|
|
1112
|
+
usable: isUsableBankItem(item),
|
|
1118
1113
|
answerStatus: item.answerStatus,
|
|
1119
1114
|
})),
|
|
1120
1115
|
stats: {
|
|
1121
1116
|
total: parsed.items.length,
|
|
1122
1117
|
withAnswer: parsed.items.filter((item) => item.answer).length,
|
|
1123
|
-
blocked: parsed.items.
|
|
1118
|
+
blocked: parsed.items.length - parsed.usable,
|
|
1124
1119
|
},
|
|
1125
1120
|
}
|
|
1126
1121
|
}
|
|
@@ -1132,10 +1127,14 @@ export class DailyQuestionService {
|
|
|
1132
1127
|
}
|
|
1133
1128
|
}
|
|
1134
1129
|
|
|
1135
|
-
async commitBank({ importId, name, subjectId }) {
|
|
1130
|
+
async commitBank({ importId, name, subjectId, excludedIndexes = [] }) {
|
|
1136
1131
|
const pending = this.imports.get(importId)
|
|
1137
1132
|
if (!pending) throw new Error('导入结果已过期,请重新选择文件导入')
|
|
1138
|
-
|
|
1133
|
+
if (!Array.isArray(excludedIndexes) || excludedIndexes.some((index) => !Number.isInteger(index) || index < 1 || index > pending.items.length)) {
|
|
1134
|
+
throw new Error('导入勾选有误,请重新选择题目')
|
|
1135
|
+
}
|
|
1136
|
+
const excluded = new Set(excludedIndexes)
|
|
1137
|
+
const usable = pending.items.filter((item) => !excluded.has(item.index) && isUsableBankItem(item))
|
|
1139
1138
|
if (!usable.length) throw new Error('没有可用的题目可以入库:请检查文件结构后重新导入')
|
|
1140
1139
|
const bankId = `bank_${randomUUID().slice(0, 8)}`
|
|
1141
1140
|
const bank = {
|
|
@@ -1159,11 +1158,13 @@ export class DailyQuestionService {
|
|
|
1159
1158
|
answerStatus: item.answer ? 'unverified' : 'missing',
|
|
1160
1159
|
})),
|
|
1161
1160
|
}
|
|
1162
|
-
await this.store.update((draft) => {
|
|
1163
|
-
draft.banks.push(bank)
|
|
1164
|
-
return draft
|
|
1165
|
-
})
|
|
1166
1161
|
this.imports.delete(importId)
|
|
1162
|
+
try {
|
|
1163
|
+
await this.store.update((draft) => { draft.banks.push(bank) })
|
|
1164
|
+
} catch (error) {
|
|
1165
|
+
this.imports.set(importId, pending)
|
|
1166
|
+
throw error
|
|
1167
|
+
}
|
|
1167
1168
|
const data = await this.data()
|
|
1168
1169
|
return { ok: true, bank: this.bankViews(data).find((item) => item.id === bankId), banks: this.bankViews(data), subjects: this.subjectViews(data) }
|
|
1169
1170
|
}
|
|
@@ -1240,11 +1241,11 @@ export class DailyQuestionService {
|
|
|
1240
1241
|
const kept = Object.values(data.questions).filter((question) => question.subjectId === subjectId).length
|
|
1241
1242
|
const result = await this.saveSettings({
|
|
1242
1243
|
subjects: remaining,
|
|
1243
|
-
activeSubject: data.settings.activeSubject === subjectId ? (remaining[0] || null) : data.settings.activeSubject,
|
|
1244
|
+
activeSubject: data.settings.activeSubject === subjectId && !kept ? (remaining[0] || null) : data.settings.activeSubject,
|
|
1244
1245
|
})
|
|
1245
1246
|
return {
|
|
1246
1247
|
...result,
|
|
1247
|
-
message: `科目已移出每日出题,历史数据保留:${kept}
|
|
1248
|
+
message: `科目已移出每日出题,历史数据保留:${kept} 道题目及其作答记录可通过“已停用科目”查看。`,
|
|
1248
1249
|
}
|
|
1249
1250
|
}
|
|
1250
1251
|
}
|
package/lib/store.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdir, readFile, rename, writeFile } from 'node:fs/promises'
|
|
2
2
|
import { homedir } from 'node:os'
|
|
3
3
|
import path from 'node:path'
|
|
4
|
+
import { todayISO, yearOptions } from './exam-dates.js'
|
|
4
5
|
|
|
5
6
|
/** Bump when the persisted shape changes incompatibly. */
|
|
6
7
|
export const DATA_VERSION = 1
|
|
@@ -27,7 +28,7 @@ export function emptyData() {
|
|
|
27
28
|
updatedAt: now,
|
|
28
29
|
settings: {
|
|
29
30
|
/** 目标考研年份(入学年份),例如 2028 表示 2028 年入学。 */
|
|
30
|
-
targetYear:
|
|
31
|
+
targetYear: yearOptions()[0],
|
|
31
32
|
/** 已启用科目 id,按用户顺序排列。 */
|
|
32
33
|
subjects: [],
|
|
33
34
|
/** 科目 id -> 'online' | 'bank' | 'auto' */
|
|
@@ -54,12 +55,6 @@ export function emptyData() {
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
/** 默认目标年份:若 12 月考试尚未过去则取今年入学,否则取明年。 */
|
|
58
|
-
function defaultTargetYear() {
|
|
59
|
-
const now = new Date()
|
|
60
|
-
return now.getMonth() >= 11 ? now.getFullYear() + 2 : now.getFullYear() + 1
|
|
61
|
-
}
|
|
62
|
-
|
|
63
58
|
function isPlainObject(value) {
|
|
64
59
|
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
65
60
|
}
|
|
@@ -85,7 +80,7 @@ function normalize(raw) {
|
|
|
85
80
|
data.settings[key] = base.settings[key]
|
|
86
81
|
}
|
|
87
82
|
}
|
|
88
|
-
if (!Number.isFinite(
|
|
83
|
+
if (!Number.isFinite(raw.settings?.targetYear)) data.settings.targetYear = yearOptions(todayISO(), data.examDates)[0]
|
|
89
84
|
data.version = DATA_VERSION
|
|
90
85
|
return data
|
|
91
86
|
}
|
package/lib/subjects.js
CHANGED
|
@@ -22,6 +22,18 @@ export const QUESTION_TYPE_LABEL = {
|
|
|
22
22
|
/** 选择题类题型(判分依据唯一选项)。完形填空与阅读理解同样按四选一判分。 */
|
|
23
23
|
export const CHOICE_TYPES = new Set(['single', 'multiple', 'cloze', 'reading'])
|
|
24
24
|
|
|
25
|
+
export function hasChoiceOptions(options) {
|
|
26
|
+
return Array.isArray(options) && options.length >= 2
|
|
27
|
+
&& options.every((option) => /^[A-H]$/.test(option?.key) && typeof option.text === 'string' && option.text.trim())
|
|
28
|
+
&& new Set(options.map((option) => option.key)).size === options.length
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function validChoiceKey(type, key, options) {
|
|
32
|
+
return typeof key === 'string' && /^[A-H]+$/.test(key) && (type === 'multiple' || key.length === 1)
|
|
33
|
+
&& new Set(key).size === key.length
|
|
34
|
+
&& [...key].every((letter) => options?.some((option) => option?.key === letter))
|
|
35
|
+
}
|
|
36
|
+
|
|
25
37
|
export const SUBJECT_CATALOG = [
|
|
26
38
|
{
|
|
27
39
|
id: 'politics',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "daily-question",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "考研每日一题 — DSH 插件:每科每天一道独立校验过的考研题,含倒计时、错题本、收藏与按题隔离的追问。",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"icon.svg",
|
|
49
49
|
"CHANGELOG.md",
|
|
50
50
|
"lib/*.js",
|
|
51
|
-
"vendor/mathjax
|
|
51
|
+
"vendor/mathjax"
|
|
52
52
|
],
|
|
53
53
|
"dsh": {
|
|
54
54
|
"bundle": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{AssistiveMmlHandler:()=>u,AssistiveMmlMathDocumentMixin:()=>h,AssistiveMmlMathItemMixin:()=>d,LimitedMmlVisitor:()=>m});const s=("undefined"!=typeof window?window:t.g).MathJax._.components.global,i=(s.GLOBAL,s.isObject,s.combineConfig,s.combineDefaults),o=s.combineWithMathJax,a=(s.MathJax,MathJax._.core.MathItem),n=(a.protoItem,a.AbstractMathItem,a.STATE),r=a.newState,l=MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,p=MathJax._.util.Options,c=(p.isObject,p.APPEND,p.REMOVE,p.OPTIONS,p.Expandable,p.expandable);p.makeArray,p.keys,p.copy,p.insert,p.defaultOptions,p.userOptions,p.selectOptions,p.selectOptionsFromKeys,p.separateOptions,p.lookup;class m extends l{getAttributes(t){return super.getAttributes(t).replace(/ ?id=".*?"/,"")}}function d(t){return class extends t{assistiveMml(t,e=!1){if(!(this.state()>=n.ASSISTIVEMML)){if(!this.isEscaped&&(t.options.enableAssistiveMml||e)){const e=t.adaptor,s=t.toMML(this.root).replace(/\n */g,"").replace(/<!--.*?-->/g,""),i=e.firstChild(e.body(e.parse(s,"text/html"))),o=e.node("mjx-assistive-mml",{unselectable:"on",display:this.display?"block":"inline"},[i]);for(const t of e.childNodes(this.typesetRoot))e.setAttribute(t,"aria-hidden","true");e.setStyle(this.typesetRoot,"position","relative"),e.append(this.typesetRoot,o)}this.state(n.ASSISTIVEMML)}}}}function h(t){var e;return(e=class extends t{constructor(...t){super(...t);const e=this.constructor,s=e.ProcessBits;s.has("assistive-mml")||s.allocate("assistive-mml"),this.visitor=new m(this.mmlFactory),this.options.MathItem=d(this.options.MathItem),"addStyles"in this&&this.addStyles(e.assistiveStyles)}toMML(t){return this.visitor.visitTree(t)}assistiveMml(){if(!this.processed.isSet("assistive-mml")){for(const t of this.math)t.assistiveMml(this);this.processed.set("assistive-mml")}return this}state(t,e=!1){return super.state(t,e),t<n.ASSISTIVEMML&&this.processed.clear("assistive-mml"),this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableAssistiveMml:!0,renderActions:c(Object.assign(Object.assign({},t.OPTIONS.renderActions),{assistiveMml:[n.ASSISTIVEMML]}))}),e.assistiveStyles={"mjx-assistive-mml":{position:"absolute !important",top:"0px",left:"0px",bottom:"0px",right:"0px",clip:"rect(1px, 1px, 1px, 1px)","clip-path":"polygon(0 0, 0 1px, 1px 1px, 1px 0)",padding:"1px 0px 0px 0px !important",border:"0px !important",display:"block !important",width:"auto !important",overflow:"hidden !important","text-indent":"0px ! important","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},'mjx-assistive-mml[display="block"]':{width:"100% !important"}},e}function u(t){return t.documentClass=h(t.documentClass),t}r("ASSISTIVEMML",153),MathJax.loader&&MathJax.loader.checkVersion("a11y/assistive-mml","4.1.3","a11y"),o({_:{a11y:{"assistive-mml":e}}}),MathJax.startup&&(MathJax.config.options&&!1!==MathJax.config.options.enableAssistiveMml&&i(MathJax.config,"options",{menuOptions:{settings:{assistiveMml:!0}}}),MathJax.startup.extendHandler(t=>u(t)))})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={d:(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{ActionConfiguration:()=>h,ActionMethods:()=>d});const a=("undefined"!=typeof window?window:t.g).MathJax._.components.global,o=(a.GLOBAL,a.isObject,a.combineConfig,a.combineDefaults,a.combineWithMathJax),n=(a.MathJax,MathJax._.input.tex.HandlerTypes),i=n.ConfigurationType,r=n.HandlerType,c=MathJax._.input.tex.Configuration,p=c.Configuration,s=(c.ConfigurationHandler,c.ParserConfiguration,MathJax._.input.tex.TexParser.default),l=MathJax._.input.tex.TokenMap,u=(l.parseResult,l.AbstractTokenMap,l.RegExpMap,l.AbstractParseMap,l.CharacterMap,l.DelimiterMap,l.MacroMap,l.CommandMap),g=(l.EnvironmentMap,MathJax._.input.tex.base.BaseMethods),M=(g.splitAlignArray,g.default),d={Toggle(t,e){const a=[];let o;for(;"\\endtoggle"!==(o=t.GetArgument(e));)a.push(new s(o,t.stack.env,t.configuration).mml());t.Push(t.create("node","maction",a,{actiontype:"toggle"}))},Mathtip(t,e){const a=t.ParseArg(e),o=t.ParseArg(e);t.Push(t.create("node","maction",[a,o],{actiontype:"tooltip"}))},Macro:M.Macro};new u("action-macros",{toggle:d.Toggle,mathtip:d.Mathtip,texttip:[d.Macro,"\\mathtip{#1}{\\text{#2}}",2]});const h=p.create("action",{[i.HANDLER]:{[r.MACRO]:["action-macros"]}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/action","4.1.3","tex-extension"),o({_:{input:{tex:{action:{ActionConfiguration:e}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={d:(e,a)=>{for(var r in a)t.o(a,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{FlalignItem:()=>v,MultlineItem:()=>w});var a={};t.r(a),t.d(a,{AmsMethods:()=>O});var r={};t.r(r),t.d(r,{AmsConfiguration:()=>K,AmsTags:()=>X});const n=("undefined"!=typeof window?window:t.g).MathJax._.components.global,i=(n.GLOBAL,n.isObject,n.combineConfig,n.combineDefaults,n.combineWithMathJax),l=(n.MathJax,MathJax._.input.tex.HandlerTypes),o=l.ConfigurationType,s=l.HandlerType,m=MathJax._.input.tex.Configuration,c=m.Configuration,h=(m.ConfigurationHandler,m.ParserConfiguration,MathJax._.input.tex.base.BaseItems),d=(h.StartItem,h.StopItem,h.OpenItem,h.CloseItem,h.NullItem,h.PrimeItem,h.SubsupItem,h.OverItem,h.LeftItem,h.Middle,h.RightItem,h.BreakItem,h.BeginItem,h.EndItem,h.StyleItem,h.PositionItem,h.CellItem,h.MmlItem,h.FnItem,h.NotItem,h.NonscriptItem,h.DotsItem,h.ArrayItem),g=h.EqnArrayItem,u=(h.MstyleItem,h.EquationItem,MathJax._.input.tex.ParseUtil),p=(u.KeyValueDef,u.KeyValueTypes,u.ParseUtil),A=MathJax._.input.tex.NodeUtil.default,f=MathJax._.input.tex.TexError.default,b=MathJax._.input.tex.TexConstants.TexConstant;class w extends d{constructor(t,...e){super(t),this.factory.configuration.tags.start("multline",!0,e[0])}get kind(){return"multline"}EndEntry(){this.table.length&&p.fixInitialMO(this.factory.configuration,this.nodes);const t=this.getProperty("shove"),e=this.create("node","mtd",this.nodes,t?{columnalign:t}:{});this.setProperty("shove",null),this.row.push(e),this.Clear()}EndRow(){if(1!==this.row.length)throw new f("MultlineRowsOneCol","The rows within the %1 environment must have exactly one column","multline");const t=this.create("node","mtr",this.row);this.table.push(t),this.row=[]}EndTable(){if(super.EndTable(),this.table.length){const t=this.table.length-1;let e=-1;A.getAttribute(A.getChildren(this.table[0])[0],"columnalign")||A.setAttribute(A.getChildren(this.table[0])[0],"columnalign",b.Align.LEFT),A.getAttribute(A.getChildren(this.table[t])[0],"columnalign")||A.setAttribute(A.getChildren(this.table[t])[0],"columnalign",b.Align.RIGHT);const a=this.factory.configuration.tags.getTag();if(a){e=this.arraydef.side===b.Align.LEFT?0:this.table.length-1;const t=this.table[e],r=this.create("node","mlabeledtr",[a].concat(A.getChildren(t)));A.copyAttributes(t,r),this.table[e]=r}}this.factory.configuration.tags.end()}}class v extends g{get kind(){return"flalign"}constructor(t,e,a,r,n){super(t),this.name=e,this.numbered=a,this.padded=r,this.center=n,this.factory.configuration.tags.start(e,a,a)}EndEntry(){super.EndEntry();const t=this.getProperty("xalignat");if(t&&this.row.length>t)throw new f("XalignOverflow","Extra %1 in row of %2","&",this.name)}EndRow(){let t;const e=this.row,a=this.getProperty("xalignat");for(;e.length<a;)e.push(this.create("node","mtd"));for(this.row=[],this.padded&&this.row.push(this.create("node","mtd"));t=e.shift();)this.row.push(t),t=e.shift(),t&&this.row.push(t),(e.length||this.padded)&&this.row.push(this.create("node","mtd"));this.row.length>this.maxrow&&(this.maxrow=this.row.length),super.EndRow();const r=this.table[this.table.length-1];if(this.getProperty("zeroWidthLabel")&&r.isKind("mlabeledtr")){const t=A.getChildren(r)[0],e=this.factory.configuration.options.tagSide,a=Object.assign({width:0},"right"===e?{lspace:"-1width"}:{}),n=this.create("node","mpadded",A.getChildren(t),a);t.setChildren([n])}}EndTable(){if(super.EndTable(),this.center&&this.maxrow<=2){delete this.arraydef.width,delete this.global.indentalign}}}const y=MathJax._.input.tex.Tags,q=(y.Label,y.TagInfo,y.AbstractTags),x=(y.NoTags,y.AllTags,y.TagsFactory,MathJax._.input.tex.UnitUtil.UnitUtil),M=MathJax._.input.tex.ParseMethods.default,C=MathJax._.input.tex.TexParser.default,T=MathJax._.input.tex.base.BaseMethods,I=T.splitAlignArray,S=T.default,E=MathJax._.core.MmlTree.MmlNode,P=E.TEXCLASS,N=(E.TEXCLASSNAMES,E.MATHVARIANTS,E.indentAttributes,E.AbstractMmlNode,E.AbstractMmlTokenNode,E.AbstractMmlLayoutNode,E.AbstractMmlBaseNode,E.AbstractMmlEmptyNode,E.TextNode,E.XMLNode,MathJax._.input.tex.newcommand.NewcommandUtil),k=(N.NewcommandTables,N.NewcommandPriority,N.NewcommandUtil);function F(t){if(!t||t.isInferred&&0===t.childNodes.length)return[null,null];if(t.isKind("msubsup")&&L(t))return[t,null];const e=A.getChildAt(t,0);return t.isInferred&&e&&L(e)?(t.childNodes.splice(0,1),[e,t]):[null,t]}function L(t){const e=t.childNodes[0];return e&&e.isKind("mi")&&""===e.getText()}const O={AmsEqnArray(t,e,a,r,n,i,l,o){const s=t.GetBrackets("\\begin{"+e.getName()+"}"),m=S.EqnArray(t,e,a,r,n,i,l,o);return p.setArrayAlign(m,s,t)},AlignAt(t,e,a,r){const n=e.getName();let i,l="",o="";const s=[];r||(i=t.GetBrackets("\\begin{"+n+"}"));const m=t.GetArgument("\\begin{"+n+"}");if(m.match(/[^0-9]/))throw new f("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+n+"}");let c=parseInt(m,10);for(;c>0;)l+="rl",o+="bt",s.push("0em 0em"),c--;const h=s.join(" ");if(r)return O.EqnArray(t,e,a,r,l,o,h);const d=O.EqnArray(t,e,a,r,l,o,h);return p.setArrayAlign(d,i,t)},Multline(t,e,a){p.checkEqnEnv(t),t.Push(e);const r=t.options.ams.multlineIndent,n=t.itemFactory.create("multline",a,t.stack);return n.arraydef={displaystyle:!0,rowspacing:".5em",columnspacing:"100%",width:t.options.ams.multlineWidth,side:t.options.tagSide,minlabelspacing:t.options.tagIndent,"data-array-padding":`${r} ${r}`,"data-width-includes-label":!0},n},XalignAt(t,e,a,r){const n=t.GetArgument("\\begin{"+e.getName()+"}");if(n.match(/[^0-9]/))throw new f("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+e.getName()+"}");const i=r?"crl":"rlc",l=r?"mbt":"btm",o=r?"fit auto auto":"auto auto fit",s=O.FlalignArray(t,e,a,r,!1,i,l,o,!0);return s.setProperty("xalignat",2*parseInt(n)),s},FlalignArray(t,e,a,r,n,i,l,o,s=!1){p.checkEqnEnv(t),t.Push(e),i=i.split("").join(" ").replace(/r/g,"right").replace(/l/g,"left").replace(/c/g,"center"),l=I(l);const m=t.itemFactory.create("flalign",e.getName(),a,r,n,t.stack);return m.arraydef={width:"100%",displaystyle:!0,columnalign:i,columnspacing:"0em",columnwidth:o,rowspacing:"3pt","data-break-align":l,side:t.options.tagSide,minlabelspacing:s?"0":t.options.tagIndent,"data-width-includes-label":!0},m.setProperty("zeroWidthLabel",s),m},HandleDeclareOp(t,e){const a=t.GetStar()?"*":"",r=k.GetCsNameArgument(t,e),n=t.GetArgument(e);k.addMacro(t,r,O.Macro,[`\\operatorname${a}{${n}}`]),t.Push(t.itemFactory.create("null"))},HandleOperatorName(t,e){const a=t.GetStar(),r=x.trimSpaces(t.GetArgument(e));let n=new C(r,Object.assign(Object.assign({},t.stack.env),{font:b.Variant.NORMAL,multiLetterIdentifiers:t.options.ams.operatornamePattern,operatorLetters:!0,noAutoOP:!0}),t.configuration).mml();if(n.isKind("mi")?n.removeProperty("autoOP"):n=t.create("node","TeXAtom",[n]),A.setProperties(n,{movesupsub:a,movablelimits:!0,texClass:P.OP}),!a){const e=t.GetNext(),a=t.i;"\\"===e&&++t.i&&"limits"!==t.GetCS()&&(t.i=a)}t.Push(t.itemFactory.create("fn",n))},SideSet(t,e){const[a,r]=F(t.ParseArg(e)),[n,i]=F(t.ParseArg(e)),l=t.ParseArg(e);let o=l;a&&(r?a.replaceChild(t.create("node","mphantom",[t.create("node","mpadded",[p.copyNode(l,t)],{width:0})]),A.getChildAt(a,0)):(o=t.create("node","mmultiscripts",[l]),n&&A.appendChildren(o,[A.getChildAt(n,1)||t.create("node","none"),A.getChildAt(n,2)||t.create("node","none")]),A.setProperty(o,"scriptalign","left"),A.appendChildren(o,[t.create("node","mprescripts"),A.getChildAt(a,1)||t.create("node","none"),A.getChildAt(a,2)||t.create("node","none")]))),n&&o===l&&(n.replaceChild(l,A.getChildAt(n,0)),o=n);const s=t.create("node","TeXAtom",[],{texClass:P.OP,movesupsub:!0,movablelimits:!0});r&&(a&&s.appendChild(a),s.appendChild(r)),s.appendChild(o),i&&s.appendChild(i),t.Push(s)},operatorLetter:(t,e)=>!!t.stack.env.operatorLetters&&M.variable(t,e),MultiIntegral(t,e,a){let r=t.GetNext();if("\\"===r){const n=t.i;r=t.GetArgument(e),t.i=n,"\\limits"===r&&(a="\\!\\!\\mathop{\\,\\,"+a+"}")}t.string=a+" "+t.string.slice(t.i),t.i=0},xArrow(t,e,a,r,n,i=0){const l={width:"+"+x.em((r+n)/18),lspace:x.em(r/18)},o=t.GetBrackets(e),s=t.ParseArg(e),m=t.create("node","mspace",[],{depth:".2em"});let c=t.create("token","mo",{stretchy:!0,texClass:P.ORD},String.fromCodePoint(a));i&&c.attributes.set("minsize",x.em(i)),c=t.create("node","mstyle",[c],{scriptlevel:0});const h=t.create("node","munderover",[c]);let d=t.create("node","mpadded",[s,m],l);if(A.setAttribute(d,"voffset","-.2em"),A.setAttribute(d,"height","-.2em"),A.setChild(h,h.over,d),o){const e=new C(o,t.stack.env,t.configuration).mml(),a=t.create("node","mspace",[],{height:".75em"});d=t.create("node","mpadded",[e,a],l),A.setAttribute(d,"voffset",".15em"),A.setAttribute(d,"depth","-.15em"),A.setChild(h,h.under,d)}A.setProperty(h,"subsupOK",!0),t.Push(t.create("node","TeXAtom",[t.create("node","TeXAtom",[],{texClass:P.NONE}),h],{texClass:P.REL}))},HandleShove(t,e,a){const r=t.stack.Top();if("multline"!==r.kind)throw new f("CommandOnlyAllowedInEnv","%1 only allowed in %2 environment",t.currentCS,"multline");if(r.Size())throw new f("CommandAtTheBeginingOfLine","%1 must come at the beginning of the line",t.currentCS);r.setProperty("shove",a)},CFrac(t,e){let a=x.trimSpaces(t.GetBrackets(e,""));const r=t.GetArgument(e),n=t.GetArgument(e),i={l:b.Align.LEFT,r:b.Align.RIGHT,"":""},l=new C("\\strut\\textstyle{"+r+"}",t.stack.env,t.configuration).mml(),o=new C("\\strut\\textstyle{"+n+"}",t.stack.env,t.configuration).mml(),s=t.create("node","mfrac",[l,o]);if(a=i[a],null==a)throw new f("IllegalAlign","Illegal alignment specified in %1",t.currentCS);a&&A.setProperties(s,{numalign:a,denomalign:a}),t.Push(s)},Genfrac(t,e,a,r,n,i){null==a&&(a=t.GetDelimiterArg(e)),null==r&&(r=t.GetDelimiterArg(e)),null==n&&(n=t.GetArgument(e)),null==i&&(i=x.trimSpaces(t.GetArgument(e)));const l=t.ParseArg(e),o=t.ParseArg(e);let s=t.create("node","mfrac",[l,o]);if(""!==n&&A.setAttribute(s,"linethickness",n),(a||r)&&(A.setProperty(s,"withDelims",!0),s=p.fixedFence(t.configuration,a,s,r)),""!==i){const e=parseInt(i,10),a=["D","T","S","SS"][e];if(null==a)throw new f("BadMathStyleFor","Bad math style for %1",t.currentCS);s=t.create("node","mstyle",[s]),"D"===a?A.setProperties(s,{displaystyle:!0,scriptlevel:0}):A.setProperties(s,{displaystyle:!1,scriptlevel:e-1})}t.Push(s)},HandleTag(t,e){if(!t.tags.currentTag.taggable&&t.tags.env)throw new f("CommandNotAllowedInEnv","%1 not allowed in %2 environment",t.currentCS,t.tags.env);if(t.tags.currentTag.tag)throw new f("MultipleCommand","Multiple %1",t.currentCS);const a=t.GetStar(),r=x.trimSpaces(t.GetArgument(e));t.tags.tag(r,a),t.Push(t.itemFactory.create("null"))},HandleNoTag:S.HandleNoTag,HandleRef:S.HandleRef,Macro:S.Macro,Accent:S.Accent,Tilde:S.Tilde,Array:S.Array,Spacer:S.Spacer,NamedOp:S.NamedOp,EqnArray:S.EqnArray,Equation:S.Equation},G=MathJax._.input.tex.TokenMap,R=(G.parseResult,G.AbstractTokenMap,G.RegExpMap),V=(G.AbstractParseMap,G.CharacterMap),D=G.DelimiterMap,H=(G.MacroMap,G.CommandMap),J=G.EnvironmentMap,_=MathJax._.util.lengths,B=(_.BIGDIMEN,_.UNITS,_.RELUNITS,_.MATHSPACE);_.length2em,_.percent,_.em,_.px;new V("AMSmath-mathchar0mo",M.mathchar0mo,{iiiint:["\u2a0c",{texClass:P.OP}]}),new R("AMSmath-operatorLetter",O.operatorLetter,/[-*]/i),new H("AMSmath-macros",{mathring:[O.Accent,"02DA"],nobreakspace:O.Tilde,negmedspace:[O.Spacer,B.negativemediummathspace],negthickspace:[O.Spacer,B.negativethickmathspace],idotsint:[O.MultiIntegral,"\\int\\cdots\\int"],dddot:[O.Accent,"20DB"],ddddot:[O.Accent,"20DC"],sideset:O.SideSet,boxed:[O.Macro,"\\fbox{$\\displaystyle{#1}$}",1],tag:O.HandleTag,notag:O.HandleNoTag,eqref:[O.HandleRef,!0],substack:[O.Macro,"\\begin{subarray}{c}#1\\end{subarray}",1],injlim:[O.NamedOp,"inj lim"],projlim:[O.NamedOp,"proj lim"],varliminf:[O.Macro,"\\mathop{\\underline{\\mmlToken{mi}{lim}}}"],varlimsup:[O.Macro,"\\mathop{\\overline{\\mmlToken{mi}{lim}}}"],varinjlim:[O.Macro,"\\mathop{\\underrightarrow{\\mmlToken{mi}{lim}}}"],varprojlim:[O.Macro,"\\mathop{\\underleftarrow{\\mmlToken{mi}{lim}}}"],DeclareMathOperator:O.HandleDeclareOp,operatorname:O.HandleOperatorName,genfrac:O.Genfrac,frac:[O.Genfrac,"","","",""],tfrac:[O.Genfrac,"","","","1"],dfrac:[O.Genfrac,"","","","0"],binom:[O.Genfrac,"(",")","0",""],tbinom:[O.Genfrac,"(",")","0","1"],dbinom:[O.Genfrac,"(",")","0","0"],cfrac:O.CFrac,shoveleft:[O.HandleShove,b.Align.LEFT],shoveright:[O.HandleShove,b.Align.RIGHT],xrightarrow:[O.xArrow,8594,5,10],xleftarrow:[O.xArrow,8592,10,5]}),new J("AMSmath-environment",M.environment,{"equation*":[O.Equation,null,!1],"eqnarray*":[O.EqnArray,null,!1,!0,"rcl","bmt",p.cols(0,B.thickmathspace),".5em"],align:[O.EqnArray,null,!0,!0,"rl","bt",p.cols(0,2)],"align*":[O.EqnArray,null,!1,!0,"rl","bt",p.cols(0,2)],multline:[O.Multline,null,!0],"multline*":[O.Multline,null,!1],split:[O.EqnArray,null,!1,!1,"rl","bt",p.cols(0)],gather:[O.EqnArray,null,!0,!0,"c","m"],"gather*":[O.EqnArray,null,!1,!0,"c","m"],alignat:[O.AlignAt,null,!0,!0],"alignat*":[O.AlignAt,null,!1,!0],alignedat:[O.AlignAt,null,!1,!1],aligned:[O.AmsEqnArray,null,null,null,"rl","bt",p.cols(0,2),".5em","D"],gathered:[O.AmsEqnArray,null,null,null,"c","m",null,".5em","D"],xalignat:[O.XalignAt,null,!0,!0],"xalignat*":[O.XalignAt,null,!1,!0],xxalignat:[O.XalignAt,null,!1,!1],flalign:[O.FlalignArray,null,!0,!1,!0,"rlc","btm","auto auto fit"],"flalign*":[O.FlalignArray,null,!1,!1,!0,"rlc","btm","auto auto fit"],subarray:[O.Array,null,null,null,null,p.cols(0),"0.1em","S",!0],smallmatrix:[O.Array,null,null,null,"c",p.cols(1/3),".2em","S",!0],matrix:[O.Array,null,null,null,"c"],pmatrix:[O.Array,null,"(",")","c"],bmatrix:[O.Array,null,"[","]","c"],Bmatrix:[O.Array,null,"\\{","\\}","c"],vmatrix:[O.Array,null,"\\vert","\\vert","c"],Vmatrix:[O.Array,null,"\\Vert","\\Vert","c"],cases:[O.Array,null,"\\{",".","ll",null,".2em","T"]}),new D("AMSmath-delimiter",M.delimiter,{"\\lvert":["|",{texClass:P.OPEN}],"\\rvert":["|",{texClass:P.CLOSE}],"\\lVert":["\u2016",{texClass:P.OPEN}],"\\rVert":["\u2016",{texClass:P.CLOSE}]}),new V("AMSsymbols-mathchar0mi",M.mathchar0mi,{digamma:"\u03dd",varkappa:"\u03f0",varGamma:["\u0393",{mathvariant:b.Variant.ITALIC}],varDelta:["\u0394",{mathvariant:b.Variant.ITALIC}],varTheta:["\u0398",{mathvariant:b.Variant.ITALIC}],varLambda:["\u039b",{mathvariant:b.Variant.ITALIC}],varXi:["\u039e",{mathvariant:b.Variant.ITALIC}],varPi:["\u03a0",{mathvariant:b.Variant.ITALIC}],varSigma:["\u03a3",{mathvariant:b.Variant.ITALIC}],varUpsilon:["\u03a5",{mathvariant:b.Variant.ITALIC}],varPhi:["\u03a6",{mathvariant:b.Variant.ITALIC}],varPsi:["\u03a8",{mathvariant:b.Variant.ITALIC}],varOmega:["\u03a9",{mathvariant:b.Variant.ITALIC}],beth:"\u2136",gimel:"\u2137",daleth:"\u2138",backprime:["\u2035",{variantForm:!0}],hslash:"\u210f",varnothing:["\u2205",{variantForm:!0}],blacktriangle:"\u25b4",triangledown:["\u25bd",{variantForm:!0}],blacktriangledown:"\u25be",square:"\u25fb",Box:"\u25fb",blacksquare:"\u25fc",lozenge:"\u25ca",Diamond:"\u25ca",blacklozenge:"\u29eb",circledS:["\u24c8",{mathvariant:b.Variant.NORMAL}],bigstar:"\u2605",sphericalangle:"\u2222",measuredangle:"\u2221",nexists:"\u2204",complement:"\u2201",mho:"\u2127",eth:["\xf0",{mathvariant:b.Variant.NORMAL}],Finv:"\u2132",diagup:"\u2571",Game:"\u2141",diagdown:"\u2572",Bbbk:["k",{mathvariant:b.Variant.DOUBLESTRUCK}],yen:"\xa5",circledR:"\xae",checkmark:"\u2713",maltese:"\u2720"}),new V("AMSsymbols-mathchar0mo",M.mathchar0mo,{dotplus:"\u2214",ltimes:"\u22c9",smallsetminus:["\u2216",{variantForm:!0}],rtimes:"\u22ca",Cap:"\u22d2",doublecap:"\u22d2",leftthreetimes:"\u22cb",Cup:"\u22d3",doublecup:"\u22d3",rightthreetimes:"\u22cc",barwedge:"\u22bc",curlywedge:"\u22cf",veebar:"\u22bb",curlyvee:"\u22ce",doublebarwedge:"\u2a5e",boxminus:"\u229f",circleddash:"\u229d",boxtimes:"\u22a0",circledast:"\u229b",boxdot:"\u22a1",circledcirc:"\u229a",boxplus:"\u229e",centerdot:["\u22c5",{variantForm:!0}],divideontimes:"\u22c7",intercal:"\u22ba",leqq:"\u2266",geqq:"\u2267",leqslant:"\u2a7d",geqslant:"\u2a7e",eqslantless:"\u2a95",eqslantgtr:"\u2a96",lesssim:"\u2272",gtrsim:"\u2273",lessapprox:"\u2a85",gtrapprox:"\u2a86",approxeq:"\u224a",lessdot:"\u22d6",gtrdot:"\u22d7",lll:"\u22d8",llless:"\u22d8",ggg:"\u22d9",gggtr:"\u22d9",lessgtr:"\u2276",gtrless:"\u2277",lesseqgtr:"\u22da",gtreqless:"\u22db",lesseqqgtr:"\u2a8b",gtreqqless:"\u2a8c",doteqdot:"\u2251",Doteq:"\u2251",eqcirc:"\u2256",risingdotseq:"\u2253",circeq:"\u2257",fallingdotseq:"\u2252",triangleq:"\u225c",backsim:"\u223d",thicksim:["\u223c",{variantForm:!0}],backsimeq:"\u22cd",thickapprox:["\u2248",{variantForm:!0}],subseteqq:"\u2ac5",supseteqq:"\u2ac6",Subset:"\u22d0",Supset:"\u22d1",sqsubset:"\u228f",sqsupset:"\u2290",preccurlyeq:"\u227c",succcurlyeq:"\u227d",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",precsim:"\u227e",succsim:"\u227f",precapprox:"\u2ab7",succapprox:"\u2ab8",vartriangleleft:"\u22b2",lhd:"\u22b2",vartriangleright:"\u22b3",rhd:"\u22b3",trianglelefteq:"\u22b4",unlhd:"\u22b4",trianglerighteq:"\u22b5",unrhd:"\u22b5",vDash:"\u22a8",Vdash:"\u22a9",Vvdash:"\u22aa",smallsmile:["\u2323",{variantForm:!0}],shortmid:["\u2223",{variantForm:!0}],smallfrown:["\u2322",{variantForm:!0}],shortparallel:["\u2225",{variantForm:!0}],bumpeq:"\u224f",between:"\u226c",Bumpeq:"\u224e",pitchfork:"\u22d4",varpropto:["\u221d",{variantForm:!0}],backepsilon:"\u220d",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",therefore:"\u2234",because:"\u2235",eqsim:"\u2242",vartriangle:["\u25b3",{variantForm:!0}],Join:"\u22c8",nless:"\u226e",ngtr:"\u226f",nleq:"\u2270",ngeq:"\u2271",nleqslant:["\u2a87",{variantForm:!0}],ngeqslant:["\u2a88",{variantForm:!0}],nleqq:["\u2270",{variantForm:!0}],ngeqq:["\u2271",{variantForm:!0}],lneq:"\u2a87",gneq:"\u2a88",lneqq:"\u2268",gneqq:"\u2269",lvertneqq:["\u2268",{variantForm:!0}],gvertneqq:["\u2269",{variantForm:!0}],lnsim:"\u22e6",gnsim:"\u22e7",lnapprox:"\u2a89",gnapprox:"\u2a8a",nprec:"\u2280",nsucc:"\u2281",npreceq:["\u22e0",{variantForm:!0}],nsucceq:["\u22e1",{variantForm:!0}],precneqq:"\u2ab5",succneqq:"\u2ab6",precnsim:"\u22e8",succnsim:"\u22e9",precnapprox:"\u2ab9",succnapprox:"\u2aba",nsim:"\u2241",ncong:"\u2247",nshortmid:["\u2224",{variantForm:!0}],nshortparallel:["\u2226",{variantForm:!0}],nmid:"\u2224",nparallel:"\u2226",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",ntriangleleft:"\u22ea",ntriangleright:"\u22eb",ntrianglelefteq:"\u22ec",ntrianglerighteq:"\u22ed",nsubseteq:"\u2288",nsupseteq:"\u2289",nsubseteqq:["\u2288",{variantForm:!0}],nsupseteqq:["\u2289",{variantForm:!0}],subsetneq:"\u228a",supsetneq:"\u228b",varsubsetneq:["\u228a",{variantForm:!0}],varsupsetneq:["\u228b",{variantForm:!0}],subsetneqq:"\u2acb",supsetneqq:"\u2acc",varsubsetneqq:["\u2acb",{variantForm:!0}],varsupsetneqq:["\u2acc",{variantForm:!0}],leftleftarrows:"\u21c7",rightrightarrows:"\u21c9",leftrightarrows:"\u21c6",rightleftarrows:"\u21c4",Lleftarrow:"\u21da",Rrightarrow:"\u21db",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",leftarrowtail:"\u21a2",rightarrowtail:"\u21a3",looparrowleft:"\u21ab",looparrowright:"\u21ac",leftrightharpoons:"\u21cb",rightleftharpoons:["\u21cc",{variantForm:!0}],curvearrowleft:"\u21b6",curvearrowright:"\u21b7",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",Lsh:"\u21b0",Rsh:"\u21b1",upuparrows:"\u21c8",downdownarrows:"\u21ca",upharpoonleft:"\u21bf",upharpoonright:"\u21be",downharpoonleft:"\u21c3",restriction:"\u21be",multimap:"\u22b8",downharpoonright:"\u21c2",leftrightsquigarrow:"\u21ad",rightsquigarrow:"\u21dd",leadsto:"\u21dd",dashrightarrow:"\u21e2",dashleftarrow:"\u21e0",nleftarrow:"\u219a",nrightarrow:"\u219b",nLeftarrow:"\u21cd",nRightarrow:"\u21cf",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce"}),new D("AMSsymbols-delimiter",M.delimiter,{"\\ulcorner":"\u231c","\\urcorner":"\u231d","\\llcorner":"\u231e","\\lrcorner":"\u231f"}),new H("AMSsymbols-macros",{implies:[O.Macro,"\\;\\Longrightarrow\\;"],impliedby:[O.Macro,"\\;\\Longleftarrow\\;"]});const j=MathJax._.input.tex.newcommand.NewcommandConfiguration,U=j.NewcommandConfig;j.NewcommandConfiguration;class X extends q{}const K=c.create("ams",{[o.HANDLER]:{[s.CHARACTER]:["AMSmath-operatorLetter"],[s.DELIMITER]:["AMSsymbols-delimiter","AMSmath-delimiter"],[s.MACRO]:["AMSsymbols-mathchar0mi","AMSsymbols-mathchar0mo","AMSsymbols-delimiter","AMSsymbols-macros","AMSmath-mathchar0mo","AMSmath-macros","AMSmath-delimiter"],[s.ENVIRONMENT]:["AMSmath-environment"]},[o.ITEMS]:{[w.prototype.kind]:w,[v.prototype.kind]:v},[o.TAGS]:{ams:X},[o.OPTIONS]:{multlineWidth:"",ams:{operatornamePattern:/^[-*a-zA-Z0-9]+/,multlineWidth:"100%",multlineIndent:"1em"}},[o.CONFIG]:U});MathJax.loader&&MathJax.loader.checkVersion("[tex]/ams","4.1.3","tex-extension"),i({_:{input:{tex:{ams:{AmsConfiguration:r,AmsItems:e,AmsMethods:a}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,a)=>{for(var n in a)e.o(a,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:a[n]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{default:()=>x});var a={};e.r(a),e.d(a,{AmsCdConfiguration:()=>T});const n=("undefined"!=typeof window?window:e.g).MathJax._.components.global,o=(n.GLOBAL,n.isObject,n.combineConfig,n.combineDefaults,n.combineWithMathJax),r=(n.MathJax,MathJax._.input.tex.HandlerTypes),i=r.ConfigurationType,s=r.HandlerType,c=MathJax._.input.tex.Configuration,m=c.Configuration,d=(c.ConfigurationHandler,c.ParserConfiguration,MathJax._.input.tex.TokenMap),l=(d.parseResult,d.AbstractTokenMap,d.RegExpMap,d.AbstractParseMap,d.CharacterMap,d.DelimiterMap,d.MacroMap),p=d.CommandMap,h=d.EnvironmentMap,u=MathJax._.input.tex.ParseMethods.default,f=MathJax._.input.tex.TexParser.default,w=MathJax._.input.tex.base.BaseConfiguration,g=w.Other,C=(w.BaseTags,w.BaseConfiguration,MathJax._.core.MmlTree.MmlNode),M=C.TEXCLASS,y=(C.TEXCLASSNAMES,C.MATHVARIANTS,C.indentAttributes,C.AbstractMmlNode,C.AbstractMmlTokenNode,C.AbstractMmlLayoutNode,C.AbstractMmlBaseNode,C.AbstractMmlEmptyNode,C.TextNode,C.XMLNode,MathJax._.input.tex.NodeUtil.default),b={CD(e,t){e.Push(t);const a=e.itemFactory.create("array"),n=e.configuration.options.amscd;return a.setProperties({minw:e.stack.env.CD_minw||n.harrowsize,minh:e.stack.env.CD_minh||n.varrowsize}),a.arraydef={columnalign:"center",columnspacing:n.colspace,rowspacing:n.rowspace,displaystyle:!0},a},arrow(e,t){const a=e.i,n=e.GetNext();if(!n.match(/[><VA.|=]/))return e.i=a,g(e,t);e.i++;let o=e.stack.Top();o.isKind("array")&&!o.Size()||(b.cell(e,t),o=e.stack.Top());const r=o,i=r.table.length%2==1;let s,c=(r.row.length+(i?0:1))%2;for(;c;)b.cell(e,t),c--;const m={minsize:r.getProperty("minw"),stretchy:!0},d={minsize:r.getProperty("minh"),stretchy:!0,symmetric:!0,lspace:0,rspace:0};if("|"===n)s=e.create("token","mo",d,"\u2225");else if("="===n)s=e.create("token","mo",m,"=");else if("."!==n){const a={">":"\u2192","<":"\u2190",V:"\u2193",A:"\u2191"}[n];let o=e.GetUpTo(t+n,n);const i=e.GetUpTo(t+n,n);if(">"===n||"<"===n){s=e.create("token","mo",m,a),o||(o="\\kern "+r.getProperty("minw"));const t={width:"+.67em",lspace:".33em"};s=e.create("node","munderover",[s]);const n=new f(o,e.stack.env,e.configuration).mml(),c=e.create("node","mpadded",[n],t);if(y.setAttribute(c,"voffset",".1em"),y.setChild(s,s.over,c),i){const a=new f(i,e.stack.env,e.configuration).mml();y.setChild(s,s.under,e.create("node","mpadded",[a],t))}e.configuration.options.amscd.hideHorizontalLabels&&(s=e.create("node","mpadded",[s],{depth:0,height:".67em"}))}else{const t=e.create("token","mo",d,a);s=t,(o||i)&&(s=e.create("node","mrow"),o&&y.appendChildren(s,[new f("\\scriptstyle\\raise.125em{\\vcenter{\\llap{"+o+"}}}",e.stack.env,e.configuration).mml()]),t.texClass=M.ORD,y.appendChildren(s,[t]),i&&y.appendChildren(s,[new f("\\scriptstyle\\raise.125em{\\vcenter{\\rlap{"+i+"}}}",e.stack.env,e.configuration).mml()]))}}s&&e.Push(s),b.cell(e,t)},cell(e,t){const a=e.stack.Top();(a.table||[]).length%2==0&&0===(a.row||[]).length&&e.Push(e.create("node","mpadded",[],{height:"8.5pt",depth:"2pt"})),e.Push(e.itemFactory.create("cell").setProperties({isEntry:!0,name:t}))},minCDarrowwidth(e,t){e.stack.env.CD_minw=e.GetDimen(t)},minCDarrowheight(e,t){e.stack.env.CD_minh=e.GetDimen(t)}},x=b;new h("amscd_environment",u.environment,{CD:x.CD}),new p("amscd_macros",{minCDarrowwidth:x.minCDarrowwidth,minCDarrowheight:x.minCDarrowheight}),new l("amscd_special",{"@":x.arrow});const T=m.create("amscd",{[i.HANDLER]:{[s.CHARACTER]:["amscd_special"],[s.MACRO]:["amscd_macros"],[s.ENVIRONMENT]:["amscd_environment"]},[i.OPTIONS]:{amscd:{colspace:"5pt",rowspace:"5pt",harrowsize:"2.75em",varrowsize:"1.75em",hideHorizontalLabels:!1}}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/amscd","4.1.3","tex-extension"),o({_:{input:{tex:{amscd:{AmsCdConfiguration:a,AmsCdMethods:t}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var o={d:(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}};o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(o){if("object"==typeof window)return window}}(),o.o=(o,e)=>Object.prototype.hasOwnProperty.call(o,e),o.r=o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var e={};o.r(e),o.d(e,{AutoloadConfiguration:()=>T});const t=("undefined"!=typeof window?window:o.g).MathJax._.components.global,a=(t.GLOBAL,t.isObject,t.combineConfig,t.combineDefaults,t.combineWithMathJax),n=(t.MathJax,MathJax._.input.tex.HandlerTypes),r=n.ConfigurationType,i=n.HandlerType,c=MathJax._.input.tex.Configuration,s=c.Configuration,l=(c.ConfigurationHandler,c.ParserConfiguration,MathJax._.input.tex.TokenMap),u=(l.parseResult,l.AbstractTokenMap,l.RegExpMap,l.AbstractParseMap,l.CharacterMap,l.DelimiterMap,l.MacroMap,l.CommandMap),p=(l.EnvironmentMap,MathJax._.input.tex.Token),d=(p.Token,p.Macro),f=MathJax._.input.tex.require.RequireConfiguration,b=f.RequireLoad,g=(f.RequireMethods,f.options,f.RequireConfiguration),x=MathJax._.components.package,m=(x.PackageError,x.Package),h=MathJax._.util.Options,M=(h.isObject,h.APPEND,h.REMOVE,h.OPTIONS,h.Expandable,h.expandable),y=(h.makeArray,h.keys,h.copy,h.insert,h.defaultOptions);h.userOptions,h.selectOptions,h.selectOptionsFromKeys,h.separateOptions,h.lookup;function O(o,e,t,a){if(m.packages.has(o.options.require.prefix+t)){const n=o.options.autoload[t],[r,i]=2===n.length&&Array.isArray(n[0])?n:[n,[]];for(const o of r)w.remove(o);for(const o of i)k.remove(o);o.string=(a?e+" ":"\\begin{"+e.slice(1)+"}")+o.string.slice(o.i),o.i=0}b(o,t)}const w=new u("autoload-macros",{}),k=new u("autoload-environments",{}),T=s.create("autoload",{[r.HANDLER]:{[i.MACRO]:["autoload-macros"],[i.ENVIRONMENT]:["autoload-environments"]},[r.OPTIONS]:{autoload:M({action:["toggle","mathtip","texttip"],amscd:[[],["CD"]],bbox:["bbox"],boldsymbol:["boldsymbol"],braket:["bra","ket","braket","set","Bra","Ket","Braket","Set","ketbra","Ketbra"],bussproofs:[[],["prooftree"]],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","definecolor","textcolor","colorbox","fcolorbox"],enclose:["enclose"],extpfeil:["xtwoheadrightarrow","xtwoheadleftarrow","xmapsto","xlongequal","xtofrom","Newextarrow"],html:["data","href","class","style","cssId"],mhchem:["ce","pu"],newcommand:["newcommand","renewcommand","newenvironment","renewenvironment","def","let"],unicode:["unicode","U","char"],verb:["verb"]})},[r.CONFIG]:function(o,e){const t=e.parseOptions,a=t.handlers.get(i.MACRO),n=t.handlers.get(i.ENVIRONMENT),r=t.options.autoload;t.packageData.set("autoload",{Autoload:O});for(const o of Object.keys(r)){const e=r[o],[t,i]=2===e.length&&Array.isArray(e[0])?e:[e,[]];for(const e of t)a.lookup(e)&&"color"!==e||w.add(e,new d(e,O,[o,!0]));for(const e of i)n.lookup(e)||k.add(e,new d(e,O,[o,!1]))}t.packageData.get("require")||g.config(o,e)},[r.INIT]:function(o){o.options.require||y(o.options,g.options)},[r.PRIORITY]:10});MathJax.loader&&MathJax.loader.checkVersion("[tex]/autoload","4.1.3","tex-extension"),a({_:{input:{tex:{autoload:{AutoloadConfiguration:e}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={d:(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{BbmConfiguration:()=>c,BbmMethods:()=>u});const o=("undefined"!=typeof window?window:t.g).MathJax._.components.global,a=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults),n=o.combineWithMathJax,r=(o.MathJax,MathJax._.input.tex.HandlerTypes),i=r.ConfigurationType,b=r.HandlerType,s=MathJax._.input.tex.Configuration,d=s.Configuration,h=(s.ConfigurationHandler,s.ParserConfiguration,MathJax._.input.tex.TokenMap),l=(h.parseResult,h.AbstractTokenMap,h.RegExpMap,h.AbstractParseMap,h.CharacterMap,h.DelimiterMap,h.MacroMap,h.CommandMap),m=(h.EnvironmentMap,MathJax._.input.tex.base.BaseMethods),p=(m.splitAlignArray,m.default),u={ChooseFont(t,e,o,a){p.MathFont(t,e,t.options.bbm.bold?a:o)},ChangeBold(t,e){const o=t.GetArgument(e);t.options.bbm.bold="bold"===o},MathFont:p.MathFont};new l("bbm",{mathversion:u.ChangeBold,mathbbm:[u.ChooseFont,"-bbm-normal","-bbm-bold"],mathbbmss:[u.ChooseFont,"-bbm-sans-serif","-bbm-sans-serif-bold"],mathbbmtt:[u.MathFont,"-bbm-monospace"]});const c=d.create("bbm",{[i.HANDLER]:{[b.MACRO]:["bbm"]},[i.OPTIONS]:{bbm:{bold:!1}}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/bbm","4.1.3","tex-extension"),n({_:{input:{tex:{bbm:{BbmConfiguration:e}}}}}),function(t,e,o=`[fonts]/${e}`){if(MathJax.loader){const n=e.replace(/-font-extension$/,"-extension"),r=MathJax.config?.startup?.output||"chtml";a(MathJax.config.loader,"paths",{[n]:o}),MathJax._.output?.[r]||a(MathJax.config.loader,"dependencies",{[`[${n}]/${r}`]:[`output/${r}`]}),MathJax.loader.addPackageData(t,{extraLoads:[`[${n}]/${r}`],rendererExtensions:[n]})}}("[tex]/bbm","mathjax-bbm-font-extension")})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var b={d:(t,a)=>{for(var o in a)b.o(a,o)&&!b.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:a[o]})}};b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(b){if("object"==typeof window)return window}}(),b.o=(b,t)=>Object.prototype.hasOwnProperty.call(b,t),b.r=b=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})};var t={};b.r(t),b.d(t,{BboldxMethods:()=>u});var a={};b.r(a),b.d(a,{BboldxConfiguration:()=>M});const o=("undefined"!=typeof window?window:b.g).MathJax._.components.global,e=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults),x=o.combineWithMathJax,i=(o.MathJax,MathJax._.input.tex.HandlerTypes),l=i.ConfigurationType,n=i.HandlerType,r=MathJax._.input.tex.Configuration,d=r.Configuration,f=(r.ConfigurationHandler,r.ParserConfiguration,MathJax._.input.tex.TokenMap),m=(f.parseResult,f.AbstractTokenMap,f.RegExpMap,f.AbstractParseMap,f.CharacterMap),s=(f.DelimiterMap,f.MacroMap,f.CommandMap),h=(f.EnvironmentMap,MathJax._.input.tex.textmacros.TextMacrosMethods.TextMacrosMethods),c=MathJax._.input.tex.base.BaseMethods,p=(c.splitAlignArray,c.default),u={Macro:p.Macro,ChooseFont:function(b,t,a,o,e){const x=g(b,a,o,e);p.MathFont(b,t,x)},ChooseTextFont:function(b,t,a,o,e){const x=g(b,a,o,e);h.TextFont(b,t,x)},mathchar0miNormal:function(b,t){const a=g(b,"-bboldx","-bboldx-light","-bboldx-bold"),o=b.create("token","mi",{mathvariant:a},t.char);b.Push(o)},delimiterNormal:function(b,t){const a={stretchy:!1,mathvariant:g(b,"-bboldx","-bboldx-light","-bboldx-bold")},o=b.create("token","mo",a,t.char);b.Push(o)},mathchar0miBold:function(b,t){const a=g(b,"-bboldx-bold","-bboldx","-bboldx-bold"),o=b.create("token","mi",{mathvariant:a},t.char);b.Push(o)},delimiterBold:function(b,t){const a={stretchy:!1,mathvariant:g(b,"-bboldx-bold","-bboldx","-bboldx-bold")},o=b.create("token","mo",a,t.char);b.Push(o)}};function g(b,t,a,o){const e=b.options.bboldx;return e.bfbb?o:e.light?a:t}new m("bboldx-mathchar0miNormal",u.mathchar0miNormal,{bbGamma:"\u0393",bbDelta:"\u2206",bbTheta:"\u0398",bbLambda:"\u039b",bbXi:"\u039e",bbPi:"\u03a0",bbSigma:"\u03a3",bbUpsilon:"\u03a5",bbPhi:"\u03a6",bbPsi:"\u03a8",bbOmega:"\u2126",bbalpha:"\u03b1",bbbeta:"\u03b2",bbgamma:"\u03b3",bbdelta:"\u03b4",bbepsilon:"\u03b5",bbzeta:"\u03b6",bbeta:"\u03b7",bbtheta:"\u03b8",bbiota:"\u03b9",bbkappa:"\u03ba",bblambda:"\u03bb",bbmu:"\xb5",bbnu:"\u03bd",bbxi:"\u03be",bbpi:"\u03c0",bbrho:"\u03c1",bbsigma:"\u03c3",bbtau:"\u03c4",bbupsilon:"\u03c5",bbphi:"\u03c6",bbchi:"\u03c7",bbpsi:"\u03c8",bbomega:"\u03c9",bbdotlessi:"\u0131",bbdotlessj:"\u0237"}),new m("bboldx-delimiterNormal",u.delimiterNormal,{bbLparen:"(",bbRparen:")",bbLbrack:"[",bbRbrack:"]",bbLangle:"\u2329",bbRangle:"\u232a"}),new m("bboldx-mathchar0miBold",u.mathchar0miBold,{bfbbGamma:"\u0393",bfbbDelta:"\u2206",bfbbTheta:"\u0398",bfbbLambda:"\u039b",bfbbXi:"\u039e",bfbbPi:"\u03a0",bfbbSigma:"\u03a3",bfbbUpsilon:"\u03a5",bfbbPhi:"\u03a6",bfbbPsi:"\u03a8",bfbbOmega:"\u2126",bfbbalpha:"\u03b1",bfbbbeta:"\u03b2",bfbbgamma:"\u03b3",bfbbdelta:"\u03b4",bfbbepsilon:"\u03b5",bfbbzeta:"\u03b6",bfbbeta:"\u03b7",bfbbtheta:"\u03b8",bfbbiota:"\u03b9",bfbbkappa:"\u03ba",bfbblambda:"\u03bfBB",bfbbmu:"\xb5",bfbbnu:"\u03bd",bfbbxi:"\u03be",bfbbpi:"\u03c0",bfbbrho:"\u03c1",bfbbsigma:"\u03c3",bfbbtau:"\u03c4",bfbbupsilon:"\u03c5",bfbbphi:"\u03c6",bfbbchi:"\u03c7",bfbbpsi:"\u03c8",bfbbomega:"\u03c9",bfbbdotlessi:"\u0131",bfbbdotlessj:"\u0237"}),new m("bboldx-delimiterBold",u.delimiterBold,{bfbbLparen:"(",bfbbRparen:")",bfbbLbrack:"[",bfbbRbrack:"]",bfbbLangle:"\u2329",bfbbRangle:"\u232a"}),new s("bboldx",{mathbb:[u.ChooseFont,"-bboldx","-bboldx-light","-bboldx-bold"],mathbfbb:[u.ChooseFont,"-bboldx-bold","-bboldx","-bboldx-bold"],imathbb:[u.Macro,"\\bbdotlessi"],jmathbb:[u.Macro,"\\bbdotlessj"],imathbfbb:[u.Macro,"\\bfbbdotlessi"],jmathbfbb:[u.Macro,"\\bfbbdotlessj"]}),new m("text-bboldx-mathchar0miNormal",u.mathchar0miNormal,{txtbbGamma:"\u0393",txtbbDelta:"\u2206",txtbbTheta:"\u0398",txtbbLambda:"\u039b",txtbbXi:"\u039e",txtbbPi:"\u03a0",txtbbSigma:"\u03a3",txtbbUpsilon:"\u03a5",txtbbPhi:"\u03a6",txtbbPsi:"\u03a8",txtbbOmega:"\u2126",txtbbalpha:"\u03b1",txtbbbeta:"\u03b2",txtbbgamma:"\u03b3",txtbbdelta:"\u03b4",txtbbepsilon:"\u03b5",txtbbzeta:"\u03b6",txtbbeta:"\u03b7",txtbbtheta:"\u03b8",txtbbiota:"\u03b9",txtbbkappa:"\u03ba",txtbblambda:"\u03bb",txtbbmu:"\xb5",txtbbnu:"\u03bd",txtbbxi:"\u03be",txtbbpi:"\u03c0",txtbbrho:"\u03c1",txtbbsigma:"\u03c3",txtbbtau:"\u03c4",txtbbupsilon:"\u03c5",txtbbphi:"\u03c6",txtbbchi:"\u03c7",txtbbpsi:"\u03c8",txtbbomega:"\u03c9",txtbbdotlessi:"\u0131",txtbbdotlessj:"\u0237"}),new m("text-bboldx-delimiterNormal",u.delimiterNormal,{txtbbLparen:"(",txtbbRparen:")",txtbbLbrack:"[",txtbbRbrack:"]",txtbbLangle:"\u2329",txtbbRangle:"\u232a"}),new m("text-bboldx-mathchar0miBold",u.mathchar0miBold,{txtbfbbGamma:"\u0393",txtbfbbDelta:"\u2206",txtbfbbTheta:"\u0398",txtbfbbLambda:"\u039b",txtbfbbXi:"\u039e",txtbfbbPi:"\u03a0",txtbfbbSigma:"\u03a3",txtbfbbUpsilon:"\u03a5",txtbfbbPhi:"\u03a6",txtbfbbPsi:"\u03a8",txtbfbbOmega:"\u2126",txtbfbbalpha:"\u03b1",txtbfbbbeta:"\u03b2",txtbfbbgamma:"\u03b3",txtbfbbdelta:"\u03b4",txtbfbbepsilon:"\u03b5",txtbfbbzeta:"\u03b6",txtbfbbeta:"\u03b7",txtbfbbtheta:"\u03b8",txtbfbbiota:"\u03b9",txtbfbbkappa:"\u03ba",txtbfbblambda:"\u03bb",txtbfbbmu:"\xb5",txtbfbbnu:"\u03bd",txtbfbbxi:"\u03be",txtbfbbpi:"\u03c0",txtbfbbrho:"\u03c1",txtbfbbsigma:"\u03c3",txtbfbbtau:"\u03c4",txtbfbbupsilon:"\u03c5",txtbfbbphi:"\u03c6",txtbfbbchi:"\u03c7",txtbfbbpsi:"\u03c8",txtbfbbomega:"\u03c9",txtbfbbdotlessi:"\u0131",txtbfbbdotlessj:"\u0237"}),new m("text-bboldx-delimiterBold",u.delimiterBold,{txtbfbbLparen:"(",txtbfbbRparen:")",txtbfbbLbrack:"[",txtbfbbRbrack:"]",txtbfbbLangle:"\u2329",txtbfbbRangle:"\u232a"}),new s("text-bboldx",{textbb:[u.ChooseTextFont,"-bboldx","-bboldx-light","-bboldx-bold"],textbfbb:[u.ChooseTextFont,"-bboldx-bold","-bboldx","-bboldx-bold"],itextbb:[u.Macro,"\\txtbbdotlessi"],jtextbb:[u.Macro,"\\txtbbdotlessj"],itextbfbb:[u.Macro,"\\txtbfbbdotlessi"],jtextbfbb:[u.Macro,"\\txtbfbbdotlessj"]}),d.create("text-bboldx",{parser:"text",handler:{macro:["text-bboldx","text-bboldx-mathchar0miNormal","text-bboldx-delimiterNormal","text-bboldx-mathchar0miBold","text-bboldx-delimiterBold"]}});const M=d.create("bboldx",{[l.HANDLER]:{[n.MACRO]:["bboldx","bboldx-mathchar0miNormal","bboldx-delimiterNormal","bboldx-mathchar0miBold","bboldx-delimiterBold"]},[l.OPTIONS]:{bboldx:{bfbb:!1,light:!1}},config(b,t){const a=t.parseOptions.packageData.get("textmacros");a&&(a.parseOptions.options.textmacros.packages.push("text-bboldx"),a.textConf.add("text-bboldx",t,{}))},priority:3});MathJax.loader&&MathJax.loader.checkVersion("[tex]/bboldx","4.1.3","tex-extension"),x({_:{input:{tex:{bboldx:{BboldxConfiguration:a,BboldxMethods:t}}}}}),function(b,t,a=`[fonts]/${t}`){if(MathJax.loader){const o=t.replace(/-font-extension$/,"-extension"),x=MathJax.config?.startup?.output||"chtml";e(MathJax.config.loader,"paths",{[o]:a}),MathJax._.output?.[x]||e(MathJax.config.loader,"dependencies",{[`[${o}]/${x}`]:[`output/${x}`]}),MathJax.loader.addPackageData(b,{extraLoads:[`[${o}]/${x}`],rendererExtensions:[o]})}}("[tex]/bboldx","mathjax-bboldx-font-extension")})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{BboxConfiguration:()=>x});const o=("undefined"!=typeof window?window:e.g).MathJax._.components.global,n=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults,o.combineWithMathJax),a=(o.MathJax,MathJax._.input.tex.HandlerTypes),i=a.ConfigurationType,r=a.HandlerType,c=MathJax._.input.tex.Configuration,l=c.Configuration,p=(c.ConfigurationHandler,c.ParserConfiguration,MathJax._.input.tex.TokenMap),s=(p.parseResult,p.AbstractTokenMap,p.RegExpMap,p.AbstractParseMap,p.CharacterMap,p.DelimiterMap,p.MacroMap,p.CommandMap),d=(p.EnvironmentMap,MathJax._.input.tex.TexError.default),u={BBox(e,t){const o=e.GetBrackets(t,"");let n=e.ParseArg(t);const a=o.split(/,/);let i,r,c;for(let e=0,o=a.length;e<o;e++){const o=a[e].trim(),n=o.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/);if(n){if(i)throw new d("MultipleBBoxProperty","%1 specified twice in %2","Padding",t);const e=b(n[1]+n[3]);e&&(i={height:"+"+e,depth:"+"+e,lspace:e,width:"+"+2*parseFloat(n[1])+n[3]})}else if(o.match(/^([a-z0-9]+|#[0-9a-f]{6}|#[0-9a-f]{3})$/i)){if(r)throw new d("MultipleBBoxProperty","%1 specified twice in %2","Background",t);r=o}else if(o.match(/^[-a-z]+:/i)){if(c)throw new d("MultipleBBoxProperty","%1 specified twice in %2","Style",t);c=f(o)}else if(""!==o)throw new d("InvalidBBoxProperty",'"%1" doesn\'t look like a color, a padding dimension, or a style',o)}i&&(n=e.create("node","mpadded",[n],i)),(r||c)&&(i={},r&&Object.assign(i,{mathbackground:r}),c&&Object.assign(i,{style:c}),n=e.create("node","mstyle",[n],i)),e.Push(n)}};function f(e){return e}function b(e){return e}new s("bbox",{bbox:u.BBox});const x=l.create("bbox",{[i.HANDLER]:{[r.MACRO]:["bbox"]}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/bbox","4.1.3","tex-extension"),n({_:{input:{tex:{bbox:{BboxConfiguration:t}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,o)=>{for(var a in o)e.o(o,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:o[a]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{BegingroupStack:()=>R,begingroupStack:()=>O});var o={};e.r(o),e.d(o,{BegingroupMethods:()=>I});var a={};e.r(a),e.d(a,{BegingroupConfiguration:()=>T});const n=("undefined"!=typeof window?window:e.g).MathJax._.components.global,i=(n.GLOBAL,n.isObject,n.combineConfig,n.combineDefaults,n.combineWithMathJax),r=(n.MathJax,MathJax._.input.tex.HandlerTypes),s=r.ConfigurationType,g=r.HandlerType,l=MathJax._.input.tex.Configuration,p=l.Configuration,u=(l.ConfigurationHandler,l.ParserConfiguration,MathJax._.input.tex.TokenMap),d=(u.parseResult,u.AbstractTokenMap,u.RegExpMap,u.AbstractParseMap,u.CharacterMap,u.DelimiterMap),h=(u.MacroMap,u.CommandMap),b=u.EnvironmentMap,M=MathJax._.input.tex.MapHandler,c=M.MapHandler,E=(M.SubHandler,M.SubHandlers,MathJax._.input.tex.TexError.default),N=MathJax._.input.tex.newcommand.NewcommandUtil,f=N.NewcommandTables,x=N.NewcommandPriority,m=(N.NewcommandUtil,MathJax._.input.tex.ParseMethods.default);class R{constructor(e){this.i=x,this.top=x,this.base=x,this.MARKER=Symbol("marker"),this.handlers=e.handlers,this.getGlobal()}getGlobal(){this.global={[f.NEW_DELIMITER]:c.getMap(f.NEW_DELIMITER),[f.NEW_ENVIRONMENT]:c.getMap(f.NEW_ENVIRONMENT),[f.NEW_COMMAND]:c.getMap(f.NEW_COMMAND)}}checkGlobal(e,t){for(const o of t){const t=e.shift(),a=this.handlers.get(R.handlerMap[o]);let n;this.global[o].add(t,this.MARKER);do{const e=a.applicable(t);n=e.lookup(t),e.remove(t)}while(n&&n!==this.MARKER)}return t.map(e=>this.global[e])}push(){new d(f.NEW_DELIMITER,m.delimiter,{}),new h(f.NEW_COMMAND,{}),new b(f.NEW_ENVIRONMENT,m.environment,{}),this.handlers.add(R.handlerConfig,{},--this.i)}pop(){if(this.i===this.base)throw new E("MissingBegingroup","Missing \\begingroup or extra \\endgroup");this.handlers.remove(R.handlerConfig,{});for(const e of[f.NEW_COMMAND,f.NEW_ENVIRONMENT,f.NEW_DELIMITER])c.register(this.handlers.retrieve(e));this.i++}finish(){this.top=this.i}remove(){for(;this.i<this.top;)this.pop()}reset(){this.top=this.base,this.remove()}sandbox(){this.base=x,this.reset(),this.push(),this.getGlobal(),this.base=x-1}}function O(e){return e.packageData.get("begingroup").stack}R.handlerConfig={[g.DELIMITER]:[f.NEW_DELIMITER],[g.ENVIRONMENT]:[f.NEW_ENVIRONMENT],[g.MACRO]:[f.NEW_DELIMITER,f.NEW_COMMAND]},R.handlerMap={[f.NEW_DELIMITER]:g.DELIMITER,[f.NEW_ENVIRONMENT]:g.ENVIRONMENT,[f.NEW_COMMAND]:g.MACRO};const w=MathJax._.input.tex.base.BaseMethods,_=(w.splitAlignArray,w.default),I={begingroup(e,t){O(e.configuration).push()},endgroup(e,t){O(e.configuration).pop()},reset(e,t){O(e.configuration).reset()},sandbox(e,t){O(e.configuration).sandbox(),e.stack.global.isSandbox=!0},global(e,t){const o=e.i,a="\\"===e.GetNext()?(e.i++,e.GetCS()):"";if(e.i=o,!e.options.begingroup.allowGlobal.includes(a))throw new E("IllegalGlobal","Invalid use of %1",e.currentCS);e.stack.env.isGlobal=!0},macro:_.Macro};new h("begingroup",{begingroup:I.begingroup,endgroup:I.endgroup,global:I.global,gdef:[I.macro,"\\global\\def"],begingroupReset:I.reset,begingroupSandbox:I.sandbox}),new h("begingroup",{begingroup:I.begingroup,endgroup:I.endgroup,global:I.global,gdef:[I.macro,"\\global\\def"],begingroupReset:I.reset,begingroupSandbox:I.sandbox});const T=p.create("begingroup",{[s.HANDLER]:{[g.MACRO]:["begingroup"]},[s.CONFIG]:(e,t)=>{t.parseOptions.packageData.set("begingroup",{stack:new R(t.parseOptions)})},[s.OPTIONS]:{begingroup:{allowGlobal:["let","def","newcommand","DeclareMathOperator","Newextarrow"]}},[s.PREPROCESSORS]:[({data:e})=>O(e).remove()],[s.POSTPROCESSORS]:[({data:e})=>O(e).finish()]});MathJax.loader&&MathJax.loader.checkVersion("[tex]/begingroup","4.1.3","tex-extension"),i({_:{input:{tex:{begingroup:{BegingroupConfiguration:a,BegingroupMethods:o,BegingroupStack:t}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={d:(o,e)=>{for(var a in e)t.o(e,a)&&!t.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:e[a]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};t.r(o),t.d(o,{BoldsymbolConfiguration:()=>g,BoldsymbolMethods:()=>f,createBoldToken:()=>x,rewriteBoldTokens:()=>m});const e=("undefined"!=typeof window?window:t.g).MathJax._.components.global,a=(e.GLOBAL,e.isObject,e.combineConfig,e.combineDefaults,e.combineWithMathJax),n=(e.MathJax,MathJax._.input.tex.HandlerTypes),r=n.ConfigurationType,i=n.HandlerType,l=MathJax._.input.tex.Configuration,s=l.Configuration,d=(l.ConfigurationHandler,l.ParserConfiguration,MathJax._.input.tex.NodeUtil.default),b=MathJax._.input.tex.TexConstants.TexConstant,c=MathJax._.input.tex.TokenMap,u=(c.parseResult,c.AbstractTokenMap,c.RegExpMap,c.AbstractParseMap,c.CharacterMap,c.DelimiterMap,c.MacroMap,c.CommandMap),p=(c.EnvironmentMap,MathJax._.input.tex.NodeFactory.NodeFactory),y={};y[b.Variant.NORMAL]=b.Variant.BOLD,y[b.Variant.ITALIC]=b.Variant.BOLDITALIC,y[b.Variant.FRAKTUR]=b.Variant.BOLDFRAKTUR,y[b.Variant.SCRIPT]=b.Variant.BOLDSCRIPT,y[b.Variant.SANSSERIF]=b.Variant.BOLDSANSSERIF,y["-tex-calligraphic"]="-tex-bold-calligraphic",y["-tex-oldstyle"]="-tex-bold-oldstyle",y["-tex-mathit"]=b.Variant.BOLDITALIC;const f={Boldsymbol(t,o){const e=t.stack.env.boldsymbol;t.stack.env.boldsymbol=!0;const a=t.ParseArg(o);t.stack.env.boldsymbol=e,t.Push(a)}};function x(t,o,e,a){const n=p.createToken(t,o,e,a);return"mtext"!==o&&t.configuration.parser.stack.env.boldsymbol&&(d.setProperty(n,"fixBold",!0),t.configuration.addNode("fixBold",n)),n}function m(t){for(const o of t.data.getList("fixBold"))if(d.getProperty(o,"fixBold")){const t=d.getAttribute(o,"mathvariant");d.setAttribute(o,"mathvariant",y[t]||t),d.removeProperties(o,"fixBold")}}new u("boldsymbol",{boldsymbol:f.Boldsymbol});const g=s.create("boldsymbol",{[r.HANDLER]:{[i.MACRO]:["boldsymbol"]},[r.NODES]:{token:x},[r.POSTPROCESSORS]:[m]});MathJax.loader&&MathJax.loader.checkVersion("[tex]/boldsymbol","4.1.3","tex-extension"),a({_:{input:{tex:{boldsymbol:{BoldsymbolConfiguration:o}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{BraketItem:()=>x});var r={};e.r(r),e.d(r,{default:()=>N});var a={};e.r(a),e.d(a,{BraketConfiguration:()=>S});const o=("undefined"!=typeof window?window:e.g).MathJax._.components.global,n=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults,o.combineWithMathJax),s=(o.MathJax,MathJax._.input.tex.HandlerTypes),i=s.ConfigurationType,c=s.HandlerType,l=MathJax._.input.tex.Configuration,h=l.Configuration,p=(l.ConfigurationHandler,l.ParserConfiguration,MathJax._.input.tex.StackItem),u=(p.MmlStack,p.BaseItem),d=MathJax._.core.MmlTree.MmlNode,m=d.TEXCLASS,M=(d.TEXCLASSNAMES,d.MATHVARIANTS,d.indentAttributes,d.AbstractMmlNode,d.AbstractMmlTokenNode,d.AbstractMmlLayoutNode,d.AbstractMmlBaseNode,d.AbstractMmlEmptyNode,d.TextNode,d.XMLNode,MathJax._.input.tex.ParseUtil),b=(M.KeyValueDef,M.KeyValueTypes,M.ParseUtil),g=MathJax._.util.lengths,k=(g.BIGDIMEN,g.UNITS,g.RELUNITS,g.MATHSPACE),y=(g.length2em,g.percent,g.em),f=(g.px,y(k.thinmathspace));class x extends u{constructor(){super(...arguments),this.barNodes=[]}get kind(){return"braket"}get isOpen(){return!0}checkItem(e){return e.isKind("close")?e.getProperty("braketbar")?(this.barNodes.push(...super.toMml(!0,!0).childNodes),this.Clear(),u.fail):[[this.factory.create("mml",this.toMml())],!0]:e.isKind("mml")?(this.Push(e.toMml()),this.getProperty("single")?[[this.toMml()],!0]:u.fail):super.checkItem(e)}toMml(e=!0,t){let r=super.toMml(e,t);if(!e)return r;const a=this.getProperty("open"),o=this.getProperty("close");if(this.barNodes.length&&(r=this.create("node","inferredMrow",[...this.barNodes,r])),this.getProperty("stretchy"))return this.getProperty("space")&&(r=this.create("node","inferredMrow",[this.create("token","mspace",{width:f}),r,this.create("token","mspace",{width:f})])),b.fenced(this.factory.configuration,a,r,o);const n={fence:!0,stretchy:!1,symmetric:!0,texClass:m.OPEN},s=this.create("token","mo",n,a);n.texClass=m.CLOSE;const i=this.create("token","mo",n,o);return this.create("node","mrow",[s,r,i],{open:a,close:o})}}const P=MathJax._.input.tex.TokenMap,A=(P.parseResult,P.AbstractTokenMap,P.RegExpMap,P.AbstractParseMap,P.CharacterMap,P.DelimiterMap,P.MacroMap),T=P.CommandMap,B=(P.EnvironmentMap,MathJax._.input.tex.base.BaseMethods),C=(B.splitAlignArray,B.default),N={Braket(e,t,r,a,o,n,s=!1){const i=e.i;e.GetArgument(t),e.i=i;let c=!0;"{"===e.GetNext()&&(e.i++,c=!1);const l=e.itemFactory.create("braket");l.setProperties({barcount:0,barmax:n,open:r,close:a,stretchy:o,single:c,space:s}),e.Push(l),l.env.braketItem=e.stack.height-1},Bar(e,t){let r="|"===t?"|":"\u2016";const a=e.stack.height-e.stack.env.braketItem,o=e.stack.Top(a);if(!o||!o.isKind("braket")||o.getProperty("barcount")>=o.getProperty("barmax"))return!1;if("|"===r&&"|"===e.GetNext()&&(e.i++,r="\u2016"),!o.getProperty("stretchy")){const t=e.create("token","mo",{stretchy:!1,"data-braketbar":!0,texClass:m.ORD},r);return e.Push(t),!0}const n=e.itemFactory.create("close").setProperty("braketbar",!0);return e.Push(n),o.barNodes.push(e.create("node","TeXAtom",[],{texClass:m.CLOSE}),e.create("token","mo",{stretchy:!0,"data-braketbar":!0,texClass:m.BIN},r),e.create("node","TeXAtom",[],{texClass:m.OPEN})),o.setProperty("barcount",o.getProperty("barcount")+1),!0},Macro:C.Macro};new T("Braket-macros",{bra:[N.Macro,"{\\langle {#1} \\vert}",1],ket:[N.Macro,"{\\vert {#1} \\rangle}",1],braket:[N.Braket,"\u27e8","\u27e9",!1,1/0],set:[N.Braket,"{","}",!1,1],Bra:[N.Macro,"{\\left\\langle {#1} \\right\\vert}",1],Ket:[N.Macro,"{\\left\\vert {#1} \\right\\rangle}",1],Braket:[N.Braket,"\u27e8","\u27e9",!0,1/0],Set:[N.Braket,"{","}",!0,1,!0],ketbra:[N.Macro,"{\\vert {#1} \\rangle\\langle {#2} \\vert}",2],Ketbra:[N.Macro,"{\\left\\vert {#1} \\right\\rangle\\left\\langle {#2} \\right\\vert}",2],"|":N.Bar}),new A("Braket-characters",{"|":N.Bar});const S=h.create("braket",{[i.HANDLER]:{[c.CHARACTER]:["Braket-characters"],[c.MACRO]:["Braket-macros"]},[i.ITEMS]:{[x.prototype.kind]:x},[i.PRIORITY]:3});MathJax.loader&&MathJax.loader.checkVersion("[tex]/braket","4.1.3","tex-extension"),n({_:{input:{tex:{braket:{BraketConfiguration:a,BraketItems:t,BraketMethods:r}}}}})})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{balanceRules:()=>O,clearDocument:()=>$,getProperty:()=>q,makeBsprAttributes:()=>G,removeProperty:()=>D,saveDocument:()=>K,setProperty:()=>j});var o={};e.r(o),e.d(o,{ProofTreeItem:()=>H});var n={};e.r(n),e.d(n,{default:()=>Z});var r={};e.r(r),e.d(r,{BussproofsConfiguration:()=>re});const i=("undefined"!=typeof window?window:e.g).MathJax._.components.global,a=(i.GLOBAL,i.isObject,i.combineConfig,i.combineDefaults,i.combineWithMathJax),s=(i.MathJax,MathJax._.input.tex.HandlerTypes),c=s.ConfigurationType,l=s.HandlerType,f=MathJax._.input.tex.Configuration,d=f.Configuration,u=(f.ConfigurationHandler,f.ParserConfiguration,MathJax._.input.tex.TexError.default),p=MathJax._.input.tex.StackItem,h=(p.MmlStack,p.BaseItem),m=MathJax._.input.tex.Stack.default,g=MathJax._.input.tex.NodeUtil.default,y=MathJax._.input.tex.UnitUtil.UnitUtil;let P=null,w=null;const x=function(e){w.root=e;const{w:t}=P.outputJax.getBBox(w,P);return t},T=function(e){let t=0;for(;e&&!g.isType(e,"mtable");){if(g.isType(e,"text"))return null;g.isType(e,"mrow")?(e=e.childNodes[0],t=0):(e=e.parent.childNodes[t],t++)}return e},b=function(e,t){return e.childNodes["up"===t?1:0].childNodes[0].childNodes[0].childNodes[0].childNodes[0]},M=function(e,t){return e.childNodes[t].childNodes[0].childNodes[0]},N=function(e){return M(e,0)},I=function(e){return M(e,e.childNodes.length-1)},C=function(e,t){return e.childNodes["up"===t?0:1].childNodes[0].childNodes[0].childNodes[0]},L=function(e){for(;e&&!g.isType(e,"mtd");)e=e.parent;return e},S=function(e){return e.parent.childNodes[e.parent.childNodes.indexOf(e)+1]},k=function(e){for(;e&&null==q(e,"inference");)e=e.parent;return e},A=function(e,t,o=!1){let n=0;if(e===t)return n;if(e!==t.parent&&(n+=e.getProperty(o?"proof-right":"proof-left")||0,e=t.parent),e===t)return n;const r=e.childNodes,i=o?r.length-1:0;return r[i]!==t&&(n+=x(r[i])),n},R=function(e,t=!1){const o=T(e),n=C(o,q(o,"inferenceRule"));return A(e,o,t)+(x(o)-x(n))/2},v=function(e,t,o,n=!1){if(0===o)return;if(q(t,"inferenceRule")||q(t,"labelledRule")){const o=e.nodeFactory.create("node","mrow");t.parent.replaceChild(o,t),o.setChildren([t]),B(t,o),t=o}const r=n?"proof-right":"proof-left";t.setProperty(r,(t.getProperty(r)||0)+o);const i=[];for(const e of["left","right"]){const o=t.getProperty(`proof-${e}`);o&&i.push(`margin-${e}: ${y.em(o)}`)}t.attributes.set("style",i.join("; "))},B=function(e,t){["inference","proof","labelledRule"].forEach(o=>{const n=q(e,o);null!=n&&(j(t,o,n),D(e,o))})},J=function(e,t,o,n,r){const i=e.nodeFactory.create("node","mspace",[],{width:y.em(r)});if("left"===n){const e=t.childNodes[o].childNodes[0];i.parent=e,e.childNodes.unshift(i)}else t.childNodes[o].appendChild(i);j(t.parent,"sequentAdjust_"+n,r)},_=function(e,t){let o=t.pop();for(;t.length;){const n=t.pop(),[r,i]=E(o,n);q(o.parent,"axiom")&&(J(e,r<0?o:n,0,"left",Math.abs(r)),J(e,i<0?o:n,2,"right",Math.abs(i))),o=n}},E=function(e,t){const o=x(e.childNodes[2]),n=x(t.childNodes[2]);return[x(e.childNodes[0])-x(t.childNodes[0]),o-n]},O=function(e){w=new e.document.options.MathItem("",null,e.math.display);const t=e.data;!function(e){const t=e.nodeLists.sequent;if(t)for(let o,n=t.length-1;o=t[n];n--){if(q(o,"sequentProcessed")){D(o,"sequentProcessed");continue}const t=[];let n=k(o);if(1===q(n,"inference")){for(t.push(o);1===q(n,"inference");){n=T(n);const e=N(b(n,q(n,"inferenceRule"))),r=q(e,"inferenceRule")?C(e,q(e,"inferenceRule")):e;q(r,"sequent")&&(o=r.childNodes[0],t.push(o),j(o,"sequentProcessed",!0)),n=e}_(e,t)}}}(t);const o=t.nodeLists.inference||[];let n=0;for(const e of o){const o=q(e,"proof"),r=T(e),i=b(r,q(r,"inferenceRule")),a=N(i);let s=0;if(q(a,"inference")){const o=R(a);if(o){v(t,a,-o);const n=A(e,r,!1);v(t,e,o-n),s=o-n}}const c=I(i);if(null==q(c,"inference"))continue;const l=R(c,!0);v(t,c,-l,!0);const f=A(e,r,!0),d=(x(r)-x(i.parent))/2;let u;if(v(t,e,d<s?-d:-s),n=Math.max(0,Math.max(0,n+l-f)-d),o||!(u=L(e))){v(t,q(e,"proof")?e:e.parent,n,!0);continue}const p=S(u);if(p){const e=t.nodeFactory.create("node","mspace",[],{width:y.em(n)});p.appendChild(e),n=0;continue}k(u)}},F="bspr_",U=RegExp("^"+F),j=function(e,t,o){g.setProperty(e,F+t,o)},q=function(e,t){return g.getProperty(e,F+t)},D=function(e,t){e.removeProperty(F+t)},G=function(e){e.data.root.walkTree((e,t)=>{const o=[];e.getPropertyNames().forEach(t=>{t.match(U)&&o.push(t+":"+e.getProperty(t))}),o.length&&g.setAttribute(e,"semantics",o.join(";"))})},K=function(e){if(P=e.document,!("getBBox"in P.outputJax))throw Error("The bussproofs extension requires an output jax with a getBBox() method")},$=function(e){P=null};class H extends h{constructor(){super(...arguments),this.leftLabel=null,this.rigthLabel=null,this.innerStack=new m(this.factory,{},!0)}get kind(){return"proofTree"}checkItem(e){if(e.isKind("end")&&"prooftree"===e.getName()){const t=this.toMml();return j(t,"proof",!0),[[this.factory.create("mml",t),e],!0]}if(e.isKind("stop"))throw new u("EnvMissingEnd","Missing \\end{%1}",this.getName());return this.innerStack.Push(e),h.fail}toMml(){const e=super.toMml(),t=this.innerStack.Top();if(t.isKind("start")&&!t.Size())return e;this.innerStack.Push(this.factory.create("stop"));const o=this.innerStack.Top().toMml();return this.create("node","mrow",[o,e],{})}}const Q=MathJax._.input.tex.TexParser.default,V=MathJax._.input.tex.ParseUtil,z=(V.KeyValueDef,V.KeyValueTypes,V.ParseUtil);function W(e,t){const o=z.internalMath(e,y.trimSpaces(t),0);if(!o[0].childNodes[0].childNodes.length)return e.create("node","mrow",[]);const n=e.create("node","mspace",[],{width:".5ex"}),r=e.create("node","mspace",[],{width:".5ex"});return e.create("node","mrow",[n,...o,r])}function X(e,t,o,n,r,i,a){const s=e.create("node","mtr",[e.create("node","mtd",[t],{})],{}),c=e.create("node","mtr",[e.create("node","mtd",o,{})],{});let l,f,d,u,p=e.create("node","mtable",a?[c,s]:[s,c],{align:"top 2",rowlines:i,framespacing:"0 0"});if(j(p,"inferenceRule",a?"up":"down"),n&&(l=e.create("node","mpadded",[n],{height:".25em",depth:"+.25em",width:"+.5ex",voffset:"-.25em"}),j(l,"prooflabel","left")),r&&(f=e.create("node","mpadded",[r],{height:"-.25em",depth:"+.25em",width:"+.5ex",voffset:"-.25em",lspace:".5ex"}),j(f,"prooflabel","right")),n&&r)d=[l,p,f],u="both";else if(n)d=[l,p],u="left";else{if(!r)return p;d=[p,f],u="right"}return p=e.create("node","mrow",d),j(p,"labelledRule",u),p}function Y(e,t){if("$"!==e.GetNext())throw new u("IllegalUseOfCommand","Use of %1 does not match its definition.",t);e.i++;const o=e.GetUpTo(t,"$");if(!o.includes("\\fCenter"))throw new u("MissingProofCommand","Missing %1 in %2.","\\fCenter",t);const[n,r]=o.split("\\fCenter"),i=new Q(n,e.stack.env,e.configuration).mml(),a=new Q(r,e.stack.env,e.configuration).mml(),s=new Q("\\fCenter",e.stack.env,e.configuration).mml(),c=e.create("node","mtd",[i],{}),l=e.create("node","mtd",[s],{}),f=e.create("node","mtd",[a],{}),d=e.create("node","mtr",[c,l,f],{}),p=e.create("node","mtable",[d],{columnspacing:".5ex",columnalign:"center 2"});return j(p,"sequent",!0),e.configuration.addNode("sequent",d),p}const Z={Prooftree(e,t){e.Push(t);return e.itemFactory.create("proofTree").setProperties({name:t.getName(),line:"solid",currentLine:"solid",rootAtTop:!1})},Axiom(e,t){const o=e.stack.Top();if("proofTree"!==o.kind)throw new u("IllegalProofCommand","Proof commands only allowed in prooftree environment.");const n=W(e,e.GetArgument(t));j(n,"axiom",!0),o.Push(n)},Inference(e,t,o){const n=e.stack.Top();if("proofTree"!==n.kind)throw new u("IllegalProofCommand","Proof commands only allowed in prooftree environment.");if(n.Size()<o)throw new u("BadProofTree","Proof tree badly specified.");const r=n.getProperty("rootAtTop"),i=1!==o||n.Peek()[0].childNodes.length?o:0,a=[];do{a.length&&a.unshift(e.create("node","mtd",[],{})),a.unshift(e.create("node","mtd",[n.Pop()],{rowalign:r?"top":"bottom"})),o--}while(o>0);const s=e.create("node","mtr",a,{}),c=e.create("node","mtable",[s],{framespacing:"0 0"}),l=W(e,e.GetArgument(t)),f=n.getProperty("currentLine");f!==n.getProperty("line")&&n.setProperty("currentLine",n.getProperty("line"));const d=X(e,c,[l],n.getProperty("left"),n.getProperty("right"),f,r);n.setProperty("left",null),n.setProperty("right",null),j(d,"inference",i),e.configuration.addNode("inference",d),n.Push(d)},Label(e,t,o){const n=e.stack.Top();if("proofTree"!==n.kind)throw new u("IllegalProofCommand","Proof commands only allowed in prooftree environment.");const r=z.internalMath(e,e.GetArgument(t),0),i=r.length>1?e.create("node","mrow",r,{}):r[0];n.setProperty(o,i)},SetLine(e,t,o,n){const r=e.stack.Top();if("proofTree"!==r.kind)throw new u("IllegalProofCommand","Proof commands only allowed in prooftree environment.");r.setProperty("currentLine",o),n&&r.setProperty("line",o)},RootAtTop(e,t,o){const n=e.stack.Top();if("proofTree"!==n.kind)throw new u("IllegalProofCommand","Proof commands only allowed in prooftree environment.");n.setProperty("rootAtTop",o)},AxiomF(e,t){const o=e.stack.Top();if("proofTree"!==o.kind)throw new u("IllegalProofCommand","Proof commands only allowed in prooftree environment.");const n=Y(e,t);j(n,"axiom",!0),o.Push(n)},FCenter(e,t){},InferenceF(e,t,o){const n=e.stack.Top();if("proofTree"!==n.kind)throw new u("IllegalProofCommand","Proof commands only allowed in prooftree environment.");if(n.Size()<o)throw new u("BadProofTree","Proof tree badly specified.");const r=n.getProperty("rootAtTop"),i=1!==o||n.Peek()[0].childNodes.length?o:0,a=[];do{a.length&&a.unshift(e.create("node","mtd",[],{})),a.unshift(e.create("node","mtd",[n.Pop()],{rowalign:r?"top":"bottom"})),o--}while(o>0);const s=e.create("node","mtr",a,{}),c=e.create("node","mtable",[s],{framespacing:"0 0"}),l=Y(e,t),f=n.getProperty("currentLine");f!==n.getProperty("line")&&n.setProperty("currentLine",n.getProperty("line"));const d=X(e,c,[l],n.getProperty("left"),n.getProperty("right"),f,r);n.setProperty("left",null),n.setProperty("right",null),j(d,"inference",i),e.configuration.addNode("inference",d),n.Push(d)}},ee=MathJax._.input.tex.ParseMethods.default,te=MathJax._.input.tex.TokenMap,oe=(te.parseResult,te.AbstractTokenMap,te.RegExpMap,te.AbstractParseMap,te.CharacterMap,te.DelimiterMap,te.MacroMap,te.CommandMap),ne=te.EnvironmentMap;new oe("Bussproofs-macros",{AxiomC:Z.Axiom,UnaryInfC:[Z.Inference,1],BinaryInfC:[Z.Inference,2],TrinaryInfC:[Z.Inference,3],QuaternaryInfC:[Z.Inference,4],QuinaryInfC:[Z.Inference,5],RightLabel:[Z.Label,"right"],LeftLabel:[Z.Label,"left"],AXC:Z.Axiom,UIC:[Z.Inference,1],BIC:[Z.Inference,2],TIC:[Z.Inference,3],RL:[Z.Label,"right"],LL:[Z.Label,"left"],noLine:[Z.SetLine,"none",!1],singleLine:[Z.SetLine,"solid",!1],solidLine:[Z.SetLine,"solid",!1],dashedLine:[Z.SetLine,"dashed",!1],alwaysNoLine:[Z.SetLine,"none",!0],alwaysSingleLine:[Z.SetLine,"solid",!0],alwaysSolidLine:[Z.SetLine,"solid",!0],alwaysDashedLine:[Z.SetLine,"dashed",!0],rootAtTop:[Z.RootAtTop,!0],alwaysRootAtTop:[Z.RootAtTop,!0],rootAtBottom:[Z.RootAtTop,!1],alwaysRootAtBottom:[Z.RootAtTop,!1],fCenter:Z.FCenter,Axiom:Z.AxiomF,UnaryInf:[Z.InferenceF,1],BinaryInf:[Z.InferenceF,2],TrinaryInf:[Z.InferenceF,3],QuaternaryInf:[Z.InferenceF,4],QuinaryInf:[Z.InferenceF,5]}),new ne("Bussproofs-environments",ee.environment,{prooftree:[Z.Prooftree,null,!1]});const re=d.create("bussproofs",{[c.HANDLER]:{[l.MACRO]:["Bussproofs-macros"],[l.ENVIRONMENT]:["Bussproofs-environments"]},[c.ITEMS]:{[H.prototype.kind]:H},[c.PREPROCESSORS]:[[K,1]],[c.POSTPROCESSORS]:[[$,3],[G,2],[O,1]]});MathJax.loader&&MathJax.loader.checkVersion("[tex]/bussproofs","4.1.3","tex-extension"),a({_:{input:{tex:{bussproofs:{BussproofsConfiguration:r,BussproofsItems:o,BussproofsMethods:n,BussproofsUtil:t}}}}})})();
|