@khanacademy/perseus-core 5.3.0 → 5.4.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.
- package/dist/data-schema.d.ts +8 -0
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/get-matrix-size.ts","../../src/utils/get-decimal-separator.ts","../../src/utils/equality.ts","../../src/utils/widget-id-utils.ts","../../src/utils/deep-clone.ts","../../src/utils/grapher-util.ts","../../src/utils/is-real-json-parse.ts","../../../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../src/parse-perseus-json/result.ts","../../src/parse-perseus-json/error-tracking-parse-context.ts","../../src/parse-perseus-json/object-path.ts","../../src/parse-perseus-json/parse-failure-detail.ts","../../src/parse-perseus-json/parse.ts","../../src/parse-perseus-json/general-purpose-parsers/any.ts","../../src/parse-perseus-json/general-purpose-parsers/array.ts","../../src/parse-perseus-json/general-purpose-parsers/boolean.ts","../../src/parse-perseus-json/general-purpose-parsers/constant.ts","../../src/parse-perseus-json/general-purpose-parsers/enumeration.ts","../../src/parse-perseus-json/general-purpose-parsers/is-object.ts","../../src/parse-perseus-json/general-purpose-parsers/nullable.ts","../../src/parse-perseus-json/general-purpose-parsers/number.ts","../../src/parse-perseus-json/general-purpose-parsers/object.ts","../../src/parse-perseus-json/general-purpose-parsers/optional.ts","../../src/parse-perseus-json/general-purpose-parsers/pair.ts","../../src/parse-perseus-json/general-purpose-parsers/pipe-parsers.ts","../../src/parse-perseus-json/general-purpose-parsers/record.ts","../../src/parse-perseus-json/general-purpose-parsers/string.ts","../../src/parse-perseus-json/general-purpose-parsers/trio.ts","../../src/parse-perseus-json/general-purpose-parsers/union.ts","../../src/parse-perseus-json/general-purpose-parsers/defaulted.ts","../../src/parse-perseus-json/perseus-parsers/images-map.ts","../../src/parse-perseus-json/perseus-parsers/widget.ts","../../src/parse-perseus-json/perseus-parsers/categorizer-widget.ts","../../src/parse-perseus-json/perseus-parsers/cs-program-widget.ts","../../src/parse-perseus-json/perseus-parsers/definition-widget.ts","../../src/parse-perseus-json/perseus-parsers/dropdown-widget.ts","../../src/parse-perseus-json/perseus-parsers/explanation-widget.ts","../../src/keypad.ts","../../src/widgets/expression/derive-extra-keys.ts","../../src/parse-perseus-json/general-purpose-parsers/convert.ts","../../src/parse-perseus-json/perseus-parsers/legacy-button-sets.ts","../../src/parse-perseus-json/perseus-parsers/versioned-widget-options.ts","../../src/parse-perseus-json/perseus-parsers/expression-widget.ts","../../src/parse-perseus-json/perseus-parsers/graded-group-widget.ts","../../src/parse-perseus-json/perseus-parsers/graded-group-set-widget.ts","../../src/parse-perseus-json/general-purpose-parsers/discriminated-union.ts","../../src/parse-perseus-json/perseus-parsers/grapher-widget.ts","../../src/parse-perseus-json/perseus-parsers/group-widget.ts","../../src/parse-perseus-json/perseus-parsers/iframe-widget.ts","../../src/parse-perseus-json/general-purpose-parsers/string-to-number.ts","../../src/parse-perseus-json/perseus-parsers/perseus-image-background.ts","../../src/parse-perseus-json/perseus-parsers/image-widget.ts","../../src/parse-perseus-json/perseus-parsers/input-number-widget.ts","../../src/parse-perseus-json/perseus-parsers/interaction-widget.ts","../../src/data-schema.ts","../../src/parse-perseus-json/perseus-parsers/interactive-graph-widget.ts","../../src/parse-perseus-json/perseus-parsers/label-image-widget.ts","../../src/parse-perseus-json/perseus-parsers/matcher-widget.ts","../../src/parse-perseus-json/perseus-parsers/matrix-widget.ts","../../src/parse-perseus-json/perseus-parsers/measurer-widget.ts","../../src/parse-perseus-json/perseus-parsers/molecule-renderer-widget.ts","../../src/parse-perseus-json/perseus-parsers/number-line-widget.ts","../../src/parse-perseus-json/perseus-parsers/numeric-input-widget.ts","../../src/parse-perseus-json/perseus-parsers/orderer-widget.ts","../../src/parse-perseus-json/perseus-parsers/passage-ref-widget.ts","../../src/parse-perseus-json/perseus-parsers/passage-widget.ts","../../src/parse-perseus-json/perseus-parsers/phet-simulation-widget.ts","../../src/parse-perseus-json/perseus-parsers/plotter-widget.ts","../../src/parse-perseus-json/perseus-parsers/python-program-widget.ts","../../src/widgets/radio/radio-upgrade.ts","../../src/parse-perseus-json/perseus-parsers/radio-widget.ts","../../src/parse-perseus-json/perseus-parsers/sorter-widget.ts","../../src/parse-perseus-json/perseus-parsers/table-widget.ts","../../src/parse-perseus-json/perseus-parsers/video-widget.ts","../../src/parse-perseus-json/perseus-parsers/widgets-map.ts","../../src/parse-perseus-json/perseus-parsers/perseus-renderer.ts","../../src/parse-perseus-json/perseus-parsers/perseus-article.ts","../../src/parse-perseus-json/perseus-parsers/hint.ts","../../src/parse-perseus-json/perseus-parsers/perseus-answer-area.ts","../../src/parse-perseus-json/perseus-parsers/perseus-item.ts","../../src/parse-perseus-json/index.ts","../../../../utils/shared/add-library-version-to-perseus-debug.ts","../../src/version.ts","../../src/error/errors.ts","../../src/error/perseus-error.ts","../../src/utils/objective_.ts","../../src/widgets/categorizer/categorizer-util.ts","../../src/widgets/categorizer/index.ts","../../src/widgets/cs-program/cs-program-util.ts","../../src/widgets/cs-program/index.ts","../../src/widgets/definition/index.ts","../../src/widgets/dropdown/dropdown-util.ts","../../src/widgets/dropdown/index.ts","../../src/widgets/explanation/index.ts","../../src/widgets/expression/expression-upgrade.ts","../../src/widgets/expression/expression-util.ts","../../src/widgets/expression/index.ts","../../src/widgets/graded-group/index.ts","../../src/widgets/graded-group-set/index.ts","../../src/widgets/grapher/grapher-util.ts","../../src/widgets/grapher/index.ts","../../src/widgets/group/index.ts","../../src/widgets/iframe/iframe-util.ts","../../src/widgets/iframe/index.ts","../../src/widgets/image/index.ts","../../src/widgets/input-number/index.ts","../../src/widgets/interaction/index.ts","../../src/widgets/interactive-graph/interactive-graph-util.ts","../../src/widgets/interactive-graph/index.ts","../../src/widgets/label-image/label-image-util.ts","../../src/widgets/label-image/index.ts","../../src/widgets/matcher/matcher-util.ts","../../src/widgets/matcher/index.ts","../../src/widgets/matrix/matrix-util.ts","../../src/widgets/matrix/index.ts","../../src/widgets/measurer/measurer-upgrade.ts","../../src/widgets/measurer/index.ts","../../src/widgets/number-line/number-line-util.ts","../../src/widgets/number-line/index.ts","../../src/widgets/numeric-input/numeric-input-util.ts","../../src/widgets/numeric-input/index.ts","../../src/widgets/orderer/orderer-util.ts","../../src/widgets/orderer/index.ts","../../src/widgets/passage/index.ts","../../src/widgets/passage-ref/passage-ref-upgrade.ts","../../src/widgets/passage-ref/index.ts","../../src/widgets/passage-ref-target/index.ts","../../src/widgets/phet-simulation/index.ts","../../src/widgets/plotter/plotter-util.ts","../../src/widgets/plotter/index.ts","../../src/widgets/python-program/index.ts","../../src/widgets/radio/radio-util.ts","../../src/widgets/radio/index.ts","../../src/widgets/sorter/sorter-util.ts","../../src/widgets/sorter/index.ts","../../src/widgets/table/table-util.ts","../../src/widgets/table/index.ts","../../src/widgets/video/index.ts","../../src/widgets/core-widget-registry.ts","../../src/widgets/upgrade.ts","../../src/utils/split-perseus-item.ts","../../src/utils/random-util.ts"],"sourcesContent":["import _ from \"underscore\";\n\nfunction getMatrixSize(matrix: ReadonlyArray<ReadonlyArray<number>>) {\n const matrixSize = [1, 1];\n\n // We need to find the widest row and tallest column to get the correct\n // matrix size.\n _(matrix).each((matrixRow, row) => {\n let rowWidth = 0;\n _(matrixRow).each((matrixCol, col) => {\n if (matrixCol != null && matrixCol.toString().length) {\n rowWidth = col + 1;\n }\n });\n\n // Matrix width:\n matrixSize[1] = Math.max(matrixSize[1], rowWidth);\n\n // Matrix height:\n if (rowWidth > 0) {\n matrixSize[0] = Math.max(matrixSize[0], row + 1);\n }\n });\n return matrixSize;\n}\n\nexport default getMatrixSize;\n","/**\n * Get the character used for separating decimals.\n */\nconst getDecimalSeparator = (locale: string): string => {\n switch (locale) {\n // TODO(somewhatabstract): Remove this when Chrome supports the `ka`\n // locale properly.\n // https://github.com/formatjs/formatjs/issues/1526#issuecomment-559891201\n //\n // Supported locales in Chrome:\n // https://source.chromium.org/chromium/chromium/src/+/master:third_party/icu/scripts/chrome_ui_languages.list\n case \"ka\":\n return \",\";\n\n default:\n const numberWithDecimalSeparator = 1.1;\n // TODO(FEI-3647): Update to use .formatToParts() once we no longer have to\n // support Safari 12.\n const match = new Intl.NumberFormat(locale)\n .format(numberWithDecimalSeparator)\n // 0x661 is ARABIC-INDIC DIGIT ONE\n // 0x6F1 is EXTENDED ARABIC-INDIC DIGIT ONE\n // 0x967 is DEVANAGARI DIGIT ONE\n // 0x9e7 is BENGALI/BANGLA DIGIT ONE\n .match(/[^\\d\\u0661\\u06F1\\u0967\\u09e7]/);\n return match?.[0] ?? \".\";\n }\n};\n\nexport default getDecimalSeparator;\n","import _ from \"underscore\";\n\n/**\n * APPROXIMATE equality on numbers and primitives.\n */\nexport function approximateEqual<T>(x: T, y: T): boolean {\n if (typeof x === \"number\" && typeof y === \"number\") {\n return Math.abs(x - y) < 1e-9;\n }\n return x === y;\n}\n\n/**\n * Deep APPROXIMATE equality on primitives, numbers, arrays, and objects.\n * Recursive.\n */\nexport function approximateDeepEqual<T>(x: T, y: T): boolean {\n if (Array.isArray(x) && Array.isArray(y)) {\n if (x.length !== y.length) {\n return false;\n }\n for (let i = 0; i < x.length; i++) {\n if (!approximateDeepEqual(x[i], y[i])) {\n return false;\n }\n }\n return true;\n }\n if (Array.isArray(x) || Array.isArray(y)) {\n return false;\n }\n if (typeof x === \"function\" && typeof y === \"function\") {\n return approximateEqual(x, y);\n }\n if (typeof x === \"function\" || typeof y === \"function\") {\n return false;\n }\n if (typeof x === \"object\" && typeof y === \"object\" && !!x && !!y) {\n return (\n x === y ||\n (_.all(x, function (v, k) {\n // @ts-expect-error - TS2536 - Type 'CollectionKey<T>' cannot be used to index type 'T'.\n return approximateDeepEqual(y[k], v);\n }) &&\n _.all(y, function (v, k) {\n // @ts-expect-error - TS2536 - Type 'CollectionKey<T>' cannot be used to index type 'T'.\n return approximateDeepEqual(x[k], v);\n }))\n );\n }\n if ((typeof x === \"object\" && !!x) || (typeof y === \"object\" && !!y)) {\n return false;\n }\n return approximateEqual(x, y);\n}\n","import type {PerseusWidgetsMap} from \"../data-schema\";\n\n/**\n * Add a widget placeholder using the widget ID.\n * ex. addWidget(\"radio 1\") => \"[[☃ radio 1]]\"\n *\n * @param {string} id\n * @returns {string}\n */\nexport function addWidget(id: string): string {\n return `[[☃ ${id}]]`;\n}\n\n/**\n * Regex for widget placeholders in a string.\n *\n * First capture group is the widget ID (ex. 'radio 1')\n * Second capture group is the widget type (ex. \"radio)\n * exec return will look like: ['[[☃ radio 1]]', 'radio 1', 'radio']\n */\nexport function getWidgetRegex() {\n return /\\[\\[☃ ([A-Za-z0-9- ]+)\\]\\]/g;\n}\n\n/**\n * Extract all widget IDs, which includes the widget type and instance number.\n * example output: ['radio 1', 'categorizer 1', 'categorizor 2']\n *\n * Content should contain Perseus widget placeholders,\n * which look like: '[[☃ radio 1]]'.\n *\n * @param {string} content\n * @returns {ReadonlyArray<string>} widgetIds\n */\nexport function getWidgetIdsFromContent(\n content: string,\n): ReadonlyArray<string> {\n const widgets: Array<string> = [];\n const localWidgetRegex = getWidgetRegex();\n\n let match = localWidgetRegex.exec(content);\n\n while (match !== null) {\n widgets.push(match[1]);\n match = localWidgetRegex.exec(content);\n }\n\n return widgets;\n}\n\n/**\n * Get a list of widget IDs from content,\n * but only for specific widget types\n *\n * @param {string} type the type of widget (ie \"radio\")\n * @param {string} content the string to parse\n * @param {PerseusWidgetsMap} widgetMap widget ID to widget map\n * @returns {ReadonlyArray<string>} the widget type (ie \"radio\")\n */\nexport function getWidgetIdsFromContentByType(\n type: string,\n content: string,\n widgetMap: PerseusWidgetsMap,\n): ReadonlyArray<string> {\n const rv: Array<string> = [];\n const widgetIdsInContent = getWidgetIdsFromContent(content);\n widgetIdsInContent.forEach((widgetId) => {\n const widget = widgetMap[widgetId];\n if (widget?.type === type) {\n rv.push(widgetId);\n }\n });\n return rv;\n}\n","// TODO(benchristel): in the future, we may want to make deepClone work for\n// Record<string, Cloneable> as well. Currently, it only does arrays.\ntype Cloneable =\n | null\n | undefined\n | boolean\n | string\n | number\n | Cloneable[]\n | readonly Cloneable[];\nfunction deepClone<T extends Cloneable>(obj: T): T {\n if (Array.isArray(obj)) {\n return obj.map(deepClone) as T;\n }\n return obj;\n}\n\nexport default deepClone;\n","import _ from \"underscore\";\n\nimport {approximateDeepEqual} from \"./equality\";\n\nimport type {\n LinearType,\n QuadraticType,\n SinusoidType,\n TangentType,\n ExponentialType,\n LogarithmType,\n AbsoluteValueType,\n Coords,\n} from \"./grapher-types\";\nimport type {Coord} from \"../data-schema\";\n\nexport const MOVABLES = {\n PLOT: \"PLOT\",\n PARABOLA: \"PARABOLA\",\n SINUSOID: \"SINUSOID\",\n};\n\n// TODO(charlie): These really need to go into a utility file as they're being\n// used by both interactive-graph and now grapher.\nfunction canonicalSineCoefficients(coeffs: any) {\n // For a curve of the form f(x) = a * Sin(b * x - c) + d,\n // this function ensures that a, b > 0, and c is its\n // smallest possible positive value.\n let amplitude = coeffs[0];\n let angularFrequency = coeffs[1];\n let phase = coeffs[2];\n const verticalOffset = coeffs[3];\n\n // Guarantee a > 0\n if (amplitude < 0) {\n amplitude *= -1;\n angularFrequency *= -1;\n phase *= -1;\n }\n\n const period = 2 * Math.PI;\n // Guarantee b > 0\n if (angularFrequency < 0) {\n angularFrequency *= -1;\n phase *= -1;\n phase += period / 2;\n }\n\n // Guarantee c is smallest possible positive value\n while (phase > 0) {\n phase -= period;\n }\n while (phase < 0) {\n phase += period;\n }\n\n return [amplitude, angularFrequency, phase, verticalOffset];\n}\n\nfunction canonicalTangentCoefficients(coeffs: any) {\n // For a curve of the form f(x) = a * Tan(b * x - c) + d,\n // this function ensures that a, b > 0, and c is its\n // smallest possible positive value.\n let amplitude = coeffs[0];\n let angularFrequency = coeffs[1];\n let phase = coeffs[2];\n const verticalOffset = coeffs[3];\n\n // Guarantee a > 0\n if (amplitude < 0) {\n amplitude *= -1;\n angularFrequency *= -1;\n phase *= -1;\n }\n\n const period = Math.PI;\n // Guarantee b > 0\n if (angularFrequency < 0) {\n angularFrequency *= -1;\n phase *= -1;\n phase += period / 2;\n }\n\n // Guarantee c is smallest possible positive value\n while (phase > 0) {\n phase -= period;\n }\n while (phase < 0) {\n phase += period;\n }\n\n return [amplitude, angularFrequency, phase, verticalOffset];\n}\n\nconst PlotDefaults = {\n areEqual: function (\n coeffs1: ReadonlyArray<number>,\n coeffs2: ReadonlyArray<number>,\n ): boolean {\n return approximateDeepEqual(coeffs1, coeffs2);\n },\n movable: MOVABLES.PLOT,\n getPropsForCoeffs: function (coeffs: ReadonlyArray<number>): {fn: any} {\n return {\n // @ts-expect-error - TS2339 - Property 'getFunctionForCoeffs' does not exist on type '{ readonly areEqual: (coeffs1: any, coeffs2: any) => boolean; readonly Movable: any; readonly getPropsForCoeffs: (coeffs: any) => any; }'.\n fn: _.partial(this.getFunctionForCoeffs, coeffs),\n };\n },\n} as const;\n\nconst Linear: LinearType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/67aaf581e6d9ef9038c10558a1f70ac21c11c9f8.png\",\n\n defaultCoords: [\n [0.25, 0.75],\n [0.75, 0.75],\n ],\n\n getCoefficients: function (\n coords: Coords,\n ): ReadonlyArray<number> | undefined {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const denom = p2[0] - p1[0];\n const num = p2[1] - p1[1];\n\n if (denom === 0) {\n return;\n }\n\n const m = num / denom;\n const b = p2[1] - m * p2[0];\n return [m, b];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const m = coeffs[0];\n const b = coeffs[1];\n return m * x + b;\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs: ReadonlyArray<number> = this.getCoefficients(coords);\n const m: number = coeffs[0];\n const b: number = coeffs[1];\n return \"y = \" + m.toFixed(3) + \"x + \" + b.toFixed(3);\n },\n});\n\nconst Quadratic: QuadraticType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/e23d36e6fc29ee37174e92c9daba2a66677128ab.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.75, 0.75],\n ],\n movable: MOVABLES.PARABOLA,\n\n getCoefficients: function (coords: Coords): ReadonlyArray<number> {\n const p1 = coords[0];\n const p2 = coords[1];\n\n // Parabola with vertex (h, k) has form: y = a * (h - k)^2 + k\n const h = p1[0];\n const k = p1[1];\n\n // Use these to calculate familiar a, b, c\n const a = (p2[1] - k) / ((p2[0] - h) * (p2[0] - h));\n const b = -2 * h * a;\n const c = a * h * h + k;\n\n return [a, b, c];\n },\n\n getFunctionForCoeffs: function (\n coeffs: ReadonlyArray<number>,\n x: number,\n ): number {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (a * x + b) * x + c;\n },\n\n getPropsForCoeffs: function (coeffs: ReadonlyArray<number>): {\n a: number;\n b: number;\n c: number;\n } {\n return {\n a: coeffs[0],\n b: coeffs[1],\n c: coeffs[2],\n };\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs = this.getCoefficients(coords);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (\n \"y = \" +\n a.toFixed(3) +\n \"x^2 + \" +\n b.toFixed(3) +\n \"x + \" +\n c.toFixed(3)\n );\n },\n});\n\nconst Sinusoid: SinusoidType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/3d68e7718498475f53b206c2ab285626baf8857e.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.6, 0.6],\n ],\n movable: MOVABLES.SINUSOID,\n\n getCoefficients: function (coords: Coords) {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const a = p2[1] - p1[1];\n const b = Math.PI / (2 * (p2[0] - p1[0]));\n const c = p1[0] * b;\n const d = p1[1];\n\n return [a, b, c, d];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return a * Math.sin(b * x - c) + d;\n },\n\n getPropsForCoeffs: function (coeffs: ReadonlyArray<number>) {\n return {\n a: coeffs[0],\n b: coeffs[1],\n c: coeffs[2],\n d: coeffs[3],\n };\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs = this.getCoefficients(coords);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return (\n \"y = \" +\n a.toFixed(3) +\n \" sin(\" +\n b.toFixed(3) +\n \"x - \" +\n c.toFixed(3) +\n \") + \" +\n d.toFixed(3)\n );\n },\n\n areEqual: function (\n coeffs1: ReadonlyArray<number>,\n coeffs2: ReadonlyArray<number>,\n ) {\n return approximateDeepEqual(\n canonicalSineCoefficients(coeffs1),\n canonicalSineCoefficients(coeffs2),\n );\n },\n});\n\nconst Tangent: TangentType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/7db80d23c35214f98659fe1cf0765811c1bbfbba.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.75, 0.75],\n ],\n\n getCoefficients: function (coords: Coords) {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const a = p2[1] - p1[1];\n const b = Math.PI / (4 * (p2[0] - p1[0]));\n const c = p1[0] * b;\n const d = p1[1];\n\n return [a, b, c, d];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return a * Math.tan(b * x - c) + d;\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs = this.getCoefficients(coords);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return (\n \"y = \" +\n a.toFixed(3) +\n \" sin(\" +\n b.toFixed(3) +\n \"x - \" +\n c.toFixed(3) +\n \") + \" +\n d.toFixed(3)\n );\n },\n\n areEqual: function (\n coeffs1: ReadonlyArray<number>,\n coeffs2: ReadonlyArray<number>,\n ) {\n return approximateDeepEqual(\n canonicalTangentCoefficients(coeffs1),\n canonicalTangentCoefficients(coeffs2),\n );\n },\n});\n\nconst Exponential: ExponentialType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/9cbfad55525e3ce755a31a631b074670a5dad611.png\",\n\n defaultCoords: [\n [0.5, 0.55],\n [0.75, 0.75],\n ],\n\n defaultAsymptote: [\n [0, 0.5],\n [1.0, 0.5],\n ],\n\n /**\n * Add extra constraints for movement of the points or asymptote (below):\n * newCoord: [x, y]\n * The end position of the point or asymptote endpoint\n * oldCoord: [x, y]\n * The old position of the point or asymptote endpoint\n * coords:\n * An array of coordinates representing the proposed end configuration\n * of the plot coordinates.\n * asymptote:\n * An array of coordinates representing the proposed end configuration\n * of the asymptote.\n *\n * Return: either a coordinate (to be used as the resulting coordinate of\n * the move) or a boolean, where `true` uses newCoord as the resulting\n * coordinate, and `false` uses oldCoord as the resulting coordinate.\n */\n extraCoordConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coords,\n asymptote: Coords,\n graph,\n ) {\n const y: number = asymptote[0][1];\n return _.all(coords, (coord) => coord[1] !== y);\n },\n\n extraAsymptoteConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coords,\n asymptote: Coords,\n graph,\n ): Coord {\n const y = newCoord[1];\n const isValid =\n _.all(coords, (coord) => coord[1] > y) ||\n _.all(coords, (coord) => coord[1] < y);\n\n if (isValid) {\n return [oldCoord[0], y];\n }\n // Snap the asymptote as close as possible, i.e., if the user moves\n // the mouse really quickly into an invalid region\n const oldY = oldCoord[1];\n const wasBelow = _.all(coords, (coord) => coord[1] > oldY);\n if (wasBelow) {\n const bottomMost = _.min(_.map(coords, (coord) => coord[1]));\n return [oldCoord[0], bottomMost - graph.snapStep[1]];\n }\n const topMost = _.max(_.map(coords, (coord) => coord[1]));\n return [oldCoord[0], topMost + graph.snapStep[1]];\n },\n\n allowReflectOverAsymptote: true,\n\n getCoefficients: function (\n coords: Coords,\n asymptote: Coords,\n ): ReadonlyArray<number> {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const c = asymptote[0][1];\n const b = Math.log((p1[1] - c) / (p2[1] - c)) / (p1[0] - p2[0]);\n const a = (p1[1] - c) / Math.exp(b * p1[0]);\n return [a, b, c];\n },\n\n getFunctionForCoeffs: function (\n coeffs: ReadonlyArray<number>,\n x: number,\n ): number {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return a * Math.exp(b * x) + c;\n },\n\n getEquationString: function (coords: Coords, asymptote: Coords) {\n if (!asymptote) {\n return null;\n }\n const coeffs = this.getCoefficients(coords, asymptote);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (\n \"y = \" +\n a.toFixed(3) +\n \"e^(\" +\n b.toFixed(3) +\n \"x) + \" +\n c.toFixed(3)\n );\n },\n});\n\nconst Logarithm: LogarithmType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/f6491e99d34af34d924bfe0231728ad912068dc3.png\",\n\n defaultCoords: [\n [0.55, 0.5],\n [0.75, 0.75],\n ],\n\n defaultAsymptote: [\n [0.5, 0],\n [0.5, 1.0],\n ],\n\n extraCoordConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coord,\n asymptote: Coords,\n graph,\n ) {\n const x = asymptote[0][0];\n return (\n _.all(coords, (coord) => coord[0] !== x) &&\n coords[0][1] !== coords[1][1]\n );\n },\n\n extraAsymptoteConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coords,\n asymptote: Coords,\n graph,\n ): ReadonlyArray<number> {\n const x = newCoord[0];\n const isValid =\n _.all(coords, (coord) => coord[0] > x) ||\n _.all(coords, (coord) => coord[0] < x);\n\n if (isValid) {\n return [x, oldCoord[1]];\n }\n // Snap the asymptote as close as possible, i.e., if the user moves\n // the mouse really quickly into an invalid region\n const oldX = oldCoord[0];\n const wasLeft = _.all(coords, (coord) => coord[0] > oldX);\n if (wasLeft) {\n const leftMost = _.min(_.map(coords, (coord) => coord[0]));\n return [leftMost - graph.snapStep[0], oldCoord[1]];\n }\n const rightMost = _.max(_.map(coords, (coord) => coord[0]));\n return [rightMost + graph.snapStep[0], oldCoord[1]];\n },\n\n allowReflectOverAsymptote: true,\n\n getCoefficients: function (\n coords: Coords,\n asymptote: Coords,\n ): ReadonlyArray<number> | undefined {\n // It's easiest to calculate the logarithm's coefficients by thinking\n // about it as the inverse of the exponential, so we flip x and y and\n // perform some algebra on the coefficients. This also unifies the\n // logic between the two 'models'.\n const flip = (coord: Coord): Coord => [coord[1], coord[0]];\n const inverseCoeffs = Exponential.getCoefficients(\n _.map(coords, flip) as Coords,\n _.map(asymptote, flip) as Coords,\n );\n if (inverseCoeffs) {\n const c = -inverseCoeffs[2] / inverseCoeffs[0];\n const b = 1 / inverseCoeffs[0];\n const a = 1 / inverseCoeffs[1];\n return [a, b, c];\n }\n },\n\n getFunctionForCoeffs: function (\n coeffs: ReadonlyArray<number>,\n x: number,\n asymptote: Coords,\n ) {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return a * Math.log(b * x + c);\n },\n\n getEquationString: function (coords: Coords, asymptote: Coords) {\n if (!asymptote) {\n return null;\n }\n const coeffs: ReadonlyArray<number> = this.getCoefficients(\n coords,\n asymptote,\n );\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (\n \"y = ln(\" +\n a.toFixed(3) +\n \"x + \" +\n b.toFixed(3) +\n \") + \" +\n c.toFixed(3)\n );\n },\n});\n\nconst AbsoluteValue: AbsoluteValueType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/8256a630175a0cb1d11de223d6de0266daf98721.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.75, 0.75],\n ],\n\n getCoefficients: function (\n coords: Coords,\n ): ReadonlyArray<number> | undefined {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const denom = p2[0] - p1[0];\n const num = p2[1] - p1[1];\n\n if (denom === 0) {\n return;\n }\n\n let m = Math.abs(num / denom);\n if (p2[1] < p1[1]) {\n m *= -1;\n }\n const horizontalOffset = p1[0];\n const verticalOffset = p1[1];\n\n return [m, horizontalOffset, verticalOffset];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const m = coeffs[0];\n const horizontalOffset = coeffs[1];\n const verticalOffset = coeffs[2];\n return m * Math.abs(x - horizontalOffset) + verticalOffset;\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs: ReadonlyArray<number> = this.getCoefficients(coords);\n const m = coeffs[0];\n const horizontalOffset = coeffs[1];\n const verticalOffset = coeffs[2];\n return (\n \"y = \" +\n m.toFixed(3) +\n \"| x - \" +\n horizontalOffset.toFixed(3) +\n \"| + \" +\n verticalOffset.toFixed(3)\n );\n },\n});\n\n/* Utility functions for dealing with graphing interfaces. */\nconst functionTypeMapping = {\n linear: Linear,\n quadratic: Quadratic,\n sinusoid: Sinusoid,\n tangent: Tangent,\n exponential: Exponential,\n logarithm: Logarithm,\n absolute_value: AbsoluteValue,\n} as const;\n\nexport const allTypes: any = _.keys(functionTypeMapping);\n\nexport type FunctionTypeMappingKeys = keyof typeof functionTypeMapping;\n\ntype ConditionalGraderType<T extends FunctionTypeMappingKeys> =\n // prettier-ignore\n T extends \"linear\" ? LinearType\n : T extends \"quadratic\" ? QuadraticType\n : T extends \"sinusoid\" ? SinusoidType\n : T extends \"tangent\" ? TangentType\n : T extends \"exponential\" ? ExponentialType\n : T extends \"logarithm\" ? LogarithmType\n : T extends \"absolute_value\" ? AbsoluteValueType\n : never;\n\nexport function functionForType<T extends FunctionTypeMappingKeys>(\n type: T,\n): ConditionalGraderType<T> {\n // @ts-expect-error: TypeScript doesn't know how to use deal with generics\n // and conditional types in this way.\n return functionTypeMapping[type];\n}\n","import {approximateDeepEqual} from \"./equality\";\n\nexport function isRealJSONParse(jsonParse: typeof JSON.parse): boolean {\n const randomPhrase = buildRandomPhrase();\n const randomHintPhrase = buildRandomPhrase();\n const randomString = buildRandomString();\n const testingObject = JSON.stringify({\n answerArea: {\n calculator: false,\n chi2Table: false,\n financialCalculatorMonthlyPayment: false,\n financialCalculatorTimeToPayOff: false,\n financialCalculatorTotalAmount: false,\n periodicTable: false,\n periodicTableWithKey: false,\n tTable: false,\n zTable: false,\n },\n hints: [randomHintPhrase, `=${Math.floor(Math.random() * 50) + 1}`],\n itemDataVersion: {major: 0, minor: 1},\n question: {\n content: `${randomPhrase}`,\n images: {},\n widgets: {\n expression1: {\n alignment: \"default\",\n graded: false,\n options: {\n answerForms: [\n {\n considered: \"wrong\",\n form: false,\n key: 0,\n simplify: false,\n value: `${randomString}`,\n },\n ],\n ariaLabel: \"Answer\",\n buttonSets: [\"basic\"],\n functions: [\"f\", \"g\", \"h\"],\n static: true,\n times: false,\n visibleLabel: \"Answer\",\n },\n static: true,\n type: \"expression\",\n version: {major: 1, minor: 0},\n },\n },\n },\n });\n const testJSON = buildTestData(testingObject.replace(/\"/g, '\\\\\"'));\n const parsedTestJSON = jsonParse(testJSON);\n const parsedTestItemData: string =\n parsedTestJSON.data.assessmentItem.item.itemData;\n return approximateDeepEqual(parsedTestItemData, testingObject);\n}\n\nfunction buildRandomString(capitalize: boolean = false) {\n let randomString: string = \"\";\n const randomLength = Math.floor(Math.random() * 8) + 3;\n for (let i = 0; i < randomLength; i++) {\n const randomLetter = String.fromCharCode(\n 97 + Math.floor(Math.random() * 26),\n );\n randomString +=\n capitalize && i === 0 ? randomLetter.toUpperCase() : randomLetter;\n }\n return randomString;\n}\n\nfunction buildRandomPhrase() {\n const phrases: string[] = [];\n const randomLength = Math.floor(Math.random() * 10) + 5;\n for (let i = 0; i < randomLength; i++) {\n phrases.push(buildRandomString(i === 0));\n }\n const modifierStart = [\"**\", \"$\"];\n const modifierEnd = [\"**\", \"$\"];\n const modifierIndex = Math.floor(Math.random() * modifierStart.length);\n return `${modifierStart[modifierIndex]}${phrases.join(\" \")}${modifierEnd[modifierIndex]}`;\n}\n\nfunction buildTestData(testObject: string) {\n return `{\"data\":{\"assessmentItem\":{\"__typename\":\"AssessmentItemOrError\",\"error\":null,\"item\":{\"__typename\":\"AssessmentItem\",\"id\":\"x890b3c70f3e8f4a6\",\"itemData\":\"${testObject}\",\"problemType\":\"Type 1\",\"sha\":\"c7284a3ad65214b4e62bccce236d92f7f5d35941\"}}}}`;\n}\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import invariant from \"tiny-invariant\";\n\nexport type Result<S, F> = Success<S> | Failure<F>;\n\nexport type Success<T> = {type: \"success\"; value: T};\nexport type Failure<T> = {type: \"failure\"; detail: T};\n\nexport function success<T>(value: T): Success<T> {\n return {type: \"success\", value};\n}\n\nexport function failure<T>(detail: T): Failure<T> {\n return {type: \"failure\", detail};\n}\n\nexport function isFailure<S, F>(result: Result<S, F>): result is Failure<F> {\n return result.type === \"failure\";\n}\n\nexport function isSuccess<S, F>(result: Result<S, F>): result is Success<S> {\n return result.type === \"success\";\n}\n\nexport function assertFailure<S, F>(\n result: Result<S, F>,\n): asserts result is Failure<F> {\n invariant(\n isFailure(result),\n \"expected result to be a Failure, but got a Success\",\n );\n}\n\nexport function assertSuccess<S, F>(\n result: Result<S, F>,\n): asserts result is Success<S> {\n invariant(\n isSuccess(result),\n \"expected result to be a Success, but got a Failure\",\n );\n}\n\n/**\n * @returns a function that transforms the `detail` value of any Failure result\n * passed to it, and leaves Success results unchanged. `mapFailure` is curried\n * for easy composition with Array.map(), mu-lambda's pipe(), etc.\n * @param f the function to apply to Failure `detail`s.\n */\nexport function mapFailure<S, DetailIn, DetailOut>(\n f: (detail: DetailIn) => DetailOut,\n): (result: Result<S, DetailIn>) => Result<S, DetailOut> {\n return (result) => {\n if (isFailure(result)) {\n return failure(f(result.detail));\n }\n return result;\n };\n}\n\n// Result's `all` function is similar to Promise.all: given an array of\n// results, it returns success if all succeeded, and failure if any failed.\nexport function all<S, F>(\n results: Array<Result<S, F>>,\n combineFailureDetails: (a: F, b: F) => F = (a) => a,\n): Result<S[], F> {\n const values: S[] = [];\n const failureDetails: F[] = [];\n for (const result of results) {\n if (result.type === \"success\") {\n values.push(result.value);\n } else {\n failureDetails.push(result.detail);\n }\n }\n\n if (failureDetails.length > 0) {\n return failure(failureDetails.reduce(combineFailureDetails));\n }\n return success(values);\n}\n","import {failure, success} from \"./result\";\n\nimport type {ParseContext, Mismatch, PathSegment} from \"./parser-types\";\nimport type {Failure, Success} from \"./result\";\n\nexport class ErrorTrackingParseContext implements ParseContext {\n constructor(private readonly path: PathSegment[]) {}\n\n failure(\n expected: string | string[],\n badValue: unknown,\n ): Failure<Mismatch[]> {\n return failure([\n {\n expected: wrapInArray(expected),\n badValue,\n path: this.path,\n },\n ]);\n }\n\n forSubtree(key: PathSegment): ParseContext {\n return new ErrorTrackingParseContext([...this.path, key]);\n }\n\n success<T>(value: T): Success<T> {\n return success(value);\n }\n}\n\nfunction wrapInArray(a: string | string[]): string[] {\n return Array.isArray(a) ? a : [a];\n}\n","import type {PathSegment} from \"./parser-types\";\n\nexport function formatPath(path: PathSegment[]): string {\n return \"(root)\" + path.map(formatPathSegment).join(\"\");\n}\n\nfunction formatPathSegment(segment: PathSegment): string {\n if (typeof segment === \"string\") {\n return validIdentifier.test(segment)\n ? \".\" + segment\n : `[${JSON.stringify(segment)}]`;\n }\n return `[${segment.toString()}]`;\n}\n\nconst validIdentifier = /^[A-Za-z$_][A-Za-z$_0-9]*$/;\n","import {formatPath} from \"./object-path\";\n\nimport type {Mismatch} from \"./parser-types\";\n\nexport function message(failure: Mismatch): string {\n const expected = conjoin(failure.expected);\n const path = formatPath(failure.path);\n const badValue = JSON.stringify(failure.badValue);\n return `At ${path} -- expected ${expected}, but got ${badValue}`;\n}\n\nfunction conjoin(items: string[]): string {\n switch (items.length) {\n // TODO(benchristel): handle 0 if this is reused elsewhere.\n case 1:\n return items[0];\n case 2:\n return items.join(\" or \");\n default: {\n const allButLast = items.slice(0, items.length - 1);\n const last = items[items.length - 1];\n return allButLast.join(\", \") + \", or \" + last;\n }\n }\n}\n","import {ErrorTrackingParseContext} from \"./error-tracking-parse-context\";\nimport {message} from \"./parse-failure-detail\";\nimport {failure, isFailure} from \"./result\";\n\nimport type {Parser} from \"./parser-types\";\nimport type {Result} from \"./result\";\n\nexport function parse<T>(value: unknown, parser: Parser<T>): Result<T, string> {\n const result = parser(value, new ErrorTrackingParseContext([]));\n if (isFailure(result)) {\n return failure(result.detail.map(message).join(\"; \"));\n }\n return result;\n}\n","import type {Parser} from \"../parser-types\";\n\nexport const any: Parser<any> = (rawValue, ctx) => ctx.success(rawValue);\n","import * as Result from \"../result\";\n\nimport type {ParseContext, Parser} from \"../parser-types\";\n\nexport function array<T>(elementParser: Parser<T>): Parser<T[]> {\n return (rawValue: unknown, ctx: ParseContext) => {\n if (!Array.isArray(rawValue)) {\n return ctx.failure(\"array\", rawValue);\n }\n const elementResults = rawValue.map((elem, i) =>\n elementParser(elem, ctx.forSubtree(i)),\n );\n return Result.all(elementResults, concat);\n };\n}\n\nfunction concat<T>(a: T[], b: T[]): T[] {\n return [...a, ...b];\n}\n","import type {ParseContext, ParseResult} from \"../parser-types\";\n\nexport function boolean(\n rawValue: unknown,\n ctx: ParseContext,\n): ParseResult<boolean> {\n if (typeof rawValue === \"boolean\") {\n return ctx.success(rawValue);\n }\n return ctx.failure(\"boolean\", rawValue);\n}\n","import type {Parser} from \"../parser-types\";\n\ntype Primitive = string | number | boolean | null | undefined;\n\nexport function constant<T extends Primitive>(acceptedValue: T): Parser<T> {\n return (rawValue, ctx) => {\n if (rawValue !== acceptedValue) {\n return ctx.failure(String(JSON.stringify(acceptedValue)), rawValue);\n }\n return ctx.success(acceptedValue);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport function enumeration<T extends readonly string[]>(\n ...acceptedValues: T\n): Parser<T[number]> {\n return (rawValue, ctx) => {\n if (typeof rawValue === \"string\") {\n const index = acceptedValues.indexOf(rawValue);\n if (index > -1) {\n return ctx.success(acceptedValues[index]);\n }\n }\n const expected = acceptedValues.map((v) => JSON.stringify(v));\n return ctx.failure(expected, rawValue);\n };\n}\n","export function isObject(x: unknown): x is Record<keyof any, unknown> {\n return x != null && Object.getPrototypeOf(x) === Object.prototype;\n}\n","import type {Parser} from \"../parser-types\";\n\nexport function nullable<T>(parseValue: Parser<T>): Parser<T | null> {\n return (rawValue, ctx) => {\n if (rawValue === null) {\n return ctx.success(rawValue);\n }\n return parseValue(rawValue, ctx);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport const number: Parser<number> = (rawValue, ctx) => {\n if (typeof rawValue === \"number\") {\n return ctx.success(rawValue);\n }\n return ctx.failure(\"number\", rawValue);\n};\n","import {failure, isSuccess} from \"../result\";\n\nimport {isObject} from \"./is-object\";\n\nimport type {Mismatch, ParsedValue, Parser} from \"../parser-types\";\n\ntype ObjectSchema = Record<keyof any, Parser<any>>;\n\nexport function object<S extends ObjectSchema>(\n schema: S,\n): Parser<{[K in keyof S]: ParsedValue<S[K]>}> {\n return (rawValue, ctx) => {\n if (!isObject(rawValue)) {\n return ctx.failure(\"object\", rawValue);\n }\n\n const ret: any = {...rawValue};\n const mismatches: Mismatch[] = [];\n for (const [prop, propParser] of Object.entries(schema)) {\n const result = propParser(rawValue[prop], ctx.forSubtree(prop));\n if (isSuccess(result)) {\n if (result.value !== undefined || prop in rawValue) {\n ret[prop] = result.value;\n }\n } else {\n mismatches.push(...result.detail);\n }\n }\n\n if (mismatches.length > 0) {\n return failure(mismatches);\n }\n return ctx.success(ret);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport function optional<T>(parseValue: Parser<T>): Parser<T | undefined> {\n return (rawValue, ctx) => {\n if (rawValue === undefined) {\n return ctx.success(rawValue);\n }\n return parseValue(rawValue, ctx);\n };\n}\n","import {isFailure} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function pair<A, B>(\n parseA: Parser<A>,\n parseB: Parser<B>,\n): Parser<[A, B]> {\n return (rawValue, ctx) => {\n if (!Array.isArray(rawValue)) {\n return ctx.failure(\"array\", rawValue);\n }\n if (rawValue.length !== 2) {\n return ctx.failure(\"array of length 2\", rawValue);\n }\n const [rawA, rawB] = rawValue;\n const resultA = parseA(rawA, ctx.forSubtree(0));\n if (isFailure(resultA)) {\n return resultA;\n }\n const resultB = parseB(rawB, ctx.forSubtree(1));\n if (isFailure(resultB)) {\n return resultB;\n }\n\n return ctx.success([resultA.value, resultB.value]);\n };\n}\n","import {isFailure} from \"../result\";\n\nimport type {\n ParseContext,\n ParsedValue,\n Parser,\n PartialParser,\n} from \"../parser-types\";\n\nexport function pipeParsers<T>(p: Parser<T>): ParserPipeline<T> {\n return new ParserPipeline(p);\n}\n\nexport class ParserPipeline<T> {\n constructor(public readonly parser: Parser<T>) {}\n\n then<U>(nextParser: PartialParser<T, U>): ParserPipeline<U> {\n return new ParserPipeline<U>(composeParsers(this.parser, nextParser));\n }\n}\n\nfunction composeParsers<\n A extends Parser<any>,\n B extends PartialParser<ParsedValue<A>, any>,\n>(parserA: A, parserB: B): Parser<ParsedValue<B>> {\n return (rawValue: unknown, ctx: ParseContext) => {\n const partialResult = parserA(rawValue, ctx);\n if (isFailure(partialResult)) {\n return partialResult;\n }\n\n return parserB(partialResult.value, ctx);\n };\n}\n","import {failure, isFailure, isSuccess} from \"../result\";\n\nimport {isObject} from \"./is-object\";\n\nimport type {Mismatch, Parser} from \"../parser-types\";\n\nexport function record<K extends string, V>(\n parseKey: Parser<K>,\n parseValue: Parser<V>,\n): Parser<Record<K, V>> {\n return (rawValue, ctx) => {\n if (!isObject(rawValue)) {\n return ctx.failure(\"object\", rawValue);\n }\n\n const result = {} as Record<K, V>;\n const mismatches: Mismatch[] = [];\n for (const [key, value] of Object.entries(rawValue)) {\n const entryCtx = ctx.forSubtree(key);\n const keyResult = parseKey(key, entryCtx);\n if (isFailure(keyResult)) {\n mismatches.push(...keyResult.detail);\n }\n\n const valueResult = parseValue(value, entryCtx);\n if (isFailure(valueResult)) {\n mismatches.push(...valueResult.detail);\n }\n\n if (isSuccess(keyResult) && isSuccess(valueResult)) {\n result[keyResult.value] = valueResult.value;\n }\n }\n\n if (mismatches.length > 0) {\n return failure(mismatches);\n }\n return ctx.success(result);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport const string: Parser<string> = (rawValue, ctx) => {\n if (typeof rawValue === \"string\") {\n return ctx.success(rawValue);\n }\n return ctx.failure(\"string\", rawValue);\n};\n","import {isFailure} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function trio<A, B, C>(\n parseA: Parser<A>,\n parseB: Parser<B>,\n parseC: Parser<C>,\n): Parser<[A, B, C]> {\n return (rawValue, ctx) => {\n if (!Array.isArray(rawValue)) {\n return ctx.failure(\"array\", rawValue);\n }\n if (rawValue.length !== 3) {\n return ctx.failure(\"array of length 3\", rawValue);\n }\n\n const resultA = parseA(rawValue[0], ctx.forSubtree(0));\n if (isFailure(resultA)) {\n return resultA;\n }\n\n const resultB = parseB(rawValue[1], ctx.forSubtree(1));\n if (isFailure(resultB)) {\n return resultB;\n }\n\n const resultC = parseC(rawValue[2], ctx.forSubtree(2));\n if (isFailure(resultC)) {\n return resultC;\n }\n\n return ctx.success([resultA.value, resultB.value, resultC.value]);\n };\n}\n","import {isSuccess} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function union<T>(parseBranch: Parser<T>): UnionBuilder<T> {\n return new UnionBuilder(parseBranch);\n}\n\nexport class UnionBuilder<T> {\n constructor(public parser: Parser<T>) {}\n\n or<New>(newBranch: Parser<New>) {\n return new UnionBuilder<T | New>(either(this.parser, newBranch));\n }\n}\n\nfunction either<A, B>(parseA: Parser<A>, parseB: Parser<B>): Parser<A | B> {\n return (rawValue, ctx) => {\n const resultA = parseA(rawValue, ctx);\n if (isSuccess(resultA)) {\n return resultA;\n }\n\n return parseB(rawValue, ctx);\n };\n}\n","import {success} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function defaulted<T, Default>(\n parser: Parser<T>,\n fallback: (missingValue: null | undefined) => Default,\n): Parser<T | Default> {\n return (rawValue, ctx) => {\n if (rawValue == null) {\n return success(fallback(rawValue));\n }\n return parser(rawValue, ctx);\n };\n}\n","import {number, object, record, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport type {PerseusImageDetail} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseImages: Parser<{[key: string]: PerseusImageDetail}> =\n defaulted(\n record(\n string,\n object({\n width: number,\n height: number,\n }),\n ),\n () => ({}),\n );\n","import {\n boolean,\n nullable,\n number,\n object,\n optional,\n string,\n} from \"../general-purpose-parsers\";\n\nimport type {WidgetOptions} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport function parseWidget<Type extends string, Options>(\n parseType: Parser<Type>,\n parseOptions: Parser<Options>,\n): Parser<WidgetOptions<Type, Options>> {\n return object({\n type: parseType,\n static: optional(boolean),\n graded: optional(boolean),\n alignment: optional(string),\n options: parseOptions,\n key: optional(nullable(number)),\n version: optional(\n object({\n major: number,\n minor: number,\n }),\n ),\n });\n}\n\nexport function parseWidgetWithVersion<\n Version extends {major: number; minor: number} | undefined,\n Type extends string,\n Options,\n>(\n parseVersion: Parser<Version>,\n parseType: Parser<Type>,\n parseOptions: Parser<Options>,\n): Parser<WidgetOptions<Type, Options>> {\n return object({\n type: parseType,\n static: optional(boolean),\n graded: optional(boolean),\n alignment: optional(string),\n options: parseOptions,\n key: optional(nullable(number)),\n version: parseVersion,\n });\n}\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {CategorizerWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseCategorizerWidget: Parser<CategorizerWidget> = parseWidget(\n constant(\"categorizer\"),\n object({\n items: array(string),\n categories: array(string),\n randomizeItems: defaulted(boolean, () => false),\n static: defaulted(boolean, () => false),\n values: array(defaulted(number, () => 0)),\n highlightLint: optional(boolean),\n linterContext: optional(\n object({\n contentType: string,\n paths: array(string),\n stack: array(string),\n }),\n ),\n }),\n);\n","import {\n any,\n array,\n boolean,\n constant,\n number,\n object,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {CSProgramWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseCSProgramWidget: Parser<CSProgramWidget> = parseWidget(\n constant(\"cs-program\"),\n object({\n programID: string,\n programType: any,\n settings: array(object({name: string, value: string})),\n showEditor: boolean,\n showButtons: boolean,\n height: number,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {boolean, constant, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {DefinitionWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseDefinitionWidget: Parser<DefinitionWidget> = parseWidget(\n constant(\"definition\"),\n object({\n togglePrompt: string,\n definition: string,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n array,\n boolean,\n constant,\n object,\n string,\n optional,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {DropdownWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseDropdownWidget: Parser<DropdownWidget> = parseWidget(\n constant(\"dropdown\"),\n object({\n placeholder: defaulted(string, () => \"\"),\n ariaLabel: optional(string),\n visibleLabel: optional(string),\n static: defaulted(boolean, () => false),\n choices: array(\n object({\n content: string,\n correct: boolean,\n }),\n ),\n }),\n);\n","import {boolean, constant, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {ExplanationWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseExplanationWidget: Parser<ExplanationWidget> = parseWidget(\n constant(\"explanation\"),\n object({\n showPrompt: string,\n hidePrompt: string,\n explanation: string,\n // We wrap parseWidgetsMap in a function here to make sure it is not\n // referenced before it is defined. There is an import cycle between\n // this file and widgets-map.ts that could cause it to be undefined.\n widgets: defaulted(\n (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n () => ({}),\n ),\n static: defaulted(boolean, () => false),\n }),\n);\n","export const KeypadKeys = [\n \"PLUS\",\n \"MINUS\",\n \"NEGATIVE\",\n \"TIMES\",\n \"DIVIDE\",\n \"DECIMAL\",\n \"PERIOD\",\n \"PERCENT\",\n \"CDOT\",\n \"EQUAL\",\n \"NEQ\",\n \"GT\",\n \"LT\",\n \"GEQ\",\n \"LEQ\", // mobile native only\n \"FRAC_INCLUSIVE\", // mobile native only\n \"FRAC_EXCLUSIVE\", // mobile native only\n \"FRAC\",\n \"EXP\",\n \"EXP_2\",\n \"EXP_3\",\n \"SQRT\",\n \"CUBE_ROOT\",\n \"RADICAL\",\n \"LEFT_PAREN\",\n \"RIGHT_PAREN\",\n \"LN\",\n \"LOG\",\n \"LOG_N\",\n \"SIN\",\n \"COS\", // TODO(charlie): Add in additional Greek letters.,\n \"TAN\",\n \"PI\",\n \"THETA\",\n \"UP\",\n \"RIGHT\",\n \"DOWN\",\n \"LEFT\",\n \"BACKSPACE\",\n \"DISMISS\",\n \"JUMP_OUT_PARENTHESES\",\n \"JUMP_OUT_EXPONENT\",\n \"JUMP_OUT_BASE\",\n \"JUMP_INTO_NUMERATOR\",\n \"JUMP_OUT_NUMERATOR\",\n \"JUMP_OUT_DENOMINATOR\", // Multi-functional keys.\n \"NUM_0\",\n \"NUM_1\",\n \"NUM_2\",\n \"NUM_3\",\n \"NUM_4\",\n \"NUM_5\",\n \"NUM_6\",\n \"NUM_7\",\n \"NUM_8\",\n \"NUM_9\",\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n] as const;\n\nexport type KeypadKey = (typeof KeypadKeys)[number];\n\nexport type KeypadType = \"FRACTION\" | \"EXPRESSION\";\n\nexport type KeypadConfiguration = {\n keypadType: KeypadType;\n extraKeys?: ReadonlyArray<KeypadKey>;\n times?: boolean;\n scientific?: boolean;\n};\n\n// Used by KeypadContext to pass around a renderer reference\nexport interface KeypadContextRendererInterface {\n blur(): void;\n}\n","import * as KAS from \"@khanacademy/kas\";\n\nimport {\n type KeypadKey,\n type KeypadConfiguration,\n KeypadKeys,\n} from \"../../keypad\";\n\nimport type {PerseusExpressionWidgetOptions} from \"../../data-schema\";\n\n/**\n * Scrape the answer forms for any variables or contants (like Pi)\n * that need to be included as keys on the keypad.\n */\nfunction deriveExtraKeys(\n widgetOptions: PerseusExpressionWidgetOptions,\n): KeypadConfiguration[\"extraKeys\"] {\n if (widgetOptions.extraKeys) {\n return widgetOptions.extraKeys as ReadonlyArray<KeypadKey>;\n }\n\n // If there are no extra symbols available, we include Pi anyway, so\n // that the \"extra symbols\" button doesn't appear empty.\n const defaultKeys: ReadonlyArray<KeypadKey> = [\"PI\"];\n\n if (widgetOptions.answerForms == null) {\n return defaultKeys;\n }\n\n // Extract any and all variables and constants from the answer forms.\n const uniqueExtraVariables: Partial<Record<KeypadKey, boolean>> = {};\n const uniqueExtraConstants: Partial<Record<KeypadKey, boolean>> = {};\n for (const answerForm of widgetOptions.answerForms) {\n const maybeExpr = KAS.parse(answerForm.value, widgetOptions);\n if (maybeExpr.parsed) {\n const expr = maybeExpr.expr;\n\n // The keypad expects Greek letters to be capitalized (e.g., it\n // requires `PI` instead of `pi`). Right now, it only supports Pi\n // and Theta, so we special-case.\n const isGreek = (symbol: any) =>\n symbol === \"pi\" || symbol === \"theta\";\n const toKey = (symbol: any) =>\n isGreek(symbol) ? symbol.toUpperCase() : symbol;\n const isKey = (key: string): key is KeypadKey =>\n KeypadKeys.includes(key as KeypadKey);\n\n for (const variable of expr.getVars()) {\n const maybeKey = toKey(variable);\n if (isKey(maybeKey)) {\n uniqueExtraVariables[maybeKey] = true;\n }\n }\n for (const constant of expr.getConsts()) {\n const maybeKey = toKey(constant);\n if (isKey(maybeKey)) {\n uniqueExtraConstants[maybeKey] = true;\n }\n }\n }\n }\n\n // TODO(charlie): Alert the keypad as to which of these symbols should be\n // treated as functions.\n const extraVariables = Object.keys(\n uniqueExtraVariables,\n ).sort() as ReadonlyArray<KeypadKey>;\n\n const extraConstants = Object.keys(\n uniqueExtraConstants,\n ).sort() as ReadonlyArray<KeypadKey>;\n\n const extraKeys = [...extraVariables, ...extraConstants];\n if (!extraKeys.length) {\n return defaultKeys;\n }\n\n return extraKeys;\n}\n\nexport default deriveExtraKeys;\n","import type {PartialParser} from \"../parser-types\";\n\n// Given a function, creates a PartialParser that converts one type to another\n// using that function. The returned parser never fails.\nexport function convert<A, B>(f: (value: A) => B): PartialParser<A, B> {\n return (rawValue, ctx) => ctx.success(f(rawValue));\n}\n","import {array, enumeration} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nexport const parseLegacyButtonSet = enumeration(\n \"basic\",\n \"basic+div\",\n \"trig\",\n \"prealgebra\",\n \"logarithms\",\n \"basic relations\",\n \"advanced relations\",\n \"scientific\",\n);\n\nexport const parseLegacyButtonSets = defaulted(\n array(parseLegacyButtonSet),\n // NOTE(benchristel): I copied the default buttonSets from\n // expression.tsx. See the parse-perseus-json/README.md for\n // an explanation of why we want to duplicate the default here.\n () => [\"basic\", \"trig\", \"prealgebra\", \"logarithms\"] as const,\n);\n","import {\n isObject,\n number,\n object,\n pipeParsers,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {isFailure} from \"../result\";\n\nimport type {Version} from \"../../data-schema\";\nimport type {ParseContext, Parser} from \"../parser-types\";\n\ntype Versioned = {\n version?: Version;\n};\n\n/**\n * Creates a parser for a widget options type with multiple major versions. Old\n * versions are migrated to the latest version. The parse fails if the input\n * data does not match any of the versions.\n *\n * @example\n * const parseOptions = versionedWidgetOptions(3, parseOptionsV3)\n * .withMigrationFrom(2, parseOptionsV2, migrateV2ToV3)\n * .withMigrationFrom(1, parseOptionsV1, migrateV1ToV2)\n * .withMigrationFrom(0, parseOptionsV0, migrateV0ToV1)\n * .parser;\n *\n * @param latestMajorVersion the latest major version of the widget options.\n * @param parseLatest a {@link Parser} for the latest version of the widget\n * options.\n * @returns a builder object, to which migrations from earlier versions can be\n * added. Migrations must be added in \"reverse chronological\" order as in the\n * example above.\n */\nexport function versionedWidgetOptions<Latest extends Versioned>(\n latestMajorVersion: number,\n parseLatest: Parser<Latest>,\n): VersionedWidgetOptionsParserBuilder<Latest, Latest> {\n return new VersionedWidgetOptionsParserBuilder(\n latestMajorVersion,\n parseLatest,\n (latest) => latest,\n (raw, ctx) =>\n ctx.failure(\"widget options with a known version number\", raw),\n );\n}\n\nclass VersionedWidgetOptionsParserBuilder<\n // The latest version of the widget options\n Latest extends Versioned,\n // A version of the widget options which we want to migrate to Latest.\n MigratableWidgetOptions extends Versioned,\n> {\n public parser: Parser<Latest>;\n\n constructor(\n majorVersion: number,\n parseThisVersion: Parser<MigratableWidgetOptions>,\n private migrateToLatest: (m: MigratableWidgetOptions) => Latest,\n private parseOtherVersions: Parser<Latest>,\n ) {\n const parseThisVersionAndMigrateToLatest = pipeParsers(\n parseThisVersion,\n ).then(convert(this.migrateToLatest)).parser;\n\n this.parser = (raw: unknown, ctx: ParseContext) => {\n if (!isObject(raw)) {\n return ctx.failure(\"object\", raw);\n }\n\n const versionParseResult = parseVersionedObject(raw, ctx);\n if (isFailure(versionParseResult)) {\n return versionParseResult;\n }\n\n if (versionParseResult.value.version.major !== majorVersion) {\n return this.parseOtherVersions(raw, ctx);\n }\n\n return parseThisVersionAndMigrateToLatest(raw, ctx);\n };\n }\n\n /**\n * Add a migration from an old version of the widget options.\n */\n withMigrationFrom<Old extends Versioned>(\n majorVersion: number,\n parseOldVersion: Parser<Old>,\n migrateToNextVersion: (old: Old) => MigratableWidgetOptions,\n ): VersionedWidgetOptionsParserBuilder<Latest, Old> {\n const parseOtherVersions = this.parser;\n\n const migrateToLatest = (old: Old) =>\n this.migrateToLatest(migrateToNextVersion(old));\n\n return new VersionedWidgetOptionsParserBuilder(\n majorVersion,\n parseOldVersion,\n migrateToLatest,\n parseOtherVersions,\n );\n }\n}\n\nconst parseVersionedObject = object({\n version: defaulted(object({major: number, minor: number}), () => ({\n major: 0,\n minor: 0,\n })),\n});\n","import {KeypadKeys} from \"../../keypad\";\nimport deriveExtraKeys from \"../../widgets/expression/derive-extra-keys\";\nimport {\n array,\n boolean,\n constant,\n enumeration,\n number,\n object,\n optional,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseLegacyButtonSets} from \"./legacy-button-sets\";\nimport {versionedWidgetOptions} from \"./versioned-widget-options\";\nimport {parseWidgetWithVersion} from \"./widget\";\n\nimport type {\n ExpressionWidget,\n PerseusExpressionAnswerForm,\n} from \"../../data-schema\";\nimport type {ParsedValue, Parser} from \"../parser-types\";\n\nconst stringOrNumberOrNullOrUndefined = union(string)\n .or(number)\n .or(constant(null))\n .or(constant(undefined)).parser;\n\nconst parsePossiblyInvalidAnswerForm = object({\n // `value` is the possibly invalid part of this. It should always be a\n // string, but some answer forms don't have it. The Expression widget\n // ignores invalid values, so we can safely filter them out during parsing.\n value: optional(string),\n form: defaulted(boolean, () => false),\n simplify: defaulted(boolean, () => false),\n considered: enumeration(\"correct\", \"wrong\", \"ungraded\"),\n key: pipeParsers(stringOrNumberOrNullOrUndefined).then(convert(String))\n .parser,\n});\n\nfunction removeInvalidAnswerForms(\n possiblyInvalid: Array<ParsedValue<typeof parsePossiblyInvalidAnswerForm>>,\n): PerseusExpressionAnswerForm[] {\n const valid: PerseusExpressionAnswerForm[] = [];\n for (const answerForm of possiblyInvalid) {\n const {value} = answerForm;\n if (value != null) {\n // Copying the object seems to be needed to make TypeScript happy\n valid.push({...answerForm, value});\n }\n }\n return valid;\n}\n\nconst version2 = object({major: constant(2), minor: number});\nconst parseExpressionWidgetV2: Parser<ExpressionWidget> =\n parseWidgetWithVersion(\n version2,\n constant(\"expression\"),\n object({\n answerForms: pipeParsers(\n array(parsePossiblyInvalidAnswerForm),\n ).then(convert(removeInvalidAnswerForms)).parser,\n functions: array(string),\n times: boolean,\n visibleLabel: optional(string),\n ariaLabel: optional(string),\n buttonSets: parseLegacyButtonSets,\n buttonsVisible: optional(enumeration(\"always\", \"never\", \"focused\")),\n extraKeys: array(enumeration(...KeypadKeys)),\n }),\n );\n\nconst version1 = object({major: constant(1), minor: number});\nconst parseExpressionWidgetV1 = parseWidgetWithVersion(\n version1,\n constant(\"expression\"),\n object({\n answerForms: pipeParsers(array(parsePossiblyInvalidAnswerForm)).then(\n convert(removeInvalidAnswerForms),\n ).parser,\n functions: array(string),\n times: boolean,\n visibleLabel: optional(string),\n ariaLabel: optional(string),\n buttonSets: parseLegacyButtonSets,\n buttonsVisible: optional(enumeration(\"always\", \"never\", \"focused\")),\n }),\n);\n\nfunction migrateV1ToV2(\n widget: ParsedValue<typeof parseExpressionWidgetV1>,\n): ExpressionWidget {\n const {options} = widget;\n return {\n ...widget,\n version: {major: 2, minor: 0},\n options: {\n times: options.times,\n buttonSets: options.buttonSets,\n functions: options.functions,\n buttonsVisible: options.buttonsVisible,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n answerForms: options.answerForms,\n extraKeys: deriveExtraKeys(options),\n },\n };\n}\n\nconst version0 = optional(object({major: constant(0), minor: number}));\nconst parseExpressionWidgetV0 = parseWidgetWithVersion(\n version0,\n constant(\"expression\"),\n object({\n functions: array(string),\n times: boolean,\n visibleLabel: optional(string),\n ariaLabel: optional(string),\n form: boolean,\n simplify: boolean,\n value: string,\n buttonSets: parseLegacyButtonSets,\n buttonsVisible: optional(enumeration(\"always\", \"never\", \"focused\")),\n }),\n);\n\nfunction migrateV0ToV1(\n widget: ParsedValue<typeof parseExpressionWidgetV0>,\n): ParsedValue<typeof parseExpressionWidgetV1> {\n const {options} = widget;\n return {\n ...widget,\n version: {major: 1, minor: 0},\n options: {\n times: options.times,\n buttonSets: options.buttonSets as any,\n functions: options.functions,\n buttonsVisible: options.buttonsVisible,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n\n answerForms: [\n {\n considered: \"correct\",\n form: options.form,\n simplify: options.simplify,\n value: options.value,\n },\n ],\n },\n };\n}\n\nexport const parseExpressionWidget: Parser<ExpressionWidget> =\n versionedWidgetOptions(2, parseExpressionWidgetV2)\n .withMigrationFrom(1, parseExpressionWidgetV1, migrateV1ToV2)\n .withMigrationFrom(0, parseExpressionWidgetV0, migrateV0ToV1).parser;\n","import {\n boolean,\n constant,\n nullable,\n number,\n object,\n optional,\n pipeParsers,\n record,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\nimport {parseWidget} from \"./widget\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {GradedGroupWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst falseToNull = pipeParsers(constant(false)).then(\n convert(() => null),\n).parser;\nexport const parseGradedGroupWidgetOptions = object({\n title: defaulted(string, () => \"\"),\n hasHint: optional(nullable(boolean)),\n // This module has an import cycle with parsePerseusRenderer.\n // The anonymous function below ensures that we don't try to access\n // parsePerseusRenderer before it's defined.\n hint: union(falseToNull)\n .or(constant(null))\n .or(constant(undefined))\n .or((rawVal, ctx) => parsePerseusRenderer(rawVal, ctx)).parser,\n content: string,\n // This module has an import cycle with parseWidgetsMap.\n // The anonymous function below ensures that we don't try to access\n // parseWidgetsMap before it's defined.\n widgets: (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n widgetEnabled: optional(nullable(boolean)),\n immutableWidgets: optional(nullable(boolean)),\n images: record(\n string,\n object({\n width: number,\n height: number,\n }),\n ),\n});\n\nexport const parseGradedGroupWidget: Parser<GradedGroupWidget> = parseWidget(\n constant(\"graded-group\"),\n parseGradedGroupWidgetOptions,\n);\n","import {array, constant, object} from \"../general-purpose-parsers\";\n\nimport {parseGradedGroupWidgetOptions} from \"./graded-group-widget\";\nimport {parseWidget} from \"./widget\";\n\nimport type {GradedGroupSetWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseGradedGroupSetWidget: Parser<GradedGroupSetWidget> =\n parseWidget(\n constant(\"graded-group-set\"),\n object({gradedGroups: array(parseGradedGroupWidgetOptions)}),\n );\n","import {isObject} from \"./is-object\";\n\nimport type {ParseContext, Parser} from \"../parser-types\";\n\ntype Primitive = number | string | boolean | null | undefined;\n\n/**\n * discriminatedUnion() should be preferred over union() when parsing a\n * discriminated union type, because discriminatedUnion() produces more\n * understandable failure messages. It takes the discriminant as the source of\n * truth for which variant is to be parsed, and expects the other data to match\n * that variant.\n */\nexport function discriminatedUnionOn<DK extends string>(discriminantKey: DK) {\n const noMoreBranches: Parser<never> = (raw: unknown, ctx: ParseContext) => {\n if (!isObject(raw)) {\n return ctx.failure(\"object\", raw);\n }\n return ctx\n .forSubtree(discriminantKey)\n .failure(\"a valid value\", raw[discriminantKey]);\n };\n\n return new DiscriminatedUnionBuilder(discriminantKey, noMoreBranches);\n}\n\nclass DiscriminatedUnionBuilder<\n DK extends string,\n Union extends {[k in DK]: Primitive},\n> {\n constructor(\n private discriminantKey: DK,\n public parser: Parser<Union>,\n ) {}\n\n withBranch<Variant extends {[k in DK]: Primitive}>(\n discriminantValue: Primitive,\n parseNewVariant: Parser<Variant>,\n ): DiscriminatedUnionBuilder<DK, Union | Variant> {\n const parseNewBranch = discriminatedUnionBranch(\n this.discriminantKey,\n discriminantValue,\n parseNewVariant,\n this.parser,\n );\n\n return new DiscriminatedUnionBuilder(\n this.discriminantKey,\n parseNewBranch,\n );\n }\n}\n\nfunction discriminatedUnionBranch<\n DK extends string,\n DV extends Primitive,\n Variant extends {[k in DK]: DV},\n Rest extends {[k in DK]: DV},\n>(\n discriminantKey: DK,\n discriminantValue: DV,\n parseVariant: Parser<Variant>,\n parseOtherBranches: Parser<Rest>,\n): Parser<Variant | Rest> {\n return (raw: unknown, ctx: ParseContext) => {\n if (!isObject(raw)) {\n return ctx.failure(\"object\", raw);\n }\n\n if (raw[discriminantKey] === discriminantValue) {\n return parseVariant(raw, ctx);\n }\n\n return parseOtherBranches(raw, ctx);\n };\n}\n","import {\n array,\n boolean,\n constant,\n enumeration,\n nullable,\n number,\n object,\n optional,\n pair,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {discriminatedUnionOn} from \"../general-purpose-parsers/discriminated-union\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {GrapherWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst pairOfNumbers = pair(number, number);\n\nconst pairOfPoints = pair(pairOfNumbers, pairOfNumbers);\n\nexport const parseGrapherWidget: Parser<GrapherWidget> = parseWidget(\n constant(\"grapher\"),\n object({\n availableTypes: array(\n enumeration(\n \"absolute_value\",\n \"exponential\",\n \"linear\",\n \"logarithm\",\n \"quadratic\",\n \"sinusoid\",\n \"tangent\",\n ),\n ),\n correct: discriminatedUnionOn(\"type\")\n .withBranch(\n \"absolute_value\",\n object({\n type: constant(\"absolute_value\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"exponential\",\n object({\n type: constant(\"exponential\"),\n asymptote: pairOfPoints,\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"linear\",\n object({\n type: constant(\"linear\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"logarithm\",\n object({\n type: constant(\"logarithm\"),\n asymptote: pairOfPoints,\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"quadratic\",\n object({\n type: constant(\"quadratic\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"sinusoid\",\n object({\n type: constant(\"sinusoid\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"tangent\",\n object({\n type: constant(\"tangent\"),\n coords: nullable(pairOfPoints),\n }),\n ).parser,\n graph: object({\n backgroundImage: object({\n bottom: optional(number),\n height: optional(number),\n left: optional(number),\n scale: optional(number),\n url: optional(nullable(string)),\n width: optional(number),\n }),\n box: optional(pairOfNumbers),\n editableSettings: optional(\n array(enumeration(\"graph\", \"snap\", \"image\", \"measure\")),\n ),\n gridStep: optional(pairOfNumbers),\n labels: pair(string, string),\n markings: enumeration(\"graph\", \"none\", \"grid\"),\n range: pair(pairOfNumbers, pairOfNumbers),\n rulerLabel: constant(\"\"),\n rulerTicks: number,\n showProtractor: optional(boolean),\n showRuler: optional(boolean),\n showTooltips: optional(boolean),\n snapStep: optional(pairOfNumbers),\n step: pairOfNumbers,\n valid: optional(union(boolean).or(string).parser),\n }),\n }),\n);\n","import {constant} from \"../general-purpose-parsers\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\nimport {parseWidget} from \"./widget\";\n\nimport type {GroupWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseGroupWidget: Parser<GroupWidget> = parseWidget(\n constant(\"group\"),\n // This module has an import cycle with parsePerseusRenderer.\n // The anonymous function below ensures that we don't try to access\n // parsePerseusRenderer before it's defined.\n (rawVal, ctx) => parsePerseusRenderer(rawVal, ctx),\n);\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {IFrameWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseIframeWidget: Parser<IFrameWidget> = parseWidget(\n constant(\"iframe\"),\n object({\n url: string,\n settings: optional(array(object({name: string, value: string}))),\n width: union(number).or(string).parser,\n height: union(number).or(string).parser,\n allowFullScreen: defaulted(boolean, () => false),\n allowTopNavigation: optional(boolean),\n static: defaulted(boolean, () => false),\n }),\n);\n","import type {PartialParser} from \"../parser-types\";\n\nexport const stringToNumber: PartialParser<string | number, number> = (\n rawValue,\n ctx,\n) => {\n if (typeof rawValue === \"number\") {\n return ctx.success(rawValue);\n }\n\n const parsedNumber = +rawValue;\n if (rawValue === \"\" || isNaN(parsedNumber)) {\n return ctx.failure(\"a number or numeric string\", rawValue);\n }\n\n return ctx.success(parsedNumber);\n};\n","import {\n nullable,\n number,\n object,\n optional,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {stringToNumber} from \"../general-purpose-parsers/string-to-number\";\n\nimport type {PerseusImageBackground} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nfunction emptyToZero(x: string | number): string | number {\n return x === \"\" ? 0 : x;\n}\n\nconst imageDimensionToNumber = pipeParsers(union(number).or(string).parser)\n // In this specific case, empty string is equivalent to zero. An empty\n // string parses to either NaN (using parseInt) or 0 (using unary +) and\n // CSS will treat NaN as invalid and default to 0 instead.\n .then(convert(emptyToZero))\n .then(stringToNumber).parser;\n\nconst dimensionOrUndefined = defaulted(imageDimensionToNumber, () => undefined);\n\nexport const parsePerseusImageBackground: Parser<PerseusImageBackground> =\n object({\n url: optional(nullable(string)),\n width: dimensionOrUndefined,\n height: dimensionOrUndefined,\n top: dimensionOrUndefined,\n left: dimensionOrUndefined,\n bottom: dimensionOrUndefined,\n scale: dimensionOrUndefined,\n });\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n pair,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {ImageWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst pairOfNumbers = pair(number, number);\n\nexport const parseImageWidget: Parser<ImageWidget> = parseWidget(\n constant(\"image\"),\n object({\n title: optional(string),\n caption: optional(string),\n alt: optional(string),\n backgroundImage: parsePerseusImageBackground,\n static: optional(boolean),\n labels: optional(\n array(\n object({\n content: string,\n alignment: string,\n coordinates: array(number),\n }),\n ),\n ),\n range: optional(pair(pairOfNumbers, pairOfNumbers)),\n box: optional(pairOfNumbers),\n }),\n);\n","import {\n boolean,\n constant,\n enumeration,\n number,\n object,\n optional,\n string,\n union,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {InputNumberWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst booleanToString: Parser<string> = (rawValue, ctx) => {\n if (typeof rawValue === \"boolean\") {\n return ctx.success(String(rawValue));\n }\n return ctx.failure(\"boolean\", rawValue);\n};\n\nexport const parseInputNumberWidget: Parser<InputNumberWidget> = parseWidget(\n constant(\"input-number\"),\n object({\n answerType: optional(\n enumeration(\n \"number\",\n \"decimal\",\n \"integer\",\n \"rational\",\n \"improper\",\n \"mixed\",\n \"percent\",\n \"pi\",\n ),\n ),\n inexact: optional(boolean),\n maxError: optional(union(number).or(string).parser),\n rightAlign: optional(boolean),\n simplify: enumeration(\"required\", \"optional\", \"enforced\"),\n size: enumeration(\"normal\", \"small\"),\n // TODO(benchristel): there are some content items where value is a\n // boolean, even though that makes no sense. We should figure out if\n // those content items are actually published anywhere, and consider\n // updating them.\n value: union(number).or(string).or(booleanToString).parser,\n customKeypad: optional(boolean),\n }),\n);\n","import {\n array,\n boolean,\n constant,\n enumeration,\n number,\n object,\n optional,\n pair,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {discriminatedUnionOn} from \"../general-purpose-parsers/discriminated-union\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {\n InteractionWidget,\n PerseusInteractionElement,\n} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst pairOfNumbers = pair(number, number);\nconst stringOrEmpty = defaulted(string, () => \"\");\n\nconst parseKey = pipeParsers(optional(string)).then(convert(String)).parser;\n\ntype FunctionElement = Extract<PerseusInteractionElement, {type: \"function\"}>;\nconst parseFunctionElement: Parser<FunctionElement> = object({\n type: constant(\"function\"),\n key: parseKey,\n options: object({\n value: string,\n funcName: string,\n rangeMin: string,\n rangeMax: string,\n color: string,\n strokeDasharray: string,\n strokeWidth: number,\n }),\n});\n\ntype LabelElement = Extract<PerseusInteractionElement, {type: \"label\"}>;\nconst parseLabelElement: Parser<LabelElement> = object({\n type: constant(\"label\"),\n key: parseKey,\n options: object({\n label: string,\n color: string,\n coordX: string,\n coordY: string,\n }),\n});\n\ntype LineElement = Extract<PerseusInteractionElement, {type: \"line\"}>;\nconst parseLineElement: Parser<LineElement> = object({\n type: constant(\"line\"),\n key: parseKey,\n options: object({\n color: string,\n startX: string,\n startY: string,\n endX: string,\n endY: string,\n strokeDasharray: string,\n strokeWidth: number,\n arrows: string,\n }),\n});\n\ntype MovableLineElement = Extract<\n PerseusInteractionElement,\n {type: \"movable-line\"}\n>;\nconst parseMovableLineElement: Parser<MovableLineElement> = object({\n type: constant(\"movable-line\"),\n key: parseKey,\n options: object({\n startX: string,\n startY: string,\n startSubscript: number,\n endX: string,\n endY: string,\n endSubscript: number,\n constraint: string,\n snap: number,\n constraintFn: string,\n constraintXMin: string,\n constraintXMax: string,\n constraintYMin: string,\n constraintYMax: string,\n }),\n});\n\ntype MovablePointElement = Extract<\n PerseusInteractionElement,\n {type: \"movable-point\"}\n>;\nconst parseMovablePointElement: Parser<MovablePointElement> = object({\n type: constant(\"movable-point\"),\n key: parseKey,\n options: object({\n startX: string,\n startY: string,\n varSubscript: number,\n constraint: string,\n snap: number,\n constraintFn: string,\n constraintXMin: stringOrEmpty,\n constraintXMax: stringOrEmpty,\n constraintYMin: stringOrEmpty,\n constraintYMax: stringOrEmpty,\n }),\n});\n\ntype ParametricElement = Extract<\n PerseusInteractionElement,\n {type: \"parametric\"}\n>;\nconst parseParametricElement: Parser<ParametricElement> = object({\n type: constant(\"parametric\"),\n key: parseKey,\n options: object({\n x: string,\n y: string,\n rangeMin: string,\n rangeMax: string,\n color: string,\n strokeDasharray: string,\n strokeWidth: number,\n }),\n});\n\ntype PointElement = Extract<PerseusInteractionElement, {type: \"point\"}>;\nconst parsePointElement: Parser<PointElement> = object({\n type: constant(\"point\"),\n key: parseKey,\n options: object({\n color: string,\n coordX: string,\n coordY: string,\n }),\n});\n\ntype RectangleElement = Extract<PerseusInteractionElement, {type: \"rectangle\"}>;\nconst parseRectangleElement: Parser<RectangleElement> = object({\n type: constant(\"rectangle\"),\n key: parseKey,\n options: object({\n color: string,\n coordX: string,\n coordY: string,\n width: string,\n height: string,\n }),\n});\n\nexport const parseInteractionWidget: Parser<InteractionWidget> = parseWidget(\n constant(\"interaction\"),\n object({\n static: defaulted(boolean, () => false),\n graph: object({\n editableSettings: optional(array(enumeration(\"canvas\", \"graph\"))),\n box: pairOfNumbers,\n labels: array(string),\n range: pair(pairOfNumbers, pairOfNumbers),\n gridStep: pairOfNumbers,\n markings: enumeration(\"graph\", \"grid\", \"none\"),\n snapStep: optional(pairOfNumbers),\n valid: optional(union(boolean).or(string).parser),\n backgroundImage: optional(parsePerseusImageBackground),\n showProtractor: optional(boolean),\n showRuler: optional(boolean),\n rulerLabel: optional(string),\n rulerTicks: optional(number),\n tickStep: pairOfNumbers,\n }),\n elements: array(\n discriminatedUnionOn(\"type\")\n .withBranch(\"function\", parseFunctionElement)\n .withBranch(\"label\", parseLabelElement)\n .withBranch(\"line\", parseLineElement)\n .withBranch(\"movable-line\", parseMovableLineElement)\n .withBranch(\"movable-point\", parseMovablePointElement)\n .withBranch(\"parametric\", parseParametricElement)\n .withBranch(\"point\", parsePointElement)\n .withBranch(\"rectangle\", parseRectangleElement).parser,\n ),\n }),\n);\n","/**\n * The Perseus \"data schema\" file.\n *\n * This file, and the types in it, represents the \"data schema\" that Perseus\n * uses. The @khanacademy/perseus-editor package edits and produces objects\n * that conform to the types in this file. Similarly, the top-level renderers\n * in @khanacademy/perseus, consume objects that conform to these types.\n *\n * WARNING: This file should not import any types from elsewhere so that it is\n * easy to reason about changes that alter the Perseus schema. This helps\n * ensure that it is not changed accidentally when upgrading a dependant\n * package or other part of Perseus code. Note that TypeScript does type\n * checking via something called \"structural typing\". This means that as long\n * as the shape of a type matches, the name it goes by doesn't matter. As a\n * result, a `Coord` type that looks like this `[x: number, y: number]` is\n * _identical_, in TypeScript's eyes, to this `Vector2` type `[x: number, y:\n * number]`. Also, with tuples, the labels for each entry is ignored, so `[x:\n * number, y: number]` is compatible with `[min: number, max: number]`. The\n * labels are for humans, not TypeScript. :)\n *\n * If you make changes to types in this file, be very sure that:\n *\n * a) the changes are backwards compatible. If they are not, old data from\n * previous versions of the \"schema\" could become unrenderable, or worse,\n * introduce hard-to-diagnose bugs.\n * b) the parsing code (`util/parse-perseus-json/`) is updated to handle\n * the new format _as well as_ the old format.\n */\n\nimport type {KeypadKey} from \"./keypad\";\n\n// TODO(FEI-4010): Remove `Perseus` prefix for all types here\n\nexport type Coord = [x: number, y: number];\nexport type Interval = [min: number, max: number];\nexport type Vector2 = Coord; // Same name as Mafs\nexport type Range = Interval;\nexport type Size = [width: number, height: number];\nexport type CollinearTuple = [Vector2, Vector2];\nexport type ShowSolutions = \"all\" | \"selected\" | \"none\";\n\n/**\n * A utility type that constructs a widget map from a \"registry interface\".\n * The keys of the registry should be the widget type (aka, \"categorizer\" or\n * \"radio\", etc) and the value should be the option type stored in the value\n * of the map.\n *\n * You can think of this as a type that generates another type. We use\n * \"registry interfaces\" as a way to keep a set of widget types to their data\n * type in several places in Perseus. This type then allows us to generate a\n * map type that maps a widget id to its data type and keep strong typing by\n * widget id.\n *\n * For example, given a fictitious registry such as this:\n *\n * ```\n * interface DummyRegistry {\n * categorizer: { categories: ReadonlyArray<string> };\n * dropdown: { choices: ReadonlyArray<string> }:\n * }\n * ```\n *\n * If we create a DummyMap using this helper:\n *\n * ```\n * type DummyMap = MakeWidgetMap<DummyRegistry>;\n * ```\n *\n * We'll get a map that looks like this:\n *\n * ```\n * type DummyMap = {\n * `categorizer ${number}`: { categories: ReadonlyArray<string> };\n * `dropdown ${number}`: { choices: ReadonlyArray<string> };\n * }\n * ```\n *\n * We use interfaces for the registries so that they can be extended in cases\n * where the consuming app brings along their own widgets. Interfaces in\n * TypeScript are always open (ie. you can extend them) whereas types aren't.\n */\nexport type MakeWidgetMap<TRegistry> = {\n [Property in keyof TRegistry as `${Property & string} ${number}`]: TRegistry[Property];\n};\n\n/**\n * Our core set of Perseus widgets.\n *\n * This interface is the basis for \"registering\" all Perseus widget types.\n * There should be one key/value pair for each supported widget. If you create\n * a new widget, an entry should be added to this interface. Note that this\n * only registers the widget options type, you'll also need to register the\n * widget so that it's available at runtime (@see\n * {@link file://./widgets.ts#registerWidget}).\n *\n * Importantly, the key should be the name that is used in widget IDs. For most\n * widgets that is the same as the widget option's `type` field. In cases where\n * a widget has been deprecated and replaced with the deprecated-standin\n * widget, it should be the original widget type!\n *\n * If you define the widget outside of this package, you can still add the new\n * widget to this interface by writing the following in that package that\n * contains the widget. TypeScript will merge that definition of the\n * `PerseusWidgets` with the one defined below.\n *\n * ```typescript\n * declare module \"@khanacademy/perseus-core\" {\n * interface PerseusWidgetTypes {\n * // A new widget\n * \"new-awesomeness\": MyAwesomeNewWidget;\n *\n * // A deprecated widget\n * \"super-old-widget\": DeprecatedStandinWidget;\n * }\n * }\n *\n * // The new widget's options definition\n * type MyAwesomeNewWidget = WidgetOptions<'new-awesomeness', MyAwesomeNewWidgetOptions>;\n *\n * // The deprecated widget's options definition\n * type SuperOldWidget = WidgetOptions<'super-old-widget', object>;\n * ```\n *\n * This interface can be extended through the magic of TypeScript \"Declaration\n * merging\". Specifically, we augment this module and extend this interface.\n *\n * @see {@link https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation}\n */\nexport interface PerseusWidgetTypes {\n categorizer: CategorizerWidget;\n \"cs-program\": CSProgramWidget;\n definition: DefinitionWidget;\n dropdown: DropdownWidget;\n explanation: ExplanationWidget;\n expression: ExpressionWidget;\n grapher: GrapherWidget;\n \"graded-group-set\": GradedGroupSetWidget;\n \"graded-group\": GradedGroupWidget;\n group: GroupWidget;\n iframe: IFrameWidget;\n image: ImageWidget;\n \"input-number\": InputNumberWidget;\n interaction: InteractionWidget;\n \"interactive-graph\": InteractiveGraphWidget;\n \"label-image\": LabelImageWidget;\n matcher: MatcherWidget;\n matrix: MatrixWidget;\n measurer: MeasurerWidget;\n \"molecule-renderer\": MoleculeRendererWidget;\n \"number-line\": NumberLineWidget;\n \"numeric-input\": NumericInputWidget;\n orderer: OrdererWidget;\n \"passage-ref-target\": RefTargetWidget;\n \"passage-ref\": PassageRefWidget;\n passage: PassageWidget;\n \"phet-simulation\": PhetSimulationWidget;\n \"python-program\": PythonProgramWidget;\n plotter: PlotterWidget;\n radio: RadioWidget;\n sorter: SorterWidget;\n table: TableWidget;\n video: VideoWidget;\n\n // Deprecated widgets\n \"lights-puzzle\": DeprecatedStandinWidget;\n sequence: DeprecatedStandinWidget;\n simulator: DeprecatedStandinWidget;\n transformer: DeprecatedStandinWidget;\n}\n\n/**\n * A map of widget IDs to widget options. This is most often used as the type\n * for a set of widgets defined in a `PerseusItem` but can also be useful to\n * represent a function parameter where only `widgets` from a `PerseusItem` are\n * needed. Today Widget IDs are made up of the widget type and an incrementing\n * integer (eg. `interactive-graph 1` or `radio 3`). It is suggested to avoid\n * reading/parsing the widget id to derive any information from it, except in\n * the case of this map.\n *\n * @see {@link PerseusWidgetTypes} additional widgets can be added to this map type\n * by augmenting the PerseusWidgetTypes with new widget types!\n */\nexport type PerseusWidgetsMap = MakeWidgetMap<PerseusWidgetTypes>;\n\n/**\n * PerseusWidget is a union of all the different types of widget options that\n * Perseus knows about.\n *\n * Thanks to it being based on PerseusWidgetTypes interface, this union is\n * automatically extended to include widgets used in tests without those widget\n * option types seeping into our production types.\n *\n * @see MockWidget for an example\n */\nexport type PerseusWidget = PerseusWidgetTypes[keyof PerseusWidgetTypes];\n\n/**\n * A \"PerseusItem\" is a classic Perseus item. It is rendered by the\n * `ServerItemRenderer` and the layout is pre-set.\n *\n * To render more complex Perseus items, see the `Item` type in the multi item\n * area.\n */\nexport type PerseusItem = {\n // The details of the question being asked to the user.\n question: PerseusRenderer;\n // A collection of hints to be offered to the user that support answering the question.\n hints: ReadonlyArray<Hint>;\n // Details about the tools the user might need to answer the question\n answerArea: PerseusAnswerArea | null | undefined;\n /**\n * The version of the item.\n * @deprecated Not used.\n */\n itemDataVersion: any;\n /**\n * @deprecated Superseded by per-widget answers.\n */\n answer: any;\n};\n\n/**\n * A \"PerseusArticle\" is an item that is meant to be rendered as an article.\n * This item is never scored and is rendered by the `ArticleRenderer`.\n */\nexport type PerseusArticle = PerseusRenderer | ReadonlyArray<PerseusRenderer>;\n\nexport type Version = {\n // The major part of the version\n major: number;\n // The minor part of the version\n minor: number;\n};\n\nexport type PerseusRenderer = {\n /**\n * Translatable Markdown content to be rendered. May include references to\n * widgets (as [[☃ widgetName]]) or images (as ).\n * For each image found in this content, there can be an entry in the\n * `images` dict (below) with the key being the image's url which defines\n * additional attributes for the image.\n */\n content: string;\n /**\n * A dictionary of {[widgetName]: Widget} to be referenced from the content\n * field.\n */\n widgets: PerseusWidgetsMap;\n /**\n * Formerly used in the PerseusGradedGroup widget. A list of \"tags\" that\n * are keys that represent other content in the system. Not rendered to\n * the user. NOTE: perseus_data.go says this is required even though it\n * isn't necessary.\n * @deprecated\n */\n metadata?: any;\n /**\n * A dictionary of {[imageUrl]: PerseusImageDetail}.\n */\n images: {\n [imageUrl: string]: PerseusImageDetail;\n };\n};\n\nexport type Hint = PerseusRenderer & {\n /**\n * When `true`, causes the previous hint to be replaced with this hint when\n * displayed. When `false`, the previous hint remains visible when this one\n * is displayed. This allows for hints that build upon each other.\n */\n replace?: boolean;\n};\n\nexport type PerseusImageDetail = {\n // The width of the image\n width: number;\n // the height of the image\n height: number;\n};\n\nexport const ItemExtras = [\n // The user might benefit from using a Scientific Calculator. Provided on Khan Academy when true\n \"calculator\",\n // The user might benefit from using a statistics Chi Squared Table like https://people.richland.edu/james/lecture/m170/tbl-chi.html\n \"chi2Table\",\n // The user might benefit from a monthly payments calculator. Provided on Khan Academy when true\n \"financialCalculatorMonthlyPayment\",\n // The user might benefit from a total amount calculator. Provided on Khan Academy when true\n \"financialCalculatorTotalAmount\",\n // The user might benefit from a time to pay off calculator. Provided on Khan Academy when true\n \"financialCalculatorTimeToPayOff\",\n // The user might benefit from using a Periodic Table of Elements. Provided on Khan Academy when true\n \"periodicTable\",\n // The user might benefit from using a Periodic Table of Elements with key. Provided on Khan Academy when true\n \"periodicTableWithKey\",\n // The user might benefit from using a statistics T Table like https://www.statisticshowto.com/tables/t-distribution-table/\n \"tTable\",\n // The user might benefit from using a statistics Z Table like https://www.ztable.net/\n \"zTable\",\n] as const;\nexport type PerseusAnswerArea = Record<(typeof ItemExtras)[number], boolean>;\n\n/**\n * The type representing the common structure of all widget's options. The\n * `Options` generic type represents the widget-specific option data.\n */\nexport type WidgetOptions<Type extends string, Options> = {\n // The \"type\" of widget which will define what the Options field looks like\n type: Type;\n // Whether this widget is displayed with the values and is immutable. For display only\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n static?: boolean;\n // Whether a widget is scored. Usually true except for IFrame widgets (deprecated)\n // Default: true\n graded?: boolean;\n // The HTML alignment of the widget. \"default\" or \"block\"\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n alignment?: string;\n // Options specific to the type field of the widget. See Perseus*WidgetOptions for more details\n options: Options;\n // Only used by interactive child widgets (line, point, etc) to identify the components\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n key?: number | null;\n // The version of the widget data spec. Used to differentiate between newer and older content data.\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n version?: Version;\n};\n\n// prettier-ignore\nexport type CategorizerWidget = WidgetOptions<'categorizer', PerseusCategorizerWidgetOptions>;\n// prettier-ignore\nexport type CSProgramWidget = WidgetOptions<'cs-program', PerseusCSProgramWidgetOptions>;\n// prettier-ignore\nexport type DefinitionWidget = WidgetOptions<'definition', PerseusDefinitionWidgetOptions>;\n// prettier-ignore\nexport type DropdownWidget = WidgetOptions<'dropdown', PerseusDropdownWidgetOptions>;\n// prettier-ignore\nexport type ExplanationWidget = WidgetOptions<'explanation', PerseusExplanationWidgetOptions>;\n// prettier-ignore\nexport type ExpressionWidget = WidgetOptions<'expression', PerseusExpressionWidgetOptions>;\n// prettier-ignore\nexport type GradedGroupSetWidget = WidgetOptions<'graded-group-set', PerseusGradedGroupSetWidgetOptions>;\n// prettier-ignore\nexport type GradedGroupWidget = WidgetOptions<'graded-group', PerseusGradedGroupWidgetOptions>;\n// prettier-ignore\nexport type GrapherWidget = WidgetOptions<'grapher', PerseusGrapherWidgetOptions>;\n// prettier-ignore\nexport type GroupWidget = WidgetOptions<'group', PerseusGroupWidgetOptions>;\n// prettier-ignore\nexport type IFrameWidget = WidgetOptions<'iframe', PerseusIFrameWidgetOptions>;\n// prettier-ignore\nexport type ImageWidget = WidgetOptions<'image', PerseusImageWidgetOptions>;\n// prettier-ignore\nexport type InteractionWidget = WidgetOptions<'interaction', PerseusInteractionWidgetOptions>;\n// prettier-ignore\nexport type InteractiveGraphWidget = WidgetOptions<'interactive-graph', PerseusInteractiveGraphWidgetOptions>;\n// prettier-ignore\nexport type LabelImageWidget = WidgetOptions<'label-image', PerseusLabelImageWidgetOptions>;\n// prettier-ignore\nexport type MatcherWidget = WidgetOptions<'matcher', PerseusMatcherWidgetOptions>;\n// prettier-ignore\nexport type MatrixWidget = WidgetOptions<'matrix', PerseusMatrixWidgetOptions>;\n// prettier-ignore\nexport type MeasurerWidget = WidgetOptions<'measurer', PerseusMeasurerWidgetOptions>;\n// prettier-ignore\nexport type NumberLineWidget = WidgetOptions<'number-line', PerseusNumberLineWidgetOptions>;\n// prettier-ignore\nexport type NumericInputWidget = WidgetOptions<'numeric-input', PerseusNumericInputWidgetOptions>;\n// prettier-ignore\nexport type OrdererWidget = WidgetOptions<'orderer', PerseusOrdererWidgetOptions>;\n// prettier-ignore\nexport type PassageRefWidget = WidgetOptions<'passage-ref', PerseusPassageRefWidgetOptions>;\n// prettier-ignore\nexport type PassageWidget = WidgetOptions<'passage', PerseusPassageWidgetOptions>;\n// prettier-ignore\nexport type PhetSimulationWidget = WidgetOptions<'phet-simulation', PerseusPhetSimulationWidgetOptions>;\n// prettier-ignore\nexport type PlotterWidget = WidgetOptions<'plotter', PerseusPlotterWidgetOptions>;\n// prettier-ignore\nexport type PythonProgramWidget = WidgetOptions<'python-program', PerseusPythonProgramWidgetOptions>;\n// prettier-ignore\nexport type RadioWidget = WidgetOptions<'radio', PerseusRadioWidgetOptions>;\n// prettier-ignore\nexport type SorterWidget = WidgetOptions<'sorter', PerseusSorterWidgetOptions>;\n// prettier-ignore\nexport type TableWidget = WidgetOptions<'table', PerseusTableWidgetOptions>;\n// prettier-ignore\nexport type InputNumberWidget = WidgetOptions<'input-number', PerseusInputNumberWidgetOptions>;\n// prettier-ignore\nexport type MoleculeRendererWidget = WidgetOptions<'molecule-renderer', PerseusMoleculeRendererWidgetOptions>;\n// prettier-ignore\nexport type RefTargetWidget = WidgetOptions<'passage-ref-target', PerseusPassageRefTargetWidgetOptions>;\n// prettier-ignore\nexport type VideoWidget = WidgetOptions<'video', PerseusVideoWidgetOptions>;\n//prettier-ignore\nexport type DeprecatedStandinWidget = WidgetOptions<'deprecated-standin', object>;\n\n/**\n * A background image applied to various widgets.\n */\nexport type PerseusImageBackground = {\n // The URL of the image\n url: string | null | undefined;\n // The width of the image\n width?: number;\n // The height of the image\n height?: number;\n // The top offset of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n top?: number;\n // The left offset of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n left?: number;\n // The scale of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n scale?: number;\n // The bottom offset of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n bottom?: number;\n};\n\n/**\n * The type of markings to display on the graph.\n * - axes: shows the axes without the gride lines\n * - graph: shows the axes and the grid lines\n * - grid: shows only the grid lines\n * - none: shows no markings\n */\nexport type MarkingsType = \"axes\" | \"graph\" | \"grid\" | \"none\";\n\nexport type PerseusCategorizerWidgetOptions = {\n // Translatable text; a list of items to categorize. e.g. [\"banana\", \"yellow\", \"apple\", \"purple\", \"shirt\"]\n items: ReadonlyArray<string>;\n // Translatable text; a list of categories. e.g. [\"fruits\", \"colors\", \"clothing\"]\n categories: ReadonlyArray<string>;\n // Whether the items should be randemized\n randomizeItems: boolean;\n // Whether this widget is displayed with the results and immutable\n static: boolean;\n // The correct answers where index relates to the items and value relates to the category. e.g. [0, 1, 0, 1, 2]\n values: ReadonlyArray<number>;\n // Whether we should highlight i18n linter errors found on this widget\n highlightLint?: boolean;\n // Internal editor configuration. Can be ignored by consumers.\n linterContext?: PerseusLinterContext;\n};\n\nexport type PerseusLinterContext = {\n contentType: string;\n paths: ReadonlyArray<string>;\n stack: ReadonlyArray<string>;\n};\n\nexport type PerseusDefinitionWidgetOptions = {\n // Translatable text; the word to define. e.g. \"vertex\"\n togglePrompt: string;\n // Translatable text; the definition of the word. e.g. \"where 2 rays connect\"\n definition: string;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusDropdownWidgetOptions = {\n // A list of choices for the dropdown\n choices: ReadonlyArray<PerseusDropdownChoice>;\n // Translatable Text; placeholder text for a dropdown. e.g. \"Please select a fruit\"\n placeholder: string;\n // Always false. Not used for this widget\n static: boolean;\n // Translatable Text; visible label for the dropdown\n visibleLabel?: string;\n // Translatable Text; aria label that screen readers will read\n ariaLabel?: string;\n};\n\nexport type PerseusDropdownChoice = {\n // Translatable text; The text for the option. e.g. \"Banana\" or \"Orange\"\n content: string;\n // Whether this is the correct option or not\n correct: boolean;\n};\n\nexport type PerseusExplanationWidgetOptions = {\n // Translatable Text; The clickable text to expand an explanation. e.g. \"What is an apple?\"\n showPrompt: string;\n // Translatable Text; The cliclable text to hide an explanation. e.g. \"Thanks. I got it!\"\n hidePrompt: string;\n // Translatable Markdown; The explanation that is shown when showPrompt is clicked. e.g. \"An apple is a tasty fruit.\"\n explanation: string;\n // explanation fields can embed widgets. When they do, the details of the widgets are here.\n widgets: PerseusWidgetsMap;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type LegacyButtonSets = ReadonlyArray<\n | \"basic\"\n | \"basic+div\"\n | \"trig\"\n | \"prealgebra\"\n | \"logarithms\"\n | \"basic relations\"\n | \"advanced relations\"\n | \"scientific\"\n>;\n\nexport type PerseusExpressionWidgetOptions = {\n // The expression forms the answer may come in\n answerForms: ReadonlyArray<PerseusExpressionAnswerForm>;\n buttonSets: LegacyButtonSets;\n // Variables that can be used as functions. Default: [\"f\", \"g\", \"h\"]\n functions: ReadonlyArray<string>;\n // Use x for rendering multiplication instead of a center dot.\n times: boolean;\n // What extra keys need to be displayed on the keypad so that the\n // question can be answerable without a keyboard (ie mobile)\n // TODO: this is really ReadonlyArray<Key>\n extraKeys?: ReadonlyArray<KeypadKey>;\n // visible label associated with the MathQuill field\n visibleLabel?: string;\n // aria label for screen readers attached to MathQuill field\n ariaLabel?: string;\n // Controls when buttons for special characters are visible when using a\n // desktop browser. Defaults to \"focused\".\n // NOTE: This isn't listed in perseus-format.js or perseus_data.go, but\n // appears in item data in the datastore.\n buttonsVisible?: \"always\" | \"never\" | \"focused\";\n};\n\nexport const PerseusExpressionAnswerFormConsidered = [\n \"correct\",\n \"wrong\",\n \"ungraded\",\n] as const;\n\nexport type PerseusExpressionAnswerForm = {\n // The TeX form of the expression. e.g. \"x\\\\cdot3=y\"\n value: string;\n // The Answer expression must have the same form\n form: boolean;\n // The answer expression must be fully expanded and simplified\n simplify: boolean;\n // Whether the form is considered \"correct\", \"wrong\", or \"ungraded\"\n considered: (typeof PerseusExpressionAnswerFormConsidered)[number];\n // A key to identify the answer form in a list\n // NOTE: perseus-format.js says this is required even though it isn't necessary.\n key?: string;\n};\n\nexport type PerseusGradedGroupWidgetOptions = {\n // Translatable Text; A title to be displayed for the group.\n title: string;\n // Not used in Perseus (but is set in (en, pt) production data)\n hasHint?: boolean | null | undefined;\n // A section to define hints for the group.\n hint?: PerseusRenderer | null | undefined;\n // Translatable Markdown. May include widgets and images embedded.\n content: string;\n // See PerseusRenderer.widgets\n widgets: PerseusWidgetsMap;\n // Not used in Perseus\n widgetEnabled?: boolean | null | undefined;\n // Not used in Perseus\n immutableWidgets?: boolean | null | undefined;\n // See PerseusRenderer.images\n images: {\n [key: string]: PerseusImageDetail;\n };\n};\n\nexport type PerseusGradedGroupSetWidgetOptions = {\n // A list of Widget Groups\n gradedGroups: ReadonlyArray<PerseusGradedGroupWidgetOptions>;\n};\n\n// 2D range: xMin, xMax, yMin, yMax\nexport type GraphRange = [\n x: [min: number, max: number],\n y: [min: number, max: number],\n];\n\nexport type GrapherAnswerTypes =\n | {\n type: \"absolute_value\";\n // If `coords` is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [vertex: Coord, secondPoint: Coord];\n }\n | {\n type: \"exponential\";\n // Two points along the asymptote line. Usually (always?) a\n // horizontal or vertical line.\n asymptote: [Coord, Coord];\n // Two points along the exponential curve. One end of the curve\n // trends towards the asymptote.\n // If `coords` is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"linear\";\n // Two points along the straight line\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"logarithm\";\n // Two points along the asymptote line.\n asymptote: [Coord, Coord];\n // Two points along the logarithmic curve. One end of the curve\n // trends towards the asymptote.\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"quadratic\";\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [vertex: Coord, secondPoint: Coord];\n }\n | {\n type: \"sinusoid\";\n // Two points on the same slope in the sinusoid wave line.\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"tangent\";\n // Two points on the same slope in the tangent wave line.\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n };\n\nexport type PerseusGrapherWidgetOptions = {\n availableTypes: ReadonlyArray<\n | \"absolute_value\"\n | \"exponential\"\n | \"linear\"\n | \"logarithm\"\n | \"quadratic\"\n | \"sinusoid\"\n | \"tangent\"\n >;\n correct: GrapherAnswerTypes;\n graph: {\n backgroundImage: {\n bottom?: number;\n height?: number;\n left?: number;\n scale?: number;\n url?: string | null | undefined;\n width?: number;\n };\n box?: [number, number];\n editableSettings?: ReadonlyArray<\n \"graph\" | \"snap\" | \"image\" | \"measure\"\n >;\n gridStep?: [number, number];\n labels: [string, string];\n markings: MarkingsType;\n range: GraphRange;\n rulerLabel: \"\";\n rulerTicks: number;\n showProtractor?: boolean;\n showRuler?: boolean;\n showTooltips?: boolean;\n snapStep?: [number, number];\n step: [number, number];\n valid?: boolean | string;\n };\n};\n\nexport type PerseusGroupWidgetOptions = PerseusRenderer;\n\nexport type PerseusImageWidgetOptions = {\n // Translatable Markdown; Text to be shown for the title of the image\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n title?: string;\n // Translatable Markdown; Text to be shown in the caption section of an image\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n caption?: string;\n // Translatable Text; The alt text to be shown in the img.alt attribute\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n alt?: string;\n // The image details for the image to be displayed\n backgroundImage: PerseusImageBackground;\n // Always false. Not used for this widget\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n static?: boolean;\n // A list of labels to display on the image\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n labels?: ReadonlyArray<PerseusImageLabel>;\n // The range on the image render for labels\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n range?: [Interval, Interval];\n // The box on the image render for labels. The same as backgroundImage.width and backgroundImage.height\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n box?: Size;\n};\n\nexport type PerseusImageLabel = {\n // Translatable Text; The content of the label to display\n content: string;\n // The visual alignment of the label. default: \"center\"\n alignment: string;\n // The point on the image to display the label\n coordinates: ReadonlyArray<number>;\n};\n\nexport type PerseusInteractiveGraphWidgetOptions = {\n // Where the little black axis lines & labels (ticks) should render.\n // Also known as the tick step. default [1, 1]\n // NOTE(kevinb): perseus_data.go defines this as Array<number>\n step: [number, number];\n // Where the grid lines on the graph will render. default [1, 1]\n // NOTE(kevinb): perseus_data.go defines this as Array<number>\n gridStep?: [x: number, y: number];\n // Where the graph points will lock to when they are dragged. default [0.5, 0.5]\n // NOTE(kevinb): perseus_data.go defines this as Array<number>\n snapStep?: [x: number, y: number];\n // An optional image to use in the background\n backgroundImage?: PerseusImageBackground;\n /**\n * The type of markings to display on the graph.\n */\n markings: MarkingsType;\n // How to label the X and Y axis. default: [\"x\", \"y\"]\n labels?: ReadonlyArray<string>;\n // Whether to show the Protractor tool overlayed on top of the graph\n showProtractor: boolean;\n /**\n * Whether to show the Ruler tool overlayed on top of the graph.\n * @deprecated - no longer used by the InteractiveGraph widget. The\n * property is kept on this type to prevent its accidental reuse in future\n * features, since it may appear in production data.\n */\n showRuler?: boolean;\n // Whether to show tooltips on the graph\n showTooltips?: boolean;\n /**\n * The unit to show on the ruler. e.g. \"mm\", \"cm\", \"m\", \"km\", \"in\", \"ft\",\n * \"yd\", \"mi\".\n * @deprecated - no longer used by the InteractiveGraph widget. The\n * property is kept on this type to prevent its accidental reuse in future\n * features, since it may appear in production data.\n */\n rulerLabel?: string;\n /**\n * How many ticks to show on the ruler. e.g. 1, 2, 4, 8, 10, 16. Must be\n * an integer.\n * @deprecated - no longer used by the InteractiveGraph widget. The\n * property is kept on this type to prevent its accidental reuse in future\n * features, since it may appear in production data.\n */\n rulerTicks?: number;\n // The X and Y coordinate ranges for the view of the graph. default: [[-10, 10], [-10, 10]]\n // NOTE(kevinb): perseus_data.go defines this as Array<Array<number>>\n // TODO(kevinb): Add a transform function to interactive-graph.jsx to\n // rename `range` to `ranges` so that things are less confusing.\n range: GraphRange;\n // The type of graph\n graph: PerseusGraphType;\n // The correct kind of graph, if being used to select function type\n // TODO(LEMS-2344): make the type of `correct` more specific\n correct: PerseusGraphType;\n // Shapes (points, chords, etc) displayed on the graph that cannot\n // be moved by the user.\n lockedFigures?: ReadonlyArray<LockedFigure>;\n // Aria label that applies to the entire graph.\n fullGraphAriaLabel?: string;\n // Aria description that applies to the entire graph.\n fullGraphAriaDescription?: string;\n};\n\nexport const lockedFigureColorNames = [\n \"blue\",\n \"green\",\n \"grayH\",\n \"purple\",\n \"pink\",\n \"orange\",\n \"red\",\n] as const;\n\nexport type LockedFigureColor = (typeof lockedFigureColorNames)[number];\n\nexport const lockedFigureColors: Record<LockedFigureColor, string> = {\n blue: \"#3D7586\",\n green: \"#447A53\",\n grayH: \"#3B3D45\",\n purple: \"#594094\",\n pink: \"#B25071\",\n red: \"#D92916\",\n orange: \"#946700\",\n} as const;\n\nexport type LockedFigure =\n | LockedPointType\n | LockedLineType\n | LockedVectorType\n | LockedEllipseType\n | LockedPolygonType\n | LockedFunctionType\n | LockedLabelType;\nexport type LockedFigureType = LockedFigure[\"type\"];\n\nexport type LockedLineStyle = \"solid\" | \"dashed\";\n\nexport type LockedPointType = {\n type: \"point\";\n coord: Coord;\n color: LockedFigureColor;\n filled: boolean;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedLineType = {\n type: \"line\";\n kind: \"line\" | \"ray\" | \"segment\";\n points: [point1: LockedPointType, point2: LockedPointType];\n color: LockedFigureColor;\n lineStyle: LockedLineStyle;\n showPoint1: boolean;\n showPoint2: boolean;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedVectorType = {\n type: \"vector\";\n points: [tail: Coord, tip: Coord];\n color: LockedFigureColor;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedFigureFillType = \"none\" | \"white\" | \"translucent\" | \"solid\";\nexport const lockedFigureFillStyles: Record<LockedFigureFillType, number> = {\n none: 0,\n white: 1,\n translucent: 0.4,\n solid: 1,\n} as const;\n\nexport type LockedEllipseType = {\n type: \"ellipse\";\n center: Coord;\n radius: [x: number, y: number];\n angle: number;\n color: LockedFigureColor;\n fillStyle: LockedFigureFillType;\n strokeStyle: LockedLineStyle;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedPolygonType = {\n type: \"polygon\";\n points: ReadonlyArray<Coord>;\n color: LockedFigureColor;\n showVertices: boolean;\n fillStyle: LockedFigureFillType;\n strokeStyle: LockedLineStyle;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedFunctionType = {\n type: \"function\";\n color: LockedFigureColor;\n strokeStyle: LockedLineStyle;\n /**\n * This is the user-defined equation (as it was typed)\n */\n equation: string;\n /**\n * The independent variable of this function\n */\n directionalAxis: \"x\" | \"y\";\n /**\n * The minimum and maximum values along the `directionalAxis` at which\n * this function should be graphed. Values of -Infinity and Infinity are\n * allowed. Note that infinite values are serialized as `null` in JSON.\n */\n domain: [min: number, max: number];\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\n// Not associated with a specific figure\nexport type LockedLabelType = {\n type: \"label\";\n coord: Coord;\n // TeX-supported string\n text: string;\n color: LockedFigureColor;\n size: \"small\" | \"medium\" | \"large\";\n};\n\nexport type PerseusGraphType =\n | PerseusGraphTypeAngle\n | PerseusGraphTypeCircle\n | PerseusGraphTypeLinear\n | PerseusGraphTypeLinearSystem\n | PerseusGraphTypeNone\n | PerseusGraphTypePoint\n | PerseusGraphTypePolygon\n | PerseusGraphTypeQuadratic\n | PerseusGraphTypeRay\n | PerseusGraphTypeSegment\n | PerseusGraphTypeSinusoid;\n\ntype PerseusGraphTypeCommon = {\n // NOTE(jeremy): This is referenced in the component. Verify if there's any\n // production data that still has this.\n coord?: Coord; // Legacy!\n};\n\nexport type PerseusGraphTypeAngle = {\n type: \"angle\";\n // Whether to show the angle measurements. default: false\n showAngles?: boolean;\n // Allow Reflex Angles if an \"angle\" type. default: true\n allowReflexAngles?: boolean;\n // The angle offset in degrees if an \"angle\" type. default: 0\n angleOffsetDeg?: number;\n // Snap to degree increments if an \"angle\" type. default: 1\n snapDegrees?: number;\n // How to match the answer. If missing, defaults to exact matching.\n match?: \"congruent\";\n // must have 3 coords - ie [Coord, Coord, Coord]\n coords?: [Coord, Coord, Coord] | null;\n // The initial coordinates the graph renders with.\n startCoords?: [Coord, Coord, Coord];\n};\n\nexport type PerseusGraphTypeCircle = {\n type: \"circle\";\n center?: Coord;\n radius?: number;\n // The initial coordinates the graph renders with.\n startCoords?: {\n center: Coord;\n radius: number;\n };\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeLinear = {\n type: \"linear\";\n // expects 2 coords\n coords?: CollinearTuple | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeLinearSystem = {\n type: \"linear-system\";\n // expects 2 sets of 2 coords\n coords?: CollinearTuple[] | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple[];\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeNone = {\n type: \"none\";\n};\n\nexport type PerseusGraphTypePoint = {\n type: \"point\";\n // The number of points if a \"point\" type. default: 1. \"unlimited\" if no limit\n numPoints?: number | \"unlimited\";\n coords?: ReadonlyArray<Coord> | null;\n // The initial coordinates the graph renders with.\n startCoords?: ReadonlyArray<Coord>;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypePolygon = {\n type: \"polygon\";\n // The number of sides. default: 3. \"unlimited\" if no limit\n numSides?: number | \"unlimited\";\n // Whether to the angle measurements. default: false\n showAngles?: boolean;\n // Whether to show side measurements. default: false\n showSides?: boolean;\n // How to snap points. e.g. \"grid\", \"angles\", or \"sides\". default: grid\n snapTo?: \"grid\" | \"angles\" | \"sides\";\n // How to match the answer. If missing, defaults to exact matching.\n match?: \"similar\" | \"congruent\" | \"approx\" | \"exact\";\n coords?: ReadonlyArray<Coord> | null;\n // The initial coordinates the graph renders with.\n startCoords?: ReadonlyArray<Coord>;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeQuadratic = {\n type: \"quadratic\";\n // expects a list of 3 coords\n coords?: [Coord, Coord, Coord] | null;\n // The initial coordinates the graph renders with.\n startCoords?: [Coord, Coord, Coord];\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeSegment = {\n type: \"segment\";\n // The number of segments if a \"segment\" type. default: 1. Max: 6\n numSegments?: number;\n // Expects a list of Coord tuples. Length should match the `numSegments` value.\n coords?: CollinearTuple[] | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple[];\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeSinusoid = {\n type: \"sinusoid\";\n // Expects a list of 2 Coords\n coords?: ReadonlyArray<Coord> | null;\n // The initial coordinates the graph renders with.\n startCoords?: ReadonlyArray<Coord>;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeRay = {\n type: \"ray\";\n // Expects a list of 2 Coords\n coords?: CollinearTuple | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple;\n} & PerseusGraphTypeCommon;\n\ntype AngleGraphCorrect = {\n type: \"angle\";\n allowReflexAngles: boolean;\n match?: \"congruent\";\n coords: [Coord, Coord, Coord];\n};\n\ntype CircleGraphCorrect = {\n type: \"circle\";\n center: Coord;\n radius: number;\n};\n\ntype LinearGraphCorrect = {\n type: \"linear\";\n coords: CollinearTuple;\n};\n\ntype LinearSystemGraphCorrect = {\n type: \"linear-system\";\n coords: [CollinearTuple, CollinearTuple];\n};\n\ntype NoneGraphCorrect = {\n type: \"none\";\n};\n\ntype PointGraphCorrect = {\n type: \"point\";\n coords: ReadonlyArray<Coord>;\n};\n\ntype PolygonGraphCorrect = {\n type: \"polygon\";\n match: \"similar\" | \"congruent\" | \"approx\";\n coords: ReadonlyArray<Coord>;\n};\n\ntype QuadraticGraphCorrect = {\n type: \"quadratic\";\n coords: [Coord, Coord, Coord];\n};\n\ntype SegmentGraphCorrect = {\n type: \"segment\";\n coords: CollinearTuple[];\n};\n\ntype SinusoidGraphCorrect = {\n type: \"sinusoid\";\n coords: CollinearTuple;\n};\n\ntype RayGraphCorrect = {\n type: \"ray\";\n coords: CollinearTuple;\n};\n\nexport type PerseusGraphCorrectType =\n | AngleGraphCorrect\n | CircleGraphCorrect\n | LinearGraphCorrect\n | LinearSystemGraphCorrect\n | NoneGraphCorrect\n | PointGraphCorrect\n | PolygonGraphCorrect\n | QuadraticGraphCorrect\n | RayGraphCorrect\n | SegmentGraphCorrect\n | SinusoidGraphCorrect;\n\nexport type PerseusLabelImageWidgetOptions = {\n // Translatable Text; Tex representation of choices\n choices: ReadonlyArray<string>;\n // The URL of the image\n imageUrl: string;\n // Translatable Text; To show up in the img.alt attribute\n imageAlt: string;\n // The height of the image\n imageHeight: number;\n // The width of the image\n imageWidth: number;\n // A list of markers to display on the image\n markers: ReadonlyArray<PerseusLabelImageMarker>;\n // Do not display answer choices in instructions\n hideChoicesFromInstructions: boolean;\n // Allow multiple answers per marker\n multipleAnswers: boolean;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusLabelImageMarker = {\n // A list of correct answers for this marker. Often only one but can have multiple\n answers: ReadonlyArray<string>;\n // Translatable Text; The text to show for the marker. Not displayed directly to the user\n label: string;\n // X Coordiate location of the marker on the image\n x: number;\n // Y Coordinate location of the marker on the image\n y: number;\n};\n\nexport type PerseusMatcherWidgetOptions = {\n // Translatable Text; Labels to adorn the headings for the columns. Only 2 values [left, right]. e.g. [\"Concepts\", \"Things\"]\n labels: ReadonlyArray<string>;\n // Translatable Text; Static concepts to show in the left column. e.g. [\"Fruit\", \"Color\", \"Clothes\"]\n left: ReadonlyArray<string>;\n // Translatable Markup; Values that represent the concepts to be correlated with the concepts. e.g. [\"Red\", \"Shirt\", \"Banana\"]\n right: ReadonlyArray<string>;\n // Order of the matched pairs matters. With this option enabled, only the order provided above will be treated as correct. This is useful when ordering is significant, such as in the context of a proof. If disabled, pairwise matching is sufficient. To make this clear, the left column becomes fixed in the provided order and only the cards in the right column can be moved.\n orderMatters: boolean;\n // Adds padding to the rows. Padding is good for text, but not needed for images.\n padding: boolean;\n};\n\nexport type PerseusMatrixWidgetAnswers = ReadonlyArray<ReadonlyArray<number>>;\nexport type PerseusMatrixWidgetOptions = {\n // Translatable Text; Shown before the matrix\n prefix?: string | undefined;\n // Translatable Text; Shown after the matrix\n suffix?: string | undefined;\n // A data matrix representing the \"correct\" answers to be entered into the matrix\n answers: PerseusMatrixWidgetAnswers;\n // The coordinate location of the cursor position at start. default: [0, 0]\n cursorPosition?: ReadonlyArray<number> | undefined;\n // The coordinate size of the matrix. Only supports 2-dimensional matrix. default: [3, 3]\n matrixBoardSize: ReadonlyArray<number>;\n // Whether this is meant to statically display the answers (true) or be used as an input field, graded against the answers\n static?: boolean | undefined;\n};\n\nexport type PerseusMeasurerWidgetOptions = {\n // The image that the user is meant to measure\n image: PerseusImageBackground;\n // Whether to show the Protractor tool overlayed on top of the image\n showProtractor: boolean;\n // Whether to show the Ruler tool overlayed on top of the image\n showRuler: boolean;\n // The unit to show on the ruler. e.g. \"mm\", \"cm\", \"m\", \"km\", \"in\", \"ft\", \"yd\", \"mi\"\n rulerLabel: string;\n // How many ticks to show on the ruler. e.g. 1, 2, 4, 8, 10, 16\n rulerTicks: number;\n // The number of image pixels per unit (label)\n rulerPixels: number;\n // The number of units to display on the ruler\n rulerLength: number;\n // Containing area [width, height]\n box: [number, number];\n // TODO(benchristel): static is not used. Remove it?\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type MathFormat =\n | \"integer\"\n | \"mixed\"\n | \"improper\"\n | \"proper\"\n | \"decimal\"\n | \"percent\"\n | \"pi\";\n\nexport type PerseusNumericInputAnswerForm = {\n simplify: PerseusNumericInputSimplify | null | undefined;\n name: MathFormat;\n};\n\nexport type PerseusNumericInputSimplify =\n | \"required\"\n | \"correct\"\n | \"enforced\"\n | \"optional\";\n\nexport type PerseusNumericInputWidgetOptions = {\n // A list of all the possible correct and incorrect answers\n answers: ReadonlyArray<PerseusNumericInputAnswer>;\n // Translatable Text; Text to describe this input. This will be shown to users using screenreaders.\n labelText?: string | undefined;\n // Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them. Options: \"normal\" or \"small\"\n size: string;\n // A coefficient style number allows the student to use - for -1 and an empty string to mean 1.\n coefficient: boolean;\n // Whether to right-align the text or not\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n rightAlign?: boolean;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusNumericInputAnswer = {\n // Translatable Display; A description for why this answer is correct, wrong, or ungraded\n message: string;\n // The expected answer\n value?: number | null;\n // Whether this answer is \"correct\", \"wrong\", or \"ungraded\"\n status: string;\n // The forms available for this answer. Options: \"integer, \"\"decimal\", \"proper\", \"improper\", \"mixed\", or \"pi\"\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n answerForms?: ReadonlyArray<MathFormat>;\n // Whether we should check the answer strictly against the the configured answerForms (strict = true)\n // or include the set of default answerForms (strict = false).\n strict: boolean;\n // A range of error +/- the value\n // NOTE: perseus_data.go says this is non-nullable even though we handle null values.\n maxError: number | null | undefined;\n // Unsimplified answers are Ungraded, Accepted, or Wrong. Options: \"required\", \"correct\", or \"enforced\"\n simplify: PerseusNumericInputSimplify | null | undefined;\n};\n\nexport type PerseusNumberLineWidgetOptions = {\n // The position of the endpoints of the number line. Setting the range constrains the position of the answer and the labels.\n range: ReadonlyArray<number>;\n // This controls the position of the left / right labels. By default, the labels are set by the range. Note: Ensure that the labels line up with the tick marks, or it may be confusing for users.\n labelRange: ReadonlyArray<number | null>;\n // This controls the styling of the labels for the two main labels as well as all the tick mark labels, if applicable. Options: \"decimal\", \"improper\", \"mixed\", \"non-reduced\"\n labelStyle: string;\n // Show label ticks\n labelTicks: boolean;\n // Show tick controller\n isTickCtrl?: boolean | null | undefined;\n // The range of divisions within the line\n divisionRange: ReadonlyArray<number>;\n // This controls the number (and position) of the tick marks. The number of divisions is constrained to the division range. Note: The user will be able to specify the number of divisions in a number input.\n numDivisions: number | null | undefined;\n // This determines the number of different places the point will snap between two adjacent tick marks. Note: Ensure the required number of snap increments is provided to answer the question.\n snapDivisions: number;\n // This controls the number (and position) of the tick marks; you can either set the number of divisions (2 divisions would split the entire range in two halves), or the tick step (the distance between ticks) and the other value will be updated accordingly. Note: There is no check to see if labels coordinate with the tick marks, which may be confusing for users if the blue labels and black ticks are off-step.\n tickStep: number | null | undefined;\n // The correct relative value. default: \"eq\". options: \"eq\", \"lt\", \"gt\", \"le\", \"ge\"\n correctRel: string | null | undefined;\n // This is the correct answer. The answer is validated (as right or wrong) by using only the end position of the point and the relation (=, <, >, ≤, ≥).\n correctX: number | null;\n // This controls the initial position of the point along the number line\n initialX: number | null | undefined;\n // Show tooltips\n showTooltips?: boolean;\n // When true, the answer is displayed and is immutable\n static: boolean;\n};\n\nexport type PerseusOrdererWidgetOptions = {\n // All of the options available to the user. Place the cards in the correct order. The same card can be used more than once in the answer but will only be displayed once at the top of a stack of identical cards.\n options: ReadonlyArray<PerseusRenderer>;\n // The correct order of the options\n correctOptions: ReadonlyArray<PerseusRenderer>;\n // Cards that are not part of the answer\n otherOptions: ReadonlyArray<PerseusRenderer>;\n // \"normal\" for text options. \"auto\" for image options.\n height: \"normal\" | \"auto\";\n // Use the \"horizontal\" layout for short text and small images. The \"vertical\" layout is best for longer text (e.g. proofs).\n layout: \"horizontal\" | \"vertical\";\n};\n\nexport type PerseusPassageWidgetOptions = {\n // Translatable Text; To add footnotes, add ^ characters where they belong in the passage. Then, add ^ in the footnotes area to reference the footnotes in the passage.\n footnotes: string;\n // Translatable Text; The text of the passage\n passageText: string;\n // translatableText - An optional title that will appear directly above the passage in the same font style. (e.g. Passage 1)\n passageTitle: string;\n // Should we show line numbers along with the passage?\n showLineNumbers: boolean;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusPassageRefWidgetOptions = {\n // The passage number\n passageNumber: number;\n // The reference number\n referenceNumber: number;\n // Short summary of the referenced section. This will be included in parentheses and quotes automatically.\n summaryText?: string;\n};\n\nexport const plotterPlotTypes = [\n \"bar\",\n \"line\",\n \"pic\",\n \"histogram\",\n \"dotplot\",\n] as const;\nexport type PlotType = (typeof plotterPlotTypes)[number];\n\nexport type PerseusPlotterWidgetOptions = {\n // Translatable Text; The Axis labels. e.g. [\"X Label\", \"Y Label\"]\n labels: ReadonlyArray<string>;\n // Translatable Text; Categories to display along the X access. e.g. [\">0\", \">6\", \">12\", \">18\"]\n categories: ReadonlyArray<string>;\n // The type of the graph. options \"bar\", \"line\", \"pic\", \"histogram\", \"dotplot\"\n type: PlotType;\n // The maximimum Y tick to display in the graph\n maxY: number;\n // The scale of the Y Axis\n scaleY: number;\n // Which ticks to display the labels for. For instance, setting this to \"4\" will only show every 4th label (plus the last one)\n labelInterval: number | null | undefined;\n // Creates the specified number of divisions between the horizontal lines. Fewer snaps between lines makes the graph easier for the student to create correctly.\n snapsPerLine: number;\n // The Y values the graph should start with\n starting: ReadonlyArray<number>;\n // The Y values that represent the correct answer expected\n correct: ReadonlyArray<number>;\n // A picture to represent items in a graph.\n picUrl: string | null | undefined;\n // deprecated\n picSize: number | null | undefined;\n // deprecated\n picBoxHeight: number | null | undefined;\n // deprecated\n plotDimensions: ReadonlyArray<number>;\n};\n\nexport type PerseusRadioWidgetOptions = {\n // The choices provided to the user.\n choices: ReadonlyArray<PerseusRadioChoice>;\n // Does this have a \"none of the above\" option?\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n hasNoneOfTheAbove?: boolean;\n // If multipleSelect is enabled, Specify the number expected to be correct.\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n countChoices?: boolean;\n // How many of the choices are correct, which is conditionally used to tell\n // learners ahead of time how many options they'll need.\n numCorrect?: number;\n // Randomize the order of the options or keep them as defined\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n randomize?: boolean;\n // Does this set allow for multiple selections to be correct?\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n multipleSelect?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n deselectEnabled?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n onePerLine?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n displayCount?: any;\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove?: false;\n};\n\nexport type PerseusRadioChoice = {\n // Translatable Markdown; The label for this choice\n content: string;\n // Translatable Markdown; A clue to give the user when they get it wrong\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n clue?: string;\n // Whether this option is a correct answer or not\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n correct?: boolean;\n // If this is none of the above, override the content with \"None of the above\"\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n isNoneOfTheAbove?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n widgets?: PerseusWidgetsMap;\n};\n\nexport type PerseusSorterWidgetOptions = {\n // Translatable Text; The correct answer (in the correct order). The user will see the cards in a randomized order.\n correct: ReadonlyArray<string>;\n // Adds padding to the options. Padding is good for text but not needed for images\n padding: boolean;\n // Use the \"horizontal\" layout for short text and small images. The \"vertical\" layout is best for longer text and larger images.\n layout: \"horizontal\" | \"vertical\";\n};\n\nexport type PerseusTableWidgetOptions = {\n // Translatable Text; A list of column headers\n headers: ReadonlyArray<string>;\n // The number of rows to display\n rows: number;\n // The number of columns to display\n columns: number;\n // Translatable Text; A 2-dimensional array of text to populate the table with\n answers: ReadonlyArray<ReadonlyArray<string>>;\n};\n\nexport type PerseusInteractionWidgetOptions = {\n // The definition of the graph\n graph: PerseusInteractionGraph;\n // The elements of the graph\n elements: ReadonlyArray<PerseusInteractionElement>;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusInteractionGraph = {\n // \"canvas\", \"graph\"\n editableSettings?: ReadonlyArray<\"canvas\" | \"graph\">;\n // The Grid Canvas size. e.g. [400, 140]\n box: Size;\n // The Axis labels. e.g. [\"x\", \"y\"]\n labels: ReadonlyArray<string>;\n // The Axis ranges. e.g. [[-10, 10], [-10, 10]]\n range: [Interval, Interval];\n // The steps in the grid. default [1, 1]\n gridStep: [number, number];\n /**\n * The type of markings to display on the graph.\n */\n markings: MarkingsType;\n // The snap steps. default [0.5, 0.5]\n snapStep?: [number, number];\n // Whether the grid is valid or not. Do the numbers all make sense?\n // NOTE(jeremy) The editor for this widget sometimes stores the graph\n // editor validation error message into this field. It seems innocuous\n // because it looks like many of these usages don't actually use the graph\n // at all.\n valid?: boolean | string;\n // An optional background image to use\n backgroundImage?: PerseusImageBackground;\n // Whether to show the Protractor tool overlayed on top of the graph\n showProtractor?: boolean;\n // Whether to show the Ruler tool overlayed on top of the graph\n showRuler?: boolean;\n // The unit to show on the ruler. e.g. \"mm\", \"cm\", \"m\", \"km\", \"in\", \"ft\", \"yd\", \"mi\"\n rulerLabel?: string;\n // How many ticks to show on the ruler. e.g. 1, 2, 4, 8, 10, 16\n rulerTicks?: number;\n // This controls the number (and position) of the tick marks for the X and Y axis. e.g. [1, 1]\n tickStep: [number, number];\n};\n\nexport type PerseusInteractionElement =\n | {\n type: \"function\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionFunctionElementOptions;\n }\n | {\n type: \"label\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionLabelElementOptions;\n }\n | {\n type: \"line\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionLineElementOptions;\n }\n | {\n type: \"movable-line\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionMovableLineElementOptions;\n }\n | {\n type: \"movable-point\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionMovablePointElementOptions;\n }\n | {\n type: \"parametric\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionParametricElementOptions;\n }\n | {\n type: \"point\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionPointElementOptions;\n }\n | {\n type: \"rectangle\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionRectangleElementOptions;\n };\n\nexport type PerseusInteractionFunctionElementOptions = {\n // The definition of the function to draw on the graph. e.g \"x^2 + 1\"\n value: string;\n // The name of the function like f(n). default: \"f\"\n funcName: string;\n // The range of points to start plotting\n rangeMin: string;\n // The range of points to end plotting\n rangeMax: string;\n // The color of the stroke. e.g. #6495ED\n color: string;\n // If the function stroke has a dash, what is it? options: \"\", \"-\", \"- \", \".\", \". \"\n strokeDasharray: string;\n // The thickness of the stroke\n strokeWidth: number;\n};\n\nexport type PerseusInteractionLabelElementOptions = {\n // Translatable Text; the content of the label\n label: string;\n // The color of the label. e.g. \"red\"\n color: string;\n // The X location of the label\n coordX: string;\n // The Y location of the label\n coordY: string;\n};\n\nexport type PerseusInteractionLineElementOptions = {\n // A color code for the line segment. e.g. \"#FFOOAF\"\n color: string;\n // The start of the line segment (X)\n startX: string;\n // The start of the line segment (Y)\n startY: string;\n // The end of the line segment (X)\n endX: string;\n // The end of the line segment (Y)\n endY: string;\n // If the line stroke has a dash, what is it? options: \"\", \"-\", \"- \", \".\", \". \"\n strokeDasharray: string;\n // The thickness of the line\n strokeWidth: number;\n // Does the line have an arrow point to it? options: \"\", \"->\"\n arrows: string;\n};\n\nexport type PerseusInteractionMovableLineElementOptions = {\n // The start of the line segment (X)\n startX: string;\n // The start of the line segment (Y)\n startY: string;\n // Start updates (Xn, Yn) for n\n startSubscript: number;\n // The end of the line segment (X)\n endX: string;\n // The end of the line segment (Y)\n endY: string;\n // End updates (Xm, Ym) for m\n endSubscript: number;\n // How to constrain this line? options \"none\", \"snap\", \"x\", \"y\"\n constraint: string;\n // The snap resolution when constraint is set to \"snap\"\n snap: number;\n // The constraint function for when constraint is set to \"x\" or \"y\"\n constraintFn: string;\n // The lowest possible X value\n constraintXMin: string;\n // The highest possible X value\n constraintXMax: string;\n // The lowest possible Y value\n constraintYMin: string;\n // The highest possible Y value\n constraintYMax: string;\n};\n\nexport type PerseusInteractionMovablePointElementOptions = {\n // The X position of the point\n startX: string;\n // The Y position of the point\n startY: string;\n // Update (Xn, Yn) for n\n varSubscript: number;\n // How to constrain this line? options \"none\", \"snap\", \"x\", \"y\"\n constraint: string;\n // The snap resolution when constraint is set to \"snap\"\n snap: number;\n // The constraint function for when constraint is set to \"x\" or \"y\"\n constraintFn: string;\n // The lowest possible X value\n constraintXMin: string;\n // The highest possible X value\n constraintXMax: string;\n // The lowest possible Y value\n constraintYMin: string;\n // The highest possible Y value\n constraintYMax: string;\n};\n\nexport type PerseusInteractionParametricElementOptions = {\n // The function for the X coordinate. e.g. \"\\\\cos(t)\"\n x: string;\n // The function for the Y coordinate. e.g. \"\\\\sin(t)\"\n y: string;\n // The range of points to start plotting\n rangeMin: string;\n // The range of points to end plotting\n rangeMax: string;\n // The color of the stroke. e.g. #6495ED\n color: string;\n // If the function stroke has a dash, what is it? options: \"\", \"-\", \"- \", \".\", \". \"\n strokeDasharray: string;\n // The thickness of the stroke\n strokeWidth: number;\n};\n\nexport type PerseusInteractionPointElementOptions = {\n // The color of the point. e.g. \"black\"\n color: string;\n // The X coordinate of the point\n coordX: string;\n // The Y coordinate of the point\n coordY: string;\n};\n\nexport type PerseusInteractionRectangleElementOptions = {\n // The fill color. e.g. \"#EDD19B\"\n color: string;\n // The lower left point X\n coordX: string;\n // The lower left point Y\n coordY: string;\n // The width of the rectangle\n width: string;\n // The height of the rectangle\n height: string;\n};\n\nexport type PerseusCSProgramWidgetOptions = {\n // The ID of the CS program to embed\n programID: string;\n // Deprecated. Always null and sometimes omitted entirely.\n programType?: any;\n // Settings that you add here are available to the program as an object returned by Program.settings()\n settings: ReadonlyArray<PerseusCSProgramSetting>;\n // If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor.\n showEditor: boolean;\n // Whether to show the execute buttons\n showButtons: boolean;\n // The height of the widget\n height: number;\n // TODO(benchristel): static is not used. Delete it?\n // Always false\n static: boolean;\n};\n\nexport type PerseusCSProgramSetting = {\n // The name/key of the setting\n name: string;\n // The value of the setting\n value: string;\n};\n\nexport type PerseusPythonProgramWidgetOptions = {\n // The ID of the Python program to embed\n programID: string;\n // The height of the widget in pixels\n height: number;\n};\n\nexport type PerseusIFrameWidgetOptions = {\n // A URL to display OR a CS Program ID\n url: string;\n // Settings that you add here are available to the program as an object returned by Program.settings()\n settings?: ReadonlyArray<PerseusCSProgramSetting>;\n // The width of the widget\n width: number | string;\n // The height of the widget\n height: number | string;\n // Whether to allow the IFrame to become full-screen (like a video)\n allowFullScreen: boolean;\n // Whether to allow the iframe content to redirect the page\n allowTopNavigation?: boolean;\n // Always false\n static: boolean;\n};\n\nexport type PerseusPhetSimulationWidgetOptions = {\n // A URL to display, must start with https://phet.colorado.edu/\n url: string;\n // Translatable Text; Description of the sim for Khanmigo and alt text\n description: string;\n};\n\nexport type PerseusVideoWidgetOptions = {\n location: string;\n static?: boolean;\n};\n\nexport type PerseusInputNumberWidgetOptions = {\n answerType?:\n | \"number\"\n | \"decimal\"\n | \"integer\"\n | \"rational\"\n | \"improper\"\n | \"mixed\"\n | \"percent\"\n | \"pi\";\n inexact?: boolean;\n maxError?: number | string;\n rightAlign?: boolean;\n simplify: \"required\" | \"optional\" | \"enforced\";\n size: \"normal\" | \"small\";\n value: string | number;\n customKeypad?: boolean;\n};\n\nexport type PerseusMoleculeRendererWidgetOptions = {\n widgetId: string;\n rotationAngle?: number;\n smiles?: string;\n};\n\nexport type PerseusPassageRefTargetWidgetOptions = {\n content: string;\n};\n\nexport type PerseusWidgetOptions =\n | PerseusCategorizerWidgetOptions\n | PerseusCSProgramWidgetOptions\n | PerseusDefinitionWidgetOptions\n | PerseusDropdownWidgetOptions\n | PerseusExplanationWidgetOptions\n | PerseusExpressionWidgetOptions\n | PerseusGradedGroupSetWidgetOptions\n | PerseusGradedGroupWidgetOptions\n | PerseusIFrameWidgetOptions\n | PerseusImageWidgetOptions\n | PerseusInputNumberWidgetOptions\n | PerseusInteractionWidgetOptions\n | PerseusInteractiveGraphWidgetOptions\n | PerseusLabelImageWidgetOptions\n | PerseusMatcherWidgetOptions\n | PerseusMatrixWidgetOptions\n | PerseusMeasurerWidgetOptions\n | PerseusMoleculeRendererWidgetOptions\n | PerseusNumberLineWidgetOptions\n | PerseusNumericInputWidgetOptions\n | PerseusOrdererWidgetOptions\n | PerseusPassageRefTargetWidgetOptions\n | PerseusPassageRefWidgetOptions\n | PerseusPassageWidgetOptions\n | PerseusPhetSimulationWidgetOptions\n | PerseusPlotterWidgetOptions\n | PerseusRadioWidgetOptions\n | PerseusSorterWidgetOptions\n | PerseusTableWidgetOptions\n | PerseusVideoWidgetOptions;\n","import {lockedFigureColorNames} from \"../../data-schema\";\nimport {\n array,\n boolean,\n constant,\n enumeration,\n nullable,\n number,\n object,\n optional,\n pair,\n string,\n trio,\n union,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {discriminatedUnionOn} from \"../general-purpose-parsers/discriminated-union\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {\n InteractiveGraphWidget,\n LockedEllipseType,\n LockedFigure,\n LockedFigureColor,\n LockedFigureFillType,\n LockedFunctionType,\n LockedLabelType,\n LockedLineStyle,\n LockedLineType,\n LockedPointType,\n LockedPolygonType,\n LockedVectorType,\n PerseusGraphType,\n PerseusGraphTypeAngle,\n PerseusGraphTypeCircle,\n PerseusGraphTypeLinear,\n PerseusGraphTypeLinearSystem,\n PerseusGraphTypeNone,\n PerseusGraphTypePoint,\n PerseusGraphTypePolygon,\n PerseusGraphTypeQuadratic,\n PerseusGraphTypeRay,\n PerseusGraphTypeSegment,\n PerseusGraphTypeSinusoid,\n} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\n// Used to represent 2-D points and ranges\nconst pairOfNumbers = pair(number, number);\n\nconst parsePerseusGraphTypeAngle: Parser<PerseusGraphTypeAngle> = object({\n type: constant(\"angle\"),\n showAngles: optional(boolean),\n allowReflexAngles: optional(boolean),\n angleOffsetDeg: optional(number),\n snapDegrees: optional(number),\n match: optional(constant(\"congruent\")),\n coords: optional(trio(pairOfNumbers, pairOfNumbers, pairOfNumbers)),\n startCoords: optional(trio(pairOfNumbers, pairOfNumbers, pairOfNumbers)),\n});\n\nconst parsePerseusGraphTypeCircle: Parser<PerseusGraphTypeCircle> = object({\n type: constant(\"circle\"),\n center: optional(pairOfNumbers),\n radius: optional(number),\n startCoords: optional(\n object({\n center: pairOfNumbers,\n radius: number,\n }),\n ),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeLinear: Parser<PerseusGraphTypeLinear> = object({\n type: constant(\"linear\"),\n coords: optional(nullable(pair(pairOfNumbers, pairOfNumbers))),\n startCoords: optional(pair(pairOfNumbers, pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeLinearSystem: Parser<PerseusGraphTypeLinearSystem> =\n object({\n type: constant(\"linear-system\"),\n // TODO(benchristel): default coords to empty array?\n coords: optional(nullable(array(pair(pairOfNumbers, pairOfNumbers)))),\n startCoords: optional(array(pair(pairOfNumbers, pairOfNumbers))),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n });\n\nconst parsePerseusGraphTypeNone: Parser<PerseusGraphTypeNone> = object({\n type: constant(\"none\"),\n});\n\nconst parsePerseusGraphTypePoint: Parser<PerseusGraphTypePoint> = object({\n type: constant(\"point\"),\n numPoints: optional(union(number).or(constant(\"unlimited\")).parser),\n coords: optional(nullable(array(pairOfNumbers))),\n startCoords: optional(array(pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypePolygon: Parser<PerseusGraphTypePolygon> = object({\n type: constant(\"polygon\"),\n numSides: optional(union(number).or(constant(\"unlimited\")).parser),\n showAngles: optional(boolean),\n showSides: optional(boolean),\n snapTo: optional(enumeration(\"grid\", \"angles\", \"sides\")),\n match: optional(enumeration(\"similar\", \"congruent\", \"approx\", \"exact\")),\n startCoords: optional(array(pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeQuadratic: Parser<PerseusGraphTypeQuadratic> =\n object({\n type: constant(\"quadratic\"),\n coords: optional(\n nullable(trio(pairOfNumbers, pairOfNumbers, pairOfNumbers)),\n ),\n startCoords: optional(\n trio(pairOfNumbers, pairOfNumbers, pairOfNumbers),\n ),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n });\n\nconst parsePerseusGraphTypeRay: Parser<PerseusGraphTypeRay> = object({\n type: constant(\"ray\"),\n coords: optional(nullable(pair(pairOfNumbers, pairOfNumbers))),\n startCoords: optional(pair(pairOfNumbers, pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeSegment: Parser<PerseusGraphTypeSegment> = object({\n type: constant(\"segment\"),\n // TODO(benchristel): default numSegments?\n numSegments: optional(number),\n coords: optional(nullable(array(pair(pairOfNumbers, pairOfNumbers)))),\n startCoords: optional(array(pair(pairOfNumbers, pairOfNumbers))),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeSinusoid: Parser<PerseusGraphTypeSinusoid> = object({\n type: constant(\"sinusoid\"),\n coords: optional(nullable(array(pairOfNumbers))),\n startCoords: optional(array(pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphType: Parser<PerseusGraphType> = discriminatedUnionOn(\n \"type\",\n)\n .withBranch(\"angle\", parsePerseusGraphTypeAngle)\n .withBranch(\"circle\", parsePerseusGraphTypeCircle)\n .withBranch(\"linear\", parsePerseusGraphTypeLinear)\n .withBranch(\"linear-system\", parsePerseusGraphTypeLinearSystem)\n .withBranch(\"none\", parsePerseusGraphTypeNone)\n .withBranch(\"point\", parsePerseusGraphTypePoint)\n .withBranch(\"polygon\", parsePerseusGraphTypePolygon)\n .withBranch(\"quadratic\", parsePerseusGraphTypeQuadratic)\n .withBranch(\"ray\", parsePerseusGraphTypeRay)\n .withBranch(\"segment\", parsePerseusGraphTypeSegment)\n .withBranch(\"sinusoid\", parsePerseusGraphTypeSinusoid).parser;\n\nconst parseLockedFigureColor: Parser<LockedFigureColor> = enumeration(\n ...lockedFigureColorNames,\n);\n\nconst parseLockedFigureFillType: Parser<LockedFigureFillType> = enumeration(\n \"none\",\n \"white\",\n \"translucent\",\n \"solid\",\n);\n\nconst parseLockedLineStyle: Parser<LockedLineStyle> = enumeration(\n \"solid\",\n \"dashed\",\n);\n\nconst parseLockedLabelType: Parser<LockedLabelType> = object({\n type: constant(\"label\"),\n coord: pairOfNumbers,\n text: string,\n color: parseLockedFigureColor,\n size: enumeration(\"small\", \"medium\", \"large\"),\n});\n\nconst parseLockedPointType: Parser<LockedPointType> = object({\n type: constant(\"point\"),\n coord: pairOfNumbers,\n color: parseLockedFigureColor,\n filled: boolean,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedLineType: Parser<LockedLineType> = object({\n type: constant(\"line\"),\n kind: enumeration(\"line\", \"ray\", \"segment\"),\n points: pair(parseLockedPointType, parseLockedPointType),\n color: parseLockedFigureColor,\n lineStyle: parseLockedLineStyle,\n showPoint1: defaulted(boolean, () => false),\n showPoint2: defaulted(boolean, () => false),\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedVectorType: Parser<LockedVectorType> = object({\n type: constant(\"vector\"),\n points: pair(pairOfNumbers, pairOfNumbers),\n color: parseLockedFigureColor,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedEllipseType: Parser<LockedEllipseType> = object({\n type: constant(\"ellipse\"),\n center: pairOfNumbers,\n radius: pairOfNumbers,\n angle: number,\n color: parseLockedFigureColor,\n fillStyle: parseLockedFigureFillType,\n strokeStyle: parseLockedLineStyle,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedPolygonType: Parser<LockedPolygonType> = object({\n type: constant(\"polygon\"),\n points: array(pairOfNumbers),\n color: parseLockedFigureColor,\n showVertices: boolean,\n fillStyle: parseLockedFigureFillType,\n strokeStyle: parseLockedLineStyle,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\n// Exported for testing.\nexport const parseLockedFunctionDomain = defaulted(\n pair(\n defaulted(number, () => -Infinity),\n defaulted(number, () => Infinity),\n ),\n (): [number, number] => [-Infinity, Infinity],\n);\n\nconst parseLockedFunctionType: Parser<LockedFunctionType> = object({\n type: constant(\"function\"),\n color: parseLockedFigureColor,\n strokeStyle: parseLockedLineStyle,\n equation: string,\n directionalAxis: enumeration(\"x\", \"y\"),\n domain: parseLockedFunctionDomain,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedFigure: Parser<LockedFigure> = discriminatedUnionOn(\"type\")\n .withBranch(\"point\", parseLockedPointType)\n .withBranch(\"line\", parseLockedLineType)\n .withBranch(\"vector\", parseLockedVectorType)\n .withBranch(\"ellipse\", parseLockedEllipseType)\n .withBranch(\"polygon\", parseLockedPolygonType)\n .withBranch(\"function\", parseLockedFunctionType)\n .withBranch(\"label\", parseLockedLabelType).parser;\n\nexport const parseInteractiveGraphWidget: Parser<InteractiveGraphWidget> =\n parseWidget(\n constant(\"interactive-graph\"),\n object({\n step: pairOfNumbers,\n // TODO(benchristel): rather than making gridStep and snapStep\n // optional, we should duplicate the defaulting logic from the\n // InteractiveGraph component. See parse-perseus-json/README.md for\n // why.\n gridStep: optional(pairOfNumbers),\n snapStep: optional(pairOfNumbers),\n backgroundImage: optional(parsePerseusImageBackground),\n markings: enumeration(\"graph\", \"grid\", \"none\"),\n labels: optional(array(string)),\n showProtractor: boolean,\n showRuler: optional(boolean),\n showTooltips: optional(boolean),\n rulerLabel: optional(string),\n rulerTicks: optional(number),\n range: pair(pairOfNumbers, pairOfNumbers),\n // NOTE(benchristel): I copied the default graph from\n // interactive-graph.tsx. See the parse-perseus-json/README.md for\n // an explanation of why we want to duplicate the default here.\n graph: defaulted(parsePerseusGraphType, () => ({\n type: \"linear\" as const,\n })),\n correct: parsePerseusGraphType,\n // TODO(benchristel): default lockedFigures to empty array\n lockedFigures: optional(array(parseLockedFigure)),\n fullGraphLabel: optional(string),\n fullGraphAriaDescription: optional(string),\n }),\n );\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {LabelImageWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseLabelImageWidget: Parser<LabelImageWidget> = parseWidget(\n constant(\"label-image\"),\n object({\n choices: array(string),\n imageUrl: string,\n imageAlt: string,\n imageHeight: number,\n imageWidth: number,\n markers: array(\n object({\n answers: array(string),\n label: string,\n x: number,\n y: number,\n }),\n ),\n hideChoicesFromInstructions: boolean,\n multipleAnswers: boolean,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n array,\n boolean,\n constant,\n object,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {MatcherWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseMatcherWidget: Parser<MatcherWidget> = parseWidget(\n constant(\"matcher\"),\n object({\n labels: array(string),\n left: array(string),\n right: array(string),\n orderMatters: boolean,\n padding: boolean,\n }),\n);\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {stringToNumber} from \"../general-purpose-parsers/string-to-number\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {MatrixWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst numberOrString = union(number).or(string).parser;\nconst numeric = pipeParsers(defaulted(numberOrString, () => NaN)).then(\n stringToNumber,\n).parser;\n\nexport const parseMatrixWidget: Parser<MatrixWidget> = parseWidget(\n defaulted(constant(\"matrix\"), () => \"matrix\"),\n object({\n prefix: optional(string),\n suffix: optional(string),\n answers: array(array(numeric)),\n cursorPosition: optional(array(number)),\n matrixBoardSize: array(number),\n static: optional(boolean),\n }),\n);\n","import {\n boolean,\n constant,\n number,\n object,\n pair,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {MeasurerWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseMeasurerWidget: Parser<MeasurerWidget> = parseWidget(\n constant(\"measurer\"),\n object({\n // The default value for image comes from measurer.tsx.\n // See parse-perseus-json/README.md for why we want to duplicate the\n // defaults here.\n image: defaulted(parsePerseusImageBackground, () => ({\n url: null,\n top: 0,\n left: 0,\n })),\n showProtractor: boolean,\n showRuler: boolean,\n rulerLabel: string,\n rulerTicks: number,\n rulerPixels: number,\n rulerLength: number,\n box: pair(number, number),\n // TODO(benchristel): static is not used. Remove it?\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n constant,\n object,\n string,\n number,\n optional,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {MoleculeRendererWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseMoleculeRendererWidget: Parser<MoleculeRendererWidget> =\n parseWidget(\n constant(\"molecule-renderer\"),\n object({\n widgetId: string,\n rotationAngle: optional(number),\n smiles: optional(string),\n }),\n );\n","import {\n constant,\n object,\n array,\n number,\n string,\n boolean,\n optional,\n nullable,\n pipeParsers,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {NumberLineWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst emptyStringToNull = pipeParsers(constant(\"\")).then(\n convert(() => null),\n).parser;\n\nexport const parseNumberLineWidget: Parser<NumberLineWidget> = parseWidget(\n constant(\"number-line\"),\n object({\n range: array(number),\n labelRange: array(nullable(union(number).or(emptyStringToNull).parser)),\n labelStyle: string,\n labelTicks: boolean,\n isTickCtrl: optional(nullable(boolean)),\n divisionRange: array(number),\n numDivisions: optional(nullable(number)),\n // NOTE(benchristel): I copied the default snapDivisions from\n // number-line.tsx. See the parse-perseus-json/README.md for\n // an explanation of why we want to duplicate the default here.\n snapDivisions: defaulted(number, () => 2),\n tickStep: optional(nullable(number)),\n correctRel: optional(nullable(string)),\n correctX: nullable(number),\n initialX: optional(nullable(number)),\n showTooltips: optional(boolean),\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n constant,\n object,\n array,\n string,\n number,\n optional,\n enumeration,\n boolean,\n nullable,\n union,\n pipeParsers,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {NumericInputWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst parseMathFormat = enumeration(\n \"integer\",\n \"mixed\",\n \"improper\",\n \"proper\",\n \"decimal\",\n \"percent\",\n \"pi\",\n);\n\nconst parseSimplify = enumeration(\n \"required\",\n \"correct\",\n \"enforced\",\n \"optional\",\n);\n\nexport const parseNumericInputWidget: Parser<NumericInputWidget> = parseWidget(\n constant(\"numeric-input\"),\n object({\n answers: array(\n object({\n message: string,\n // TODO(benchristel): value should never be null or undefined,\n // but we have some content where it is anyway. If we backfill\n // the data, simplify this.\n value: optional(nullable(number)),\n status: string,\n answerForms: defaulted(array(parseMathFormat), () => undefined),\n strict: boolean,\n maxError: optional(nullable(number)),\n // TODO(benchristel): simplify should never be a boolean, but we\n // have some content where it is anyway. If we ever backfill\n // the data, we should simplify `simplify`.\n simplify: optional(\n nullable(\n union(parseSimplify).or(\n pipeParsers(boolean).then(\n convert((value) => {\n if (typeof value === \"boolean\") {\n return value ? \"required\" : \"optional\";\n }\n return value;\n }),\n ).parser,\n ).parser,\n ),\n ),\n }),\n ),\n labelText: optional(string),\n size: string,\n coefficient: defaulted(boolean, () => false),\n rightAlign: optional(boolean),\n static: defaulted(boolean, () => false),\n answerForms: optional(\n array(\n object({\n name: parseMathFormat,\n simplify: optional(\n nullable(\n enumeration(\n \"required\",\n \"correct\",\n \"enforced\",\n \"optional\",\n ),\n ),\n ),\n }),\n ),\n ),\n }),\n);\n","import {\n array,\n constant,\n enumeration,\n object,\n pipeParsers,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\nimport {parseWidget} from \"./widget\";\n\nimport type {OrdererWidget} from \"../../data-schema\";\nimport type {Parser, PartialParser} from \"../parser-types\";\n\n// There is an import cycle between orderer-widget.ts and perseus-renderer.ts.\n// This wrapper ensures that we don't refer to parsePerseusRenderer before\n// it's defined.\nfunction parseRenderer(rawValue, ctx) {\n return parsePerseusRenderer(rawValue, ctx);\n}\n\nconst largeToAuto: PartialParser<\n \"normal\" | \"auto\" | \"large\",\n \"normal\" | \"auto\"\n> = (height, ctx) => {\n if (height === \"large\") {\n return ctx.success(\"auto\");\n }\n return ctx.success(height);\n};\n\nexport const parseOrdererWidget: Parser<OrdererWidget> = parseWidget(\n constant(\"orderer\"),\n object({\n options: defaulted(array(parseRenderer), () => []),\n correctOptions: array(parseRenderer),\n otherOptions: array(parseRenderer),\n height: pipeParsers(enumeration(\"normal\", \"auto\", \"large\")).then(\n largeToAuto,\n ).parser,\n layout: defaulted(\n enumeration(\"horizontal\", \"vertical\"),\n () => \"horizontal\" as const,\n ),\n }),\n);\n","import {\n constant,\n object,\n string,\n number,\n optional,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PassageRefWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePassageRefWidget: Parser<PassageRefWidget> = parseWidget(\n constant(\"passage-ref\"),\n object({\n passageNumber: number,\n referenceNumber: number,\n summaryText: optional(string),\n }),\n);\n","import {constant, object, string, boolean} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PassageWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePassageWidget: Parser<PassageWidget> = parseWidget(\n constant(\"passage\"),\n object({\n footnotes: defaulted(string, () => \"\"),\n passageText: string,\n passageTitle: defaulted(string, () => \"\"),\n showLineNumbers: boolean,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {constant, object, string} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PhetSimulationWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePhetSimulationWidget: Parser<PhetSimulationWidget> =\n parseWidget(\n constant(\"phet-simulation\"),\n object({\n url: string,\n description: string,\n }),\n );\n","import {plotterPlotTypes} from \"../../data-schema\";\nimport {\n constant,\n object,\n string,\n array,\n number,\n optional,\n nullable,\n enumeration,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PlotterWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePlotterWidget: Parser<PlotterWidget> = parseWidget(\n constant(\"plotter\"),\n object({\n labels: array(string),\n categories: array(string),\n type: enumeration(...plotterPlotTypes),\n maxY: number,\n // The default value for scaleY comes from plotter.tsx.\n // See parse-perseus-json/README.md for why we want to duplicate the\n // defaults here.\n scaleY: defaulted(number, () => 1),\n labelInterval: optional(nullable(number)),\n // The default value for snapsPerLine comes from plotter.tsx.\n // See parse-perseus-json/README.md for why we want to duplicate the\n // defaults here.\n snapsPerLine: defaulted(number, () => 2),\n starting: array(number),\n correct: array(number),\n picUrl: optional(nullable(string)),\n picSize: optional(nullable(number)),\n picBoxHeight: optional(nullable(number)),\n // NOTE(benchristel): I copied the default plotDimensions from\n // plotter.tsx. See the parse-perseus-json/README.md for an explanation\n // of why we want to duplicate the defaults here.\n plotDimensions: defaulted(array(number), () => [380, 300]),\n }),\n);\n","import {constant, object, string, number} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PythonProgramWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePythonProgramWidget: Parser<PythonProgramWidget> =\n parseWidget(\n constant(\"python-program\"),\n object({\n programID: string,\n height: number,\n }),\n );\n","import type {PerseusRadioWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 2, minor: 0};\n\nexport function deriveNumCorrect(options: PerseusRadioWidgetOptions) {\n const {choices, numCorrect} = options;\n\n return numCorrect ?? choices.filter((c) => c.correct).length;\n}\n\nexport const widgetOptionsUpgrades = {\n \"2\": (v1props: any): PerseusRadioWidgetOptions => {\n const upgraded = {\n ...v1props,\n numCorrect: deriveNumCorrect(v1props),\n };\n return upgraded;\n },\n \"1\": (v0props: any): PerseusRadioWidgetOptions => {\n const {noneOfTheAbove, ...rest} = v0props;\n\n if (noneOfTheAbove) {\n throw new Error(\n \"radio widget v0 no longer supports auto noneOfTheAbove\",\n );\n }\n\n return {\n ...rest,\n hasNoneOfTheAbove: false,\n };\n },\n} as const;\n\nexport type RadioDefaultWidgetOptions = Pick<\n PerseusRadioWidgetOptions,\n | \"choices\"\n | \"displayCount\"\n | \"randomize\"\n | \"hasNoneOfTheAbove\"\n | \"multipleSelect\"\n | \"countChoices\"\n | \"deselectEnabled\"\n>;\n\nexport const defaultWidgetOptions: RadioDefaultWidgetOptions = {\n choices: [{}, {}, {}, {}] as any,\n displayCount: null,\n randomize: false,\n hasNoneOfTheAbove: false,\n multipleSelect: false,\n countChoices: false,\n deselectEnabled: false,\n};\n","import {deriveNumCorrect} from \"../../widgets/radio/radio-upgrade\";\nimport {\n any,\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {versionedWidgetOptions} from \"./versioned-widget-options\";\nimport {parseWidgetWithVersion} from \"./widget\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {RadioWidget} from \"../../data-schema\";\nimport type {ParsedValue, Parser} from \"../parser-types\";\n\nconst version2 = optional(object({major: constant(2), minor: number}));\nconst parseRadioWidgetV2: Parser<RadioWidget> = parseWidgetWithVersion(\n version2,\n constant(\"radio\"),\n object({\n numCorrect: optional(number),\n choices: array(\n object({\n content: defaulted(string, () => \"\"),\n clue: optional(string),\n correct: optional(boolean),\n isNoneOfTheAbove: optional(boolean),\n // deprecated\n // There is an import cycle between radio-widget.ts and\n // widgets-map.ts. The anonymous function below ensures that we\n // don't refer to parseWidgetsMap before it's defined.\n widgets: optional((rawVal, ctx) =>\n parseWidgetsMap(rawVal, ctx),\n ),\n }),\n ),\n hasNoneOfTheAbove: optional(boolean),\n countChoices: optional(boolean),\n randomize: optional(boolean),\n multipleSelect: optional(boolean),\n deselectEnabled: optional(boolean),\n // deprecated\n onePerLine: optional(boolean),\n // deprecated\n displayCount: optional(any),\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove: optional(constant(false)),\n }),\n);\n\nconst version1 = optional(object({major: constant(1), minor: number}));\nconst parseRadioWidgetV1: Parser<RadioWidget> = parseWidgetWithVersion(\n version1,\n constant(\"radio\"),\n object({\n choices: array(\n object({\n content: defaulted(string, () => \"\"),\n clue: optional(string),\n correct: optional(boolean),\n isNoneOfTheAbove: optional(boolean),\n // deprecated\n // There is an import cycle between radio-widget.ts and\n // widgets-map.ts. The anonymous function below ensures that we\n // don't refer to parseWidgetsMap before it's defined.\n widgets: defaulted(\n (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n () => undefined,\n ),\n }),\n ),\n hasNoneOfTheAbove: optional(boolean),\n countChoices: optional(boolean),\n randomize: optional(boolean),\n multipleSelect: optional(boolean),\n deselectEnabled: optional(boolean),\n // deprecated\n onePerLine: optional(boolean),\n // deprecated\n displayCount: optional(any),\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove: optional(constant(false)),\n }),\n);\n\nfunction migrateV1ToV2(\n widget: ParsedValue<typeof parseRadioWidgetV1>,\n): RadioWidget {\n const {options} = widget;\n return {\n ...widget,\n version: {major: 2, minor: 0},\n options: {\n ...options,\n numCorrect: deriveNumCorrect(options),\n },\n };\n}\n\nconst version0 = optional(object({major: constant(0), minor: number}));\nconst parseRadioWidgetV0: Parser<RadioWidget> = parseWidgetWithVersion(\n version0,\n constant(\"radio\"),\n object({\n choices: array(\n object({\n content: defaulted(string, () => \"\"),\n clue: optional(string),\n correct: optional(boolean),\n isNoneOfTheAbove: optional(boolean),\n // deprecated\n // There is an import cycle between radio-widget.ts and\n // widgets-map.ts. The anonymous function below ensures that we\n // don't refer to parseWidgetsMap before it's defined.\n widgets: optional((rawVal, ctx) =>\n parseWidgetsMap(rawVal, ctx),\n ),\n }),\n ),\n hasNoneOfTheAbove: optional(boolean),\n countChoices: optional(boolean),\n randomize: optional(boolean),\n multipleSelect: optional(boolean),\n deselectEnabled: optional(boolean),\n // deprecated\n onePerLine: optional(boolean),\n // deprecated\n displayCount: optional(any),\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove: optional(constant(false)),\n }),\n);\n\nfunction migrateV0ToV1(\n widget: ParsedValue<typeof parseRadioWidgetV1>,\n): RadioWidget {\n const {options} = widget;\n const {noneOfTheAbove: _, ...rest} = options;\n return {\n ...widget,\n version: {major: 1, minor: 0},\n options: {\n ...rest,\n hasNoneOfTheAbove: false,\n },\n };\n}\n\nexport const parseRadioWidget: Parser<RadioWidget> = versionedWidgetOptions(\n 2,\n parseRadioWidgetV2,\n)\n .withMigrationFrom(1, parseRadioWidgetV1, migrateV1ToV2)\n .withMigrationFrom(0, parseRadioWidgetV0, migrateV0ToV1).parser;\n","import {\n array,\n boolean,\n constant,\n enumeration,\n object,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {SorterWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseSorterWidget: Parser<SorterWidget> = parseWidget(\n constant(\"sorter\"),\n object({\n correct: array(string),\n padding: boolean,\n layout: enumeration(\"horizontal\", \"vertical\"),\n }),\n);\n","import {\n array,\n number,\n constant,\n object,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {TableWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseTableWidget: Parser<TableWidget> = parseWidget(\n constant(\"table\"),\n object({\n headers: array(string),\n rows: number,\n columns: number,\n answers: array(array(string)),\n }),\n);\n","import {\n constant,\n object,\n string,\n boolean,\n optional,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {VideoWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseVideoWidget: Parser<VideoWidget> = parseWidget(\n constant(\"video\"),\n object({\n location: string,\n static: optional(boolean),\n }),\n);\n","import {\n any,\n pair,\n isObject,\n string,\n object,\n constant,\n} from \"../general-purpose-parsers\";\nimport {isFailure} from \"../result\";\n\nimport {parseCategorizerWidget} from \"./categorizer-widget\";\nimport {parseCSProgramWidget} from \"./cs-program-widget\";\nimport {parseDefinitionWidget} from \"./definition-widget\";\nimport {parseDropdownWidget} from \"./dropdown-widget\";\nimport {parseExplanationWidget} from \"./explanation-widget\";\nimport {parseExpressionWidget} from \"./expression-widget\";\nimport {parseGradedGroupSetWidget} from \"./graded-group-set-widget\";\nimport {parseGradedGroupWidget} from \"./graded-group-widget\";\nimport {parseGrapherWidget} from \"./grapher-widget\";\nimport {parseGroupWidget} from \"./group-widget\";\nimport {parseIframeWidget} from \"./iframe-widget\";\nimport {parseImageWidget} from \"./image-widget\";\nimport {parseInputNumberWidget} from \"./input-number-widget\";\nimport {parseInteractionWidget} from \"./interaction-widget\";\nimport {parseInteractiveGraphWidget} from \"./interactive-graph-widget\";\nimport {parseLabelImageWidget} from \"./label-image-widget\";\nimport {parseMatcherWidget} from \"./matcher-widget\";\nimport {parseMatrixWidget} from \"./matrix-widget\";\nimport {parseMeasurerWidget} from \"./measurer-widget\";\nimport {parseMoleculeRendererWidget} from \"./molecule-renderer-widget\";\nimport {parseNumberLineWidget} from \"./number-line-widget\";\nimport {parseNumericInputWidget} from \"./numeric-input-widget\";\nimport {parseOrdererWidget} from \"./orderer-widget\";\nimport {parsePassageRefWidget} from \"./passage-ref-widget\";\nimport {parsePassageWidget} from \"./passage-widget\";\nimport {parsePhetSimulationWidget} from \"./phet-simulation-widget\";\nimport {parsePlotterWidget} from \"./plotter-widget\";\nimport {parsePythonProgramWidget} from \"./python-program-widget\";\nimport {parseRadioWidget} from \"./radio-widget\";\nimport {parseSorterWidget} from \"./sorter-widget\";\nimport {parseTableWidget} from \"./table-widget\";\nimport {parseVideoWidget} from \"./video-widget\";\nimport {parseWidget} from \"./widget\";\n\nimport type {\n DeprecatedStandinWidget,\n PerseusWidgetsMap,\n} from \"../../data-schema\";\nimport type {ParseContext, Parser, ParseResult} from \"../parser-types\";\n\nexport const parseWidgetsMap: Parser<PerseusWidgetsMap> = (rawValue, ctx) => {\n if (!isObject(rawValue)) {\n return ctx.failure(\"PerseusWidgetsMap\", rawValue);\n }\n\n const widgetsMap: PerseusWidgetsMap = {};\n for (const key of Object.keys(rawValue)) {\n // parseWidgetsMapEntry modifies the widgetsMap. This is kind of gross,\n // but it's the only way I could find to make TypeScript check the key\n // against the widget type.\n const entryResult = parseWidgetsMapEntry(\n [key, rawValue[key]],\n widgetsMap,\n ctx.forSubtree(key),\n );\n if (isFailure(entryResult)) {\n return entryResult;\n }\n }\n\n return ctx.success(widgetsMap);\n};\n\nconst parseWidgetsMapEntry: (\n entry: [string, unknown],\n widgetMap: PerseusWidgetsMap,\n ctx: ParseContext,\n) => ParseResult<unknown> = ([id, widget], widgetMap, ctx) => {\n const idComponentsResult = parseWidgetIdComponents(\n id.split(\" \"),\n ctx.forSubtree(\"(widget ID)\"),\n );\n if (isFailure(idComponentsResult)) {\n return idComponentsResult;\n }\n const [type, n] = idComponentsResult.value;\n\n function parseAndAssign<K extends keyof PerseusWidgetsMap>(\n key: K,\n parse: Parser<PerseusWidgetsMap[K]>,\n ): ParseResult<unknown> {\n const widgetResult = parse(widget, ctx);\n if (isFailure(widgetResult)) {\n return widgetResult;\n }\n widgetMap[key] = widgetResult.value;\n return ctx.success(undefined);\n }\n\n switch (type) {\n case \"categorizer\":\n return parseAndAssign(`categorizer ${n}`, parseCategorizerWidget);\n case \"cs-program\":\n return parseAndAssign(`cs-program ${n}`, parseCSProgramWidget);\n case \"definition\":\n return parseAndAssign(`definition ${n}`, parseDefinitionWidget);\n case \"dropdown\":\n return parseAndAssign(`dropdown ${n}`, parseDropdownWidget);\n case \"explanation\":\n return parseAndAssign(`explanation ${n}`, parseExplanationWidget);\n case \"expression\":\n return parseAndAssign(`expression ${n}`, parseExpressionWidget);\n case \"grapher\":\n return parseAndAssign(`grapher ${n}`, parseGrapherWidget);\n case \"group\":\n return parseAndAssign(`group ${n}`, parseGroupWidget);\n case \"graded-group\":\n return parseAndAssign(`graded-group ${n}`, parseGradedGroupWidget);\n case \"graded-group-set\":\n return parseAndAssign(\n `graded-group-set ${n}`,\n parseGradedGroupSetWidget,\n );\n case \"iframe\":\n return parseAndAssign(`iframe ${n}`, parseIframeWidget);\n case \"image\":\n return parseAndAssign(`image ${n}`, parseImageWidget);\n case \"input-number\":\n return parseAndAssign(`input-number ${n}`, parseInputNumberWidget);\n case \"interaction\":\n return parseAndAssign(`interaction ${n}`, parseInteractionWidget);\n case \"interactive-graph\":\n return parseAndAssign(\n `interactive-graph ${n}`,\n parseInteractiveGraphWidget,\n );\n case \"label-image\":\n return parseAndAssign(`label-image ${n}`, parseLabelImageWidget);\n case \"matcher\":\n return parseAndAssign(`matcher ${n}`, parseMatcherWidget);\n case \"matrix\":\n return parseAndAssign(`matrix ${n}`, parseMatrixWidget);\n case \"measurer\":\n return parseAndAssign(`measurer ${n}`, parseMeasurerWidget);\n case \"molecule-renderer\":\n return parseAndAssign(\n `molecule-renderer ${n}`,\n parseMoleculeRendererWidget,\n );\n case \"number-line\":\n return parseAndAssign(`number-line ${n}`, parseNumberLineWidget);\n case \"numeric-input\":\n return parseAndAssign(\n `numeric-input ${n}`,\n parseNumericInputWidget,\n );\n case \"orderer\":\n return parseAndAssign(`orderer ${n}`, parseOrdererWidget);\n case \"passage\":\n return parseAndAssign(`passage ${n}`, parsePassageWidget);\n case \"passage-ref\":\n return parseAndAssign(`passage-ref ${n}`, parsePassageRefWidget);\n case \"passage-ref-target\":\n // NOTE(benchristel): as of 2024-11-12, passage-ref-target is only\n // used in test content. See:\n // https://www.khanacademy.org/devadmin/content/search?query=widget:passage-ref-target\n return parseAndAssign(`passage-ref-target ${n}`, any);\n case \"phet-simulation\":\n return parseAndAssign(\n `phet-simulation ${n}`,\n parsePhetSimulationWidget,\n );\n case \"plotter\":\n return parseAndAssign(`plotter ${n}`, parsePlotterWidget);\n case \"python-program\":\n return parseAndAssign(\n `python-program ${n}`,\n parsePythonProgramWidget,\n );\n case \"radio\":\n return parseAndAssign(`radio ${n}`, parseRadioWidget);\n case \"sorter\":\n return parseAndAssign(`sorter ${n}`, parseSorterWidget);\n case \"table\":\n return parseAndAssign(`table ${n}`, parseTableWidget);\n case \"video\":\n return parseAndAssign(`video ${n}`, parseVideoWidget);\n case \"sequence\":\n // sequence is a deprecated widget type, and the corresponding\n // widget component no longer exists.\n return parseAndAssign(`sequence ${n}`, parseDeprecatedWidget);\n case \"lights-puzzle\":\n return parseAndAssign(`lights-puzzle ${n}`, parseDeprecatedWidget);\n case \"simulator\":\n return parseAndAssign(`simulator ${n}`, parseDeprecatedWidget);\n case \"transformer\":\n return parseAndAssign(`transformer ${n}`, parseDeprecatedWidget);\n\n default:\n return parseAndAssign(\n `${type} ${n}` as any,\n parseWidget(constant(type), any) as any,\n );\n }\n};\n\nconst parseDeprecatedWidget: Parser<DeprecatedStandinWidget> = parseWidget(\n // Ignore the incoming widget type and hardcode \"deprecated-standin\"\n (_, ctx) => ctx.success(\"deprecated-standin\" as const),\n // Allow any widget options\n object({}),\n);\n\nconst parseStringToNonNegativeInt: Parser<number> = (rawValue, ctx) => {\n // The article renderer seems to allow the numeric part of a widget ID to\n // be 0, at least for image widgets. However, if widget IDs in an exercise\n // contain 0, the exercise renderer will blow up. We allow 0 here for\n // compatibility with articles.\n if (typeof rawValue !== \"string\" || !/^(0|[1-9][0-9]*)$/.test(rawValue)) {\n return ctx.failure(\n \"a string representing a non-negative integer\",\n rawValue,\n );\n }\n return ctx.success(+rawValue);\n};\n\nconst parseWidgetIdComponents = pair(string, parseStringToNonNegativeInt);\n","import {any, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseImages} from \"./images-map\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {PerseusRenderer} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePerseusRenderer: Parser<PerseusRenderer> = defaulted(\n object({\n // TODO(benchristel): content is also defaulted to empty string in\n // renderer.tsx. See if we can remove one default or the other.\n content: defaulted(string, () => \"\"),\n // This module has an import cycle with parseWidgetsMap, because the\n // `group` widget can contain another renderer.\n // The anonymous function below ensures that we don't try to access\n // parseWidgetsMap before it's defined.\n widgets: defaulted(\n (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n () => ({}),\n ),\n images: parseImages,\n // deprecated\n metadata: any,\n }),\n // Default value\n () => ({\n content: \"\",\n widgets: {},\n images: {},\n }),\n);\n","import {array, union} from \"../general-purpose-parsers\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\n\nimport type {PerseusArticle} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePerseusArticle: Parser<PerseusArticle> = union(\n parsePerseusRenderer,\n).or(array(parsePerseusRenderer)).parser;\n","import {any, boolean, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseImages} from \"./images-map\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {Hint} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseHint: Parser<Hint> = object({\n replace: defaulted(boolean, () => undefined),\n content: string,\n widgets: defaulted(parseWidgetsMap, () => ({})),\n images: parseImages,\n // deprecated\n metadata: any,\n});\n","import {object, pipeParsers} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport type {PerseusAnswerArea} from \"@khanacademy/perseus-core\";\n\nexport const parsePerseusAnswerArea = pipeParsers(\n defaulted(object({}), () => ({})),\n).then(convert(toAnswerArea)).parser;\n\n// Some answerAreas have extra, bogus fields, like:\n//\n// \"answerArea\": {\n// \"type\": \"multiple\",\n// \"options\": {},\n// \"version\": null,\n// \"static\": false,\n// \"graded\": false,\n// \"alignment\": \"\",\n// }\n//\n// This function filters the fields of an answerArea object, keeping only the\n// known ones, and converts `undefined` and `null` values to `false`.\nfunction toAnswerArea(raw: Record<string, unknown>): PerseusAnswerArea {\n return {\n zTable: !!raw.zTable,\n calculator: !!raw.calculator,\n chi2Table: !!raw.chi2Table,\n financialCalculatorMonthlyPayment:\n !!raw.financialCalculatorMonthlyPayment,\n financialCalculatorTotalAmount: !!raw.financialCalculatorTotalAmount,\n financialCalculatorTimeToPayOff: !!raw.financialCalculatorTimeToPayOff,\n periodicTable: !!raw.periodicTable,\n periodicTableWithKey: !!raw.periodicTableWithKey,\n tTable: !!raw.tTable,\n };\n}\n","import {any, array, number, object, optional} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseHint} from \"./hint\";\nimport {parsePerseusAnswerArea} from \"./perseus-answer-area\";\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\n\nimport type {PerseusItem} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePerseusItem: Parser<PerseusItem> = object({\n question: parsePerseusRenderer,\n hints: defaulted(array(parseHint), () => []),\n answerArea: parsePerseusAnswerArea,\n itemDataVersion: optional(\n object({\n major: number,\n minor: number,\n }),\n ),\n // Deprecated field\n answer: any,\n});\n","import {isRealJSONParse} from \"../utils/is-real-json-parse\";\n\nimport {parse} from \"./parse\";\nimport {parsePerseusArticle as migrateAndTypecheckPerseusArticle} from \"./perseus-parsers/perseus-article\";\nimport {parsePerseusItem as migrateAndTypecheckPerseusItem} from \"./perseus-parsers/perseus-item\";\nimport {failure, isFailure} from \"./result\";\n\nimport type {Result} from \"./result\";\nimport type {PerseusItem, PerseusArticle} from \"../data-schema\";\n\n/**\n * Helper to parse PerseusItem JSON\n * Why not just use JSON.parse? We want:\n * - To make sure types are correct\n * - To give us a central place to validate/transform output if needed\n * @deprecated - use parseAndMigratePerseusItem instead\n * @param {string} json - the stringified PerseusItem JSON\n * @returns {PerseusItem} the parsed PerseusItem object\n */\nexport function parsePerseusItem(json: string): PerseusItem {\n // Try to block a cheating vector which relies on monkey-patching\n // JSON.parse\n if (isRealJSONParse(JSON.parse)) {\n return JSON.parse(json);\n }\n throw new Error(\"Something went wrong.\");\n}\n\nexport type ParseFailureDetail = {\n /**\n * A human-readable error message describing where in the object tree\n * parsing failed.\n */\n message: string;\n /**\n * The raw result of parsing the input JSON, with no migrations applied.\n * Use at your own risk.\n */\n invalidObject: unknown;\n};\n\n/**\n * Parses a PerseusItem from a JSON string, migrates old formats to the latest\n * schema, and runtime-typechecks the result. Use this to parse assessmentItem\n * data.\n *\n * @returns a {@link Result} of the parsed PerseusItem. If the result is a\n * failure, it will contain an error message describing where in the tree\n * parsing failed.\n * @throws SyntaxError if the argument is not well-formed JSON.\n */\nexport function parseAndMigratePerseusItem(\n json: string,\n): Result<PerseusItem, ParseFailureDetail> {\n throwErrorIfCheatingDetected();\n const object: unknown = JSON.parse(json);\n const result = parse(object, migrateAndTypecheckPerseusItem);\n if (isFailure(result)) {\n return failure({message: result.detail, invalidObject: object});\n }\n return result;\n}\n\n/**\n * Parses a PerseusArticle from a JSON string, migrates old formats to the\n * latest schema, and runtime-typechecks the result.\n *\n * @returns a {@link Result} of the parsed PerseusArticle. If the result is a\n * failure, it will contain an error message describing where in the tree\n * parsing failed.\n * @throws SyntaxError if the argument is not well-formed JSON.\n */\nexport function parseAndMigratePerseusArticle(\n json: string,\n): Result<PerseusArticle, ParseFailureDetail> {\n throwErrorIfCheatingDetected();\n const object: unknown = JSON.parse(json);\n const result = parse(object, migrateAndTypecheckPerseusArticle);\n if (isFailure(result)) {\n return failure({message: result.detail, invalidObject: object});\n }\n return result;\n}\n\n/**\n * Tries to block a cheating vector that relies on monkey-patching JSON.parse.\n */\n// TODO(LEMS-2331): delete this function once server-side scoring is done.\nfunction throwErrorIfCheatingDetected() {\n if (!isRealJSONParse(JSON.parse)) {\n throw new Error(\"Something went wrong.\");\n }\n}\n","/**\n * Adds the given perseus library version information to the __perseus_debug__\n * object and ensures that the object is attached to `globalThis` (`window` in\n * browser environments).\n *\n * This allows each library to provide runtime version information to assist in\n * debugging in production environments.\n */\nexport const addLibraryVersionToPerseusDebug = (\n libraryName: string,\n libraryVersion: string,\n) => {\n // If the library version is the default value, then we don't want to\n // prefix it with a \"v\" to indicate that it is a version number.\n let prefix = \"v\";\n if (libraryVersion === \"__lib_version__\") {\n prefix = \"\";\n }\n const formattedVersion = `${prefix}${libraryVersion}`;\n\n if (typeof globalThis !== \"undefined\") {\n globalThis.__perseus_debug__ = globalThis.__perseus_debug__ ?? {};\n\n const existingVersionEntry = globalThis.__perseus_debug__[libraryName];\n if (existingVersionEntry) {\n // If we already have an entry and it doesn't match the registered\n // version, we morph the entry into an array and log a warning.\n if (existingVersionEntry !== formattedVersion) {\n // Existing entry might be an array already (oops, at least 2\n // versions of the library already loaded!).\n const allVersions = Array.isArray(existingVersionEntry)\n ? existingVersionEntry\n : [existingVersionEntry];\n allVersions.push(formattedVersion);\n\n globalThis.__perseus_debug__[libraryName] = allVersions;\n\n // eslint-disable-next-line no-console\n console.warn(\n `Multiple versions of ${libraryName} loaded on this page: ${allVersions\n .sort()\n .join(\", \")}`,\n );\n }\n } else {\n globalThis.__perseus_debug__[libraryName] = formattedVersion;\n }\n } else {\n // eslint-disable-next-line no-console\n console.warn(`globalThis not found found (${formattedVersion})`);\n }\n};\n","// This file is processed by a Rollup plugin (replace) to inject the production\n// version number during the release build.\n// In dev, you'll never see the version number.\n\n// We use a shared, symlinked directory to bring in this function so that we\n// don't need to have cross-package dependencies just for a few hundred bytes\n// of shared code.\n// ESLint's import/no-relative-packages doesn't understand symlinks! If this\n// lint suppression is removed, it autofixes the import path to an invalid\n// package+path entry.\n// eslint-disable-next-line import/no-relative-packages\nimport {addLibraryVersionToPerseusDebug} from \"./shared-utils/add-library-version-to-perseus-debug\";\n\nconst libName = \"@khanacademy/perseus-core\";\nexport const libVersion = \"__lib_version__\";\n\naddLibraryVersionToPerseusDebug(libName, libVersion);\n","/**\n * @typedef {Object} Errors utility for referencing the Perseus error taxonomy.\n */\nexport const Errors = Object.freeze({\n /**\n * @property {ErrorKind} Unknown The kind of error is not known.\n */\n Unknown: \"Unknown\",\n /**\n * @property {ErrorKind} Internal The error is internal to the executing code.\n */\n Internal: \"Internal\",\n /**\n * @property {ErrorKind} InvalidInput There was a problem with the provided\n * input, such as the wrong format or a null value.\n */\n InvalidInput: \"InvalidInput\",\n /**\n * @property {ErrorKind} NotAllowed There was a problem due to the state of\n * the system not matching the requested operation or input. For example,\n * trying to create a username that is valid, but is already taken by\n * another user. Use {@link InvalidInput} instead when the input isn't\n * valid regardless of the state of the system. Use {@link NotFound} when\n * the failure is due to not being able to find a resource.\n */\n NotAllowed: \"NotAllowed\",\n /**\n * @property {ErrorKind} TransientService There was a problem when making a\n * request to a service.\n */\n TransientService: \"TransientService\",\n /**\n * @property {ErrorKind} Service There was a non-transient problem when\n * making a request to service.\n */\n Service: \"Service\",\n});\n\n/**\n * @type {ErrorKind} The kind of error being reported\n */\nexport type ErrorKind = (typeof Errors)[keyof typeof Errors];\n","import type {ErrorKind} from \"./errors\";\nimport type {Metadata} from \"@khanacademy/wonder-stuff-core\";\n\ntype Options = {\n metadata?: Metadata | null | undefined;\n};\n\nexport class PerseusError extends Error {\n kind: ErrorKind;\n metadata: Metadata | null | undefined;\n\n constructor(message: string, kind: ErrorKind, options?: Options) {\n super(message);\n this.kind = kind;\n this.metadata = options?.metadata;\n }\n}\n","/**\n * _ utilities for objects\n */\n\nimport _ from \"underscore\";\n\n/**\n * Does a pluck on keys inside objects in an object\n *\n * Ex:\n * tools = {\n * translation: {\n * enabled: true\n * },\n * rotation: {\n * enabled: false\n * }\n * };\n * pluckObject(tools, \"enabled\") returns {\n * translation: true\n * rotation: false\n * }\n */\nexport const pluck = function (table: any, subKey: string): any {\n return _.object(\n _.map(table, function (value, key) {\n return [key, value[subKey]];\n }),\n );\n};\n\n/**\n * Maps an object to an object\n *\n * > mapObject({a: '1', b: '2'}, (value, key) => {\n * return value + 1;\n * });\n * {a: 2, b: 3}\n */\nexport const mapObject = function <K extends string, V, U>(\n obj: Record<K, V>,\n lambda: (arg1: V, arg2: K) => U,\n): Record<K, U> {\n const result: Record<string, any> = {};\n Object.keys(obj).forEach((key) => {\n // @ts-expect-error - TS2345 - Argument of type 'string' is not assignable to parameter of type 'K'.\n result[key] = lambda(obj[key], key);\n });\n return result;\n};\n","import type {PerseusCategorizerWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusCategorizerWidgetOptions type\n */\ntype CategorizerPublicWidgetOptions = {\n items: PerseusCategorizerWidgetOptions[\"items\"];\n categories: PerseusCategorizerWidgetOptions[\"categories\"];\n randomizeItems: PerseusCategorizerWidgetOptions[\"randomizeItems\"];\n static: PerseusCategorizerWidgetOptions[\"static\"];\n};\n\n/**\n * Given a PerseusCategorizerWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getCategorizerPublicWidgetOptions(\n options: PerseusCategorizerWidgetOptions,\n): CategorizerPublicWidgetOptions {\n return {\n items: options.items,\n categories: options.categories,\n randomizeItems: options.randomizeItems,\n static: options.static,\n };\n}\n\nexport default getCategorizerPublicWidgetOptions;\n","import getCategorizerPublicWidgetOptions from \"./categorizer-util\";\n\nimport type {PerseusCategorizerWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type CategorizerDefaultWidgetOptions = Pick<\n PerseusCategorizerWidgetOptions,\n \"items\" | \"categories\" | \"values\" | \"randomizeItems\"\n>;\n\nconst defaultWidgetOptions: CategorizerDefaultWidgetOptions = {\n items: [],\n categories: [],\n values: [],\n randomizeItems: false,\n};\n\nconst categorizerWidgetLogic: WidgetLogic = {\n name: \"categorizer\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getCategorizerPublicWidgetOptions,\n};\n\nexport default categorizerWidgetLogic;\n","import type {PerseusCSProgramWidgetOptions} from \"../../data-schema\";\n\nexport default function getCSProgramPublicWidgetOptions(\n options: PerseusCSProgramWidgetOptions,\n): PerseusCSProgramWidgetOptions {\n return options;\n}\n","import getCSProgramPublicWidgetOptions from \"./cs-program-util\";\n\nimport type {PerseusCSProgramWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type CSProgramDefaultWidgetOptions = Pick<\n PerseusCSProgramWidgetOptions,\n | \"programID\"\n | \"programType\"\n | \"settings\"\n | \"showEditor\"\n | \"showButtons\"\n | \"height\"\n>;\n\nconst DEFAULT_HEIGHT = 400;\n\nconst defaultWidgetOptions: CSProgramDefaultWidgetOptions = {\n programID: \"\",\n programType: null,\n settings: [{name: \"\", value: \"\"}],\n showEditor: false,\n showButtons: false,\n height: DEFAULT_HEIGHT,\n};\n\nconst csProgramWidgetLogic: WidgetLogic = {\n name: \"cs-program\",\n defaultWidgetOptions,\n supportedAlignments: [\"block\", \"full-width\"],\n getPublicWidgetOptions: getCSProgramPublicWidgetOptions,\n};\n\nexport default csProgramWidgetLogic;\n","import type {PerseusDefinitionWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type DefinitionDefaultWidgetOptions = Pick<\n PerseusDefinitionWidgetOptions,\n \"togglePrompt\" | \"definition\"\n>;\n\nconst defaultWidgetOptions: DefinitionDefaultWidgetOptions = {\n togglePrompt: \"\",\n definition: \"\",\n};\n\nconst definitionWidgetLogic: WidgetLogic = {\n name: \"definition\",\n defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default definitionWidgetLogic;\n","import type {PerseusDropdownWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusDropdownWidgetOptions type\n */\nexport type DropdownPublicWidgetOptions = {\n choices: ReadonlyArray<{content: string}>;\n placeholder: PerseusDropdownWidgetOptions[\"placeholder\"];\n static: PerseusDropdownWidgetOptions[\"static\"];\n visibleLabel?: PerseusDropdownWidgetOptions[\"visibleLabel\"];\n ariaLabel?: PerseusDropdownWidgetOptions[\"ariaLabel\"];\n};\n\n/**\n * Given a PerseusDropdownWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getDropdownPublicWidgetOptions(\n options: PerseusDropdownWidgetOptions,\n): DropdownPublicWidgetOptions {\n return {\n choices: options.choices.map((choice) => ({content: choice.content})),\n placeholder: options.placeholder,\n static: options.static,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n };\n}\n\nexport default getDropdownPublicWidgetOptions;\n","import getDropdownPublicWidgetOptions from \"./dropdown-util\";\n\nimport type {PerseusDropdownWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type DropdownDefaultWidgetOptions = Pick<\n PerseusDropdownWidgetOptions,\n \"placeholder\" | \"choices\"\n>;\n\nconst defaultWidgetOptions: DropdownDefaultWidgetOptions = {\n placeholder: \"\",\n choices: [\n {\n content: \"\",\n correct: false,\n },\n ],\n};\n\nconst dropdownWidgetLogic: WidgetLogic = {\n name: \"definition\",\n defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n getPublicWidgetOptions: getDropdownPublicWidgetOptions,\n};\n\nexport default dropdownWidgetLogic;\n","import type {PerseusExplanationWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type ExplanationDefaultWidgetOptions = Pick<\n PerseusExplanationWidgetOptions,\n \"showPrompt\" | \"hidePrompt\" | \"explanation\" | \"widgets\"\n>;\n\nconst defaultWidgetOptions: ExplanationDefaultWidgetOptions = {\n showPrompt: \"Explain\",\n hidePrompt: \"Hide explanation\",\n explanation: \"explanation goes here\\n\\nmore explanation\",\n widgets: {},\n};\n\nconst explanationWidgetLogic: WidgetLogic = {\n name: \"explanation\",\n defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default explanationWidgetLogic;\n","import deriveExtraKeys from \"./derive-extra-keys\";\n\nimport type {PerseusExpressionWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 2, minor: 0};\n\nexport const widgetOptionsUpgrades = {\n \"2\": (v1options: any): PerseusExpressionWidgetOptions => {\n return {\n times: v1options.times,\n buttonSets: v1options.buttonSets,\n functions: v1options.functions,\n buttonsVisible: v1options.buttonsVisible,\n visibleLabel: v1options.visibleLabel,\n ariaLabel: v1options.ariaLabel,\n answerForms: v1options.answerForms,\n extraKeys: v1options.extraKeys || deriveExtraKeys(v1options),\n };\n },\n \"1\": (v0options: any): PerseusExpressionWidgetOptions => {\n return {\n times: v0options.times,\n buttonSets: v0options.buttonSets,\n functions: v0options.functions,\n buttonsVisible: v0options.buttonsVisible,\n visibleLabel: v0options.visibleLabel,\n ariaLabel: v0options.ariaLabel,\n extraKeys: v0options.extraKeys,\n\n answerForms: [\n {\n considered: \"correct\",\n form: v0options.form,\n simplify: v0options.simplify,\n value: v0options.value,\n },\n ],\n };\n },\n} as const;\n\nexport type ExpressionDefaultWidgetOptions = Pick<\n PerseusExpressionWidgetOptions,\n \"answerForms\" | \"times\" | \"buttonSets\" | \"functions\"\n>;\n\nexport const defaultWidgetOptions: ExpressionDefaultWidgetOptions = {\n answerForms: [],\n times: false,\n buttonSets: [\"basic\"],\n functions: [\"f\", \"g\", \"h\"],\n};\n","import type {PerseusExpressionWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusExpressionWidgetOptions type\n */\nexport type ExpressionPublicWidgetOptions = {\n buttonSets: PerseusExpressionWidgetOptions[\"buttonSets\"];\n functions: PerseusExpressionWidgetOptions[\"functions\"];\n times: PerseusExpressionWidgetOptions[\"times\"];\n visibleLabel?: PerseusExpressionWidgetOptions[\"visibleLabel\"];\n ariaLabel?: PerseusExpressionWidgetOptions[\"ariaLabel\"];\n buttonsVisible?: PerseusExpressionWidgetOptions[\"buttonsVisible\"];\n extraKeys?: PerseusExpressionWidgetOptions[\"extraKeys\"];\n};\n\n/**\n * Given a PerseusExpressionWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getExpressionPublicWidgetOptions(\n options: PerseusExpressionWidgetOptions,\n): ExpressionPublicWidgetOptions {\n return {\n buttonSets: options.buttonSets,\n functions: options.functions,\n times: options.times,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n buttonsVisible: options.buttonsVisible,\n extraKeys: options.extraKeys,\n };\n}\n\nexport default getExpressionPublicWidgetOptions;\n","import {\n currentVersion,\n defaultWidgetOptions,\n widgetOptionsUpgrades,\n} from \"./expression-upgrade\";\nimport getExpressionPublicWidgetOptions from \"./expression-util\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {ExpressionDefaultWidgetOptions} from \"./expression-upgrade\";\n\nconst expressionWidgetLogic: WidgetLogic = {\n name: \"expression\",\n version: currentVersion,\n widgetOptionsUpgrades: widgetOptionsUpgrades,\n defaultWidgetOptions: defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n getPublicWidgetOptions: getExpressionPublicWidgetOptions,\n};\n\nexport default expressionWidgetLogic;\n","import type {PerseusGradedGroupWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GradedGroupDefaultWidgetOptions = Pick<\n PerseusGradedGroupWidgetOptions,\n \"title\" | \"content\" | \"widgets\" | \"images\" | \"hint\"\n>;\n\nconst defaultWidgetOptions: GradedGroupDefaultWidgetOptions = {\n title: \"\",\n content: \"\",\n widgets: {},\n images: {},\n hint: null,\n};\n\nconst gradedGroupWidgetLogic: WidgetLogic = {\n name: \"graded-group\",\n defaultWidgetOptions,\n};\n\nexport default gradedGroupWidgetLogic;\n","import type {PerseusGradedGroupSetWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GradedGroupSetDefaultWidgetOptions = Pick<\n PerseusGradedGroupSetWidgetOptions,\n \"gradedGroups\"\n>;\n\nconst defaultWidgetOptions: GradedGroupSetDefaultWidgetOptions = {\n gradedGroups: [],\n};\n\nconst gradedGroupSetWidgetLogic: WidgetLogic = {\n name: \"graded-group-set\",\n defaultWidgetOptions,\n};\n\nexport default gradedGroupSetWidgetLogic;\n","import type {PerseusGrapherWidgetOptions} from \"../../data-schema\";\n\ntype GrapherPublicWidgetOptions = Pick<\n PerseusGrapherWidgetOptions,\n \"availableTypes\" | \"graph\"\n>;\n\nexport default function getGrapherPublicWidgetOptions(\n options: PerseusGrapherWidgetOptions,\n): GrapherPublicWidgetOptions {\n const {correct: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getGrapherPublicWidgetOptions from \"./grapher-util\";\n\nimport type {PerseusGrapherWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GrapherDefaultWidgetOptions = Pick<\n PerseusGrapherWidgetOptions,\n \"graph\" | \"correct\" | \"availableTypes\"\n>;\n\nconst defaultWidgetOptions: GrapherDefaultWidgetOptions = {\n graph: {\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n backgroundImage: {\n url: null,\n },\n markings: \"graph\",\n rulerLabel: \"\",\n rulerTicks: 10,\n valid: true,\n showTooltips: false,\n },\n correct: {\n type: \"linear\",\n coords: null,\n },\n availableTypes: [\"linear\"],\n};\n\nconst grapherWidgetLogic: WidgetLogic = {\n name: \"grapher\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getGrapherPublicWidgetOptions,\n};\n\nexport default grapherWidgetLogic;\n","import type {PerseusGroupWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GroupDefaultWidgetOptions = Pick<\n PerseusGroupWidgetOptions,\n \"content\" | \"widgets\" | \"images\"\n>;\n\nconst defaultWidgetOptions: GroupDefaultWidgetOptions = {\n content: \"\",\n widgets: {},\n images: {},\n};\n\nconst groupWidgetLogic: WidgetLogic = {\n name: \"group\",\n defaultWidgetOptions,\n};\n\nexport default groupWidgetLogic;\n","import type {PerseusIFrameWidgetOptions} from \"../../data-schema\";\n\nexport default function getIFramePublicWidgetOptions(\n options: PerseusIFrameWidgetOptions,\n): PerseusIFrameWidgetOptions {\n return options;\n}\n","import getIFramePublicWidgetOptions from \"./iframe-util\";\n\nimport type {PerseusIFrameWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type IFrameDefaultWidgetOptions = Pick<\n PerseusIFrameWidgetOptions,\n | \"url\"\n | \"settings\"\n | \"width\"\n | \"height\"\n | \"allowFullScreen\"\n | \"allowTopNavigation\"\n>;\n\nconst defaultWidgetOptions: IFrameDefaultWidgetOptions = {\n url: \"\",\n settings: [{name: \"\", value: \"\"}],\n width: \"400\",\n height: \"400\",\n allowFullScreen: false,\n allowTopNavigation: false,\n};\n\nconst iframeWidgetLogic: WidgetLogic = {\n name: \"iframe\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getIFramePublicWidgetOptions,\n};\n\nexport default iframeWidgetLogic;\n","import type {PerseusImageWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type ImageDefaultWidgetOptions = Pick<\n PerseusImageWidgetOptions,\n \"title\" | \"range\" | \"box\" | \"backgroundImage\" | \"labels\" | \"alt\" | \"caption\"\n>;\n\nconst defaultWidgetOptions: ImageDefaultWidgetOptions = {\n title: \"\",\n range: [\n [0, 10],\n [0, 10],\n ],\n box: [400, 400],\n backgroundImage: {\n url: null,\n width: 0,\n height: 0,\n },\n labels: [],\n alt: \"\",\n caption: \"\",\n};\n\nconst imageWidgetLogic: WidgetLogic = {\n name: \"image\",\n defaultWidgetOptions,\n supportedAlignments: [\"block\", \"full-width\"],\n defaultAlignment: \"block\",\n};\n\nexport default imageWidgetLogic;\n","import type {PerseusInputNumberWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type InputNumberDefaultWidgetOptions = Pick<\n PerseusInputNumberWidgetOptions,\n | \"value\"\n | \"simplify\"\n | \"size\"\n | \"inexact\"\n | \"maxError\"\n | \"answerType\"\n | \"rightAlign\"\n>;\n\nconst defaultWidgetOptions: InputNumberDefaultWidgetOptions = {\n value: 0,\n simplify: \"required\",\n size: \"normal\",\n inexact: false,\n maxError: 0.1,\n answerType: \"number\",\n rightAlign: false,\n};\n\nconst inputNumberWidgetLogic: WidgetLogic = {\n name: \"input-number\",\n defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n};\n\nexport default inputNumberWidgetLogic;\n","import type {PerseusInteractionWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type InteractionDefaultWidgetOptions = Pick<\n PerseusInteractionWidgetOptions,\n \"graph\" | \"elements\"\n>;\n\nconst defaultWidgetOptions: InteractionDefaultWidgetOptions = {\n graph: {\n box: [400, 400],\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n tickStep: [1, 1],\n gridStep: [1, 1],\n markings: \"graph\",\n },\n elements: [],\n};\n\nconst interactionWidgetLogic: WidgetLogic = {\n name: \"interaction\",\n defaultWidgetOptions,\n};\n\nexport default interactionWidgetLogic;\n","import type {PerseusInteractiveGraphWidgetOptions} from \"@khanacademy/perseus-core\";\n\nexport type InteractiveGraphPublicWidgetOptions = Pick<\n PerseusInteractiveGraphWidgetOptions,\n | \"step\"\n | \"gridStep\"\n | \"snapStep\"\n | \"backgroundImage\"\n | \"markings\"\n | \"labels\"\n | \"showProtractor\"\n | \"showRuler\"\n | \"showTooltips\"\n | \"rulerLabel\"\n | \"rulerTicks\"\n | \"range\"\n | \"graph\"\n | \"lockedFigures\"\n | \"fullGraphAriaLabel\"\n | \"fullGraphAriaDescription\"\n>;\n\nexport default function getInteractiveGraphPublicWidgetOptions(\n options: PerseusInteractiveGraphWidgetOptions,\n): InteractiveGraphPublicWidgetOptions {\n const {correct: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getInteractiveGraphPublicWidgetOptions from \"./interactive-graph-util\";\n\nimport type {PerseusInteractiveGraphWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type InteractiveGraphDefaultWidgetOptions = Pick<\n PerseusInteractiveGraphWidgetOptions,\n | \"labels\"\n | \"range\"\n | \"step\"\n | \"backgroundImage\"\n | \"markings\"\n | \"showTooltips\"\n | \"showProtractor\"\n | \"graph\"\n | \"correct\"\n>;\n\nconst defaultWidgetOptions: InteractiveGraphDefaultWidgetOptions = {\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n backgroundImage: {\n url: null,\n },\n markings: \"graph\",\n showTooltips: false,\n showProtractor: false,\n graph: {\n type: \"linear\",\n },\n correct: {\n type: \"linear\",\n coords: null,\n },\n};\n\nconst interactiveGraphWidgetLogic: WidgetLogic = {\n name: \"interactive-graph\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getInteractiveGraphPublicWidgetOptions,\n};\n\nexport default interactiveGraphWidgetLogic;\n","import type {\n PerseusLabelImageMarker,\n PerseusLabelImageWidgetOptions,\n} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusLabelImageWidgetOptions type\n */\ntype LabelImagePublicWidgetOptions = {\n choices: PerseusLabelImageWidgetOptions[\"choices\"];\n imageUrl: PerseusLabelImageWidgetOptions[\"imageUrl\"];\n imageAlt: PerseusLabelImageWidgetOptions[\"imageAlt\"];\n imageHeight: PerseusLabelImageWidgetOptions[\"imageHeight\"];\n imageWidth: PerseusLabelImageWidgetOptions[\"imageWidth\"];\n markers: ReadonlyArray<LabelImageMarkerPublicData>;\n hideChoicesFromInstructions: PerseusLabelImageWidgetOptions[\"hideChoicesFromInstructions\"];\n multipleAnswers: PerseusLabelImageWidgetOptions[\"multipleAnswers\"];\n static: PerseusLabelImageWidgetOptions[\"static\"];\n};\n\ntype LabelImageMarkerPublicData = Pick<\n PerseusLabelImageMarker,\n \"x\" | \"y\" | \"label\"\n>;\n\nexport default function getLabelImagePublicWidgetOptions(\n options: PerseusLabelImageWidgetOptions,\n): LabelImagePublicWidgetOptions {\n return {\n ...options,\n markers: options.markers.map(getLabelImageMarkerPublicData),\n };\n}\n\nfunction getLabelImageMarkerPublicData(\n marker: PerseusLabelImageMarker,\n): LabelImageMarkerPublicData {\n const {answers: _, ...publicData} = marker;\n return publicData;\n}\n","import getLabelImagePublicWidgetOptions from \"./label-image-util\";\n\nimport type {PerseusLabelImageWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type LabelImageDefaultWidgetOptions = Pick<\n PerseusLabelImageWidgetOptions,\n | \"choices\"\n | \"imageAlt\"\n | \"imageUrl\"\n | \"imageWidth\"\n | \"imageHeight\"\n | \"markers\"\n | \"multipleAnswers\"\n | \"hideChoicesFromInstructions\"\n>;\n\nconst defaultWidgetOptions: LabelImageDefaultWidgetOptions = {\n choices: [],\n imageAlt: \"\",\n imageUrl: \"\",\n imageWidth: 0,\n imageHeight: 0,\n markers: [],\n multipleAnswers: false,\n hideChoicesFromInstructions: false,\n};\n\nconst labelImageWidgetLogic: WidgetLogic = {\n name: \"label-image\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getLabelImagePublicWidgetOptions,\n};\n\nexport default labelImageWidgetLogic;\n","import {seededRNG, shuffle} from \"@khanacademy/perseus-core\";\n\nimport type {PerseusMatcherWidgetOptions} from \"@khanacademy/perseus-core\";\n\n// TODO(LEMS-2841): Should be able to remove once getPublicWidgetOptions is hooked up\ntype MatcherInfo = {\n left: ReadonlyArray<string>;\n right: ReadonlyArray<string>;\n orderMatters: boolean;\n problemNum: number | null | undefined;\n};\n\ntype MatcherShuffleInfo = {\n left: ReadonlyArray<string>;\n right: ReadonlyArray<string>;\n orderMatters: boolean;\n};\n\n// TODO(LEMS-2841): Should be able to remove once getPublicWidgetOptions is hooked up\nexport const shuffleMatcher = (\n props: MatcherInfo,\n): {left: ReadonlyArray<string>; right: ReadonlyArray<string>} => {\n // Use the same random() function to shuffle both columns sequentially\n const rng = seededRNG(props.problemNum as number);\n\n let left;\n if (!props.orderMatters) {\n // If the order doesn't matter, don't shuffle the left column\n left = props.left;\n } else {\n left = shuffle(props.left, rng, /* ensurePermuted */ true);\n }\n\n const right = shuffle(props.right, rng, /* ensurePermuted */ true);\n\n return {left, right};\n};\n\n// TODO(LEMS-2841): Can shorten to shuffleMatcher after above function removed\nfunction shuffleMatcherWithRandom(data: MatcherShuffleInfo): {\n left: ReadonlyArray<string>;\n right: ReadonlyArray<string>;\n} {\n // Use the same random() function to shuffle both columns sequentially\n let left;\n if (!data.orderMatters) {\n // If the order doesn't matter, don't shuffle the left column\n left = data.left;\n } else {\n left = shuffle(data.left, Math.random, /* ensurePermuted */ true);\n }\n\n const right = shuffle(data.right, Math.random, /* ensurePermuted */ true);\n\n return {left, right};\n}\n\n/**\n * For details on the individual options, see the\n * PerseusMatcherWidgetOptions type\n */\ntype MatcherPublicWidgetOptions = {\n labels: PerseusMatcherWidgetOptions[\"labels\"];\n left: PerseusMatcherWidgetOptions[\"left\"];\n right: PerseusMatcherWidgetOptions[\"right\"];\n orderMatters: PerseusMatcherWidgetOptions[\"orderMatters\"];\n padding: PerseusMatcherWidgetOptions[\"padding\"];\n};\n\n/**\n * Given a PerseusMatcherWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getMatcherPublicWidgetOptions(\n options: PerseusMatcherWidgetOptions,\n): MatcherPublicWidgetOptions {\n const {left, right} = shuffleMatcherWithRandom(options);\n\n return {\n ...options,\n left: left,\n right: right,\n };\n}\n\nexport default getMatcherPublicWidgetOptions;\n","import getMatcherPublicWidgetOptions from \"./matcher-util\";\n\nimport type {PerseusMatcherWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type MatcherDefaultWidgetOptions = Pick<\n PerseusMatcherWidgetOptions,\n \"left\" | \"right\" | \"labels\" | \"orderMatters\" | \"padding\"\n>;\n\nconst defaultWidgetOptions: MatcherDefaultWidgetOptions = {\n left: [\"$x$\", \"$y$\", \"$z$\"],\n right: [\"$1$\", \"$2$\", \"$3$\"],\n labels: [\"test\", \"label\"],\n orderMatters: false,\n padding: true,\n};\n\nconst matcherWidgetLogic: WidgetLogic = {\n name: \"matcher\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getMatcherPublicWidgetOptions,\n};\n\nexport default matcherWidgetLogic;\n","import type {PerseusMatrixWidgetOptions} from \"@khanacademy/perseus-core\";\n\ntype MatrixPublicWidgetOptions = Pick<\n PerseusMatrixWidgetOptions,\n \"prefix\" | \"suffix\" | \"cursorPosition\" | \"matrixBoardSize\" | \"static\"\n>;\n\nexport default function getMatrixPublicWidgetOptions(\n options: PerseusMatrixWidgetOptions,\n): MatrixPublicWidgetOptions {\n const {answers: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getMatrixPublicWidgetOptions from \"./matrix-util\";\n\nimport type {PerseusMatrixWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type MatrixDefaultWidgetOptions = Pick<\n PerseusMatrixWidgetOptions,\n \"matrixBoardSize\" | \"answers\" | \"prefix\" | \"suffix\" | \"cursorPosition\"\n>;\n\nconst defaultWidgetOptions: MatrixDefaultWidgetOptions = {\n matrixBoardSize: [3, 3],\n answers: [[]],\n prefix: \"\",\n suffix: \"\",\n cursorPosition: [0, 0],\n};\n\nconst matrixWidgetLogic: WidgetLogic = {\n name: \"matrix\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getMatrixPublicWidgetOptions,\n};\n\nexport default matrixWidgetLogic;\n","import type {PerseusMeasurerWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 1, minor: 0};\n\nexport const widgetOptionsUpgrades = {\n \"1\": (v0options: any): PerseusMeasurerWidgetOptions => {\n const {imageUrl, imageTop, imageLeft, ...rest} = v0options;\n\n return {\n ...rest,\n image: {\n url: imageUrl,\n top: imageTop,\n left: imageLeft,\n },\n };\n },\n} as const;\n\nexport type MeasurerDefaultWidgetOptions = Pick<\n PerseusMeasurerWidgetOptions,\n | \"box\"\n | \"image\"\n | \"showProtractor\"\n | \"showRuler\"\n | \"rulerLabel\"\n | \"rulerTicks\"\n | \"rulerPixels\"\n | \"rulerLength\"\n>;\n\nexport const defaultWidgetOptions: MeasurerDefaultWidgetOptions = {\n box: [480, 480],\n image: {} as any,\n showProtractor: true,\n showRuler: false,\n rulerLabel: \"\",\n rulerTicks: 10,\n rulerPixels: 40,\n rulerLength: 10,\n};\n","import {\n currentVersion,\n defaultWidgetOptions,\n widgetOptionsUpgrades,\n} from \"./measurer-upgrade\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {MeasurerDefaultWidgetOptions} from \"./measurer-upgrade\";\n\nconst measurerWidgetLogic: WidgetLogic = {\n name: \"measurer\",\n version: currentVersion,\n widgetOptionsUpgrades: widgetOptionsUpgrades,\n defaultWidgetOptions: defaultWidgetOptions,\n};\n\nexport default measurerWidgetLogic;\n","import type {PerseusNumberLineWidgetOptions} from \"../../data-schema\";\n\ntype NumberLinePublicWidgetOptions = Pick<\n PerseusNumberLineWidgetOptions,\n | \"range\"\n | \"labelRange\"\n | \"labelStyle\"\n | \"labelTicks\"\n | \"isTickCtrl\"\n | \"divisionRange\"\n | \"numDivisions\"\n | \"snapDivisions\"\n | \"tickStep\"\n | \"initialX\"\n | \"showTooltips\"\n | \"static\"\n>;\n\nexport default function getNumberLinePublicWidgetOptions(\n options: PerseusNumberLineWidgetOptions,\n): NumberLinePublicWidgetOptions {\n const {correctX: _, correctRel: __, ...publicOptions} = options;\n return publicOptions;\n}\n","import getNumberLinePublicWidgetOptions from \"./number-line-util\";\n\nimport type {PerseusNumberLineWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type NumberLineDefaultWidgetOptions = Pick<\n PerseusNumberLineWidgetOptions,\n | \"range\"\n | \"labelRange\"\n | \"labelStyle\"\n | \"labelTicks\"\n | \"divisionRange\"\n | \"numDivisions\"\n | \"snapDivisions\"\n | \"tickStep\"\n | \"correctRel\"\n | \"correctX\"\n | \"initialX\"\n | \"showTooltips\"\n>;\n\nconst defaultWidgetOptions: NumberLineDefaultWidgetOptions = {\n range: [0, 10],\n\n labelRange: [null, null],\n labelStyle: \"decimal\",\n labelTicks: true,\n\n divisionRange: [1, 12],\n numDivisions: 5,\n snapDivisions: 2,\n\n tickStep: null,\n correctRel: \"eq\",\n correctX: null,\n initialX: null,\n\n showTooltips: false,\n};\n\nconst numberLineWidgetLogic: WidgetLogic = {\n name: \"number-line\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getNumberLinePublicWidgetOptions,\n};\n\nexport default numberLineWidgetLogic;\n","import type {\n PerseusNumericInputAnswer,\n PerseusNumericInputWidgetOptions,\n} from \"@khanacademy/perseus-core\";\n\ntype NumericInputAnswerPublicData = Pick<\n PerseusNumericInputAnswer,\n \"answerForms\" | \"simplify\" | \"status\"\n>;\n\n/**\n * For details on the individual options, see the\n * PerseusNumericInputWidgetOptions type\n */\ntype NumericInputPublicWidgetOptions = {\n labelText?: PerseusNumericInputWidgetOptions[\"labelText\"];\n size: PerseusNumericInputWidgetOptions[\"size\"];\n coefficient: PerseusNumericInputWidgetOptions[\"coefficient\"];\n rightAlign?: PerseusNumericInputWidgetOptions[\"rightAlign\"];\n static: PerseusNumericInputWidgetOptions[\"static\"];\n answers: ReadonlyArray<NumericInputAnswerPublicData>;\n};\n\n/**\n * This data from `answers` is used pre-scoring to give hints\n * to the learner regarding the format of accepted answers\n */\nfunction getNumericInputAnswerPublicData(\n answer: PerseusNumericInputAnswer,\n): NumericInputAnswerPublicData {\n const {answerForms, simplify, status} = answer;\n return {\n answerForms,\n simplify,\n status,\n };\n}\n\n/**\n * Given a PerseusNumericInputWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getNumericInputPublicWidgetOptions(\n options: PerseusNumericInputWidgetOptions,\n): NumericInputPublicWidgetOptions {\n const {answers, ...publicWidgetOptions} = options;\n return {\n ...publicWidgetOptions,\n answers: answers.map(getNumericInputAnswerPublicData),\n };\n}\n\nexport default getNumericInputPublicWidgetOptions;\n","import getNumericInputPublicWidgetOptions from \"./numeric-input-util\";\n\nimport type {PerseusNumericInputWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type NumericInputDefaultWidgetOptions = Pick<\n PerseusNumericInputWidgetOptions,\n \"answers\" | \"size\" | \"coefficient\" | \"labelText\" | \"rightAlign\"\n>;\n\nconst defaultWidgetOptions: NumericInputDefaultWidgetOptions = {\n answers: [\n {\n value: null,\n status: \"correct\",\n message: \"\",\n simplify: \"required\",\n answerForms: [],\n strict: false,\n maxError: null,\n },\n ],\n size: \"normal\",\n coefficient: false,\n labelText: \"\",\n rightAlign: false,\n};\n\nconst numericInputWidgetLogic: WidgetLogic = {\n name: \"numeric-input\",\n defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n getPublicWidgetOptions: getNumericInputPublicWidgetOptions,\n};\n\nexport default numericInputWidgetLogic;\n","import type {PerseusOrdererWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusOrdererWidgetOptions type\n */\ntype OrdererPublicWidgetOptions = {\n options: PerseusOrdererWidgetOptions[\"options\"];\n height: PerseusOrdererWidgetOptions[\"height\"];\n layout: PerseusOrdererWidgetOptions[\"layout\"];\n};\n\n/**\n * Given a PerseusOrdererWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getOrdererPublicWidgetOptions(\n options: PerseusOrdererWidgetOptions,\n): OrdererPublicWidgetOptions {\n return {\n options: options.options,\n height: options.height,\n layout: options.layout,\n };\n}\n\nexport default getOrdererPublicWidgetOptions;\n","import getOrdererPublicWidgetOptions from \"./orderer-util\";\n\nimport type {PerseusOrdererWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type OrdererDefaultWidgetOptions = Pick<\n PerseusOrdererWidgetOptions,\n \"correctOptions\" | \"otherOptions\" | \"height\" | \"layout\"\n>;\n\nconst defaultWidgetOptions: OrdererDefaultWidgetOptions = {\n correctOptions: [{content: \"$x$\"}] as any,\n otherOptions: [{content: \"$y$\"}] as any,\n height: \"normal\",\n layout: \"horizontal\",\n};\n\nconst ordererWidgetLogic: WidgetLogic = {\n name: \"orderer\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getOrdererPublicWidgetOptions,\n};\n\nexport default ordererWidgetLogic;\n","import type {PerseusPassageWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PassageDefaultWidgetOptions = Pick<\n PerseusPassageWidgetOptions,\n \"passageTitle\" | \"passageText\" | \"footnotes\" | \"showLineNumbers\"\n>;\n\nconst defaultWidgetOptions: PassageDefaultWidgetOptions = {\n passageTitle: \"\",\n passageText: \"\",\n footnotes: \"\",\n showLineNumbers: true,\n};\n\nconst passageWidgetLogic: WidgetLogic = {\n name: \"passage\",\n defaultWidgetOptions,\n};\n\nexport default passageWidgetLogic;\n","import type {PerseusPassageRefWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 0, minor: 1};\n\nexport type PassageRefDefaultWidgetOptions = Pick<\n PerseusPassageRefWidgetOptions,\n \"passageNumber\" | \"referenceNumber\" | \"summaryText\"\n>;\n\nexport const defaultWidgetOptions: PassageRefDefaultWidgetOptions = {\n passageNumber: 1,\n referenceNumber: 1,\n summaryText: \"\",\n};\n","import {currentVersion, defaultWidgetOptions} from \"./passage-ref-upgrade\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {PassageRefDefaultWidgetOptions} from \"./passage-ref-upgrade\";\n\nconst passageRefWidgetLogic: WidgetLogic = {\n name: \"passageRef\",\n version: currentVersion,\n defaultWidgetOptions: defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default passageRefWidgetLogic;\n","import type {PerseusPassageRefTargetWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PassageRefTargetDefaultWidgetOptions = Pick<\n PerseusPassageRefTargetWidgetOptions,\n \"content\"\n>;\n\nconst defaultWidgetOptions: PassageRefTargetDefaultWidgetOptions = {\n content: \"\",\n};\n\nconst passageRefTargetWidgetLogic: WidgetLogic = {\n name: \"passageRefTarget\",\n defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default passageRefTargetWidgetLogic;\n","import type {PerseusPhetSimulationWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PhetSimulationDefaultWidgetOptions = Pick<\n PerseusPhetSimulationWidgetOptions,\n \"url\" | \"description\"\n>;\n\nconst defaultWidgetOptions: PhetSimulationDefaultWidgetOptions = {\n url: \"\",\n description: \"\",\n};\n\nconst phetSimulationWidgetLogic: WidgetLogic = {\n name: \"phet-simulation\",\n defaultWidgetOptions,\n};\n\nexport default phetSimulationWidgetLogic;\n","import type {PerseusPlotterWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusPlotterWidgetOptions type\n */\ntype PlotterPublicWidgetOptions = Omit<PerseusPlotterWidgetOptions, \"correct\">;\n\n/**\n * Given a PerseusPlotterWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getPlotterPublicWidgetOptions(\n options: PerseusPlotterWidgetOptions,\n): PlotterPublicWidgetOptions {\n const {correct: _, ...publicOptions} = options;\n return publicOptions;\n}\n\nexport default getPlotterPublicWidgetOptions;\n","import getPlotterPublicWidgetOptions from \"./plotter-util\";\n\nimport type {PerseusPlotterWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PlotterDefaultWidgetOptions = Pick<\n PerseusPlotterWidgetOptions,\n | \"scaleY\"\n | \"maxY\"\n | \"snapsPerLine\"\n | \"correct\"\n | \"starting\"\n | \"type\"\n | \"labels\"\n | \"categories\"\n | \"picSize\"\n | \"picBoxHeight\"\n | \"plotDimensions\"\n | \"labelInterval\"\n | \"picUrl\"\n>;\n\nconst defaultWidgetOptions: PlotterDefaultWidgetOptions = {\n scaleY: 1,\n maxY: 10,\n snapsPerLine: 2,\n correct: [1],\n starting: [1],\n\n type: \"bar\",\n labels: [\"\", \"\"],\n categories: [\"\"],\n\n picSize: 30,\n picBoxHeight: 36,\n plotDimensions: [275, 200],\n labelInterval: 1,\n\n picUrl: null,\n};\n\nconst plotterWidgetLogic: WidgetLogic = {\n name: \"plotter\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getPlotterPublicWidgetOptions,\n};\n\nexport default plotterWidgetLogic;\n","import type {PerseusPythonProgramWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PythonProgramDefaultWidgetOptions = Pick<\n PerseusPythonProgramWidgetOptions,\n \"programID\" | \"height\"\n>;\n\nconst defaultWidgetOptions: PythonProgramDefaultWidgetOptions = {\n programID: \"\",\n height: 400,\n};\n\nconst pythonProgramWidgetLogic: WidgetLogic = {\n name: \"python-program\",\n defaultWidgetOptions,\n};\n\nexport default pythonProgramWidgetLogic;\n","import type {\n PerseusRadioChoice,\n PerseusRadioWidgetOptions,\n} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusRadioWidgetOptions type\n */\ntype RadioPublicWidgetOptions = {\n choices: ReadonlyArray<RadioChoicePublicData>;\n hasNoneOfTheAbove?: PerseusRadioWidgetOptions[\"hasNoneOfTheAbove\"];\n countChoices?: PerseusRadioWidgetOptions[\"countChoices\"];\n numCorrect?: PerseusRadioWidgetOptions[\"numCorrect\"];\n randomize?: PerseusRadioWidgetOptions[\"randomize\"];\n multipleSelect?: PerseusRadioWidgetOptions[\"multipleSelect\"];\n deselectEnabled?: PerseusRadioWidgetOptions[\"deselectEnabled\"];\n onePerLine?: PerseusRadioWidgetOptions[\"onePerLine\"];\n displayCount?: PerseusRadioWidgetOptions[\"displayCount\"];\n noneOfTheAbove?: PerseusRadioWidgetOptions[\"noneOfTheAbove\"];\n};\n\n/**\n * Only the options from each Radio choice that should be exposed to the client.\n */\ntype RadioChoicePublicData = Pick<\n PerseusRadioChoice,\n \"content\" | \"isNoneOfTheAbove\" | \"widgets\"\n>;\n\n/**\n * Given a PerseusRadioChoice object, return a new object with only the public\n * data that should be included in the Radio public widget options.\n */\nfunction getRadioChoicePublicData(\n choice: PerseusRadioChoice,\n): RadioChoicePublicData {\n const {content, isNoneOfTheAbove, widgets} = choice;\n return {\n content,\n isNoneOfTheAbove,\n widgets,\n };\n}\n\n/**\n * Shared functionality to determine if numCorrect is used, because:\n *\n * 1. numCorrect is conditionally used for rendering pre-scoring\n * 2. numCorrect also exposes information about answers\n *\n * So only include/use numCorrect when we know it's useful.\n */\nexport function usesNumCorrect(\n multipleSelect: PerseusRadioWidgetOptions[\"multipleSelect\"],\n countChoices: PerseusRadioWidgetOptions[\"countChoices\"],\n numCorrect: PerseusRadioWidgetOptions[\"numCorrect\"],\n) {\n return multipleSelect && countChoices && numCorrect;\n}\n\n/**\n * Given a PerseusRadioWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getRadioPublicWidgetOptions(\n options: PerseusRadioWidgetOptions,\n): RadioPublicWidgetOptions {\n const {numCorrect, choices, multipleSelect, countChoices} = options;\n\n return {\n ...options,\n numCorrect: usesNumCorrect(multipleSelect, countChoices, numCorrect)\n ? numCorrect\n : undefined,\n choices: choices.map(getRadioChoicePublicData),\n };\n}\n\nexport default getRadioPublicWidgetOptions;\n","import {\n currentVersion,\n defaultWidgetOptions,\n widgetOptionsUpgrades,\n} from \"./radio-upgrade\";\nimport getRadioPublicWidgetOptions from \"./radio-util\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {RadioDefaultWidgetOptions} from \"./radio-upgrade\";\n\nconst radioWidgetLogic: WidgetLogic = {\n name: \"radio\",\n version: currentVersion,\n widgetOptionsUpgrades: widgetOptionsUpgrades,\n defaultWidgetOptions: defaultWidgetOptions,\n getPublicWidgetOptions: getRadioPublicWidgetOptions,\n};\n\nexport default radioWidgetLogic;\n","import {shuffle} from \"@khanacademy/perseus-core\";\n\nimport type {PerseusSorterWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusSorterWidgetOptions type\n */\ntype SorterPublicWidgetOptions = {\n correct: PerseusSorterWidgetOptions[\"correct\"];\n padding: PerseusSorterWidgetOptions[\"padding\"];\n layout: PerseusSorterWidgetOptions[\"layout\"];\n isCorrectShuffled: boolean;\n};\n\n/**\n * Given a PerseusSorterWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getSorterPublicWidgetOptions(\n options: PerseusSorterWidgetOptions,\n): SorterPublicWidgetOptions {\n const shuffledCorrect = shuffle(\n options.correct,\n Math.random,\n /* ensurePermuted */ true,\n );\n\n return {\n ...options,\n // Note(Tamara): This does not provide correct answer information any longer.\n // To maintain compatibility with the original widget options, we are\n // keeping the key the same. Represents initial state of the cards here.\n correct: shuffledCorrect,\n // Note(Tamara): This new key is only added here with \"true\". There isn't\n // a place where it is set to false. It indicates that the correct field\n // has been shuffled and no longer contains correct answer info.\n isCorrectShuffled: true,\n };\n}\n\nexport default getSorterPublicWidgetOptions;\n","import getSorterPublicWidgetOptions from \"./sorter-util\";\n\nimport type {PerseusSorterWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type SorterDefaultWidgetOptions = Pick<\n PerseusSorterWidgetOptions,\n \"correct\" | \"layout\" | \"padding\"\n>;\n\nconst defaultWidgetOptions: SorterDefaultWidgetOptions = {\n correct: [\"$x$\", \"$y$\", \"$z$\"],\n layout: \"horizontal\",\n padding: true,\n};\n\nconst sorterWidgetLogic: WidgetLogic = {\n name: \"sorter\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getSorterPublicWidgetOptions,\n};\n\nexport default sorterWidgetLogic;\n","import type {PerseusTableWidgetOptions} from \"@khanacademy/perseus-core\";\n\ntype TablePublicWidgetOptions = Pick<\n PerseusTableWidgetOptions,\n \"headers\" | \"rows\" | \"columns\"\n>;\n\nexport default function getTablePublicWidgetOptions(\n options: PerseusTableWidgetOptions,\n): TablePublicWidgetOptions {\n const {answers: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getTablePublicWidgetOptions from \"./table-util\";\n\nimport type {PerseusTableWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type TableDefaultWidgetOptions = Pick<\n PerseusTableWidgetOptions,\n \"headers\" | \"rows\" | \"columns\" | \"answers\"\n>;\n\nconst defaultRows = 4;\nconst defaultColumns = 1;\n\n// initialize a 2D array\n// (defaultRows x defaultColumns) of empty strings\nconst answers = new Array(defaultRows)\n .fill(0)\n .map(() => new Array(defaultColumns).fill(\"\"));\n\nconst defaultWidgetOptions: TableDefaultWidgetOptions = {\n headers: [\"\"],\n rows: defaultRows,\n columns: defaultColumns,\n answers: answers,\n};\n\nconst tableWidgetLogic: WidgetLogic = {\n name: \"table\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getTablePublicWidgetOptions,\n};\n\nexport default tableWidgetLogic;\n","import type {PerseusVideoWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type VideoDefaultWidgetOptions = Pick<\n PerseusVideoWidgetOptions,\n \"location\"\n>;\n\nconst defaultWidgetOptions: VideoDefaultWidgetOptions = {\n location: \"\",\n};\n\nconst videoWidgetLogic: WidgetLogic = {\n name: \"video\",\n defaultWidgetOptions,\n supportedAlignments: [\"block\", \"float-left\", \"float-right\", \"full-width\"],\n defaultAlignment: \"block\",\n};\n\nexport default videoWidgetLogic;\n","import categorizerWidgetLogic from \"./categorizer\";\nimport csProgramWidgetLogic from \"./cs-program\";\nimport definitionWidgetLogic from \"./definition\";\nimport dropdownWidgetLogic from \"./dropdown\";\nimport explanationWidgetLogic from \"./explanation\";\nimport expressionWidgetLogic from \"./expression\";\nimport gradedGroupWidgetLogic from \"./graded-group\";\nimport gradedGroupSetWidgetLogic from \"./graded-group-set\";\nimport grapherWidgetLogic from \"./grapher\";\nimport groupWidgetLogic from \"./group\";\nimport iframeWidgetLogic from \"./iframe\";\nimport imageWidgetLogic from \"./image\";\nimport inputNumberWidgetLogic from \"./input-number\";\nimport interactionWidgetLogic from \"./interaction\";\nimport interactiveGraphWidgetLogic from \"./interactive-graph\";\nimport labelImageWidgetLogic from \"./label-image\";\nimport matcherWidgetLogic from \"./matcher\";\nimport matrixWidgetLogic from \"./matrix\";\nimport measurerWidgetLogic from \"./measurer\";\nimport numberLineWidgetLogic from \"./number-line\";\nimport numericInputWidgetLogic from \"./numeric-input\";\nimport ordererWidgetLogic from \"./orderer\";\nimport passageWidgetLogic from \"./passage\";\nimport passageRefWidgetLogic from \"./passage-ref\";\nimport passageRefTargetWidgetLogic from \"./passage-ref-target\";\nimport phetSimulationWidgetLogic from \"./phet-simulation\";\nimport plotterWidgetLogic from \"./plotter\";\nimport pythonProgramWidgetLogic from \"./python-program\";\nimport radioWidgetLogic from \"./radio\";\nimport sorterWidgetLogic from \"./sorter\";\nimport tableWidgetLogic from \"./table\";\nimport videoWidgetLogic from \"./video\";\n\nimport type {\n PublicWidgetOptionsFunction,\n WidgetLogic,\n} from \"./logic-export.types\";\nimport type {Alignment} from \"../types\";\n\nconst widgets = {};\n\nfunction registerWidget(type: string, logic: WidgetLogic) {\n widgets[type] = logic;\n}\n\nexport function isWidgetRegistered(type: string) {\n const widgetLogic = widgets[type];\n return !!widgetLogic;\n}\n\nexport function getCurrentVersion(type: string) {\n const widgetLogic = widgets[type];\n return widgetLogic?.version || {major: 0, minor: 0};\n}\n\n// TODO(LEMS-2870): getPublicWidgetOptionsFunction/PublicWidgetOptionsFunction\n// need better types\nexport const getPublicWidgetOptionsFunction = (\n name: string,\n): PublicWidgetOptionsFunction => {\n return widgets[name]?.getPublicWidgetOptions ?? ((i: any) => i);\n};\n\nexport function getWidgetOptionsUpgrades(type: string) {\n const widgetLogic = widgets[type];\n return widgetLogic?.widgetOptionsUpgrades || {};\n}\n\nexport function getDefaultWidgetOptions(type: string) {\n const widgetLogic = widgets[type];\n return widgetLogic?.defaultWidgetOptions || {};\n}\n\n/**\n * Handling for the optional alignments for widgets\n * See widget-container.jsx for details on how alignments are implemented.\n */\n\n/**\n * Returns the list of supported alignments for the given (string) widget\n * type. This is used primarily at editing time to display the choices\n * for the user.\n *\n * Supported alignments are given as an array of strings in the exports of\n * a widget's module.\n */\nexport const getSupportedAlignments = (\n type: string,\n): ReadonlyArray<Alignment> => {\n const widgetLogic = widgets[type];\n if (!widgetLogic?.supportedAlignments?.[0]) {\n // default alignments\n return [\"default\"];\n }\n return widgetLogic?.supportedAlignments;\n};\n\n/**\n * For the given (string) widget type, determine the default alignment for\n * the widget. This is used at rendering time to go from \"default\" alignment\n * to the actual alignment displayed on the screen.\n *\n * The default alignment is given either as a string (called\n * `defaultAlignment`) or a function (called `getDefaultAlignment`) on\n * the exports of a widget's module.\n */\nexport const getDefaultAlignment = (type: string): Alignment => {\n const widgetLogic = widgets[type];\n if (!widgetLogic?.defaultAlignment) {\n return \"block\";\n }\n return widgetLogic.defaultAlignment;\n};\n\nregisterWidget(\"categorizer\", categorizerWidgetLogic);\nregisterWidget(\"cs-program\", csProgramWidgetLogic);\nregisterWidget(\"definition\", definitionWidgetLogic);\nregisterWidget(\"dropdown\", dropdownWidgetLogic);\nregisterWidget(\"explanation\", explanationWidgetLogic);\nregisterWidget(\"expression\", expressionWidgetLogic);\nregisterWidget(\"graded-group\", gradedGroupWidgetLogic);\nregisterWidget(\"graded-group-set\", gradedGroupSetWidgetLogic);\nregisterWidget(\"grapher\", grapherWidgetLogic);\nregisterWidget(\"group\", groupWidgetLogic);\nregisterWidget(\"iframe\", iframeWidgetLogic);\nregisterWidget(\"image\", imageWidgetLogic);\nregisterWidget(\"input-number\", inputNumberWidgetLogic);\nregisterWidget(\"interaction\", interactionWidgetLogic);\nregisterWidget(\"interactive-graph\", interactiveGraphWidgetLogic);\nregisterWidget(\"label-image\", labelImageWidgetLogic);\nregisterWidget(\"matcher\", matcherWidgetLogic);\nregisterWidget(\"matrix\", matrixWidgetLogic);\nregisterWidget(\"measurer\", measurerWidgetLogic);\nregisterWidget(\"number-line\", numberLineWidgetLogic);\nregisterWidget(\"numeric-input\", numericInputWidgetLogic);\nregisterWidget(\"orderer\", ordererWidgetLogic);\nregisterWidget(\"passage\", passageWidgetLogic);\nregisterWidget(\"passage-ref\", passageRefWidgetLogic);\nregisterWidget(\"passage-ref-target\", passageRefTargetWidgetLogic);\nregisterWidget(\"phet-simulation\", phetSimulationWidgetLogic);\nregisterWidget(\"plotter\", plotterWidgetLogic);\nregisterWidget(\"python-program\", pythonProgramWidgetLogic);\nregisterWidget(\"radio\", radioWidgetLogic);\nregisterWidget(\"sorter\", sorterWidgetLogic);\nregisterWidget(\"table\", tableWidgetLogic);\nregisterWidget(\"video\", videoWidgetLogic);\n","import _ from \"underscore\";\n\nimport {Errors} from \"../error/errors\";\nimport {PerseusError} from \"../error/perseus-error\";\nimport {mapObject} from \"../utils/objective_\";\n\nimport {\n getCurrentVersion,\n getDefaultWidgetOptions,\n getSupportedAlignments,\n getWidgetOptionsUpgrades,\n isWidgetRegistered,\n} from \"./core-widget-registry\";\n\nimport type {PerseusWidget, PerseusWidgetsMap} from \"../data-schema\";\n\nconst DEFAULT_STATIC = false;\n\nexport const upgradeWidgetInfoToLatestVersion = (\n oldWidgetInfo: PerseusWidget,\n): PerseusWidget => {\n const type = oldWidgetInfo.type;\n // NOTE(jeremy): This looks like it could be replaced by fixing types so\n // that `type` is non-optional. But we're seeing this in Sentry today so I\n // suspect we have legacy data (potentially unpublished) and we should\n // figure that out before depending solely on types.\n if (!_.isString(type)) {\n throw new PerseusError(\n \"widget type must be a string, but was: \" + type,\n Errors.Internal,\n );\n }\n\n if (!isWidgetRegistered(type)) {\n // If we have a widget that isn't registered, we can't upgrade it\n // TODO(aria): Figure out what the best thing to do here would be\n return oldWidgetInfo;\n }\n\n // Unversioned widgets (pre-July 2014) are all implicitly 0.0\n const initialVersion = oldWidgetInfo.version || {major: 0, minor: 0};\n const latestVersion = getCurrentVersion(type);\n\n // If the widget version is later than what we understand (major\n // version is higher than latest, or major versions are equal and minor\n // version is higher than latest), don't perform any upgrades.\n if (\n initialVersion.major > latestVersion.major ||\n (initialVersion.major === latestVersion.major &&\n initialVersion.minor > latestVersion.minor)\n ) {\n return oldWidgetInfo;\n }\n\n // We do a clone here so that it's safe to mutate the input parameter\n // in propUpgrades functions (which I will probably accidentally do at\n // some point, and we would like to not break when that happens).\n let newEditorOptions = _.clone(oldWidgetInfo.options) || {};\n\n const upgradePropsMap = getWidgetOptionsUpgrades(type);\n\n // Empty props usually mean a newly created widget by the editor,\n // and are always considerered up-to-date.\n // Mostly, we'd rather not run upgrade functions on props that are\n // not complete.\n if (_.keys(newEditorOptions).length !== 0) {\n // We loop through all the versions after the current version of\n // the loaded widget, up to and including the latest version of the\n // loaded widget, and run the upgrade function to bring our loaded\n // widget's props up to that version.\n // There is a little subtlety here in that we call\n // upgradePropsMap[1] to upgrade *to* version 1,\n // (not from version 1).\n for (\n let nextVersion = initialVersion.major + 1;\n nextVersion <= latestVersion.major;\n nextVersion++\n ) {\n if (upgradePropsMap[String(nextVersion)]) {\n newEditorOptions =\n upgradePropsMap[String(nextVersion)](newEditorOptions);\n } else {\n throw new PerseusError(\n \"No upgrade found for widget. Cannot render.\",\n Errors.Internal,\n {\n metadata: {\n type,\n fromMajorVersion: nextVersion - 1,\n toMajorVersion: nextVersion,\n oldWidgetInfo: JSON.stringify(oldWidgetInfo),\n },\n },\n );\n }\n }\n }\n\n // Minor version upgrades (eg. new optional props) don't have\n // transform functions. Instead, we fill in the new props with their\n // defaults.\n const defaultOptions = getDefaultWidgetOptions(type);\n newEditorOptions = {\n ...defaultOptions,\n ...newEditorOptions,\n };\n\n let alignment = oldWidgetInfo.alignment;\n\n // Widgets that support multiple alignments will \"lock in\" the\n // alignment to the alignment that would be listed first in the\n // select box. If the widget only supports one alignment, the\n // alignment value will likely just end up as \"default\".\n if (alignment == null || alignment === \"default\") {\n alignment = getSupportedAlignments(type)?.[0];\n if (!alignment) {\n throw new PerseusError(\n \"No default alignment found when upgrading widget\",\n Errors.Internal,\n {metadata: {widgetType: type}},\n );\n }\n }\n\n let widgetStatic = oldWidgetInfo.static;\n\n if (widgetStatic == null) {\n widgetStatic = DEFAULT_STATIC;\n }\n\n return {\n ...oldWidgetInfo,\n // maintain other info, like type\n // After upgrading we guarantee that the version is up-to-date\n version: latestVersion,\n // Default graded to true (so null/undefined becomes true):\n graded: oldWidgetInfo.graded != null ? oldWidgetInfo.graded : true,\n alignment: alignment,\n static: widgetStatic,\n options: newEditorOptions,\n } as any;\n};\n\nexport function getUpgradedWidgetOptions(\n oldWidgetOptions: PerseusWidgetsMap,\n): PerseusWidgetsMap {\n return mapObject(oldWidgetOptions, (widgetInfo, widgetId) => {\n if (!widgetInfo.type || !widgetInfo.alignment) {\n const newValues: Record<string, any> = {};\n\n if (!widgetInfo.type) {\n // TODO: why does widget have no type?\n // We don't want to derive type from widget ID\n // see: LEMS-1845\n newValues.type = widgetId.split(\" \")[0];\n }\n\n if (!widgetInfo.alignment) {\n newValues.alignment = \"default\";\n }\n\n widgetInfo = {...widgetInfo, ...newValues};\n }\n\n return upgradeWidgetInfoToLatestVersion(widgetInfo) as any;\n });\n}\n","import _ from \"underscore\";\n\nimport {getPublicWidgetOptionsFunction} from \"../widgets/core-widget-registry\";\nimport {getUpgradedWidgetOptions} from \"../widgets/upgrade\";\n\nimport type {PerseusRenderer} from \"../data-schema\";\n\n/**\n * Upgrades widget options and removes answerful data for all the widgets in a\n * Perseus item.\n */\nexport default function splitPerseusItem(\n originalItem: PerseusRenderer,\n): PerseusRenderer {\n const item = _.clone(originalItem);\n const originalWidgets = item.widgets ?? {};\n\n const upgradedWidgets = getUpgradedWidgetOptions(originalWidgets);\n const splitWidgets = {};\n\n for (const [id, widget] of Object.entries(upgradedWidgets)) {\n const publicWidgetOptionsFun = getPublicWidgetOptionsFunction(\n widget.type,\n );\n\n splitWidgets[id] = {\n ...widget,\n options: publicWidgetOptionsFun(widget.options as any),\n };\n }\n\n return {\n ...item,\n widgets: splitWidgets,\n };\n}\n","/* Note(tamara): Brought over from the perseus package packages/perseus/src/util.ts file.\n May be useful to bring other perseus package utilities here. Contains utility functions\n and types used across multiple widgets for randomization and shuffling. */\n\nimport _ from \"underscore\";\n\ntype RNG = () => number;\n\nexport const seededRNG: (seed: number) => RNG = function (seed: number): RNG {\n let randomSeed = seed;\n\n return function () {\n // Robert Jenkins' 32 bit integer hash function.\n let seed = randomSeed;\n seed = (seed + 0x7ed55d16 + (seed << 12)) & 0xffffffff;\n seed = (seed ^ 0xc761c23c ^ (seed >>> 19)) & 0xffffffff;\n seed = (seed + 0x165667b1 + (seed << 5)) & 0xffffffff;\n seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;\n seed = (seed + 0xfd7046c5 + (seed << 3)) & 0xffffffff;\n seed = (seed ^ 0xb55a4f09 ^ (seed >>> 16)) & 0xffffffff;\n return (randomSeed = seed & 0xfffffff) / 0x10000000;\n };\n};\n\n// Shuffle an array using a given random seed or function.\n// If `ensurePermuted` is true, the input and output are guaranteed to be\n// distinct permutations.\nexport function shuffle<T>(\n array: ReadonlyArray<T>,\n randomSeed: number | RNG,\n ensurePermuted = false,\n): ReadonlyArray<T> {\n // Always return a copy of the input array\n const shuffled = _.clone(array);\n\n // Handle edge cases (input array is empty or uniform)\n if (\n !shuffled.length ||\n _.all(shuffled, function (value) {\n return _.isEqual(value, shuffled[0]);\n })\n ) {\n return shuffled;\n }\n\n let random;\n if (typeof randomSeed === \"function\") {\n random = randomSeed;\n } else {\n random = seededRNG(randomSeed);\n }\n\n do {\n // Fischer-Yates shuffle\n for (let top = shuffled.length; top > 0; top--) {\n const newEnd = Math.floor(random() * top);\n const temp = shuffled[newEnd];\n\n // @ts-expect-error - TS2542 - Index signature in type 'readonly T[]' only permits reading.\n shuffled[newEnd] = shuffled[top - 1];\n // @ts-expect-error - TS2542 - Index signature in type 'readonly T[]' only permits reading.\n shuffled[top - 1] = temp;\n }\n } while (ensurePermuted && _.isEqual(array, shuffled));\n\n return shuffled;\n}\n\nexport const random: RNG = seededRNG(new Date().getTime() & 0xffffffff);\n"],"names":["getMatrixSize","matrix","matrixSize","_","each","matrixRow","row","rowWidth","matrixCol","col","toString","length","Math","max","getDecimalSeparator","locale","_match$","numberWithDecimalSeparator","match","Intl","NumberFormat","format","approximateEqual","x","y","abs","approximateDeepEqual","Array","isArray","i","all","v","k","addWidget","id","getWidgetRegex","getWidgetIdsFromContent","content","widgets","localWidgetRegex","exec","push","getWidgetIdsFromContentByType","type","widgetMap","rv","widgetIdsInContent","forEach","widgetId","widget","deepClone","obj","map","MOVABLES","PLOT","PARABOLA","SINUSOID","canonicalSineCoefficients","coeffs","amplitude","angularFrequency","phase","verticalOffset","period","PI","canonicalTangentCoefficients","PlotDefaults","areEqual","coeffs1","coeffs2","movable","getPropsForCoeffs","fn","partial","getFunctionForCoeffs","Linear","extend","url","defaultCoords","getCoefficients","coords","p1","p2","denom","num","m","b","getEquationString","toFixed","Quadratic","h","a","c","Sinusoid","d","sin","Tangent","tan","Exponential","defaultAsymptote","extraCoordConstraint","newCoord","oldCoord","asymptote","graph","coord","extraAsymptoteConstraint","isValid","oldY","wasBelow","bottomMost","min","snapStep","topMost","allowReflectOverAsymptote","log","exp","Logarithm","oldX","wasLeft","leftMost","rightMost","flip","inverseCoeffs","AbsoluteValue","horizontalOffset","functionTypeMapping","linear","quadratic","sinusoid","tangent","exponential","logarithm","absolute_value","allTypes","keys","functionForType","isRealJSONParse","jsonParse","randomPhrase","buildRandomPhrase","randomHintPhrase","randomString","buildRandomString","testingObject","JSON","stringify","answerArea","calculator","chi2Table","financialCalculatorMonthlyPayment","financialCalculatorTimeToPayOff","financialCalculatorTotalAmount","periodicTable","periodicTableWithKey","tTable","zTable","hints","floor","random","itemDataVersion","major","minor","question","images","expression1","alignment","graded","options","answerForms","considered","form","key","simplify","value","ariaLabel","buttonSets","functions","static","times","visibleLabel","version","testJSON","buildTestData","replace","parsedTestJSON","parsedTestItemData","data","assessmentItem","item","itemData","capitalize","randomLength","randomLetter","String","fromCharCode","toUpperCase","phrases","modifierStart","modifierEnd","modifierIndex","join","testObject","success","failure","detail","isFailure","result","isSuccess","results","combineFailureDetails","values","failureDetails","reduce","ErrorTrackingParseContext","constructor","path","expected","badValue","wrapInArray","forSubtree","formatPath","formatPathSegment","segment","validIdentifier","test","message","conjoin","items","allButLast","slice","last","parse","parser","any","rawValue","ctx","array","elementParser","elementResults","elem","Result","concat","boolean","constant","acceptedValue","enumeration","acceptedValues","index","indexOf","isObject","Object","getPrototypeOf","prototype","nullable","parseValue","number","object","schema","ret","_extends","mismatches","prop","propParser","entries","undefined","optional","pair","parseA","parseB","rawA","rawB","resultA","resultB","pipeParsers","p","ParserPipeline","then","nextParser","composeParsers","parserA","parserB","partialResult","record","parseKey","entryCtx","keyResult","valueResult","string","trio","parseC","resultC","union","parseBranch","UnionBuilder","or","newBranch","either","defaulted","fallback","parseImages","width","height","parseWidget","parseType","parseOptions","parseWidgetWithVersion","parseVersion","parseCategorizerWidget","categories","randomizeItems","highlightLint","linterContext","contentType","paths","stack","parseCSProgramWidget","programID","programType","settings","name","showEditor","showButtons","parseDefinitionWidget","togglePrompt","definition","parseDropdownWidget","placeholder","choices","correct","parseExplanationWidget","showPrompt","hidePrompt","explanation","rawVal","parseWidgetsMap","KeypadKeys","deriveExtraKeys","widgetOptions","extraKeys","defaultKeys","uniqueExtraVariables","uniqueExtraConstants","answerForm","maybeExpr","KAS","parsed","expr","isGreek","symbol","toKey","isKey","includes","variable","getVars","maybeKey","getConsts","extraVariables","sort","extraConstants","convert","f","parseLegacyButtonSet","parseLegacyButtonSets","versionedWidgetOptions","latestMajorVersion","parseLatest","VersionedWidgetOptionsParserBuilder","latest","raw","majorVersion","parseThisVersion","migrateToLatest","parseOtherVersions","parseThisVersionAndMigrateToLatest","versionParseResult","parseVersionedObject","withMigrationFrom","parseOldVersion","migrateToNextVersion","old","stringOrNumberOrNullOrUndefined","parsePossiblyInvalidAnswerForm","removeInvalidAnswerForms","possiblyInvalid","valid","version2","parseExpressionWidgetV2","buttonsVisible","version1","parseExpressionWidgetV1","migrateV1ToV2","version0","parseExpressionWidgetV0","migrateV0ToV1","parseExpressionWidget","falseToNull","parseGradedGroupWidgetOptions","title","hasHint","hint","parsePerseusRenderer","widgetEnabled","immutableWidgets","parseGradedGroupWidget","parseGradedGroupSetWidget","gradedGroups","discriminatedUnionOn","discriminantKey","noMoreBranches","DiscriminatedUnionBuilder","withBranch","discriminantValue","parseNewVariant","parseNewBranch","discriminatedUnionBranch","parseVariant","parseOtherBranches","pairOfNumbers","pairOfPoints","parseGrapherWidget","availableTypes","backgroundImage","bottom","left","scale","box","editableSettings","gridStep","labels","markings","range","rulerLabel","rulerTicks","showProtractor","showRuler","showTooltips","step","parseGroupWidget","parseIframeWidget","allowFullScreen","allowTopNavigation","stringToNumber","parsedNumber","isNaN","emptyToZero","imageDimensionToNumber","dimensionOrUndefined","parsePerseusImageBackground","top","parseImageWidget","caption","alt","coordinates","booleanToString","parseInputNumberWidget","answerType","inexact","maxError","rightAlign","size","customKeypad","stringOrEmpty","parseFunctionElement","funcName","rangeMin","rangeMax","color","strokeDasharray","strokeWidth","parseLabelElement","label","coordX","coordY","parseLineElement","startX","startY","endX","endY","arrows","parseMovableLineElement","startSubscript","endSubscript","constraint","snap","constraintFn","constraintXMin","constraintXMax","constraintYMin","constraintYMax","parseMovablePointElement","varSubscript","parseParametricElement","parsePointElement","parseRectangleElement","parseInteractionWidget","tickStep","elements","ItemExtras","PerseusExpressionAnswerFormConsidered","lockedFigureColorNames","lockedFigureColors","blue","green","grayH","purple","pink","red","orange","lockedFigureFillStyles","none","white","translucent","solid","plotterPlotTypes","parsePerseusGraphTypeAngle","showAngles","allowReflexAngles","angleOffsetDeg","snapDegrees","startCoords","parsePerseusGraphTypeCircle","center","radius","parsePerseusGraphTypeLinear","parsePerseusGraphTypeLinearSystem","parsePerseusGraphTypeNone","parsePerseusGraphTypePoint","numPoints","parsePerseusGraphTypePolygon","numSides","showSides","snapTo","parsePerseusGraphTypeQuadratic","parsePerseusGraphTypeRay","parsePerseusGraphTypeSegment","numSegments","parsePerseusGraphTypeSinusoid","parsePerseusGraphType","parseLockedFigureColor","parseLockedFigureFillType","parseLockedLineStyle","parseLockedLabelType","text","parseLockedPointType","filled","parseLockedLineType","kind","points","lineStyle","showPoint1","showPoint2","parseLockedVectorType","parseLockedEllipseType","angle","fillStyle","strokeStyle","parseLockedPolygonType","showVertices","parseLockedFunctionDomain","Infinity","parseLockedFunctionType","equation","directionalAxis","domain","parseLockedFigure","parseInteractiveGraphWidget","lockedFigures","fullGraphLabel","fullGraphAriaDescription","parseLabelImageWidget","imageUrl","imageAlt","imageHeight","imageWidth","markers","answers","hideChoicesFromInstructions","multipleAnswers","parseMatcherWidget","right","orderMatters","padding","numberOrString","numeric","NaN","parseMatrixWidget","prefix","suffix","cursorPosition","matrixBoardSize","parseMeasurerWidget","image","rulerPixels","rulerLength","parseMoleculeRendererWidget","rotationAngle","smiles","emptyStringToNull","parseNumberLineWidget","labelRange","labelStyle","labelTicks","isTickCtrl","divisionRange","numDivisions","snapDivisions","correctRel","correctX","initialX","parseMathFormat","parseSimplify","parseNumericInputWidget","status","strict","labelText","coefficient","parseRenderer","largeToAuto","parseOrdererWidget","correctOptions","otherOptions","layout","parsePassageRefWidget","passageNumber","referenceNumber","summaryText","parsePassageWidget","footnotes","passageText","passageTitle","showLineNumbers","parsePhetSimulationWidget","description","parsePlotterWidget","maxY","scaleY","labelInterval","snapsPerLine","starting","picUrl","picSize","picBoxHeight","plotDimensions","parsePythonProgramWidget","currentVersion","deriveNumCorrect","numCorrect","filter","widgetOptionsUpgrades","v1props","upgraded","v0props","noneOfTheAbove","rest","_objectWithoutPropertiesLoose","_excluded","Error","hasNoneOfTheAbove","defaultWidgetOptions","displayCount","randomize","multipleSelect","countChoices","deselectEnabled","parseRadioWidgetV2","clue","isNoneOfTheAbove","onePerLine","parseRadioWidgetV1","parseRadioWidgetV0","parseRadioWidget","parseSorterWidget","parseTableWidget","headers","rows","columns","parseVideoWidget","location","widgetsMap","entryResult","parseWidgetsMapEntry","idComponentsResult","parseWidgetIdComponents","split","n","parseAndAssign","widgetResult","parseDeprecatedWidget","parseStringToNonNegativeInt","metadata","parsePerseusArticle","parseHint","parsePerseusAnswerArea","toAnswerArea","parsePerseusItem","answer","json","parseAndMigratePerseusItem","throwErrorIfCheatingDetected","migrateAndTypecheckPerseusItem","invalidObject","parseAndMigratePerseusArticle","migrateAndTypecheckPerseusArticle","addLibraryVersionToPerseusDebug","libraryName","libraryVersion","formattedVersion","globalThis","_globalThis$__perseus","__perseus_debug__","existingVersionEntry","allVersions","console","warn","libName","libVersion","Errors","freeze","Unknown","Internal","InvalidInput","NotAllowed","TransientService","Service","PerseusError","pluck","table","subKey","mapObject","lambda","getCategorizerPublicWidgetOptions","categorizerWidgetLogic","getPublicWidgetOptions","getCSProgramPublicWidgetOptions","DEFAULT_HEIGHT","csProgramWidgetLogic","supportedAlignments","definitionWidgetLogic","defaultAlignment","getDropdownPublicWidgetOptions","choice","dropdownWidgetLogic","explanationWidgetLogic","v1options","v0options","getExpressionPublicWidgetOptions","expressionWidgetLogic","gradedGroupWidgetLogic","gradedGroupSetWidgetLogic","getGrapherPublicWidgetOptions","publicOptions","grapherWidgetLogic","groupWidgetLogic","getIFramePublicWidgetOptions","iframeWidgetLogic","imageWidgetLogic","inputNumberWidgetLogic","interactionWidgetLogic","getInteractiveGraphPublicWidgetOptions","interactiveGraphWidgetLogic","getLabelImagePublicWidgetOptions","getLabelImageMarkerPublicData","marker","publicData","labelImageWidgetLogic","shuffleMatcher","props","rng","seededRNG","problemNum","shuffle","shuffleMatcherWithRandom","getMatcherPublicWidgetOptions","matcherWidgetLogic","getMatrixPublicWidgetOptions","matrixWidgetLogic","imageTop","imageLeft","measurerWidgetLogic","getNumberLinePublicWidgetOptions","numberLineWidgetLogic","getNumericInputAnswerPublicData","getNumericInputPublicWidgetOptions","publicWidgetOptions","numericInputWidgetLogic","getOrdererPublicWidgetOptions","ordererWidgetLogic","passageWidgetLogic","passageRefWidgetLogic","passageRefTargetWidgetLogic","phetSimulationWidgetLogic","getPlotterPublicWidgetOptions","plotterWidgetLogic","pythonProgramWidgetLogic","getRadioChoicePublicData","usesNumCorrect","getRadioPublicWidgetOptions","radioWidgetLogic","getSorterPublicWidgetOptions","shuffledCorrect","isCorrectShuffled","sorterWidgetLogic","getTablePublicWidgetOptions","defaultRows","defaultColumns","fill","tableWidgetLogic","videoWidgetLogic","registerWidget","logic","isWidgetRegistered","widgetLogic","getCurrentVersion","getPublicWidgetOptionsFunction","_widgets$name$getPubl","_widgets$name","getWidgetOptionsUpgrades","getDefaultWidgetOptions","getSupportedAlignments","_widgetLogic$supporte","getDefaultAlignment","DEFAULT_STATIC","upgradeWidgetInfoToLatestVersion","oldWidgetInfo","isString","initialVersion","latestVersion","newEditorOptions","clone","upgradePropsMap","nextVersion","fromMajorVersion","toMajorVersion","defaultOptions","_getSupportedAlignmen","widgetType","widgetStatic","getUpgradedWidgetOptions","oldWidgetOptions","widgetInfo","newValues","splitPerseusItem","originalItem","_item$widgets","originalWidgets","upgradedWidgets","splitWidgets","publicWidgetOptionsFun","seed","randomSeed","ensurePermuted","shuffled","isEqual","newEnd","temp","Date","getTime"],"mappings":";;;;;;AAEA,SAASA,aAAaA,CAACC,MAA4C,EAAE;AACjE,EAAA,MAAMC,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;;AAEzB;AACA;EACAC,CAAC,CAACF,MAAM,CAAC,CAACG,IAAI,CAAC,CAACC,SAAS,EAAEC,GAAG,KAAK;IAC/B,IAAIC,QAAQ,GAAG,CAAC,CAAA;IAChBJ,CAAC,CAACE,SAAS,CAAC,CAACD,IAAI,CAAC,CAACI,SAAS,EAAEC,GAAG,KAAK;MAClC,IAAID,SAAS,IAAI,IAAI,IAAIA,SAAS,CAACE,QAAQ,EAAE,CAACC,MAAM,EAAE;QAClDJ,QAAQ,GAAGE,GAAG,GAAG,CAAC,CAAA;AACt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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;;AAwDO,MAAMyQ,UAAU,GAAG;AACtB;AACA,YAAY;AACZ;AACA,WAAW;AACX;AACA,mCAAmC;AACnC;AACA,gCAAgC;AAChC;AACA,iCAAiC;AACjC;AACA,eAAe;AACf;AACA,sBAAsB;AACtB;AACA,QAAQ;AACR;AACA,QAAQ,EACF;;AAGV;AACA;AACA;AACA;;AAuBA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAGA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsGO,MAAMC,qCAAqC,GAAG,CACjD,SAAS,EACT,OAAO,EACP,UAAU,EACJ;;AA0CV;;MA2MaC,sBAAsB,GAAG,CAClC,MAAM,EACN,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,KAAK,EACC;AAIH,MAAMC,kBAAqD,GAAG;AACjEC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,KAAK,EAAE,SAAS;AAChBC,EAAAA,MAAM,EAAE,SAAS;AACjBC,EAAAA,IAAI,EA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k1B,OAAO,CAACvqB,KAAK,EAAEsqB,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AACxC,GAAC,CAAC,EACJ;AACE,IAAA,OAAOA,QAAQ,CAAA;AACnB,GAAA;AAEA,EAAA,IAAIrrB,MAAM,CAAA;AACV,EAAA,IAAI,OAAOmrB,UAAU,KAAK,UAAU,EAAE;AAClCnrB,IAAAA,MAAM,GAAGmrB,UAAU,CAAA;AACvB,GAAC,MAAM;AACHnrB,IAAAA,MAAM,GAAGkmB,SAAS,CAACiF,UAAU,CAAC,CAAA;AAClC,GAAA;EAEA,GAAG;AACC;AACA,IAAA,KAAK,IAAIjZ,GAAG,GAAGmZ,QAAQ,CAACz0B,MAAM,EAAEsb,GAAG,GAAG,CAAC,EAAEA,GAAG,EAAE,EAAE;MAC5C,MAAMqZ,MAAM,GAAG10B,IAAI,CAACkJ,KAAK,CAACC,MAAM,EAAE,GAAGkS,GAAG,CAAC,CAAA;AACzC,MAAA,MAAMsZ,IAAI,GAAGH,QAAQ,CAACE,MAAM,CAAC,CAAA;;AAE7B;MACAF,QAAQ,CAACE,MAAM,CAAC,GAAGF,QAAQ,CAACnZ,GAAG,GAAG,CAAC,CAAC,CAAA;AACpC;AACAmZ,MAAAA,QAAQ,CAACnZ,GAAG,GAAG,CAAC,CAAC,GAAGsZ,IAAI,CAAA;AAC5B,KAAA;GACH,QAAQJ,cAAc,IAAIh1B,CAAC,CAACk1B,OAAO,CAACxmB,KAAK,EAAEumB,QAAQ,CAAC,EAAA;AAErD,EAAA,OAAOA,QAAQ,CAAA;AACnB,CAAA;AAEarrB,MAAAA,MAAW,GAAGkmB,SAAS,CAAC,IAAIuF,IAAI,EAAE,CAACC,OAAO,EAAE,GAAG,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/get-matrix-size.ts","../../src/utils/get-decimal-separator.ts","../../src/utils/equality.ts","../../src/utils/widget-id-utils.ts","../../src/utils/deep-clone.ts","../../src/utils/grapher-util.ts","../../src/utils/is-real-json-parse.ts","../../../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../src/parse-perseus-json/result.ts","../../src/parse-perseus-json/error-tracking-parse-context.ts","../../src/parse-perseus-json/object-path.ts","../../src/parse-perseus-json/parse-failure-detail.ts","../../src/parse-perseus-json/parse.ts","../../src/parse-perseus-json/general-purpose-parsers/any.ts","../../src/parse-perseus-json/general-purpose-parsers/array.ts","../../src/parse-perseus-json/general-purpose-parsers/boolean.ts","../../src/parse-perseus-json/general-purpose-parsers/constant.ts","../../src/parse-perseus-json/general-purpose-parsers/enumeration.ts","../../src/parse-perseus-json/general-purpose-parsers/is-object.ts","../../src/parse-perseus-json/general-purpose-parsers/nullable.ts","../../src/parse-perseus-json/general-purpose-parsers/number.ts","../../src/parse-perseus-json/general-purpose-parsers/object.ts","../../src/parse-perseus-json/general-purpose-parsers/optional.ts","../../src/parse-perseus-json/general-purpose-parsers/pair.ts","../../src/parse-perseus-json/general-purpose-parsers/pipe-parsers.ts","../../src/parse-perseus-json/general-purpose-parsers/record.ts","../../src/parse-perseus-json/general-purpose-parsers/string.ts","../../src/parse-perseus-json/general-purpose-parsers/trio.ts","../../src/parse-perseus-json/general-purpose-parsers/union.ts","../../src/parse-perseus-json/general-purpose-parsers/defaulted.ts","../../src/parse-perseus-json/perseus-parsers/images-map.ts","../../src/parse-perseus-json/perseus-parsers/widget.ts","../../src/parse-perseus-json/perseus-parsers/categorizer-widget.ts","../../src/parse-perseus-json/perseus-parsers/cs-program-widget.ts","../../src/parse-perseus-json/perseus-parsers/definition-widget.ts","../../src/parse-perseus-json/perseus-parsers/dropdown-widget.ts","../../src/parse-perseus-json/perseus-parsers/explanation-widget.ts","../../src/keypad.ts","../../src/widgets/expression/derive-extra-keys.ts","../../src/parse-perseus-json/general-purpose-parsers/convert.ts","../../src/parse-perseus-json/perseus-parsers/legacy-button-sets.ts","../../src/parse-perseus-json/perseus-parsers/versioned-widget-options.ts","../../src/parse-perseus-json/perseus-parsers/expression-widget.ts","../../src/parse-perseus-json/perseus-parsers/graded-group-widget.ts","../../src/parse-perseus-json/perseus-parsers/graded-group-set-widget.ts","../../src/parse-perseus-json/general-purpose-parsers/discriminated-union.ts","../../src/parse-perseus-json/perseus-parsers/grapher-widget.ts","../../src/parse-perseus-json/perseus-parsers/group-widget.ts","../../src/parse-perseus-json/perseus-parsers/iframe-widget.ts","../../src/parse-perseus-json/general-purpose-parsers/string-to-number.ts","../../src/parse-perseus-json/perseus-parsers/perseus-image-background.ts","../../src/parse-perseus-json/perseus-parsers/image-widget.ts","../../src/parse-perseus-json/perseus-parsers/input-number-widget.ts","../../src/parse-perseus-json/perseus-parsers/interaction-widget.ts","../../src/data-schema.ts","../../src/parse-perseus-json/perseus-parsers/interactive-graph-widget.ts","../../src/parse-perseus-json/perseus-parsers/label-image-widget.ts","../../src/parse-perseus-json/perseus-parsers/matcher-widget.ts","../../src/parse-perseus-json/perseus-parsers/matrix-widget.ts","../../src/parse-perseus-json/perseus-parsers/measurer-widget.ts","../../src/parse-perseus-json/perseus-parsers/molecule-renderer-widget.ts","../../src/parse-perseus-json/perseus-parsers/number-line-widget.ts","../../src/parse-perseus-json/perseus-parsers/numeric-input-widget.ts","../../src/parse-perseus-json/perseus-parsers/orderer-widget.ts","../../src/parse-perseus-json/perseus-parsers/passage-ref-widget.ts","../../src/parse-perseus-json/perseus-parsers/passage-widget.ts","../../src/parse-perseus-json/perseus-parsers/phet-simulation-widget.ts","../../src/parse-perseus-json/perseus-parsers/plotter-widget.ts","../../src/parse-perseus-json/perseus-parsers/python-program-widget.ts","../../src/widgets/radio/radio-upgrade.ts","../../src/parse-perseus-json/perseus-parsers/radio-widget.ts","../../src/parse-perseus-json/perseus-parsers/sorter-widget.ts","../../src/parse-perseus-json/perseus-parsers/table-widget.ts","../../src/parse-perseus-json/perseus-parsers/video-widget.ts","../../src/parse-perseus-json/perseus-parsers/widgets-map.ts","../../src/parse-perseus-json/perseus-parsers/perseus-renderer.ts","../../src/parse-perseus-json/perseus-parsers/perseus-article.ts","../../src/parse-perseus-json/perseus-parsers/hint.ts","../../src/parse-perseus-json/perseus-parsers/perseus-answer-area.ts","../../src/parse-perseus-json/perseus-parsers/perseus-item.ts","../../src/parse-perseus-json/index.ts","../../../../utils/shared/add-library-version-to-perseus-debug.ts","../../src/version.ts","../../src/error/errors.ts","../../src/error/perseus-error.ts","../../src/utils/objective_.ts","../../src/widgets/categorizer/categorizer-util.ts","../../src/widgets/categorizer/index.ts","../../src/widgets/cs-program/cs-program-util.ts","../../src/widgets/cs-program/index.ts","../../src/widgets/definition/index.ts","../../src/widgets/dropdown/dropdown-util.ts","../../src/widgets/dropdown/index.ts","../../src/widgets/explanation/index.ts","../../src/widgets/expression/expression-upgrade.ts","../../src/widgets/expression/expression-util.ts","../../src/widgets/expression/index.ts","../../src/widgets/graded-group/index.ts","../../src/widgets/graded-group-set/index.ts","../../src/widgets/grapher/grapher-util.ts","../../src/widgets/grapher/index.ts","../../src/widgets/group/index.ts","../../src/widgets/iframe/iframe-util.ts","../../src/widgets/iframe/index.ts","../../src/widgets/image/index.ts","../../src/widgets/input-number/index.ts","../../src/widgets/interaction/index.ts","../../src/widgets/interactive-graph/interactive-graph-util.ts","../../src/widgets/interactive-graph/index.ts","../../src/widgets/label-image/label-image-util.ts","../../src/widgets/label-image/index.ts","../../src/widgets/matcher/matcher-util.ts","../../src/widgets/matcher/index.ts","../../src/widgets/matrix/matrix-util.ts","../../src/widgets/matrix/index.ts","../../src/widgets/measurer/measurer-upgrade.ts","../../src/widgets/measurer/index.ts","../../src/widgets/number-line/number-line-util.ts","../../src/widgets/number-line/index.ts","../../src/widgets/numeric-input/numeric-input-util.ts","../../src/widgets/numeric-input/index.ts","../../src/widgets/orderer/orderer-util.ts","../../src/widgets/orderer/index.ts","../../src/widgets/passage/index.ts","../../src/widgets/passage-ref/passage-ref-upgrade.ts","../../src/widgets/passage-ref/index.ts","../../src/widgets/passage-ref-target/index.ts","../../src/widgets/phet-simulation/index.ts","../../src/widgets/plotter/plotter-util.ts","../../src/widgets/plotter/index.ts","../../src/widgets/python-program/index.ts","../../src/widgets/radio/radio-util.ts","../../src/widgets/radio/index.ts","../../src/widgets/sorter/sorter-util.ts","../../src/widgets/sorter/index.ts","../../src/widgets/table/table-util.ts","../../src/widgets/table/index.ts","../../src/widgets/video/index.ts","../../src/widgets/core-widget-registry.ts","../../src/widgets/upgrade.ts","../../src/utils/split-perseus-item.ts","../../src/utils/random-util.ts"],"sourcesContent":["import _ from \"underscore\";\n\nfunction getMatrixSize(matrix: ReadonlyArray<ReadonlyArray<number>>) {\n const matrixSize = [1, 1];\n\n // We need to find the widest row and tallest column to get the correct\n // matrix size.\n _(matrix).each((matrixRow, row) => {\n let rowWidth = 0;\n _(matrixRow).each((matrixCol, col) => {\n if (matrixCol != null && matrixCol.toString().length) {\n rowWidth = col + 1;\n }\n });\n\n // Matrix width:\n matrixSize[1] = Math.max(matrixSize[1], rowWidth);\n\n // Matrix height:\n if (rowWidth > 0) {\n matrixSize[0] = Math.max(matrixSize[0], row + 1);\n }\n });\n return matrixSize;\n}\n\nexport default getMatrixSize;\n","/**\n * Get the character used for separating decimals.\n */\nconst getDecimalSeparator = (locale: string): string => {\n switch (locale) {\n // TODO(somewhatabstract): Remove this when Chrome supports the `ka`\n // locale properly.\n // https://github.com/formatjs/formatjs/issues/1526#issuecomment-559891201\n //\n // Supported locales in Chrome:\n // https://source.chromium.org/chromium/chromium/src/+/master:third_party/icu/scripts/chrome_ui_languages.list\n case \"ka\":\n return \",\";\n\n default:\n const numberWithDecimalSeparator = 1.1;\n // TODO(FEI-3647): Update to use .formatToParts() once we no longer have to\n // support Safari 12.\n const match = new Intl.NumberFormat(locale)\n .format(numberWithDecimalSeparator)\n // 0x661 is ARABIC-INDIC DIGIT ONE\n // 0x6F1 is EXTENDED ARABIC-INDIC DIGIT ONE\n // 0x967 is DEVANAGARI DIGIT ONE\n // 0x9e7 is BENGALI/BANGLA DIGIT ONE\n .match(/[^\\d\\u0661\\u06F1\\u0967\\u09e7]/);\n return match?.[0] ?? \".\";\n }\n};\n\nexport default getDecimalSeparator;\n","import _ from \"underscore\";\n\n/**\n * APPROXIMATE equality on numbers and primitives.\n */\nexport function approximateEqual<T>(x: T, y: T): boolean {\n if (typeof x === \"number\" && typeof y === \"number\") {\n return Math.abs(x - y) < 1e-9;\n }\n return x === y;\n}\n\n/**\n * Deep APPROXIMATE equality on primitives, numbers, arrays, and objects.\n * Recursive.\n */\nexport function approximateDeepEqual<T>(x: T, y: T): boolean {\n if (Array.isArray(x) && Array.isArray(y)) {\n if (x.length !== y.length) {\n return false;\n }\n for (let i = 0; i < x.length; i++) {\n if (!approximateDeepEqual(x[i], y[i])) {\n return false;\n }\n }\n return true;\n }\n if (Array.isArray(x) || Array.isArray(y)) {\n return false;\n }\n if (typeof x === \"function\" && typeof y === \"function\") {\n return approximateEqual(x, y);\n }\n if (typeof x === \"function\" || typeof y === \"function\") {\n return false;\n }\n if (typeof x === \"object\" && typeof y === \"object\" && !!x && !!y) {\n return (\n x === y ||\n (_.all(x, function (v, k) {\n // @ts-expect-error - TS2536 - Type 'CollectionKey<T>' cannot be used to index type 'T'.\n return approximateDeepEqual(y[k], v);\n }) &&\n _.all(y, function (v, k) {\n // @ts-expect-error - TS2536 - Type 'CollectionKey<T>' cannot be used to index type 'T'.\n return approximateDeepEqual(x[k], v);\n }))\n );\n }\n if ((typeof x === \"object\" && !!x) || (typeof y === \"object\" && !!y)) {\n return false;\n }\n return approximateEqual(x, y);\n}\n","import type {PerseusWidgetsMap} from \"../data-schema\";\n\n/**\n * Add a widget placeholder using the widget ID.\n * ex. addWidget(\"radio 1\") => \"[[☃ radio 1]]\"\n *\n * @param {string} id\n * @returns {string}\n */\nexport function addWidget(id: string): string {\n return `[[☃ ${id}]]`;\n}\n\n/**\n * Regex for widget placeholders in a string.\n *\n * First capture group is the widget ID (ex. 'radio 1')\n * Second capture group is the widget type (ex. \"radio)\n * exec return will look like: ['[[☃ radio 1]]', 'radio 1', 'radio']\n */\nexport function getWidgetRegex() {\n return /\\[\\[☃ ([A-Za-z0-9- ]+)\\]\\]/g;\n}\n\n/**\n * Extract all widget IDs, which includes the widget type and instance number.\n * example output: ['radio 1', 'categorizer 1', 'categorizor 2']\n *\n * Content should contain Perseus widget placeholders,\n * which look like: '[[☃ radio 1]]'.\n *\n * @param {string} content\n * @returns {ReadonlyArray<string>} widgetIds\n */\nexport function getWidgetIdsFromContent(\n content: string,\n): ReadonlyArray<string> {\n const widgets: Array<string> = [];\n const localWidgetRegex = getWidgetRegex();\n\n let match = localWidgetRegex.exec(content);\n\n while (match !== null) {\n widgets.push(match[1]);\n match = localWidgetRegex.exec(content);\n }\n\n return widgets;\n}\n\n/**\n * Get a list of widget IDs from content,\n * but only for specific widget types\n *\n * @param {string} type the type of widget (ie \"radio\")\n * @param {string} content the string to parse\n * @param {PerseusWidgetsMap} widgetMap widget ID to widget map\n * @returns {ReadonlyArray<string>} the widget type (ie \"radio\")\n */\nexport function getWidgetIdsFromContentByType(\n type: string,\n content: string,\n widgetMap: PerseusWidgetsMap,\n): ReadonlyArray<string> {\n const rv: Array<string> = [];\n const widgetIdsInContent = getWidgetIdsFromContent(content);\n widgetIdsInContent.forEach((widgetId) => {\n const widget = widgetMap[widgetId];\n if (widget?.type === type) {\n rv.push(widgetId);\n }\n });\n return rv;\n}\n","// TODO(benchristel): in the future, we may want to make deepClone work for\n// Record<string, Cloneable> as well. Currently, it only does arrays.\ntype Cloneable =\n | null\n | undefined\n | boolean\n | string\n | number\n | Cloneable[]\n | readonly Cloneable[];\nfunction deepClone<T extends Cloneable>(obj: T): T {\n if (Array.isArray(obj)) {\n return obj.map(deepClone) as T;\n }\n return obj;\n}\n\nexport default deepClone;\n","import _ from \"underscore\";\n\nimport {approximateDeepEqual} from \"./equality\";\n\nimport type {\n LinearType,\n QuadraticType,\n SinusoidType,\n TangentType,\n ExponentialType,\n LogarithmType,\n AbsoluteValueType,\n Coords,\n} from \"./grapher-types\";\nimport type {Coord} from \"../data-schema\";\n\nexport const MOVABLES = {\n PLOT: \"PLOT\",\n PARABOLA: \"PARABOLA\",\n SINUSOID: \"SINUSOID\",\n};\n\n// TODO(charlie): These really need to go into a utility file as they're being\n// used by both interactive-graph and now grapher.\nfunction canonicalSineCoefficients(coeffs: any) {\n // For a curve of the form f(x) = a * Sin(b * x - c) + d,\n // this function ensures that a, b > 0, and c is its\n // smallest possible positive value.\n let amplitude = coeffs[0];\n let angularFrequency = coeffs[1];\n let phase = coeffs[2];\n const verticalOffset = coeffs[3];\n\n // Guarantee a > 0\n if (amplitude < 0) {\n amplitude *= -1;\n angularFrequency *= -1;\n phase *= -1;\n }\n\n const period = 2 * Math.PI;\n // Guarantee b > 0\n if (angularFrequency < 0) {\n angularFrequency *= -1;\n phase *= -1;\n phase += period / 2;\n }\n\n // Guarantee c is smallest possible positive value\n while (phase > 0) {\n phase -= period;\n }\n while (phase < 0) {\n phase += period;\n }\n\n return [amplitude, angularFrequency, phase, verticalOffset];\n}\n\nfunction canonicalTangentCoefficients(coeffs: any) {\n // For a curve of the form f(x) = a * Tan(b * x - c) + d,\n // this function ensures that a, b > 0, and c is its\n // smallest possible positive value.\n let amplitude = coeffs[0];\n let angularFrequency = coeffs[1];\n let phase = coeffs[2];\n const verticalOffset = coeffs[3];\n\n // Guarantee a > 0\n if (amplitude < 0) {\n amplitude *= -1;\n angularFrequency *= -1;\n phase *= -1;\n }\n\n const period = Math.PI;\n // Guarantee b > 0\n if (angularFrequency < 0) {\n angularFrequency *= -1;\n phase *= -1;\n phase += period / 2;\n }\n\n // Guarantee c is smallest possible positive value\n while (phase > 0) {\n phase -= period;\n }\n while (phase < 0) {\n phase += period;\n }\n\n return [amplitude, angularFrequency, phase, verticalOffset];\n}\n\nconst PlotDefaults = {\n areEqual: function (\n coeffs1: ReadonlyArray<number>,\n coeffs2: ReadonlyArray<number>,\n ): boolean {\n return approximateDeepEqual(coeffs1, coeffs2);\n },\n movable: MOVABLES.PLOT,\n getPropsForCoeffs: function (coeffs: ReadonlyArray<number>): {fn: any} {\n return {\n // @ts-expect-error - TS2339 - Property 'getFunctionForCoeffs' does not exist on type '{ readonly areEqual: (coeffs1: any, coeffs2: any) => boolean; readonly Movable: any; readonly getPropsForCoeffs: (coeffs: any) => any; }'.\n fn: _.partial(this.getFunctionForCoeffs, coeffs),\n };\n },\n} as const;\n\nconst Linear: LinearType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/67aaf581e6d9ef9038c10558a1f70ac21c11c9f8.png\",\n\n defaultCoords: [\n [0.25, 0.75],\n [0.75, 0.75],\n ],\n\n getCoefficients: function (\n coords: Coords,\n ): ReadonlyArray<number> | undefined {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const denom = p2[0] - p1[0];\n const num = p2[1] - p1[1];\n\n if (denom === 0) {\n return;\n }\n\n const m = num / denom;\n const b = p2[1] - m * p2[0];\n return [m, b];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const m = coeffs[0];\n const b = coeffs[1];\n return m * x + b;\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs: ReadonlyArray<number> = this.getCoefficients(coords);\n const m: number = coeffs[0];\n const b: number = coeffs[1];\n return \"y = \" + m.toFixed(3) + \"x + \" + b.toFixed(3);\n },\n});\n\nconst Quadratic: QuadraticType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/e23d36e6fc29ee37174e92c9daba2a66677128ab.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.75, 0.75],\n ],\n movable: MOVABLES.PARABOLA,\n\n getCoefficients: function (coords: Coords): ReadonlyArray<number> {\n const p1 = coords[0];\n const p2 = coords[1];\n\n // Parabola with vertex (h, k) has form: y = a * (h - k)^2 + k\n const h = p1[0];\n const k = p1[1];\n\n // Use these to calculate familiar a, b, c\n const a = (p2[1] - k) / ((p2[0] - h) * (p2[0] - h));\n const b = -2 * h * a;\n const c = a * h * h + k;\n\n return [a, b, c];\n },\n\n getFunctionForCoeffs: function (\n coeffs: ReadonlyArray<number>,\n x: number,\n ): number {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (a * x + b) * x + c;\n },\n\n getPropsForCoeffs: function (coeffs: ReadonlyArray<number>): {\n a: number;\n b: number;\n c: number;\n } {\n return {\n a: coeffs[0],\n b: coeffs[1],\n c: coeffs[2],\n };\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs = this.getCoefficients(coords);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (\n \"y = \" +\n a.toFixed(3) +\n \"x^2 + \" +\n b.toFixed(3) +\n \"x + \" +\n c.toFixed(3)\n );\n },\n});\n\nconst Sinusoid: SinusoidType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/3d68e7718498475f53b206c2ab285626baf8857e.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.6, 0.6],\n ],\n movable: MOVABLES.SINUSOID,\n\n getCoefficients: function (coords: Coords) {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const a = p2[1] - p1[1];\n const b = Math.PI / (2 * (p2[0] - p1[0]));\n const c = p1[0] * b;\n const d = p1[1];\n\n return [a, b, c, d];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return a * Math.sin(b * x - c) + d;\n },\n\n getPropsForCoeffs: function (coeffs: ReadonlyArray<number>) {\n return {\n a: coeffs[0],\n b: coeffs[1],\n c: coeffs[2],\n d: coeffs[3],\n };\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs = this.getCoefficients(coords);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return (\n \"y = \" +\n a.toFixed(3) +\n \" sin(\" +\n b.toFixed(3) +\n \"x - \" +\n c.toFixed(3) +\n \") + \" +\n d.toFixed(3)\n );\n },\n\n areEqual: function (\n coeffs1: ReadonlyArray<number>,\n coeffs2: ReadonlyArray<number>,\n ) {\n return approximateDeepEqual(\n canonicalSineCoefficients(coeffs1),\n canonicalSineCoefficients(coeffs2),\n );\n },\n});\n\nconst Tangent: TangentType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/7db80d23c35214f98659fe1cf0765811c1bbfbba.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.75, 0.75],\n ],\n\n getCoefficients: function (coords: Coords) {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const a = p2[1] - p1[1];\n const b = Math.PI / (4 * (p2[0] - p1[0]));\n const c = p1[0] * b;\n const d = p1[1];\n\n return [a, b, c, d];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return a * Math.tan(b * x - c) + d;\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs = this.getCoefficients(coords);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n const d = coeffs[3];\n return (\n \"y = \" +\n a.toFixed(3) +\n \" sin(\" +\n b.toFixed(3) +\n \"x - \" +\n c.toFixed(3) +\n \") + \" +\n d.toFixed(3)\n );\n },\n\n areEqual: function (\n coeffs1: ReadonlyArray<number>,\n coeffs2: ReadonlyArray<number>,\n ) {\n return approximateDeepEqual(\n canonicalTangentCoefficients(coeffs1),\n canonicalTangentCoefficients(coeffs2),\n );\n },\n});\n\nconst Exponential: ExponentialType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/9cbfad55525e3ce755a31a631b074670a5dad611.png\",\n\n defaultCoords: [\n [0.5, 0.55],\n [0.75, 0.75],\n ],\n\n defaultAsymptote: [\n [0, 0.5],\n [1.0, 0.5],\n ],\n\n /**\n * Add extra constraints for movement of the points or asymptote (below):\n * newCoord: [x, y]\n * The end position of the point or asymptote endpoint\n * oldCoord: [x, y]\n * The old position of the point or asymptote endpoint\n * coords:\n * An array of coordinates representing the proposed end configuration\n * of the plot coordinates.\n * asymptote:\n * An array of coordinates representing the proposed end configuration\n * of the asymptote.\n *\n * Return: either a coordinate (to be used as the resulting coordinate of\n * the move) or a boolean, where `true` uses newCoord as the resulting\n * coordinate, and `false` uses oldCoord as the resulting coordinate.\n */\n extraCoordConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coords,\n asymptote: Coords,\n graph,\n ) {\n const y: number = asymptote[0][1];\n return _.all(coords, (coord) => coord[1] !== y);\n },\n\n extraAsymptoteConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coords,\n asymptote: Coords,\n graph,\n ): Coord {\n const y = newCoord[1];\n const isValid =\n _.all(coords, (coord) => coord[1] > y) ||\n _.all(coords, (coord) => coord[1] < y);\n\n if (isValid) {\n return [oldCoord[0], y];\n }\n // Snap the asymptote as close as possible, i.e., if the user moves\n // the mouse really quickly into an invalid region\n const oldY = oldCoord[1];\n const wasBelow = _.all(coords, (coord) => coord[1] > oldY);\n if (wasBelow) {\n const bottomMost = _.min(_.map(coords, (coord) => coord[1]));\n return [oldCoord[0], bottomMost - graph.snapStep[1]];\n }\n const topMost = _.max(_.map(coords, (coord) => coord[1]));\n return [oldCoord[0], topMost + graph.snapStep[1]];\n },\n\n allowReflectOverAsymptote: true,\n\n getCoefficients: function (\n coords: Coords,\n asymptote: Coords,\n ): ReadonlyArray<number> {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const c = asymptote[0][1];\n const b = Math.log((p1[1] - c) / (p2[1] - c)) / (p1[0] - p2[0]);\n const a = (p1[1] - c) / Math.exp(b * p1[0]);\n return [a, b, c];\n },\n\n getFunctionForCoeffs: function (\n coeffs: ReadonlyArray<number>,\n x: number,\n ): number {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return a * Math.exp(b * x) + c;\n },\n\n getEquationString: function (coords: Coords, asymptote: Coords) {\n if (!asymptote) {\n return null;\n }\n const coeffs = this.getCoefficients(coords, asymptote);\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (\n \"y = \" +\n a.toFixed(3) +\n \"e^(\" +\n b.toFixed(3) +\n \"x) + \" +\n c.toFixed(3)\n );\n },\n});\n\nconst Logarithm: LogarithmType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/f6491e99d34af34d924bfe0231728ad912068dc3.png\",\n\n defaultCoords: [\n [0.55, 0.5],\n [0.75, 0.75],\n ],\n\n defaultAsymptote: [\n [0.5, 0],\n [0.5, 1.0],\n ],\n\n extraCoordConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coord,\n asymptote: Coords,\n graph,\n ) {\n const x = asymptote[0][0];\n return (\n _.all(coords, (coord) => coord[0] !== x) &&\n coords[0][1] !== coords[1][1]\n );\n },\n\n extraAsymptoteConstraint: function (\n newCoord: Coord,\n oldCoord: Coord,\n coords: Coords,\n asymptote: Coords,\n graph,\n ): ReadonlyArray<number> {\n const x = newCoord[0];\n const isValid =\n _.all(coords, (coord) => coord[0] > x) ||\n _.all(coords, (coord) => coord[0] < x);\n\n if (isValid) {\n return [x, oldCoord[1]];\n }\n // Snap the asymptote as close as possible, i.e., if the user moves\n // the mouse really quickly into an invalid region\n const oldX = oldCoord[0];\n const wasLeft = _.all(coords, (coord) => coord[0] > oldX);\n if (wasLeft) {\n const leftMost = _.min(_.map(coords, (coord) => coord[0]));\n return [leftMost - graph.snapStep[0], oldCoord[1]];\n }\n const rightMost = _.max(_.map(coords, (coord) => coord[0]));\n return [rightMost + graph.snapStep[0], oldCoord[1]];\n },\n\n allowReflectOverAsymptote: true,\n\n getCoefficients: function (\n coords: Coords,\n asymptote: Coords,\n ): ReadonlyArray<number> | undefined {\n // It's easiest to calculate the logarithm's coefficients by thinking\n // about it as the inverse of the exponential, so we flip x and y and\n // perform some algebra on the coefficients. This also unifies the\n // logic between the two 'models'.\n const flip = (coord: Coord): Coord => [coord[1], coord[0]];\n const inverseCoeffs = Exponential.getCoefficients(\n _.map(coords, flip) as Coords,\n _.map(asymptote, flip) as Coords,\n );\n if (inverseCoeffs) {\n const c = -inverseCoeffs[2] / inverseCoeffs[0];\n const b = 1 / inverseCoeffs[0];\n const a = 1 / inverseCoeffs[1];\n return [a, b, c];\n }\n },\n\n getFunctionForCoeffs: function (\n coeffs: ReadonlyArray<number>,\n x: number,\n asymptote: Coords,\n ) {\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return a * Math.log(b * x + c);\n },\n\n getEquationString: function (coords: Coords, asymptote: Coords) {\n if (!asymptote) {\n return null;\n }\n const coeffs: ReadonlyArray<number> = this.getCoefficients(\n coords,\n asymptote,\n );\n const a = coeffs[0];\n const b = coeffs[1];\n const c = coeffs[2];\n return (\n \"y = ln(\" +\n a.toFixed(3) +\n \"x + \" +\n b.toFixed(3) +\n \") + \" +\n c.toFixed(3)\n );\n },\n});\n\nconst AbsoluteValue: AbsoluteValueType = _.extend({}, PlotDefaults, {\n url: \"https://ka-perseus-graphie.s3.amazonaws.com/8256a630175a0cb1d11de223d6de0266daf98721.png\",\n\n defaultCoords: [\n [0.5, 0.5],\n [0.75, 0.75],\n ],\n\n getCoefficients: function (\n coords: Coords,\n ): ReadonlyArray<number> | undefined {\n const p1 = coords[0];\n const p2 = coords[1];\n\n const denom = p2[0] - p1[0];\n const num = p2[1] - p1[1];\n\n if (denom === 0) {\n return;\n }\n\n let m = Math.abs(num / denom);\n if (p2[1] < p1[1]) {\n m *= -1;\n }\n const horizontalOffset = p1[0];\n const verticalOffset = p1[1];\n\n return [m, horizontalOffset, verticalOffset];\n },\n\n getFunctionForCoeffs: function (coeffs: ReadonlyArray<number>, x: number) {\n const m = coeffs[0];\n const horizontalOffset = coeffs[1];\n const verticalOffset = coeffs[2];\n return m * Math.abs(x - horizontalOffset) + verticalOffset;\n },\n\n getEquationString: function (coords: Coords) {\n const coeffs: ReadonlyArray<number> = this.getCoefficients(coords);\n const m = coeffs[0];\n const horizontalOffset = coeffs[1];\n const verticalOffset = coeffs[2];\n return (\n \"y = \" +\n m.toFixed(3) +\n \"| x - \" +\n horizontalOffset.toFixed(3) +\n \"| + \" +\n verticalOffset.toFixed(3)\n );\n },\n});\n\n/* Utility functions for dealing with graphing interfaces. */\nconst functionTypeMapping = {\n linear: Linear,\n quadratic: Quadratic,\n sinusoid: Sinusoid,\n tangent: Tangent,\n exponential: Exponential,\n logarithm: Logarithm,\n absolute_value: AbsoluteValue,\n} as const;\n\nexport const allTypes: any = _.keys(functionTypeMapping);\n\nexport type FunctionTypeMappingKeys = keyof typeof functionTypeMapping;\n\ntype ConditionalGraderType<T extends FunctionTypeMappingKeys> =\n // prettier-ignore\n T extends \"linear\" ? LinearType\n : T extends \"quadratic\" ? QuadraticType\n : T extends \"sinusoid\" ? SinusoidType\n : T extends \"tangent\" ? TangentType\n : T extends \"exponential\" ? ExponentialType\n : T extends \"logarithm\" ? LogarithmType\n : T extends \"absolute_value\" ? AbsoluteValueType\n : never;\n\nexport function functionForType<T extends FunctionTypeMappingKeys>(\n type: T,\n): ConditionalGraderType<T> {\n // @ts-expect-error: TypeScript doesn't know how to use deal with generics\n // and conditional types in this way.\n return functionTypeMapping[type];\n}\n","import {approximateDeepEqual} from \"./equality\";\n\nexport function isRealJSONParse(jsonParse: typeof JSON.parse): boolean {\n const randomPhrase = buildRandomPhrase();\n const randomHintPhrase = buildRandomPhrase();\n const randomString = buildRandomString();\n const testingObject = JSON.stringify({\n answerArea: {\n calculator: false,\n chi2Table: false,\n financialCalculatorMonthlyPayment: false,\n financialCalculatorTimeToPayOff: false,\n financialCalculatorTotalAmount: false,\n periodicTable: false,\n periodicTableWithKey: false,\n tTable: false,\n zTable: false,\n },\n hints: [randomHintPhrase, `=${Math.floor(Math.random() * 50) + 1}`],\n itemDataVersion: {major: 0, minor: 1},\n question: {\n content: `${randomPhrase}`,\n images: {},\n widgets: {\n expression1: {\n alignment: \"default\",\n graded: false,\n options: {\n answerForms: [\n {\n considered: \"wrong\",\n form: false,\n key: 0,\n simplify: false,\n value: `${randomString}`,\n },\n ],\n ariaLabel: \"Answer\",\n buttonSets: [\"basic\"],\n functions: [\"f\", \"g\", \"h\"],\n static: true,\n times: false,\n visibleLabel: \"Answer\",\n },\n static: true,\n type: \"expression\",\n version: {major: 1, minor: 0},\n },\n },\n },\n });\n const testJSON = buildTestData(testingObject.replace(/\"/g, '\\\\\"'));\n const parsedTestJSON = jsonParse(testJSON);\n const parsedTestItemData: string =\n parsedTestJSON.data.assessmentItem.item.itemData;\n return approximateDeepEqual(parsedTestItemData, testingObject);\n}\n\nfunction buildRandomString(capitalize: boolean = false) {\n let randomString: string = \"\";\n const randomLength = Math.floor(Math.random() * 8) + 3;\n for (let i = 0; i < randomLength; i++) {\n const randomLetter = String.fromCharCode(\n 97 + Math.floor(Math.random() * 26),\n );\n randomString +=\n capitalize && i === 0 ? randomLetter.toUpperCase() : randomLetter;\n }\n return randomString;\n}\n\nfunction buildRandomPhrase() {\n const phrases: string[] = [];\n const randomLength = Math.floor(Math.random() * 10) + 5;\n for (let i = 0; i < randomLength; i++) {\n phrases.push(buildRandomString(i === 0));\n }\n const modifierStart = [\"**\", \"$\"];\n const modifierEnd = [\"**\", \"$\"];\n const modifierIndex = Math.floor(Math.random() * modifierStart.length);\n return `${modifierStart[modifierIndex]}${phrases.join(\" \")}${modifierEnd[modifierIndex]}`;\n}\n\nfunction buildTestData(testObject: string) {\n return `{\"data\":{\"assessmentItem\":{\"__typename\":\"AssessmentItemOrError\",\"error\":null,\"item\":{\"__typename\":\"AssessmentItem\",\"id\":\"x890b3c70f3e8f4a6\",\"itemData\":\"${testObject}\",\"problemType\":\"Type 1\",\"sha\":\"c7284a3ad65214b4e62bccce236d92f7f5d35941\"}}}}`;\n}\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import invariant from \"tiny-invariant\";\n\nexport type Result<S, F> = Success<S> | Failure<F>;\n\nexport type Success<T> = {type: \"success\"; value: T};\nexport type Failure<T> = {type: \"failure\"; detail: T};\n\nexport function success<T>(value: T): Success<T> {\n return {type: \"success\", value};\n}\n\nexport function failure<T>(detail: T): Failure<T> {\n return {type: \"failure\", detail};\n}\n\nexport function isFailure<S, F>(result: Result<S, F>): result is Failure<F> {\n return result.type === \"failure\";\n}\n\nexport function isSuccess<S, F>(result: Result<S, F>): result is Success<S> {\n return result.type === \"success\";\n}\n\nexport function assertFailure<S, F>(\n result: Result<S, F>,\n): asserts result is Failure<F> {\n invariant(\n isFailure(result),\n \"expected result to be a Failure, but got a Success\",\n );\n}\n\nexport function assertSuccess<S, F>(\n result: Result<S, F>,\n): asserts result is Success<S> {\n invariant(\n isSuccess(result),\n \"expected result to be a Success, but got a Failure\",\n );\n}\n\n/**\n * @returns a function that transforms the `detail` value of any Failure result\n * passed to it, and leaves Success results unchanged. `mapFailure` is curried\n * for easy composition with Array.map(), mu-lambda's pipe(), etc.\n * @param f the function to apply to Failure `detail`s.\n */\nexport function mapFailure<S, DetailIn, DetailOut>(\n f: (detail: DetailIn) => DetailOut,\n): (result: Result<S, DetailIn>) => Result<S, DetailOut> {\n return (result) => {\n if (isFailure(result)) {\n return failure(f(result.detail));\n }\n return result;\n };\n}\n\n// Result's `all` function is similar to Promise.all: given an array of\n// results, it returns success if all succeeded, and failure if any failed.\nexport function all<S, F>(\n results: Array<Result<S, F>>,\n combineFailureDetails: (a: F, b: F) => F = (a) => a,\n): Result<S[], F> {\n const values: S[] = [];\n const failureDetails: F[] = [];\n for (const result of results) {\n if (result.type === \"success\") {\n values.push(result.value);\n } else {\n failureDetails.push(result.detail);\n }\n }\n\n if (failureDetails.length > 0) {\n return failure(failureDetails.reduce(combineFailureDetails));\n }\n return success(values);\n}\n","import {failure, success} from \"./result\";\n\nimport type {ParseContext, Mismatch, PathSegment} from \"./parser-types\";\nimport type {Failure, Success} from \"./result\";\n\nexport class ErrorTrackingParseContext implements ParseContext {\n constructor(private readonly path: PathSegment[]) {}\n\n failure(\n expected: string | string[],\n badValue: unknown,\n ): Failure<Mismatch[]> {\n return failure([\n {\n expected: wrapInArray(expected),\n badValue,\n path: this.path,\n },\n ]);\n }\n\n forSubtree(key: PathSegment): ParseContext {\n return new ErrorTrackingParseContext([...this.path, key]);\n }\n\n success<T>(value: T): Success<T> {\n return success(value);\n }\n}\n\nfunction wrapInArray(a: string | string[]): string[] {\n return Array.isArray(a) ? a : [a];\n}\n","import type {PathSegment} from \"./parser-types\";\n\nexport function formatPath(path: PathSegment[]): string {\n return \"(root)\" + path.map(formatPathSegment).join(\"\");\n}\n\nfunction formatPathSegment(segment: PathSegment): string {\n if (typeof segment === \"string\") {\n return validIdentifier.test(segment)\n ? \".\" + segment\n : `[${JSON.stringify(segment)}]`;\n }\n return `[${segment.toString()}]`;\n}\n\nconst validIdentifier = /^[A-Za-z$_][A-Za-z$_0-9]*$/;\n","import {formatPath} from \"./object-path\";\n\nimport type {Mismatch} from \"./parser-types\";\n\nexport function message(failure: Mismatch): string {\n const expected = conjoin(failure.expected);\n const path = formatPath(failure.path);\n const badValue = JSON.stringify(failure.badValue);\n return `At ${path} -- expected ${expected}, but got ${badValue}`;\n}\n\nfunction conjoin(items: string[]): string {\n switch (items.length) {\n // TODO(benchristel): handle 0 if this is reused elsewhere.\n case 1:\n return items[0];\n case 2:\n return items.join(\" or \");\n default: {\n const allButLast = items.slice(0, items.length - 1);\n const last = items[items.length - 1];\n return allButLast.join(\", \") + \", or \" + last;\n }\n }\n}\n","import {ErrorTrackingParseContext} from \"./error-tracking-parse-context\";\nimport {message} from \"./parse-failure-detail\";\nimport {failure, isFailure} from \"./result\";\n\nimport type {Parser} from \"./parser-types\";\nimport type {Result} from \"./result\";\n\nexport function parse<T>(value: unknown, parser: Parser<T>): Result<T, string> {\n const result = parser(value, new ErrorTrackingParseContext([]));\n if (isFailure(result)) {\n return failure(result.detail.map(message).join(\"; \"));\n }\n return result;\n}\n","import type {Parser} from \"../parser-types\";\n\nexport const any: Parser<any> = (rawValue, ctx) => ctx.success(rawValue);\n","import * as Result from \"../result\";\n\nimport type {ParseContext, Parser} from \"../parser-types\";\n\nexport function array<T>(elementParser: Parser<T>): Parser<T[]> {\n return (rawValue: unknown, ctx: ParseContext) => {\n if (!Array.isArray(rawValue)) {\n return ctx.failure(\"array\", rawValue);\n }\n const elementResults = rawValue.map((elem, i) =>\n elementParser(elem, ctx.forSubtree(i)),\n );\n return Result.all(elementResults, concat);\n };\n}\n\nfunction concat<T>(a: T[], b: T[]): T[] {\n return [...a, ...b];\n}\n","import type {ParseContext, ParseResult} from \"../parser-types\";\n\nexport function boolean(\n rawValue: unknown,\n ctx: ParseContext,\n): ParseResult<boolean> {\n if (typeof rawValue === \"boolean\") {\n return ctx.success(rawValue);\n }\n return ctx.failure(\"boolean\", rawValue);\n}\n","import type {Parser} from \"../parser-types\";\n\ntype Primitive = string | number | boolean | null | undefined;\n\nexport function constant<T extends Primitive>(acceptedValue: T): Parser<T> {\n return (rawValue, ctx) => {\n if (rawValue !== acceptedValue) {\n return ctx.failure(String(JSON.stringify(acceptedValue)), rawValue);\n }\n return ctx.success(acceptedValue);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport function enumeration<T extends readonly string[]>(\n ...acceptedValues: T\n): Parser<T[number]> {\n return (rawValue, ctx) => {\n if (typeof rawValue === \"string\") {\n const index = acceptedValues.indexOf(rawValue);\n if (index > -1) {\n return ctx.success(acceptedValues[index]);\n }\n }\n const expected = acceptedValues.map((v) => JSON.stringify(v));\n return ctx.failure(expected, rawValue);\n };\n}\n","export function isObject(x: unknown): x is Record<keyof any, unknown> {\n return x != null && Object.getPrototypeOf(x) === Object.prototype;\n}\n","import type {Parser} from \"../parser-types\";\n\nexport function nullable<T>(parseValue: Parser<T>): Parser<T | null> {\n return (rawValue, ctx) => {\n if (rawValue === null) {\n return ctx.success(rawValue);\n }\n return parseValue(rawValue, ctx);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport const number: Parser<number> = (rawValue, ctx) => {\n if (typeof rawValue === \"number\") {\n return ctx.success(rawValue);\n }\n return ctx.failure(\"number\", rawValue);\n};\n","import {failure, isSuccess} from \"../result\";\n\nimport {isObject} from \"./is-object\";\n\nimport type {Mismatch, ParsedValue, Parser} from \"../parser-types\";\n\ntype ObjectSchema = Record<keyof any, Parser<any>>;\n\nexport function object<S extends ObjectSchema>(\n schema: S,\n): Parser<{[K in keyof S]: ParsedValue<S[K]>}> {\n return (rawValue, ctx) => {\n if (!isObject(rawValue)) {\n return ctx.failure(\"object\", rawValue);\n }\n\n const ret: any = {...rawValue};\n const mismatches: Mismatch[] = [];\n for (const [prop, propParser] of Object.entries(schema)) {\n const result = propParser(rawValue[prop], ctx.forSubtree(prop));\n if (isSuccess(result)) {\n if (result.value !== undefined || prop in rawValue) {\n ret[prop] = result.value;\n }\n } else {\n mismatches.push(...result.detail);\n }\n }\n\n if (mismatches.length > 0) {\n return failure(mismatches);\n }\n return ctx.success(ret);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport function optional<T>(parseValue: Parser<T>): Parser<T | undefined> {\n return (rawValue, ctx) => {\n if (rawValue === undefined) {\n return ctx.success(rawValue);\n }\n return parseValue(rawValue, ctx);\n };\n}\n","import {isFailure} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function pair<A, B>(\n parseA: Parser<A>,\n parseB: Parser<B>,\n): Parser<[A, B]> {\n return (rawValue, ctx) => {\n if (!Array.isArray(rawValue)) {\n return ctx.failure(\"array\", rawValue);\n }\n if (rawValue.length !== 2) {\n return ctx.failure(\"array of length 2\", rawValue);\n }\n const [rawA, rawB] = rawValue;\n const resultA = parseA(rawA, ctx.forSubtree(0));\n if (isFailure(resultA)) {\n return resultA;\n }\n const resultB = parseB(rawB, ctx.forSubtree(1));\n if (isFailure(resultB)) {\n return resultB;\n }\n\n return ctx.success([resultA.value, resultB.value]);\n };\n}\n","import {isFailure} from \"../result\";\n\nimport type {\n ParseContext,\n ParsedValue,\n Parser,\n PartialParser,\n} from \"../parser-types\";\n\nexport function pipeParsers<T>(p: Parser<T>): ParserPipeline<T> {\n return new ParserPipeline(p);\n}\n\nexport class ParserPipeline<T> {\n constructor(public readonly parser: Parser<T>) {}\n\n then<U>(nextParser: PartialParser<T, U>): ParserPipeline<U> {\n return new ParserPipeline<U>(composeParsers(this.parser, nextParser));\n }\n}\n\nfunction composeParsers<\n A extends Parser<any>,\n B extends PartialParser<ParsedValue<A>, any>,\n>(parserA: A, parserB: B): Parser<ParsedValue<B>> {\n return (rawValue: unknown, ctx: ParseContext) => {\n const partialResult = parserA(rawValue, ctx);\n if (isFailure(partialResult)) {\n return partialResult;\n }\n\n return parserB(partialResult.value, ctx);\n };\n}\n","import {failure, isFailure, isSuccess} from \"../result\";\n\nimport {isObject} from \"./is-object\";\n\nimport type {Mismatch, Parser} from \"../parser-types\";\n\nexport function record<K extends string, V>(\n parseKey: Parser<K>,\n parseValue: Parser<V>,\n): Parser<Record<K, V>> {\n return (rawValue, ctx) => {\n if (!isObject(rawValue)) {\n return ctx.failure(\"object\", rawValue);\n }\n\n const result = {} as Record<K, V>;\n const mismatches: Mismatch[] = [];\n for (const [key, value] of Object.entries(rawValue)) {\n const entryCtx = ctx.forSubtree(key);\n const keyResult = parseKey(key, entryCtx);\n if (isFailure(keyResult)) {\n mismatches.push(...keyResult.detail);\n }\n\n const valueResult = parseValue(value, entryCtx);\n if (isFailure(valueResult)) {\n mismatches.push(...valueResult.detail);\n }\n\n if (isSuccess(keyResult) && isSuccess(valueResult)) {\n result[keyResult.value] = valueResult.value;\n }\n }\n\n if (mismatches.length > 0) {\n return failure(mismatches);\n }\n return ctx.success(result);\n };\n}\n","import type {Parser} from \"../parser-types\";\n\nexport const string: Parser<string> = (rawValue, ctx) => {\n if (typeof rawValue === \"string\") {\n return ctx.success(rawValue);\n }\n return ctx.failure(\"string\", rawValue);\n};\n","import {isFailure} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function trio<A, B, C>(\n parseA: Parser<A>,\n parseB: Parser<B>,\n parseC: Parser<C>,\n): Parser<[A, B, C]> {\n return (rawValue, ctx) => {\n if (!Array.isArray(rawValue)) {\n return ctx.failure(\"array\", rawValue);\n }\n if (rawValue.length !== 3) {\n return ctx.failure(\"array of length 3\", rawValue);\n }\n\n const resultA = parseA(rawValue[0], ctx.forSubtree(0));\n if (isFailure(resultA)) {\n return resultA;\n }\n\n const resultB = parseB(rawValue[1], ctx.forSubtree(1));\n if (isFailure(resultB)) {\n return resultB;\n }\n\n const resultC = parseC(rawValue[2], ctx.forSubtree(2));\n if (isFailure(resultC)) {\n return resultC;\n }\n\n return ctx.success([resultA.value, resultB.value, resultC.value]);\n };\n}\n","import {isSuccess} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function union<T>(parseBranch: Parser<T>): UnionBuilder<T> {\n return new UnionBuilder(parseBranch);\n}\n\nexport class UnionBuilder<T> {\n constructor(public parser: Parser<T>) {}\n\n or<New>(newBranch: Parser<New>) {\n return new UnionBuilder<T | New>(either(this.parser, newBranch));\n }\n}\n\nfunction either<A, B>(parseA: Parser<A>, parseB: Parser<B>): Parser<A | B> {\n return (rawValue, ctx) => {\n const resultA = parseA(rawValue, ctx);\n if (isSuccess(resultA)) {\n return resultA;\n }\n\n return parseB(rawValue, ctx);\n };\n}\n","import {success} from \"../result\";\n\nimport type {Parser} from \"../parser-types\";\n\nexport function defaulted<T, Default>(\n parser: Parser<T>,\n fallback: (missingValue: null | undefined) => Default,\n): Parser<T | Default> {\n return (rawValue, ctx) => {\n if (rawValue == null) {\n return success(fallback(rawValue));\n }\n return parser(rawValue, ctx);\n };\n}\n","import {number, object, record, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport type {PerseusImageDetail} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseImages: Parser<{[key: string]: PerseusImageDetail}> =\n defaulted(\n record(\n string,\n object({\n width: number,\n height: number,\n }),\n ),\n () => ({}),\n );\n","import {\n boolean,\n nullable,\n number,\n object,\n optional,\n string,\n} from \"../general-purpose-parsers\";\n\nimport type {WidgetOptions} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport function parseWidget<Type extends string, Options>(\n parseType: Parser<Type>,\n parseOptions: Parser<Options>,\n): Parser<WidgetOptions<Type, Options>> {\n return object({\n type: parseType,\n static: optional(boolean),\n graded: optional(boolean),\n alignment: optional(string),\n options: parseOptions,\n key: optional(nullable(number)),\n version: optional(\n object({\n major: number,\n minor: number,\n }),\n ),\n });\n}\n\nexport function parseWidgetWithVersion<\n Version extends {major: number; minor: number} | undefined,\n Type extends string,\n Options,\n>(\n parseVersion: Parser<Version>,\n parseType: Parser<Type>,\n parseOptions: Parser<Options>,\n): Parser<WidgetOptions<Type, Options>> {\n return object({\n type: parseType,\n static: optional(boolean),\n graded: optional(boolean),\n alignment: optional(string),\n options: parseOptions,\n key: optional(nullable(number)),\n version: parseVersion,\n });\n}\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {CategorizerWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseCategorizerWidget: Parser<CategorizerWidget> = parseWidget(\n constant(\"categorizer\"),\n object({\n items: array(string),\n categories: array(string),\n randomizeItems: defaulted(boolean, () => false),\n static: defaulted(boolean, () => false),\n values: array(defaulted(number, () => 0)),\n highlightLint: optional(boolean),\n linterContext: optional(\n object({\n contentType: string,\n paths: array(string),\n stack: array(string),\n }),\n ),\n }),\n);\n","import {\n any,\n array,\n boolean,\n constant,\n number,\n object,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {CSProgramWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseCSProgramWidget: Parser<CSProgramWidget> = parseWidget(\n constant(\"cs-program\"),\n object({\n programID: string,\n programType: any,\n settings: array(object({name: string, value: string})),\n showEditor: boolean,\n showButtons: boolean,\n height: number,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {boolean, constant, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {DefinitionWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseDefinitionWidget: Parser<DefinitionWidget> = parseWidget(\n constant(\"definition\"),\n object({\n togglePrompt: string,\n definition: string,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n array,\n boolean,\n constant,\n object,\n string,\n optional,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {DropdownWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseDropdownWidget: Parser<DropdownWidget> = parseWidget(\n constant(\"dropdown\"),\n object({\n placeholder: defaulted(string, () => \"\"),\n ariaLabel: optional(string),\n visibleLabel: optional(string),\n static: defaulted(boolean, () => false),\n choices: array(\n object({\n content: string,\n correct: boolean,\n }),\n ),\n }),\n);\n","import {boolean, constant, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {ExplanationWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseExplanationWidget: Parser<ExplanationWidget> = parseWidget(\n constant(\"explanation\"),\n object({\n showPrompt: string,\n hidePrompt: string,\n explanation: string,\n // We wrap parseWidgetsMap in a function here to make sure it is not\n // referenced before it is defined. There is an import cycle between\n // this file and widgets-map.ts that could cause it to be undefined.\n widgets: defaulted(\n (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n () => ({}),\n ),\n static: defaulted(boolean, () => false),\n }),\n);\n","export const KeypadKeys = [\n \"PLUS\",\n \"MINUS\",\n \"NEGATIVE\",\n \"TIMES\",\n \"DIVIDE\",\n \"DECIMAL\",\n \"PERIOD\",\n \"PERCENT\",\n \"CDOT\",\n \"EQUAL\",\n \"NEQ\",\n \"GT\",\n \"LT\",\n \"GEQ\",\n \"LEQ\", // mobile native only\n \"FRAC_INCLUSIVE\", // mobile native only\n \"FRAC_EXCLUSIVE\", // mobile native only\n \"FRAC\",\n \"EXP\",\n \"EXP_2\",\n \"EXP_3\",\n \"SQRT\",\n \"CUBE_ROOT\",\n \"RADICAL\",\n \"LEFT_PAREN\",\n \"RIGHT_PAREN\",\n \"LN\",\n \"LOG\",\n \"LOG_N\",\n \"SIN\",\n \"COS\", // TODO(charlie): Add in additional Greek letters.,\n \"TAN\",\n \"PI\",\n \"THETA\",\n \"UP\",\n \"RIGHT\",\n \"DOWN\",\n \"LEFT\",\n \"BACKSPACE\",\n \"DISMISS\",\n \"JUMP_OUT_PARENTHESES\",\n \"JUMP_OUT_EXPONENT\",\n \"JUMP_OUT_BASE\",\n \"JUMP_INTO_NUMERATOR\",\n \"JUMP_OUT_NUMERATOR\",\n \"JUMP_OUT_DENOMINATOR\", // Multi-functional keys.\n \"NUM_0\",\n \"NUM_1\",\n \"NUM_2\",\n \"NUM_3\",\n \"NUM_4\",\n \"NUM_5\",\n \"NUM_6\",\n \"NUM_7\",\n \"NUM_8\",\n \"NUM_9\",\n \"a\",\n \"b\",\n \"c\",\n \"d\",\n \"e\",\n \"f\",\n \"g\",\n \"h\",\n \"i\",\n \"j\",\n \"k\",\n \"l\",\n \"m\",\n \"n\",\n \"o\",\n \"p\",\n \"q\",\n \"r\",\n \"s\",\n \"t\",\n \"u\",\n \"v\",\n \"w\",\n \"x\",\n \"y\",\n \"z\",\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n \"N\",\n \"O\",\n \"P\",\n \"Q\",\n \"R\",\n \"S\",\n \"T\",\n \"U\",\n \"V\",\n \"W\",\n \"X\",\n \"Y\",\n \"Z\",\n] as const;\n\nexport type KeypadKey = (typeof KeypadKeys)[number];\n\nexport type KeypadType = \"FRACTION\" | \"EXPRESSION\";\n\nexport type KeypadConfiguration = {\n keypadType: KeypadType;\n extraKeys?: ReadonlyArray<KeypadKey>;\n times?: boolean;\n scientific?: boolean;\n};\n\n// Used by KeypadContext to pass around a renderer reference\nexport interface KeypadContextRendererInterface {\n blur(): void;\n}\n","import * as KAS from \"@khanacademy/kas\";\n\nimport {\n type KeypadKey,\n type KeypadConfiguration,\n KeypadKeys,\n} from \"../../keypad\";\n\nimport type {PerseusExpressionWidgetOptions} from \"../../data-schema\";\n\n/**\n * Scrape the answer forms for any variables or contants (like Pi)\n * that need to be included as keys on the keypad.\n */\nfunction deriveExtraKeys(\n widgetOptions: PerseusExpressionWidgetOptions,\n): KeypadConfiguration[\"extraKeys\"] {\n if (widgetOptions.extraKeys) {\n return widgetOptions.extraKeys as ReadonlyArray<KeypadKey>;\n }\n\n // If there are no extra symbols available, we include Pi anyway, so\n // that the \"extra symbols\" button doesn't appear empty.\n const defaultKeys: ReadonlyArray<KeypadKey> = [\"PI\"];\n\n if (widgetOptions.answerForms == null) {\n return defaultKeys;\n }\n\n // Extract any and all variables and constants from the answer forms.\n const uniqueExtraVariables: Partial<Record<KeypadKey, boolean>> = {};\n const uniqueExtraConstants: Partial<Record<KeypadKey, boolean>> = {};\n for (const answerForm of widgetOptions.answerForms) {\n const maybeExpr = KAS.parse(answerForm.value, widgetOptions);\n if (maybeExpr.parsed) {\n const expr = maybeExpr.expr;\n\n // The keypad expects Greek letters to be capitalized (e.g., it\n // requires `PI` instead of `pi`). Right now, it only supports Pi\n // and Theta, so we special-case.\n const isGreek = (symbol: any) =>\n symbol === \"pi\" || symbol === \"theta\";\n const toKey = (symbol: any) =>\n isGreek(symbol) ? symbol.toUpperCase() : symbol;\n const isKey = (key: string): key is KeypadKey =>\n KeypadKeys.includes(key as KeypadKey);\n\n for (const variable of expr.getVars()) {\n const maybeKey = toKey(variable);\n if (isKey(maybeKey)) {\n uniqueExtraVariables[maybeKey] = true;\n }\n }\n for (const constant of expr.getConsts()) {\n const maybeKey = toKey(constant);\n if (isKey(maybeKey)) {\n uniqueExtraConstants[maybeKey] = true;\n }\n }\n }\n }\n\n // TODO(charlie): Alert the keypad as to which of these symbols should be\n // treated as functions.\n const extraVariables = Object.keys(\n uniqueExtraVariables,\n ).sort() as ReadonlyArray<KeypadKey>;\n\n const extraConstants = Object.keys(\n uniqueExtraConstants,\n ).sort() as ReadonlyArray<KeypadKey>;\n\n const extraKeys = [...extraVariables, ...extraConstants];\n if (!extraKeys.length) {\n return defaultKeys;\n }\n\n return extraKeys;\n}\n\nexport default deriveExtraKeys;\n","import type {PartialParser} from \"../parser-types\";\n\n// Given a function, creates a PartialParser that converts one type to another\n// using that function. The returned parser never fails.\nexport function convert<A, B>(f: (value: A) => B): PartialParser<A, B> {\n return (rawValue, ctx) => ctx.success(f(rawValue));\n}\n","import {array, enumeration} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nexport const parseLegacyButtonSet = enumeration(\n \"basic\",\n \"basic+div\",\n \"trig\",\n \"prealgebra\",\n \"logarithms\",\n \"basic relations\",\n \"advanced relations\",\n \"scientific\",\n);\n\nexport const parseLegacyButtonSets = defaulted(\n array(parseLegacyButtonSet),\n // NOTE(benchristel): I copied the default buttonSets from\n // expression.tsx. See the parse-perseus-json/README.md for\n // an explanation of why we want to duplicate the default here.\n () => [\"basic\", \"trig\", \"prealgebra\", \"logarithms\"] as const,\n);\n","import {\n isObject,\n number,\n object,\n pipeParsers,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {isFailure} from \"../result\";\n\nimport type {Version} from \"../../data-schema\";\nimport type {ParseContext, Parser} from \"../parser-types\";\n\ntype Versioned = {\n version?: Version;\n};\n\n/**\n * Creates a parser for a widget options type with multiple major versions. Old\n * versions are migrated to the latest version. The parse fails if the input\n * data does not match any of the versions.\n *\n * @example\n * const parseOptions = versionedWidgetOptions(3, parseOptionsV3)\n * .withMigrationFrom(2, parseOptionsV2, migrateV2ToV3)\n * .withMigrationFrom(1, parseOptionsV1, migrateV1ToV2)\n * .withMigrationFrom(0, parseOptionsV0, migrateV0ToV1)\n * .parser;\n *\n * @param latestMajorVersion the latest major version of the widget options.\n * @param parseLatest a {@link Parser} for the latest version of the widget\n * options.\n * @returns a builder object, to which migrations from earlier versions can be\n * added. Migrations must be added in \"reverse chronological\" order as in the\n * example above.\n */\nexport function versionedWidgetOptions<Latest extends Versioned>(\n latestMajorVersion: number,\n parseLatest: Parser<Latest>,\n): VersionedWidgetOptionsParserBuilder<Latest, Latest> {\n return new VersionedWidgetOptionsParserBuilder(\n latestMajorVersion,\n parseLatest,\n (latest) => latest,\n (raw, ctx) =>\n ctx.failure(\"widget options with a known version number\", raw),\n );\n}\n\nclass VersionedWidgetOptionsParserBuilder<\n // The latest version of the widget options\n Latest extends Versioned,\n // A version of the widget options which we want to migrate to Latest.\n MigratableWidgetOptions extends Versioned,\n> {\n public parser: Parser<Latest>;\n\n constructor(\n majorVersion: number,\n parseThisVersion: Parser<MigratableWidgetOptions>,\n private migrateToLatest: (m: MigratableWidgetOptions) => Latest,\n private parseOtherVersions: Parser<Latest>,\n ) {\n const parseThisVersionAndMigrateToLatest = pipeParsers(\n parseThisVersion,\n ).then(convert(this.migrateToLatest)).parser;\n\n this.parser = (raw: unknown, ctx: ParseContext) => {\n if (!isObject(raw)) {\n return ctx.failure(\"object\", raw);\n }\n\n const versionParseResult = parseVersionedObject(raw, ctx);\n if (isFailure(versionParseResult)) {\n return versionParseResult;\n }\n\n if (versionParseResult.value.version.major !== majorVersion) {\n return this.parseOtherVersions(raw, ctx);\n }\n\n return parseThisVersionAndMigrateToLatest(raw, ctx);\n };\n }\n\n /**\n * Add a migration from an old version of the widget options.\n */\n withMigrationFrom<Old extends Versioned>(\n majorVersion: number,\n parseOldVersion: Parser<Old>,\n migrateToNextVersion: (old: Old) => MigratableWidgetOptions,\n ): VersionedWidgetOptionsParserBuilder<Latest, Old> {\n const parseOtherVersions = this.parser;\n\n const migrateToLatest = (old: Old) =>\n this.migrateToLatest(migrateToNextVersion(old));\n\n return new VersionedWidgetOptionsParserBuilder(\n majorVersion,\n parseOldVersion,\n migrateToLatest,\n parseOtherVersions,\n );\n }\n}\n\nconst parseVersionedObject = object({\n version: defaulted(object({major: number, minor: number}), () => ({\n major: 0,\n minor: 0,\n })),\n});\n","import {KeypadKeys} from \"../../keypad\";\nimport deriveExtraKeys from \"../../widgets/expression/derive-extra-keys\";\nimport {\n array,\n boolean,\n constant,\n enumeration,\n number,\n object,\n optional,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseLegacyButtonSets} from \"./legacy-button-sets\";\nimport {versionedWidgetOptions} from \"./versioned-widget-options\";\nimport {parseWidgetWithVersion} from \"./widget\";\n\nimport type {\n ExpressionWidget,\n PerseusExpressionAnswerForm,\n} from \"../../data-schema\";\nimport type {ParsedValue, Parser} from \"../parser-types\";\n\nconst stringOrNumberOrNullOrUndefined = union(string)\n .or(number)\n .or(constant(null))\n .or(constant(undefined)).parser;\n\nconst parsePossiblyInvalidAnswerForm = object({\n // `value` is the possibly invalid part of this. It should always be a\n // string, but some answer forms don't have it. The Expression widget\n // ignores invalid values, so we can safely filter them out during parsing.\n value: optional(string),\n form: defaulted(boolean, () => false),\n simplify: defaulted(boolean, () => false),\n considered: enumeration(\"correct\", \"wrong\", \"ungraded\"),\n key: pipeParsers(stringOrNumberOrNullOrUndefined).then(convert(String))\n .parser,\n});\n\nfunction removeInvalidAnswerForms(\n possiblyInvalid: Array<ParsedValue<typeof parsePossiblyInvalidAnswerForm>>,\n): PerseusExpressionAnswerForm[] {\n const valid: PerseusExpressionAnswerForm[] = [];\n for (const answerForm of possiblyInvalid) {\n const {value} = answerForm;\n if (value != null) {\n // Copying the object seems to be needed to make TypeScript happy\n valid.push({...answerForm, value});\n }\n }\n return valid;\n}\n\nconst version2 = object({major: constant(2), minor: number});\nconst parseExpressionWidgetV2: Parser<ExpressionWidget> =\n parseWidgetWithVersion(\n version2,\n constant(\"expression\"),\n object({\n answerForms: pipeParsers(\n array(parsePossiblyInvalidAnswerForm),\n ).then(convert(removeInvalidAnswerForms)).parser,\n functions: array(string),\n times: boolean,\n visibleLabel: optional(string),\n ariaLabel: optional(string),\n buttonSets: parseLegacyButtonSets,\n buttonsVisible: optional(enumeration(\"always\", \"never\", \"focused\")),\n extraKeys: array(enumeration(...KeypadKeys)),\n }),\n );\n\nconst version1 = object({major: constant(1), minor: number});\nconst parseExpressionWidgetV1 = parseWidgetWithVersion(\n version1,\n constant(\"expression\"),\n object({\n answerForms: pipeParsers(array(parsePossiblyInvalidAnswerForm)).then(\n convert(removeInvalidAnswerForms),\n ).parser,\n functions: array(string),\n times: boolean,\n visibleLabel: optional(string),\n ariaLabel: optional(string),\n buttonSets: parseLegacyButtonSets,\n buttonsVisible: optional(enumeration(\"always\", \"never\", \"focused\")),\n }),\n);\n\nfunction migrateV1ToV2(\n widget: ParsedValue<typeof parseExpressionWidgetV1>,\n): ExpressionWidget {\n const {options} = widget;\n return {\n ...widget,\n version: {major: 2, minor: 0},\n options: {\n times: options.times,\n buttonSets: options.buttonSets,\n functions: options.functions,\n buttonsVisible: options.buttonsVisible,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n answerForms: options.answerForms,\n extraKeys: deriveExtraKeys(options),\n },\n };\n}\n\nconst version0 = optional(object({major: constant(0), minor: number}));\nconst parseExpressionWidgetV0 = parseWidgetWithVersion(\n version0,\n constant(\"expression\"),\n object({\n functions: array(string),\n times: boolean,\n visibleLabel: optional(string),\n ariaLabel: optional(string),\n form: boolean,\n simplify: boolean,\n value: string,\n buttonSets: parseLegacyButtonSets,\n buttonsVisible: optional(enumeration(\"always\", \"never\", \"focused\")),\n }),\n);\n\nfunction migrateV0ToV1(\n widget: ParsedValue<typeof parseExpressionWidgetV0>,\n): ParsedValue<typeof parseExpressionWidgetV1> {\n const {options} = widget;\n return {\n ...widget,\n version: {major: 1, minor: 0},\n options: {\n times: options.times,\n buttonSets: options.buttonSets as any,\n functions: options.functions,\n buttonsVisible: options.buttonsVisible,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n\n answerForms: [\n {\n considered: \"correct\",\n form: options.form,\n simplify: options.simplify,\n value: options.value,\n },\n ],\n },\n };\n}\n\nexport const parseExpressionWidget: Parser<ExpressionWidget> =\n versionedWidgetOptions(2, parseExpressionWidgetV2)\n .withMigrationFrom(1, parseExpressionWidgetV1, migrateV1ToV2)\n .withMigrationFrom(0, parseExpressionWidgetV0, migrateV0ToV1).parser;\n","import {\n boolean,\n constant,\n nullable,\n number,\n object,\n optional,\n pipeParsers,\n record,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\nimport {parseWidget} from \"./widget\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {GradedGroupWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst falseToNull = pipeParsers(constant(false)).then(\n convert(() => null),\n).parser;\nexport const parseGradedGroupWidgetOptions = object({\n title: defaulted(string, () => \"\"),\n hasHint: optional(nullable(boolean)),\n // This module has an import cycle with parsePerseusRenderer.\n // The anonymous function below ensures that we don't try to access\n // parsePerseusRenderer before it's defined.\n hint: union(falseToNull)\n .or(constant(null))\n .or(constant(undefined))\n .or((rawVal, ctx) => parsePerseusRenderer(rawVal, ctx)).parser,\n content: string,\n // This module has an import cycle with parseWidgetsMap.\n // The anonymous function below ensures that we don't try to access\n // parseWidgetsMap before it's defined.\n widgets: (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n widgetEnabled: optional(nullable(boolean)),\n immutableWidgets: optional(nullable(boolean)),\n images: record(\n string,\n object({\n width: number,\n height: number,\n }),\n ),\n});\n\nexport const parseGradedGroupWidget: Parser<GradedGroupWidget> = parseWidget(\n constant(\"graded-group\"),\n parseGradedGroupWidgetOptions,\n);\n","import {array, constant, object} from \"../general-purpose-parsers\";\n\nimport {parseGradedGroupWidgetOptions} from \"./graded-group-widget\";\nimport {parseWidget} from \"./widget\";\n\nimport type {GradedGroupSetWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseGradedGroupSetWidget: Parser<GradedGroupSetWidget> =\n parseWidget(\n constant(\"graded-group-set\"),\n object({gradedGroups: array(parseGradedGroupWidgetOptions)}),\n );\n","import {isObject} from \"./is-object\";\n\nimport type {ParseContext, Parser} from \"../parser-types\";\n\ntype Primitive = number | string | boolean | null | undefined;\n\n/**\n * discriminatedUnion() should be preferred over union() when parsing a\n * discriminated union type, because discriminatedUnion() produces more\n * understandable failure messages. It takes the discriminant as the source of\n * truth for which variant is to be parsed, and expects the other data to match\n * that variant.\n */\nexport function discriminatedUnionOn<DK extends string>(discriminantKey: DK) {\n const noMoreBranches: Parser<never> = (raw: unknown, ctx: ParseContext) => {\n if (!isObject(raw)) {\n return ctx.failure(\"object\", raw);\n }\n return ctx\n .forSubtree(discriminantKey)\n .failure(\"a valid value\", raw[discriminantKey]);\n };\n\n return new DiscriminatedUnionBuilder(discriminantKey, noMoreBranches);\n}\n\nclass DiscriminatedUnionBuilder<\n DK extends string,\n Union extends {[k in DK]: Primitive},\n> {\n constructor(\n private discriminantKey: DK,\n public parser: Parser<Union>,\n ) {}\n\n withBranch<Variant extends {[k in DK]: Primitive}>(\n discriminantValue: Primitive,\n parseNewVariant: Parser<Variant>,\n ): DiscriminatedUnionBuilder<DK, Union | Variant> {\n const parseNewBranch = discriminatedUnionBranch(\n this.discriminantKey,\n discriminantValue,\n parseNewVariant,\n this.parser,\n );\n\n return new DiscriminatedUnionBuilder(\n this.discriminantKey,\n parseNewBranch,\n );\n }\n}\n\nfunction discriminatedUnionBranch<\n DK extends string,\n DV extends Primitive,\n Variant extends {[k in DK]: DV},\n Rest extends {[k in DK]: DV},\n>(\n discriminantKey: DK,\n discriminantValue: DV,\n parseVariant: Parser<Variant>,\n parseOtherBranches: Parser<Rest>,\n): Parser<Variant | Rest> {\n return (raw: unknown, ctx: ParseContext) => {\n if (!isObject(raw)) {\n return ctx.failure(\"object\", raw);\n }\n\n if (raw[discriminantKey] === discriminantValue) {\n return parseVariant(raw, ctx);\n }\n\n return parseOtherBranches(raw, ctx);\n };\n}\n","import {\n array,\n boolean,\n constant,\n enumeration,\n nullable,\n number,\n object,\n optional,\n pair,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {discriminatedUnionOn} from \"../general-purpose-parsers/discriminated-union\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {GrapherWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst pairOfNumbers = pair(number, number);\n\nconst pairOfPoints = pair(pairOfNumbers, pairOfNumbers);\n\nexport const parseGrapherWidget: Parser<GrapherWidget> = parseWidget(\n constant(\"grapher\"),\n object({\n availableTypes: array(\n enumeration(\n \"absolute_value\",\n \"exponential\",\n \"linear\",\n \"logarithm\",\n \"quadratic\",\n \"sinusoid\",\n \"tangent\",\n ),\n ),\n correct: discriminatedUnionOn(\"type\")\n .withBranch(\n \"absolute_value\",\n object({\n type: constant(\"absolute_value\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"exponential\",\n object({\n type: constant(\"exponential\"),\n asymptote: pairOfPoints,\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"linear\",\n object({\n type: constant(\"linear\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"logarithm\",\n object({\n type: constant(\"logarithm\"),\n asymptote: pairOfPoints,\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"quadratic\",\n object({\n type: constant(\"quadratic\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"sinusoid\",\n object({\n type: constant(\"sinusoid\"),\n coords: nullable(pairOfPoints),\n }),\n )\n .withBranch(\n \"tangent\",\n object({\n type: constant(\"tangent\"),\n coords: nullable(pairOfPoints),\n }),\n ).parser,\n graph: object({\n backgroundImage: object({\n bottom: optional(number),\n height: optional(number),\n left: optional(number),\n scale: optional(number),\n url: optional(nullable(string)),\n width: optional(number),\n }),\n box: optional(pairOfNumbers),\n editableSettings: optional(\n array(enumeration(\"graph\", \"snap\", \"image\", \"measure\")),\n ),\n gridStep: optional(pairOfNumbers),\n labels: pair(string, string),\n markings: enumeration(\"graph\", \"none\", \"grid\"),\n range: pair(pairOfNumbers, pairOfNumbers),\n rulerLabel: constant(\"\"),\n rulerTicks: number,\n showProtractor: optional(boolean),\n showRuler: optional(boolean),\n showTooltips: optional(boolean),\n snapStep: optional(pairOfNumbers),\n step: pairOfNumbers,\n valid: optional(union(boolean).or(string).parser),\n }),\n }),\n);\n","import {constant} from \"../general-purpose-parsers\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\nimport {parseWidget} from \"./widget\";\n\nimport type {GroupWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseGroupWidget: Parser<GroupWidget> = parseWidget(\n constant(\"group\"),\n // This module has an import cycle with parsePerseusRenderer.\n // The anonymous function below ensures that we don't try to access\n // parsePerseusRenderer before it's defined.\n (rawVal, ctx) => parsePerseusRenderer(rawVal, ctx),\n);\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {IFrameWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseIframeWidget: Parser<IFrameWidget> = parseWidget(\n constant(\"iframe\"),\n object({\n url: string,\n settings: optional(array(object({name: string, value: string}))),\n width: union(number).or(string).parser,\n height: union(number).or(string).parser,\n allowFullScreen: defaulted(boolean, () => false),\n allowTopNavigation: optional(boolean),\n static: defaulted(boolean, () => false),\n }),\n);\n","import type {PartialParser} from \"../parser-types\";\n\nexport const stringToNumber: PartialParser<string | number, number> = (\n rawValue,\n ctx,\n) => {\n if (typeof rawValue === \"number\") {\n return ctx.success(rawValue);\n }\n\n const parsedNumber = +rawValue;\n if (rawValue === \"\" || isNaN(parsedNumber)) {\n return ctx.failure(\"a number or numeric string\", rawValue);\n }\n\n return ctx.success(parsedNumber);\n};\n","import {\n nullable,\n number,\n object,\n optional,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {stringToNumber} from \"../general-purpose-parsers/string-to-number\";\n\nimport type {PerseusImageBackground} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nfunction emptyToZero(x: string | number): string | number {\n return x === \"\" ? 0 : x;\n}\n\nconst imageDimensionToNumber = pipeParsers(union(number).or(string).parser)\n // In this specific case, empty string is equivalent to zero. An empty\n // string parses to either NaN (using parseInt) or 0 (using unary +) and\n // CSS will treat NaN as invalid and default to 0 instead.\n .then(convert(emptyToZero))\n .then(stringToNumber).parser;\n\nconst dimensionOrUndefined = defaulted(imageDimensionToNumber, () => undefined);\n\nexport const parsePerseusImageBackground: Parser<PerseusImageBackground> =\n object({\n url: optional(nullable(string)),\n width: dimensionOrUndefined,\n height: dimensionOrUndefined,\n top: dimensionOrUndefined,\n left: dimensionOrUndefined,\n bottom: dimensionOrUndefined,\n scale: dimensionOrUndefined,\n });\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n pair,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {ImageWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst pairOfNumbers = pair(number, number);\n\nexport const parseImageWidget: Parser<ImageWidget> = parseWidget(\n constant(\"image\"),\n object({\n title: optional(string),\n caption: optional(string),\n alt: optional(string),\n backgroundImage: parsePerseusImageBackground,\n static: optional(boolean),\n labels: optional(\n array(\n object({\n content: string,\n alignment: string,\n coordinates: array(number),\n }),\n ),\n ),\n range: optional(pair(pairOfNumbers, pairOfNumbers)),\n box: optional(pairOfNumbers),\n }),\n);\n","import {\n boolean,\n constant,\n enumeration,\n number,\n object,\n optional,\n string,\n union,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {InputNumberWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst booleanToString: Parser<string> = (rawValue, ctx) => {\n if (typeof rawValue === \"boolean\") {\n return ctx.success(String(rawValue));\n }\n return ctx.failure(\"boolean\", rawValue);\n};\n\nexport const parseInputNumberWidget: Parser<InputNumberWidget> = parseWidget(\n constant(\"input-number\"),\n object({\n answerType: optional(\n enumeration(\n \"number\",\n \"decimal\",\n \"integer\",\n \"rational\",\n \"improper\",\n \"mixed\",\n \"percent\",\n \"pi\",\n ),\n ),\n inexact: optional(boolean),\n maxError: optional(union(number).or(string).parser),\n rightAlign: optional(boolean),\n simplify: enumeration(\"required\", \"optional\", \"enforced\"),\n size: enumeration(\"normal\", \"small\"),\n // TODO(benchristel): there are some content items where value is a\n // boolean, even though that makes no sense. We should figure out if\n // those content items are actually published anywhere, and consider\n // updating them.\n value: union(number).or(string).or(booleanToString).parser,\n customKeypad: optional(boolean),\n }),\n);\n","import {\n array,\n boolean,\n constant,\n enumeration,\n number,\n object,\n optional,\n pair,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {discriminatedUnionOn} from \"../general-purpose-parsers/discriminated-union\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {\n InteractionWidget,\n PerseusInteractionElement,\n} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst pairOfNumbers = pair(number, number);\nconst stringOrEmpty = defaulted(string, () => \"\");\n\nconst parseKey = pipeParsers(optional(string)).then(convert(String)).parser;\n\ntype FunctionElement = Extract<PerseusInteractionElement, {type: \"function\"}>;\nconst parseFunctionElement: Parser<FunctionElement> = object({\n type: constant(\"function\"),\n key: parseKey,\n options: object({\n value: string,\n funcName: string,\n rangeMin: string,\n rangeMax: string,\n color: string,\n strokeDasharray: string,\n strokeWidth: number,\n }),\n});\n\ntype LabelElement = Extract<PerseusInteractionElement, {type: \"label\"}>;\nconst parseLabelElement: Parser<LabelElement> = object({\n type: constant(\"label\"),\n key: parseKey,\n options: object({\n label: string,\n color: string,\n coordX: string,\n coordY: string,\n }),\n});\n\ntype LineElement = Extract<PerseusInteractionElement, {type: \"line\"}>;\nconst parseLineElement: Parser<LineElement> = object({\n type: constant(\"line\"),\n key: parseKey,\n options: object({\n color: string,\n startX: string,\n startY: string,\n endX: string,\n endY: string,\n strokeDasharray: string,\n strokeWidth: number,\n arrows: string,\n }),\n});\n\ntype MovableLineElement = Extract<\n PerseusInteractionElement,\n {type: \"movable-line\"}\n>;\nconst parseMovableLineElement: Parser<MovableLineElement> = object({\n type: constant(\"movable-line\"),\n key: parseKey,\n options: object({\n startX: string,\n startY: string,\n startSubscript: number,\n endX: string,\n endY: string,\n endSubscript: number,\n constraint: string,\n snap: number,\n constraintFn: string,\n constraintXMin: string,\n constraintXMax: string,\n constraintYMin: string,\n constraintYMax: string,\n }),\n});\n\ntype MovablePointElement = Extract<\n PerseusInteractionElement,\n {type: \"movable-point\"}\n>;\nconst parseMovablePointElement: Parser<MovablePointElement> = object({\n type: constant(\"movable-point\"),\n key: parseKey,\n options: object({\n startX: string,\n startY: string,\n varSubscript: number,\n constraint: string,\n snap: number,\n constraintFn: string,\n constraintXMin: stringOrEmpty,\n constraintXMax: stringOrEmpty,\n constraintYMin: stringOrEmpty,\n constraintYMax: stringOrEmpty,\n }),\n});\n\ntype ParametricElement = Extract<\n PerseusInteractionElement,\n {type: \"parametric\"}\n>;\nconst parseParametricElement: Parser<ParametricElement> = object({\n type: constant(\"parametric\"),\n key: parseKey,\n options: object({\n x: string,\n y: string,\n rangeMin: string,\n rangeMax: string,\n color: string,\n strokeDasharray: string,\n strokeWidth: number,\n }),\n});\n\ntype PointElement = Extract<PerseusInteractionElement, {type: \"point\"}>;\nconst parsePointElement: Parser<PointElement> = object({\n type: constant(\"point\"),\n key: parseKey,\n options: object({\n color: string,\n coordX: string,\n coordY: string,\n }),\n});\n\ntype RectangleElement = Extract<PerseusInteractionElement, {type: \"rectangle\"}>;\nconst parseRectangleElement: Parser<RectangleElement> = object({\n type: constant(\"rectangle\"),\n key: parseKey,\n options: object({\n color: string,\n coordX: string,\n coordY: string,\n width: string,\n height: string,\n }),\n});\n\nexport const parseInteractionWidget: Parser<InteractionWidget> = parseWidget(\n constant(\"interaction\"),\n object({\n static: defaulted(boolean, () => false),\n graph: object({\n editableSettings: optional(array(enumeration(\"canvas\", \"graph\"))),\n box: pairOfNumbers,\n labels: array(string),\n range: pair(pairOfNumbers, pairOfNumbers),\n gridStep: pairOfNumbers,\n markings: enumeration(\"graph\", \"grid\", \"none\"),\n snapStep: optional(pairOfNumbers),\n valid: optional(union(boolean).or(string).parser),\n backgroundImage: optional(parsePerseusImageBackground),\n showProtractor: optional(boolean),\n showRuler: optional(boolean),\n rulerLabel: optional(string),\n rulerTicks: optional(number),\n tickStep: pairOfNumbers,\n }),\n elements: array(\n discriminatedUnionOn(\"type\")\n .withBranch(\"function\", parseFunctionElement)\n .withBranch(\"label\", parseLabelElement)\n .withBranch(\"line\", parseLineElement)\n .withBranch(\"movable-line\", parseMovableLineElement)\n .withBranch(\"movable-point\", parseMovablePointElement)\n .withBranch(\"parametric\", parseParametricElement)\n .withBranch(\"point\", parsePointElement)\n .withBranch(\"rectangle\", parseRectangleElement).parser,\n ),\n }),\n);\n","/**\n * The Perseus \"data schema\" file.\n *\n * This file, and the types in it, represents the \"data schema\" that Perseus\n * uses. The @khanacademy/perseus-editor package edits and produces objects\n * that conform to the types in this file. Similarly, the top-level renderers\n * in @khanacademy/perseus, consume objects that conform to these types.\n *\n * WARNING: This file should not import any types from elsewhere so that it is\n * easy to reason about changes that alter the Perseus schema. This helps\n * ensure that it is not changed accidentally when upgrading a dependant\n * package or other part of Perseus code. Note that TypeScript does type\n * checking via something called \"structural typing\". This means that as long\n * as the shape of a type matches, the name it goes by doesn't matter. As a\n * result, a `Coord` type that looks like this `[x: number, y: number]` is\n * _identical_, in TypeScript's eyes, to this `Vector2` type `[x: number, y:\n * number]`. Also, with tuples, the labels for each entry is ignored, so `[x:\n * number, y: number]` is compatible with `[min: number, max: number]`. The\n * labels are for humans, not TypeScript. :)\n *\n * If you make changes to types in this file, be very sure that:\n *\n * a) the changes are backwards compatible. If they are not, old data from\n * previous versions of the \"schema\" could become unrenderable, or worse,\n * introduce hard-to-diagnose bugs.\n * b) the parsing code (`util/parse-perseus-json/`) is updated to handle\n * the new format _as well as_ the old format.\n */\n\nimport type {KeypadKey} from \"./keypad\";\n\n// TODO(FEI-4010): Remove `Perseus` prefix for all types here\n\nexport type Coord = [x: number, y: number];\nexport type Interval = [min: number, max: number];\nexport type Vector2 = Coord; // Same name as Mafs\nexport type Range = Interval;\nexport type Size = [width: number, height: number];\nexport type CollinearTuple = [Vector2, Vector2];\nexport type ShowSolutions = \"all\" | \"selected\" | \"none\";\n\n/**\n * A utility type that constructs a widget map from a \"registry interface\".\n * The keys of the registry should be the widget type (aka, \"categorizer\" or\n * \"radio\", etc) and the value should be the option type stored in the value\n * of the map.\n *\n * You can think of this as a type that generates another type. We use\n * \"registry interfaces\" as a way to keep a set of widget types to their data\n * type in several places in Perseus. This type then allows us to generate a\n * map type that maps a widget id to its data type and keep strong typing by\n * widget id.\n *\n * For example, given a fictitious registry such as this:\n *\n * ```\n * interface DummyRegistry {\n * categorizer: { categories: ReadonlyArray<string> };\n * dropdown: { choices: ReadonlyArray<string> }:\n * }\n * ```\n *\n * If we create a DummyMap using this helper:\n *\n * ```\n * type DummyMap = MakeWidgetMap<DummyRegistry>;\n * ```\n *\n * We'll get a map that looks like this:\n *\n * ```\n * type DummyMap = {\n * `categorizer ${number}`: { categories: ReadonlyArray<string> };\n * `dropdown ${number}`: { choices: ReadonlyArray<string> };\n * }\n * ```\n *\n * We use interfaces for the registries so that they can be extended in cases\n * where the consuming app brings along their own widgets. Interfaces in\n * TypeScript are always open (ie. you can extend them) whereas types aren't.\n */\nexport type MakeWidgetMap<TRegistry> = {\n [Property in keyof TRegistry as `${Property & string} ${number}`]: TRegistry[Property];\n};\n\n/**\n * Our core set of Perseus widgets.\n *\n * This interface is the basis for \"registering\" all Perseus widget types.\n * There should be one key/value pair for each supported widget. If you create\n * a new widget, an entry should be added to this interface. Note that this\n * only registers the widget options type, you'll also need to register the\n * widget so that it's available at runtime (@see\n * {@link file://./widgets.ts#registerWidget}).\n *\n * Importantly, the key should be the name that is used in widget IDs. For most\n * widgets that is the same as the widget option's `type` field. In cases where\n * a widget has been deprecated and replaced with the deprecated-standin\n * widget, it should be the original widget type!\n *\n * If you define the widget outside of this package, you can still add the new\n * widget to this interface by writing the following in that package that\n * contains the widget. TypeScript will merge that definition of the\n * `PerseusWidgets` with the one defined below.\n *\n * ```typescript\n * declare module \"@khanacademy/perseus-core\" {\n * interface PerseusWidgetTypes {\n * // A new widget\n * \"new-awesomeness\": MyAwesomeNewWidget;\n *\n * // A deprecated widget\n * \"super-old-widget\": DeprecatedStandinWidget;\n * }\n * }\n *\n * // The new widget's options definition\n * type MyAwesomeNewWidget = WidgetOptions<'new-awesomeness', MyAwesomeNewWidgetOptions>;\n *\n * // The deprecated widget's options definition\n * type SuperOldWidget = WidgetOptions<'super-old-widget', object>;\n * ```\n *\n * This interface can be extended through the magic of TypeScript \"Declaration\n * merging\". Specifically, we augment this module and extend this interface.\n *\n * @see {@link https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation}\n */\nexport interface PerseusWidgetTypes {\n categorizer: CategorizerWidget;\n \"cs-program\": CSProgramWidget;\n definition: DefinitionWidget;\n dropdown: DropdownWidget;\n explanation: ExplanationWidget;\n expression: ExpressionWidget;\n grapher: GrapherWidget;\n \"graded-group-set\": GradedGroupSetWidget;\n \"graded-group\": GradedGroupWidget;\n group: GroupWidget;\n iframe: IFrameWidget;\n image: ImageWidget;\n \"input-number\": InputNumberWidget;\n interaction: InteractionWidget;\n \"interactive-graph\": InteractiveGraphWidget;\n \"label-image\": LabelImageWidget;\n matcher: MatcherWidget;\n matrix: MatrixWidget;\n measurer: MeasurerWidget;\n \"molecule-renderer\": MoleculeRendererWidget;\n \"number-line\": NumberLineWidget;\n \"numeric-input\": NumericInputWidget;\n orderer: OrdererWidget;\n \"passage-ref-target\": RefTargetWidget;\n \"passage-ref\": PassageRefWidget;\n passage: PassageWidget;\n \"phet-simulation\": PhetSimulationWidget;\n \"python-program\": PythonProgramWidget;\n plotter: PlotterWidget;\n radio: RadioWidget;\n sorter: SorterWidget;\n table: TableWidget;\n video: VideoWidget;\n\n // Deprecated widgets\n \"lights-puzzle\": DeprecatedStandinWidget;\n sequence: DeprecatedStandinWidget;\n simulator: DeprecatedStandinWidget;\n transformer: DeprecatedStandinWidget;\n}\n\n/**\n * A map of widget IDs to widget options. This is most often used as the type\n * for a set of widgets defined in a `PerseusItem` but can also be useful to\n * represent a function parameter where only `widgets` from a `PerseusItem` are\n * needed. Today Widget IDs are made up of the widget type and an incrementing\n * integer (eg. `interactive-graph 1` or `radio 3`). It is suggested to avoid\n * reading/parsing the widget id to derive any information from it, except in\n * the case of this map.\n *\n * @see {@link PerseusWidgetTypes} additional widgets can be added to this map type\n * by augmenting the PerseusWidgetTypes with new widget types!\n */\nexport type PerseusWidgetsMap = MakeWidgetMap<PerseusWidgetTypes>;\n\n/**\n * PerseusWidget is a union of all the different types of widget options that\n * Perseus knows about.\n *\n * Thanks to it being based on PerseusWidgetTypes interface, this union is\n * automatically extended to include widgets used in tests without those widget\n * option types seeping into our production types.\n *\n * @see MockWidget for an example\n */\nexport type PerseusWidget = PerseusWidgetTypes[keyof PerseusWidgetTypes];\n\n/**\n * A \"PerseusItem\" is a classic Perseus item. It is rendered by the\n * `ServerItemRenderer` and the layout is pre-set.\n *\n * To render more complex Perseus items, see the `Item` type in the multi item\n * area.\n */\nexport type PerseusItem = {\n // The details of the question being asked to the user.\n question: PerseusRenderer;\n // A collection of hints to be offered to the user that support answering the question.\n hints: ReadonlyArray<Hint>;\n // Details about the tools the user might need to answer the question\n answerArea: PerseusAnswerArea | null | undefined;\n /**\n * The version of the item.\n * @deprecated Not used.\n */\n itemDataVersion: any;\n /**\n * @deprecated Superseded by per-widget answers.\n */\n answer: any;\n};\n\n/**\n * A \"PerseusArticle\" is an item that is meant to be rendered as an article.\n * This item is never scored and is rendered by the `ArticleRenderer`.\n */\nexport type PerseusArticle = PerseusRenderer | ReadonlyArray<PerseusRenderer>;\n\nexport type Version = {\n // The major part of the version\n major: number;\n // The minor part of the version\n minor: number;\n};\n\nexport type PerseusRenderer = {\n /**\n * Translatable Markdown content to be rendered. May include references to\n * widgets (as [[☃ widgetName]]) or images (as ).\n * For each image found in this content, there can be an entry in the\n * `images` dict (below) with the key being the image's url which defines\n * additional attributes for the image.\n */\n content: string;\n /**\n * A dictionary of {[widgetName]: Widget} to be referenced from the content\n * field.\n */\n widgets: PerseusWidgetsMap;\n /**\n * Formerly used in the PerseusGradedGroup widget. A list of \"tags\" that\n * are keys that represent other content in the system. Not rendered to\n * the user. NOTE: perseus_data.go says this is required even though it\n * isn't necessary.\n * @deprecated\n */\n metadata?: any;\n /**\n * A dictionary of {[imageUrl]: PerseusImageDetail}.\n */\n images: {\n [imageUrl: string]: PerseusImageDetail;\n };\n};\n\nexport type Hint = PerseusRenderer & {\n /**\n * When `true`, causes the previous hint to be replaced with this hint when\n * displayed. When `false`, the previous hint remains visible when this one\n * is displayed. This allows for hints that build upon each other.\n */\n replace?: boolean;\n};\n\nexport type PerseusImageDetail = {\n // The width of the image\n width: number;\n // the height of the image\n height: number;\n};\n\nexport const ItemExtras = [\n // The user might benefit from using a Scientific Calculator. Provided on Khan Academy when true\n \"calculator\",\n // The user might benefit from using a statistics Chi Squared Table like https://people.richland.edu/james/lecture/m170/tbl-chi.html\n \"chi2Table\",\n // The user might benefit from a monthly payments calculator. Provided on Khan Academy when true\n \"financialCalculatorMonthlyPayment\",\n // The user might benefit from a total amount calculator. Provided on Khan Academy when true\n \"financialCalculatorTotalAmount\",\n // The user might benefit from a time to pay off calculator. Provided on Khan Academy when true\n \"financialCalculatorTimeToPayOff\",\n // The user might benefit from using a Periodic Table of Elements. Provided on Khan Academy when true\n \"periodicTable\",\n // The user might benefit from using a Periodic Table of Elements with key. Provided on Khan Academy when true\n \"periodicTableWithKey\",\n // The user might benefit from using a statistics T Table like https://www.statisticshowto.com/tables/t-distribution-table/\n \"tTable\",\n // The user might benefit from using a statistics Z Table like https://www.ztable.net/\n \"zTable\",\n] as const;\nexport type PerseusAnswerArea = Record<(typeof ItemExtras)[number], boolean>;\n\n/**\n * The type representing the common structure of all widget's options. The\n * `Options` generic type represents the widget-specific option data.\n */\nexport type WidgetOptions<Type extends string, Options> = {\n // The \"type\" of widget which will define what the Options field looks like\n type: Type;\n // Whether this widget is displayed with the values and is immutable. For display only\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n static?: boolean;\n // Whether a widget is scored. Usually true except for IFrame widgets (deprecated)\n // Default: true\n graded?: boolean;\n // The HTML alignment of the widget. \"default\" or \"block\"\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n alignment?: string;\n // Options specific to the type field of the widget. See Perseus*WidgetOptions for more details\n options: Options;\n // Only used by interactive child widgets (line, point, etc) to identify the components\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n key?: number | null;\n // The version of the widget data spec. Used to differentiate between newer and older content data.\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n version?: Version;\n};\n\n// prettier-ignore\nexport type CategorizerWidget = WidgetOptions<'categorizer', PerseusCategorizerWidgetOptions>;\n// prettier-ignore\nexport type CSProgramWidget = WidgetOptions<'cs-program', PerseusCSProgramWidgetOptions>;\n// prettier-ignore\nexport type DefinitionWidget = WidgetOptions<'definition', PerseusDefinitionWidgetOptions>;\n// prettier-ignore\nexport type DropdownWidget = WidgetOptions<'dropdown', PerseusDropdownWidgetOptions>;\n// prettier-ignore\nexport type ExplanationWidget = WidgetOptions<'explanation', PerseusExplanationWidgetOptions>;\n// prettier-ignore\nexport type ExpressionWidget = WidgetOptions<'expression', PerseusExpressionWidgetOptions>;\n// prettier-ignore\nexport type GradedGroupSetWidget = WidgetOptions<'graded-group-set', PerseusGradedGroupSetWidgetOptions>;\n// prettier-ignore\nexport type GradedGroupWidget = WidgetOptions<'graded-group', PerseusGradedGroupWidgetOptions>;\n// prettier-ignore\nexport type GrapherWidget = WidgetOptions<'grapher', PerseusGrapherWidgetOptions>;\n// prettier-ignore\nexport type GroupWidget = WidgetOptions<'group', PerseusGroupWidgetOptions>;\n// prettier-ignore\nexport type IFrameWidget = WidgetOptions<'iframe', PerseusIFrameWidgetOptions>;\n// prettier-ignore\nexport type ImageWidget = WidgetOptions<'image', PerseusImageWidgetOptions>;\n// prettier-ignore\nexport type InteractionWidget = WidgetOptions<'interaction', PerseusInteractionWidgetOptions>;\n// prettier-ignore\nexport type InteractiveGraphWidget = WidgetOptions<'interactive-graph', PerseusInteractiveGraphWidgetOptions>;\n// prettier-ignore\nexport type LabelImageWidget = WidgetOptions<'label-image', PerseusLabelImageWidgetOptions>;\n// prettier-ignore\nexport type MatcherWidget = WidgetOptions<'matcher', PerseusMatcherWidgetOptions>;\n// prettier-ignore\nexport type MatrixWidget = WidgetOptions<'matrix', PerseusMatrixWidgetOptions>;\n// prettier-ignore\nexport type MeasurerWidget = WidgetOptions<'measurer', PerseusMeasurerWidgetOptions>;\n// prettier-ignore\nexport type NumberLineWidget = WidgetOptions<'number-line', PerseusNumberLineWidgetOptions>;\n// prettier-ignore\nexport type NumericInputWidget = WidgetOptions<'numeric-input', PerseusNumericInputWidgetOptions>;\n// prettier-ignore\nexport type OrdererWidget = WidgetOptions<'orderer', PerseusOrdererWidgetOptions>;\n// prettier-ignore\nexport type PassageRefWidget = WidgetOptions<'passage-ref', PerseusPassageRefWidgetOptions>;\n// prettier-ignore\nexport type PassageWidget = WidgetOptions<'passage', PerseusPassageWidgetOptions>;\n// prettier-ignore\nexport type PhetSimulationWidget = WidgetOptions<'phet-simulation', PerseusPhetSimulationWidgetOptions>;\n// prettier-ignore\nexport type PlotterWidget = WidgetOptions<'plotter', PerseusPlotterWidgetOptions>;\n// prettier-ignore\nexport type PythonProgramWidget = WidgetOptions<'python-program', PerseusPythonProgramWidgetOptions>;\n// prettier-ignore\nexport type RadioWidget = WidgetOptions<'radio', PerseusRadioWidgetOptions>;\n// prettier-ignore\nexport type SorterWidget = WidgetOptions<'sorter', PerseusSorterWidgetOptions>;\n// prettier-ignore\nexport type TableWidget = WidgetOptions<'table', PerseusTableWidgetOptions>;\n// prettier-ignore\nexport type InputNumberWidget = WidgetOptions<'input-number', PerseusInputNumberWidgetOptions>;\n// prettier-ignore\nexport type MoleculeRendererWidget = WidgetOptions<'molecule-renderer', PerseusMoleculeRendererWidgetOptions>;\n// prettier-ignore\nexport type RefTargetWidget = WidgetOptions<'passage-ref-target', PerseusPassageRefTargetWidgetOptions>;\n// prettier-ignore\nexport type VideoWidget = WidgetOptions<'video', PerseusVideoWidgetOptions>;\n//prettier-ignore\nexport type DeprecatedStandinWidget = WidgetOptions<'deprecated-standin', object>;\n\n/**\n * A background image applied to various widgets.\n */\nexport type PerseusImageBackground = {\n // The URL of the image\n url: string | null | undefined;\n // The width of the image\n width?: number;\n // The height of the image\n height?: number;\n // The top offset of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n top?: number;\n // The left offset of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n left?: number;\n // The scale of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n scale?: number;\n // The bottom offset of the image\n // NOTE: perseus_data.go says this is required, but nullable, even though\n // it isn't necessary at all.\n bottom?: number;\n};\n\n/**\n * The type of markings to display on the graph.\n * - axes: shows the axes without the gride lines\n * - graph: shows the axes and the grid lines\n * - grid: shows only the grid lines\n * - none: shows no markings\n */\nexport type MarkingsType = \"axes\" | \"graph\" | \"grid\" | \"none\";\nexport type AxisLabelLocation = \"onAxis\" | \"alongEdge\";\n\nexport type PerseusCategorizerWidgetOptions = {\n // Translatable text; a list of items to categorize. e.g. [\"banana\", \"yellow\", \"apple\", \"purple\", \"shirt\"]\n items: ReadonlyArray<string>;\n // Translatable text; a list of categories. e.g. [\"fruits\", \"colors\", \"clothing\"]\n categories: ReadonlyArray<string>;\n // Whether the items should be randemized\n randomizeItems: boolean;\n // Whether this widget is displayed with the results and immutable\n static: boolean;\n // The correct answers where index relates to the items and value relates to the category. e.g. [0, 1, 0, 1, 2]\n values: ReadonlyArray<number>;\n // Whether we should highlight i18n linter errors found on this widget\n highlightLint?: boolean;\n // Internal editor configuration. Can be ignored by consumers.\n linterContext?: PerseusLinterContext;\n};\n\nexport type PerseusLinterContext = {\n contentType: string;\n paths: ReadonlyArray<string>;\n stack: ReadonlyArray<string>;\n};\n\nexport type PerseusDefinitionWidgetOptions = {\n // Translatable text; the word to define. e.g. \"vertex\"\n togglePrompt: string;\n // Translatable text; the definition of the word. e.g. \"where 2 rays connect\"\n definition: string;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusDropdownWidgetOptions = {\n // A list of choices for the dropdown\n choices: ReadonlyArray<PerseusDropdownChoice>;\n // Translatable Text; placeholder text for a dropdown. e.g. \"Please select a fruit\"\n placeholder: string;\n // Always false. Not used for this widget\n static: boolean;\n // Translatable Text; visible label for the dropdown\n visibleLabel?: string;\n // Translatable Text; aria label that screen readers will read\n ariaLabel?: string;\n};\n\nexport type PerseusDropdownChoice = {\n // Translatable text; The text for the option. e.g. \"Banana\" or \"Orange\"\n content: string;\n // Whether this is the correct option or not\n correct: boolean;\n};\n\nexport type PerseusExplanationWidgetOptions = {\n // Translatable Text; The clickable text to expand an explanation. e.g. \"What is an apple?\"\n showPrompt: string;\n // Translatable Text; The cliclable text to hide an explanation. e.g. \"Thanks. I got it!\"\n hidePrompt: string;\n // Translatable Markdown; The explanation that is shown when showPrompt is clicked. e.g. \"An apple is a tasty fruit.\"\n explanation: string;\n // explanation fields can embed widgets. When they do, the details of the widgets are here.\n widgets: PerseusWidgetsMap;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type LegacyButtonSets = ReadonlyArray<\n | \"basic\"\n | \"basic+div\"\n | \"trig\"\n | \"prealgebra\"\n | \"logarithms\"\n | \"basic relations\"\n | \"advanced relations\"\n | \"scientific\"\n>;\n\nexport type PerseusExpressionWidgetOptions = {\n // The expression forms the answer may come in\n answerForms: ReadonlyArray<PerseusExpressionAnswerForm>;\n buttonSets: LegacyButtonSets;\n // Variables that can be used as functions. Default: [\"f\", \"g\", \"h\"]\n functions: ReadonlyArray<string>;\n // Use x for rendering multiplication instead of a center dot.\n times: boolean;\n // What extra keys need to be displayed on the keypad so that the\n // question can be answerable without a keyboard (ie mobile)\n // TODO: this is really ReadonlyArray<Key>\n extraKeys?: ReadonlyArray<KeypadKey>;\n // visible label associated with the MathQuill field\n visibleLabel?: string;\n // aria label for screen readers attached to MathQuill field\n ariaLabel?: string;\n // Controls when buttons for special characters are visible when using a\n // desktop browser. Defaults to \"focused\".\n // NOTE: This isn't listed in perseus-format.js or perseus_data.go, but\n // appears in item data in the datastore.\n buttonsVisible?: \"always\" | \"never\" | \"focused\";\n};\n\nexport const PerseusExpressionAnswerFormConsidered = [\n \"correct\",\n \"wrong\",\n \"ungraded\",\n] as const;\n\nexport type PerseusExpressionAnswerForm = {\n // The TeX form of the expression. e.g. \"x\\\\cdot3=y\"\n value: string;\n // The Answer expression must have the same form\n form: boolean;\n // The answer expression must be fully expanded and simplified\n simplify: boolean;\n // Whether the form is considered \"correct\", \"wrong\", or \"ungraded\"\n considered: (typeof PerseusExpressionAnswerFormConsidered)[number];\n // A key to identify the answer form in a list\n // NOTE: perseus-format.js says this is required even though it isn't necessary.\n key?: string;\n};\n\nexport type PerseusGradedGroupWidgetOptions = {\n // Translatable Text; A title to be displayed for the group.\n title: string;\n // Not used in Perseus (but is set in (en, pt) production data)\n hasHint?: boolean | null | undefined;\n // A section to define hints for the group.\n hint?: PerseusRenderer | null | undefined;\n // Translatable Markdown. May include widgets and images embedded.\n content: string;\n // See PerseusRenderer.widgets\n widgets: PerseusWidgetsMap;\n // Not used in Perseus\n widgetEnabled?: boolean | null | undefined;\n // Not used in Perseus\n immutableWidgets?: boolean | null | undefined;\n // See PerseusRenderer.images\n images: {\n [key: string]: PerseusImageDetail;\n };\n};\n\nexport type PerseusGradedGroupSetWidgetOptions = {\n // A list of Widget Groups\n gradedGroups: ReadonlyArray<PerseusGradedGroupWidgetOptions>;\n};\n\n// 2D range: xMin, xMax, yMin, yMax\nexport type GraphRange = [\n x: [min: number, max: number],\n y: [min: number, max: number],\n];\n\nexport type GrapherAnswerTypes =\n | {\n type: \"absolute_value\";\n // If `coords` is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [vertex: Coord, secondPoint: Coord];\n }\n | {\n type: \"exponential\";\n // Two points along the asymptote line. Usually (always?) a\n // horizontal or vertical line.\n asymptote: [Coord, Coord];\n // Two points along the exponential curve. One end of the curve\n // trends towards the asymptote.\n // If `coords` is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"linear\";\n // Two points along the straight line\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"logarithm\";\n // Two points along the asymptote line.\n asymptote: [Coord, Coord];\n // Two points along the logarithmic curve. One end of the curve\n // trends towards the asymptote.\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"quadratic\";\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [vertex: Coord, secondPoint: Coord];\n }\n | {\n type: \"sinusoid\";\n // Two points on the same slope in the sinusoid wave line.\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n }\n | {\n type: \"tangent\";\n // Two points on the same slope in the tangent wave line.\n // If coords is null, the graph will not be gradable. All answers\n // will be scored as invalid.\n coords: null | [Coord, Coord];\n };\n\nexport type PerseusGrapherWidgetOptions = {\n availableTypes: ReadonlyArray<\n | \"absolute_value\"\n | \"exponential\"\n | \"linear\"\n | \"logarithm\"\n | \"quadratic\"\n | \"sinusoid\"\n | \"tangent\"\n >;\n correct: GrapherAnswerTypes;\n graph: {\n backgroundImage: {\n bottom?: number;\n height?: number;\n left?: number;\n scale?: number;\n url?: string | null | undefined;\n width?: number;\n };\n box?: [number, number];\n editableSettings?: ReadonlyArray<\n \"graph\" | \"snap\" | \"image\" | \"measure\"\n >;\n gridStep?: [number, number];\n labels: [string, string];\n markings: MarkingsType;\n range: GraphRange;\n rulerLabel: \"\";\n rulerTicks: number;\n showProtractor?: boolean;\n showRuler?: boolean;\n showTooltips?: boolean;\n snapStep?: [number, number];\n step: [number, number];\n valid?: boolean | string;\n };\n};\n\nexport type PerseusGroupWidgetOptions = PerseusRenderer;\n\nexport type PerseusImageWidgetOptions = {\n // Translatable Markdown; Text to be shown for the title of the image\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n title?: string;\n // Translatable Markdown; Text to be shown in the caption section of an image\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n caption?: string;\n // Translatable Text; The alt text to be shown in the img.alt attribute\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n alt?: string;\n // The image details for the image to be displayed\n backgroundImage: PerseusImageBackground;\n // Always false. Not used for this widget\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n static?: boolean;\n // A list of labels to display on the image\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n labels?: ReadonlyArray<PerseusImageLabel>;\n // The range on the image render for labels\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n range?: [Interval, Interval];\n // The box on the image render for labels. The same as backgroundImage.width and backgroundImage.height\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n box?: Size;\n};\n\nexport type PerseusImageLabel = {\n // Translatable Text; The content of the label to display\n content: string;\n // The visual alignment of the label. default: \"center\"\n alignment: string;\n // The point on the image to display the label\n coordinates: ReadonlyArray<number>;\n};\n\nexport type PerseusInteractiveGraphWidgetOptions = {\n // Where the little black axis lines & labels (ticks) should render.\n // Also known as the tick step. default [1, 1]\n // NOTE(kevinb): perseus_data.go defines this as Array<number>\n step: [number, number];\n // Where the grid lines on the graph will render. default [1, 1]\n // NOTE(kevinb): perseus_data.go defines this as Array<number>\n gridStep?: [x: number, y: number];\n // Where the graph points will lock to when they are dragged. default [0.5, 0.5]\n // NOTE(kevinb): perseus_data.go defines this as Array<number>\n snapStep?: [x: number, y: number];\n // An optional image to use in the background\n backgroundImage?: PerseusImageBackground;\n /**\n * The type of markings to display on the graph.\n */\n markings: MarkingsType;\n // How to label the X and Y axis. default: [\"x\", \"y\"]\n labels?: ReadonlyArray<string>;\n /**\n * Specifies the location of the labels on the graph. default: \"onAxis\".\n * - \"onAxis\": Labels are positioned on the axis at the right (x) and top (y) of the graph.\n * - \"alongEdge\": Labels are centered along the bottom (x) and left (y) edges of the graph.\n * The y label is rotated. Typically used when the range min is near 0 with longer labels.\n */\n labelLocation?: AxisLabelLocation;\n // Whether to show the Protractor tool overlayed on top of the graph\n showProtractor: boolean;\n /**\n * Whether to show the Ruler tool overlayed on top of the graph.\n * @deprecated - no longer used by the InteractiveGraph widget. The\n * property is kept on this type to prevent its accidental reuse in future\n * features, since it may appear in production data.\n */\n showRuler?: boolean;\n // Whether to show tooltips on the graph\n showTooltips?: boolean;\n /**\n * The unit to show on the ruler. e.g. \"mm\", \"cm\", \"m\", \"km\", \"in\", \"ft\",\n * \"yd\", \"mi\".\n * @deprecated - no longer used by the InteractiveGraph widget. The\n * property is kept on this type to prevent its accidental reuse in future\n * features, since it may appear in production data.\n */\n rulerLabel?: string;\n /**\n * How many ticks to show on the ruler. e.g. 1, 2, 4, 8, 10, 16. Must be\n * an integer.\n * @deprecated - no longer used by the InteractiveGraph widget. The\n * property is kept on this type to prevent its accidental reuse in future\n * features, since it may appear in production data.\n */\n rulerTicks?: number;\n // The X and Y coordinate ranges for the view of the graph. default: [[-10, 10], [-10, 10]]\n // NOTE(kevinb): perseus_data.go defines this as Array<Array<number>>\n // TODO(kevinb): Add a transform function to interactive-graph.jsx to\n // rename `range` to `ranges` so that things are less confusing.\n range: GraphRange;\n // The type of graph\n graph: PerseusGraphType;\n // The correct kind of graph, if being used to select function type\n // TODO(LEMS-2344): make the type of `correct` more specific\n correct: PerseusGraphType;\n // Shapes (points, chords, etc) displayed on the graph that cannot\n // be moved by the user.\n lockedFigures?: ReadonlyArray<LockedFigure>;\n // Aria label that applies to the entire graph.\n fullGraphAriaLabel?: string;\n // Aria description that applies to the entire graph.\n fullGraphAriaDescription?: string;\n};\n\nexport const lockedFigureColorNames = [\n \"blue\",\n \"green\",\n \"grayH\",\n \"purple\",\n \"pink\",\n \"orange\",\n \"red\",\n] as const;\n\nexport type LockedFigureColor = (typeof lockedFigureColorNames)[number];\n\nexport const lockedFigureColors: Record<LockedFigureColor, string> = {\n blue: \"#3D7586\",\n green: \"#447A53\",\n grayH: \"#3B3D45\",\n purple: \"#594094\",\n pink: \"#B25071\",\n red: \"#D92916\",\n orange: \"#946700\",\n} as const;\n\nexport type LockedFigure =\n | LockedPointType\n | LockedLineType\n | LockedVectorType\n | LockedEllipseType\n | LockedPolygonType\n | LockedFunctionType\n | LockedLabelType;\nexport type LockedFigureType = LockedFigure[\"type\"];\n\nexport type LockedLineStyle = \"solid\" | \"dashed\";\n\nexport type LockedPointType = {\n type: \"point\";\n coord: Coord;\n color: LockedFigureColor;\n filled: boolean;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedLineType = {\n type: \"line\";\n kind: \"line\" | \"ray\" | \"segment\";\n points: [point1: LockedPointType, point2: LockedPointType];\n color: LockedFigureColor;\n lineStyle: LockedLineStyle;\n showPoint1: boolean;\n showPoint2: boolean;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedVectorType = {\n type: \"vector\";\n points: [tail: Coord, tip: Coord];\n color: LockedFigureColor;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedFigureFillType = \"none\" | \"white\" | \"translucent\" | \"solid\";\nexport const lockedFigureFillStyles: Record<LockedFigureFillType, number> = {\n none: 0,\n white: 1,\n translucent: 0.4,\n solid: 1,\n} as const;\n\nexport type LockedEllipseType = {\n type: \"ellipse\";\n center: Coord;\n radius: [x: number, y: number];\n angle: number;\n color: LockedFigureColor;\n fillStyle: LockedFigureFillType;\n strokeStyle: LockedLineStyle;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedPolygonType = {\n type: \"polygon\";\n points: ReadonlyArray<Coord>;\n color: LockedFigureColor;\n showVertices: boolean;\n fillStyle: LockedFigureFillType;\n strokeStyle: LockedLineStyle;\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\nexport type LockedFunctionType = {\n type: \"function\";\n color: LockedFigureColor;\n strokeStyle: LockedLineStyle;\n /**\n * This is the user-defined equation (as it was typed)\n */\n equation: string;\n /**\n * The independent variable of this function\n */\n directionalAxis: \"x\" | \"y\";\n /**\n * The minimum and maximum values along the `directionalAxis` at which\n * this function should be graphed. Values of -Infinity and Infinity are\n * allowed. Note that infinite values are serialized as `null` in JSON.\n */\n domain: [min: number, max: number];\n labels?: LockedLabelType[];\n ariaLabel?: string;\n};\n\n// Not associated with a specific figure\nexport type LockedLabelType = {\n type: \"label\";\n coord: Coord;\n // TeX-supported string\n text: string;\n color: LockedFigureColor;\n size: \"small\" | \"medium\" | \"large\";\n};\n\nexport type PerseusGraphType =\n | PerseusGraphTypeAngle\n | PerseusGraphTypeCircle\n | PerseusGraphTypeLinear\n | PerseusGraphTypeLinearSystem\n | PerseusGraphTypeNone\n | PerseusGraphTypePoint\n | PerseusGraphTypePolygon\n | PerseusGraphTypeQuadratic\n | PerseusGraphTypeRay\n | PerseusGraphTypeSegment\n | PerseusGraphTypeSinusoid;\n\ntype PerseusGraphTypeCommon = {\n // NOTE(jeremy): This is referenced in the component. Verify if there's any\n // production data that still has this.\n coord?: Coord; // Legacy!\n};\n\nexport type PerseusGraphTypeAngle = {\n type: \"angle\";\n // Whether to show the angle measurements. default: false\n showAngles?: boolean;\n // Allow Reflex Angles if an \"angle\" type. default: true\n allowReflexAngles?: boolean;\n // The angle offset in degrees if an \"angle\" type. default: 0\n angleOffsetDeg?: number;\n // Snap to degree increments if an \"angle\" type. default: 1\n snapDegrees?: number;\n // How to match the answer. If missing, defaults to exact matching.\n match?: \"congruent\";\n // must have 3 coords - ie [Coord, Coord, Coord]\n coords?: [Coord, Coord, Coord] | null;\n // The initial coordinates the graph renders with.\n startCoords?: [Coord, Coord, Coord];\n};\n\nexport type PerseusGraphTypeCircle = {\n type: \"circle\";\n center?: Coord;\n radius?: number;\n // The initial coordinates the graph renders with.\n startCoords?: {\n center: Coord;\n radius: number;\n };\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeLinear = {\n type: \"linear\";\n // expects 2 coords\n coords?: CollinearTuple | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeLinearSystem = {\n type: \"linear-system\";\n // expects 2 sets of 2 coords\n coords?: CollinearTuple[] | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple[];\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeNone = {\n type: \"none\";\n};\n\nexport type PerseusGraphTypePoint = {\n type: \"point\";\n // The number of points if a \"point\" type. default: 1. \"unlimited\" if no limit\n numPoints?: number | \"unlimited\";\n coords?: ReadonlyArray<Coord> | null;\n // The initial coordinates the graph renders with.\n startCoords?: ReadonlyArray<Coord>;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypePolygon = {\n type: \"polygon\";\n // The number of sides. default: 3. \"unlimited\" if no limit\n numSides?: number | \"unlimited\";\n // Whether to the angle measurements. default: false\n showAngles?: boolean;\n // Whether to show side measurements. default: false\n showSides?: boolean;\n // How to snap points. e.g. \"grid\", \"angles\", or \"sides\". default: grid\n snapTo?: \"grid\" | \"angles\" | \"sides\";\n // How to match the answer. If missing, defaults to exact matching.\n match?: \"similar\" | \"congruent\" | \"approx\" | \"exact\";\n coords?: ReadonlyArray<Coord> | null;\n // The initial coordinates the graph renders with.\n startCoords?: ReadonlyArray<Coord>;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeQuadratic = {\n type: \"quadratic\";\n // expects a list of 3 coords\n coords?: [Coord, Coord, Coord] | null;\n // The initial coordinates the graph renders with.\n startCoords?: [Coord, Coord, Coord];\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeSegment = {\n type: \"segment\";\n // The number of segments if a \"segment\" type. default: 1. Max: 6\n numSegments?: number;\n // Expects a list of Coord tuples. Length should match the `numSegments` value.\n coords?: CollinearTuple[] | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple[];\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeSinusoid = {\n type: \"sinusoid\";\n // Expects a list of 2 Coords\n coords?: ReadonlyArray<Coord> | null;\n // The initial coordinates the graph renders with.\n startCoords?: ReadonlyArray<Coord>;\n} & PerseusGraphTypeCommon;\n\nexport type PerseusGraphTypeRay = {\n type: \"ray\";\n // Expects a list of 2 Coords\n coords?: CollinearTuple | null;\n // The initial coordinates the graph renders with.\n startCoords?: CollinearTuple;\n} & PerseusGraphTypeCommon;\n\ntype AngleGraphCorrect = {\n type: \"angle\";\n allowReflexAngles: boolean;\n match?: \"congruent\";\n coords: [Coord, Coord, Coord];\n};\n\ntype CircleGraphCorrect = {\n type: \"circle\";\n center: Coord;\n radius: number;\n};\n\ntype LinearGraphCorrect = {\n type: \"linear\";\n coords: CollinearTuple;\n};\n\ntype LinearSystemGraphCorrect = {\n type: \"linear-system\";\n coords: [CollinearTuple, CollinearTuple];\n};\n\ntype NoneGraphCorrect = {\n type: \"none\";\n};\n\ntype PointGraphCorrect = {\n type: \"point\";\n coords: ReadonlyArray<Coord>;\n};\n\ntype PolygonGraphCorrect = {\n type: \"polygon\";\n match: \"similar\" | \"congruent\" | \"approx\";\n coords: ReadonlyArray<Coord>;\n};\n\ntype QuadraticGraphCorrect = {\n type: \"quadratic\";\n coords: [Coord, Coord, Coord];\n};\n\ntype SegmentGraphCorrect = {\n type: \"segment\";\n coords: CollinearTuple[];\n};\n\ntype SinusoidGraphCorrect = {\n type: \"sinusoid\";\n coords: CollinearTuple;\n};\n\ntype RayGraphCorrect = {\n type: \"ray\";\n coords: CollinearTuple;\n};\n\nexport type PerseusGraphCorrectType =\n | AngleGraphCorrect\n | CircleGraphCorrect\n | LinearGraphCorrect\n | LinearSystemGraphCorrect\n | NoneGraphCorrect\n | PointGraphCorrect\n | PolygonGraphCorrect\n | QuadraticGraphCorrect\n | RayGraphCorrect\n | SegmentGraphCorrect\n | SinusoidGraphCorrect;\n\nexport type PerseusLabelImageWidgetOptions = {\n // Translatable Text; Tex representation of choices\n choices: ReadonlyArray<string>;\n // The URL of the image\n imageUrl: string;\n // Translatable Text; To show up in the img.alt attribute\n imageAlt: string;\n // The height of the image\n imageHeight: number;\n // The width of the image\n imageWidth: number;\n // A list of markers to display on the image\n markers: ReadonlyArray<PerseusLabelImageMarker>;\n // Do not display answer choices in instructions\n hideChoicesFromInstructions: boolean;\n // Allow multiple answers per marker\n multipleAnswers: boolean;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusLabelImageMarker = {\n // A list of correct answers for this marker. Often only one but can have multiple\n answers: ReadonlyArray<string>;\n // Translatable Text; The text to show for the marker. Not displayed directly to the user\n label: string;\n // X Coordiate location of the marker on the image\n x: number;\n // Y Coordinate location of the marker on the image\n y: number;\n};\n\nexport type PerseusMatcherWidgetOptions = {\n // Translatable Text; Labels to adorn the headings for the columns. Only 2 values [left, right]. e.g. [\"Concepts\", \"Things\"]\n labels: ReadonlyArray<string>;\n // Translatable Text; Static concepts to show in the left column. e.g. [\"Fruit\", \"Color\", \"Clothes\"]\n left: ReadonlyArray<string>;\n // Translatable Markup; Values that represent the concepts to be correlated with the concepts. e.g. [\"Red\", \"Shirt\", \"Banana\"]\n right: ReadonlyArray<string>;\n // Order of the matched pairs matters. With this option enabled, only the order provided above will be treated as correct. This is useful when ordering is significant, such as in the context of a proof. If disabled, pairwise matching is sufficient. To make this clear, the left column becomes fixed in the provided order and only the cards in the right column can be moved.\n orderMatters: boolean;\n // Adds padding to the rows. Padding is good for text, but not needed for images.\n padding: boolean;\n};\n\nexport type PerseusMatrixWidgetAnswers = ReadonlyArray<ReadonlyArray<number>>;\nexport type PerseusMatrixWidgetOptions = {\n // Translatable Text; Shown before the matrix\n prefix?: string | undefined;\n // Translatable Text; Shown after the matrix\n suffix?: string | undefined;\n // A data matrix representing the \"correct\" answers to be entered into the matrix\n answers: PerseusMatrixWidgetAnswers;\n // The coordinate location of the cursor position at start. default: [0, 0]\n cursorPosition?: ReadonlyArray<number> | undefined;\n // The coordinate size of the matrix. Only supports 2-dimensional matrix. default: [3, 3]\n matrixBoardSize: ReadonlyArray<number>;\n // Whether this is meant to statically display the answers (true) or be used as an input field, graded against the answers\n static?: boolean | undefined;\n};\n\nexport type PerseusMeasurerWidgetOptions = {\n // The image that the user is meant to measure\n image: PerseusImageBackground;\n // Whether to show the Protractor tool overlayed on top of the image\n showProtractor: boolean;\n // Whether to show the Ruler tool overlayed on top of the image\n showRuler: boolean;\n // The unit to show on the ruler. e.g. \"mm\", \"cm\", \"m\", \"km\", \"in\", \"ft\", \"yd\", \"mi\"\n rulerLabel: string;\n // How many ticks to show on the ruler. e.g. 1, 2, 4, 8, 10, 16\n rulerTicks: number;\n // The number of image pixels per unit (label)\n rulerPixels: number;\n // The number of units to display on the ruler\n rulerLength: number;\n // Containing area [width, height]\n box: [number, number];\n // TODO(benchristel): static is not used. Remove it?\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type MathFormat =\n | \"integer\"\n | \"mixed\"\n | \"improper\"\n | \"proper\"\n | \"decimal\"\n | \"percent\"\n | \"pi\";\n\nexport type PerseusNumericInputAnswerForm = {\n simplify: PerseusNumericInputSimplify | null | undefined;\n name: MathFormat;\n};\n\nexport type PerseusNumericInputSimplify =\n | \"required\"\n | \"correct\"\n | \"enforced\"\n | \"optional\";\n\nexport type PerseusNumericInputWidgetOptions = {\n // A list of all the possible correct and incorrect answers\n answers: ReadonlyArray<PerseusNumericInputAnswer>;\n // Translatable Text; Text to describe this input. This will be shown to users using screenreaders.\n labelText?: string | undefined;\n // Use size \"Normal\" for all text boxes, unless there are multiple text boxes in one line and the answer area is too narrow to fit them. Options: \"normal\" or \"small\"\n size: string;\n // A coefficient style number allows the student to use - for -1 and an empty string to mean 1.\n coefficient: boolean;\n // Whether to right-align the text or not\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n rightAlign?: boolean;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusNumericInputAnswer = {\n // Translatable Display; A description for why this answer is correct, wrong, or ungraded\n message: string;\n // The expected answer\n value?: number | null;\n // Whether this answer is \"correct\", \"wrong\", or \"ungraded\"\n status: string;\n // The forms available for this answer. Options: \"integer, \"\"decimal\", \"proper\", \"improper\", \"mixed\", or \"pi\"\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n answerForms?: ReadonlyArray<MathFormat>;\n // Whether we should check the answer strictly against the the configured answerForms (strict = true)\n // or include the set of default answerForms (strict = false).\n strict: boolean;\n // A range of error +/- the value\n // NOTE: perseus_data.go says this is non-nullable even though we handle null values.\n maxError: number | null | undefined;\n // Unsimplified answers are Ungraded, Accepted, or Wrong. Options: \"required\", \"correct\", or \"enforced\"\n simplify: PerseusNumericInputSimplify | null | undefined;\n};\n\nexport type PerseusNumberLineWidgetOptions = {\n // The position of the endpoints of the number line. Setting the range constrains the position of the answer and the labels.\n range: ReadonlyArray<number>;\n // This controls the position of the left / right labels. By default, the labels are set by the range. Note: Ensure that the labels line up with the tick marks, or it may be confusing for users.\n labelRange: ReadonlyArray<number | null>;\n // This controls the styling of the labels for the two main labels as well as all the tick mark labels, if applicable. Options: \"decimal\", \"improper\", \"mixed\", \"non-reduced\"\n labelStyle: string;\n // Show label ticks\n labelTicks: boolean;\n // Show tick controller\n isTickCtrl?: boolean | null | undefined;\n // The range of divisions within the line\n divisionRange: ReadonlyArray<number>;\n // This controls the number (and position) of the tick marks. The number of divisions is constrained to the division range. Note: The user will be able to specify the number of divisions in a number input.\n numDivisions: number | null | undefined;\n // This determines the number of different places the point will snap between two adjacent tick marks. Note: Ensure the required number of snap increments is provided to answer the question.\n snapDivisions: number;\n // This controls the number (and position) of the tick marks; you can either set the number of divisions (2 divisions would split the entire range in two halves), or the tick step (the distance between ticks) and the other value will be updated accordingly. Note: There is no check to see if labels coordinate with the tick marks, which may be confusing for users if the blue labels and black ticks are off-step.\n tickStep: number | null | undefined;\n // The correct relative value. default: \"eq\". options: \"eq\", \"lt\", \"gt\", \"le\", \"ge\"\n correctRel: string | null | undefined;\n // This is the correct answer. The answer is validated (as right or wrong) by using only the end position of the point and the relation (=, <, >, ≤, ≥).\n correctX: number | null;\n // This controls the initial position of the point along the number line\n initialX: number | null | undefined;\n // Show tooltips\n showTooltips?: boolean;\n // When true, the answer is displayed and is immutable\n static: boolean;\n};\n\nexport type PerseusOrdererWidgetOptions = {\n // All of the options available to the user. Place the cards in the correct order. The same card can be used more than once in the answer but will only be displayed once at the top of a stack of identical cards.\n options: ReadonlyArray<PerseusRenderer>;\n // The correct order of the options\n correctOptions: ReadonlyArray<PerseusRenderer>;\n // Cards that are not part of the answer\n otherOptions: ReadonlyArray<PerseusRenderer>;\n // \"normal\" for text options. \"auto\" for image options.\n height: \"normal\" | \"auto\";\n // Use the \"horizontal\" layout for short text and small images. The \"vertical\" layout is best for longer text (e.g. proofs).\n layout: \"horizontal\" | \"vertical\";\n};\n\nexport type PerseusPassageWidgetOptions = {\n // Translatable Text; To add footnotes, add ^ characters where they belong in the passage. Then, add ^ in the footnotes area to reference the footnotes in the passage.\n footnotes: string;\n // Translatable Text; The text of the passage\n passageText: string;\n // translatableText - An optional title that will appear directly above the passage in the same font style. (e.g. Passage 1)\n passageTitle: string;\n // Should we show line numbers along with the passage?\n showLineNumbers: boolean;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusPassageRefWidgetOptions = {\n // The passage number\n passageNumber: number;\n // The reference number\n referenceNumber: number;\n // Short summary of the referenced section. This will be included in parentheses and quotes automatically.\n summaryText?: string;\n};\n\nexport const plotterPlotTypes = [\n \"bar\",\n \"line\",\n \"pic\",\n \"histogram\",\n \"dotplot\",\n] as const;\nexport type PlotType = (typeof plotterPlotTypes)[number];\n\nexport type PerseusPlotterWidgetOptions = {\n // Translatable Text; The Axis labels. e.g. [\"X Label\", \"Y Label\"]\n labels: ReadonlyArray<string>;\n // Translatable Text; Categories to display along the X access. e.g. [\">0\", \">6\", \">12\", \">18\"]\n categories: ReadonlyArray<string>;\n // The type of the graph. options \"bar\", \"line\", \"pic\", \"histogram\", \"dotplot\"\n type: PlotType;\n // The maximimum Y tick to display in the graph\n maxY: number;\n // The scale of the Y Axis\n scaleY: number;\n // Which ticks to display the labels for. For instance, setting this to \"4\" will only show every 4th label (plus the last one)\n labelInterval: number | null | undefined;\n // Creates the specified number of divisions between the horizontal lines. Fewer snaps between lines makes the graph easier for the student to create correctly.\n snapsPerLine: number;\n // The Y values the graph should start with\n starting: ReadonlyArray<number>;\n // The Y values that represent the correct answer expected\n correct: ReadonlyArray<number>;\n // A picture to represent items in a graph.\n picUrl: string | null | undefined;\n // deprecated\n picSize: number | null | undefined;\n // deprecated\n picBoxHeight: number | null | undefined;\n // deprecated\n plotDimensions: ReadonlyArray<number>;\n};\n\nexport type PerseusRadioWidgetOptions = {\n // The choices provided to the user.\n choices: ReadonlyArray<PerseusRadioChoice>;\n // Does this have a \"none of the above\" option?\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n hasNoneOfTheAbove?: boolean;\n // If multipleSelect is enabled, Specify the number expected to be correct.\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n countChoices?: boolean;\n // How many of the choices are correct, which is conditionally used to tell\n // learners ahead of time how many options they'll need.\n numCorrect?: number;\n // Randomize the order of the options or keep them as defined\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n randomize?: boolean;\n // Does this set allow for multiple selections to be correct?\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n multipleSelect?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n deselectEnabled?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n onePerLine?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n displayCount?: any;\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove?: false;\n};\n\nexport type PerseusRadioChoice = {\n // Translatable Markdown; The label for this choice\n content: string;\n // Translatable Markdown; A clue to give the user when they get it wrong\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n clue?: string;\n // Whether this option is a correct answer or not\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n correct?: boolean;\n // If this is none of the above, override the content with \"None of the above\"\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n isNoneOfTheAbove?: boolean;\n // deprecated\n // NOTE: perseus_data.go says this is required even though it isn't necessary.\n widgets?: PerseusWidgetsMap;\n};\n\nexport type PerseusSorterWidgetOptions = {\n // Translatable Text; The correct answer (in the correct order). The user will see the cards in a randomized order.\n correct: ReadonlyArray<string>;\n // Adds padding to the options. Padding is good for text but not needed for images\n padding: boolean;\n // Use the \"horizontal\" layout for short text and small images. The \"vertical\" layout is best for longer text and larger images.\n layout: \"horizontal\" | \"vertical\";\n};\n\nexport type PerseusTableWidgetOptions = {\n // Translatable Text; A list of column headers\n headers: ReadonlyArray<string>;\n // The number of rows to display\n rows: number;\n // The number of columns to display\n columns: number;\n // Translatable Text; A 2-dimensional array of text to populate the table with\n answers: ReadonlyArray<ReadonlyArray<string>>;\n};\n\nexport type PerseusInteractionWidgetOptions = {\n // The definition of the graph\n graph: PerseusInteractionGraph;\n // The elements of the graph\n elements: ReadonlyArray<PerseusInteractionElement>;\n // Always false. Not used for this widget\n static: boolean;\n};\n\nexport type PerseusInteractionGraph = {\n // \"canvas\", \"graph\"\n editableSettings?: ReadonlyArray<\"canvas\" | \"graph\">;\n // The Grid Canvas size. e.g. [400, 140]\n box: Size;\n // The Axis labels. e.g. [\"x\", \"y\"]\n labels: ReadonlyArray<string>;\n // The Axis ranges. e.g. [[-10, 10], [-10, 10]]\n range: [Interval, Interval];\n // The steps in the grid. default [1, 1]\n gridStep: [number, number];\n /**\n * The type of markings to display on the graph.\n */\n markings: MarkingsType;\n // The snap steps. default [0.5, 0.5]\n snapStep?: [number, number];\n // Whether the grid is valid or not. Do the numbers all make sense?\n // NOTE(jeremy) The editor for this widget sometimes stores the graph\n // editor validation error message into this field. It seems innocuous\n // because it looks like many of these usages don't actually use the graph\n // at all.\n valid?: boolean | string;\n // An optional background image to use\n backgroundImage?: PerseusImageBackground;\n // Whether to show the Protractor tool overlayed on top of the graph\n showProtractor?: boolean;\n // Whether to show the Ruler tool overlayed on top of the graph\n showRuler?: boolean;\n // The unit to show on the ruler. e.g. \"mm\", \"cm\", \"m\", \"km\", \"in\", \"ft\", \"yd\", \"mi\"\n rulerLabel?: string;\n // How many ticks to show on the ruler. e.g. 1, 2, 4, 8, 10, 16\n rulerTicks?: number;\n // This controls the number (and position) of the tick marks for the X and Y axis. e.g. [1, 1]\n tickStep: [number, number];\n};\n\nexport type PerseusInteractionElement =\n | {\n type: \"function\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionFunctionElementOptions;\n }\n | {\n type: \"label\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionLabelElementOptions;\n }\n | {\n type: \"line\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionLineElementOptions;\n }\n | {\n type: \"movable-line\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionMovableLineElementOptions;\n }\n | {\n type: \"movable-point\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionMovablePointElementOptions;\n }\n | {\n type: \"parametric\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionParametricElementOptions;\n }\n | {\n type: \"point\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionPointElementOptions;\n }\n | {\n type: \"rectangle\";\n // An identifier for the element\n key: string;\n options: PerseusInteractionRectangleElementOptions;\n };\n\nexport type PerseusInteractionFunctionElementOptions = {\n // The definition of the function to draw on the graph. e.g \"x^2 + 1\"\n value: string;\n // The name of the function like f(n). default: \"f\"\n funcName: string;\n // The range of points to start plotting\n rangeMin: string;\n // The range of points to end plotting\n rangeMax: string;\n // The color of the stroke. e.g. #6495ED\n color: string;\n // If the function stroke has a dash, what is it? options: \"\", \"-\", \"- \", \".\", \". \"\n strokeDasharray: string;\n // The thickness of the stroke\n strokeWidth: number;\n};\n\nexport type PerseusInteractionLabelElementOptions = {\n // Translatable Text; the content of the label\n label: string;\n // The color of the label. e.g. \"red\"\n color: string;\n // The X location of the label\n coordX: string;\n // The Y location of the label\n coordY: string;\n};\n\nexport type PerseusInteractionLineElementOptions = {\n // A color code for the line segment. e.g. \"#FFOOAF\"\n color: string;\n // The start of the line segment (X)\n startX: string;\n // The start of the line segment (Y)\n startY: string;\n // The end of the line segment (X)\n endX: string;\n // The end of the line segment (Y)\n endY: string;\n // If the line stroke has a dash, what is it? options: \"\", \"-\", \"- \", \".\", \". \"\n strokeDasharray: string;\n // The thickness of the line\n strokeWidth: number;\n // Does the line have an arrow point to it? options: \"\", \"->\"\n arrows: string;\n};\n\nexport type PerseusInteractionMovableLineElementOptions = {\n // The start of the line segment (X)\n startX: string;\n // The start of the line segment (Y)\n startY: string;\n // Start updates (Xn, Yn) for n\n startSubscript: number;\n // The end of the line segment (X)\n endX: string;\n // The end of the line segment (Y)\n endY: string;\n // End updates (Xm, Ym) for m\n endSubscript: number;\n // How to constrain this line? options \"none\", \"snap\", \"x\", \"y\"\n constraint: string;\n // The snap resolution when constraint is set to \"snap\"\n snap: number;\n // The constraint function for when constraint is set to \"x\" or \"y\"\n constraintFn: string;\n // The lowest possible X value\n constraintXMin: string;\n // The highest possible X value\n constraintXMax: string;\n // The lowest possible Y value\n constraintYMin: string;\n // The highest possible Y value\n constraintYMax: string;\n};\n\nexport type PerseusInteractionMovablePointElementOptions = {\n // The X position of the point\n startX: string;\n // The Y position of the point\n startY: string;\n // Update (Xn, Yn) for n\n varSubscript: number;\n // How to constrain this line? options \"none\", \"snap\", \"x\", \"y\"\n constraint: string;\n // The snap resolution when constraint is set to \"snap\"\n snap: number;\n // The constraint function for when constraint is set to \"x\" or \"y\"\n constraintFn: string;\n // The lowest possible X value\n constraintXMin: string;\n // The highest possible X value\n constraintXMax: string;\n // The lowest possible Y value\n constraintYMin: string;\n // The highest possible Y value\n constraintYMax: string;\n};\n\nexport type PerseusInteractionParametricElementOptions = {\n // The function for the X coordinate. e.g. \"\\\\cos(t)\"\n x: string;\n // The function for the Y coordinate. e.g. \"\\\\sin(t)\"\n y: string;\n // The range of points to start plotting\n rangeMin: string;\n // The range of points to end plotting\n rangeMax: string;\n // The color of the stroke. e.g. #6495ED\n color: string;\n // If the function stroke has a dash, what is it? options: \"\", \"-\", \"- \", \".\", \". \"\n strokeDasharray: string;\n // The thickness of the stroke\n strokeWidth: number;\n};\n\nexport type PerseusInteractionPointElementOptions = {\n // The color of the point. e.g. \"black\"\n color: string;\n // The X coordinate of the point\n coordX: string;\n // The Y coordinate of the point\n coordY: string;\n};\n\nexport type PerseusInteractionRectangleElementOptions = {\n // The fill color. e.g. \"#EDD19B\"\n color: string;\n // The lower left point X\n coordX: string;\n // The lower left point Y\n coordY: string;\n // The width of the rectangle\n width: string;\n // The height of the rectangle\n height: string;\n};\n\nexport type PerseusCSProgramWidgetOptions = {\n // The ID of the CS program to embed\n programID: string;\n // Deprecated. Always null and sometimes omitted entirely.\n programType?: any;\n // Settings that you add here are available to the program as an object returned by Program.settings()\n settings: ReadonlyArray<PerseusCSProgramSetting>;\n // If you show the editor, you should use the \"full-width\" alignment to make room for the width of the editor.\n showEditor: boolean;\n // Whether to show the execute buttons\n showButtons: boolean;\n // The height of the widget\n height: number;\n // TODO(benchristel): static is not used. Delete it?\n // Always false\n static: boolean;\n};\n\nexport type PerseusCSProgramSetting = {\n // The name/key of the setting\n name: string;\n // The value of the setting\n value: string;\n};\n\nexport type PerseusPythonProgramWidgetOptions = {\n // The ID of the Python program to embed\n programID: string;\n // The height of the widget in pixels\n height: number;\n};\n\nexport type PerseusIFrameWidgetOptions = {\n // A URL to display OR a CS Program ID\n url: string;\n // Settings that you add here are available to the program as an object returned by Program.settings()\n settings?: ReadonlyArray<PerseusCSProgramSetting>;\n // The width of the widget\n width: number | string;\n // The height of the widget\n height: number | string;\n // Whether to allow the IFrame to become full-screen (like a video)\n allowFullScreen: boolean;\n // Whether to allow the iframe content to redirect the page\n allowTopNavigation?: boolean;\n // Always false\n static: boolean;\n};\n\nexport type PerseusPhetSimulationWidgetOptions = {\n // A URL to display, must start with https://phet.colorado.edu/\n url: string;\n // Translatable Text; Description of the sim for Khanmigo and alt text\n description: string;\n};\n\nexport type PerseusVideoWidgetOptions = {\n location: string;\n static?: boolean;\n};\n\nexport type PerseusInputNumberWidgetOptions = {\n answerType?:\n | \"number\"\n | \"decimal\"\n | \"integer\"\n | \"rational\"\n | \"improper\"\n | \"mixed\"\n | \"percent\"\n | \"pi\";\n inexact?: boolean;\n maxError?: number | string;\n rightAlign?: boolean;\n simplify: \"required\" | \"optional\" | \"enforced\";\n size: \"normal\" | \"small\";\n value: string | number;\n customKeypad?: boolean;\n};\n\nexport type PerseusMoleculeRendererWidgetOptions = {\n widgetId: string;\n rotationAngle?: number;\n smiles?: string;\n};\n\nexport type PerseusPassageRefTargetWidgetOptions = {\n content: string;\n};\n\nexport type PerseusWidgetOptions =\n | PerseusCategorizerWidgetOptions\n | PerseusCSProgramWidgetOptions\n | PerseusDefinitionWidgetOptions\n | PerseusDropdownWidgetOptions\n | PerseusExplanationWidgetOptions\n | PerseusExpressionWidgetOptions\n | PerseusGradedGroupSetWidgetOptions\n | PerseusGradedGroupWidgetOptions\n | PerseusIFrameWidgetOptions\n | PerseusImageWidgetOptions\n | PerseusInputNumberWidgetOptions\n | PerseusInteractionWidgetOptions\n | PerseusInteractiveGraphWidgetOptions\n | PerseusLabelImageWidgetOptions\n | PerseusMatcherWidgetOptions\n | PerseusMatrixWidgetOptions\n | PerseusMeasurerWidgetOptions\n | PerseusMoleculeRendererWidgetOptions\n | PerseusNumberLineWidgetOptions\n | PerseusNumericInputWidgetOptions\n | PerseusOrdererWidgetOptions\n | PerseusPassageRefTargetWidgetOptions\n | PerseusPassageRefWidgetOptions\n | PerseusPassageWidgetOptions\n | PerseusPhetSimulationWidgetOptions\n | PerseusPlotterWidgetOptions\n | PerseusRadioWidgetOptions\n | PerseusSorterWidgetOptions\n | PerseusTableWidgetOptions\n | PerseusVideoWidgetOptions;\n","import {lockedFigureColorNames} from \"../../data-schema\";\nimport {\n array,\n boolean,\n constant,\n enumeration,\n nullable,\n number,\n object,\n optional,\n pair,\n string,\n trio,\n union,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {discriminatedUnionOn} from \"../general-purpose-parsers/discriminated-union\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {\n InteractiveGraphWidget,\n LockedEllipseType,\n LockedFigure,\n LockedFigureColor,\n LockedFigureFillType,\n LockedFunctionType,\n LockedLabelType,\n LockedLineStyle,\n LockedLineType,\n LockedPointType,\n LockedPolygonType,\n LockedVectorType,\n PerseusGraphType,\n PerseusGraphTypeAngle,\n PerseusGraphTypeCircle,\n PerseusGraphTypeLinear,\n PerseusGraphTypeLinearSystem,\n PerseusGraphTypeNone,\n PerseusGraphTypePoint,\n PerseusGraphTypePolygon,\n PerseusGraphTypeQuadratic,\n PerseusGraphTypeRay,\n PerseusGraphTypeSegment,\n PerseusGraphTypeSinusoid,\n} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\n// Used to represent 2-D points and ranges\nconst pairOfNumbers = pair(number, number);\n\nconst parsePerseusGraphTypeAngle: Parser<PerseusGraphTypeAngle> = object({\n type: constant(\"angle\"),\n showAngles: optional(boolean),\n allowReflexAngles: optional(boolean),\n angleOffsetDeg: optional(number),\n snapDegrees: optional(number),\n match: optional(constant(\"congruent\")),\n coords: optional(trio(pairOfNumbers, pairOfNumbers, pairOfNumbers)),\n startCoords: optional(trio(pairOfNumbers, pairOfNumbers, pairOfNumbers)),\n});\n\nconst parsePerseusGraphTypeCircle: Parser<PerseusGraphTypeCircle> = object({\n type: constant(\"circle\"),\n center: optional(pairOfNumbers),\n radius: optional(number),\n startCoords: optional(\n object({\n center: pairOfNumbers,\n radius: number,\n }),\n ),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeLinear: Parser<PerseusGraphTypeLinear> = object({\n type: constant(\"linear\"),\n coords: optional(nullable(pair(pairOfNumbers, pairOfNumbers))),\n startCoords: optional(pair(pairOfNumbers, pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeLinearSystem: Parser<PerseusGraphTypeLinearSystem> =\n object({\n type: constant(\"linear-system\"),\n // TODO(benchristel): default coords to empty array?\n coords: optional(nullable(array(pair(pairOfNumbers, pairOfNumbers)))),\n startCoords: optional(array(pair(pairOfNumbers, pairOfNumbers))),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n });\n\nconst parsePerseusGraphTypeNone: Parser<PerseusGraphTypeNone> = object({\n type: constant(\"none\"),\n});\n\nconst parsePerseusGraphTypePoint: Parser<PerseusGraphTypePoint> = object({\n type: constant(\"point\"),\n numPoints: optional(union(number).or(constant(\"unlimited\")).parser),\n coords: optional(nullable(array(pairOfNumbers))),\n startCoords: optional(array(pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypePolygon: Parser<PerseusGraphTypePolygon> = object({\n type: constant(\"polygon\"),\n numSides: optional(union(number).or(constant(\"unlimited\")).parser),\n showAngles: optional(boolean),\n showSides: optional(boolean),\n snapTo: optional(enumeration(\"grid\", \"angles\", \"sides\")),\n match: optional(enumeration(\"similar\", \"congruent\", \"approx\", \"exact\")),\n startCoords: optional(array(pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeQuadratic: Parser<PerseusGraphTypeQuadratic> =\n object({\n type: constant(\"quadratic\"),\n coords: optional(\n nullable(trio(pairOfNumbers, pairOfNumbers, pairOfNumbers)),\n ),\n startCoords: optional(\n trio(pairOfNumbers, pairOfNumbers, pairOfNumbers),\n ),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n });\n\nconst parsePerseusGraphTypeRay: Parser<PerseusGraphTypeRay> = object({\n type: constant(\"ray\"),\n coords: optional(nullable(pair(pairOfNumbers, pairOfNumbers))),\n startCoords: optional(pair(pairOfNumbers, pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeSegment: Parser<PerseusGraphTypeSegment> = object({\n type: constant(\"segment\"),\n // TODO(benchristel): default numSegments?\n numSegments: optional(number),\n coords: optional(nullable(array(pair(pairOfNumbers, pairOfNumbers)))),\n startCoords: optional(array(pair(pairOfNumbers, pairOfNumbers))),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphTypeSinusoid: Parser<PerseusGraphTypeSinusoid> = object({\n type: constant(\"sinusoid\"),\n coords: optional(nullable(array(pairOfNumbers))),\n startCoords: optional(array(pairOfNumbers)),\n // TODO: remove coord? it's legacy.\n coord: optional(pairOfNumbers),\n});\n\nconst parsePerseusGraphType: Parser<PerseusGraphType> = discriminatedUnionOn(\n \"type\",\n)\n .withBranch(\"angle\", parsePerseusGraphTypeAngle)\n .withBranch(\"circle\", parsePerseusGraphTypeCircle)\n .withBranch(\"linear\", parsePerseusGraphTypeLinear)\n .withBranch(\"linear-system\", parsePerseusGraphTypeLinearSystem)\n .withBranch(\"none\", parsePerseusGraphTypeNone)\n .withBranch(\"point\", parsePerseusGraphTypePoint)\n .withBranch(\"polygon\", parsePerseusGraphTypePolygon)\n .withBranch(\"quadratic\", parsePerseusGraphTypeQuadratic)\n .withBranch(\"ray\", parsePerseusGraphTypeRay)\n .withBranch(\"segment\", parsePerseusGraphTypeSegment)\n .withBranch(\"sinusoid\", parsePerseusGraphTypeSinusoid).parser;\n\nconst parseLockedFigureColor: Parser<LockedFigureColor> = enumeration(\n ...lockedFigureColorNames,\n);\n\nconst parseLockedFigureFillType: Parser<LockedFigureFillType> = enumeration(\n \"none\",\n \"white\",\n \"translucent\",\n \"solid\",\n);\n\nconst parseLockedLineStyle: Parser<LockedLineStyle> = enumeration(\n \"solid\",\n \"dashed\",\n);\n\nconst parseLockedLabelType: Parser<LockedLabelType> = object({\n type: constant(\"label\"),\n coord: pairOfNumbers,\n text: string,\n color: parseLockedFigureColor,\n size: enumeration(\"small\", \"medium\", \"large\"),\n});\n\nconst parseLockedPointType: Parser<LockedPointType> = object({\n type: constant(\"point\"),\n coord: pairOfNumbers,\n color: parseLockedFigureColor,\n filled: boolean,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedLineType: Parser<LockedLineType> = object({\n type: constant(\"line\"),\n kind: enumeration(\"line\", \"ray\", \"segment\"),\n points: pair(parseLockedPointType, parseLockedPointType),\n color: parseLockedFigureColor,\n lineStyle: parseLockedLineStyle,\n showPoint1: defaulted(boolean, () => false),\n showPoint2: defaulted(boolean, () => false),\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedVectorType: Parser<LockedVectorType> = object({\n type: constant(\"vector\"),\n points: pair(pairOfNumbers, pairOfNumbers),\n color: parseLockedFigureColor,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedEllipseType: Parser<LockedEllipseType> = object({\n type: constant(\"ellipse\"),\n center: pairOfNumbers,\n radius: pairOfNumbers,\n angle: number,\n color: parseLockedFigureColor,\n fillStyle: parseLockedFigureFillType,\n strokeStyle: parseLockedLineStyle,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedPolygonType: Parser<LockedPolygonType> = object({\n type: constant(\"polygon\"),\n points: array(pairOfNumbers),\n color: parseLockedFigureColor,\n showVertices: boolean,\n fillStyle: parseLockedFigureFillType,\n strokeStyle: parseLockedLineStyle,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\n// Exported for testing.\nexport const parseLockedFunctionDomain = defaulted(\n pair(\n defaulted(number, () => -Infinity),\n defaulted(number, () => Infinity),\n ),\n (): [number, number] => [-Infinity, Infinity],\n);\n\nconst parseLockedFunctionType: Parser<LockedFunctionType> = object({\n type: constant(\"function\"),\n color: parseLockedFigureColor,\n strokeStyle: parseLockedLineStyle,\n equation: string,\n directionalAxis: enumeration(\"x\", \"y\"),\n domain: parseLockedFunctionDomain,\n // TODO(benchristel): default labels to empty array?\n labels: optional(array(parseLockedLabelType)),\n ariaLabel: optional(string),\n});\n\nconst parseLockedFigure: Parser<LockedFigure> = discriminatedUnionOn(\"type\")\n .withBranch(\"point\", parseLockedPointType)\n .withBranch(\"line\", parseLockedLineType)\n .withBranch(\"vector\", parseLockedVectorType)\n .withBranch(\"ellipse\", parseLockedEllipseType)\n .withBranch(\"polygon\", parseLockedPolygonType)\n .withBranch(\"function\", parseLockedFunctionType)\n .withBranch(\"label\", parseLockedLabelType).parser;\n\nexport const parseInteractiveGraphWidget: Parser<InteractiveGraphWidget> =\n parseWidget(\n constant(\"interactive-graph\"),\n object({\n step: pairOfNumbers,\n // TODO(benchristel): rather than making gridStep and snapStep\n // optional, we should duplicate the defaulting logic from the\n // InteractiveGraph component. See parse-perseus-json/README.md for\n // why.\n gridStep: optional(pairOfNumbers),\n snapStep: optional(pairOfNumbers),\n backgroundImage: optional(parsePerseusImageBackground),\n markings: enumeration(\"graph\", \"grid\", \"none\"),\n labels: optional(array(string)),\n showProtractor: boolean,\n showRuler: optional(boolean),\n showTooltips: optional(boolean),\n rulerLabel: optional(string),\n rulerTicks: optional(number),\n range: pair(pairOfNumbers, pairOfNumbers),\n // NOTE(benchristel): I copied the default graph from\n // interactive-graph.tsx. See the parse-perseus-json/README.md for\n // an explanation of why we want to duplicate the default here.\n graph: defaulted(parsePerseusGraphType, () => ({\n type: \"linear\" as const,\n })),\n correct: parsePerseusGraphType,\n // TODO(benchristel): default lockedFigures to empty array\n lockedFigures: optional(array(parseLockedFigure)),\n fullGraphLabel: optional(string),\n fullGraphAriaDescription: optional(string),\n }),\n );\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {LabelImageWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseLabelImageWidget: Parser<LabelImageWidget> = parseWidget(\n constant(\"label-image\"),\n object({\n choices: array(string),\n imageUrl: string,\n imageAlt: string,\n imageHeight: number,\n imageWidth: number,\n markers: array(\n object({\n answers: array(string),\n label: string,\n x: number,\n y: number,\n }),\n ),\n hideChoicesFromInstructions: boolean,\n multipleAnswers: boolean,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n array,\n boolean,\n constant,\n object,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {MatcherWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseMatcherWidget: Parser<MatcherWidget> = parseWidget(\n constant(\"matcher\"),\n object({\n labels: array(string),\n left: array(string),\n right: array(string),\n orderMatters: boolean,\n padding: boolean,\n }),\n);\n","import {\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n pipeParsers,\n string,\n union,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\nimport {stringToNumber} from \"../general-purpose-parsers/string-to-number\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {MatrixWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst numberOrString = union(number).or(string).parser;\nconst numeric = pipeParsers(defaulted(numberOrString, () => NaN)).then(\n stringToNumber,\n).parser;\n\nexport const parseMatrixWidget: Parser<MatrixWidget> = parseWidget(\n defaulted(constant(\"matrix\"), () => \"matrix\"),\n object({\n prefix: optional(string),\n suffix: optional(string),\n answers: array(array(numeric)),\n cursorPosition: optional(array(number)),\n matrixBoardSize: array(number),\n static: optional(boolean),\n }),\n);\n","import {\n boolean,\n constant,\n number,\n object,\n pair,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parsePerseusImageBackground} from \"./perseus-image-background\";\nimport {parseWidget} from \"./widget\";\n\nimport type {MeasurerWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseMeasurerWidget: Parser<MeasurerWidget> = parseWidget(\n constant(\"measurer\"),\n object({\n // The default value for image comes from measurer.tsx.\n // See parse-perseus-json/README.md for why we want to duplicate the\n // defaults here.\n image: defaulted(parsePerseusImageBackground, () => ({\n url: null,\n top: 0,\n left: 0,\n })),\n showProtractor: boolean,\n showRuler: boolean,\n rulerLabel: string,\n rulerTicks: number,\n rulerPixels: number,\n rulerLength: number,\n box: pair(number, number),\n // TODO(benchristel): static is not used. Remove it?\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n constant,\n object,\n string,\n number,\n optional,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {MoleculeRendererWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseMoleculeRendererWidget: Parser<MoleculeRendererWidget> =\n parseWidget(\n constant(\"molecule-renderer\"),\n object({\n widgetId: string,\n rotationAngle: optional(number),\n smiles: optional(string),\n }),\n );\n","import {\n constant,\n object,\n array,\n number,\n string,\n boolean,\n optional,\n nullable,\n pipeParsers,\n union,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {NumberLineWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst emptyStringToNull = pipeParsers(constant(\"\")).then(\n convert(() => null),\n).parser;\n\nexport const parseNumberLineWidget: Parser<NumberLineWidget> = parseWidget(\n constant(\"number-line\"),\n object({\n range: array(number),\n labelRange: array(nullable(union(number).or(emptyStringToNull).parser)),\n labelStyle: string,\n labelTicks: boolean,\n isTickCtrl: optional(nullable(boolean)),\n divisionRange: array(number),\n numDivisions: optional(nullable(number)),\n // NOTE(benchristel): I copied the default snapDivisions from\n // number-line.tsx. See the parse-perseus-json/README.md for\n // an explanation of why we want to duplicate the default here.\n snapDivisions: defaulted(number, () => 2),\n tickStep: optional(nullable(number)),\n correctRel: optional(nullable(string)),\n correctX: nullable(number),\n initialX: optional(nullable(number)),\n showTooltips: optional(boolean),\n static: defaulted(boolean, () => false),\n }),\n);\n","import {\n constant,\n object,\n array,\n string,\n number,\n optional,\n enumeration,\n boolean,\n nullable,\n union,\n pipeParsers,\n} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {NumericInputWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nconst parseMathFormat = enumeration(\n \"integer\",\n \"mixed\",\n \"improper\",\n \"proper\",\n \"decimal\",\n \"percent\",\n \"pi\",\n);\n\nconst parseSimplify = enumeration(\n \"required\",\n \"correct\",\n \"enforced\",\n \"optional\",\n);\n\nexport const parseNumericInputWidget: Parser<NumericInputWidget> = parseWidget(\n constant(\"numeric-input\"),\n object({\n answers: array(\n object({\n message: string,\n // TODO(benchristel): value should never be null or undefined,\n // but we have some content where it is anyway. If we backfill\n // the data, simplify this.\n value: optional(nullable(number)),\n status: string,\n answerForms: defaulted(array(parseMathFormat), () => undefined),\n strict: boolean,\n maxError: optional(nullable(number)),\n // TODO(benchristel): simplify should never be a boolean, but we\n // have some content where it is anyway. If we ever backfill\n // the data, we should simplify `simplify`.\n simplify: optional(\n nullable(\n union(parseSimplify).or(\n pipeParsers(boolean).then(\n convert((value) => {\n if (typeof value === \"boolean\") {\n return value ? \"required\" : \"optional\";\n }\n return value;\n }),\n ).parser,\n ).parser,\n ),\n ),\n }),\n ),\n labelText: optional(string),\n size: string,\n coefficient: defaulted(boolean, () => false),\n rightAlign: optional(boolean),\n static: defaulted(boolean, () => false),\n answerForms: optional(\n array(\n object({\n name: parseMathFormat,\n simplify: optional(\n nullable(\n enumeration(\n \"required\",\n \"correct\",\n \"enforced\",\n \"optional\",\n ),\n ),\n ),\n }),\n ),\n ),\n }),\n);\n","import {\n array,\n constant,\n enumeration,\n object,\n pipeParsers,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\nimport {parseWidget} from \"./widget\";\n\nimport type {OrdererWidget} from \"../../data-schema\";\nimport type {Parser, PartialParser} from \"../parser-types\";\n\n// There is an import cycle between orderer-widget.ts and perseus-renderer.ts.\n// This wrapper ensures that we don't refer to parsePerseusRenderer before\n// it's defined.\nfunction parseRenderer(rawValue, ctx) {\n return parsePerseusRenderer(rawValue, ctx);\n}\n\nconst largeToAuto: PartialParser<\n \"normal\" | \"auto\" | \"large\",\n \"normal\" | \"auto\"\n> = (height, ctx) => {\n if (height === \"large\") {\n return ctx.success(\"auto\");\n }\n return ctx.success(height);\n};\n\nexport const parseOrdererWidget: Parser<OrdererWidget> = parseWidget(\n constant(\"orderer\"),\n object({\n options: defaulted(array(parseRenderer), () => []),\n correctOptions: array(parseRenderer),\n otherOptions: array(parseRenderer),\n height: pipeParsers(enumeration(\"normal\", \"auto\", \"large\")).then(\n largeToAuto,\n ).parser,\n layout: defaulted(\n enumeration(\"horizontal\", \"vertical\"),\n () => \"horizontal\" as const,\n ),\n }),\n);\n","import {\n constant,\n object,\n string,\n number,\n optional,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PassageRefWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePassageRefWidget: Parser<PassageRefWidget> = parseWidget(\n constant(\"passage-ref\"),\n object({\n passageNumber: number,\n referenceNumber: number,\n summaryText: optional(string),\n }),\n);\n","import {constant, object, string, boolean} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PassageWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePassageWidget: Parser<PassageWidget> = parseWidget(\n constant(\"passage\"),\n object({\n footnotes: defaulted(string, () => \"\"),\n passageText: string,\n passageTitle: defaulted(string, () => \"\"),\n showLineNumbers: boolean,\n static: defaulted(boolean, () => false),\n }),\n);\n","import {constant, object, string} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PhetSimulationWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePhetSimulationWidget: Parser<PhetSimulationWidget> =\n parseWidget(\n constant(\"phet-simulation\"),\n object({\n url: string,\n description: string,\n }),\n );\n","import {plotterPlotTypes} from \"../../data-schema\";\nimport {\n constant,\n object,\n string,\n array,\n number,\n optional,\n nullable,\n enumeration,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PlotterWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePlotterWidget: Parser<PlotterWidget> = parseWidget(\n constant(\"plotter\"),\n object({\n labels: array(string),\n categories: array(string),\n type: enumeration(...plotterPlotTypes),\n maxY: number,\n // The default value for scaleY comes from plotter.tsx.\n // See parse-perseus-json/README.md for why we want to duplicate the\n // defaults here.\n scaleY: defaulted(number, () => 1),\n labelInterval: optional(nullable(number)),\n // The default value for snapsPerLine comes from plotter.tsx.\n // See parse-perseus-json/README.md for why we want to duplicate the\n // defaults here.\n snapsPerLine: defaulted(number, () => 2),\n starting: array(number),\n correct: array(number),\n picUrl: optional(nullable(string)),\n picSize: optional(nullable(number)),\n picBoxHeight: optional(nullable(number)),\n // NOTE(benchristel): I copied the default plotDimensions from\n // plotter.tsx. See the parse-perseus-json/README.md for an explanation\n // of why we want to duplicate the defaults here.\n plotDimensions: defaulted(array(number), () => [380, 300]),\n }),\n);\n","import {constant, object, string, number} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {PythonProgramWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePythonProgramWidget: Parser<PythonProgramWidget> =\n parseWidget(\n constant(\"python-program\"),\n object({\n programID: string,\n height: number,\n }),\n );\n","import type {PerseusRadioWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 2, minor: 0};\n\nexport function deriveNumCorrect(options: PerseusRadioWidgetOptions) {\n const {choices, numCorrect} = options;\n\n return numCorrect ?? choices.filter((c) => c.correct).length;\n}\n\nexport const widgetOptionsUpgrades = {\n \"2\": (v1props: any): PerseusRadioWidgetOptions => {\n const upgraded = {\n ...v1props,\n numCorrect: deriveNumCorrect(v1props),\n };\n return upgraded;\n },\n \"1\": (v0props: any): PerseusRadioWidgetOptions => {\n const {noneOfTheAbove, ...rest} = v0props;\n\n if (noneOfTheAbove) {\n throw new Error(\n \"radio widget v0 no longer supports auto noneOfTheAbove\",\n );\n }\n\n return {\n ...rest,\n hasNoneOfTheAbove: false,\n };\n },\n} as const;\n\nexport type RadioDefaultWidgetOptions = Pick<\n PerseusRadioWidgetOptions,\n | \"choices\"\n | \"displayCount\"\n | \"randomize\"\n | \"hasNoneOfTheAbove\"\n | \"multipleSelect\"\n | \"countChoices\"\n | \"deselectEnabled\"\n>;\n\nexport const defaultWidgetOptions: RadioDefaultWidgetOptions = {\n choices: [{}, {}, {}, {}] as any,\n displayCount: null,\n randomize: false,\n hasNoneOfTheAbove: false,\n multipleSelect: false,\n countChoices: false,\n deselectEnabled: false,\n};\n","import {deriveNumCorrect} from \"../../widgets/radio/radio-upgrade\";\nimport {\n any,\n array,\n boolean,\n constant,\n number,\n object,\n optional,\n string,\n} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {versionedWidgetOptions} from \"./versioned-widget-options\";\nimport {parseWidgetWithVersion} from \"./widget\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {RadioWidget} from \"../../data-schema\";\nimport type {ParsedValue, Parser} from \"../parser-types\";\n\nconst version2 = optional(object({major: constant(2), minor: number}));\nconst parseRadioWidgetV2: Parser<RadioWidget> = parseWidgetWithVersion(\n version2,\n constant(\"radio\"),\n object({\n numCorrect: optional(number),\n choices: array(\n object({\n content: defaulted(string, () => \"\"),\n clue: optional(string),\n correct: optional(boolean),\n isNoneOfTheAbove: optional(boolean),\n // deprecated\n // There is an import cycle between radio-widget.ts and\n // widgets-map.ts. The anonymous function below ensures that we\n // don't refer to parseWidgetsMap before it's defined.\n widgets: optional((rawVal, ctx) =>\n parseWidgetsMap(rawVal, ctx),\n ),\n }),\n ),\n hasNoneOfTheAbove: optional(boolean),\n countChoices: optional(boolean),\n randomize: optional(boolean),\n multipleSelect: optional(boolean),\n deselectEnabled: optional(boolean),\n // deprecated\n onePerLine: optional(boolean),\n // deprecated\n displayCount: optional(any),\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove: optional(constant(false)),\n }),\n);\n\nconst version1 = optional(object({major: constant(1), minor: number}));\nconst parseRadioWidgetV1: Parser<RadioWidget> = parseWidgetWithVersion(\n version1,\n constant(\"radio\"),\n object({\n choices: array(\n object({\n content: defaulted(string, () => \"\"),\n clue: optional(string),\n correct: optional(boolean),\n isNoneOfTheAbove: optional(boolean),\n // deprecated\n // There is an import cycle between radio-widget.ts and\n // widgets-map.ts. The anonymous function below ensures that we\n // don't refer to parseWidgetsMap before it's defined.\n widgets: defaulted(\n (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n () => undefined,\n ),\n }),\n ),\n hasNoneOfTheAbove: optional(boolean),\n countChoices: optional(boolean),\n randomize: optional(boolean),\n multipleSelect: optional(boolean),\n deselectEnabled: optional(boolean),\n // deprecated\n onePerLine: optional(boolean),\n // deprecated\n displayCount: optional(any),\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove: optional(constant(false)),\n }),\n);\n\nfunction migrateV1ToV2(\n widget: ParsedValue<typeof parseRadioWidgetV1>,\n): RadioWidget {\n const {options} = widget;\n return {\n ...widget,\n version: {major: 2, minor: 0},\n options: {\n ...options,\n numCorrect: deriveNumCorrect(options),\n },\n };\n}\n\nconst version0 = optional(object({major: constant(0), minor: number}));\nconst parseRadioWidgetV0: Parser<RadioWidget> = parseWidgetWithVersion(\n version0,\n constant(\"radio\"),\n object({\n choices: array(\n object({\n content: defaulted(string, () => \"\"),\n clue: optional(string),\n correct: optional(boolean),\n isNoneOfTheAbove: optional(boolean),\n // deprecated\n // There is an import cycle between radio-widget.ts and\n // widgets-map.ts. The anonymous function below ensures that we\n // don't refer to parseWidgetsMap before it's defined.\n widgets: optional((rawVal, ctx) =>\n parseWidgetsMap(rawVal, ctx),\n ),\n }),\n ),\n hasNoneOfTheAbove: optional(boolean),\n countChoices: optional(boolean),\n randomize: optional(boolean),\n multipleSelect: optional(boolean),\n deselectEnabled: optional(boolean),\n // deprecated\n onePerLine: optional(boolean),\n // deprecated\n displayCount: optional(any),\n // v0 props\n // `noneOfTheAbove` is still in use (but only set to `false`).\n noneOfTheAbove: optional(constant(false)),\n }),\n);\n\nfunction migrateV0ToV1(\n widget: ParsedValue<typeof parseRadioWidgetV1>,\n): RadioWidget {\n const {options} = widget;\n const {noneOfTheAbove: _, ...rest} = options;\n return {\n ...widget,\n version: {major: 1, minor: 0},\n options: {\n ...rest,\n hasNoneOfTheAbove: false,\n },\n };\n}\n\nexport const parseRadioWidget: Parser<RadioWidget> = versionedWidgetOptions(\n 2,\n parseRadioWidgetV2,\n)\n .withMigrationFrom(1, parseRadioWidgetV1, migrateV1ToV2)\n .withMigrationFrom(0, parseRadioWidgetV0, migrateV0ToV1).parser;\n","import {\n array,\n boolean,\n constant,\n enumeration,\n object,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {SorterWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseSorterWidget: Parser<SorterWidget> = parseWidget(\n constant(\"sorter\"),\n object({\n correct: array(string),\n padding: boolean,\n layout: enumeration(\"horizontal\", \"vertical\"),\n }),\n);\n","import {\n array,\n number,\n constant,\n object,\n string,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {TableWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseTableWidget: Parser<TableWidget> = parseWidget(\n constant(\"table\"),\n object({\n headers: array(string),\n rows: number,\n columns: number,\n answers: array(array(string)),\n }),\n);\n","import {\n constant,\n object,\n string,\n boolean,\n optional,\n} from \"../general-purpose-parsers\";\n\nimport {parseWidget} from \"./widget\";\n\nimport type {VideoWidget} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseVideoWidget: Parser<VideoWidget> = parseWidget(\n constant(\"video\"),\n object({\n location: string,\n static: optional(boolean),\n }),\n);\n","import {\n any,\n pair,\n isObject,\n string,\n object,\n constant,\n} from \"../general-purpose-parsers\";\nimport {isFailure} from \"../result\";\n\nimport {parseCategorizerWidget} from \"./categorizer-widget\";\nimport {parseCSProgramWidget} from \"./cs-program-widget\";\nimport {parseDefinitionWidget} from \"./definition-widget\";\nimport {parseDropdownWidget} from \"./dropdown-widget\";\nimport {parseExplanationWidget} from \"./explanation-widget\";\nimport {parseExpressionWidget} from \"./expression-widget\";\nimport {parseGradedGroupSetWidget} from \"./graded-group-set-widget\";\nimport {parseGradedGroupWidget} from \"./graded-group-widget\";\nimport {parseGrapherWidget} from \"./grapher-widget\";\nimport {parseGroupWidget} from \"./group-widget\";\nimport {parseIframeWidget} from \"./iframe-widget\";\nimport {parseImageWidget} from \"./image-widget\";\nimport {parseInputNumberWidget} from \"./input-number-widget\";\nimport {parseInteractionWidget} from \"./interaction-widget\";\nimport {parseInteractiveGraphWidget} from \"./interactive-graph-widget\";\nimport {parseLabelImageWidget} from \"./label-image-widget\";\nimport {parseMatcherWidget} from \"./matcher-widget\";\nimport {parseMatrixWidget} from \"./matrix-widget\";\nimport {parseMeasurerWidget} from \"./measurer-widget\";\nimport {parseMoleculeRendererWidget} from \"./molecule-renderer-widget\";\nimport {parseNumberLineWidget} from \"./number-line-widget\";\nimport {parseNumericInputWidget} from \"./numeric-input-widget\";\nimport {parseOrdererWidget} from \"./orderer-widget\";\nimport {parsePassageRefWidget} from \"./passage-ref-widget\";\nimport {parsePassageWidget} from \"./passage-widget\";\nimport {parsePhetSimulationWidget} from \"./phet-simulation-widget\";\nimport {parsePlotterWidget} from \"./plotter-widget\";\nimport {parsePythonProgramWidget} from \"./python-program-widget\";\nimport {parseRadioWidget} from \"./radio-widget\";\nimport {parseSorterWidget} from \"./sorter-widget\";\nimport {parseTableWidget} from \"./table-widget\";\nimport {parseVideoWidget} from \"./video-widget\";\nimport {parseWidget} from \"./widget\";\n\nimport type {\n DeprecatedStandinWidget,\n PerseusWidgetsMap,\n} from \"../../data-schema\";\nimport type {ParseContext, Parser, ParseResult} from \"../parser-types\";\n\nexport const parseWidgetsMap: Parser<PerseusWidgetsMap> = (rawValue, ctx) => {\n if (!isObject(rawValue)) {\n return ctx.failure(\"PerseusWidgetsMap\", rawValue);\n }\n\n const widgetsMap: PerseusWidgetsMap = {};\n for (const key of Object.keys(rawValue)) {\n // parseWidgetsMapEntry modifies the widgetsMap. This is kind of gross,\n // but it's the only way I could find to make TypeScript check the key\n // against the widget type.\n const entryResult = parseWidgetsMapEntry(\n [key, rawValue[key]],\n widgetsMap,\n ctx.forSubtree(key),\n );\n if (isFailure(entryResult)) {\n return entryResult;\n }\n }\n\n return ctx.success(widgetsMap);\n};\n\nconst parseWidgetsMapEntry: (\n entry: [string, unknown],\n widgetMap: PerseusWidgetsMap,\n ctx: ParseContext,\n) => ParseResult<unknown> = ([id, widget], widgetMap, ctx) => {\n const idComponentsResult = parseWidgetIdComponents(\n id.split(\" \"),\n ctx.forSubtree(\"(widget ID)\"),\n );\n if (isFailure(idComponentsResult)) {\n return idComponentsResult;\n }\n const [type, n] = idComponentsResult.value;\n\n function parseAndAssign<K extends keyof PerseusWidgetsMap>(\n key: K,\n parse: Parser<PerseusWidgetsMap[K]>,\n ): ParseResult<unknown> {\n const widgetResult = parse(widget, ctx);\n if (isFailure(widgetResult)) {\n return widgetResult;\n }\n widgetMap[key] = widgetResult.value;\n return ctx.success(undefined);\n }\n\n switch (type) {\n case \"categorizer\":\n return parseAndAssign(`categorizer ${n}`, parseCategorizerWidget);\n case \"cs-program\":\n return parseAndAssign(`cs-program ${n}`, parseCSProgramWidget);\n case \"definition\":\n return parseAndAssign(`definition ${n}`, parseDefinitionWidget);\n case \"dropdown\":\n return parseAndAssign(`dropdown ${n}`, parseDropdownWidget);\n case \"explanation\":\n return parseAndAssign(`explanation ${n}`, parseExplanationWidget);\n case \"expression\":\n return parseAndAssign(`expression ${n}`, parseExpressionWidget);\n case \"grapher\":\n return parseAndAssign(`grapher ${n}`, parseGrapherWidget);\n case \"group\":\n return parseAndAssign(`group ${n}`, parseGroupWidget);\n case \"graded-group\":\n return parseAndAssign(`graded-group ${n}`, parseGradedGroupWidget);\n case \"graded-group-set\":\n return parseAndAssign(\n `graded-group-set ${n}`,\n parseGradedGroupSetWidget,\n );\n case \"iframe\":\n return parseAndAssign(`iframe ${n}`, parseIframeWidget);\n case \"image\":\n return parseAndAssign(`image ${n}`, parseImageWidget);\n case \"input-number\":\n return parseAndAssign(`input-number ${n}`, parseInputNumberWidget);\n case \"interaction\":\n return parseAndAssign(`interaction ${n}`, parseInteractionWidget);\n case \"interactive-graph\":\n return parseAndAssign(\n `interactive-graph ${n}`,\n parseInteractiveGraphWidget,\n );\n case \"label-image\":\n return parseAndAssign(`label-image ${n}`, parseLabelImageWidget);\n case \"matcher\":\n return parseAndAssign(`matcher ${n}`, parseMatcherWidget);\n case \"matrix\":\n return parseAndAssign(`matrix ${n}`, parseMatrixWidget);\n case \"measurer\":\n return parseAndAssign(`measurer ${n}`, parseMeasurerWidget);\n case \"molecule-renderer\":\n return parseAndAssign(\n `molecule-renderer ${n}`,\n parseMoleculeRendererWidget,\n );\n case \"number-line\":\n return parseAndAssign(`number-line ${n}`, parseNumberLineWidget);\n case \"numeric-input\":\n return parseAndAssign(\n `numeric-input ${n}`,\n parseNumericInputWidget,\n );\n case \"orderer\":\n return parseAndAssign(`orderer ${n}`, parseOrdererWidget);\n case \"passage\":\n return parseAndAssign(`passage ${n}`, parsePassageWidget);\n case \"passage-ref\":\n return parseAndAssign(`passage-ref ${n}`, parsePassageRefWidget);\n case \"passage-ref-target\":\n // NOTE(benchristel): as of 2024-11-12, passage-ref-target is only\n // used in test content. See:\n // https://www.khanacademy.org/devadmin/content/search?query=widget:passage-ref-target\n return parseAndAssign(`passage-ref-target ${n}`, any);\n case \"phet-simulation\":\n return parseAndAssign(\n `phet-simulation ${n}`,\n parsePhetSimulationWidget,\n );\n case \"plotter\":\n return parseAndAssign(`plotter ${n}`, parsePlotterWidget);\n case \"python-program\":\n return parseAndAssign(\n `python-program ${n}`,\n parsePythonProgramWidget,\n );\n case \"radio\":\n return parseAndAssign(`radio ${n}`, parseRadioWidget);\n case \"sorter\":\n return parseAndAssign(`sorter ${n}`, parseSorterWidget);\n case \"table\":\n return parseAndAssign(`table ${n}`, parseTableWidget);\n case \"video\":\n return parseAndAssign(`video ${n}`, parseVideoWidget);\n case \"sequence\":\n // sequence is a deprecated widget type, and the corresponding\n // widget component no longer exists.\n return parseAndAssign(`sequence ${n}`, parseDeprecatedWidget);\n case \"lights-puzzle\":\n return parseAndAssign(`lights-puzzle ${n}`, parseDeprecatedWidget);\n case \"simulator\":\n return parseAndAssign(`simulator ${n}`, parseDeprecatedWidget);\n case \"transformer\":\n return parseAndAssign(`transformer ${n}`, parseDeprecatedWidget);\n\n default:\n return parseAndAssign(\n `${type} ${n}` as any,\n parseWidget(constant(type), any) as any,\n );\n }\n};\n\nconst parseDeprecatedWidget: Parser<DeprecatedStandinWidget> = parseWidget(\n // Ignore the incoming widget type and hardcode \"deprecated-standin\"\n (_, ctx) => ctx.success(\"deprecated-standin\" as const),\n // Allow any widget options\n object({}),\n);\n\nconst parseStringToNonNegativeInt: Parser<number> = (rawValue, ctx) => {\n // The article renderer seems to allow the numeric part of a widget ID to\n // be 0, at least for image widgets. However, if widget IDs in an exercise\n // contain 0, the exercise renderer will blow up. We allow 0 here for\n // compatibility with articles.\n if (typeof rawValue !== \"string\" || !/^(0|[1-9][0-9]*)$/.test(rawValue)) {\n return ctx.failure(\n \"a string representing a non-negative integer\",\n rawValue,\n );\n }\n return ctx.success(+rawValue);\n};\n\nconst parseWidgetIdComponents = pair(string, parseStringToNonNegativeInt);\n","import {any, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseImages} from \"./images-map\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {PerseusRenderer} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePerseusRenderer: Parser<PerseusRenderer> = defaulted(\n object({\n // TODO(benchristel): content is also defaulted to empty string in\n // renderer.tsx. See if we can remove one default or the other.\n content: defaulted(string, () => \"\"),\n // This module has an import cycle with parseWidgetsMap, because the\n // `group` widget can contain another renderer.\n // The anonymous function below ensures that we don't try to access\n // parseWidgetsMap before it's defined.\n widgets: defaulted(\n (rawVal, ctx) => parseWidgetsMap(rawVal, ctx),\n () => ({}),\n ),\n images: parseImages,\n // deprecated\n metadata: any,\n }),\n // Default value\n () => ({\n content: \"\",\n widgets: {},\n images: {},\n }),\n);\n","import {array, union} from \"../general-purpose-parsers\";\n\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\n\nimport type {PerseusArticle} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePerseusArticle: Parser<PerseusArticle> = union(\n parsePerseusRenderer,\n).or(array(parsePerseusRenderer)).parser;\n","import {any, boolean, object, string} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseImages} from \"./images-map\";\nimport {parseWidgetsMap} from \"./widgets-map\";\n\nimport type {Hint} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parseHint: Parser<Hint> = object({\n replace: defaulted(boolean, () => undefined),\n content: string,\n widgets: defaulted(parseWidgetsMap, () => ({})),\n images: parseImages,\n // deprecated\n metadata: any,\n});\n","import {object, pipeParsers} from \"../general-purpose-parsers\";\nimport {convert} from \"../general-purpose-parsers/convert\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport type {PerseusAnswerArea} from \"@khanacademy/perseus-core\";\n\nexport const parsePerseusAnswerArea = pipeParsers(\n defaulted(object({}), () => ({})),\n).then(convert(toAnswerArea)).parser;\n\n// Some answerAreas have extra, bogus fields, like:\n//\n// \"answerArea\": {\n// \"type\": \"multiple\",\n// \"options\": {},\n// \"version\": null,\n// \"static\": false,\n// \"graded\": false,\n// \"alignment\": \"\",\n// }\n//\n// This function filters the fields of an answerArea object, keeping only the\n// known ones, and converts `undefined` and `null` values to `false`.\nfunction toAnswerArea(raw: Record<string, unknown>): PerseusAnswerArea {\n return {\n zTable: !!raw.zTable,\n calculator: !!raw.calculator,\n chi2Table: !!raw.chi2Table,\n financialCalculatorMonthlyPayment:\n !!raw.financialCalculatorMonthlyPayment,\n financialCalculatorTotalAmount: !!raw.financialCalculatorTotalAmount,\n financialCalculatorTimeToPayOff: !!raw.financialCalculatorTimeToPayOff,\n periodicTable: !!raw.periodicTable,\n periodicTableWithKey: !!raw.periodicTableWithKey,\n tTable: !!raw.tTable,\n };\n}\n","import {any, array, number, object, optional} from \"../general-purpose-parsers\";\nimport {defaulted} from \"../general-purpose-parsers/defaulted\";\n\nimport {parseHint} from \"./hint\";\nimport {parsePerseusAnswerArea} from \"./perseus-answer-area\";\nimport {parsePerseusRenderer} from \"./perseus-renderer\";\n\nimport type {PerseusItem} from \"../../data-schema\";\nimport type {Parser} from \"../parser-types\";\n\nexport const parsePerseusItem: Parser<PerseusItem> = object({\n question: parsePerseusRenderer,\n hints: defaulted(array(parseHint), () => []),\n answerArea: parsePerseusAnswerArea,\n itemDataVersion: optional(\n object({\n major: number,\n minor: number,\n }),\n ),\n // Deprecated field\n answer: any,\n});\n","import {isRealJSONParse} from \"../utils/is-real-json-parse\";\n\nimport {parse} from \"./parse\";\nimport {parsePerseusArticle as migrateAndTypecheckPerseusArticle} from \"./perseus-parsers/perseus-article\";\nimport {parsePerseusItem as migrateAndTypecheckPerseusItem} from \"./perseus-parsers/perseus-item\";\nimport {failure, isFailure} from \"./result\";\n\nimport type {Result} from \"./result\";\nimport type {PerseusItem, PerseusArticle} from \"../data-schema\";\n\n/**\n * Helper to parse PerseusItem JSON\n * Why not just use JSON.parse? We want:\n * - To make sure types are correct\n * - To give us a central place to validate/transform output if needed\n * @deprecated - use parseAndMigratePerseusItem instead\n * @param {string} json - the stringified PerseusItem JSON\n * @returns {PerseusItem} the parsed PerseusItem object\n */\nexport function parsePerseusItem(json: string): PerseusItem {\n // Try to block a cheating vector which relies on monkey-patching\n // JSON.parse\n if (isRealJSONParse(JSON.parse)) {\n return JSON.parse(json);\n }\n throw new Error(\"Something went wrong.\");\n}\n\nexport type ParseFailureDetail = {\n /**\n * A human-readable error message describing where in the object tree\n * parsing failed.\n */\n message: string;\n /**\n * The raw result of parsing the input JSON, with no migrations applied.\n * Use at your own risk.\n */\n invalidObject: unknown;\n};\n\n/**\n * Parses a PerseusItem from a JSON string, migrates old formats to the latest\n * schema, and runtime-typechecks the result. Use this to parse assessmentItem\n * data.\n *\n * @returns a {@link Result} of the parsed PerseusItem. If the result is a\n * failure, it will contain an error message describing where in the tree\n * parsing failed.\n * @throws SyntaxError if the argument is not well-formed JSON.\n */\nexport function parseAndMigratePerseusItem(\n json: string,\n): Result<PerseusItem, ParseFailureDetail> {\n throwErrorIfCheatingDetected();\n const object: unknown = JSON.parse(json);\n const result = parse(object, migrateAndTypecheckPerseusItem);\n if (isFailure(result)) {\n return failure({message: result.detail, invalidObject: object});\n }\n return result;\n}\n\n/**\n * Parses a PerseusArticle from a JSON string, migrates old formats to the\n * latest schema, and runtime-typechecks the result.\n *\n * @returns a {@link Result} of the parsed PerseusArticle. If the result is a\n * failure, it will contain an error message describing where in the tree\n * parsing failed.\n * @throws SyntaxError if the argument is not well-formed JSON.\n */\nexport function parseAndMigratePerseusArticle(\n json: string,\n): Result<PerseusArticle, ParseFailureDetail> {\n throwErrorIfCheatingDetected();\n const object: unknown = JSON.parse(json);\n const result = parse(object, migrateAndTypecheckPerseusArticle);\n if (isFailure(result)) {\n return failure({message: result.detail, invalidObject: object});\n }\n return result;\n}\n\n/**\n * Tries to block a cheating vector that relies on monkey-patching JSON.parse.\n */\n// TODO(LEMS-2331): delete this function once server-side scoring is done.\nfunction throwErrorIfCheatingDetected() {\n if (!isRealJSONParse(JSON.parse)) {\n throw new Error(\"Something went wrong.\");\n }\n}\n","/**\n * Adds the given perseus library version information to the __perseus_debug__\n * object and ensures that the object is attached to `globalThis` (`window` in\n * browser environments).\n *\n * This allows each library to provide runtime version information to assist in\n * debugging in production environments.\n */\nexport const addLibraryVersionToPerseusDebug = (\n libraryName: string,\n libraryVersion: string,\n) => {\n // If the library version is the default value, then we don't want to\n // prefix it with a \"v\" to indicate that it is a version number.\n let prefix = \"v\";\n if (libraryVersion === \"__lib_version__\") {\n prefix = \"\";\n }\n const formattedVersion = `${prefix}${libraryVersion}`;\n\n if (typeof globalThis !== \"undefined\") {\n globalThis.__perseus_debug__ = globalThis.__perseus_debug__ ?? {};\n\n const existingVersionEntry = globalThis.__perseus_debug__[libraryName];\n if (existingVersionEntry) {\n // If we already have an entry and it doesn't match the registered\n // version, we morph the entry into an array and log a warning.\n if (existingVersionEntry !== formattedVersion) {\n // Existing entry might be an array already (oops, at least 2\n // versions of the library already loaded!).\n const allVersions = Array.isArray(existingVersionEntry)\n ? existingVersionEntry\n : [existingVersionEntry];\n allVersions.push(formattedVersion);\n\n globalThis.__perseus_debug__[libraryName] = allVersions;\n\n // eslint-disable-next-line no-console\n console.warn(\n `Multiple versions of ${libraryName} loaded on this page: ${allVersions\n .sort()\n .join(\", \")}`,\n );\n }\n } else {\n globalThis.__perseus_debug__[libraryName] = formattedVersion;\n }\n } else {\n // eslint-disable-next-line no-console\n console.warn(`globalThis not found found (${formattedVersion})`);\n }\n};\n","// This file is processed by a Rollup plugin (replace) to inject the production\n// version number during the release build.\n// In dev, you'll never see the version number.\n\n// We use a shared, symlinked directory to bring in this function so that we\n// don't need to have cross-package dependencies just for a few hundred bytes\n// of shared code.\n// ESLint's import/no-relative-packages doesn't understand symlinks! If this\n// lint suppression is removed, it autofixes the import path to an invalid\n// package+path entry.\n// eslint-disable-next-line import/no-relative-packages\nimport {addLibraryVersionToPerseusDebug} from \"./shared-utils/add-library-version-to-perseus-debug\";\n\nconst libName = \"@khanacademy/perseus-core\";\nexport const libVersion = \"__lib_version__\";\n\naddLibraryVersionToPerseusDebug(libName, libVersion);\n","/**\n * @typedef {Object} Errors utility for referencing the Perseus error taxonomy.\n */\nexport const Errors = Object.freeze({\n /**\n * @property {ErrorKind} Unknown The kind of error is not known.\n */\n Unknown: \"Unknown\",\n /**\n * @property {ErrorKind} Internal The error is internal to the executing code.\n */\n Internal: \"Internal\",\n /**\n * @property {ErrorKind} InvalidInput There was a problem with the provided\n * input, such as the wrong format or a null value.\n */\n InvalidInput: \"InvalidInput\",\n /**\n * @property {ErrorKind} NotAllowed There was a problem due to the state of\n * the system not matching the requested operation or input. For example,\n * trying to create a username that is valid, but is already taken by\n * another user. Use {@link InvalidInput} instead when the input isn't\n * valid regardless of the state of the system. Use {@link NotFound} when\n * the failure is due to not being able to find a resource.\n */\n NotAllowed: \"NotAllowed\",\n /**\n * @property {ErrorKind} TransientService There was a problem when making a\n * request to a service.\n */\n TransientService: \"TransientService\",\n /**\n * @property {ErrorKind} Service There was a non-transient problem when\n * making a request to service.\n */\n Service: \"Service\",\n});\n\n/**\n * @type {ErrorKind} The kind of error being reported\n */\nexport type ErrorKind = (typeof Errors)[keyof typeof Errors];\n","import type {ErrorKind} from \"./errors\";\nimport type {Metadata} from \"@khanacademy/wonder-stuff-core\";\n\ntype Options = {\n metadata?: Metadata | null | undefined;\n};\n\nexport class PerseusError extends Error {\n kind: ErrorKind;\n metadata: Metadata | null | undefined;\n\n constructor(message: string, kind: ErrorKind, options?: Options) {\n super(message);\n this.kind = kind;\n this.metadata = options?.metadata;\n }\n}\n","/**\n * _ utilities for objects\n */\n\nimport _ from \"underscore\";\n\n/**\n * Does a pluck on keys inside objects in an object\n *\n * Ex:\n * tools = {\n * translation: {\n * enabled: true\n * },\n * rotation: {\n * enabled: false\n * }\n * };\n * pluckObject(tools, \"enabled\") returns {\n * translation: true\n * rotation: false\n * }\n */\nexport const pluck = function (table: any, subKey: string): any {\n return _.object(\n _.map(table, function (value, key) {\n return [key, value[subKey]];\n }),\n );\n};\n\n/**\n * Maps an object to an object\n *\n * > mapObject({a: '1', b: '2'}, (value, key) => {\n * return value + 1;\n * });\n * {a: 2, b: 3}\n */\nexport const mapObject = function <K extends string, V, U>(\n obj: Record<K, V>,\n lambda: (arg1: V, arg2: K) => U,\n): Record<K, U> {\n const result: Record<string, any> = {};\n Object.keys(obj).forEach((key) => {\n // @ts-expect-error - TS2345 - Argument of type 'string' is not assignable to parameter of type 'K'.\n result[key] = lambda(obj[key], key);\n });\n return result;\n};\n","import type {PerseusCategorizerWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusCategorizerWidgetOptions type\n */\ntype CategorizerPublicWidgetOptions = {\n items: PerseusCategorizerWidgetOptions[\"items\"];\n categories: PerseusCategorizerWidgetOptions[\"categories\"];\n randomizeItems: PerseusCategorizerWidgetOptions[\"randomizeItems\"];\n static: PerseusCategorizerWidgetOptions[\"static\"];\n};\n\n/**\n * Given a PerseusCategorizerWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getCategorizerPublicWidgetOptions(\n options: PerseusCategorizerWidgetOptions,\n): CategorizerPublicWidgetOptions {\n return {\n items: options.items,\n categories: options.categories,\n randomizeItems: options.randomizeItems,\n static: options.static,\n };\n}\n\nexport default getCategorizerPublicWidgetOptions;\n","import getCategorizerPublicWidgetOptions from \"./categorizer-util\";\n\nimport type {PerseusCategorizerWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type CategorizerDefaultWidgetOptions = Pick<\n PerseusCategorizerWidgetOptions,\n \"items\" | \"categories\" | \"values\" | \"randomizeItems\"\n>;\n\nconst defaultWidgetOptions: CategorizerDefaultWidgetOptions = {\n items: [],\n categories: [],\n values: [],\n randomizeItems: false,\n};\n\nconst categorizerWidgetLogic: WidgetLogic = {\n name: \"categorizer\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getCategorizerPublicWidgetOptions,\n};\n\nexport default categorizerWidgetLogic;\n","import type {PerseusCSProgramWidgetOptions} from \"../../data-schema\";\n\nexport default function getCSProgramPublicWidgetOptions(\n options: PerseusCSProgramWidgetOptions,\n): PerseusCSProgramWidgetOptions {\n return options;\n}\n","import getCSProgramPublicWidgetOptions from \"./cs-program-util\";\n\nimport type {PerseusCSProgramWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type CSProgramDefaultWidgetOptions = Pick<\n PerseusCSProgramWidgetOptions,\n | \"programID\"\n | \"programType\"\n | \"settings\"\n | \"showEditor\"\n | \"showButtons\"\n | \"height\"\n>;\n\nconst DEFAULT_HEIGHT = 400;\n\nconst defaultWidgetOptions: CSProgramDefaultWidgetOptions = {\n programID: \"\",\n programType: null,\n settings: [{name: \"\", value: \"\"}],\n showEditor: false,\n showButtons: false,\n height: DEFAULT_HEIGHT,\n};\n\nconst csProgramWidgetLogic: WidgetLogic = {\n name: \"cs-program\",\n defaultWidgetOptions,\n supportedAlignments: [\"block\", \"full-width\"],\n getPublicWidgetOptions: getCSProgramPublicWidgetOptions,\n};\n\nexport default csProgramWidgetLogic;\n","import type {PerseusDefinitionWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type DefinitionDefaultWidgetOptions = Pick<\n PerseusDefinitionWidgetOptions,\n \"togglePrompt\" | \"definition\"\n>;\n\nconst defaultWidgetOptions: DefinitionDefaultWidgetOptions = {\n togglePrompt: \"\",\n definition: \"\",\n};\n\nconst definitionWidgetLogic: WidgetLogic = {\n name: \"definition\",\n defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default definitionWidgetLogic;\n","import type {PerseusDropdownWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusDropdownWidgetOptions type\n */\nexport type DropdownPublicWidgetOptions = {\n choices: ReadonlyArray<{content: string}>;\n placeholder: PerseusDropdownWidgetOptions[\"placeholder\"];\n static: PerseusDropdownWidgetOptions[\"static\"];\n visibleLabel?: PerseusDropdownWidgetOptions[\"visibleLabel\"];\n ariaLabel?: PerseusDropdownWidgetOptions[\"ariaLabel\"];\n};\n\n/**\n * Given a PerseusDropdownWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getDropdownPublicWidgetOptions(\n options: PerseusDropdownWidgetOptions,\n): DropdownPublicWidgetOptions {\n return {\n choices: options.choices.map((choice) => ({content: choice.content})),\n placeholder: options.placeholder,\n static: options.static,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n };\n}\n\nexport default getDropdownPublicWidgetOptions;\n","import getDropdownPublicWidgetOptions from \"./dropdown-util\";\n\nimport type {PerseusDropdownWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type DropdownDefaultWidgetOptions = Pick<\n PerseusDropdownWidgetOptions,\n \"placeholder\" | \"choices\"\n>;\n\nconst defaultWidgetOptions: DropdownDefaultWidgetOptions = {\n placeholder: \"\",\n choices: [\n {\n content: \"\",\n correct: false,\n },\n ],\n};\n\nconst dropdownWidgetLogic: WidgetLogic = {\n name: \"definition\",\n defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n getPublicWidgetOptions: getDropdownPublicWidgetOptions,\n};\n\nexport default dropdownWidgetLogic;\n","import type {PerseusExplanationWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type ExplanationDefaultWidgetOptions = Pick<\n PerseusExplanationWidgetOptions,\n \"showPrompt\" | \"hidePrompt\" | \"explanation\" | \"widgets\"\n>;\n\nconst defaultWidgetOptions: ExplanationDefaultWidgetOptions = {\n showPrompt: \"Explain\",\n hidePrompt: \"Hide explanation\",\n explanation: \"explanation goes here\\n\\nmore explanation\",\n widgets: {},\n};\n\nconst explanationWidgetLogic: WidgetLogic = {\n name: \"explanation\",\n defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default explanationWidgetLogic;\n","import deriveExtraKeys from \"./derive-extra-keys\";\n\nimport type {PerseusExpressionWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 2, minor: 0};\n\nexport const widgetOptionsUpgrades = {\n \"2\": (v1options: any): PerseusExpressionWidgetOptions => {\n return {\n times: v1options.times,\n buttonSets: v1options.buttonSets,\n functions: v1options.functions,\n buttonsVisible: v1options.buttonsVisible,\n visibleLabel: v1options.visibleLabel,\n ariaLabel: v1options.ariaLabel,\n answerForms: v1options.answerForms,\n extraKeys: v1options.extraKeys || deriveExtraKeys(v1options),\n };\n },\n \"1\": (v0options: any): PerseusExpressionWidgetOptions => {\n return {\n times: v0options.times,\n buttonSets: v0options.buttonSets,\n functions: v0options.functions,\n buttonsVisible: v0options.buttonsVisible,\n visibleLabel: v0options.visibleLabel,\n ariaLabel: v0options.ariaLabel,\n extraKeys: v0options.extraKeys,\n\n answerForms: [\n {\n considered: \"correct\",\n form: v0options.form,\n simplify: v0options.simplify,\n value: v0options.value,\n },\n ],\n };\n },\n} as const;\n\nexport type ExpressionDefaultWidgetOptions = Pick<\n PerseusExpressionWidgetOptions,\n \"answerForms\" | \"times\" | \"buttonSets\" | \"functions\"\n>;\n\nexport const defaultWidgetOptions: ExpressionDefaultWidgetOptions = {\n answerForms: [],\n times: false,\n buttonSets: [\"basic\"],\n functions: [\"f\", \"g\", \"h\"],\n};\n","import type {PerseusExpressionWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusExpressionWidgetOptions type\n */\nexport type ExpressionPublicWidgetOptions = {\n buttonSets: PerseusExpressionWidgetOptions[\"buttonSets\"];\n functions: PerseusExpressionWidgetOptions[\"functions\"];\n times: PerseusExpressionWidgetOptions[\"times\"];\n visibleLabel?: PerseusExpressionWidgetOptions[\"visibleLabel\"];\n ariaLabel?: PerseusExpressionWidgetOptions[\"ariaLabel\"];\n buttonsVisible?: PerseusExpressionWidgetOptions[\"buttonsVisible\"];\n extraKeys?: PerseusExpressionWidgetOptions[\"extraKeys\"];\n};\n\n/**\n * Given a PerseusExpressionWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getExpressionPublicWidgetOptions(\n options: PerseusExpressionWidgetOptions,\n): ExpressionPublicWidgetOptions {\n return {\n buttonSets: options.buttonSets,\n functions: options.functions,\n times: options.times,\n visibleLabel: options.visibleLabel,\n ariaLabel: options.ariaLabel,\n buttonsVisible: options.buttonsVisible,\n extraKeys: options.extraKeys,\n };\n}\n\nexport default getExpressionPublicWidgetOptions;\n","import {\n currentVersion,\n defaultWidgetOptions,\n widgetOptionsUpgrades,\n} from \"./expression-upgrade\";\nimport getExpressionPublicWidgetOptions from \"./expression-util\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {ExpressionDefaultWidgetOptions} from \"./expression-upgrade\";\n\nconst expressionWidgetLogic: WidgetLogic = {\n name: \"expression\",\n version: currentVersion,\n widgetOptionsUpgrades: widgetOptionsUpgrades,\n defaultWidgetOptions: defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n getPublicWidgetOptions: getExpressionPublicWidgetOptions,\n};\n\nexport default expressionWidgetLogic;\n","import type {PerseusGradedGroupWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GradedGroupDefaultWidgetOptions = Pick<\n PerseusGradedGroupWidgetOptions,\n \"title\" | \"content\" | \"widgets\" | \"images\" | \"hint\"\n>;\n\nconst defaultWidgetOptions: GradedGroupDefaultWidgetOptions = {\n title: \"\",\n content: \"\",\n widgets: {},\n images: {},\n hint: null,\n};\n\nconst gradedGroupWidgetLogic: WidgetLogic = {\n name: \"graded-group\",\n defaultWidgetOptions,\n};\n\nexport default gradedGroupWidgetLogic;\n","import type {PerseusGradedGroupSetWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GradedGroupSetDefaultWidgetOptions = Pick<\n PerseusGradedGroupSetWidgetOptions,\n \"gradedGroups\"\n>;\n\nconst defaultWidgetOptions: GradedGroupSetDefaultWidgetOptions = {\n gradedGroups: [],\n};\n\nconst gradedGroupSetWidgetLogic: WidgetLogic = {\n name: \"graded-group-set\",\n defaultWidgetOptions,\n};\n\nexport default gradedGroupSetWidgetLogic;\n","import type {PerseusGrapherWidgetOptions} from \"../../data-schema\";\n\ntype GrapherPublicWidgetOptions = Pick<\n PerseusGrapherWidgetOptions,\n \"availableTypes\" | \"graph\"\n>;\n\nexport default function getGrapherPublicWidgetOptions(\n options: PerseusGrapherWidgetOptions,\n): GrapherPublicWidgetOptions {\n const {correct: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getGrapherPublicWidgetOptions from \"./grapher-util\";\n\nimport type {PerseusGrapherWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GrapherDefaultWidgetOptions = Pick<\n PerseusGrapherWidgetOptions,\n \"graph\" | \"correct\" | \"availableTypes\"\n>;\n\nconst defaultWidgetOptions: GrapherDefaultWidgetOptions = {\n graph: {\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n backgroundImage: {\n url: null,\n },\n markings: \"graph\",\n rulerLabel: \"\",\n rulerTicks: 10,\n valid: true,\n showTooltips: false,\n },\n correct: {\n type: \"linear\",\n coords: null,\n },\n availableTypes: [\"linear\"],\n};\n\nconst grapherWidgetLogic: WidgetLogic = {\n name: \"grapher\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getGrapherPublicWidgetOptions,\n};\n\nexport default grapherWidgetLogic;\n","import type {PerseusGroupWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type GroupDefaultWidgetOptions = Pick<\n PerseusGroupWidgetOptions,\n \"content\" | \"widgets\" | \"images\"\n>;\n\nconst defaultWidgetOptions: GroupDefaultWidgetOptions = {\n content: \"\",\n widgets: {},\n images: {},\n};\n\nconst groupWidgetLogic: WidgetLogic = {\n name: \"group\",\n defaultWidgetOptions,\n};\n\nexport default groupWidgetLogic;\n","import type {PerseusIFrameWidgetOptions} from \"../../data-schema\";\n\nexport default function getIFramePublicWidgetOptions(\n options: PerseusIFrameWidgetOptions,\n): PerseusIFrameWidgetOptions {\n return options;\n}\n","import getIFramePublicWidgetOptions from \"./iframe-util\";\n\nimport type {PerseusIFrameWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type IFrameDefaultWidgetOptions = Pick<\n PerseusIFrameWidgetOptions,\n | \"url\"\n | \"settings\"\n | \"width\"\n | \"height\"\n | \"allowFullScreen\"\n | \"allowTopNavigation\"\n>;\n\nconst defaultWidgetOptions: IFrameDefaultWidgetOptions = {\n url: \"\",\n settings: [{name: \"\", value: \"\"}],\n width: \"400\",\n height: \"400\",\n allowFullScreen: false,\n allowTopNavigation: false,\n};\n\nconst iframeWidgetLogic: WidgetLogic = {\n name: \"iframe\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getIFramePublicWidgetOptions,\n};\n\nexport default iframeWidgetLogic;\n","import type {PerseusImageWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type ImageDefaultWidgetOptions = Pick<\n PerseusImageWidgetOptions,\n \"title\" | \"range\" | \"box\" | \"backgroundImage\" | \"labels\" | \"alt\" | \"caption\"\n>;\n\nconst defaultWidgetOptions: ImageDefaultWidgetOptions = {\n title: \"\",\n range: [\n [0, 10],\n [0, 10],\n ],\n box: [400, 400],\n backgroundImage: {\n url: null,\n width: 0,\n height: 0,\n },\n labels: [],\n alt: \"\",\n caption: \"\",\n};\n\nconst imageWidgetLogic: WidgetLogic = {\n name: \"image\",\n defaultWidgetOptions,\n supportedAlignments: [\"block\", \"full-width\"],\n defaultAlignment: \"block\",\n};\n\nexport default imageWidgetLogic;\n","import type {PerseusInputNumberWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type InputNumberDefaultWidgetOptions = Pick<\n PerseusInputNumberWidgetOptions,\n | \"value\"\n | \"simplify\"\n | \"size\"\n | \"inexact\"\n | \"maxError\"\n | \"answerType\"\n | \"rightAlign\"\n>;\n\nconst defaultWidgetOptions: InputNumberDefaultWidgetOptions = {\n value: 0,\n simplify: \"required\",\n size: \"normal\",\n inexact: false,\n maxError: 0.1,\n answerType: \"number\",\n rightAlign: false,\n};\n\nconst inputNumberWidgetLogic: WidgetLogic = {\n name: \"input-number\",\n defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n};\n\nexport default inputNumberWidgetLogic;\n","import type {PerseusInteractionWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type InteractionDefaultWidgetOptions = Pick<\n PerseusInteractionWidgetOptions,\n \"graph\" | \"elements\"\n>;\n\nconst defaultWidgetOptions: InteractionDefaultWidgetOptions = {\n graph: {\n box: [400, 400],\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n tickStep: [1, 1],\n gridStep: [1, 1],\n markings: \"graph\",\n },\n elements: [],\n};\n\nconst interactionWidgetLogic: WidgetLogic = {\n name: \"interaction\",\n defaultWidgetOptions,\n};\n\nexport default interactionWidgetLogic;\n","import type {PerseusInteractiveGraphWidgetOptions} from \"@khanacademy/perseus-core\";\n\nexport type InteractiveGraphPublicWidgetOptions = Pick<\n PerseusInteractiveGraphWidgetOptions,\n | \"step\"\n | \"gridStep\"\n | \"snapStep\"\n | \"backgroundImage\"\n | \"markings\"\n | \"labels\"\n | \"showProtractor\"\n | \"showRuler\"\n | \"showTooltips\"\n | \"rulerLabel\"\n | \"rulerTicks\"\n | \"range\"\n | \"graph\"\n | \"lockedFigures\"\n | \"fullGraphAriaLabel\"\n | \"fullGraphAriaDescription\"\n>;\n\nexport default function getInteractiveGraphPublicWidgetOptions(\n options: PerseusInteractiveGraphWidgetOptions,\n): InteractiveGraphPublicWidgetOptions {\n const {correct: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getInteractiveGraphPublicWidgetOptions from \"./interactive-graph-util\";\n\nimport type {PerseusInteractiveGraphWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type InteractiveGraphDefaultWidgetOptions = Pick<\n PerseusInteractiveGraphWidgetOptions,\n | \"labels\"\n | \"range\"\n | \"step\"\n | \"backgroundImage\"\n | \"markings\"\n | \"showTooltips\"\n | \"showProtractor\"\n | \"graph\"\n | \"correct\"\n>;\n\nconst defaultWidgetOptions: InteractiveGraphDefaultWidgetOptions = {\n labels: [\"x\", \"y\"],\n range: [\n [-10, 10],\n [-10, 10],\n ],\n step: [1, 1],\n backgroundImage: {\n url: null,\n },\n markings: \"graph\",\n showTooltips: false,\n showProtractor: false,\n graph: {\n type: \"linear\",\n },\n correct: {\n type: \"linear\",\n coords: null,\n },\n};\n\nconst interactiveGraphWidgetLogic: WidgetLogic = {\n name: \"interactive-graph\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getInteractiveGraphPublicWidgetOptions,\n};\n\nexport default interactiveGraphWidgetLogic;\n","import type {\n PerseusLabelImageMarker,\n PerseusLabelImageWidgetOptions,\n} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusLabelImageWidgetOptions type\n */\ntype LabelImagePublicWidgetOptions = {\n choices: PerseusLabelImageWidgetOptions[\"choices\"];\n imageUrl: PerseusLabelImageWidgetOptions[\"imageUrl\"];\n imageAlt: PerseusLabelImageWidgetOptions[\"imageAlt\"];\n imageHeight: PerseusLabelImageWidgetOptions[\"imageHeight\"];\n imageWidth: PerseusLabelImageWidgetOptions[\"imageWidth\"];\n markers: ReadonlyArray<LabelImageMarkerPublicData>;\n hideChoicesFromInstructions: PerseusLabelImageWidgetOptions[\"hideChoicesFromInstructions\"];\n multipleAnswers: PerseusLabelImageWidgetOptions[\"multipleAnswers\"];\n static: PerseusLabelImageWidgetOptions[\"static\"];\n};\n\ntype LabelImageMarkerPublicData = Pick<\n PerseusLabelImageMarker,\n \"x\" | \"y\" | \"label\"\n>;\n\nexport default function getLabelImagePublicWidgetOptions(\n options: PerseusLabelImageWidgetOptions,\n): LabelImagePublicWidgetOptions {\n return {\n ...options,\n markers: options.markers.map(getLabelImageMarkerPublicData),\n };\n}\n\nfunction getLabelImageMarkerPublicData(\n marker: PerseusLabelImageMarker,\n): LabelImageMarkerPublicData {\n const {answers: _, ...publicData} = marker;\n return publicData;\n}\n","import getLabelImagePublicWidgetOptions from \"./label-image-util\";\n\nimport type {PerseusLabelImageWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type LabelImageDefaultWidgetOptions = Pick<\n PerseusLabelImageWidgetOptions,\n | \"choices\"\n | \"imageAlt\"\n | \"imageUrl\"\n | \"imageWidth\"\n | \"imageHeight\"\n | \"markers\"\n | \"multipleAnswers\"\n | \"hideChoicesFromInstructions\"\n>;\n\nconst defaultWidgetOptions: LabelImageDefaultWidgetOptions = {\n choices: [],\n imageAlt: \"\",\n imageUrl: \"\",\n imageWidth: 0,\n imageHeight: 0,\n markers: [],\n multipleAnswers: false,\n hideChoicesFromInstructions: false,\n};\n\nconst labelImageWidgetLogic: WidgetLogic = {\n name: \"label-image\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getLabelImagePublicWidgetOptions,\n};\n\nexport default labelImageWidgetLogic;\n","import {seededRNG, shuffle} from \"@khanacademy/perseus-core\";\n\nimport type {PerseusMatcherWidgetOptions} from \"@khanacademy/perseus-core\";\n\n// TODO(LEMS-2841): Should be able to remove once getPublicWidgetOptions is hooked up\ntype MatcherInfo = {\n left: ReadonlyArray<string>;\n right: ReadonlyArray<string>;\n orderMatters: boolean;\n problemNum: number | null | undefined;\n};\n\ntype MatcherShuffleInfo = {\n left: ReadonlyArray<string>;\n right: ReadonlyArray<string>;\n orderMatters: boolean;\n};\n\n// TODO(LEMS-2841): Should be able to remove once getPublicWidgetOptions is hooked up\nexport const shuffleMatcher = (\n props: MatcherInfo,\n): {left: ReadonlyArray<string>; right: ReadonlyArray<string>} => {\n // Use the same random() function to shuffle both columns sequentially\n const rng = seededRNG(props.problemNum as number);\n\n let left;\n if (!props.orderMatters) {\n // If the order doesn't matter, don't shuffle the left column\n left = props.left;\n } else {\n left = shuffle(props.left, rng, /* ensurePermuted */ true);\n }\n\n const right = shuffle(props.right, rng, /* ensurePermuted */ true);\n\n return {left, right};\n};\n\n// TODO(LEMS-2841): Can shorten to shuffleMatcher after above function removed\nfunction shuffleMatcherWithRandom(data: MatcherShuffleInfo): {\n left: ReadonlyArray<string>;\n right: ReadonlyArray<string>;\n} {\n // Use the same random() function to shuffle both columns sequentially\n let left;\n if (!data.orderMatters) {\n // If the order doesn't matter, don't shuffle the left column\n left = data.left;\n } else {\n left = shuffle(data.left, Math.random, /* ensurePermuted */ true);\n }\n\n const right = shuffle(data.right, Math.random, /* ensurePermuted */ true);\n\n return {left, right};\n}\n\n/**\n * For details on the individual options, see the\n * PerseusMatcherWidgetOptions type\n */\ntype MatcherPublicWidgetOptions = {\n labels: PerseusMatcherWidgetOptions[\"labels\"];\n left: PerseusMatcherWidgetOptions[\"left\"];\n right: PerseusMatcherWidgetOptions[\"right\"];\n orderMatters: PerseusMatcherWidgetOptions[\"orderMatters\"];\n padding: PerseusMatcherWidgetOptions[\"padding\"];\n};\n\n/**\n * Given a PerseusMatcherWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getMatcherPublicWidgetOptions(\n options: PerseusMatcherWidgetOptions,\n): MatcherPublicWidgetOptions {\n const {left, right} = shuffleMatcherWithRandom(options);\n\n return {\n ...options,\n left: left,\n right: right,\n };\n}\n\nexport default getMatcherPublicWidgetOptions;\n","import getMatcherPublicWidgetOptions from \"./matcher-util\";\n\nimport type {PerseusMatcherWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type MatcherDefaultWidgetOptions = Pick<\n PerseusMatcherWidgetOptions,\n \"left\" | \"right\" | \"labels\" | \"orderMatters\" | \"padding\"\n>;\n\nconst defaultWidgetOptions: MatcherDefaultWidgetOptions = {\n left: [\"$x$\", \"$y$\", \"$z$\"],\n right: [\"$1$\", \"$2$\", \"$3$\"],\n labels: [\"test\", \"label\"],\n orderMatters: false,\n padding: true,\n};\n\nconst matcherWidgetLogic: WidgetLogic = {\n name: \"matcher\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getMatcherPublicWidgetOptions,\n};\n\nexport default matcherWidgetLogic;\n","import type {PerseusMatrixWidgetOptions} from \"@khanacademy/perseus-core\";\n\ntype MatrixPublicWidgetOptions = Pick<\n PerseusMatrixWidgetOptions,\n \"prefix\" | \"suffix\" | \"cursorPosition\" | \"matrixBoardSize\" | \"static\"\n>;\n\nexport default function getMatrixPublicWidgetOptions(\n options: PerseusMatrixWidgetOptions,\n): MatrixPublicWidgetOptions {\n const {answers: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getMatrixPublicWidgetOptions from \"./matrix-util\";\n\nimport type {PerseusMatrixWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type MatrixDefaultWidgetOptions = Pick<\n PerseusMatrixWidgetOptions,\n \"matrixBoardSize\" | \"answers\" | \"prefix\" | \"suffix\" | \"cursorPosition\"\n>;\n\nconst defaultWidgetOptions: MatrixDefaultWidgetOptions = {\n matrixBoardSize: [3, 3],\n answers: [[]],\n prefix: \"\",\n suffix: \"\",\n cursorPosition: [0, 0],\n};\n\nconst matrixWidgetLogic: WidgetLogic = {\n name: \"matrix\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getMatrixPublicWidgetOptions,\n};\n\nexport default matrixWidgetLogic;\n","import type {PerseusMeasurerWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 1, minor: 0};\n\nexport const widgetOptionsUpgrades = {\n \"1\": (v0options: any): PerseusMeasurerWidgetOptions => {\n const {imageUrl, imageTop, imageLeft, ...rest} = v0options;\n\n return {\n ...rest,\n image: {\n url: imageUrl,\n top: imageTop,\n left: imageLeft,\n },\n };\n },\n} as const;\n\nexport type MeasurerDefaultWidgetOptions = Pick<\n PerseusMeasurerWidgetOptions,\n | \"box\"\n | \"image\"\n | \"showProtractor\"\n | \"showRuler\"\n | \"rulerLabel\"\n | \"rulerTicks\"\n | \"rulerPixels\"\n | \"rulerLength\"\n>;\n\nexport const defaultWidgetOptions: MeasurerDefaultWidgetOptions = {\n box: [480, 480],\n image: {} as any,\n showProtractor: true,\n showRuler: false,\n rulerLabel: \"\",\n rulerTicks: 10,\n rulerPixels: 40,\n rulerLength: 10,\n};\n","import {\n currentVersion,\n defaultWidgetOptions,\n widgetOptionsUpgrades,\n} from \"./measurer-upgrade\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {MeasurerDefaultWidgetOptions} from \"./measurer-upgrade\";\n\nconst measurerWidgetLogic: WidgetLogic = {\n name: \"measurer\",\n version: currentVersion,\n widgetOptionsUpgrades: widgetOptionsUpgrades,\n defaultWidgetOptions: defaultWidgetOptions,\n};\n\nexport default measurerWidgetLogic;\n","import type {PerseusNumberLineWidgetOptions} from \"../../data-schema\";\n\ntype NumberLinePublicWidgetOptions = Pick<\n PerseusNumberLineWidgetOptions,\n | \"range\"\n | \"labelRange\"\n | \"labelStyle\"\n | \"labelTicks\"\n | \"isTickCtrl\"\n | \"divisionRange\"\n | \"numDivisions\"\n | \"snapDivisions\"\n | \"tickStep\"\n | \"initialX\"\n | \"showTooltips\"\n | \"static\"\n>;\n\nexport default function getNumberLinePublicWidgetOptions(\n options: PerseusNumberLineWidgetOptions,\n): NumberLinePublicWidgetOptions {\n const {correctX: _, correctRel: __, ...publicOptions} = options;\n return publicOptions;\n}\n","import getNumberLinePublicWidgetOptions from \"./number-line-util\";\n\nimport type {PerseusNumberLineWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type NumberLineDefaultWidgetOptions = Pick<\n PerseusNumberLineWidgetOptions,\n | \"range\"\n | \"labelRange\"\n | \"labelStyle\"\n | \"labelTicks\"\n | \"divisionRange\"\n | \"numDivisions\"\n | \"snapDivisions\"\n | \"tickStep\"\n | \"correctRel\"\n | \"correctX\"\n | \"initialX\"\n | \"showTooltips\"\n>;\n\nconst defaultWidgetOptions: NumberLineDefaultWidgetOptions = {\n range: [0, 10],\n\n labelRange: [null, null],\n labelStyle: \"decimal\",\n labelTicks: true,\n\n divisionRange: [1, 12],\n numDivisions: 5,\n snapDivisions: 2,\n\n tickStep: null,\n correctRel: \"eq\",\n correctX: null,\n initialX: null,\n\n showTooltips: false,\n};\n\nconst numberLineWidgetLogic: WidgetLogic = {\n name: \"number-line\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getNumberLinePublicWidgetOptions,\n};\n\nexport default numberLineWidgetLogic;\n","import type {\n PerseusNumericInputAnswer,\n PerseusNumericInputWidgetOptions,\n} from \"@khanacademy/perseus-core\";\n\ntype NumericInputAnswerPublicData = Pick<\n PerseusNumericInputAnswer,\n \"answerForms\" | \"simplify\" | \"status\"\n>;\n\n/**\n * For details on the individual options, see the\n * PerseusNumericInputWidgetOptions type\n */\ntype NumericInputPublicWidgetOptions = {\n labelText?: PerseusNumericInputWidgetOptions[\"labelText\"];\n size: PerseusNumericInputWidgetOptions[\"size\"];\n coefficient: PerseusNumericInputWidgetOptions[\"coefficient\"];\n rightAlign?: PerseusNumericInputWidgetOptions[\"rightAlign\"];\n static: PerseusNumericInputWidgetOptions[\"static\"];\n answers: ReadonlyArray<NumericInputAnswerPublicData>;\n};\n\n/**\n * This data from `answers` is used pre-scoring to give hints\n * to the learner regarding the format of accepted answers\n */\nfunction getNumericInputAnswerPublicData(\n answer: PerseusNumericInputAnswer,\n): NumericInputAnswerPublicData {\n const {answerForms, simplify, status} = answer;\n return {\n answerForms,\n simplify,\n status,\n };\n}\n\n/**\n * Given a PerseusNumericInputWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getNumericInputPublicWidgetOptions(\n options: PerseusNumericInputWidgetOptions,\n): NumericInputPublicWidgetOptions {\n const {answers, ...publicWidgetOptions} = options;\n return {\n ...publicWidgetOptions,\n answers: answers.map(getNumericInputAnswerPublicData),\n };\n}\n\nexport default getNumericInputPublicWidgetOptions;\n","import getNumericInputPublicWidgetOptions from \"./numeric-input-util\";\n\nimport type {PerseusNumericInputWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type NumericInputDefaultWidgetOptions = Pick<\n PerseusNumericInputWidgetOptions,\n \"answers\" | \"size\" | \"coefficient\" | \"labelText\" | \"rightAlign\"\n>;\n\nconst defaultWidgetOptions: NumericInputDefaultWidgetOptions = {\n answers: [\n {\n value: null,\n status: \"correct\",\n message: \"\",\n simplify: \"required\",\n answerForms: [],\n strict: false,\n maxError: null,\n },\n ],\n size: \"normal\",\n coefficient: false,\n labelText: \"\",\n rightAlign: false,\n};\n\nconst numericInputWidgetLogic: WidgetLogic = {\n name: \"numeric-input\",\n defaultWidgetOptions,\n defaultAlignment: \"inline-block\",\n getPublicWidgetOptions: getNumericInputPublicWidgetOptions,\n};\n\nexport default numericInputWidgetLogic;\n","import type {PerseusOrdererWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusOrdererWidgetOptions type\n */\ntype OrdererPublicWidgetOptions = {\n options: PerseusOrdererWidgetOptions[\"options\"];\n height: PerseusOrdererWidgetOptions[\"height\"];\n layout: PerseusOrdererWidgetOptions[\"layout\"];\n};\n\n/**\n * Given a PerseusOrdererWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getOrdererPublicWidgetOptions(\n options: PerseusOrdererWidgetOptions,\n): OrdererPublicWidgetOptions {\n return {\n options: options.options,\n height: options.height,\n layout: options.layout,\n };\n}\n\nexport default getOrdererPublicWidgetOptions;\n","import getOrdererPublicWidgetOptions from \"./orderer-util\";\n\nimport type {PerseusOrdererWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type OrdererDefaultWidgetOptions = Pick<\n PerseusOrdererWidgetOptions,\n \"correctOptions\" | \"otherOptions\" | \"height\" | \"layout\"\n>;\n\nconst defaultWidgetOptions: OrdererDefaultWidgetOptions = {\n correctOptions: [{content: \"$x$\"}] as any,\n otherOptions: [{content: \"$y$\"}] as any,\n height: \"normal\",\n layout: \"horizontal\",\n};\n\nconst ordererWidgetLogic: WidgetLogic = {\n name: \"orderer\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getOrdererPublicWidgetOptions,\n};\n\nexport default ordererWidgetLogic;\n","import type {PerseusPassageWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PassageDefaultWidgetOptions = Pick<\n PerseusPassageWidgetOptions,\n \"passageTitle\" | \"passageText\" | \"footnotes\" | \"showLineNumbers\"\n>;\n\nconst defaultWidgetOptions: PassageDefaultWidgetOptions = {\n passageTitle: \"\",\n passageText: \"\",\n footnotes: \"\",\n showLineNumbers: true,\n};\n\nconst passageWidgetLogic: WidgetLogic = {\n name: \"passage\",\n defaultWidgetOptions,\n};\n\nexport default passageWidgetLogic;\n","import type {PerseusPassageRefWidgetOptions} from \"../../data-schema\";\n\nexport const currentVersion = {major: 0, minor: 1};\n\nexport type PassageRefDefaultWidgetOptions = Pick<\n PerseusPassageRefWidgetOptions,\n \"passageNumber\" | \"referenceNumber\" | \"summaryText\"\n>;\n\nexport const defaultWidgetOptions: PassageRefDefaultWidgetOptions = {\n passageNumber: 1,\n referenceNumber: 1,\n summaryText: \"\",\n};\n","import {currentVersion, defaultWidgetOptions} from \"./passage-ref-upgrade\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {PassageRefDefaultWidgetOptions} from \"./passage-ref-upgrade\";\n\nconst passageRefWidgetLogic: WidgetLogic = {\n name: \"passageRef\",\n version: currentVersion,\n defaultWidgetOptions: defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default passageRefWidgetLogic;\n","import type {PerseusPassageRefTargetWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PassageRefTargetDefaultWidgetOptions = Pick<\n PerseusPassageRefTargetWidgetOptions,\n \"content\"\n>;\n\nconst defaultWidgetOptions: PassageRefTargetDefaultWidgetOptions = {\n content: \"\",\n};\n\nconst passageRefTargetWidgetLogic: WidgetLogic = {\n name: \"passageRefTarget\",\n defaultWidgetOptions,\n defaultAlignment: \"inline\",\n};\n\nexport default passageRefTargetWidgetLogic;\n","import type {PerseusPhetSimulationWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PhetSimulationDefaultWidgetOptions = Pick<\n PerseusPhetSimulationWidgetOptions,\n \"url\" | \"description\"\n>;\n\nconst defaultWidgetOptions: PhetSimulationDefaultWidgetOptions = {\n url: \"\",\n description: \"\",\n};\n\nconst phetSimulationWidgetLogic: WidgetLogic = {\n name: \"phet-simulation\",\n defaultWidgetOptions,\n};\n\nexport default phetSimulationWidgetLogic;\n","import type {PerseusPlotterWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusPlotterWidgetOptions type\n */\ntype PlotterPublicWidgetOptions = Omit<PerseusPlotterWidgetOptions, \"correct\">;\n\n/**\n * Given a PerseusPlotterWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getPlotterPublicWidgetOptions(\n options: PerseusPlotterWidgetOptions,\n): PlotterPublicWidgetOptions {\n const {correct: _, ...publicOptions} = options;\n return publicOptions;\n}\n\nexport default getPlotterPublicWidgetOptions;\n","import getPlotterPublicWidgetOptions from \"./plotter-util\";\n\nimport type {PerseusPlotterWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PlotterDefaultWidgetOptions = Pick<\n PerseusPlotterWidgetOptions,\n | \"scaleY\"\n | \"maxY\"\n | \"snapsPerLine\"\n | \"correct\"\n | \"starting\"\n | \"type\"\n | \"labels\"\n | \"categories\"\n | \"picSize\"\n | \"picBoxHeight\"\n | \"plotDimensions\"\n | \"labelInterval\"\n | \"picUrl\"\n>;\n\nconst defaultWidgetOptions: PlotterDefaultWidgetOptions = {\n scaleY: 1,\n maxY: 10,\n snapsPerLine: 2,\n correct: [1],\n starting: [1],\n\n type: \"bar\",\n labels: [\"\", \"\"],\n categories: [\"\"],\n\n picSize: 30,\n picBoxHeight: 36,\n plotDimensions: [275, 200],\n labelInterval: 1,\n\n picUrl: null,\n};\n\nconst plotterWidgetLogic: WidgetLogic = {\n name: \"plotter\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getPlotterPublicWidgetOptions,\n};\n\nexport default plotterWidgetLogic;\n","import type {PerseusPythonProgramWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type PythonProgramDefaultWidgetOptions = Pick<\n PerseusPythonProgramWidgetOptions,\n \"programID\" | \"height\"\n>;\n\nconst defaultWidgetOptions: PythonProgramDefaultWidgetOptions = {\n programID: \"\",\n height: 400,\n};\n\nconst pythonProgramWidgetLogic: WidgetLogic = {\n name: \"python-program\",\n defaultWidgetOptions,\n};\n\nexport default pythonProgramWidgetLogic;\n","import type {\n PerseusRadioChoice,\n PerseusRadioWidgetOptions,\n} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusRadioWidgetOptions type\n */\ntype RadioPublicWidgetOptions = {\n choices: ReadonlyArray<RadioChoicePublicData>;\n hasNoneOfTheAbove?: PerseusRadioWidgetOptions[\"hasNoneOfTheAbove\"];\n countChoices?: PerseusRadioWidgetOptions[\"countChoices\"];\n numCorrect?: PerseusRadioWidgetOptions[\"numCorrect\"];\n randomize?: PerseusRadioWidgetOptions[\"randomize\"];\n multipleSelect?: PerseusRadioWidgetOptions[\"multipleSelect\"];\n deselectEnabled?: PerseusRadioWidgetOptions[\"deselectEnabled\"];\n onePerLine?: PerseusRadioWidgetOptions[\"onePerLine\"];\n displayCount?: PerseusRadioWidgetOptions[\"displayCount\"];\n noneOfTheAbove?: PerseusRadioWidgetOptions[\"noneOfTheAbove\"];\n};\n\n/**\n * Only the options from each Radio choice that should be exposed to the client.\n */\ntype RadioChoicePublicData = Pick<\n PerseusRadioChoice,\n \"content\" | \"isNoneOfTheAbove\" | \"widgets\"\n>;\n\n/**\n * Given a PerseusRadioChoice object, return a new object with only the public\n * data that should be included in the Radio public widget options.\n */\nfunction getRadioChoicePublicData(\n choice: PerseusRadioChoice,\n): RadioChoicePublicData {\n const {content, isNoneOfTheAbove, widgets} = choice;\n return {\n content,\n isNoneOfTheAbove,\n widgets,\n };\n}\n\n/**\n * Shared functionality to determine if numCorrect is used, because:\n *\n * 1. numCorrect is conditionally used for rendering pre-scoring\n * 2. numCorrect also exposes information about answers\n *\n * So only include/use numCorrect when we know it's useful.\n */\nexport function usesNumCorrect(\n multipleSelect: PerseusRadioWidgetOptions[\"multipleSelect\"],\n countChoices: PerseusRadioWidgetOptions[\"countChoices\"],\n numCorrect: PerseusRadioWidgetOptions[\"numCorrect\"],\n) {\n return multipleSelect && countChoices && numCorrect;\n}\n\n/**\n * Given a PerseusRadioWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getRadioPublicWidgetOptions(\n options: PerseusRadioWidgetOptions,\n): RadioPublicWidgetOptions {\n const {numCorrect, choices, multipleSelect, countChoices} = options;\n\n return {\n ...options,\n numCorrect: usesNumCorrect(multipleSelect, countChoices, numCorrect)\n ? numCorrect\n : undefined,\n choices: choices.map(getRadioChoicePublicData),\n };\n}\n\nexport default getRadioPublicWidgetOptions;\n","import {\n currentVersion,\n defaultWidgetOptions,\n widgetOptionsUpgrades,\n} from \"./radio-upgrade\";\nimport getRadioPublicWidgetOptions from \"./radio-util\";\n\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type {RadioDefaultWidgetOptions} from \"./radio-upgrade\";\n\nconst radioWidgetLogic: WidgetLogic = {\n name: \"radio\",\n version: currentVersion,\n widgetOptionsUpgrades: widgetOptionsUpgrades,\n defaultWidgetOptions: defaultWidgetOptions,\n getPublicWidgetOptions: getRadioPublicWidgetOptions,\n};\n\nexport default radioWidgetLogic;\n","import {shuffle} from \"@khanacademy/perseus-core\";\n\nimport type {PerseusSorterWidgetOptions} from \"@khanacademy/perseus-core\";\n\n/**\n * For details on the individual options, see the\n * PerseusSorterWidgetOptions type\n */\ntype SorterPublicWidgetOptions = {\n correct: PerseusSorterWidgetOptions[\"correct\"];\n padding: PerseusSorterWidgetOptions[\"padding\"];\n layout: PerseusSorterWidgetOptions[\"layout\"];\n isCorrectShuffled: boolean;\n};\n\n/**\n * Given a PerseusSorterWidgetOptions object, return a new object with only\n * the public options that should be exposed to the client.\n */\nfunction getSorterPublicWidgetOptions(\n options: PerseusSorterWidgetOptions,\n): SorterPublicWidgetOptions {\n const shuffledCorrect = shuffle(\n options.correct,\n Math.random,\n /* ensurePermuted */ true,\n );\n\n return {\n ...options,\n // Note(Tamara): This does not provide correct answer information any longer.\n // To maintain compatibility with the original widget options, we are\n // keeping the key the same. Represents initial state of the cards here.\n correct: shuffledCorrect,\n // Note(Tamara): This new key is only added here with \"true\". There isn't\n // a place where it is set to false. It indicates that the correct field\n // has been shuffled and no longer contains correct answer info.\n isCorrectShuffled: true,\n };\n}\n\nexport default getSorterPublicWidgetOptions;\n","import getSorterPublicWidgetOptions from \"./sorter-util\";\n\nimport type {PerseusSorterWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type SorterDefaultWidgetOptions = Pick<\n PerseusSorterWidgetOptions,\n \"correct\" | \"layout\" | \"padding\"\n>;\n\nconst defaultWidgetOptions: SorterDefaultWidgetOptions = {\n correct: [\"$x$\", \"$y$\", \"$z$\"],\n layout: \"horizontal\",\n padding: true,\n};\n\nconst sorterWidgetLogic: WidgetLogic = {\n name: \"sorter\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getSorterPublicWidgetOptions,\n};\n\nexport default sorterWidgetLogic;\n","import type {PerseusTableWidgetOptions} from \"@khanacademy/perseus-core\";\n\ntype TablePublicWidgetOptions = Pick<\n PerseusTableWidgetOptions,\n \"headers\" | \"rows\" | \"columns\"\n>;\n\nexport default function getTablePublicWidgetOptions(\n options: PerseusTableWidgetOptions,\n): TablePublicWidgetOptions {\n const {answers: _, ...publicOptions} = options;\n return publicOptions;\n}\n","import getTablePublicWidgetOptions from \"./table-util\";\n\nimport type {PerseusTableWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type TableDefaultWidgetOptions = Pick<\n PerseusTableWidgetOptions,\n \"headers\" | \"rows\" | \"columns\" | \"answers\"\n>;\n\nconst defaultRows = 4;\nconst defaultColumns = 1;\n\n// initialize a 2D array\n// (defaultRows x defaultColumns) of empty strings\nconst answers = new Array(defaultRows)\n .fill(0)\n .map(() => new Array(defaultColumns).fill(\"\"));\n\nconst defaultWidgetOptions: TableDefaultWidgetOptions = {\n headers: [\"\"],\n rows: defaultRows,\n columns: defaultColumns,\n answers: answers,\n};\n\nconst tableWidgetLogic: WidgetLogic = {\n name: \"table\",\n defaultWidgetOptions,\n getPublicWidgetOptions: getTablePublicWidgetOptions,\n};\n\nexport default tableWidgetLogic;\n","import type {PerseusVideoWidgetOptions} from \"../../data-schema\";\nimport type {WidgetLogic} from \"../logic-export.types\";\n\nexport type VideoDefaultWidgetOptions = Pick<\n PerseusVideoWidgetOptions,\n \"location\"\n>;\n\nconst defaultWidgetOptions: VideoDefaultWidgetOptions = {\n location: \"\",\n};\n\nconst videoWidgetLogic: WidgetLogic = {\n name: \"video\",\n defaultWidgetOptions,\n supportedAlignments: [\"block\", \"float-left\", \"float-right\", \"full-width\"],\n defaultAlignment: \"block\",\n};\n\nexport default videoWidgetLogic;\n","import categorizerWidgetLogic from \"./categorizer\";\nimport csProgramWidgetLogic from \"./cs-program\";\nimport definitionWidgetLogic from \"./definition\";\nimport dropdownWidgetLogic from \"./dropdown\";\nimport explanationWidgetLogic from \"./explanation\";\nimport expressionWidgetLogic from \"./expression\";\nimport gradedGroupWidgetLogic from \"./graded-group\";\nimport gradedGroupSetWidgetLogic from \"./graded-group-set\";\nimport grapherWidgetLogic from \"./grapher\";\nimport groupWidgetLogic from \"./group\";\nimport iframeWidgetLogic from \"./iframe\";\nimport imageWidgetLogic from \"./image\";\nimport inputNumberWidgetLogic from \"./input-number\";\nimport interactionWidgetLogic from \"./interaction\";\nimport interactiveGraphWidgetLogic from \"./interactive-graph\";\nimport labelImageWidgetLogic from \"./label-image\";\nimport matcherWidgetLogic from \"./matcher\";\nimport matrixWidgetLogic from \"./matrix\";\nimport measurerWidgetLogic from \"./measurer\";\nimport numberLineWidgetLogic from \"./number-line\";\nimport numericInputWidgetLogic from \"./numeric-input\";\nimport ordererWidgetLogic from \"./orderer\";\nimport passageWidgetLogic from \"./passage\";\nimport passageRefWidgetLogic from \"./passage-ref\";\nimport passageRefTargetWidgetLogic from \"./passage-ref-target\";\nimport phetSimulationWidgetLogic from \"./phet-simulation\";\nimport plotterWidgetLogic from \"./plotter\";\nimport pythonProgramWidgetLogic from \"./python-program\";\nimport radioWidgetLogic from \"./radio\";\nimport sorterWidgetLogic from \"./sorter\";\nimport tableWidgetLogic from \"./table\";\nimport videoWidgetLogic from \"./video\";\n\nimport type {\n PublicWidgetOptionsFunction,\n WidgetLogic,\n} from \"./logic-export.types\";\nimport type {Alignment} from \"../types\";\n\nconst widgets = {};\n\nfunction registerWidget(type: string, logic: WidgetLogic) {\n widgets[type] = logic;\n}\n\nexport function isWidgetRegistered(type: string) {\n const widgetLogic = widgets[type];\n return !!widgetLogic;\n}\n\nexport function getCurrentVersion(type: string) {\n const widgetLogic = widgets[type];\n return widgetLogic?.version || {major: 0, minor: 0};\n}\n\n// TODO(LEMS-2870): getPublicWidgetOptionsFunction/PublicWidgetOptionsFunction\n// need better types\nexport const getPublicWidgetOptionsFunction = (\n name: string,\n): PublicWidgetOptionsFunction => {\n return widgets[name]?.getPublicWidgetOptions ?? ((i: any) => i);\n};\n\nexport function getWidgetOptionsUpgrades(type: string) {\n const widgetLogic = widgets[type];\n return widgetLogic?.widgetOptionsUpgrades || {};\n}\n\nexport function getDefaultWidgetOptions(type: string) {\n const widgetLogic = widgets[type];\n return widgetLogic?.defaultWidgetOptions || {};\n}\n\n/**\n * Handling for the optional alignments for widgets\n * See widget-container.jsx for details on how alignments are implemented.\n */\n\n/**\n * Returns the list of supported alignments for the given (string) widget\n * type. This is used primarily at editing time to display the choices\n * for the user.\n *\n * Supported alignments are given as an array of strings in the exports of\n * a widget's module.\n */\nexport const getSupportedAlignments = (\n type: string,\n): ReadonlyArray<Alignment> => {\n const widgetLogic = widgets[type];\n if (!widgetLogic?.supportedAlignments?.[0]) {\n // default alignments\n return [\"default\"];\n }\n return widgetLogic?.supportedAlignments;\n};\n\n/**\n * For the given (string) widget type, determine the default alignment for\n * the widget. This is used at rendering time to go from \"default\" alignment\n * to the actual alignment displayed on the screen.\n *\n * The default alignment is given either as a string (called\n * `defaultAlignment`) or a function (called `getDefaultAlignment`) on\n * the exports of a widget's module.\n */\nexport const getDefaultAlignment = (type: string): Alignment => {\n const widgetLogic = widgets[type];\n if (!widgetLogic?.defaultAlignment) {\n return \"block\";\n }\n return widgetLogic.defaultAlignment;\n};\n\nregisterWidget(\"categorizer\", categorizerWidgetLogic);\nregisterWidget(\"cs-program\", csProgramWidgetLogic);\nregisterWidget(\"definition\", definitionWidgetLogic);\nregisterWidget(\"dropdown\", dropdownWidgetLogic);\nregisterWidget(\"explanation\", explanationWidgetLogic);\nregisterWidget(\"expression\", expressionWidgetLogic);\nregisterWidget(\"graded-group\", gradedGroupWidgetLogic);\nregisterWidget(\"graded-group-set\", gradedGroupSetWidgetLogic);\nregisterWidget(\"grapher\", grapherWidgetLogic);\nregisterWidget(\"group\", groupWidgetLogic);\nregisterWidget(\"iframe\", iframeWidgetLogic);\nregisterWidget(\"image\", imageWidgetLogic);\nregisterWidget(\"input-number\", inputNumberWidgetLogic);\nregisterWidget(\"interaction\", interactionWidgetLogic);\nregisterWidget(\"interactive-graph\", interactiveGraphWidgetLogic);\nregisterWidget(\"label-image\", labelImageWidgetLogic);\nregisterWidget(\"matcher\", matcherWidgetLogic);\nregisterWidget(\"matrix\", matrixWidgetLogic);\nregisterWidget(\"measurer\", measurerWidgetLogic);\nregisterWidget(\"number-line\", numberLineWidgetLogic);\nregisterWidget(\"numeric-input\", numericInputWidgetLogic);\nregisterWidget(\"orderer\", ordererWidgetLogic);\nregisterWidget(\"passage\", passageWidgetLogic);\nregisterWidget(\"passage-ref\", passageRefWidgetLogic);\nregisterWidget(\"passage-ref-target\", passageRefTargetWidgetLogic);\nregisterWidget(\"phet-simulation\", phetSimulationWidgetLogic);\nregisterWidget(\"plotter\", plotterWidgetLogic);\nregisterWidget(\"python-program\", pythonProgramWidgetLogic);\nregisterWidget(\"radio\", radioWidgetLogic);\nregisterWidget(\"sorter\", sorterWidgetLogic);\nregisterWidget(\"table\", tableWidgetLogic);\nregisterWidget(\"video\", videoWidgetLogic);\n","import _ from \"underscore\";\n\nimport {Errors} from \"../error/errors\";\nimport {PerseusError} from \"../error/perseus-error\";\nimport {mapObject} from \"../utils/objective_\";\n\nimport {\n getCurrentVersion,\n getDefaultWidgetOptions,\n getSupportedAlignments,\n getWidgetOptionsUpgrades,\n isWidgetRegistered,\n} from \"./core-widget-registry\";\n\nimport type {PerseusWidget, PerseusWidgetsMap} from \"../data-schema\";\n\nconst DEFAULT_STATIC = false;\n\nexport const upgradeWidgetInfoToLatestVersion = (\n oldWidgetInfo: PerseusWidget,\n): PerseusWidget => {\n const type = oldWidgetInfo.type;\n // NOTE(jeremy): This looks like it could be replaced by fixing types so\n // that `type` is non-optional. But we're seeing this in Sentry today so I\n // suspect we have legacy data (potentially unpublished) and we should\n // figure that out before depending solely on types.\n if (!_.isString(type)) {\n throw new PerseusError(\n \"widget type must be a string, but was: \" + type,\n Errors.Internal,\n );\n }\n\n if (!isWidgetRegistered(type)) {\n // If we have a widget that isn't registered, we can't upgrade it\n // TODO(aria): Figure out what the best thing to do here would be\n return oldWidgetInfo;\n }\n\n // Unversioned widgets (pre-July 2014) are all implicitly 0.0\n const initialVersion = oldWidgetInfo.version || {major: 0, minor: 0};\n const latestVersion = getCurrentVersion(type);\n\n // If the widget version is later than what we understand (major\n // version is higher than latest, or major versions are equal and minor\n // version is higher than latest), don't perform any upgrades.\n if (\n initialVersion.major > latestVersion.major ||\n (initialVersion.major === latestVersion.major &&\n initialVersion.minor > latestVersion.minor)\n ) {\n return oldWidgetInfo;\n }\n\n // We do a clone here so that it's safe to mutate the input parameter\n // in propUpgrades functions (which I will probably accidentally do at\n // some point, and we would like to not break when that happens).\n let newEditorOptions = _.clone(oldWidgetInfo.options) || {};\n\n const upgradePropsMap = getWidgetOptionsUpgrades(type);\n\n // Empty props usually mean a newly created widget by the editor,\n // and are always considerered up-to-date.\n // Mostly, we'd rather not run upgrade functions on props that are\n // not complete.\n if (_.keys(newEditorOptions).length !== 0) {\n // We loop through all the versions after the current version of\n // the loaded widget, up to and including the latest version of the\n // loaded widget, and run the upgrade function to bring our loaded\n // widget's props up to that version.\n // There is a little subtlety here in that we call\n // upgradePropsMap[1] to upgrade *to* version 1,\n // (not from version 1).\n for (\n let nextVersion = initialVersion.major + 1;\n nextVersion <= latestVersion.major;\n nextVersion++\n ) {\n if (upgradePropsMap[String(nextVersion)]) {\n newEditorOptions =\n upgradePropsMap[String(nextVersion)](newEditorOptions);\n } else {\n throw new PerseusError(\n \"No upgrade found for widget. Cannot render.\",\n Errors.Internal,\n {\n metadata: {\n type,\n fromMajorVersion: nextVersion - 1,\n toMajorVersion: nextVersion,\n oldWidgetInfo: JSON.stringify(oldWidgetInfo),\n },\n },\n );\n }\n }\n }\n\n // Minor version upgrades (eg. new optional props) don't have\n // transform functions. Instead, we fill in the new props with their\n // defaults.\n const defaultOptions = getDefaultWidgetOptions(type);\n newEditorOptions = {\n ...defaultOptions,\n ...newEditorOptions,\n };\n\n let alignment = oldWidgetInfo.alignment;\n\n // Widgets that support multiple alignments will \"lock in\" the\n // alignment to the alignment that would be listed first in the\n // select box. If the widget only supports one alignment, the\n // alignment value will likely just end up as \"default\".\n if (alignment == null || alignment === \"default\") {\n alignment = getSupportedAlignments(type)?.[0];\n if (!alignment) {\n throw new PerseusError(\n \"No default alignment found when upgrading widget\",\n Errors.Internal,\n {metadata: {widgetType: type}},\n );\n }\n }\n\n let widgetStatic = oldWidgetInfo.static;\n\n if (widgetStatic == null) {\n widgetStatic = DEFAULT_STATIC;\n }\n\n return {\n ...oldWidgetInfo,\n // maintain other info, like type\n // After upgrading we guarantee that the version is up-to-date\n version: latestVersion,\n // Default graded to true (so null/undefined becomes true):\n graded: oldWidgetInfo.graded != null ? oldWidgetInfo.graded : true,\n alignment: alignment,\n static: widgetStatic,\n options: newEditorOptions,\n } as any;\n};\n\nexport function getUpgradedWidgetOptions(\n oldWidgetOptions: PerseusWidgetsMap,\n): PerseusWidgetsMap {\n return mapObject(oldWidgetOptions, (widgetInfo, widgetId) => {\n if (!widgetInfo.type || !widgetInfo.alignment) {\n const newValues: Record<string, any> = {};\n\n if (!widgetInfo.type) {\n // TODO: why does widget have no type?\n // We don't want to derive type from widget ID\n // see: LEMS-1845\n newValues.type = widgetId.split(\" \")[0];\n }\n\n if (!widgetInfo.alignment) {\n newValues.alignment = \"default\";\n }\n\n widgetInfo = {...widgetInfo, ...newValues};\n }\n\n return upgradeWidgetInfoToLatestVersion(widgetInfo) as any;\n });\n}\n","import _ from \"underscore\";\n\nimport {getPublicWidgetOptionsFunction} from \"../widgets/core-widget-registry\";\nimport {getUpgradedWidgetOptions} from \"../widgets/upgrade\";\n\nimport type {PerseusRenderer} from \"../data-schema\";\n\n/**\n * Upgrades widget options and removes answerful data for all the widgets in a\n * Perseus item.\n */\nexport default function splitPerseusItem(\n originalItem: PerseusRenderer,\n): PerseusRenderer {\n const item = _.clone(originalItem);\n const originalWidgets = item.widgets ?? {};\n\n const upgradedWidgets = getUpgradedWidgetOptions(originalWidgets);\n const splitWidgets = {};\n\n for (const [id, widget] of Object.entries(upgradedWidgets)) {\n const publicWidgetOptionsFun = getPublicWidgetOptionsFunction(\n widget.type,\n );\n\n splitWidgets[id] = {\n ...widget,\n options: publicWidgetOptionsFun(widget.options as any),\n };\n }\n\n return {\n ...item,\n widgets: splitWidgets,\n };\n}\n","/* Note(tamara): Brought over from the perseus package packages/perseus/src/util.ts file.\n May be useful to bring other perseus package utilities here. Contains utility functions\n and types used across multiple widgets for randomization and shuffling. */\n\nimport _ from \"underscore\";\n\ntype RNG = () => number;\n\nexport const seededRNG: (seed: number) => RNG = function (seed: number): RNG {\n let randomSeed = seed;\n\n return function () {\n // Robert Jenkins' 32 bit integer hash function.\n let seed = randomSeed;\n seed = (seed + 0x7ed55d16 + (seed << 12)) & 0xffffffff;\n seed = (seed ^ 0xc761c23c ^ (seed >>> 19)) & 0xffffffff;\n seed = (seed + 0x165667b1 + (seed << 5)) & 0xffffffff;\n seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;\n seed = (seed + 0xfd7046c5 + (seed << 3)) & 0xffffffff;\n seed = (seed ^ 0xb55a4f09 ^ (seed >>> 16)) & 0xffffffff;\n return (randomSeed = seed & 0xfffffff) / 0x10000000;\n };\n};\n\n// Shuffle an array using a given random seed or function.\n// If `ensurePermuted` is true, the input and output are guaranteed to be\n// distinct permutations.\nexport function shuffle<T>(\n array: ReadonlyArray<T>,\n randomSeed: number | RNG,\n ensurePermuted = false,\n): ReadonlyArray<T> {\n // Always return a copy of the input array\n const shuffled = _.clone(array);\n\n // Handle edge cases (input array is empty or uniform)\n if (\n !shuffled.length ||\n _.all(shuffled, function (value) {\n return _.isEqual(value, shuffled[0]);\n })\n ) {\n return shuffled;\n }\n\n let random;\n if (typeof randomSeed === \"function\") {\n random = randomSeed;\n } else {\n random = seededRNG(randomSeed);\n }\n\n do {\n // Fischer-Yates shuffle\n for (let top = shuffled.length; top > 0; top--) {\n const newEnd = Math.floor(random() * top);\n const temp = shuffled[newEnd];\n\n // @ts-expect-error - TS2542 - Index signature in type 'readonly T[]' only permits reading.\n shuffled[newEnd] = shuffled[top - 1];\n // @ts-expect-error - TS2542 - Index signature in type 'readonly T[]' only permits reading.\n shuffled[top - 1] = temp;\n }\n } while (ensurePermuted && _.isEqual(array, shuffled));\n\n return shuffled;\n}\n\nexport const random: RNG = seededRNG(new Date().getTime() & 0xffffffff);\n"],"names":["getMatrixSize","matrix","matrixSize","_","each","matrixRow","row","rowWidth","matrixCol","col","toString","length","Math","max","getDecimalSeparator","locale","_match$","numberWithDecimalSeparator","match","Intl","NumberFormat","format","approximateEqual","x","y","abs","approximateDeepEqual","Array","isArray","i","all","v","k","addWidget","id","getWidgetRegex","getWidgetIdsFromContent","content","widgets","localWidgetRegex","exec","push","getWidgetIdsFromContentByType","type","widgetMap","rv","widgetIdsInContent","forEach","widgetId","widget","deepClone","obj","map","MOVABLES","PLOT","PARABOLA","SINUSOID","canonicalSineCoefficients","coeffs","amplitude","angularFrequency","phase","verticalOffset","period","PI","canonicalTangentCoefficients","PlotDefaults","areEqual","coeffs1","coeffs2","movable","getPropsForCoeffs","fn","partial","getFunctionForCoeffs","Linear","extend","url","defaultCoords","getCoefficients","coords","p1","p2","denom","num","m","b","getEquationString","toFixed","Quadratic","h","a","c","Sinusoid","d","sin","Tangent","tan","Exponential","defaultAsymptote","extraCoordConstraint","newCoord","oldCoord","asymptote","graph","coord","extraAsymptoteConstraint","isValid","oldY","wasBelow","bottomMost","min","snapStep","topMost","allowReflectOverAsymptote","log","exp","Logarithm","oldX","wasLeft","leftMost","rightMost","flip","inverseCoeffs","AbsoluteValue","horizontalOffset","functionTypeMapping","linear","quadratic","sinusoid","tangent","exponential","logarithm","absolute_value","allTypes","keys","functionForType","isRealJSONParse","jsonParse","randomPhrase","buildRandomPhrase","randomHintPhrase","randomString","buildRandomString","testingObject","JSON","stringify","answerArea","calculator","chi2Table","financialCalculatorMonthlyPayment","financialCalculatorTimeToPayOff","financialCalculatorTotalAmount","periodicTable","periodicTableWithKey","tTable","zTable","hints","floor","random","itemDataVersion","major","minor","question","images","expression1","alignment","graded","options","answerForms","considered","form","key","simplify","value","ariaLabel","buttonSets","functions","static","times","visibleLabel","version","testJSON","buildTestData","replace","parsedTestJSON","parsedTestItemData","data","assessmentItem","item","itemData","capitalize","randomLength","randomLetter","String","fromCharCode","toUpperCase","phrases","modifierStart","modifierEnd","modifierIndex","join","testObject","success","failure","detail","isFailure","result","isSuccess","results","combineFailureDetails","values","failureDetails","reduce","ErrorTrackingParseContext","constructor","path","expected","badValue","wrapInArray","forSubtree","formatPath","formatPathSegment","segment","validIdentifier","test","message","conjoin","items","allButLast","slice","last","parse","parser","any","rawValue","ctx","array","elementParser","elementResults","elem","Result","concat","boolean","constant","acceptedValue","enumeration","acceptedValues","index","indexOf","isObject","Object","getPrototypeOf","prototype","nullable","parseValue","number","object","schema","ret","_extends","mismatches","prop","propParser","entries","undefined","optional","pair","parseA","parseB","rawA","rawB","resultA","resultB","pipeParsers","p","ParserPipeline","then","nextParser","composeParsers","parserA","parserB","partialResult","record","parseKey","entryCtx","keyResult","valueResult","string","trio","parseC","resultC","union","parseBranch","UnionBuilder","or","newBranch","either","defaulted","fallback","parseImages","width","height","parseWidget","parseType","parseOptions","parseWidgetWithVersion","parseVersion","parseCategorizerWidget","categories","randomizeItems","highlightLint","linterContext","contentType","paths","stack","parseCSProgramWidget","programID","programType","settings","name","showEditor","showButtons","parseDefinitionWidget","togglePrompt","definition","parseDropdownWidget","placeholder","choices","correct","parseExplanationWidget","showPrompt","hidePrompt","explanation","rawVal","parseWidgetsMap","KeypadKeys","deriveExtraKeys","widgetOptions","extraKeys","defaultKeys","uniqueExtraVariables","uniqueExtraConstants","answerForm","maybeExpr","KAS","parsed","expr","isGreek","symbol","toKey","isKey","includes","variable","getVars","maybeKey","getConsts","extraVariables","sort","extraConstants","convert","f","parseLegacyButtonSet","parseLegacyButtonSets","versionedWidgetOptions","latestMajorVersion","parseLatest","VersionedWidgetOptionsParserBuilder","latest","raw","majorVersion","parseThisVersion","migrateToLatest","parseOtherVersions","parseThisVersionAndMigrateToLatest","versionParseResult","parseVersionedObject","withMigrationFrom","parseOldVersion","migrateToNextVersion","old","stringOrNumberOrNullOrUndefined","parsePossiblyInvalidAnswerForm","removeInvalidAnswerForms","possiblyInvalid","valid","version2","parseExpressionWidgetV2","buttonsVisible","version1","parseExpressionWidgetV1","migrateV1ToV2","version0","parseExpressionWidgetV0","migrateV0ToV1","parseExpressionWidget","falseToNull","parseGradedGroupWidgetOptions","title","hasHint","hint","parsePerseusRenderer","widgetEnabled","immutableWidgets","parseGradedGroupWidget","parseGradedGroupSetWidget","gradedGroups","discriminatedUnionOn","discriminantKey","noMoreBranches","DiscriminatedUnionBuilder","withBranch","discriminantValue","parseNewVariant","parseNewBranch","discriminatedUnionBranch","parseVariant","parseOtherBranches","pairOfNumbers","pairOfPoints","parseGrapherWidget","availableTypes","backgroundImage","bottom","left","scale","box","editableSettings","gridStep","labels","markings","range","rulerLabel","rulerTicks","showProtractor","showRuler","showTooltips","step","parseGroupWidget","parseIframeWidget","allowFullScreen","allowTopNavigation","stringToNumber","parsedNumber","isNaN","emptyToZero","imageDimensionToNumber","dimensionOrUndefined","parsePerseusImageBackground","top","parseImageWidget","caption","alt","coordinates","booleanToString","parseInputNumberWidget","answerType","inexact","maxError","rightAlign","size","customKeypad","stringOrEmpty","parseFunctionElement","funcName","rangeMin","rangeMax","color","strokeDasharray","strokeWidth","parseLabelElement","label","coordX","coordY","parseLineElement","startX","startY","endX","endY","arrows","parseMovableLineElement","startSubscript","endSubscript","constraint","snap","constraintFn","constraintXMin","constraintXMax","constraintYMin","constraintYMax","parseMovablePointElement","varSubscript","parseParametricElement","parsePointElement","parseRectangleElement","parseInteractionWidget","tickStep","elements","ItemExtras","PerseusExpressionAnswerFormConsidered","lockedFigureColorNames","lockedFigureColors","blue","green","grayH","purple","pink","red","orange","lockedFigureFillStyles","none","white","translucent","solid","plotterPlotTypes","parsePerseusGraphTypeAngle","showAngles","allowReflexAngles","angleOffsetDeg","snapDegrees","startCoords","parsePerseusGraphTypeCircle","center","radius","parsePerseusGraphTypeLinear","parsePerseusGraphTypeLinearSystem","parsePerseusGraphTypeNone","parsePerseusGraphTypePoint","numPoints","parsePerseusGraphTypePolygon","numSides","showSides","snapTo","parsePerseusGraphTypeQuadratic","parsePerseusGraphTypeRay","parsePerseusGraphTypeSegment","numSegments","parsePerseusGraphTypeSinusoid","parsePerseusGraphType","parseLockedFigureColor","parseLockedFigureFillType","parseLockedLineStyle","parseLockedLabelType","text","parseLockedPointType","filled","parseLockedLineType","kind","points","lineStyle","showPoint1","showPoint2","parseLockedVectorType","parseLockedEllipseType","angle","fillStyle","strokeStyle","parseLockedPolygonType","showVertices","parseLockedFunctionDomain","Infinity","parseLockedFunctionType","equation","directionalAxis","domain","parseLockedFigure","parseInteractiveGraphWidget","lockedFigures","fullGraphLabel","fullGraphAriaDescription","parseLabelImageWidget","imageUrl","imageAlt","imageHeight","imageWidth","markers","answers","hideChoicesFromInstructions","multipleAnswers","parseMatcherWidget","right","orderMatters","padding","numberOrString","numeric","NaN","parseMatrixWidget","prefix","suffix","cursorPosition","matrixBoardSize","parseMeasurerWidget","image","rulerPixels","rulerLength","parseMoleculeRendererWidget","rotationAngle","smiles","emptyStringToNull","parseNumberLineWidget","labelRange","labelStyle","labelTicks","isTickCtrl","divisionRange","numDivisions","snapDivisions","correctRel","correctX","initialX","parseMathFormat","parseSimplify","parseNumericInputWidget","status","strict","labelText","coefficient","parseRenderer","largeToAuto","parseOrdererWidget","correctOptions","otherOptions","layout","parsePassageRefWidget","passageNumber","referenceNumber","summaryText","parsePassageWidget","footnotes","passageText","passageTitle","showLineNumbers","parsePhetSimulationWidget","description","parsePlotterWidget","maxY","scaleY","labelInterval","snapsPerLine","starting","picUrl","picSize","picBoxHeight","plotDimensions","parsePythonProgramWidget","currentVersion","deriveNumCorrect","numCorrect","filter","widgetOptionsUpgrades","v1props","upgraded","v0props","noneOfTheAbove","rest","_objectWithoutPropertiesLoose","_excluded","Error","hasNoneOfTheAbove","defaultWidgetOptions","displayCount","randomize","multipleSelect","countChoices","deselectEnabled","parseRadioWidgetV2","clue","isNoneOfTheAbove","onePerLine","parseRadioWidgetV1","parseRadioWidgetV0","parseRadioWidget","parseSorterWidget","parseTableWidget","headers","rows","columns","parseVideoWidget","location","widgetsMap","entryResult","parseWidgetsMapEntry","idComponentsResult","parseWidgetIdComponents","split","n","parseAndAssign","widgetResult","parseDeprecatedWidget","parseStringToNonNegativeInt","metadata","parsePerseusArticle","parseHint","parsePerseusAnswerArea","toAnswerArea","parsePerseusItem","answer","json","parseAndMigratePerseusItem","throwErrorIfCheatingDetected","migrateAndTypecheckPerseusItem","invalidObject","parseAndMigratePerseusArticle","migrateAndTypecheckPerseusArticle","addLibraryVersionToPerseusDebug","libraryName","libraryVersion","formattedVersion","globalThis","_globalThis$__perseus","__perseus_debug__","existingVersionEntry","allVersions","console","warn","libName","libVersion","Errors","freeze","Unknown","Internal","InvalidInput","NotAllowed","TransientService","Service","PerseusError","pluck","table","subKey","mapObject","lambda","getCategorizerPublicWidgetOptions","categorizerWidgetLogic","getPublicWidgetOptions","getCSProgramPublicWidgetOptions","DEFAULT_HEIGHT","csProgramWidgetLogic","supportedAlignments","definitionWidgetLogic","defaultAlignment","getDropdownPublicWidgetOptions","choice","dropdownWidgetLogic","explanationWidgetLogic","v1options","v0options","getExpressionPublicWidgetOptions","expressionWidgetLogic","gradedGroupWidgetLogic","gradedGroupSetWidgetLogic","getGrapherPublicWidgetOptions","publicOptions","grapherWidgetLogic","groupWidgetLogic","getIFramePublicWidgetOptions","iframeWidgetLogic","imageWidgetLogic","inputNumberWidgetLogic","interactionWidgetLogic","getInteractiveGraphPublicWidgetOptions","interactiveGraphWidgetLogic","getLabelImagePublicWidgetOptions","getLabelImageMarkerPublicData","marker","publicData","labelImageWidgetLogic","shuffleMatcher","props","rng","seededRNG","problemNum","shuffle","shuffleMatcherWithRandom","getMatcherPublicWidgetOptions","matcherWidgetLogic","getMatrixPublicWidgetOptions","matrixWidgetLogic","imageTop","imageLeft","measurerWidgetLogic","getNumberLinePublicWidgetOptions","numberLineWidgetLogic","getNumericInputAnswerPublicData","getNumericInputPublicWidgetOptions","publicWidgetOptions","numericInputWidgetLogic","getOrdererPublicWidgetOptions","ordererWidgetLogic","passageWidgetLogic","passageRefWidgetLogic","passageRefTargetWidgetLogic","phetSimulationWidgetLogic","getPlotterPublicWidgetOptions","plotterWidgetLogic","pythonProgramWidgetLogic","getRadioChoicePublicData","usesNumCorrect","getRadioPublicWidgetOptions","radioWidgetLogic","getSorterPublicWidgetOptions","shuffledCorrect","isCorrectShuffled","sorterWidgetLogic","getTablePublicWidgetOptions","defaultRows","defaultColumns","fill","tableWidgetLogic","videoWidgetLogic","registerWidget","logic","isWidgetRegistered","widgetLogic","getCurrentVersion","getPublicWidgetOptionsFunction","_widgets$name$getPubl","_widgets$name","getWidgetOptionsUpgrades","getDefaultWidgetOptions","getSupportedAlignments","_widgetLogic$supporte","getDefaultAlignment","DEFAULT_STATIC","upgradeWidgetInfoToLatestVersion","oldWidgetInfo","isString","initialVersion","latestVersion","newEditorOptions","clone","upgradePropsMap","nextVersion","fromMajorVersion","toMajorVersion","defaultOptions","_getSupportedAlignmen","widgetType","widgetStatic","getUpgradedWidgetOptions","oldWidgetOptions","widgetInfo","newValues","splitPerseusItem","originalItem","_item$widgets","originalWidgets","upgradedWidgets","splitWidgets","publicWidgetOptionsFun","seed","randomSeed","ensurePermuted","shuffled","isEqual","newEnd","temp","Date","getTime"],"mappings":";;;;;;AAEA,SAASA,aAAaA,CAACC,MAA4C,EAAE;AACjE,EAAA,MAAMC,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;;AAEzB;AACA;EACAC,CAAC,CAACF,MAAM,CAAC,CAACG,IAAI,CAAC,CAACC,SAAS,EAAEC,GAAG,KAAK;IAC/B,IAAIC,QAAQ,GAAG,CAAC,CAAA;IAChBJ,CAAC,CAACE,SAAS,CAAC,CAACD,IAAI,CAAC,CAACI,SAAS,EAAEC,GAAG,KAAK;MAClC,IAAID,SAAS,IAAI,IAAI,IAAIA,SAAS,CAACE,QAAQ,EAAE,CAACC,MAAM,EAAE;QAClDJ,QAAQ,GAAGE,GAAG,GAAG,CAAC,CAAA;AACtB,OAAA;AACJ,KAAC,CAAC,CAAA;;AAEF;AACAP,IAAAA,UAAU,CAAC,CAAC,CAAC,GAAGU,IAAI,CAACC,GAAG,CAACX,UAAU,CAAC,CAAC,CAAC,EAAEK,QAAQ,CAAC,CAAA;;AAEjD;IACA,IAAIA,QAAQ,GAAG,CA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AO,EACP,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK;AAAE;AACP,gBAAgB;AAAE;AAClB,gBAAgB;AAAE;AAClB,MAAM,EACN,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,WAAW,EACX,SAAS,EACT,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EACL,KAAK;AAAE;AACP,KAAK,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,WAAW,EACX,SAAS,EACT,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB;AAAE;AACxB,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,EACH,GAAG,CACG,CAAA;;AAaV;;AChHA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CACpBC,aAA6C,EACb;EAChC,IAAIA,aAAa,CAACC,SA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AAEtK,QAAQ,CAACsB,MAAM,CAAC;AAC5BiJ,IAAAA,UAAU,EAAEvK,QAAQ,CAACV,MAAM,CAAC;AAC5BgP,IAAAA,QAAQ,EAAE9E,eAAAA;AACd,GAAC,CAAC;AACF+E,EAAAA,QAAQ,EAAEpQ,KAAK,CACX0K,oBAAoB,CAAC,MAAM,CAAC,CACvBI,UAAU,CAAC,UAAU,EAAEoD,oBAAoB,CAAC,CAC5CpD,UAAU,CAAC,OAAO,EAAE2D,iBAAiB,CAAC,CACtC3D,UAAU,CAAC,MAAM,EAAE+D,gBAAgB,CAAC,CACpC/D,UAAU,CAAC,cAAc,EAAEqE,uBAAuB,CAAC,CACnDrE,UAAU,CAAC,eAAe,EAAE+E,wBAAwB,CAAC,CACrD/E,UAAU,CAAC,YAAY,EAAEiF,sBAAsB,CAAC,CAChDjF,UAAU,CAAC,OAAO,EAAEkF,iBAAiB,CAAC,CACtClF,UAAU,CAAC,WAAW,EAAEmF,qBAAqB,CAAC,CAACrQ,MACxD,CAAA;AACJ,CAAC,CACL,CAAC;;ACjMD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAI6B;;AAM7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2CA;AACA;AACA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