@dereekb/dbx-form 13.15.0 → 13.17.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"dereekb-dbx-form-quiz.mjs","sources":["../../../../packages/dbx-form/quiz/src/lib/store/quiz.store.ts","../../../../packages/dbx-form/quiz/src/lib/store/quiz.accessor.ts","../../../../packages/dbx-form/quiz/src/lib/container/quiz.component.ts","../../../../packages/dbx-form/quiz/src/lib/container/quiz.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.number.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.number.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.multiplechoice.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.multiplechoice.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.prequiz.intro.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.prequiz.intro.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.question.text.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.question.text.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.postquiz.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.postquiz.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.reset.button.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.score.component.ts","../../../../packages/dbx-form/quiz/src/lib/quiz.util.ts","../../../../packages/dbx-form/quiz/src/dereekb-dbx-form-quiz.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { type QuestionIndex, type Quiz, type QuizAnswer, type QuizQuestion, type QuizQuestionId, type QuizQuestionIdIndexPair, type QuizQuestionWithIndex } from './quiz';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type ArrayOrValue, asArray, type Configurable, type Maybe } from '@dereekb/util';\nimport { combineLatest, distinctUntilChanged, map, type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\n\n/**\n * Internal state shape managed by QuizStore.\n */\nexport interface QuizStoreState {\n /**\n * Map of questions, keyed by id.\n *\n * Unset if the quiz is not yet set.\n */\n readonly questionMap?: Maybe<ReadonlyMap<QuizQuestionId, QuizQuestion>>;\n /**\n * Started quiz\n */\n readonly startedQuiz: boolean;\n /**\n * Questions that have been answered, sorted by index.\n */\n readonly completedQuestions: QuizQuestionIdIndexPair[];\n /**\n * Questions that are remaining to be answered, sorted by index.\n */\n readonly unansweredQuestions: QuizQuestionIdIndexPair[];\n /**\n * Map of current answers.\n */\n readonly answers: ReadonlyMap<QuizQuestionId, QuizAnswer>;\n /**\n * The current index that corresponds with the selected question.\n *\n * If null, defaults to the first question.\n *\n * If greater than the total number of questions, then the quiz is considered complete.\n */\n readonly questionIndex?: Maybe<QuestionIndex>;\n /**\n * If true, the quiz is locked from navigation.\n *\n * Typically used while submitting the quiz.\n */\n readonly lockQuizNavigation?: boolean;\n /**\n * If true, the quiz has been marked as submitted.\n */\n readonly submittedQuiz?: boolean;\n /**\n * The current/active quiz.\n */\n readonly quiz?: Maybe<Quiz>;\n /**\n * If true, allows going back to visit previous questions.\n */\n readonly allowVisitingPreviousQuestion: boolean;\n /**\n * If true, automatically advances to the next question when an answer is set.\n */\n readonly autoAdvanceToNextQuestion: boolean;\n /**\n * Whether or not skipping questions is allowed.\n *\n * Defaults to false.\n */\n readonly allowSkipQuestion: boolean;\n}\n\n/**\n * Lookup input for retrieving an answer by question id, index, or the current question.\n * Provide exactly one of `id`, `index`, or `currentIndex`.\n */\nexport interface QuizStoreAnswerLookupInput extends Partial<QuizQuestionIdIndexPair> {\n readonly currentIndex?: boolean;\n}\n\n/**\n * NgRx ComponentStore that manages quiz lifecycle: question navigation, answer tracking,\n * submission state, and navigation locking.\n *\n * Provided at the component level by `QuizComponent`.\n *\n * @example\n * ```ts\n * // Access from a child component via DI:\n * readonly quizStore = inject(QuizStore);\n * this.quizStore.startQuiz();\n * this.quizStore.updateAnswerForCurrentQuestion(5);\n * ```\n */\n@Injectable()\nexport class QuizStore extends ComponentStore<QuizStoreState> {\n constructor() {\n super({\n quiz: undefined,\n startedQuiz: false,\n submittedQuiz: false,\n answers: new Map(),\n questionIndex: undefined,\n unansweredQuestions: [],\n completedQuestions: [],\n questionMap: undefined,\n autoAdvanceToNextQuestion: true,\n allowVisitingPreviousQuestion: true,\n allowSkipQuestion: false\n });\n }\n\n readonly quiz$ = this.select((state) => state.quiz);\n readonly titleDetails$ = this.quiz$.pipe(map((quiz) => quiz?.titleDetails));\n readonly questions$ = this.quiz$.pipe(map((quiz) => quiz?.questions ?? []));\n readonly startedQuiz$ = this.select((state) => state.startedQuiz);\n readonly lockQuizNavigation$ = this.select((state) => state.lockQuizNavigation);\n readonly submittedQuiz$ = this.select((state) => state.submittedQuiz);\n readonly answers$ = this.select((state) => state.answers);\n readonly questionIndex$ = this.select((state) => state.questionIndex ?? 0);\n readonly completedQuestions$ = this.select((state) => state.completedQuestions);\n readonly unansweredQuestions$ = this.select((state) => state.unansweredQuestions);\n readonly hasAnswerForEachQuestion$ = this.select((state) => state.unansweredQuestions.length === 0);\n readonly isAtEndOfQuestions$ = this.select((state) => (state.questionIndex ?? 0) >= (state.quiz?.questions.length ?? 0));\n\n readonly canGoToPreviousQuestion$ = this.select((state) => !state.lockQuizNavigation && state.allowVisitingPreviousQuestion && state.questionIndex != null && state.questionIndex > 0);\n readonly canGoToNextQuestion$ = this.select((state) => {\n const newQuestionIndex = computeAdvanceIndexOnState(state, 1);\n return !state.lockQuizNavigation && state.questionIndex != null && newQuestionIndex != null && newQuestionIndex > state.questionIndex;\n });\n\n readonly currentQuestion$: Observable<Maybe<QuizQuestionWithIndex>> = combineLatest([this.questions$, this.questionIndex$]).pipe(\n map(([questions, questionIndex]) => {\n const question = questions[questionIndex];\n let result: Maybe<QuizQuestionWithIndex>;\n\n if (question) {\n result = {\n ...question,\n index: questionIndex\n };\n }\n\n return result;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Returns a reactive observable of the answer for a given question, looked up by id, index, or the current question.\n *\n * @param lookupInput - Lookup criteria specifying which question's answer to retrieve.\n * @param lookupInput - Lookup criteria specifying which question's answer to retrieve.\n * @returns An observable that emits the current answer for the specified question, or undefined if not answered.\n *\n * @example\n * ```ts\n * // By current question:\n * store.answerForQuestion({ currentIndex: true }).subscribe(answer => console.log(answer));\n * // By question id:\n * store.answerForQuestion({ id: 'q1' }).subscribe(answer => console.log(answer));\n * ```\n */\n answerForQuestion(lookupInput: ObservableOrValue<QuizStoreAnswerLookupInput>): Observable<Maybe<QuizAnswer>> {\n return asObservable(lookupInput).pipe(\n switchMap((lookup) => {\n const { id, index, currentIndex } = lookup;\n let result: Observable<Maybe<QuizAnswer>>;\n\n if (currentIndex) {\n result = this.currentQuestion$.pipe(switchMap((question) => this.answerForQuestion({ index: question?.index })));\n } else if (id != null) {\n result = this.answers$.pipe(map((answers) => answers.get(id)));\n } else if (index != null) {\n result = this.questions$.pipe(\n switchMap((questions) => {\n const question = questions[index];\n let result: Observable<Maybe<QuizAnswer>>;\n\n if (question) {\n result = this.answerForQuestion({ id: question.id });\n } else {\n result = of(undefined);\n }\n\n return result;\n })\n );\n } else {\n result = of(undefined);\n }\n\n return result;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n readonly startQuiz = this.updater((state) => startQuizOnState(state));\n readonly setQuiz = this.updater((state, quiz: Maybe<Quiz>) => setQuizOnState(state, quiz));\n\n /**\n * Resets the quiz entirely, back to the pre-quiz state.\n */\n readonly resetQuiz = this.updater((state) => resetQuizOnState(state));\n\n /**\n * Restarts the quiz to the first question.\n */\n readonly restartQuizToFirstQuestion = this.updater((state) => restartQuizToFirstQuestionOnState(state));\n\n readonly setAnswers = this.updater((state, answers: Maybe<QuizAnswer[]>) => setAnswersOnState(state, answers));\n readonly updateAnswers = this.updater((state, answers: Maybe<QuizAnswer[]>) => updateAnswersOnState(state, answers));\n readonly updateAnswerForCurrentQuestion = this.updater((state, answerData: unknown) => updateAnswerForCurrentQuestionOnState(state, answerData));\n readonly setQuestionIndex = this.updater((state, questionIndex: QuestionIndex) => ({ ...state, questionIndex }));\n readonly setAutoAdvanceToNextQuestion = this.updater((state, autoAdvanceToNextQuestion: boolean) => ({ ...state, autoAdvanceToNextQuestion }));\n readonly setAllowSkipQuestion = this.updater((state, allowSkipQuestion: boolean) => ({ ...state, allowSkipQuestion }));\n readonly setAllowVisitingPreviousQuestion = this.updater((state, allowVisitingPreviousQuestion: boolean) => ({ ...state, allowVisitingPreviousQuestion }));\n\n readonly goToNextQuestion = this.updater((state) => advanceQuestionOnState(state, 1));\n readonly goToPreviousQuestion = this.updater((state) => advanceQuestionOnState(state, -1));\n\n readonly setLockQuizNavigation = this.updater((state, lockQuizNavigation: boolean) => ({ ...state, lockQuizNavigation }));\n readonly setSubmittedQuiz = this.updater((state, submittedQuiz: boolean) => ({ ...state, submittedQuiz }));\n}\n\nfunction computeAdvanceIndexOnState(state: QuizStoreState, advancement: number): Maybe<QuestionIndex> {\n const { questionIndex, allowSkipQuestion, unansweredQuestions, lockQuizNavigation } = state;\n const maxQuestionIndex = state.quiz?.questions.length;\n\n let newQuestionIndex: Maybe<QuestionIndex>;\n\n if (maxQuestionIndex != null && questionIndex != null && !lockQuizNavigation) {\n let maxAllowedIndex = maxQuestionIndex;\n\n if (!allowSkipQuestion) {\n maxAllowedIndex = unansweredQuestions[0]?.index ?? maxQuestionIndex;\n }\n\n newQuestionIndex = Math.max(0, Math.min(maxAllowedIndex, questionIndex + advancement));\n }\n\n return newQuestionIndex;\n}\n\nfunction advanceQuestionOnState(state: QuizStoreState, advancement: number): QuizStoreState {\n const newQuestionIndex = computeAdvanceIndexOnState(state, advancement);\n\n let nextState: QuizStoreState = state;\n\n if (newQuestionIndex != null) {\n nextState = {\n ...state,\n questionIndex: newQuestionIndex\n };\n }\n\n return nextState;\n}\n\nfunction startQuizOnState(state: QuizStoreState): QuizStoreState {\n const { startedQuiz } = state;\n let nextState: QuizStoreState = state;\n\n if (!startedQuiz) {\n nextState = {\n ...state,\n startedQuiz: true,\n submittedQuiz: false,\n lockQuizNavigation: false,\n questionIndex: 0\n };\n }\n\n return nextState;\n}\n\nfunction resetQuizOnState(state: QuizStoreState): QuizStoreState {\n return {\n ...restartQuizToFirstQuestionOnState(state),\n startedQuiz: false\n };\n}\n\nfunction restartQuizToFirstQuestionOnState(state: QuizStoreState): QuizStoreState {\n return setAnswersOnState(\n startQuizOnState({\n ...state,\n startedQuiz: false\n }),\n []\n );\n}\n\nfunction setQuizOnState(state: QuizStoreState, quiz?: Maybe<Quiz>): QuizStoreState {\n let questionMap: Maybe<ReadonlyMap<QuizQuestionId, QuizQuestion>> = undefined;\n const currentAnswers = [...state.answers.values()];\n\n if (quiz?.questions) {\n questionMap = new Map(quiz.questions.map((question) => [question.id, question]));\n }\n\n return setAnswersOnState({ ...state, quiz, questionMap }, currentAnswers);\n}\n\nfunction setAnswersOnState(state: QuizStoreState, newAnswers: Maybe<ArrayOrValue<QuizAnswer>>): QuizStoreState {\n return updateAnswersOnState(\n {\n ...state,\n answers: new Map()\n },\n newAnswers\n );\n}\n\nfunction updateAnswerForCurrentQuestionOnState(state: QuizStoreState, answerData: unknown): QuizStoreState {\n const { questionIndex } = state;\n let nextState: Configurable<QuizStoreState> = state;\n\n if (questionIndex != null) {\n const currentQuestion = state.quiz?.questions[questionIndex];\n\n if (currentQuestion) {\n const answer: QuizAnswer = {\n id: currentQuestion.id,\n data: answerData\n };\n\n nextState = updateAnswersOnState(state, [answer]);\n\n if (state.autoAdvanceToNextQuestion) {\n nextState.questionIndex = questionIndex + 1;\n }\n }\n }\n\n return nextState;\n}\n\nfunction updateAnswersOnState(state: QuizStoreState, inputAnswers: Maybe<ArrayOrValue<QuizAnswer>>): QuizStoreState {\n const { quiz, answers: currentAnswers } = state;\n\n const answers = new Map(currentAnswers);\n\n asArray(inputAnswers).forEach((answer) => {\n answers.set(answer.id, answer);\n });\n\n const completedQuestions: QuizQuestionIdIndexPair[] = [];\n const unansweredQuestions: QuizQuestionIdIndexPair[] = [];\n\n if (quiz?.questions) {\n quiz.questions.forEach((question, index) => {\n if (answers.has(question.id)) {\n completedQuestions.push({ id: question.id, index });\n } else {\n unansweredQuestions.push({ id: question.id, index });\n }\n });\n }\n\n return { ...state, unansweredQuestions, completedQuestions, answers };\n}\n","import { type Maybe } from '@dereekb/util';\nimport { type Observable, type Subscription } from 'rxjs';\nimport { type QuizQuestion, type QuizAnswer, type Quiz } from './quiz';\nimport { type Provider } from '@angular/core';\nimport { QuizStore } from './quiz.store';\n\n/**\n * Abstract accessor injected into answer/question child components to read the current question\n * and write answers back to the QuizStore without coupling to it directly.\n *\n * Use `provideCurrentQuestionQuizQuestionAccessor()` to bind this to the store's current question.\n */\nexport abstract class QuizQuestionAccessor<T = unknown> {\n /**\n * The active quiz definition.\n */\n abstract readonly quiz$: Observable<Maybe<Quiz>>;\n\n /**\n * The question this accessor is bound to.\n */\n abstract readonly question$: Observable<Maybe<QuizQuestion>>;\n\n /**\n * The current answer for this question, or undefined if unanswered.\n */\n abstract readonly answer$: Observable<Maybe<QuizAnswer<T>>>;\n\n /**\n * Submits an answer value for this question.\n */\n abstract setAnswer(answer: T): void;\n\n /**\n * Binds an observable source whose emissions are forwarded as answer updates.\n */\n abstract setAnswerSource(answer: Observable<T>): Subscription;\n}\n\n/**\n * Provides QuizQuestionAccessor bound to the current question in QuizStore.\n *\n * @returns An Angular provider that binds QuizQuestionAccessor to the current quiz question.\n *\n * @usage\n * ```typescript\n * @Component ({\n * providers: [QuizStore, provideCurrentQuestionQuizQuestionAccessor()]\n * })\n * ```\n */\nexport function provideCurrentQuestionQuizQuestionAccessor<T = unknown>(): Provider {\n return {\n provide: QuizQuestionAccessor,\n useFactory: (quizStore: QuizStore) => {\n return {\n quiz$: quizStore.quiz$,\n question$: quizStore.currentQuestion$,\n answer$: quizStore.answerForQuestion({ currentIndex: true }),\n setAnswer: (answer: T) => quizStore.updateAnswerForCurrentQuestion(answer),\n setAnswerSource: (answer: Observable<T>) => quizStore.updateAnswerForCurrentQuestion(answer)\n };\n },\n deps: [QuizStore]\n };\n}\n","import { Component, computed, effect, inject, input, type Signal } from '@angular/core';\nimport { QuizStore } from '../store/quiz.store';\nimport { type Maybe } from '@dereekb/util';\nimport { type Quiz } from '../store/quiz';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, first, map, type Observable, switchMap } from 'rxjs';\nimport { DbxInjectionComponent, type DbxInjectionComponentConfig } from '@dereekb/dbx-core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { provideCurrentQuestionQuizQuestionAccessor } from '../store/quiz.accessor';\nimport { DbxButtonModule, DbxWindowKeyDownListenerDirective } from '@dereekb/dbx-web';\n\n/**\n * Lifecycle state of the quiz container view.\n */\nexport type QuizComponentState = 'init' | 'pre-quiz' | 'quiz' | 'post-quiz';\n\n/**\n * Discriminated union of view configs, one per quiz lifecycle state.\n */\nexport type QuizComponentViewConfig = QuizComponentViewInitConfig | QuizComponentViewPreQuizConfig | QuizComponentViewQuizConfig | QuizComponentViewPostQuizConfig;\n\nexport interface QuizComponentViewInitConfig {\n readonly state: 'init';\n}\n\nexport interface QuizComponentViewPreQuizConfig {\n readonly state: 'pre-quiz';\n readonly preQuizComponent?: Maybe<DbxInjectionComponentConfig>;\n}\n\nexport interface QuizComponentViewQuizConfig {\n readonly state: 'quiz';\n readonly questionComponent?: Maybe<DbxInjectionComponentConfig>;\n readonly answerComponent?: Maybe<DbxInjectionComponentConfig>;\n}\n\nexport interface QuizComponentViewPostQuizConfig {\n readonly state: 'post-quiz';\n readonly resultsComponent?: Maybe<DbxInjectionComponentConfig>;\n}\n\n/**\n * Top-level quiz container that orchestrates pre-quiz, active quiz, and post-quiz views.\n *\n * Provides its own `QuizStore` and `QuizQuestionAccessor`, so child components injected via\n * `DbxInjectionComponent` can access quiz state directly through DI.\n *\n * Supports keyboard navigation: Enter (start / next), ArrowLeft (previous), ArrowRight (next).\n *\n * @example\n * ```html\n * <dbx-quiz [quiz]=\"myQuiz\"></dbx-quiz>\n * ```\n */\n@Component({\n selector: 'dbx-quiz',\n templateUrl: './quiz.component.html',\n imports: [DbxInjectionComponent, DbxButtonModule, DbxWindowKeyDownListenerDirective, NgTemplateOutlet],\n providers: [QuizStore, provideCurrentQuestionQuizQuestionAccessor()],\n standalone: true\n})\nexport class QuizComponent {\n readonly quizStore = inject(QuizStore);\n readonly quiz = input.required<Maybe<Quiz>>();\n\n readonly keysFilter = ['Enter', 'ArrowLeft', 'ArrowRight'];\n\n readonly quizEffect = effect(\n () => {\n const quiz = this.quiz();\n this.quizStore.setQuiz(quiz);\n },\n { allowSignalWrites: true }\n );\n\n readonly quiz$ = toObservable(this.quiz);\n readonly quizTitleSignal = computed(() => this.quiz()?.titleDetails.title);\n\n readonly currentQuestionSignal = toSignal(this.quizStore.currentQuestion$);\n\n readonly questionTitleSignal = computed(() => {\n const currentQuestion = this.currentQuestionSignal();\n return currentQuestion ? `Question ${currentQuestion.index + 1}` : '';\n });\n\n readonly startedQuiz$ = this.quizStore.startedQuiz$;\n readonly currentQuestion$ = this.quizStore.currentQuestion$;\n\n readonly canGoToPreviousQuestionSignal: Signal<boolean> = toSignal(this.quizStore.canGoToPreviousQuestion$, { initialValue: false });\n readonly canGoToNextQuestionSignal: Signal<boolean> = toSignal(this.quizStore.canGoToNextQuestion$, { initialValue: false });\n\n readonly viewConfig$: Observable<QuizComponentViewConfig> = this.startedQuiz$.pipe(\n switchMap((started) => {\n let result: Observable<QuizComponentViewConfig>;\n\n if (started) {\n result = combineLatest([this.quiz$, this.currentQuestion$, this.quizStore.isAtEndOfQuestions$]).pipe(\n map(([quiz, currentQuestion, isAtEndOfQuestions]) => {\n let viewConfig: QuizComponentViewConfig;\n\n if (isAtEndOfQuestions) {\n viewConfig = {\n state: 'post-quiz',\n resultsComponent: quiz?.resultsComponentConfig\n };\n } else {\n viewConfig = {\n state: 'quiz',\n questionComponent: currentQuestion?.questionComponentConfig,\n answerComponent: currentQuestion?.answerComponentConfig\n };\n }\n\n return viewConfig;\n })\n );\n } else {\n result = this.quiz$.pipe(\n map((quiz) => {\n const viewConfig: QuizComponentViewPreQuizConfig = {\n state: 'pre-quiz',\n preQuizComponent: quiz?.preQuizComponentConfig\n };\n\n return viewConfig;\n })\n );\n }\n\n return result;\n })\n );\n\n readonly viewConfigSignal: Signal<QuizComponentViewConfig> = toSignal(this.viewConfig$, { initialValue: { state: 'init' } });\n readonly viewStateSignal: Signal<QuizComponentState> = computed(() => this.viewConfigSignal()?.state ?? 'init');\n\n readonly preQuizComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewPreQuizConfig)?.preQuizComponent);\n readonly questionComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewQuizConfig)?.questionComponent);\n readonly answerComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewQuizConfig)?.answerComponent);\n readonly resultsComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewPostQuizConfig)?.resultsComponent);\n\n handleKeyDown(event: KeyboardEvent) {\n const code = event.code;\n\n switch (code) {\n case 'Enter':\n this.quizStore.startedQuiz$.pipe(first()).subscribe((started) => {\n if (!started) {\n this.quizStore.startQuiz();\n } else {\n this.clickNextQuestion();\n }\n });\n break;\n case 'ArrowLeft':\n this.clickPreviousQuestion();\n break;\n case 'ArrowRight':\n this.clickNextQuestion();\n break;\n }\n }\n\n clickPreviousQuestion() {\n this.quizStore.goToPreviousQuestion();\n }\n\n clickNextQuestion() {\n this.quizStore.goToNextQuestion();\n }\n}\n","<div class=\"dbx-quiz\" (dbxWindowKeyDownListener)=\"handleKeyDown($event)\" [dbxWindowKeyDownFilter]=\"keysFilter\">\n @switch (viewStateSignal()) {\n @case ('pre-quiz') {\n <ng-container *ngTemplateOutlet=\"preQuizTemplate\"></ng-container>\n }\n @case ('quiz') {\n <ng-container *ngTemplateOutlet=\"quizTemplate\"></ng-container>\n }\n @case ('post-quiz') {\n <ng-container *ngTemplateOutlet=\"postQuizTemplate\"></ng-container>\n }\n }\n</div>\n\n<!-- Pre-Quiz -->\n<ng-template #preQuizTemplate>\n <div class=\"dbx-quiz-pre-quiz\">\n <dbx-injection [config]=\"preQuizComponentConfigSignal()\"></dbx-injection>\n </div>\n</ng-template>\n\n<!-- Quiz -->\n<ng-template #quizTemplate>\n <div class=\"dbx-quiz-quiz\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n <div class=\"dbx-quiz-question dbx-pb3\">\n <h4 class=\"dbx-quiz-question-title\">{{ questionTitleSignal() }}</h4>\n <dbx-injection [config]=\"questionComponentConfigSignal()\"></dbx-injection>\n </div>\n <div class=\"dbx-quiz-answer dbx-pt3\">\n <dbx-injection [config]=\"answerComponentConfigSignal()\"></dbx-injection>\n </div>\n </div>\n</ng-template>\n\n<!-- Post-Quiz -->\n<ng-template #postQuizTemplate>\n <div class=\"dbx-quiz-post-quiz\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n <dbx-injection [config]=\"resultsComponentConfigSignal()\"></dbx-injection>\n </div>\n</ng-template>\n\n<!-- Header Template -->\n<ng-template #headerTemplate>\n <div class=\"dbx-quiz-header\">\n <div class=\"dbx-flex-group\">\n <dbx-button [disabled]=\"!canGoToPreviousQuestionSignal()\" icon=\"arrow_back\" (buttonClick)=\"clickPreviousQuestion()\"></dbx-button>\n <span class=\"spacer\"></span>\n <span class=\"mat-h2\">{{ quizTitleSignal() }}</span>\n <span class=\"spacer\"></span>\n <dbx-button [disabled]=\"!canGoToNextQuestionSignal()\" icon=\"arrow_forward\" (buttonClick)=\"clickNextQuestion()\"></dbx-button>\n </div>\n </div>\n</ng-template>\n","import { Component, computed, inject, model } from '@angular/core';\nimport { DbxButtonModule, DbxWindowKeyDownListenerDirective } from '@dereekb/dbx-web';\nimport { QuizQuestionAccessor } from '../store/quiz.accessor';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { type Maybe, range, type RangeInput } from '@dereekb/util';\n\n/**\n * Named preset for common number ranges.\n */\nexport type QuizAnswerNumberComponentPreset = 'oneToFive';\n\n/**\n * Configuration for the number answer component. Provide a preset, explicit range, or arbitrary numbers.\n */\nexport interface QuizAnswerNumberComponentConfig {\n /**\n * Uses a preset to compute the range/numbers.\n */\n readonly preset?: QuizAnswerNumberComponentPreset;\n /**\n * Range configuration\n */\n readonly range?: RangeInput;\n /**\n * Arbitrary array of numbers\n */\n readonly numbers?: number[];\n}\n\ninterface QuizAnswerNumberChoice {\n readonly number: number;\n readonly selected?: boolean;\n}\n\n/**\n * Answer component that displays configurable number buttons.\n *\n * @usage\n * Used as an answer component in a QuizQuestion's answerComponentConfig.\n * Defaults to 1-5 range if no config is provided.\n *\n * ```typescript\n * answerComponentConfig: {\n * componentClass: QuizAnswerNumberComponent,\n * init: (instance: QuizAnswerNumberComponent) => {\n * instance.config.set({ range: { start: 1, end: 11 } });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.answer.number.component.html',\n imports: [DbxButtonModule, DbxWindowKeyDownListenerDirective],\n standalone: true\n})\nexport class QuizAnswerNumberComponent {\n readonly questionAccessor = inject<QuizQuestionAccessor<number>>(QuizQuestionAccessor);\n\n readonly config = model<Maybe<QuizAnswerNumberComponentConfig>>();\n\n readonly currentAnswerSignal = toSignal(this.questionAccessor.answer$);\n readonly currentAnswerValueSignal = computed(() => this.currentAnswerSignal()?.data);\n\n readonly choicesSignal = computed(() => {\n const { range: inputRange, numbers: inputNumbers, preset } = this.config() ?? { preset: 'oneToFive' };\n const currentAnswer = this.currentAnswerValueSignal();\n\n let useRange: Maybe<RangeInput>;\n let useNumbers: Maybe<number[]>;\n\n if (preset) {\n switch (preset) {\n case 'oneToFive':\n default:\n useRange = { start: 1, end: 6 };\n break;\n }\n } else if (inputRange) {\n useRange = inputRange;\n } else if (inputNumbers) {\n useNumbers = inputNumbers;\n }\n\n let numbers: number[];\n\n if (useRange) {\n numbers = range(useRange);\n } else if (useNumbers) {\n numbers = useNumbers ?? [];\n } else {\n numbers = [];\n }\n\n const choices: QuizAnswerNumberChoice[] = numbers.map((number) => {\n return {\n number,\n selected: currentAnswer === number\n };\n });\n\n return choices;\n });\n\n readonly relevantKeysSignal = computed<string[]>(() => {\n const choices = this.choicesSignal();\n return choices.map((choice) => choice.number.toString());\n });\n\n clickedAnswer(answer: number) {\n this.questionAccessor.setAnswer(answer);\n }\n\n handleKeyDown(event: KeyboardEvent) {\n const number = Number(event.key);\n if (!Number.isNaN(number)) {\n this.clickedAnswer(number);\n }\n }\n}\n","<div class=\"dbx-quiz-answer-number\" (dbxWindowKeyDownListener)=\"handleKeyDown($event)\" [dbxWindowKeyDownFilter]=\"relevantKeysSignal()\">\n <div class=\"dbx-quiz-answer-number-buttons dbx-button-wrap-group\" role=\"radiogroup\" aria-label=\"Answer choices\">\n @for (choice of choicesSignal(); track choice.number) {\n <dbx-button role=\"radio\" [attr.aria-checked]=\"choice.selected\" [attr.aria-label]=\"'' + choice.number\" [color]=\"choice.selected ? 'accent' : 'primary'\" [raised]=\"true\" (buttonClick)=\"clickedAnswer(choice.number)\">{{ choice.number }}</dbx-button>\n }\n </div>\n</div>\n","import { Component, computed, inject, model } from '@angular/core';\nimport { DbxButtonModule, DbxWindowKeyDownListenerDirective } from '@dereekb/dbx-web';\nimport { type Maybe, range } from '@dereekb/util';\nimport { QuizQuestionAccessor } from '../store/quiz.accessor';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nconst MULTIPLE_CHOICE_LETTERS = `abcdefghijklmnopqrstuvwxyz`;\n\n/**\n * Upper-case letter label for a multiple choice option (e.g. \"A\", \"B\").\n */\nexport type MultipleChoiceLetter = string;\n\n/**\n * Display text for a single multiple choice option.\n */\nexport type MultipleChoiceText = string;\n\n/**\n * Answer data stored when a multiple choice option is selected.\n */\nexport interface MultipleChoiceAnswer {\n readonly isCorrectAnswer: boolean;\n readonly letter: MultipleChoiceLetter;\n readonly text: MultipleChoiceText;\n}\n\n/**\n * Configuration for the multiple choice answer component.\n */\nexport interface QuizAnswerMultipleChoiceComponentConfig {\n /**\n * Ordered list of answer option texts. Letters are auto-assigned A, B, C, etc.\n */\n readonly answerText: readonly MultipleChoiceText[];\n /**\n * Zero-based index of the correct answer, used to set `isCorrectAnswer` on the stored answer.\n */\n readonly correctAnswerIndex?: number;\n}\n\ninterface QuizAnswerMultipleChoice extends MultipleChoiceAnswer {\n readonly selected?: boolean;\n}\n\n/**\n * Answer component that displays multiple choice letter-labeled buttons.\n *\n * @usage\n * Used as an answer component in a QuizQuestion's answerComponentConfig.\n * Supports keyboard shortcuts (pressing the letter key selects that answer).\n *\n * ```typescript\n * answerComponentConfig: {\n * componentClass: QuizAnswerMultipleChoiceComponent,\n * init: (instance: QuizAnswerMultipleChoiceComponent) => {\n * instance.config.set({\n * answerText: ['Option A', 'Option B', 'Option C'],\n * correctAnswerIndex: 1\n * });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.answer.multiplechoice.component.html',\n imports: [DbxButtonModule, DbxWindowKeyDownListenerDirective],\n standalone: true\n})\nexport class QuizAnswerMultipleChoiceComponent {\n readonly questionAccessor = inject<QuizQuestionAccessor<QuizAnswerMultipleChoice>>(QuizQuestionAccessor);\n\n readonly config = model<Maybe<QuizAnswerMultipleChoiceComponentConfig>>();\n\n readonly currentAnswerSignal = toSignal(this.questionAccessor.answer$);\n readonly currentAnswerValueSignal = computed(() => this.currentAnswerSignal()?.data);\n\n readonly choicesSignal = computed(() => {\n const config = this.config();\n\n const currentAnswer = this.currentAnswerValueSignal();\n const answers = config?.answerText ?? [];\n const correctAnswerIndex = config?.correctAnswerIndex;\n\n const choices: QuizAnswerMultipleChoice[] = answers.map((text, i) => {\n const letter = MULTIPLE_CHOICE_LETTERS[i];\n\n return {\n letter: MULTIPLE_CHOICE_LETTERS[i].toUpperCase(),\n text,\n selected: currentAnswer?.letter === letter,\n isCorrectAnswer: correctAnswerIndex === i\n };\n });\n\n return choices;\n });\n\n readonly relevantKeysSignal = computed<string[]>(() => {\n const answersCount = this.config()?.answerText.length ?? 0;\n const relevantKeys = [];\n\n const numbersRange = answersCount > 0 ? range(1, answersCount + 1) : [];\n\n for (const number of numbersRange) {\n const answerLetter = MULTIPLE_CHOICE_LETTERS[number - 1];\n relevantKeys.push(answerLetter);\n }\n\n return relevantKeys;\n });\n\n clickedAnswer(answer: QuizAnswerMultipleChoice) {\n this.questionAccessor.setAnswer(answer);\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (event.key.length === 1) {\n const choices = this.choicesSignal();\n const selectedLetter = event.key.toUpperCase();\n const choice = choices.find((x) => x.letter === selectedLetter);\n\n if (choice) {\n this.clickedAnswer(choice);\n }\n }\n }\n}\n","<div class=\"dbx-quiz-answer-multiplechoice\" (dbxWindowKeyDownListener)=\"handleKeyDown($event)\" [dbxWindowKeyDownFilter]=\"relevantKeysSignal()\">\n <div class=\"dbx-quiz-answer-multiplechoice-buttons dbx-button-column dbx-button-wide\" role=\"radiogroup\" aria-label=\"Answer choices\">\n @for (choice of choicesSignal(); track choice.letter) {\n <dbx-button class=\"dbx-w100\" role=\"radio\" [attr.aria-checked]=\"choice.selected\" [attr.aria-label]=\"choice.letter + ') ' + choice.text\" [color]=\"choice.selected ? 'accent' : 'primary'\" [raised]=\"true\" (buttonClick)=\"clickedAnswer(choice)\">\n <div class=\"dbx-quiz-answer-multiplechoice-button-content\">\n <span class=\"dbx-quiz-answer-multiplechoice-button-letter\">{{ choice.letter }})</span>\n <span class=\"dbx-quiz-answer-multiplechoice-button-text\">{{ choice.text }}</span>\n </div>\n </dbx-button>\n }\n </div>\n</div>\n","import { Component, computed, inject, model } from '@angular/core';\nimport { QuizStore } from '../store/quiz.store';\nimport { DbxButtonModule } from '@dereekb/dbx-web';\nimport { type Maybe, type MaybeMap } from '@dereekb/util';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { type QuizTitleDetails } from '../store/quiz';\n\n/**\n * Config for the pre-quiz intro component.\n *\n * Overrides the title details.\n */\nexport type QuizPreQuizIntroConfig = Partial<MaybeMap<QuizTitleDetails>>;\n\n/**\n * Pre-quiz intro component that displays the quiz title, subtitle, description, and a start button.\n *\n * @usage\n * Used as a preQuizComponentConfig in a Quiz definition.\n * Inherits title details from the quiz unless overridden via config.\n *\n * ```typescript\n * preQuizComponentConfig: {\n * componentClass: QuizPreQuizIntroComponent,\n * init: (instance: QuizPreQuizIntroComponent) => {\n * instance.config.set({ subtitle: 'Custom subtitle' });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.prequiz.intro.component.html',\n imports: [DbxButtonModule],\n standalone: true\n})\nexport class QuizPreQuizIntroComponent {\n readonly quizStore = inject(QuizStore);\n\n readonly config = model<Maybe<QuizPreQuizIntroConfig>>();\n readonly quizTitleDetailsSignal = toSignal(this.quizStore.titleDetails$);\n\n readonly configSignal = computed(() => {\n const config = this.config();\n const titleDetails = this.quizTitleDetailsSignal();\n\n return {\n title: config?.title ?? titleDetails?.title,\n subtitle: config?.subtitle ?? titleDetails?.subtitle,\n description: config?.description ?? titleDetails?.description\n };\n });\n\n readonly titleSignal = computed(() => this.configSignal()?.title);\n readonly subtitleSignal = computed(() => this.configSignal()?.subtitle);\n readonly descriptionSignal = computed(() => this.configSignal()?.description);\n}\n","<div>\n <div>\n <h1>{{ titleSignal() }}</h1>\n <h2>{{ subtitleSignal() }}</h2>\n <p>{{ descriptionSignal() }}</p>\n </div>\n <div>\n <dbx-button [raised]=\"true\" (buttonClick)=\"quizStore.startQuiz()\" text=\"Start Quiz\"></dbx-button>\n </div>\n</div>\n","import { Component, computed, model } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Configuration for the text-based question display. Used with `quizAgreementPrompt()` and\n * `quizFrequencyPrompt()` helpers for Likert-scale questions.\n */\nexport interface QuizQuestionTextComponentConfig {\n /**\n * Instructional prompt displayed above the main text (e.g. \"Rate how much you agree:\").\n */\n readonly prompt?: string;\n /**\n * The primary question or statement text.\n */\n readonly text: string;\n /**\n * Scale guidance displayed below the text (e.g. \"1 = Strongly Disagree, 5 = Strongly Agree\").\n */\n readonly guidance?: string;\n}\n\n/**\n * Question component that displays text with optional prompt and guidance.\n *\n * @usage\n * Used as a questionComponentConfig in a QuizQuestion definition.\n *\n * ```typescript\n * questionComponentConfig: {\n * componentClass: QuizQuestionTextComponent,\n * init: (instance: QuizQuestionTextComponent) => {\n * instance.config.set({ text: 'How do you handle ambiguity?', prompt: 'Rate yourself:', guidance: '1=Never, 5=Always' });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.question.text.component.html',\n standalone: true\n})\nexport class QuizQuestionTextComponent {\n readonly config = model<Maybe<QuizQuestionTextComponentConfig>>();\n\n readonly promptSignal = computed(() => this.config()?.prompt);\n readonly textSignal = computed(() => this.config()?.text);\n readonly guidanceSignal = computed(() => this.config()?.guidance);\n}\n","<div class=\"dbx-quiz-question-text\" role=\"group\" aria-label=\"Question\">\n <div class=\"dbx-quiz-question-text-content\">\n @if (promptSignal() !== null) {\n <div class=\"dbx-hint dbx-pb3\" aria-label=\"Prompt\">{{ promptSignal() }}</div>\n }\n <div class=\"dbx-pb3\">{{ textSignal() }}</div>\n @if (guidanceSignal() !== null) {\n <div class=\"dbx-small dbx-hint\" role=\"note\">{{ guidanceSignal() }}</div>\n }\n </div>\n</div>\n","import { Component, computed, inject, input } from '@angular/core';\nimport { DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';\nimport { QuizStore } from '../store/quiz.store';\nimport { type Work } from '@dereekb/rxjs';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { type DbxActionSuccessHandlerFunction } from '@dereekb/dbx-core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * Submission lifecycle state within the post-quiz view.\n */\nexport type DbxQuizPostQuizState = 'presubmit' | 'postsubmit';\n\n/**\n * Post-quiz component that handles quiz submission and displays pre/post submit content.\n *\n * @usage\n * Use as a wrapper in your results component template:\n *\n * ```html\n * <dbx-quiz-post-quiz [handleSubmitQuiz]=\"handleSubmitQuiz\">\n * <div presubmit>Pre-submit content...</div>\n * <div postsubmit>Post-submit content (scores, etc.)...</div>\n * </dbx-quiz-post-quiz>\n * ```\n */\n@Component({\n selector: 'dbx-quiz-post-quiz',\n templateUrl: './quiz.postquiz.component.html',\n imports: [DbxButtonModule, DbxActionModule, NgTemplateOutlet],\n standalone: true\n})\nexport class DbxQuizPostQuizComponent {\n readonly quizStore = inject(QuizStore);\n\n readonly quizSubmittedSignal = toSignal(this.quizStore.submittedQuiz$);\n\n readonly stateSignal = computed(() => {\n const submitted = this.quizSubmittedSignal();\n\n return submitted ? 'postsubmit' : 'presubmit';\n });\n\n readonly handleSubmitQuiz = input<Work<void>>();\n\n readonly handleSubmitQuizButton: Work<void> = (_, context) => {\n this.quizStore.setLockQuizNavigation(true);\n const handler = this.handleSubmitQuiz();\n\n if (handler) {\n return handler(_, context);\n }\n\n context.reject();\n };\n\n readonly handleSubmitQuizSuccess: DbxActionSuccessHandlerFunction = () => {\n this.quizStore.setSubmittedQuiz(true);\n };\n}\n","<div class=\"dbx-post-quiz text-center\" role=\"status\" aria-live=\"polite\">\n <h3>Quiz Completed</h3>\n <div>\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n @if (stateSignal() === 'presubmit') {\n <ng-container *ngTemplateOutlet=\"preSubmitTemplate\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"postSubmitTemplate\"></ng-container>\n }\n </div>\n</div>\n\n<!-- Pre-Submit -->\n<ng-template #preSubmitTemplate>\n <ng-content select=\"[presubmit]\"></ng-content>\n @if (handleSubmitQuiz()) {\n <div class=\"dbx-post-quiz-submit\">\n <div dbxAction dbxActionLogger dbxActionValue dbxActionSnackbarError [dbxActionHandler]=\"handleSubmitQuizButton\" [dbxActionSuccessHandler]=\"handleSubmitQuizSuccess\">\n <dbx-button [disabled]=\"quizSubmittedSignal()\" [raised]=\"true\" dbxActionButton>Submit Quiz</dbx-button>\n </div>\n </div>\n }\n</ng-template>\n\n<!-- Post-Submit -->\n<ng-template #postSubmitTemplate>\n <ng-content select=\"[postsubmit]\"></ng-content>\n</ng-template>\n\n<!-- Content -->\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n","import { Component, inject, input } from '@angular/core';\nimport { DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';\nimport { QuizStore } from '../store/quiz.store';\nimport { type Work } from '@dereekb/rxjs';\n\n/**\n * Button component that restarts the quiz to the first question.\n *\n * @usage\n * ```html\n * <dbx-quiz-reset-button buttonText=\"Try Again\"></dbx-quiz-reset-button>\n * ```\n */\n@Component({\n selector: 'dbx-quiz-reset-button',\n template: `\n <div class=\"dbx-quiz-reset-button\">\n <div dbxAction dbxActionLogger dbxActionValue dbxActionSnackbarError [dbxActionHandler]=\"handleResetQuizButton\">\n <dbx-button [raised]=\"true\" [text]=\"buttonText()\" dbxActionButton></dbx-button>\n </div>\n </div>\n `,\n imports: [DbxButtonModule, DbxActionModule],\n standalone: true\n})\nexport class DbxQuizResetButtonComponent {\n readonly quizStore = inject(QuizStore);\n\n readonly buttonText = input<string>(`Restart Quiz`);\n\n readonly handleResetQuizButton: Work<void> = (_, context) => {\n this.quizStore.restartQuizToFirstQuestion();\n context.success();\n };\n}\n","import { Component, computed, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxQuizResetButtonComponent } from './quiz.reset.button.component';\n\n/**\n * Input data for rendering the quiz score display.\n */\nexport interface DbxQuizScoreInput {\n /**\n * Whether to show the retake/reset button.\n */\n readonly showRetakeButton?: boolean;\n /**\n * Feedback text to display.\n */\n readonly feedbackText: string;\n /**\n * Optional subtitle text.\n */\n readonly subtitle?: Maybe<string>;\n /**\n * The score achieved.\n */\n readonly score: number;\n /**\n * The maximum possible score.\n */\n readonly maxScore: number;\n}\n\n/**\n * Generic quiz score display component.\n *\n * @usage\n * ```html\n * <dbx-quiz-score [input]=\"scoreInput\"></dbx-quiz-score>\n * ```\n */\n@Component({\n selector: 'dbx-quiz-score',\n template: `\n <div class=\"dbx-quiz-score\">\n <h3 class=\"dbx-quiz-score-score\">{{ scoreSignal() }}/{{ maxScoreSignal() }}</h3>\n <p class=\"dbx-quiz-score-text\">{{ feedbackTextSignal() }}</p>\n @if (subtitleSignal()) {\n <p class=\"dbx-quiz-score-subtitle\">{{ subtitleSignal() }}</p>\n }\n @if (showRetakeButtonSignal()) {\n <dbx-quiz-reset-button buttonText=\"Retake Quiz\"></dbx-quiz-reset-button>\n }\n </div>\n `,\n imports: [DbxQuizResetButtonComponent],\n standalone: true\n})\nexport class DbxQuizScoreComponent {\n readonly input = input<Maybe<DbxQuizScoreInput>>();\n\n readonly scoreSignal = computed(() => this.input()?.score);\n readonly maxScoreSignal = computed(() => this.input()?.maxScore);\n readonly feedbackTextSignal = computed(() => this.input()?.feedbackText ?? '');\n readonly subtitleSignal = computed(() => this.input()?.subtitle);\n readonly showRetakeButtonSignal = computed(() => this.input()?.showRetakeButton);\n}\n","import { type QuizQuestionTextComponentConfig } from './component/quiz.question.text.component';\n\n/**\n * Creates a Likert scale question config with agreement prompt (Strongly Disagree to Strongly Agree).\n *\n * @param text - The statement to rate agreement on.\n * @param text - The statement to rate agreement on.\n * @returns A quiz question config with an agreement-based prompt and guidance text.\n *\n * @example\n * ```ts\n * instance.config.set(quizAgreementPrompt('I feel confident leading under pressure.'));\n * // { prompt: 'Please rate how much you agree...', text: '...', guidance: '1 = Strongly Disagree, 5 = Strongly Agree' }\n * ```\n */\nexport function quizAgreementPrompt(text: string): QuizQuestionTextComponentConfig {\n return {\n prompt: 'Please rate how much you agree with the following statement:',\n text,\n guidance: '1 = Strongly Disagree, 5 = Strongly Agree'\n };\n}\n\n/**\n * Creates a Likert scale question config with frequency prompt (Never to Always).\n *\n * @param text - The statement to rate frequency on.\n * @param text - The statement to rate frequency on.\n * @returns A quiz question config with a frequency-based prompt and guidance text.\n *\n * @example\n * ```ts\n * instance.config.set(quizFrequencyPrompt('I break vague direction into first steps.'));\n * // { prompt: 'Please rate how much you agree...', text: '...', guidance: '1 = Never, 5 = Always' }\n * ```\n */\nexport function quizFrequencyPrompt(text: string): QuizQuestionTextComponentConfig {\n return {\n prompt: 'Please rate how much you agree with the following statement:',\n text,\n guidance: '1 = Never, 5 = Always'\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;AA+EA;;;;;;;;;;;;;AAaG;AAEG,MAAO,SAAU,SAAQ,cAA8B,CAAA;AAC3D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CAAC;AACJ,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,WAAW,EAAE,KAAK;AAClB,YAAA,aAAa,EAAE,KAAK;YACpB,OAAO,EAAE,IAAI,GAAG,EAAE;AAClB,YAAA,aAAa,EAAE,SAAS;AACxB,YAAA,mBAAmB,EAAE,EAAE;AACvB,YAAA,kBAAkB,EAAE,EAAE;AACtB,YAAA,WAAW,EAAE,SAAS;AACtB,YAAA,yBAAyB,EAAE,IAAI;AAC/B,YAAA,6BAA6B,EAAE,IAAI;AACnC,YAAA,iBAAiB,EAAE;AACpB,SAAA,CAAC;IACJ;AAES,IAAA,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC;AAC1C,IAAA,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,YAAY,CAAC,CAAC;IAClE,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC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AAA,CAAA,EAAA,CAAA;;4FAG1B,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAjBjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;oBACD,OAAO,EAAE,CAAC,2BAA2B,CAAC;AACtC,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACpDD;;;;;;;;;;;;AAYG;AACG,SAAU,mBAAmB,CAAC,IAAY,EAAA;IAC9C,OAAO;AACL,QAAA,MAAM,EAAE,8DAA8D;QACtE,IAAI;AACJ,QAAA,QAAQ,EAAE;KACX;AACH;AAEA;;;;;;;;;;;;AAYG;AACG,SAAU,mBAAmB,CAAC,IAAY,EAAA;IAC9C,OAAO;AACL,QAAA,MAAM,EAAE,8DAA8D;QACtE,IAAI;AACJ,QAAA,QAAQ,EAAE;KACX;AACH;;AC1CA;;AAEG;;;;"}
1
+ {"version":3,"file":"dereekb-dbx-form-quiz.mjs","sources":["../../../../packages/dbx-form/quiz/src/lib/store/quiz.store.ts","../../../../packages/dbx-form/quiz/src/lib/store/quiz.accessor.ts","../../../../packages/dbx-form/quiz/src/lib/container/quiz.component.ts","../../../../packages/dbx-form/quiz/src/lib/container/quiz.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.number.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.number.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.multiplechoice.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.answer.multiplechoice.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.prequiz.intro.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.prequiz.intro.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.question.text.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.question.text.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.postquiz.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.postquiz.component.html","../../../../packages/dbx-form/quiz/src/lib/component/quiz.reset.button.component.ts","../../../../packages/dbx-form/quiz/src/lib/component/quiz.score.component.ts","../../../../packages/dbx-form/quiz/src/lib/quiz.util.ts","../../../../packages/dbx-form/quiz/src/dereekb-dbx-form-quiz.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { type QuestionIndex, type Quiz, type QuizAnswer, type QuizQuestion, type QuizQuestionId, type QuizQuestionIdIndexPair, type QuizQuestionWithIndex } from './quiz';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { type ArrayOrValue, asArray, type Configurable, type Maybe } from '@dereekb/util';\nimport { combineLatest, distinctUntilChanged, map, type Observable, of, shareReplay, switchMap } from 'rxjs';\nimport { asObservable, type ObservableOrValue } from '@dereekb/rxjs';\n\n/**\n * Internal state shape managed by QuizStore.\n */\nexport interface QuizStoreState {\n /**\n * Map of questions, keyed by id.\n *\n * Unset if the quiz is not yet set.\n */\n readonly questionMap?: Maybe<ReadonlyMap<QuizQuestionId, QuizQuestion>>;\n /**\n * Started quiz\n */\n readonly startedQuiz: boolean;\n /**\n * Questions that have been answered, sorted by index.\n */\n readonly completedQuestions: QuizQuestionIdIndexPair[];\n /**\n * Questions that are remaining to be answered, sorted by index.\n */\n readonly unansweredQuestions: QuizQuestionIdIndexPair[];\n /**\n * Map of current answers.\n */\n readonly answers: ReadonlyMap<QuizQuestionId, QuizAnswer>;\n /**\n * The current index that corresponds with the selected question.\n *\n * If null, defaults to the first question.\n *\n * If greater than the total number of questions, then the quiz is considered complete.\n */\n readonly questionIndex?: Maybe<QuestionIndex>;\n /**\n * If true, the quiz is locked from navigation.\n *\n * Typically used while submitting the quiz.\n */\n readonly lockQuizNavigation?: boolean;\n /**\n * If true, the quiz has been marked as submitted.\n */\n readonly submittedQuiz?: boolean;\n /**\n * The current/active quiz.\n */\n readonly quiz?: Maybe<Quiz>;\n /**\n * If true, allows going back to visit previous questions.\n */\n readonly allowVisitingPreviousQuestion: boolean;\n /**\n * If true, automatically advances to the next question when an answer is set.\n */\n readonly autoAdvanceToNextQuestion: boolean;\n /**\n * Whether or not skipping questions is allowed.\n *\n * Defaults to false.\n */\n readonly allowSkipQuestion: boolean;\n}\n\n/**\n * Lookup input for retrieving an answer by question id, index, or the current question.\n * Provide exactly one of `id`, `index`, or `currentIndex`.\n */\nexport interface QuizStoreAnswerLookupInput extends Partial<QuizQuestionIdIndexPair> {\n readonly currentIndex?: boolean;\n}\n\n/**\n * NgRx ComponentStore that manages quiz lifecycle: question navigation, answer tracking,\n * submission state, and navigation locking.\n *\n * Provided at the component level by `QuizComponent`.\n *\n * @example\n * ```ts\n * // Access from a child component via DI:\n * readonly quizStore = inject(QuizStore);\n * this.quizStore.startQuiz();\n * this.quizStore.updateAnswerForCurrentQuestion(5);\n * ```\n */\n@Injectable()\nexport class QuizStore extends ComponentStore<QuizStoreState> {\n constructor() {\n super({\n quiz: undefined,\n startedQuiz: false,\n submittedQuiz: false,\n answers: new Map(),\n questionIndex: undefined,\n unansweredQuestions: [],\n completedQuestions: [],\n questionMap: undefined,\n autoAdvanceToNextQuestion: true,\n allowVisitingPreviousQuestion: true,\n allowSkipQuestion: false\n });\n }\n\n readonly quiz$ = this.select((state) => state.quiz);\n readonly titleDetails$ = this.quiz$.pipe(map((quiz) => quiz?.titleDetails));\n readonly questions$ = this.quiz$.pipe(map((quiz) => quiz?.questions ?? []));\n readonly startedQuiz$ = this.select((state) => state.startedQuiz);\n readonly lockQuizNavigation$ = this.select((state) => state.lockQuizNavigation);\n readonly submittedQuiz$ = this.select((state) => state.submittedQuiz);\n readonly answers$ = this.select((state) => state.answers);\n readonly questionIndex$ = this.select((state) => state.questionIndex ?? 0);\n readonly completedQuestions$ = this.select((state) => state.completedQuestions);\n readonly unansweredQuestions$ = this.select((state) => state.unansweredQuestions);\n readonly hasAnswerForEachQuestion$ = this.select((state) => state.unansweredQuestions.length === 0);\n readonly isAtEndOfQuestions$ = this.select((state) => (state.questionIndex ?? 0) >= (state.quiz?.questions.length ?? 0));\n\n readonly canGoToPreviousQuestion$ = this.select((state) => !state.lockQuizNavigation && state.allowVisitingPreviousQuestion && state.questionIndex != null && state.questionIndex > 0);\n readonly canGoToNextQuestion$ = this.select((state) => {\n const newQuestionIndex = computeAdvanceIndexOnState(state, 1);\n return !state.lockQuizNavigation && state.questionIndex != null && newQuestionIndex != null && newQuestionIndex > state.questionIndex;\n });\n\n readonly currentQuestion$: Observable<Maybe<QuizQuestionWithIndex>> = combineLatest([this.questions$, this.questionIndex$]).pipe(\n map(([questions, questionIndex]) => {\n const question = questions[questionIndex];\n let result: Maybe<QuizQuestionWithIndex>;\n\n if (question) {\n result = {\n ...question,\n index: questionIndex\n };\n }\n\n return result;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n /**\n * Returns a reactive observable of the answer for a given question, looked up by id, index, or the current question.\n *\n * @param lookupInput - Lookup criteria specifying which question's answer to retrieve.\n * @param lookupInput - Lookup criteria specifying which question's answer to retrieve.\n * @returns An observable that emits the current answer for the specified question, or undefined if not answered.\n *\n * @example\n * ```ts\n * // By current question:\n * store.answerForQuestion({ currentIndex: true }).subscribe(answer => console.log(answer));\n * // By question id:\n * store.answerForQuestion({ id: 'q1' }).subscribe(answer => console.log(answer));\n * ```\n */\n answerForQuestion(lookupInput: ObservableOrValue<QuizStoreAnswerLookupInput>): Observable<Maybe<QuizAnswer>> {\n return asObservable(lookupInput).pipe(\n switchMap((lookup) => {\n const { id, index, currentIndex } = lookup;\n let result: Observable<Maybe<QuizAnswer>>;\n\n if (currentIndex) {\n result = this.currentQuestion$.pipe(switchMap((question) => this.answerForQuestion({ index: question?.index })));\n } else if (id != null) {\n result = this.answers$.pipe(map((answers) => answers.get(id)));\n } else if (index == null) {\n result = of(undefined);\n } else {\n result = this.questions$.pipe(\n switchMap((questions) => {\n const question = questions[index];\n let result: Observable<Maybe<QuizAnswer>>;\n\n if (question) {\n result = this.answerForQuestion({ id: question.id });\n } else {\n result = of(undefined);\n }\n\n return result;\n })\n );\n }\n\n return result;\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n readonly startQuiz = this.updater((state) => startQuizOnState(state));\n readonly setQuiz = this.updater((state, quiz: Maybe<Quiz>) => setQuizOnState(state, quiz));\n\n /**\n * Resets the quiz entirely, back to the pre-quiz state.\n */\n readonly resetQuiz = this.updater((state) => resetQuizOnState(state));\n\n /**\n * Restarts the quiz to the first question.\n */\n readonly restartQuizToFirstQuestion = this.updater((state) => restartQuizToFirstQuestionOnState(state));\n\n readonly setAnswers = this.updater((state, answers: Maybe<QuizAnswer[]>) => setAnswersOnState(state, answers));\n readonly updateAnswers = this.updater((state, answers: Maybe<QuizAnswer[]>) => updateAnswersOnState(state, answers));\n readonly updateAnswerForCurrentQuestion = this.updater((state, answerData: unknown) => updateAnswerForCurrentQuestionOnState(state, answerData));\n readonly setQuestionIndex = this.updater((state, questionIndex: QuestionIndex) => ({ ...state, questionIndex }));\n readonly setAutoAdvanceToNextQuestion = this.updater((state, autoAdvanceToNextQuestion: boolean) => ({ ...state, autoAdvanceToNextQuestion }));\n readonly setAllowSkipQuestion = this.updater((state, allowSkipQuestion: boolean) => ({ ...state, allowSkipQuestion }));\n readonly setAllowVisitingPreviousQuestion = this.updater((state, allowVisitingPreviousQuestion: boolean) => ({ ...state, allowVisitingPreviousQuestion }));\n\n readonly goToNextQuestion = this.updater((state) => advanceQuestionOnState(state, 1));\n readonly goToPreviousQuestion = this.updater((state) => advanceQuestionOnState(state, -1));\n\n readonly setLockQuizNavigation = this.updater((state, lockQuizNavigation: boolean) => ({ ...state, lockQuizNavigation }));\n readonly setSubmittedQuiz = this.updater((state, submittedQuiz: boolean) => ({ ...state, submittedQuiz }));\n}\n\nfunction computeAdvanceIndexOnState(state: QuizStoreState, advancement: number): Maybe<QuestionIndex> {\n const { questionIndex, allowSkipQuestion, unansweredQuestions, lockQuizNavigation } = state;\n const maxQuestionIndex = state.quiz?.questions.length;\n\n let newQuestionIndex: Maybe<QuestionIndex>;\n\n if (maxQuestionIndex != null && questionIndex != null && !lockQuizNavigation) {\n let maxAllowedIndex = maxQuestionIndex;\n\n if (!allowSkipQuestion) {\n maxAllowedIndex = unansweredQuestions[0]?.index ?? maxQuestionIndex;\n }\n\n newQuestionIndex = Math.max(0, Math.min(maxAllowedIndex, questionIndex + advancement));\n }\n\n return newQuestionIndex;\n}\n\nfunction advanceQuestionOnState(state: QuizStoreState, advancement: number): QuizStoreState {\n const newQuestionIndex = computeAdvanceIndexOnState(state, advancement);\n\n let nextState: QuizStoreState = state;\n\n if (newQuestionIndex != null) {\n nextState = {\n ...state,\n questionIndex: newQuestionIndex\n };\n }\n\n return nextState;\n}\n\nfunction startQuizOnState(state: QuizStoreState): QuizStoreState {\n const { startedQuiz } = state;\n let nextState: QuizStoreState = state;\n\n if (!startedQuiz) {\n nextState = {\n ...state,\n startedQuiz: true,\n submittedQuiz: false,\n lockQuizNavigation: false,\n questionIndex: 0\n };\n }\n\n return nextState;\n}\n\nfunction resetQuizOnState(state: QuizStoreState): QuizStoreState {\n return {\n ...restartQuizToFirstQuestionOnState(state),\n startedQuiz: false\n };\n}\n\nfunction restartQuizToFirstQuestionOnState(state: QuizStoreState): QuizStoreState {\n return setAnswersOnState(\n startQuizOnState({\n ...state,\n startedQuiz: false\n }),\n []\n );\n}\n\nfunction setQuizOnState(state: QuizStoreState, quiz?: Maybe<Quiz>): QuizStoreState {\n let questionMap: Maybe<ReadonlyMap<QuizQuestionId, QuizQuestion>> = undefined;\n const currentAnswers = [...state.answers.values()];\n\n if (quiz?.questions) {\n questionMap = new Map(quiz.questions.map((question) => [question.id, question]));\n }\n\n return setAnswersOnState({ ...state, quiz, questionMap }, currentAnswers);\n}\n\nfunction setAnswersOnState(state: QuizStoreState, newAnswers: Maybe<ArrayOrValue<QuizAnswer>>): QuizStoreState {\n return updateAnswersOnState(\n {\n ...state,\n answers: new Map()\n },\n newAnswers\n );\n}\n\nfunction updateAnswerForCurrentQuestionOnState(state: QuizStoreState, answerData: unknown): QuizStoreState {\n const { questionIndex } = state;\n let nextState: Configurable<QuizStoreState> = state;\n\n if (questionIndex != null) {\n const currentQuestion = state.quiz?.questions[questionIndex];\n\n if (currentQuestion) {\n const answer: QuizAnswer = {\n id: currentQuestion.id,\n data: answerData\n };\n\n nextState = updateAnswersOnState(state, [answer]);\n\n if (state.autoAdvanceToNextQuestion) {\n nextState.questionIndex = questionIndex + 1;\n }\n }\n }\n\n return nextState;\n}\n\nfunction updateAnswersOnState(state: QuizStoreState, inputAnswers: Maybe<ArrayOrValue<QuizAnswer>>): QuizStoreState {\n const { quiz, answers: currentAnswers } = state;\n\n const answers = new Map(currentAnswers);\n\n asArray(inputAnswers).forEach((answer) => {\n answers.set(answer.id, answer);\n });\n\n const completedQuestions: QuizQuestionIdIndexPair[] = [];\n const unansweredQuestions: QuizQuestionIdIndexPair[] = [];\n\n if (quiz?.questions) {\n quiz.questions.forEach((question, index) => {\n if (answers.has(question.id)) {\n completedQuestions.push({ id: question.id, index });\n } else {\n unansweredQuestions.push({ id: question.id, index });\n }\n });\n }\n\n return { ...state, unansweredQuestions, completedQuestions, answers };\n}\n","import { type Maybe } from '@dereekb/util';\nimport { type Observable, type Subscription } from 'rxjs';\nimport { type QuizQuestion, type QuizAnswer, type Quiz } from './quiz';\nimport { type Provider } from '@angular/core';\nimport { QuizStore } from './quiz.store';\n\n/**\n * Abstract accessor injected into answer/question child components to read the current question\n * and write answers back to the QuizStore without coupling to it directly.\n *\n * Use `provideCurrentQuestionQuizQuestionAccessor()` to bind this to the store's current question.\n */\nexport abstract class QuizQuestionAccessor<T = unknown> {\n /**\n * The active quiz definition.\n */\n abstract readonly quiz$: Observable<Maybe<Quiz>>;\n\n /**\n * The question this accessor is bound to.\n */\n abstract readonly question$: Observable<Maybe<QuizQuestion>>;\n\n /**\n * The current answer for this question, or undefined if unanswered.\n */\n abstract readonly answer$: Observable<Maybe<QuizAnswer<T>>>;\n\n /**\n * Submits an answer value for this question.\n */\n abstract setAnswer(answer: T): void;\n\n /**\n * Binds an observable source whose emissions are forwarded as answer updates.\n */\n abstract setAnswerSource(answer: Observable<T>): Subscription;\n}\n\n/**\n * Provides QuizQuestionAccessor bound to the current question in QuizStore.\n *\n * @returns An Angular provider that binds QuizQuestionAccessor to the current quiz question.\n *\n * @usage\n * ```typescript\n * @Component ({\n * providers: [QuizStore, provideCurrentQuestionQuizQuestionAccessor()]\n * })\n * ```\n */\nexport function provideCurrentQuestionQuizQuestionAccessor<T = unknown>(): Provider {\n return {\n provide: QuizQuestionAccessor,\n useFactory: (quizStore: QuizStore) => {\n return {\n quiz$: quizStore.quiz$,\n question$: quizStore.currentQuestion$,\n answer$: quizStore.answerForQuestion({ currentIndex: true }),\n setAnswer: (answer: T) => quizStore.updateAnswerForCurrentQuestion(answer),\n setAnswerSource: (answer: Observable<T>) => quizStore.updateAnswerForCurrentQuestion(answer)\n };\n },\n deps: [QuizStore]\n };\n}\n","import { Component, computed, effect, inject, input, type Signal } from '@angular/core';\nimport { QuizStore } from '../store/quiz.store';\nimport { type Maybe } from '@dereekb/util';\nimport { type Quiz } from '../store/quiz';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { combineLatest, first, map, type Observable, switchMap } from 'rxjs';\nimport { DbxInjectionComponent, type DbxInjectionComponentConfig } from '@dereekb/dbx-core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { provideCurrentQuestionQuizQuestionAccessor } from '../store/quiz.accessor';\nimport { DbxButtonModule, DbxWindowKeyDownListenerDirective } from '@dereekb/dbx-web';\n\n/**\n * Lifecycle state of the quiz container view.\n */\nexport type QuizComponentState = 'init' | 'pre-quiz' | 'quiz' | 'post-quiz';\n\n/**\n * Discriminated union of view configs, one per quiz lifecycle state.\n */\nexport type QuizComponentViewConfig = QuizComponentViewInitConfig | QuizComponentViewPreQuizConfig | QuizComponentViewQuizConfig | QuizComponentViewPostQuizConfig;\n\nexport interface QuizComponentViewInitConfig {\n readonly state: 'init';\n}\n\nexport interface QuizComponentViewPreQuizConfig {\n readonly state: 'pre-quiz';\n readonly preQuizComponent?: Maybe<DbxInjectionComponentConfig>;\n}\n\nexport interface QuizComponentViewQuizConfig {\n readonly state: 'quiz';\n readonly questionComponent?: Maybe<DbxInjectionComponentConfig>;\n readonly answerComponent?: Maybe<DbxInjectionComponentConfig>;\n}\n\nexport interface QuizComponentViewPostQuizConfig {\n readonly state: 'post-quiz';\n readonly resultsComponent?: Maybe<DbxInjectionComponentConfig>;\n}\n\n/**\n * Top-level quiz container that orchestrates pre-quiz, active quiz, and post-quiz views.\n *\n * Provides its own `QuizStore` and `QuizQuestionAccessor`, so child components injected via\n * `DbxInjectionComponent` can access quiz state directly through DI.\n *\n * Supports keyboard navigation: Enter (start / next), ArrowLeft (previous), ArrowRight (next).\n *\n * @example\n * ```html\n * <dbx-quiz [quiz]=\"myQuiz\"></dbx-quiz>\n * ```\n */\n@Component({\n selector: 'dbx-quiz',\n templateUrl: './quiz.component.html',\n imports: [DbxInjectionComponent, DbxButtonModule, DbxWindowKeyDownListenerDirective, NgTemplateOutlet],\n providers: [QuizStore, provideCurrentQuestionQuizQuestionAccessor()],\n standalone: true\n})\nexport class QuizComponent {\n readonly quizStore = inject(QuizStore);\n readonly quiz = input.required<Maybe<Quiz>>();\n\n readonly keysFilter = ['Enter', 'ArrowLeft', 'ArrowRight'];\n\n readonly quizEffect = effect(\n () => {\n const quiz = this.quiz();\n this.quizStore.setQuiz(quiz);\n },\n { allowSignalWrites: true }\n );\n\n readonly quiz$ = toObservable(this.quiz);\n readonly quizTitleSignal = computed(() => this.quiz()?.titleDetails.title);\n\n readonly currentQuestionSignal = toSignal(this.quizStore.currentQuestion$);\n\n readonly questionTitleSignal = computed(() => {\n const currentQuestion = this.currentQuestionSignal();\n return currentQuestion ? `Question ${currentQuestion.index + 1}` : '';\n });\n\n readonly startedQuiz$ = this.quizStore.startedQuiz$;\n readonly currentQuestion$ = this.quizStore.currentQuestion$;\n\n readonly canGoToPreviousQuestionSignal: Signal<boolean> = toSignal(this.quizStore.canGoToPreviousQuestion$, { initialValue: false });\n readonly canGoToNextQuestionSignal: Signal<boolean> = toSignal(this.quizStore.canGoToNextQuestion$, { initialValue: false });\n\n readonly viewConfig$: Observable<QuizComponentViewConfig> = this.startedQuiz$.pipe(\n switchMap((started) => {\n let result: Observable<QuizComponentViewConfig>;\n\n if (started) {\n result = combineLatest([this.quiz$, this.currentQuestion$, this.quizStore.isAtEndOfQuestions$]).pipe(\n map(([quiz, currentQuestion, isAtEndOfQuestions]) => {\n let viewConfig: QuizComponentViewConfig;\n\n if (isAtEndOfQuestions) {\n viewConfig = {\n state: 'post-quiz',\n resultsComponent: quiz?.resultsComponentConfig\n };\n } else {\n viewConfig = {\n state: 'quiz',\n questionComponent: currentQuestion?.questionComponentConfig,\n answerComponent: currentQuestion?.answerComponentConfig\n };\n }\n\n return viewConfig;\n })\n );\n } else {\n result = this.quiz$.pipe(\n map((quiz) => {\n const viewConfig: QuizComponentViewPreQuizConfig = {\n state: 'pre-quiz',\n preQuizComponent: quiz?.preQuizComponentConfig\n };\n\n return viewConfig;\n })\n );\n }\n\n return result;\n })\n );\n\n readonly viewConfigSignal: Signal<QuizComponentViewConfig> = toSignal(this.viewConfig$, { initialValue: { state: 'init' } });\n readonly viewStateSignal: Signal<QuizComponentState> = computed(() => this.viewConfigSignal()?.state ?? 'init');\n\n readonly preQuizComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewPreQuizConfig)?.preQuizComponent);\n readonly questionComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewQuizConfig)?.questionComponent);\n readonly answerComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewQuizConfig)?.answerComponent);\n readonly resultsComponentConfigSignal: Signal<Maybe<DbxInjectionComponentConfig>> = computed(() => (this.viewConfigSignal() as QuizComponentViewPostQuizConfig)?.resultsComponent);\n\n handleKeyDown(event: KeyboardEvent) {\n const code = event.code;\n\n switch (code) {\n case 'Enter':\n this.quizStore.startedQuiz$.pipe(first()).subscribe((started) => {\n if (started) {\n this.clickNextQuestion();\n } else {\n this.quizStore.startQuiz();\n }\n });\n break;\n case 'ArrowLeft':\n this.clickPreviousQuestion();\n break;\n case 'ArrowRight':\n this.clickNextQuestion();\n break;\n }\n }\n\n clickPreviousQuestion() {\n this.quizStore.goToPreviousQuestion();\n }\n\n clickNextQuestion() {\n this.quizStore.goToNextQuestion();\n }\n}\n","<div class=\"dbx-quiz\" (dbxWindowKeyDownListener)=\"handleKeyDown($event)\" [dbxWindowKeyDownFilter]=\"keysFilter\">\n @switch (viewStateSignal()) {\n @case ('pre-quiz') {\n <ng-container *ngTemplateOutlet=\"preQuizTemplate\"></ng-container>\n }\n @case ('quiz') {\n <ng-container *ngTemplateOutlet=\"quizTemplate\"></ng-container>\n }\n @case ('post-quiz') {\n <ng-container *ngTemplateOutlet=\"postQuizTemplate\"></ng-container>\n }\n }\n</div>\n\n<!-- Pre-Quiz -->\n<ng-template #preQuizTemplate>\n <div class=\"dbx-quiz-pre-quiz\">\n <dbx-injection [config]=\"preQuizComponentConfigSignal()\"></dbx-injection>\n </div>\n</ng-template>\n\n<!-- Quiz -->\n<ng-template #quizTemplate>\n <div class=\"dbx-quiz-quiz\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n <div class=\"dbx-quiz-question dbx-pb3\">\n <h4 class=\"dbx-quiz-question-title\">{{ questionTitleSignal() }}</h4>\n <dbx-injection [config]=\"questionComponentConfigSignal()\"></dbx-injection>\n </div>\n <div class=\"dbx-quiz-answer dbx-pt3\">\n <dbx-injection [config]=\"answerComponentConfigSignal()\"></dbx-injection>\n </div>\n </div>\n</ng-template>\n\n<!-- Post-Quiz -->\n<ng-template #postQuizTemplate>\n <div class=\"dbx-quiz-post-quiz\">\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n <dbx-injection [config]=\"resultsComponentConfigSignal()\"></dbx-injection>\n </div>\n</ng-template>\n\n<!-- Header Template -->\n<ng-template #headerTemplate>\n <div class=\"dbx-quiz-header\">\n <div class=\"dbx-flex-group\">\n <dbx-button [disabled]=\"!canGoToPreviousQuestionSignal()\" icon=\"arrow_back\" (buttonClick)=\"clickPreviousQuestion()\"></dbx-button>\n <span class=\"spacer\"></span>\n <span class=\"mat-h2\">{{ quizTitleSignal() }}</span>\n <span class=\"spacer\"></span>\n <dbx-button [disabled]=\"!canGoToNextQuestionSignal()\" icon=\"arrow_forward\" (buttonClick)=\"clickNextQuestion()\"></dbx-button>\n </div>\n </div>\n</ng-template>\n","import { Component, computed, inject, model } from '@angular/core';\nimport { DbxButtonModule, DbxWindowKeyDownListenerDirective } from '@dereekb/dbx-web';\nimport { QuizQuestionAccessor } from '../store/quiz.accessor';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { type Maybe, range, type RangeInput } from '@dereekb/util';\n\n/**\n * Named preset for common number ranges.\n */\nexport type QuizAnswerNumberComponentPreset = 'oneToFive';\n\n/**\n * Configuration for the number answer component. Provide a preset, explicit range, or arbitrary numbers.\n */\nexport interface QuizAnswerNumberComponentConfig {\n /**\n * Uses a preset to compute the range/numbers.\n */\n readonly preset?: QuizAnswerNumberComponentPreset;\n /**\n * Range configuration\n */\n readonly range?: RangeInput;\n /**\n * Arbitrary array of numbers\n */\n readonly numbers?: number[];\n}\n\ninterface QuizAnswerNumberChoice {\n readonly number: number;\n readonly selected?: boolean;\n}\n\n/**\n * Answer component that displays configurable number buttons.\n *\n * @usage\n * Used as an answer component in a QuizQuestion's answerComponentConfig.\n * Defaults to 1-5 range if no config is provided.\n *\n * ```typescript\n * answerComponentConfig: {\n * componentClass: QuizAnswerNumberComponent,\n * init: (instance: QuizAnswerNumberComponent) => {\n * instance.config.set({ range: { start: 1, end: 11 } });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.answer.number.component.html',\n imports: [DbxButtonModule, DbxWindowKeyDownListenerDirective],\n standalone: true\n})\nexport class QuizAnswerNumberComponent {\n readonly questionAccessor = inject<QuizQuestionAccessor<number>>(QuizQuestionAccessor);\n\n readonly config = model<Maybe<QuizAnswerNumberComponentConfig>>();\n\n readonly currentAnswerSignal = toSignal(this.questionAccessor.answer$);\n readonly currentAnswerValueSignal = computed(() => this.currentAnswerSignal()?.data);\n\n readonly choicesSignal = computed(() => {\n const { range: inputRange, numbers: inputNumbers, preset } = this.config() ?? { preset: 'oneToFive' };\n const currentAnswer = this.currentAnswerValueSignal();\n\n let useRange: Maybe<RangeInput>;\n let useNumbers: Maybe<number[]>;\n\n if (preset) {\n switch (preset) {\n case 'oneToFive':\n default:\n useRange = { start: 1, end: 6 };\n break;\n }\n } else if (inputRange) {\n useRange = inputRange;\n } else if (inputNumbers) {\n useNumbers = inputNumbers;\n }\n\n let numbers: number[];\n\n if (useRange) {\n numbers = range(useRange);\n } else if (useNumbers) {\n numbers = useNumbers ?? [];\n } else {\n numbers = [];\n }\n\n const choices: QuizAnswerNumberChoice[] = numbers.map((number) => {\n return {\n number,\n selected: currentAnswer === number\n };\n });\n\n return choices;\n });\n\n readonly relevantKeysSignal = computed<string[]>(() => {\n const choices = this.choicesSignal();\n return choices.map((choice) => choice.number.toString());\n });\n\n clickedAnswer(answer: number) {\n this.questionAccessor.setAnswer(answer);\n }\n\n handleKeyDown(event: KeyboardEvent) {\n const number = Number(event.key);\n if (!Number.isNaN(number)) {\n this.clickedAnswer(number);\n }\n }\n}\n","<div class=\"dbx-quiz-answer-number\" (dbxWindowKeyDownListener)=\"handleKeyDown($event)\" [dbxWindowKeyDownFilter]=\"relevantKeysSignal()\">\n <div class=\"dbx-quiz-answer-number-buttons dbx-button-wrap-group\" role=\"radiogroup\" aria-label=\"Answer choices\">\n @for (choice of choicesSignal(); track choice.number) {\n <dbx-button role=\"radio\" [attr.aria-checked]=\"choice.selected\" [attr.aria-label]=\"'' + choice.number\" [color]=\"choice.selected ? 'accent' : 'primary'\" [raised]=\"true\" (buttonClick)=\"clickedAnswer(choice.number)\">{{ choice.number }}</dbx-button>\n }\n </div>\n</div>\n","import { Component, computed, inject, model } from '@angular/core';\nimport { DbxButtonModule, DbxWindowKeyDownListenerDirective } from '@dereekb/dbx-web';\nimport { type Maybe, range } from '@dereekb/util';\nimport { QuizQuestionAccessor } from '../store/quiz.accessor';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nconst MULTIPLE_CHOICE_LETTERS = `abcdefghijklmnopqrstuvwxyz`;\n\n/**\n * Upper-case letter label for a multiple choice option (e.g. \"A\", \"B\").\n */\nexport type MultipleChoiceLetter = string;\n\n/**\n * Display text for a single multiple choice option.\n */\nexport type MultipleChoiceText = string;\n\n/**\n * Answer data stored when a multiple choice option is selected.\n */\nexport interface MultipleChoiceAnswer {\n readonly isCorrectAnswer: boolean;\n readonly letter: MultipleChoiceLetter;\n readonly text: MultipleChoiceText;\n}\n\n/**\n * Configuration for the multiple choice answer component.\n */\nexport interface QuizAnswerMultipleChoiceComponentConfig {\n /**\n * Ordered list of answer option texts. Letters are auto-assigned A, B, C, etc.\n */\n readonly answerText: readonly MultipleChoiceText[];\n /**\n * Zero-based index of the correct answer, used to set `isCorrectAnswer` on the stored answer.\n */\n readonly correctAnswerIndex?: number;\n}\n\ninterface QuizAnswerMultipleChoice extends MultipleChoiceAnswer {\n readonly selected?: boolean;\n}\n\n/**\n * Answer component that displays multiple choice letter-labeled buttons.\n *\n * @usage\n * Used as an answer component in a QuizQuestion's answerComponentConfig.\n * Supports keyboard shortcuts (pressing the letter key selects that answer).\n *\n * ```typescript\n * answerComponentConfig: {\n * componentClass: QuizAnswerMultipleChoiceComponent,\n * init: (instance: QuizAnswerMultipleChoiceComponent) => {\n * instance.config.set({\n * answerText: ['Option A', 'Option B', 'Option C'],\n * correctAnswerIndex: 1\n * });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.answer.multiplechoice.component.html',\n imports: [DbxButtonModule, DbxWindowKeyDownListenerDirective],\n standalone: true\n})\nexport class QuizAnswerMultipleChoiceComponent {\n readonly questionAccessor = inject<QuizQuestionAccessor<QuizAnswerMultipleChoice>>(QuizQuestionAccessor);\n\n readonly config = model<Maybe<QuizAnswerMultipleChoiceComponentConfig>>();\n\n readonly currentAnswerSignal = toSignal(this.questionAccessor.answer$);\n readonly currentAnswerValueSignal = computed(() => this.currentAnswerSignal()?.data);\n\n readonly choicesSignal = computed(() => {\n const config = this.config();\n\n const currentAnswer = this.currentAnswerValueSignal();\n const answers = config?.answerText ?? [];\n const correctAnswerIndex = config?.correctAnswerIndex;\n\n const choices: QuizAnswerMultipleChoice[] = answers.map((text, i) => {\n const letter = MULTIPLE_CHOICE_LETTERS[i];\n\n return {\n letter: MULTIPLE_CHOICE_LETTERS[i].toUpperCase(),\n text,\n selected: currentAnswer?.letter === letter,\n isCorrectAnswer: correctAnswerIndex === i\n };\n });\n\n return choices;\n });\n\n readonly relevantKeysSignal = computed<string[]>(() => {\n const answersCount = this.config()?.answerText.length ?? 0;\n const relevantKeys = [];\n\n const numbersRange = answersCount > 0 ? range(1, answersCount + 1) : [];\n\n for (const number of numbersRange) {\n const answerLetter = MULTIPLE_CHOICE_LETTERS[number - 1];\n relevantKeys.push(answerLetter);\n }\n\n return relevantKeys;\n });\n\n clickedAnswer(answer: QuizAnswerMultipleChoice) {\n this.questionAccessor.setAnswer(answer);\n }\n\n handleKeyDown(event: KeyboardEvent) {\n if (event.key.length === 1) {\n const choices = this.choicesSignal();\n const selectedLetter = event.key.toUpperCase();\n const choice = choices.find((x) => x.letter === selectedLetter);\n\n if (choice) {\n this.clickedAnswer(choice);\n }\n }\n }\n}\n","<div class=\"dbx-quiz-answer-multiplechoice\" (dbxWindowKeyDownListener)=\"handleKeyDown($event)\" [dbxWindowKeyDownFilter]=\"relevantKeysSignal()\">\n <div class=\"dbx-quiz-answer-multiplechoice-buttons dbx-button-column dbx-button-wide\" role=\"radiogroup\" aria-label=\"Answer choices\">\n @for (choice of choicesSignal(); track choice.letter) {\n <dbx-button class=\"dbx-w100\" role=\"radio\" [attr.aria-checked]=\"choice.selected\" [attr.aria-label]=\"choice.letter + ') ' + choice.text\" [color]=\"choice.selected ? 'accent' : 'primary'\" [raised]=\"true\" (buttonClick)=\"clickedAnswer(choice)\">\n <div class=\"dbx-quiz-answer-multiplechoice-button-content\">\n <span class=\"dbx-quiz-answer-multiplechoice-button-letter\">{{ choice.letter }})</span>\n <span class=\"dbx-quiz-answer-multiplechoice-button-text\">{{ choice.text }}</span>\n </div>\n </dbx-button>\n }\n </div>\n</div>\n","import { Component, computed, inject, model } from '@angular/core';\nimport { QuizStore } from '../store/quiz.store';\nimport { DbxButtonModule } from '@dereekb/dbx-web';\nimport { type Maybe, type MaybeMap } from '@dereekb/util';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { type QuizTitleDetails } from '../store/quiz';\n\n/**\n * Config for the pre-quiz intro component.\n *\n * Overrides the title details.\n */\nexport type QuizPreQuizIntroConfig = Partial<MaybeMap<QuizTitleDetails>>;\n\n/**\n * Pre-quiz intro component that displays the quiz title, subtitle, description, and a start button.\n *\n * @usage\n * Used as a preQuizComponentConfig in a Quiz definition.\n * Inherits title details from the quiz unless overridden via config.\n *\n * ```typescript\n * preQuizComponentConfig: {\n * componentClass: QuizPreQuizIntroComponent,\n * init: (instance: QuizPreQuizIntroComponent) => {\n * instance.config.set({ subtitle: 'Custom subtitle' });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.prequiz.intro.component.html',\n imports: [DbxButtonModule],\n standalone: true\n})\nexport class QuizPreQuizIntroComponent {\n readonly quizStore = inject(QuizStore);\n\n readonly config = model<Maybe<QuizPreQuizIntroConfig>>();\n readonly quizTitleDetailsSignal = toSignal(this.quizStore.titleDetails$);\n\n readonly configSignal = computed(() => {\n const config = this.config();\n const titleDetails = this.quizTitleDetailsSignal();\n\n return {\n title: config?.title ?? titleDetails?.title,\n subtitle: config?.subtitle ?? titleDetails?.subtitle,\n description: config?.description ?? titleDetails?.description\n };\n });\n\n readonly titleSignal = computed(() => this.configSignal()?.title);\n readonly subtitleSignal = computed(() => this.configSignal()?.subtitle);\n readonly descriptionSignal = computed(() => this.configSignal()?.description);\n}\n","<div>\n <div>\n <h1>{{ titleSignal() }}</h1>\n <h2>{{ subtitleSignal() }}</h2>\n <p>{{ descriptionSignal() }}</p>\n </div>\n <div>\n <dbx-button [raised]=\"true\" (buttonClick)=\"quizStore.startQuiz()\" text=\"Start Quiz\"></dbx-button>\n </div>\n</div>\n","import { Component, computed, model } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\n\n/**\n * Configuration for the text-based question display. Used with `quizAgreementPrompt()` and\n * `quizFrequencyPrompt()` helpers for Likert-scale questions.\n */\nexport interface QuizQuestionTextComponentConfig {\n /**\n * Instructional prompt displayed above the main text (e.g. \"Rate how much you agree:\").\n */\n readonly prompt?: string;\n /**\n * The primary question or statement text.\n */\n readonly text: string;\n /**\n * Scale guidance displayed below the text (e.g. \"1 = Strongly Disagree, 5 = Strongly Agree\").\n */\n readonly guidance?: string;\n}\n\n/**\n * Question component that displays text with optional prompt and guidance.\n *\n * @usage\n * Used as a questionComponentConfig in a QuizQuestion definition.\n *\n * ```typescript\n * questionComponentConfig: {\n * componentClass: QuizQuestionTextComponent,\n * init: (instance: QuizQuestionTextComponent) => {\n * instance.config.set({ text: 'How do you handle ambiguity?', prompt: 'Rate yourself:', guidance: '1=Never, 5=Always' });\n * }\n * }\n * ```\n */\n@Component({\n templateUrl: './quiz.question.text.component.html',\n standalone: true\n})\nexport class QuizQuestionTextComponent {\n readonly config = model<Maybe<QuizQuestionTextComponentConfig>>();\n\n readonly promptSignal = computed(() => this.config()?.prompt);\n readonly textSignal = computed(() => this.config()?.text);\n readonly guidanceSignal = computed(() => this.config()?.guidance);\n}\n","<div class=\"dbx-quiz-question-text\" role=\"group\" aria-label=\"Question\">\n <div class=\"dbx-quiz-question-text-content\">\n @if (promptSignal() !== null) {\n <div class=\"dbx-hint dbx-pb3\" aria-label=\"Prompt\">{{ promptSignal() }}</div>\n }\n <div class=\"dbx-pb3\">{{ textSignal() }}</div>\n @if (guidanceSignal() !== null) {\n <div class=\"dbx-small dbx-hint\" role=\"note\">{{ guidanceSignal() }}</div>\n }\n </div>\n</div>\n","import { Component, computed, inject, input } from '@angular/core';\nimport { DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';\nimport { QuizStore } from '../store/quiz.store';\nimport { type Work } from '@dereekb/rxjs';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { type DbxActionSuccessHandlerFunction } from '@dereekb/dbx-core';\nimport { NgTemplateOutlet } from '@angular/common';\n\n/**\n * Submission lifecycle state within the post-quiz view.\n */\nexport type DbxQuizPostQuizState = 'presubmit' | 'postsubmit';\n\n/**\n * Post-quiz component that handles quiz submission and displays pre/post submit content.\n *\n * @usage\n * Use as a wrapper in your results component template:\n *\n * ```html\n * <dbx-quiz-post-quiz [handleSubmitQuiz]=\"handleSubmitQuiz\">\n * <div presubmit>Pre-submit content...</div>\n * <div postsubmit>Post-submit content (scores, etc.)...</div>\n * </dbx-quiz-post-quiz>\n * ```\n */\n@Component({\n selector: 'dbx-quiz-post-quiz',\n templateUrl: './quiz.postquiz.component.html',\n imports: [DbxButtonModule, DbxActionModule, NgTemplateOutlet],\n standalone: true\n})\nexport class DbxQuizPostQuizComponent {\n readonly quizStore = inject(QuizStore);\n\n readonly quizSubmittedSignal = toSignal(this.quizStore.submittedQuiz$);\n\n readonly stateSignal = computed(() => {\n const submitted = this.quizSubmittedSignal();\n\n return submitted ? 'postsubmit' : 'presubmit';\n });\n\n readonly handleSubmitQuiz = input<Work<void>>();\n\n readonly handleSubmitQuizButton: Work<void> = (_, context) => {\n this.quizStore.setLockQuizNavigation(true);\n const handler = this.handleSubmitQuiz();\n\n if (handler) {\n return handler(_, context);\n }\n\n context.reject();\n };\n\n readonly handleSubmitQuizSuccess: DbxActionSuccessHandlerFunction = () => {\n this.quizStore.setSubmittedQuiz(true);\n };\n}\n","<div class=\"dbx-post-quiz text-center\" role=\"status\" aria-live=\"polite\">\n <h3>Quiz Completed</h3>\n <div>\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\n @if (stateSignal() === 'presubmit') {\n <ng-container *ngTemplateOutlet=\"preSubmitTemplate\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"postSubmitTemplate\"></ng-container>\n }\n </div>\n</div>\n\n<!-- Pre-Submit -->\n<ng-template #preSubmitTemplate>\n <ng-content select=\"[presubmit]\"></ng-content>\n @if (handleSubmitQuiz()) {\n <div class=\"dbx-post-quiz-submit\">\n <div dbxAction dbxActionLogger dbxActionValue dbxActionSnackbarError [dbxActionHandler]=\"handleSubmitQuizButton\" [dbxActionSuccessHandler]=\"handleSubmitQuizSuccess\">\n <dbx-button [disabled]=\"quizSubmittedSignal()\" [raised]=\"true\" dbxActionButton>Submit Quiz</dbx-button>\n </div>\n </div>\n }\n</ng-template>\n\n<!-- Post-Submit -->\n<ng-template #postSubmitTemplate>\n <ng-content select=\"[postsubmit]\"></ng-content>\n</ng-template>\n\n<!-- Content -->\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>\n","import { Component, inject, input } from '@angular/core';\nimport { DbxActionModule, DbxButtonModule } from '@dereekb/dbx-web';\nimport { QuizStore } from '../store/quiz.store';\nimport { type Work } from '@dereekb/rxjs';\n\n/**\n * Button component that restarts the quiz to the first question.\n *\n * @usage\n * ```html\n * <dbx-quiz-reset-button buttonText=\"Try Again\"></dbx-quiz-reset-button>\n * ```\n */\n@Component({\n selector: 'dbx-quiz-reset-button',\n template: `\n <div class=\"dbx-quiz-reset-button\">\n <div dbxAction dbxActionLogger dbxActionValue dbxActionSnackbarError [dbxActionHandler]=\"handleResetQuizButton\">\n <dbx-button [raised]=\"true\" [text]=\"buttonText()\" dbxActionButton></dbx-button>\n </div>\n </div>\n `,\n imports: [DbxButtonModule, DbxActionModule],\n standalone: true\n})\nexport class DbxQuizResetButtonComponent {\n readonly quizStore = inject(QuizStore);\n\n readonly buttonText = input<string>(`Restart Quiz`);\n\n readonly handleResetQuizButton: Work<void> = (_, context) => {\n this.quizStore.restartQuizToFirstQuestion();\n context.success();\n };\n}\n","import { Component, computed, input } from '@angular/core';\nimport { type Maybe } from '@dereekb/util';\nimport { DbxQuizResetButtonComponent } from './quiz.reset.button.component';\n\n/**\n * Input data for rendering the quiz score display.\n */\nexport interface DbxQuizScoreInput {\n /**\n * Whether to show the retake/reset button.\n */\n readonly showRetakeButton?: boolean;\n /**\n * Feedback text to display.\n */\n readonly feedbackText: string;\n /**\n * Optional subtitle text.\n */\n readonly subtitle?: Maybe<string>;\n /**\n * The score achieved.\n */\n readonly score: number;\n /**\n * The maximum possible score.\n */\n readonly maxScore: number;\n}\n\n/**\n * Generic quiz score display component.\n *\n * @usage\n * ```html\n * <dbx-quiz-score [input]=\"scoreInput\"></dbx-quiz-score>\n * ```\n */\n@Component({\n selector: 'dbx-quiz-score',\n template: `\n <div class=\"dbx-quiz-score\">\n <h3 class=\"dbx-quiz-score-score\">{{ scoreSignal() }}/{{ maxScoreSignal() }}</h3>\n <p class=\"dbx-quiz-score-text\">{{ feedbackTextSignal() }}</p>\n @if (subtitleSignal()) {\n <p class=\"dbx-quiz-score-subtitle\">{{ subtitleSignal() }}</p>\n }\n @if (showRetakeButtonSignal()) {\n <dbx-quiz-reset-button buttonText=\"Retake Quiz\"></dbx-quiz-reset-button>\n }\n </div>\n `,\n imports: [DbxQuizResetButtonComponent],\n standalone: true\n})\nexport class DbxQuizScoreComponent {\n readonly input = input<Maybe<DbxQuizScoreInput>>();\n\n readonly scoreSignal = computed(() => this.input()?.score);\n readonly maxScoreSignal = computed(() => this.input()?.maxScore);\n readonly feedbackTextSignal = computed(() => this.input()?.feedbackText ?? '');\n readonly subtitleSignal = computed(() => this.input()?.subtitle);\n readonly showRetakeButtonSignal = computed(() => this.input()?.showRetakeButton);\n}\n","import { type QuizQuestionTextComponentConfig } from './component/quiz.question.text.component';\n\n/**\n * Creates a Likert scale question config with agreement prompt (Strongly Disagree to Strongly Agree).\n *\n * @param text - The statement to rate agreement on.\n * @param text - The statement to rate agreement on.\n * @returns A quiz question config with an agreement-based prompt and guidance text.\n *\n * @example\n * ```ts\n * instance.config.set(quizAgreementPrompt('I feel confident leading under pressure.'));\n * // { prompt: 'Please rate how much you agree...', text: '...', guidance: '1 = Strongly Disagree, 5 = Strongly Agree' }\n * ```\n */\nexport function quizAgreementPrompt(text: string): QuizQuestionTextComponentConfig {\n return {\n prompt: 'Please rate how much you agree with the following statement:',\n text,\n guidance: '1 = Strongly Disagree, 5 = Strongly Agree'\n };\n}\n\n/**\n * Creates a Likert scale question config with frequency prompt (Never to Always).\n *\n * @param text - The statement to rate frequency on.\n * @param text - The statement to rate frequency on.\n * @returns A quiz question config with a frequency-based prompt and guidance text.\n *\n * @example\n * ```ts\n * instance.config.set(quizFrequencyPrompt('I break vague direction into first steps.'));\n * // { prompt: 'Please rate how much you agree...', text: '...', guidance: '1 = Never, 5 = Always' }\n * ```\n */\nexport function quizFrequencyPrompt(text: string): QuizQuestionTextComponentConfig {\n return {\n prompt: 'Please rate how much you agree with the following statement:',\n text,\n guidance: '1 = Never, 5 = Always'\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;AA+EA;;;;;;;;;;;;;AAaG;AAEG,MAAO,SAAU,SAAQ,cAA8B,CAAA;AAC3D,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CAAC;AACJ,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,WAAW,EAAE,KAAK;AAClB,YAAA,aAAa,EAAE,KAAK;YACpB,OAAO,EAAE,IAAI,GAAG,EAAE;AAClB,YAAA,aAAa,EAAE,SAAS;AACxB,YAAA,mBAAmB,EAAE,EAAE;AACvB,YAAA,kBAAkB,EAAE,EAAE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AA,IAAA,EAAA,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAftB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACS,2BAA2B,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAG1B,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAjBjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;oBACD,OAAO,EAAE,CAAC,2BAA2B,CAAC;AACtC,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACpDD;;;;;;;;;;;;AAYG;AACG,SAAU,mBAAmB,CAAC,IAAY,EAAA;IAC9C,OAAO;AACL,QAAA,MAAM,EAAE,8DAA8D;QACtE,IAAI;AACJ,QAAA,QAAQ,EAAE;KACX;AACH;AAEA;;;;;;;;;;;;AAYG;AACG,SAAU,mBAAmB,CAAC,IAAY,EAAA;IAC9C,OAAO;AACL,QAAA,MAAM,EAAE,8DAA8D;QACtE,IAAI;AACJ,QAAA,QAAQ,EAAE;KACX;AACH;;AC1CA;;AAEG;;;;"}
@@ -244,11 +244,11 @@ class DbxActionFormDirective {
244
244
  if (result.reject) {
245
245
  this.source.reject(result.reject);
246
246
  }
247
- else if (result.value != null) {
248
- this.source.readyValue(result.value);
247
+ else if (result.value == null) {
248
+ // value isn't ready
249
249
  }
250
250
  else {
251
- // value isn't ready
251
+ this.source.readyValue(result.value);
252
252
  }
253
253
  });
254
254
  // Update the enabled/disabled state
@@ -290,8 +290,8 @@ class DbxActionFormDirective {
290
290
  */
291
291
  checkIsValidAndIsModified(value, overrides) {
292
292
  const { isModifiedFunction: overrideIsModifiedFunction, isValidFunction: overrideIsValidFunction } = overrides ?? {};
293
- const isValidFunctionObs = overrideIsValidFunction != null ? of(overrideIsValidFunction) : this.isValidFunction$;
294
- const isModifiedFunctionObs = overrideIsModifiedFunction != null ? of(overrideIsModifiedFunction) : this.isModifiedFunction$;
293
+ const isValidFunctionObs = overrideIsValidFunction == null ? this.isValidFunction$ : of(overrideIsValidFunction);
294
+ const isModifiedFunctionObs = overrideIsModifiedFunction == null ? this.isModifiedFunction$ : of(overrideIsModifiedFunction);
295
295
  return combineLatest([isValidFunctionObs, isModifiedFunctionObs]).pipe(switchMap(([isValid, isModified]) => {
296
296
  return combineLatest([isValid(value), isModified(value)]).pipe(map(([valid, modified]) => [valid, modified]));
297
297
  }));
@@ -4384,7 +4384,7 @@ function dbxDateTimeInputValueParseFactory(mode, timezoneInstance) {
4384
4384
  case DbxDateTimeValueMode.DATE_STRING:
4385
4385
  case DbxDateTimeValueMode.DATE:
4386
4386
  default:
4387
- factory = (x) => (x != null ? toJsDate(x) : x);
4387
+ factory = (x) => (x == null ? x : toJsDate(x));
4388
4388
  break;
4389
4389
  }
4390
4390
  if (timezoneInstance && useTimezoneInstance) {
@@ -4421,18 +4421,18 @@ function dbxDateTimeOutputValueFactory(mode, timezoneInstance) {
4421
4421
  let useTimezoneInstance = true;
4422
4422
  switch (mode) {
4423
4423
  case DbxDateTimeValueMode.DAY_STRING:
4424
- factory = (x) => (x != null ? formatToISO8601DayStringForSystem(x) : x);
4424
+ factory = (x) => (x == null ? x : formatToISO8601DayStringForSystem(x));
4425
4425
  useTimezoneInstance = false; // day strings do not use timezones
4426
4426
  break;
4427
4427
  case DbxDateTimeValueMode.DATE_STRING:
4428
- factory = (x) => (x != null ? formatToISO8601DateString(x) : x);
4428
+ factory = (x) => (x == null ? x : formatToISO8601DateString(x));
4429
4429
  break;
4430
4430
  case DbxDateTimeValueMode.UNIX_TIMESTAMP:
4431
- factory = (x) => (x != null ? x.getTime() : x);
4431
+ factory = (x) => (x == null ? x : x.getTime());
4432
4432
  break;
4433
4433
  case DbxDateTimeValueMode.SYSTEM_MINUTE_OF_DAY:
4434
4434
  case DbxDateTimeValueMode.MINUTE_OF_DAY:
4435
- factory = (x) => (x != null ? dateToMinuteOfDay(x) : x);
4435
+ factory = (x) => (x == null ? x : dateToMinuteOfDay(x));
4436
4436
  if (mode === DbxDateTimeValueMode.SYSTEM_MINUTE_OF_DAY) {
4437
4437
  useTimezoneInstance = false;
4438
4438
  }
@@ -4981,11 +4981,11 @@ class DbxDateTimeFieldComponent extends FieldType {
4981
4981
  this.addTime();
4982
4982
  break;
4983
4983
  }
4984
- if (this.presets != null) {
4985
- this._presets.next(asObservableFromGetter(this.presets));
4984
+ if (this.presets == null) {
4985
+ this._presets.next(this.dbxDateTimeFieldConfigService.configurations$);
4986
4986
  }
4987
4987
  else {
4988
- this._presets.next(this.dbxDateTimeFieldConfigService.configurations$);
4988
+ this._presets.next(asObservableFromGetter(this.presets));
4989
4989
  }
4990
4990
  this._resyncTimeInputSub.subscription = this.resyncTimeInput$.pipe(switchMap((_x) => combineLatest([this.currentDate$, this.timeString$]).pipe(first()))).subscribe(([currentDate, timeString]) => {
4991
4991
  // only resync when the current date is set, otherwise do not change the time string.
@@ -4999,7 +4999,10 @@ class DbxDateTimeFieldComponent extends FieldType {
4999
4999
  (x) => {
5000
5000
  const formValue = x.value;
5001
5001
  let obs;
5002
- if (formValue != null) {
5002
+ if (formValue == null) {
5003
+ obs = of({});
5004
+ }
5005
+ else {
5003
5006
  obs = combineLatest([this.timezoneInstance$, this.dateTimePickerInstance$]).pipe(map(([timezoneInstance, x]) => {
5004
5007
  // the form value is going to be in the output form, so we need to parse it back to the "input" date before evaluating it
5005
5008
  const formValueInSystemTimezone = dbxDateTimeInputValueParseFactory(this.valueMode, timezoneInstance)(formValue);
@@ -5023,9 +5026,6 @@ class DbxDateTimeFieldComponent extends FieldType {
5023
5026
  return errors;
5024
5027
  }), first());
5025
5028
  }
5026
- else {
5027
- obs = of({});
5028
- }
5029
5029
  return obs;
5030
5030
  }
5031
5031
  ]);
@@ -6315,7 +6315,11 @@ class DbxForgeDateTimeFieldComponent {
6315
6315
  try {
6316
6316
  const state = this.field()?.();
6317
6317
  if (state?.value?.set) {
6318
- state.value.set(value);
6318
+ // Never write `undefined`: Signal Forms treats an undefined value as "this field no longer
6319
+ // exists" and orphans it from the parent structure, which throws NG01902 (Orphan field) /
6320
+ // NG01901 (Cannot resolve path) on the next computed read. Use `null` for "no value" instead
6321
+ // — that keeps the field attached (and matches what clearValue() writes).
6322
+ state.value.set(value ?? null);
6319
6323
  }
6320
6324
  }
6321
6325
  catch {
@@ -7066,7 +7070,10 @@ class DbxForgeFixedDateRangeFieldComponent {
7066
7070
  try {
7067
7071
  const fieldTree = this.field();
7068
7072
  const fieldState = fieldTree();
7069
- fieldState.value.set(value);
7073
+ // Never write `undefined`: Signal Forms orphans a field whose value becomes undefined, which
7074
+ // throws NG01902 (Orphan field) / NG01901 (Cannot resolve path) on the next computed read.
7075
+ // Use `null` for "no value" so the field stays attached to its parent structure.
7076
+ fieldState.value.set(value ?? null);
7070
7077
  fieldState.markAsTouched();
7071
7078
  fieldState.markAsDirty();
7072
7079
  }
@@ -7678,7 +7685,8 @@ class DbxForgeTimeDurationFieldComponent {
7678
7685
  this._syncing = true;
7679
7686
  const fieldTree = this.field();
7680
7687
  const fieldState = fieldTree();
7681
- fieldState.value.set(value);
7688
+ // Use null (not undefined) for "no value" — undefined orphans the Signal Forms field (NG01902/NG01901).
7689
+ fieldState.value.set(value ?? null);
7682
7690
  fieldState.markAsTouched();
7683
7691
  fieldState.markAsDirty();
7684
7692
  this._syncing = false;
@@ -8712,7 +8720,8 @@ class DbxForgeSearchableTextFieldComponent extends AbstractForgeSearchableFieldD
8712
8720
  return;
8713
8721
  const fieldState = fieldGetter();
8714
8722
  if (fieldState?.value?.set) {
8715
- fieldState.value.set(value);
8723
+ // Use null (not undefined) for "no value" — undefined orphans the Signal Forms field (NG01902/NG01901).
8724
+ fieldState.value.set(value ?? null);
8716
8725
  }
8717
8726
  }
8718
8727
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxForgeSearchableTextFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -8899,7 +8908,9 @@ class DbxForgeSearchableChipFieldComponent extends AbstractForgeSearchableFieldD
8899
8908
  }
8900
8909
  const fieldState = fieldGetter();
8901
8910
  if (fieldState?.value?.set) {
8902
- fieldState.value.set(newValue);
8911
+ // Use null (not undefined) for "no value": single-value mode yields `values[0]` === undefined
8912
+ // when empty, and undefined orphans the Signal Forms field (NG01902/NG01901).
8913
+ fieldState.value.set(newValue ?? null);
8903
8914
  }
8904
8915
  }
8905
8916
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DbxForgeSearchableChipFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -9122,7 +9133,9 @@ class AbstractForgePickableItemFieldDirective {
9122
9133
  }
9123
9134
  const fieldState = fieldGetter();
9124
9135
  if (fieldState?.value?.set) {
9125
- fieldState.value.set(newValue);
9136
+ // Use null (not undefined) for "no value": single-value mode yields `values[0]` === undefined
9137
+ // when the selection is empty, and undefined orphans the Signal Forms field (NG01902/NG01901).
9138
+ fieldState.value.set(newValue ?? null);
9126
9139
  }
9127
9140
  }
9128
9141
  }
@@ -9630,7 +9643,8 @@ class DbxForgeSourceSelectFieldComponent {
9630
9643
  return;
9631
9644
  const fieldState = fieldGetter();
9632
9645
  if (fieldState?.value?.set) {
9633
- fieldState.value.set(value);
9646
+ // Use null (not undefined) for "no value" — undefined orphans the Signal Forms field (NG01902/NG01901).
9647
+ fieldState.value.set(value ?? null);
9634
9648
  }
9635
9649
  }
9636
9650
  _loadSourceSelectValueForValues(values) {
@@ -12972,7 +12986,7 @@ class AbstractDbxPickableItemFieldDirective extends FieldType {
12972
12986
  this.filterResultsContext.destroy();
12973
12987
  }
12974
12988
  _getValueOnFormControl(valueOnFormControl) {
12975
- const value = valueOnFormControl != null ? [...asArray(valueOnFormControl)] : []; // Always return an array.
12989
+ const value = valueOnFormControl == null ? [] : [...asArray(valueOnFormControl)]; // Always return an array.
12976
12990
  return value;
12977
12991
  }
12978
12992
  addValue(value) {
@@ -13487,11 +13501,11 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
13487
13501
  obs = displayValuesObs.pipe(first(), map((displayResults) => {
13488
13502
  // Assign the default component classes to complete configuration.
13489
13503
  displayResults.forEach((x) => {
13490
- if (!x.display) {
13491
- x.display = defaultDisplay;
13504
+ if (x.display) {
13505
+ x.display = mergeDbxInjectionComponentConfigs([defaultDisplay, x.display]);
13492
13506
  }
13493
13507
  else {
13494
- x.display = mergeDbxInjectionComponentConfigs([defaultDisplay, x.display]);
13508
+ x.display = defaultDisplay;
13495
13509
  }
13496
13510
  if (!x.anchor && anchorForValue) {
13497
13511
  x.anchor = anchorForValue(x);
@@ -13630,7 +13644,7 @@ class AbstractDbxSearchableValueFieldDirective extends FieldType {
13630
13644
  }
13631
13645
  // MARK: Internal
13632
13646
  _getValueOnFormControl(valueOnFormControl) {
13633
- const value = valueOnFormControl != null ? asArray(valueOnFormControl) : []; // Always return an array.
13647
+ const value = valueOnFormControl == null ? [] : asArray(valueOnFormControl); // Always return an array.
13634
13648
  return value;
13635
13649
  }
13636
13650
  _setValueOnFormControl(values) {
@@ -14393,7 +14407,7 @@ function formlyValueSelectionField(config) {
14393
14407
  }
14394
14408
  const options = addClearOption ? asObservable(inputOptions).pipe(map(formlyAddValueSelectionOptionFunction(typeof addClearOption === 'string' ? addClearOption : undefined))) : inputOptions;
14395
14409
  let parsers = undefined;
14396
- parsers = config.multiple !== true ? [firstValue] : [convertMaybeToArray];
14410
+ parsers = config.multiple === true ? [convertMaybeToArray] : [firstValue];
14397
14411
  return formlyField({
14398
14412
  key,
14399
14413
  type: native ? 'native-select' : 'select',
@@ -15078,7 +15092,12 @@ class DbxFixedDateRangeFieldComponent extends FieldType {
15078
15092
  scan((acc, nextDateRange) => {
15079
15093
  let result;
15080
15094
  let pickType = 'start';
15081
- if (nextDateRange?.start != null) {
15095
+ if (nextDateRange?.start == null) {
15096
+ result = {
15097
+ lastDateRange: nextDateRange
15098
+ };
15099
+ }
15100
+ else {
15082
15101
  const { start: startOrNextDate, end } = nextDateRange;
15083
15102
  const potentialBoundary = dateRange({ ...dateRangeInput, date: startOrNextDate });
15084
15103
  // only comes through when passed by the text inputs
@@ -15188,11 +15207,6 @@ class DbxFixedDateRangeFieldComponent extends FieldType {
15188
15207
  };
15189
15208
  }
15190
15209
  }
15191
- else {
15192
- result = {
15193
- lastDateRange: nextDateRange
15194
- };
15195
- }
15196
15210
  if (result) {
15197
15211
  result = {
15198
15212
  lastPickType: pickType,
@@ -15263,7 +15277,7 @@ class DbxFixedDateRangeFieldComponent extends FieldType {
15263
15277
  return () => true;
15264
15278
  }
15265
15279
  const filter = dateTimeMinuteWholeDayDecisionFunction(x, false);
15266
- return (x) => (x != null ? filter(x) : true);
15280
+ return (x) => (x == null ? true : filter(x));
15267
15281
  }), shareReplay(1));
15268
15282
  defaultPickerFilter = () => true;
15269
15283
  minDateSignal = toSignal(this.min$, { initialValue: null });
@@ -15373,11 +15387,11 @@ class DbxFixedDateRangeFieldComponent extends FieldType {
15373
15387
  });
15374
15388
  }
15375
15389
  });
15376
- if (this.presets != null) {
15377
- this._presets.next(asObservableFromGetter(this.presets));
15390
+ if (this.presets == null) {
15391
+ this._presets.next(this.dbxDateTimeFieldMenuPresetsService.configurations$);
15378
15392
  }
15379
15393
  else {
15380
- this._presets.next(this.dbxDateTimeFieldMenuPresetsService.configurations$);
15394
+ this._presets.next(asObservableFromGetter(this.presets));
15381
15395
  }
15382
15396
  this._activeDateSub.subscription = this.calendarFocusDate$.subscribe((x) => {
15383
15397
  this.calendar().activeDate = x;