@m2c2kit/assessment-color-shapes 0.8.33 → 0.8.35
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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3217 -2054
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +18 -18
- package/schemas.json +247 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../data-calc/dist/index.js","../src/index.ts"],"sourcesContent":["class M2Error extends Error {\n constructor(...params) {\n super(...params);\n this.name = \"M2Error\";\n Object.setPrototypeOf(this, M2Error.prototype);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, M2Error);\n }\n }\n}\n\nclass DataCalc {\n /**\n * A class for transformation and calculation of m2c2kit data.\n *\n * @remarks The purpose is to provide a simple and intuitive interface for\n * assessments to score and summarize their own data. It is not meant for\n * data analysis or statistical modeling. The idiomatic approach is based on the\n * dplyr R package.\n *\n * @param data - An array of observations, where each observation is a set of\n * key-value pairs of variable names and values.\n * @param options - Options, such as groups to group the data by\n * @example\n * ```js\n * const dc = new DataCalc(gameData.trials);\n * const mean_response_time_correct_trials = dc\n * .filter((obs) => obs.correct_response_index === obs.user_response_index)\n * .summarize({ mean_rt: mean(\"response_time_duration_ms\") })\n * .pull(\"mean_rt\");\n * ```\n */\n constructor(data, options) {\n this._groups = new Array();\n if (!Array.isArray(data)) {\n throw new M2Error(\n \"DataCalc constructor expects an array of observations as first argument\"\n );\n }\n for (let i = 0; i < data.length; i++) {\n if (data[i] === null || typeof data[i] !== \"object\" || Array.isArray(data[i])) {\n throw new M2Error(\n `DataCalc constructor expects all elements to be objects (observations). Element at index ${i} is ${typeof data[i]}. Element: ${JSON.stringify(data[i])}`\n );\n }\n }\n this._observations = this.deepCopy(data);\n const allVariables = /* @__PURE__ */ new Set();\n for (const observation of data) {\n for (const key of Object.keys(observation)) {\n allVariables.add(key);\n }\n }\n for (const observation of this._observations) {\n for (const variable of allVariables) {\n if (!(variable in observation)) {\n observation[variable] = null;\n }\n }\n }\n if (options?.groups) {\n this._groups = Array.from(options.groups);\n }\n }\n /**\n * Returns the groups in the data.\n */\n get groups() {\n return this._groups;\n }\n /**\n * Returns the observations in the data.\n *\n * @remarks An observation is conceptually similar to a row in a dataset,\n * where the keys are the variable names and the values are the variable values.\n */\n get observations() {\n return this._observations;\n }\n /**\n * Alias for the observations property.\n */\n get rows() {\n return this._observations;\n }\n /**\n * Returns a single variable from the data.\n *\n * @remarks If the variable length is 1, the value is returned. If the\n * variable has length > 1, an array of values is returned. If an empty\n * dataset is provided, `null` is returned and a warning is logged.\n *\n * @param variable - Name of variable to pull from the data\n * @returns the value of the variable\n *\n * @example\n * ```js\n * const d = [{ a: 1, b: 2, c: 3 }];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.pull(\"c\")\n * ); // 3\n * ```\n */\n pull(variable) {\n if (this._observations.length === 0) {\n console.warn(\n `DataCalc.pull(): No observations available to pull variable \"${variable}\" from. Returning null.`\n );\n return null;\n }\n this.verifyObservationsContainVariable(variable);\n const values = this._observations.map((o) => o[variable]);\n if (values.length === 1) {\n return values[0];\n }\n return values;\n }\n /**\n * Returns the number of observations in the data.\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 }\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.length\n * ); // 2\n * ```\n */\n get length() {\n return this._observations.length;\n }\n /**\n * Filters observations based on a predicate function.\n *\n * @param predicate - A function that returns true for observations to keep and\n * false for observations to discard\n * @returns A new `DataCalc` object with only the observations that pass the\n * predicate function\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(dc.filter((obs) => obs.b >= 3).observations);\n * // [ { a: 0, b: 8, c: 3 }, { a: 9, b: 4, c: 7 } ]\n * ```\n */\n filter(predicate) {\n if (this._groups.length > 0) {\n throw new M2Error(\n `filter() cannot be used on grouped data. The data are currently grouped by ${this._groups.join(\n \", \"\n )}. Ungroup the data first using ungroup().`\n );\n }\n return new DataCalc(\n this._observations.filter(\n predicate\n ),\n { groups: this._groups }\n );\n }\n /**\n * Groups observations by one or more variables.\n *\n * @remarks This is used with the `summarize()` method to calculate summaries\n * by group.\n *\n * @param groups - variable names to group by\n * @returns A new `DataCalc` object with the observations grouped by one or\n * more variables\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * { a: 5, b: 0, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * const grouped = dc.groupBy(\"c\");\n * // subsequent summarize operations will be performed separately by\n * // each unique level of c, in this case, 3 and 7\n * ```\n */\n groupBy(...groups) {\n groups.forEach((group) => {\n this.verifyObservationsContainVariable(group);\n });\n return new DataCalc(this._observations, { groups });\n }\n /**\n * Ungroups observations.\n *\n * @returns A new DataCalc object with the observations ungrouped\n */\n ungroup() {\n return new DataCalc(this._observations);\n }\n /**\n * Adds new variables to the observations based on the provided mutation options.\n *\n * @param mutations - An object where the keys are the names of the new variables\n * and the values are functions that take an observation and return the value\n * for the new variable.\n * @returns A new DataCalc object with the new variables added to the observations.\n *\n * @example\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.mutate({ doubledA: (obs) => obs.a * 2 }).observations\n * );\n * // [ { a: 1, b: 2, c: 3, doubledA: 2 },\n * // { a: 0, b: 8, c: 3, doubledA: 0 },\n * // { a: 9, b: 4, c: 7, doubledA: 18 } ]\n */\n mutate(mutations) {\n if (this._groups.length > 0) {\n throw new M2Error(\n `mutate() cannot be used on grouped data. The data are currently grouped by ${this._groups.join(\n \", \"\n )}. Ungroup the data first using ungroup().`\n );\n }\n const newObservations = this._observations.map((observation) => {\n let newObservation = { ...observation };\n for (const [newVariable, transformFunction] of Object.entries(\n mutations\n )) {\n newObservation = {\n ...newObservation,\n [newVariable]: transformFunction(observation)\n };\n }\n return newObservation;\n });\n return new DataCalc(newObservations, { groups: this._groups });\n }\n /**\n * Calculates summaries of the data.\n *\n * @param summarizations - An object where the keys are the names of the new\n * variables and the values are `DataCalc` summary functions: `sum()`,\n * `mean()`, `median()`, `variance()`, `sd()`, `min()`, `max()`, or `n()`.\n * The summary functions take a variable name as a string, or alternatively,\n * a value or array of values to summarize.\n * @returns A new `DataCalc` object with the new summary variables.\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * { a: 5, b: 0, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.summarize({\n * meanA: mean(\"a\"),\n * varA: variance(\"a\"),\n * totalB: sum(\"b\")\n * }).observations\n * );\n * // [ { meanA: 3.75, varA: 16.916666666666668, totalB: 14 } ]\n *\n * console.log(\n * dc.summarize({\n * filteredTotalC: sum(dc.filter(obs => obs.b > 2).pull(\"c\"))\n * }).observations\n * );\n * // [ { filteredTotalC: 10 } ]\n * ```\n */\n summarize(summarizations) {\n if (this._groups.length === 0) {\n const obs = {};\n for (const [newVariable, value] of Object.entries(summarizations)) {\n if (typeof value === \"object\" && value !== null && \"summarizeFunction\" in value) {\n const summarizeOperation = value;\n obs[newVariable] = summarizeOperation.summarizeFunction(\n this,\n summarizeOperation.parameters,\n summarizeOperation.options\n );\n } else {\n obs[newVariable] = value;\n }\n }\n return new DataCalc([obs], { groups: this._groups });\n }\n return this.summarizeByGroups(summarizations);\n }\n summarizeByGroups(summarizations) {\n const groupMap = /* @__PURE__ */ new Map();\n this._observations.forEach((obs) => {\n const groupKey = this._groups.map(\n (g) => typeof obs[g] === \"object\" ? JSON.stringify(obs[g]) : obs[g]\n ).join(\"|\");\n if (!groupMap.has(groupKey)) {\n groupMap.set(groupKey, []);\n }\n const groupArray = groupMap.get(groupKey);\n if (groupArray) {\n groupArray.push(obs);\n } else {\n groupMap.set(groupKey, [obs]);\n }\n });\n const summarizedObservations = [];\n groupMap.forEach((groupObs, groupKey) => {\n const groupValues = groupKey.split(\"|\");\n const firstObs = groupObs[0];\n const summaryObj = {};\n this._groups.forEach((group, i) => {\n const valueStr = groupValues[i];\n const originalType = typeof firstObs[group];\n if (originalType === \"number\") {\n summaryObj[group] = Number(valueStr);\n } else if (originalType === \"boolean\") {\n summaryObj[group] = valueStr === \"true\";\n } else if (valueStr.startsWith(\"{\") || valueStr.startsWith(\"[\")) {\n try {\n summaryObj[group] = JSON.parse(valueStr);\n } catch {\n throw new M2Error(\n `Failed to parse group value ${valueStr} as JSON for group ${group}`\n );\n }\n } else {\n summaryObj[group] = valueStr;\n }\n });\n const groupDataCalc = new DataCalc(groupObs);\n for (const [newVariable, value] of Object.entries(summarizations)) {\n if (typeof value === \"object\" && value !== null && \"summarizeFunction\" in value) {\n const summarizeOperation = value;\n summaryObj[newVariable] = summarizeOperation.summarizeFunction(\n groupDataCalc,\n summarizeOperation.parameters,\n summarizeOperation.options\n );\n } else {\n summaryObj[newVariable] = value;\n }\n }\n summarizedObservations.push(summaryObj);\n });\n return new DataCalc(summarizedObservations, { groups: this._groups });\n }\n /**\n * Selects specific variables to keep in the dataset.\n * Variables prefixed with \"-\" will be excluded from the result.\n *\n * @param variables - Names of variables to select; prefix with '-' to exclude instead\n * @returns A new DataCalc object with only the selected variables (minus excluded ones)\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3, d: 4 },\n * { a: 5, b: 6, c: 7, d: 8 }\n * ];\n * const dc = new DataCalc(d);\n * // Keep a and c\n * console.log(dc.select(\"a\", \"c\").observations);\n * // [ { a: 1, c: 3 }, { a: 5, c: 7 } ]\n * ```\n */\n select(...variables) {\n const includeVars = [];\n const excludeVars = [];\n variables.forEach((variable) => {\n if (variable.startsWith(\"-\")) {\n excludeVars.push(variable.substring(1));\n } else {\n includeVars.push(variable);\n }\n });\n const allVars = includeVars.length > 0 ? includeVars : Object.keys(this._observations[0] || {});\n [...allVars, ...excludeVars].forEach((variable) => {\n this.verifyObservationsContainVariable(variable);\n });\n const excludeSet = new Set(excludeVars);\n const newObservations = this._observations.map((observation) => {\n const newObservation = {};\n if (includeVars.length > 0) {\n includeVars.forEach((variable) => {\n if (!excludeSet.has(variable)) {\n newObservation[variable] = observation[variable];\n }\n });\n } else {\n Object.keys(observation).forEach((key) => {\n if (!excludeSet.has(key)) {\n newObservation[key] = observation[key];\n }\n });\n }\n return newObservation;\n });\n return new DataCalc(newObservations, { groups: this._groups });\n }\n /**\n * Arranges (sorts) the observations based on one or more variables.\n *\n * @param variables - Names of variables to sort by, prefixed with '-' for descending order\n * @returns A new DataCalc object with the observations sorted\n *\n * @example\n * ```js\n * const d = [\n * { a: 5, b: 2 },\n * { a: 3, b: 7 },\n * { a: 5, b: 1 }\n * ];\n * const dc = new DataCalc(d);\n * // Sort by a (ascending), then by b (descending)\n * console.log(dc.arrange(\"a\", \"-b\").observations);\n * // [ { a: 3, b: 7 }, { a: 5, b: 2 }, { a: 5, b: 1 } ]\n * ```\n */\n arrange(...variables) {\n if (this._groups.length > 0) {\n throw new M2Error(\n `arrange() cannot be used on grouped data. The data are currently grouped by ${this._groups.join(\n \", \"\n )}. Ungroup the data first using ungroup().`\n );\n }\n const sortedObservations = [...this._observations].sort((a, b) => {\n for (const variable of variables) {\n let varName = variable;\n let direction = 1;\n if (variable.startsWith(\"-\")) {\n varName = variable.substring(1);\n direction = -1;\n }\n if (!(varName in a) || !(varName in b)) {\n throw new M2Error(\n `arrange(): variable ${varName} does not exist in all observations`\n );\n }\n const aVal = a[varName];\n const bVal = b[varName];\n if (typeof aVal !== typeof bVal) {\n return direction * (String(aVal) < String(bVal) ? -1 : 1);\n }\n if (aVal < bVal) return -1 * direction;\n if (aVal > bVal) return 1 * direction;\n }\n return 0;\n });\n return new DataCalc(sortedObservations, { groups: this._groups });\n }\n /**\n * Keeps only unique/distinct observations.\n *\n * @returns A new `DataCalc` object with only unique observations\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 1, b: 2, c: 3 }, // Duplicate\n * { a: 2, b: 3, c: 5 },\n * { a: 1, b: 2, c: { name: \"dog\" } },\n * { a: 1, b: 2, c: { name: \"dog\" } } // Duplicate with nested object\n * ];\n * const dc = new DataCalc(d);\n * console.log(dc.distinct().observations);\n * // [ { a: 1, b: 2, c: 3 }, { a: 2, b: 3, c: 5 }, { a: 1, b: 2, c: { name: \"dog\" } } ]\n * ```\n */\n distinct() {\n const seen = /* @__PURE__ */ new Set();\n const uniqueObs = this._observations.filter((obs) => {\n const key = JSON.stringify(this.normalizeForComparison(obs));\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n return new DataCalc(uniqueObs, { groups: this._groups });\n }\n /**\n * Renames variables in the observations.\n *\n * @param renames - Object mapping new variable names to old variable names\n * @returns A new DataCalc object with renamed variables\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 4, b: 5, c: 6 }\n * ];\n * const dc = new DataCalc(d);\n * console.log(dc.rename({ x: 'a', z: 'c' }).observations);\n * // [ { x: 1, b: 2, z: 3 }, { x: 4, b: 5, z: 6 } ]\n * ```\n */\n rename(renames) {\n if (this._observations.length === 0) {\n throw new M2Error(\"Cannot rename variables on an empty dataset\");\n }\n Object.values(renames).forEach((oldName) => {\n this.verifyObservationsContainVariable(oldName);\n });\n const newObservations = this._observations.map((observation) => {\n const newObservation = {};\n for (const [key, value] of Object.entries(observation)) {\n const newKey = Object.entries(renames).find(\n ([, old]) => old === key\n )?.[0];\n if (newKey) {\n newObservation[newKey] = value;\n } else if (!Object.values(renames).includes(key)) {\n newObservation[key] = value;\n }\n }\n return newObservation;\n });\n return new DataCalc(newObservations, { groups: this._groups });\n }\n /**\n * Performs an inner join with another DataCalc object.\n * Only rows with matching keys in both datasets are included.\n *\n * @param other - The other DataCalc object to join with\n * @param by - The variables to join on\n * @returns A new DataCalc object with joined observations\n *\n * @example\n * ```js\n * const d1 = [\n * { id: 1, x: 'a' },\n * { id: 2, x: 'b' },\n * { id: 3, x: 'c' }\n * ];\n * const d2 = [\n * { id: 1, y: 100 },\n * { id: 2, y: 200 },\n * { id: 4, y: 400 }\n * ];\n * const dc1 = new DataCalc(d1);\n * const dc2 = new DataCalc(d2);\n * console.log(dc1.innerJoin(dc2, [\"id\"]).observations);\n * // [ { id: 1, x: 'a', y: 100 }, { id: 2, x: 'b', y: 200 } ]\n * ```\n */\n innerJoin(other, by) {\n if (this._groups.length > 0 || other._groups.length > 0) {\n throw new M2Error(\n `innerJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`\n );\n }\n by.forEach((key) => {\n this.verifyObservationsContainVariable(key);\n other.verifyObservationsContainVariable(key);\n });\n const rightMap = /* @__PURE__ */ new Map();\n other.observations.forEach((obs) => {\n if (this.hasNullJoinKeys(obs, by)) {\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n const matches = rightMap.get(key) || [];\n matches.push(obs);\n rightMap.set(key, matches);\n });\n const result = [];\n this._observations.forEach((leftObs) => {\n if (this.hasNullJoinKeys(leftObs, by)) {\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n const rightMatches = rightMap.get(key) || [];\n if (rightMatches.length > 0) {\n rightMatches.forEach((rightObs) => {\n const joinedObs = { ...leftObs };\n Object.entries(rightObs).forEach(([k, v]) => {\n if (!by.includes(k)) {\n joinedObs[k] = v;\n }\n });\n result.push(joinedObs);\n });\n }\n });\n return new DataCalc(result);\n }\n /**\n * Performs a left join with another DataCalc object.\n * All rows from the left dataset are included, along with matching rows from the right.\n *\n * @param other - The other DataCalc object to join with\n * @param by - The variables to join on\n * @returns A new DataCalc object with joined observations\n *\n * @example\n * ```js\n * const d1 = [\n * { id: 1, x: 'a' },\n * { id: 2, x: 'b' },\n * { id: 3, x: 'c' }\n * ];\n * const d2 = [\n * { id: 1, y: 100 },\n * { id: 2, y: 200 }\n * ];\n * const dc1 = new DataCalc(d1);\n * const dc2 = new DataCalc(d2);\n * console.log(dc1.leftJoin(dc2, [\"id\"]).observations);\n * // [ { id: 1, x: 'a', y: 100 }, { id: 2, x: 'b', y: 200 }, { id: 3, x: 'c' } ]\n * ```\n */\n leftJoin(other, by) {\n if (this._groups.length > 0 || other._groups.length > 0) {\n throw new M2Error(\n `leftJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`\n );\n }\n by.forEach((key) => {\n this.verifyObservationsContainVariable(key);\n other.verifyObservationsContainVariable(key);\n });\n const rightMap = /* @__PURE__ */ new Map();\n other.observations.forEach((obs) => {\n if (this.hasNullJoinKeys(obs, by)) {\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n const matches = rightMap.get(key) || [];\n matches.push(obs);\n rightMap.set(key, matches);\n });\n const result = [];\n this._observations.forEach((leftObs) => {\n if (this.hasNullJoinKeys(leftObs, by)) {\n result.push({ ...leftObs });\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n const rightMatches = rightMap.get(key) || [];\n if (rightMatches.length > 0) {\n rightMatches.forEach((rightObs) => {\n const joinedObs = { ...leftObs };\n Object.entries(rightObs).forEach(([k, v]) => {\n if (!by.includes(k)) {\n joinedObs[k] = v;\n }\n });\n result.push(joinedObs);\n });\n } else {\n result.push({ ...leftObs });\n }\n });\n return new DataCalc(result);\n }\n /**\n * Performs a right join with another DataCalc object.\n * All rows from the right dataset are included, along with matching rows from the left.\n *\n * @param other - The other DataCalc object to join with\n * @param by - The variables to join on\n * @returns A new DataCalc object with joined observations\n *\n * @example\n * ```js\n * const d1 = [\n * { id: 1, x: 'a' },\n * { id: 2, x: 'b' }\n * ];\n * const d2 = [\n * { id: 1, y: 100 },\n * { id: 2, y: 200 },\n * { id: 4, y: 400 }\n * ];\n * const dc1 = new DataCalc(d1);\n * const dc2 = new DataCalc(d2);\n * console.log(dc1.rightJoin(dc2, [\"id\"]).observations);\n * // [ { id: 1, x: 'a', y: 100 }, { id: 2, x: 'b', y: 200 }, { id: 4, y: 400 } ]\n * ```\n */\n rightJoin(other, by) {\n if (this._groups.length > 0 || other._groups.length > 0) {\n throw new M2Error(\n `rightJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`\n );\n }\n by.forEach((key) => {\n this.verifyObservationsContainVariable(key);\n other.verifyObservationsContainVariable(key);\n });\n const rightMap = /* @__PURE__ */ new Map();\n other.observations.forEach((obs) => {\n if (this.hasNullJoinKeys(obs, by)) {\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n const matches = rightMap.get(key) || [];\n matches.push(obs);\n rightMap.set(key, matches);\n });\n const result = [];\n const processedRightKeys = /* @__PURE__ */ new Set();\n this._observations.forEach((leftObs) => {\n if (this.hasNullJoinKeys(leftObs, by)) {\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n const rightMatches = rightMap.get(key) || [];\n if (rightMatches.length > 0) {\n rightMatches.forEach((rightObs) => {\n const joinedObs = { ...leftObs };\n Object.entries(rightObs).forEach(([k, v]) => {\n if (!by.includes(k)) {\n joinedObs[k] = v;\n }\n });\n result.push(joinedObs);\n });\n processedRightKeys.add(key);\n }\n });\n other.observations.forEach((rightObs) => {\n if (this.hasNullJoinKeys(rightObs, by)) {\n result.push({ ...rightObs });\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(rightObs[k]))).join(\"|\");\n if (!processedRightKeys.has(key)) {\n result.push({ ...rightObs });\n processedRightKeys.add(key);\n }\n });\n return new DataCalc(result);\n }\n /**\n * Performs a full join with another DataCalc object.\n * All rows from both datasets are included.\n *\n * @param other - The other DataCalc object to join with\n * @param by - The variables to join on\n * @returns A new DataCalc object with joined observations\n *\n * @example\n * ```js\n * const d1 = [\n * { id: 1, x: 'a' },\n * { id: 2, x: 'b' },\n * { id: 3, x: 'c' }\n * ];\n * const d2 = [\n * { id: 1, y: 100 },\n * { id: 2, y: 200 },\n * { id: 4, y: 400 }\n * ];\n * const dc1 = new DataCalc(d1);\n * const dc2 = new DataCalc(d2);\n * console.log(dc1.fullJoin(dc2, [\"id\"]).observations);\n * // [\n * // { id: 1, x: 'a', y: 100 },\n * // { id: 2, x: 'b', y: 200 },\n * // { id: 3, x: 'c' },\n * // { id: 4, y: 400 }\n * // ]\n * ```\n */\n fullJoin(other, by) {\n if (this._groups.length > 0 || other._groups.length > 0) {\n throw new M2Error(\n `fullJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`\n );\n }\n by.forEach((key) => {\n this.verifyObservationsContainVariable(key);\n other.verifyObservationsContainVariable(key);\n });\n const rightMap = /* @__PURE__ */ new Map();\n other.observations.forEach((obs) => {\n if (this.hasNullJoinKeys(obs, by)) {\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n const matches = rightMap.get(key) || [];\n matches.push(obs);\n rightMap.set(key, matches);\n });\n const result = [];\n const processedRightKeys = /* @__PURE__ */ new Set();\n this._observations.forEach((leftObs) => {\n if (this.hasNullJoinKeys(leftObs, by)) {\n result.push({ ...leftObs });\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n const rightMatches = rightMap.get(key) || [];\n if (rightMatches.length > 0) {\n rightMatches.forEach((rightObs) => {\n const joinedObs = { ...leftObs };\n Object.entries(rightObs).forEach(([k, v]) => {\n if (!by.includes(k)) {\n joinedObs[k] = v;\n }\n });\n result.push(joinedObs);\n });\n processedRightKeys.add(key);\n } else {\n result.push({ ...leftObs });\n }\n });\n other.observations.forEach((rightObs) => {\n if (this.hasNullJoinKeys(rightObs, by)) {\n result.push({ ...rightObs });\n return;\n }\n const key = by.map((k) => JSON.stringify(this.normalizeForComparison(rightObs[k]))).join(\"|\");\n if (!processedRightKeys.has(key)) {\n result.push({ ...rightObs });\n processedRightKeys.add(key);\n }\n });\n return new DataCalc(result);\n }\n /**\n * Slice observations by position.\n *\n * @param start - Starting position (0-based). Negative values count from\n * the end.\n * @param end - Ending position (exclusive)\n * @returns A new DataCalc object with sliced observations\n *\n * @remarks If `end` is not provided, it will return a single observation at\n * `start` position. If `start` is beyond the length of observations,\n * it will return an empty DataCalc.\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2 },\n * { a: 3, b: 4 },\n * { a: 5, b: 6 },\n * { a: 7, b: 8 }\n * ];\n * const dc = new DataCalc(d);\n * console.log(dc.slice(1, 3).observations);\n * // [ { a: 3, b: 4 }, { a: 5, b: 6 } ]\n * console.log(dc.slice(0).observations);\n * // [ { a: 1, b: 2 } ]\n * ```\n */\n slice(start, end) {\n if (this._groups.length > 0) {\n throw new M2Error(\n `slice() cannot be used on grouped data. Ungroup the data first using ungroup().`\n );\n }\n let sliced;\n if (start >= this._observations.length) {\n return new DataCalc([], { groups: this._groups });\n }\n if (end === void 0) {\n const index = start < 0 ? this._observations.length + start : start;\n sliced = [this._observations[index]];\n } else {\n sliced = this._observations.slice(start, end);\n }\n return new DataCalc(sliced, { groups: this._groups });\n }\n /**\n * Combines observations from two DataCalc objects by rows.\n *\n * @param other - The other DataCalc object to bind with\n * @returns A new DataCalc object with combined observations\n *\n * @example\n * ```js\n * const d1 = [\n * { a: 1, b: 2 },\n * { a: 3, b: 4 }\n * ];\n * const d2 = [\n * { a: 5, b: 6 },\n * { a: 7, b: 8 }\n * ];\n * const dc1 = new DataCalc(d1);\n * const dc2 = new DataCalc(d2);\n * console.log(dc1.bindRows(dc2).observations);\n * // [ { a: 1, b: 2 }, { a: 3, b: 4 }, { a: 5, b: 6 }, { a: 7, b: 8 } ]\n * ```\n */\n bindRows(other) {\n if (this._observations.length > 0 && other.observations.length > 0) {\n const thisVariables = new Set(Object.keys(this._observations[0]));\n const otherVariables = new Set(Object.keys(other.observations[0]));\n const commonVariables = [...thisVariables].filter(\n (variable) => otherVariables.has(variable)\n );\n commonVariables.forEach((variable) => {\n const thisType = this.getVariableType(variable);\n const otherType = other.getVariableType(variable);\n if (thisType !== otherType) {\n console.warn(\n `Warning: bindRows() is combining datasets with different data types for variable '${variable}'. Left dataset has type '${thisType}' and right dataset has type '${otherType}'.`\n );\n }\n });\n }\n return new DataCalc([...this._observations, ...other.observations]);\n }\n /**\n * Helper method to determine the primary type of a variable across observations\n * @internal\n *\n * @param variable - The variable name to check\n * @returns The most common type for the variable or 'mixed' if no clear type exists\n */\n getVariableType(variable) {\n if (this._observations.length === 0) {\n return \"unknown\";\n }\n const typeCounts = {};\n this._observations.forEach((obs) => {\n if (variable in obs) {\n const value = obs[variable];\n const type = value === null ? \"null\" : Array.isArray(value) ? \"array\" : typeof value;\n typeCounts[type] = (typeCounts[type] || 0) + 1;\n }\n });\n let maxCount = 0;\n let dominantType = \"unknown\";\n for (const [type, count] of Object.entries(typeCounts)) {\n if (count > maxCount) {\n maxCount = count;\n dominantType = type;\n }\n }\n return dominantType;\n }\n /**\n * Verifies that the variable exists in each observation in the data.\n *\n * @remarks Throws an error if the variable does not exist in each\n * observation. This is not meant to be called by users of the library, but\n * is used internally.\n * @internal\n *\n * @param variable - The variable to check for\n */\n verifyObservationsContainVariable(variable) {\n if (!this._observations.every((observation) => variable in observation)) {\n throw new M2Error(\n `Variable ${variable} does not exist for each item (row) in the data array.`\n );\n }\n }\n /**\n * Checks if the variable exists for at least one observation in the data.\n *\n * @remarks This is not meant to be called by users of the library, but\n * is used internally.\n * @internal\n *\n * @param variable - The variable to check for\n * @returns true if the variable exists in at least one observation, false\n * otherwise\n */\n variableExists(variable) {\n return this._observations.some((observation) => variable in observation);\n }\n /**\n * Checks if a value is a non-missing numeric value.\n *\n * @remarks A non-missing numeric value is a value that is a number and is\n * not NaN or infinite.\n *\n * @param value - The value to check\n * @returns true if the value is a non-missing numeric value, false otherwise\n */\n isNonMissingNumeric(value) {\n return typeof value === \"number\" && !isNaN(value) && isFinite(value);\n }\n /**\n * Checks if a value is a missing numeric value.\n *\n * @remarks A missing numeric value is a number that is NaN or infinite, or any\n * value that is null or undefined. Thus, a null or undefined value is\n * considered to be a missing numeric value.\n *\n * @param value - The value to check\n * @returns true if the value is a missing numeric value, false otherwise\n */\n isMissingNumeric(value) {\n return typeof value === \"number\" && (isNaN(value) || !isFinite(value)) || value === null || typeof value === \"undefined\";\n }\n /**\n * Normalizes an object for stable comparison by sorting keys\n * @internal\n *\n * @remarks Normalizing is needed to handle situations where objects have the\n * same properties but in different orders because we are using\n * JSON.stringify() for comparison.\n */\n normalizeForComparison(obj) {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n if (Array.isArray(obj)) {\n return obj.map((item) => this.normalizeForComparison(item));\n }\n return Object.keys(obj).sort().reduce((result, key) => {\n result[key] = this.normalizeForComparison(obj[key]);\n return result;\n }, {});\n }\n /**\n * Creates a deep copy of an object.\n * @internal\n *\n * @remarks We create a deep copy of the object, in our case an instance\n * of `DataCalc`, to ensure that we are working with a new object\n * without any references to the original object. This is important\n * to avoid unintended side effects when modifying an object.\n *\n * @param source - object to copy\n * @param map - map of objects that have already been copied\n * @returns a deep copy of the object\n */\n deepCopy(source, map = /* @__PURE__ */ new WeakMap()) {\n if (source === null || typeof source !== \"object\") {\n return source;\n }\n if (map.has(source)) {\n return map.get(source);\n }\n const copy = Array.isArray(source) ? [] : Object.create(Object.getPrototypeOf(source));\n map.set(source, copy);\n const keys = [\n ...Object.getOwnPropertyNames(source),\n ...Object.getOwnPropertySymbols(source)\n ];\n for (const key of keys) {\n const descriptor = Object.getOwnPropertyDescriptor(\n source,\n key\n );\n if (descriptor) {\n Object.defineProperty(copy, key, {\n ...descriptor,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: this.deepCopy(source[key], map)\n });\n }\n }\n return copy;\n }\n /**\n * Checks if an observation has null or undefined values in any of the join columns.\n * @internal\n *\n * @param obs - The observation to check\n * @param keys - The join columns to check\n * @returns true if any join column has a null or undefined value\n */\n hasNullJoinKeys(obs, keys) {\n return keys.some((key) => obs[key] === null || obs[key] === void 0);\n }\n}\n\nconst PRECEDENCE = {\n \"+\": 1,\n \"-\": 1,\n \"*\": 2,\n \"/\": 2,\n \"^\": 3\n};\nclass SummarizeOperation {\n constructor(leafFn, parameters, options, tokens) {\n this.leafFn = leafFn;\n this.parameters = parameters;\n this.options = options;\n if (tokens && tokens.length > 0) {\n this.tokens = tokens.slice();\n } else if (leafFn) {\n this.tokens = [{ t: \"operand\", v: this }];\n } else {\n this.tokens = [];\n }\n this.summarizeFunction = (dc) => {\n return this.evaluateAsValue(dc);\n };\n }\n // Factory for creating a leaf SummarizeOperation (use in helpers)\n static leaf(leafFn, parameters, options) {\n return new SummarizeOperation(leafFn, parameters, options);\n }\n // clone with new token stream (immutable-ish)\n cloneWithTokens(newTokens) {\n return new SummarizeOperation(void 0, void 0, void 0, newTokens);\n }\n // append operator + operand (operand can be number or SummarizeOperation)\n appendOp(op, operand) {\n const newTokens = this.tokens.slice();\n newTokens.push({ t: \"op\", v: op });\n newTokens.push({ t: \"operand\", v: operand });\n return this.cloneWithTokens(newTokens);\n }\n /**\n * Append addition to this expression.\n *\n * @param x - A numeric literal or another `SummarizeOperation` to add to this expression\n * @returns A new `SummarizeOperation` representing `(this + x)`\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.summarize({\n * result: mean(\"a\").add(10),\n * }).observations\n * );\n * // [ { result: 13.33333 } ]\n * ```\n */\n add(x) {\n return this.appendOp(\"+\", x);\n }\n /**\n * Append subtraction to this expression.\n *\n * @param x - A numeric literal or another `SummarizeOperation` to subtract from this expression\n * @returns A new `SummarizeOperation` representing `(this - x)`\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.summarize({\n * result: mean(\"a\").sub(10),\n * }).observations\n * );\n * // [ { result: -6.6667 } ]\n * ```\n */\n sub(x) {\n return this.appendOp(\"-\", x);\n }\n /**\n * Append multiplication to this expression. Multiplication has higher\n * precedence than addition/subtraction.\n *\n * @param x - A numeric literal or another `SummarizeOperation` to multiply with this expression\n * @returns A new `SummarizeOperation` representing `(this * x)`\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.summarize({\n * result: mean(\"a\").mul(10),\n * }).observations\n * );\n * // [ { result: 33.3333 } ]\n * ```\n */\n mul(x) {\n return this.appendOp(\"*\", x);\n }\n /**\n * Append division to this expression.\n *\n * @param x - A numeric literal or another `SummarizeOperation` to divide this expression by\n * @returns A new `SummarizeOperation` representing `(this / x)`\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.summarize({\n * result: mean(\"a\").div(10),\n * }).observations\n * );\n * // [ { result: .3333 } ]\n * ```\n */\n div(x) {\n return this.appendOp(\"/\", x);\n }\n /**\n * Append exponentiation (power) to this expression.\n *\n * Note: exponentiation uses right-associative semantics (a ^ b ^ c -> a ^ (b ^ c)).\n *\n * @param x - A numeric literal or another `SummarizeOperation` used as the exponent\n * @returns A new `SummarizeOperation` representing `(this ^ x)`\n *\n * @example\n * ```js\n * const d = [\n * { a: 1, b: 2, c: 3 },\n * { a: 0, b: 8, c: 3 },\n * { a: 9, b: 4, c: 7 },\n * ];\n * const dc = new DataCalc(d);\n * console.log(\n * dc.summarize({\n * result: mean(\"a\").pow(2),\n * }).observations\n * );\n * // [ { result: 11.1111 } ]\n * ```\n */\n pow(x) {\n return this.appendOp(\"^\", x);\n }\n // Evaluate an operand token to a number (returns NaN for non-numeric)\n evaluateOperandToNumber(opd, dc) {\n if (typeof opd === \"number\") return opd;\n const params = Array.isArray(opd.parameters) ? opd.parameters : opd.parameters === void 0 ? void 0 : [opd.parameters];\n const raw = opd.leafFn ? opd.leafFn(dc, params, opd.options) : opd.evaluateAsValue(dc);\n if (raw === null || raw === void 0) return NaN;\n const num = Number(raw);\n return typeof num === \"number\" && !isNaN(num) ? num : NaN;\n }\n // Evaluate a flat token stream (no nested handling required here; nested SummarizeOperation\n // operands will evaluate themselves recursively)\n evaluateFlatTokens(tokens, dc) {\n const operands = [];\n const ops = [];\n for (const tk of tokens) {\n if (tk.t === \"operand\") operands.push(tk.v);\n else ops.push(tk.v);\n }\n if (operands.length === 0) return NaN;\n while (ops.length > 0) {\n let bestIdx = 0;\n let bestPrec = PRECEDENCE[ops[0]] ?? 0;\n for (let i = 1; i < ops.length; i++) {\n const p = PRECEDENCE[ops[i]] ?? 0;\n if (p > bestPrec || p === bestPrec && ops[i] === \"^\") {\n bestPrec = p;\n bestIdx = i;\n }\n }\n const op = ops.splice(bestIdx, 1)[0];\n const left = operands.splice(bestIdx, 1)[0];\n const right = operands.splice(bestIdx, 1)[0];\n const a = this.evaluateOperandToNumber(left, dc);\n const b = this.evaluateOperandToNumber(right, dc);\n let res = NaN;\n if (op === \"+\") res = a + b;\n else if (op === \"-\") res = a - b;\n else if (op === \"*\") res = a * b;\n else if (op === \"/\") res = b === 0 ? NaN : a / b;\n else if (op === \"^\") res = Math.pow(a, b);\n operands.splice(bestIdx, 0, res);\n }\n const final = operands[0];\n if (typeof final === \"number\") return final;\n return this.evaluateOperandToNumber(final, dc);\n }\n /**\n * Instance helper: return a grouped version of this operation so it becomes\n * a single operand in outer expressions. Equivalent to parens(this).\n */\n parens() {\n return parens(this);\n }\n // Top-level evaluation: handles the case where this instance is a leaf (leafFn present)\n // or an expression token stream.\n evaluateAsValue(dc) {\n if (this.leafFn) {\n const params = Array.isArray(this.parameters) ? this.parameters : this.parameters === void 0 ? void 0 : [this.parameters];\n const res = this.leafFn(dc, params, this.options);\n if (typeof res === \"number\" && Number.isNaN(res)) return null;\n return res;\n }\n if (!this.tokens || this.tokens.length === 0) return NaN;\n const val = this.evaluateFlatTokens(this.tokens, dc);\n if (typeof val === \"number\" && Number.isNaN(val)) return null;\n return val;\n }\n}\nfunction parens(op) {\n const tokens = [{ t: \"operand\", v: op }];\n return new SummarizeOperation(void 0, void 0, void 0, tokens);\n}\n\nconst DEFAULT_SUMMARIZE_OPTIONS = {\n coerceBooleans: true,\n skipMissing: false\n};\nfunction applyDefaultOptions(options) {\n return { ...DEFAULT_SUMMARIZE_OPTIONS, ...options };\n}\nfunction processNumericValues(dataCalc, variable, options, collector, errorPrefix, initialState) {\n const mergedOptions = applyDefaultOptions(options);\n dataCalc.verifyObservationsContainVariable(variable);\n let count = 0;\n let state = initialState;\n let containsMissing = false;\n dataCalc.observations.forEach((o) => {\n if (dataCalc.isNonMissingNumeric(o[variable])) {\n state = collector(o[variable], state);\n count++;\n return;\n }\n if (typeof o[variable] === \"boolean\" && mergedOptions.coerceBooleans) {\n state = collector(o[variable] ? 1 : 0, state);\n count++;\n return;\n }\n if (dataCalc.isMissingNumeric(o[variable])) {\n containsMissing = true;\n return;\n }\n throw new M2Error(\n `${errorPrefix}: variable ${variable} has non-numeric value ${o[variable]} in this observation: ${JSON.stringify(o)}`\n );\n });\n return { state, count, containsMissing };\n}\nfunction processDirectValues(values, options, collector, errorPrefix, initialState) {\n const mergedOptions = applyDefaultOptions(options);\n let state = initialState;\n let count = 0;\n let containsMissing = false;\n for (const value of values) {\n if (typeof value === \"number\" && !isNaN(value) && isFinite(value)) {\n state = collector(value, state);\n count++;\n } else if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) {\n state = collector(value ? 1 : 0, state);\n count++;\n } else if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) {\n containsMissing = true;\n } else {\n throw new M2Error(`${errorPrefix}: has non-numeric value ${value}`);\n }\n }\n return { state, count, containsMissing };\n}\nfunction processSingleValue(value, options, errorPrefix) {\n const mergedOptions = applyDefaultOptions(options);\n if (typeof value === \"number\" && !isNaN(value) && isFinite(value)) {\n return { value, isMissing: false };\n } else if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) {\n return { value: value ? 1 : 0, isMissing: false };\n } else if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) {\n return { value: 0, isMissing: true };\n } else {\n throw new M2Error(`${errorPrefix}: has non-numeric value ${value}`);\n }\n}\nconst nInternal = (dataCalc) => {\n return dataCalc.length;\n};\nfunction n() {\n return SummarizeOperation.leaf(nInternal, [], void 0);\n}\nconst sumInternal = (dataCalc, params, options) => {\n const variableOrValues = params ? params[0] : void 0;\n const mergedOptions = applyDefaultOptions(options);\n if (typeof variableOrValues === \"string\") {\n if (!dataCalc.variableExists(variableOrValues)) {\n return null;\n }\n const variable = variableOrValues;\n const result = processNumericValues(\n dataCalc,\n variable,\n options,\n (value, sum2) => sum2 + value,\n \"sum()\",\n 0\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state;\n } else if (Array.isArray(variableOrValues)) {\n const result = processDirectValues(\n variableOrValues,\n options,\n (value, sum2) => sum2 + value,\n \"sum()\",\n 0\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state;\n } else {\n const result = processSingleValue(variableOrValues, options, \"sum()\");\n if (result.isMissing && !mergedOptions.skipMissing) {\n return null;\n }\n return result.isMissing ? null : result.value;\n }\n};\nfunction sum(variableOrValues, options) {\n return SummarizeOperation.leaf(sumInternal, [variableOrValues], options);\n}\nconst meanInternal = (dataCalc, params, options) => {\n const variableOrValues = params ? params[0] : void 0;\n const mergedOptions = applyDefaultOptions(options);\n if (typeof variableOrValues === \"string\") {\n if (!dataCalc.variableExists(variableOrValues)) {\n return null;\n }\n const variable = variableOrValues;\n const result = processNumericValues(\n dataCalc,\n variable,\n options,\n (value, sum2) => sum2 + value,\n \"mean()\",\n 0\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state / result.count;\n } else if (Array.isArray(variableOrValues)) {\n const result = processDirectValues(\n variableOrValues,\n options,\n (value, sum2) => sum2 + value,\n \"mean()\",\n 0\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state / result.count;\n } else {\n const result = processSingleValue(variableOrValues, options, \"mean()\");\n return result.isMissing && !mergedOptions.skipMissing ? null : result.value;\n }\n};\nfunction mean(variableOrValues, options) {\n return SummarizeOperation.leaf(meanInternal, [variableOrValues], options);\n}\nconst varianceInternal = (dataCalc, params, options) => {\n const variableOrValues = params ? params[0] : void 0;\n const mergedOptions = applyDefaultOptions(options);\n if (typeof variableOrValues === \"string\") {\n if (!dataCalc.variableExists(variableOrValues)) {\n return null;\n }\n const variable = variableOrValues;\n const meanResult = processNumericValues(\n dataCalc,\n variable,\n options,\n (value, sum2) => sum2 + value,\n \"variance()\",\n 0\n );\n if (meanResult.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (meanResult.count <= 1) {\n return null;\n }\n const meanValue = meanResult.state / meanResult.count;\n const varianceResult = processNumericValues(\n dataCalc,\n variable,\n options,\n (value, sum2) => {\n const actualValue = typeof value === \"boolean\" && mergedOptions.coerceBooleans ? value ? 1 : 0 : value;\n return sum2 + Math.pow(actualValue - meanValue, 2);\n },\n \"variance()\",\n 0\n );\n return varianceResult.state / (meanResult.count - 1);\n } else if (Array.isArray(variableOrValues)) {\n const validValues = [];\n let containsMissing = false;\n for (const value of variableOrValues) {\n if (typeof value === \"number\" && !isNaN(value) && isFinite(value)) {\n validValues.push(value);\n } else if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) {\n validValues.push(value ? 1 : 0);\n } else if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) {\n containsMissing = true;\n } else {\n throw new M2Error(`variance(): has non-numeric value ${value}`);\n }\n }\n if (containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (validValues.length <= 1) {\n return null;\n }\n const sum2 = validValues.reduce((acc, val) => acc + val, 0);\n const mean2 = sum2 / validValues.length;\n const sumSquaredDiffs = validValues.reduce(\n (acc, val) => acc + Math.pow(val - mean2, 2),\n 0\n );\n return sumSquaredDiffs / (validValues.length - 1);\n } else {\n return null;\n }\n};\nfunction variance(variableOrValues, options) {\n return SummarizeOperation.leaf(varianceInternal, [variableOrValues], options);\n}\nconst minInternal = (dataCalc, params, options) => {\n const variableOrValues = params ? params[0] : void 0;\n const mergedOptions = applyDefaultOptions(options);\n if (typeof variableOrValues === \"string\") {\n if (!dataCalc.variableExists(variableOrValues)) {\n return null;\n }\n const variable = variableOrValues;\n const result = processNumericValues(\n dataCalc,\n variable,\n options,\n (value, min2) => min2 === Number.POSITIVE_INFINITY || value < min2 ? value : min2,\n \"min()\",\n Number.POSITIVE_INFINITY\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state;\n } else if (Array.isArray(variableOrValues)) {\n const result = processDirectValues(\n variableOrValues,\n options,\n (value, min2) => min2 === Number.POSITIVE_INFINITY || value < min2 ? value : min2,\n \"min()\",\n Number.POSITIVE_INFINITY\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state;\n } else {\n const result = processSingleValue(variableOrValues, options, \"min()\");\n if (result.isMissing && !mergedOptions.skipMissing) {\n return null;\n }\n return result.isMissing ? null : result.value;\n }\n};\nfunction min(variableOrValues, options) {\n return SummarizeOperation.leaf(minInternal, [variableOrValues], options);\n}\nconst maxInternal = (dataCalc, params, options) => {\n const variableOrValues = params ? params[0] : void 0;\n const mergedOptions = applyDefaultOptions(options);\n if (typeof variableOrValues === \"string\") {\n if (!dataCalc.variableExists(variableOrValues)) {\n return null;\n }\n const variable = variableOrValues;\n const result = processNumericValues(\n dataCalc,\n variable,\n options,\n (value, max2) => max2 === Number.NEGATIVE_INFINITY || value > max2 ? value : max2,\n \"max()\",\n Number.NEGATIVE_INFINITY\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state;\n } else if (Array.isArray(variableOrValues)) {\n const result = processDirectValues(\n variableOrValues,\n options,\n (value, max2) => max2 === Number.NEGATIVE_INFINITY || value > max2 ? value : max2,\n \"max()\",\n Number.NEGATIVE_INFINITY\n );\n if (result.containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (result.count === 0) {\n return null;\n }\n return result.state;\n } else {\n const result = processSingleValue(variableOrValues, options, \"max()\");\n if (result.isMissing && !mergedOptions.skipMissing) {\n return null;\n }\n return result.isMissing ? null : result.value;\n }\n};\nfunction max(variableOrValues, options) {\n return SummarizeOperation.leaf(maxInternal, [variableOrValues], options);\n}\nconst medianInternal = (dataCalc, params, options) => {\n const variableOrValues = params ? params[0] : void 0;\n const mergedOptions = applyDefaultOptions(options);\n if (typeof variableOrValues === \"string\") {\n if (!dataCalc.variableExists(variableOrValues)) {\n return null;\n }\n const variable = variableOrValues;\n dataCalc.verifyObservationsContainVariable(variable);\n const values = [];\n let containsMissing = false;\n dataCalc.observations.forEach((o) => {\n if (dataCalc.isNonMissingNumeric(o[variable])) {\n values.push(o[variable]);\n } else if (typeof o[variable] === \"boolean\" && mergedOptions.coerceBooleans) {\n values.push(o[variable] ? 1 : 0);\n } else if (dataCalc.isMissingNumeric(o[variable])) {\n containsMissing = true;\n } else {\n throw new M2Error(\n `median(): variable ${variable} has non-numeric value ${o[variable]} in this observation: ${JSON.stringify(o)}`\n );\n }\n });\n if (containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (values.length === 0) {\n return null;\n }\n values.sort((a, b) => a - b);\n const mid = Math.floor(values.length / 2);\n if (values.length % 2 === 0) {\n return (values[mid - 1] + values[mid]) / 2;\n } else {\n return values[mid];\n }\n } else if (Array.isArray(variableOrValues)) {\n const values = [];\n let containsMissing = false;\n for (const value of variableOrValues) {\n if (typeof value === \"number\" && !isNaN(value) && isFinite(value)) {\n values.push(value);\n } else if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) {\n values.push(value ? 1 : 0);\n } else if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) {\n containsMissing = true;\n } else {\n throw new M2Error(`median(): has non-numeric value ${value}`);\n }\n }\n if (containsMissing && !mergedOptions.skipMissing) {\n return null;\n }\n if (values.length === 0) {\n return null;\n }\n values.sort((a, b) => a - b);\n const mid = Math.floor(values.length / 2);\n if (values.length % 2 === 0) {\n return (values[mid - 1] + values[mid]) / 2;\n } else {\n return values[mid];\n }\n } else {\n const result = processSingleValue(variableOrValues, options, \"median()\");\n if (result.isMissing && !mergedOptions.skipMissing) {\n return null;\n }\n return result.isMissing ? null : result.value;\n }\n};\nfunction median(variableOrValues, options) {\n return SummarizeOperation.leaf(medianInternal, [variableOrValues], options);\n}\nconst sdInternal = (dataCalc, params, options) => {\n const variableOrValues = params ? params[0] : void 0;\n if (typeof variableOrValues === \"string\") {\n if (!dataCalc.variableExists(variableOrValues)) {\n return null;\n }\n const varianceValue = varianceInternal(dataCalc, params, options);\n if (varianceValue === null) {\n return null;\n }\n return Math.sqrt(varianceValue);\n } else if (Array.isArray(variableOrValues)) {\n const newParams = params ? [...params] : [variableOrValues];\n const varianceValue = varianceInternal(dataCalc, newParams, options);\n if (varianceValue === null) {\n return null;\n }\n return Math.sqrt(varianceValue);\n } else {\n return null;\n }\n};\nfunction sd(variableOrValues, options) {\n return SummarizeOperation.leaf(sdInternal, [variableOrValues], options);\n}\nconst scalarInternal = (_dataCalc, params, options) => {\n const v = params ? params[0] : void 0;\n const result = processSingleValue(v, options, \"scalar()\");\n return result.isMissing ? null : result.value;\n};\nfunction scalar(value) {\n return SummarizeOperation.leaf(scalarInternal, [value], void 0);\n}\nconst s = scalar;\n\nconsole.log(\"\\u26AA @m2c2kit/data-calc version 0.8.6 (c86b5047)\");\n\nexport { DataCalc, SummarizeOperation, max, mean, median, min, n, parens, s, scalar, sd, sum, variance };\n//# sourceMappingURL=index.js.map\n","import {\n Game,\n Action,\n Scene,\n Shape,\n Label,\n Transition,\n TransitionDirection,\n WebColors,\n RandomDraws,\n GameParameters,\n GameOptions,\n TrialSchema,\n Timer,\n Easings,\n RgbaColor,\n Sprite,\n Constants,\n Translation,\n M2Error,\n ScoringProvider,\n ActivityKeyValueData,\n ScoringSchema,\n} from \"@m2c2kit/core\";\nimport {\n Button,\n Grid,\n Instructions,\n CountdownScene,\n InstructionsOptions,\n LocalePicker,\n} from \"@m2c2kit/addons\";\nimport { DataCalc } from \"@m2c2kit/data-calc\";\n\n/**\n * Color Shapes is a visual array change detection task, measuring intra-item\n * feature binding, where participants determine if shapes change color across\n * two sequential presentations of shape stimuli.\n */\nclass ColorShapes extends Game implements ScoringProvider {\n constructor() {\n /**\n * These are configurable game parameters and their defaults.\n * Each game parameter should have a type, default (this is the default\n * value), and a description.\n */\n const defaultParameters: GameParameters = {\n fixation_duration_ms: {\n default: 500,\n description: \"How long fixation scene is shown, milliseconds.\",\n type: \"number\",\n },\n shape_colors: {\n type: \"array\",\n description: \"Array of colors for shapes.\",\n items: {\n type: \"object\",\n properties: {\n colorName: {\n type: \"string\",\n description: \"Human-friendly name of color.\",\n },\n rgbaColor: {\n type: \"array\",\n description: \"Color as array, [r,g,b,a].\",\n items: {\n type: \"number\",\n },\n },\n },\n },\n default: [\n { colorName: \"black\", rgbaColor: [0, 0, 0, 1] },\n { colorName: \"green\", rgbaColor: [0, 158, 115, 1] },\n { colorName: \"yellow\", rgbaColor: [240, 228, 66, 1] },\n { colorName: \"blue\", rgbaColor: [0, 114, 178, 1] },\n { colorName: \"orange\", rgbaColor: [213, 94, 0, 1] },\n { colorName: \"pink\", rgbaColor: [204, 121, 167, 1] },\n ],\n },\n number_of_shapes_shown: {\n default: 3,\n description: \"How many shapes to show on the grid at one time.\",\n type: \"integer\",\n },\n number_of_shapes_changing_color: {\n default: 2,\n description:\n \"If a different color trial, how many shapes should change color (minimum is 2, because changes are swaps with other shapes).\",\n type: \"integer\",\n },\n shapes_presented_duration_ms: {\n default: 2000,\n description: \"How long the shapes are shown, milliseconds.\",\n type: \"number\",\n },\n shapes_removed_duration_ms: {\n default: 1000,\n description:\n \"How long to show a blank square after shapes are removed, milliseconds.\",\n type: \"number\",\n },\n cells_per_side: {\n default: 3,\n description:\n \"How many cell positions for each side of the square grid (e.g., 3 is a 3x3 grid; 4 is a 4x4 grid).\",\n type: \"integer\",\n },\n number_of_different_colors_trials: {\n default: 6,\n type: \"integer\",\n description: \"Number of trials where the shapes have different colors.\",\n },\n number_of_trials: {\n default: 12,\n description: \"How many trials to run.\",\n type: \"integer\",\n },\n show_trials_complete_scene: {\n default: true,\n type: \"boolean\",\n description:\n \"After the final trial, should a completion scene be shown? Otherwise, the game will immediately end.\",\n },\n instruction_type: {\n default: \"long\",\n description: \"Type of instructions to show, 'short' or 'long'.\",\n type: \"string\",\n enum: [\"short\", \"long\"],\n },\n instructions: {\n default: null,\n type: [\"object\", \"null\"],\n description:\n \"When non-null, an InstructionsOptions object that will completely override the built-in instructions.\",\n },\n show_quit_button: {\n type: \"boolean\",\n default: false,\n description: \"Should the activity quit button be shown?\",\n },\n show_fps: {\n type: \"boolean\",\n default: false,\n description: \"Should the FPS be shown?\",\n },\n show_locale_picker: {\n type: \"boolean\",\n default: false,\n description:\n \"Should the icon that allows the participant to switch the locale be shown?\",\n },\n seed: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Optional seed for the seeded pseudo-random number generator. When null, the default Math.random() is used.\",\n },\n scoring: {\n type: \"boolean\",\n default: false,\n description: \"Should scoring data be generated? Default is false.\",\n },\n };\n\n /**\n * This describes all the data that will be generated by the assessment.\n * At runtime, when a trial completes, the data will be returned to the\n * session with a callback, along with this schema transformed into\n * JSON Schema.\n */\n const colorShapesTrialSchema: TrialSchema = {\n activity_begin_iso8601_timestamp: {\n type: \"string\",\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the game activity.\",\n },\n trial_begin_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the trial. Null if trial was skipped.\",\n },\n trial_end_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the end of the trial (when user presses 'Same' or 'Different'). Null if trial was skipped.\",\n },\n trial_index: {\n type: [\"integer\", \"null\"],\n description: \"Index of the trial within this assessment, 0-based.\",\n },\n present_shapes: {\n description:\n \"Configuration of shapes shown to the user in the presentation phase. Null if trial was skipped.\",\n type: [\"array\", \"null\"],\n items: {\n type: \"object\",\n properties: {\n shape_index: {\n type: \"integer\",\n description:\n \"Index of the shape within the library of shapes, 0-based\",\n },\n color_name: {\n type: \"string\",\n description: \"Human-friendly name of color.\",\n },\n rgba_color: {\n type: \"array\",\n description: \"Color as array, [r,g,b,a].\",\n items: {\n type: \"number\",\n },\n },\n location: {\n type: \"object\",\n description: \"Location of shape.\",\n properties: {\n row: {\n type: \"number\",\n description: \"Row of the shape, 0-based.\",\n },\n column: {\n type: \"number\",\n description: \"Column of the shape, 0-based.\",\n },\n },\n },\n },\n },\n },\n response_shapes: {\n description:\n \"Configuration of shapes shown to the user in the response phase. Null if trial was skipped.\",\n type: [\"array\", \"null\"],\n items: {\n type: \"object\",\n properties: {\n shape_index: {\n type: \"integer\",\n description:\n \"Index of the shape within the library of shapes, 0-based\",\n },\n color_name: {\n type: \"string\",\n description: \"Human-friendly name of color.\",\n },\n rgba_color: {\n type: \"array\",\n description: \"Color as array, [r,g,b,a].\",\n items: {\n type: \"number\",\n },\n },\n location: {\n type: \"object\",\n description: \"Location of shape.\",\n properties: {\n row: {\n type: \"number\",\n description: \"Row of the shape, 0-based.\",\n },\n column: {\n type: \"number\",\n description: \"Column of the shape, 0-based.\",\n },\n },\n },\n },\n },\n },\n response_time_duration_ms: {\n type: [\"number\", \"null\"],\n description:\n \"Milliseconds from when the response configuration of shapes is shown until the user taps a response. Null if trial was skipped.\",\n },\n user_response: {\n type: [\"string\", \"null\"],\n enum: [\"same\", \"different\"],\n description:\n \"User's response to whether the shapes are same colors or different.\",\n },\n user_response_correct: {\n type: [\"boolean\", \"null\"],\n description: \"Was the user's response correct?\",\n },\n quit_button_pressed: {\n type: \"boolean\",\n description: \"Was the quit button pressed?\",\n },\n };\n\n const colorShapesScoringSchema: ScoringSchema = {\n activity_begin_iso8601_timestamp: {\n type: \"string\",\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the game activity.\",\n },\n first_trial_begin_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the first trial. Null if no trials were completed.\",\n },\n last_trial_end_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the end of the last trial. Null if no trials were completed.\",\n },\n n_trials: {\n type: \"integer\",\n description: \"Number of trials completed.\",\n },\n flag_trials_match_expected: {\n type: \"integer\",\n description:\n \"Does the number of completed and expected trials match? 1 = true, 0 = false.\",\n },\n n_trials_correct: {\n type: \"integer\",\n description: \"Number of correct trials.\",\n },\n n_trials_incorrect: {\n type: \"integer\",\n description: \"Number of incorrect trials.\",\n },\n participant_score: {\n type: [\"number\", \"null\"],\n description:\n \"Participant-facing score, calculated as (number of correct trials / number of trials attempted) * 100. This is a simple metric to provide feedback to the participant. Null if no trials attempted.\",\n },\n };\n\n const translation: Translation = {\n configuration: {\n baseLocale: \"en-US\",\n },\n \"en-US\": {\n localeName: \"English\",\n INSTRUCTIONS_TITLE: \"Color Shapes\",\n SHORT_INSTRUCTIONS_TEXT_PAGE_1:\n \"Try to remember the color of 3 shapes, because they will soon disappear. When the shapes reappear, answer whether they have the SAME or DIFFERENT colors as they had before\",\n INSTRUCTIONS_TEXT_PAGE_1:\n \"Try to remember the color of 3 shapes, because they will soon disappear.\",\n INSTRUCTIONS_TEXT_PAGE_2: \"Next you will see the same shapes reappear.\",\n INSTRUCTIONS_TEXT_PAGE_3:\n \"Answer whether the shapes have the SAME or DIFFERENT colors as they had before.\",\n START_BUTTON_TEXT: \"START\",\n NEXT_BUTTON_TEXT: \"Next\",\n BACK_BUTTON_TEXT: \"Back\",\n GET_READY_COUNTDOWN_TEXT: \"GET READY!\",\n SAME_BUTTON_TEXT: \"Same\",\n DIFFERENT_BUTTON_TEXT: \"Different\",\n TRIALS_COMPLETE_SCENE_TEXT: \"This activity is complete.\",\n TRIALS_COMPLETE_SCENE_BUTTON_TEXT: \"OK\",\n },\n // cSpell:disable (for VS Code extension, Code Spell Checker)\n \"es-MX\": {\n localeName: \"Español\",\n INSTRUCTIONS_TITLE: \"Formas de Color\",\n // Short instructions need to be translated.\n // SHORT_INSTRUCTIONS_TEXT_PAGE_1: \"\",\n INSTRUCTIONS_TEXT_PAGE_1:\n \"Intenta recordar el color de las 3 formas, porque pronto desaparecerán.\",\n INSTRUCTIONS_TEXT_PAGE_2: \"Luego verás reaparecer las mismas formas.\",\n INSTRUCTIONS_TEXT_PAGE_3:\n \"Responde si las formas tienen el MISMO o DIFERENTE color que antes.\",\n START_BUTTON_TEXT: \"COMENZAR\",\n NEXT_BUTTON_TEXT: \"Siguiente\",\n BACK_BUTTON_TEXT: \"Atrás\",\n GET_READY_COUNTDOWN_TEXT: \"PREPÁRESE\",\n SAME_BUTTON_TEXT: \"Mismo\",\n DIFFERENT_BUTTON_TEXT: \"Diferente\",\n TRIALS_COMPLETE_SCENE_TEXT: \"Esta actividad está completa.\",\n TRIALS_COMPLETE_SCENE_BUTTON_TEXT: \"OK\",\n },\n \"de-DE\": {\n localeName: \"Deutsch\",\n INSTRUCTIONS_TITLE: \"Farb-Formen\",\n // Short instructions need to be translated.\n // SHORT_INSTRUCTIONS_TEXT_PAGE_1: \"\",\n INSTRUCTIONS_TEXT_PAGE_1: \"Oben und unten sehen Sie Symbolpaare.\",\n INSTRUCTIONS_TEXT_PAGE_2:\n \"Ihre Aufgabe wird es sein, auf dasjenige untere Paar zu tippen, welches mit einem der obigen Paare exakt übereinstimmt.\",\n INSTRUCTIONS_TEXT_PAGE_3:\n \"Versuchen Sie bitte, so schnell und korrekt wie möglich zu sein.\",\n START_BUTTON_TEXT: \"START\",\n NEXT_BUTTON_TEXT: \"Weiter\",\n BACK_BUTTON_TEXT: \"Vorherige\",\n GET_READY_COUNTDOWN_TEXT: \"BEREIT MACHEN\",\n SAME_BUTTON_TEXT: \"Gleich\",\n DIFFERENT_BUTTON_TEXT: \"Unterschiedlich\",\n TRIALS_COMPLETE_SCENE_TEXT: \"Die Aufgabe ist beendet.\",\n TRIALS_COMPLETE_SCENE_BUTTON_TEXT: \"OK\",\n },\n // cSpell:enable\n };\n\n const options: GameOptions = {\n name: \"Color Shapes\",\n /**\n * This id must match the property m2c2kit.assessmentId in package.json\n */\n id: \"color-shapes\",\n publishUuid: \"394cb010-2ccf-4a87-9d23-cda7fb07a960\",\n version: \"__PACKAGE_JSON_VERSION__\",\n moduleMetadata: Constants.MODULE_METADATA_PLACEHOLDER,\n translation: translation,\n shortDescription:\n \"Color Shapes is a visual array change detection \\\ntask, measuring intra-item feature binding, where participants determine \\\nif shapes change color across two sequential presentations of shape \\\nstimuli.\",\n longDescription: `Color Shapes is a change detection paradigm used \\\nto measure visual short-term memory binding (Parra et al., 2009). \\\nParticipants are asked to memorize the shapes and colors of three different \\\npolygons for 3 seconds. The three polygons are then removed from the screen \\\nand re-displayed at different locations, either having the same or different \\\ncolors. Participants are then asked to decide whether the combination of \\\ncolors and shapes are the \"Same\" or \"Different\" between the study and test \\\nphases.`,\n showFps: defaultParameters.show_fps.default,\n width: 400,\n height: 800,\n trialSchema: colorShapesTrialSchema,\n scoringSchema: colorShapesScoringSchema,\n parameters: defaultParameters,\n fonts: [\n {\n fontName: \"roboto\",\n url: \"fonts/roboto/Roboto-Regular.ttf\",\n },\n ],\n images: [\n {\n imageName: \"instructions-1\",\n height: 256,\n width: 256,\n url: \"images/cs-instructions-1.png\",\n },\n {\n imageName: \"instructions-2\",\n height: 256,\n width: 256,\n url: \"images/cs-instructions-2.png\",\n },\n {\n imageName: \"instructions-3\",\n height: 350,\n width: 300,\n url: \"images/cs-instructions-3.png\",\n localize: true,\n },\n {\n imageName: \"circle-x\",\n height: 32,\n width: 32,\n // the svg is from evericons and is licensed under CC0 1.0\n // Universal (Public Domain). see https://www.patreon.com/evericons\n url: \"images/circle-x.svg\",\n },\n ],\n };\n\n super(options);\n }\n\n override async initialize() {\n await super.initialize();\n // just for convenience, alias the variable game to \"this\"\n // (even though eslint doesn't like it)\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const game = this;\n\n const seed = game.getParameter<string | null>(\"seed\");\n if (typeof seed === \"string\") {\n RandomDraws.setSeed(seed);\n }\n\n const SHAPE_SVG_HEIGHT = 96;\n const SQUARE_SIDE_LENGTH = 350;\n const numberOfShapesShown = game.getParameter<number>(\n \"number_of_shapes_shown\",\n );\n const shapeLibrary = this.makeShapes(SHAPE_SVG_HEIGHT);\n\n // ==============================================================\n\n if (game.getParameter<boolean>(\"show_quit_button\")) {\n const quitSprite = new Sprite({\n imageName: \"circle-x\",\n position: { x: 380, y: 20 },\n isUserInteractionEnabled: true,\n });\n game.addFreeNode(quitSprite);\n quitSprite.onTapDown((e) => {\n game.removeAllFreeNodes();\n e.handled = true;\n const blankScene = new Scene();\n game.addScene(blankScene);\n game.presentScene(blankScene);\n game.addTrialData(\"quit_button_pressed\", true);\n game.trialComplete();\n if (game.getParameter<boolean>(\"scoring\")) {\n // Score the data only if user does not quit. If user quits, pass\n // empty data to calculateScores so a \"blank\" set of scores is\n // generated.\n const scores = game.calculateScores([], {\n numberOfTrials: game.getParameter<number>(\"number_of_trials\"),\n });\n game.addScoringData(scores);\n game.scoringComplete();\n }\n game.cancel();\n });\n }\n\n let localePicker: LocalePicker;\n if (game.getParameter<boolean>(\"show_locale_picker\")) {\n localePicker = new LocalePicker();\n game.addFreeNode(localePicker);\n }\n\n // ==============================================================\n // SCENES: instructions\n let instructionsScenes: Array<Scene>;\n\n const customInstructions = game.getParameter<InstructionsOptions | null>(\n \"instructions\",\n );\n if (customInstructions) {\n instructionsScenes = Instructions.create(customInstructions);\n } else {\n switch (game.getParameter(\"instruction_type\")) {\n case \"short\": {\n instructionsScenes = Instructions.create({\n instructionScenes: [\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"SHORT_INSTRUCTIONS_TEXT_PAGE_1\",\n imageName: \"instructions-1\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"START_BUTTON_TEXT\",\n nextButtonBackgroundColor: WebColors.Green,\n nextSceneTransition: Transition.none(),\n },\n ],\n });\n break;\n }\n case \"long\": {\n instructionsScenes = Instructions.create({\n instructionScenes: [\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"INSTRUCTIONS_TEXT_PAGE_1\",\n imageName: \"instructions-1\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"NEXT_BUTTON_TEXT\",\n backButtonText: \"BACK_BUTTON_TEXT\",\n },\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"INSTRUCTIONS_TEXT_PAGE_2\",\n imageName: \"instructions-2\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"NEXT_BUTTON_TEXT\",\n backButtonText: \"BACK_BUTTON_TEXT\",\n },\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"INSTRUCTIONS_TEXT_PAGE_3\",\n imageName: \"instructions-3\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"START_BUTTON_TEXT\",\n nextButtonBackgroundColor: WebColors.Green,\n backButtonText: \"BACK_BUTTON_TEXT\",\n },\n ],\n });\n break;\n }\n default: {\n throw new M2Error(\"invalid value for instruction_type\");\n }\n }\n }\n instructionsScenes[0].onAppear(() => {\n // in case user quits before starting a trial, record the\n // timestamp\n game.addTrialData(\n \"activity_begin_iso8601_timestamp\",\n this.beginIso8601Timestamp,\n );\n });\n game.addScenes(instructionsScenes);\n\n // ==============================================================\n // SCENE: countdown. Show 3 second countdown.\n const countdownScene = new CountdownScene({\n milliseconds: 3000,\n text: \"GET_READY_COUNTDOWN_TEXT\",\n zeroDwellMilliseconds: 1000,\n transition: Transition.none(),\n });\n game.addScene(countdownScene);\n\n const gridRows = game.getParameter<number>(\"cells_per_side\");\n const gridColumns = game.getParameter<number>(\"cells_per_side\");\n const numberOfTrials = game.getParameter<number>(\"number_of_trials\");\n const shapeColors =\n game.getParameter<Array<{ colorName: string; rgbaColor: RgbaColor }>>(\n \"shape_colors\",\n );\n\n interface DisplayShape {\n shape: Shape;\n shapeIndex: number;\n color: RgbaColor;\n colorName: string;\n location: {\n row: number;\n column: number;\n };\n }\n\n interface TrialConfiguration {\n presentShapes: Array<DisplayShape>;\n responseShapes: Array<DisplayShape>;\n numberOfShapesWithDifferentColors: number;\n }\n\n const trialConfigurations: Array<TrialConfiguration> = [];\n const rows = game.getParameter<number>(\"cells_per_side\");\n const columns = rows;\n const numberOfDifferentColorsTrials = game.getParameter<number>(\n \"number_of_different_colors_trials\",\n );\n const differentColorsTrialIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfDifferentColorsTrials,\n 0,\n numberOfTrials - 1,\n );\n\n for (let i = 0; i < numberOfTrials; i++) {\n const presentShapes = new Array<DisplayShape>();\n const responseShapes = new Array<DisplayShape>();\n const shapesToShowIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfShapesShown,\n 0,\n shapeLibrary.length - 1,\n );\n const shapeColorsIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfShapesShown,\n 0,\n shapeColors.length - 1,\n );\n\n // do not allow shapes to be in the same row or column\n // or along the diagonal\n const onDiagonal = (\n locations: {\n row: number;\n column: number;\n }[],\n ): boolean => {\n if (\n locations\n .map((c) => c.row === 0 && c.column === 0)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 1 && c.column === 1)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 2 && c.column === 2)\n .some((e) => e === true)\n ) {\n return true;\n }\n if (\n locations\n .map((c) => c.row === 2 && c.column === 0)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 1 && c.column === 1)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 0 && c.column === 2)\n .some((e) => e === true)\n ) {\n return true;\n }\n return false;\n };\n\n const inLine = (\n locations: {\n row: number;\n column: number;\n }[],\n ): boolean => {\n const uniqueRows = new Set(locations.map((l) => l.row)).size;\n const uniqueColumns = new Set(locations.map((l) => l.column)).size;\n\n if (uniqueRows !== 1 && uniqueColumns !== 1) {\n return false;\n }\n return true;\n };\n\n // assign present shapes' locations and colors\n let presentLocationsOk = false;\n let presentLocations: {\n row: number;\n column: number;\n }[];\n do {\n presentLocations = RandomDraws.fromGridWithoutReplacement(\n numberOfShapesShown,\n rows,\n columns,\n );\n\n if (!inLine(presentLocations) && !onDiagonal(presentLocations)) {\n presentLocationsOk = true;\n } else {\n presentLocationsOk = false;\n }\n } while (!presentLocationsOk);\n for (let j = 0; j < numberOfShapesShown; j++) {\n const presentShape: DisplayShape = {\n shape: shapeLibrary[shapesToShowIndexes[j]],\n shapeIndex: shapesToShowIndexes[j],\n color: shapeColors[shapeColorsIndexes[j]].rgbaColor,\n colorName: shapeColors[shapeColorsIndexes[j]].colorName,\n location: presentLocations[j],\n };\n presentShapes.push(presentShape);\n }\n\n // assign response shapes' locations\n let responseLocationsOk = false;\n let responseLocations: {\n row: number;\n column: number;\n }[];\n do {\n responseLocations = RandomDraws.fromGridWithoutReplacement(\n numberOfShapesShown,\n rows,\n columns,\n );\n\n if (!inLine(responseLocations) && !onDiagonal(responseLocations)) {\n responseLocationsOk = true;\n } else {\n responseLocationsOk = false;\n }\n } while (!responseLocationsOk);\n for (let j = 0; j < numberOfShapesShown; j++) {\n const responseShape: DisplayShape = {\n shape: presentShapes[j].shape,\n shapeIndex: shapesToShowIndexes[j],\n color: presentShapes[j].color,\n colorName: shapeColors[shapeColorsIndexes[j]].colorName,\n location: responseLocations[j],\n };\n responseShapes.push(responseShape);\n }\n\n let numberOfShapesWithDifferentColors = 0;\n const differentColorTrial = differentColorsTrialIndexes.includes(i);\n\n if (differentColorTrial) {\n const numberOfShapesToChange = game.getParameter<number>(\n \"number_of_shapes_changing_color\",\n );\n if (numberOfShapesToChange > numberOfShapesShown) {\n throw new M2Error(\n `number_of_shapes_changing_color is ${numberOfShapesToChange}, but it must be less than or equal to number_of_shapes_shown (which is ${numberOfShapesShown}).`,\n );\n }\n const shapesToChangeIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfShapesToChange,\n 0,\n numberOfShapesShown - 1,\n );\n const shapesToChange = shapesToChangeIndexes.map(\n (index) => responseShapes[index],\n );\n numberOfShapesWithDifferentColors = shapesToChange.length;\n\n /**\n * rotate each shape's color to the next one. The last shape\n * gets the first shape's color\n */\n const firstShapeColor = shapesToChange[0].color;\n for (let j = 0; j < numberOfShapesToChange; j++) {\n const shape = shapesToChange[j];\n if (j + 1 < numberOfShapesToChange) {\n shape.color = shapesToChange[j + 1].color;\n } else {\n shape.color = firstShapeColor;\n }\n }\n }\n\n trialConfigurations.push({\n presentShapes: presentShapes,\n responseShapes: responseShapes,\n numberOfShapesWithDifferentColors: numberOfShapesWithDifferentColors,\n });\n }\n\n // ==============================================================\n // SCENE: fixation. Show get ready message, then advance after XXXX\n // milliseconds (as defined in fixation_duration_ms parameter)\n const fixationScene = new Scene();\n game.addScene(fixationScene);\n\n const fixationSceneSquare = new Shape({\n rect: { size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH } },\n fillColor: WebColors.Transparent,\n strokeColor: WebColors.Gray,\n lineWidth: 4,\n position: { x: 200, y: 300 },\n });\n fixationScene.addChild(fixationSceneSquare);\n\n const plusLabel = new Label({\n text: \"+\",\n fontSize: 32,\n fontColor: WebColors.Black,\n localize: false,\n });\n fixationSceneSquare.addChild(plusLabel);\n\n fixationScene.onAppear(() => {\n game.addTrialData(\n \"activity_begin_iso8601_timestamp\",\n this.beginIso8601Timestamp,\n );\n game.addTrialData(\n \"trial_begin_iso8601_timestamp\",\n new Date().toISOString(),\n );\n fixationScene.run(\n Action.sequence([\n Action.wait({ duration: game.getParameter(\"fixation_duration_ms\") }),\n Action.custom({\n callback: () => {\n game.presentScene(shapePresentationScene);\n },\n }),\n ]),\n );\n });\n\n // ==============================================================\n // SCENE: Shape Presentation.\n const shapePresentationScene = new Scene();\n game.addScene(shapePresentationScene);\n\n const presentationSceneSquare = new Shape({\n rect: { size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH } },\n fillColor: WebColors.Transparent,\n strokeColor: WebColors.Gray,\n lineWidth: 4,\n position: { x: 200, y: 300 },\n });\n shapePresentationScene.addChild(presentationSceneSquare);\n\n const presentationGrid = new Grid({\n rows: gridRows,\n columns: gridColumns,\n size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH },\n position: { x: 200, y: 300 },\n backgroundColor: WebColors.Transparent,\n gridLineColor: WebColors.Transparent,\n });\n shapePresentationScene.addChild(presentationGrid);\n\n shapePresentationScene.onAppear(() => {\n const trialConfiguration = trialConfigurations[game.trialIndex];\n for (let i = 0; i < trialConfiguration.presentShapes.length; i++) {\n const presentShape = trialConfiguration.presentShapes[i].shape;\n presentShape.fillColor = trialConfiguration.presentShapes[i].color;\n /**\n * Because we are repositioning children of a grid, we need to\n * set its position back to zero, because in the grid, it recalculates\n * the position. If we don't do this, the shapes will be positioned\n * incorrectly if they are positioned a second time.\n */\n presentShape.position = { x: 0, y: 0 };\n presentationGrid.addAtCell(\n presentShape,\n trialConfiguration.presentShapes[i].location.row,\n trialConfiguration.presentShapes[i].location.column,\n );\n }\n shapePresentationScene.run(\n Action.sequence([\n Action.wait({\n duration: game.getParameter(\"shapes_presented_duration_ms\"),\n }),\n Action.custom({\n callback: () => {\n presentationGrid.removeAllGridChildren();\n },\n }),\n Action.wait({\n duration: game.getParameter(\"shapes_removed_duration_ms\"),\n }),\n Action.custom({\n callback: () => {\n presentationGrid.removeAllGridChildren();\n game.presentScene(shapeResponseScene);\n },\n }),\n ]),\n );\n });\n\n // ==============================================================\n // SCENE: Shape Response.\n const shapeResponseScene = new Scene();\n game.addScene(shapeResponseScene);\n\n const responseSceneSquare = new Shape({\n rect: { size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH } },\n fillColor: WebColors.Transparent,\n strokeColor: WebColors.Gray,\n lineWidth: 4,\n position: { x: 200, y: 300 },\n });\n shapeResponseScene.addChild(responseSceneSquare);\n\n const responseGrid = new Grid({\n rows: gridRows,\n columns: gridColumns,\n size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH },\n position: { x: 200, y: 300 },\n backgroundColor: WebColors.Transparent,\n gridLineColor: WebColors.Transparent,\n });\n shapeResponseScene.addChild(responseGrid);\n\n shapeResponseScene.onAppear(() => {\n const trialConfiguration = trialConfigurations[game.trialIndex];\n for (let i = 0; i < trialConfiguration.responseShapes.length; i++) {\n const responseShape = trialConfiguration.responseShapes[i].shape;\n responseShape.fillColor = trialConfiguration.responseShapes[i].color;\n /**\n * Because we are repositioning children of a grid, we need to\n * set its position back to zero, because in the grid, it recalculates\n * the position. If we don't do this, the shapes will be positioned\n * incorrectly if they are positioned a second time.\n */\n responseShape.position = { x: 0, y: 0 };\n responseGrid.addAtCell(\n responseShape,\n trialConfiguration.responseShapes[i].location.row,\n trialConfiguration.responseShapes[i].location.column,\n );\n }\n sameButton.isUserInteractionEnabled = true;\n differentButton.isUserInteractionEnabled = true;\n Timer.startNew(\"rt\");\n });\n\n const sameButton = new Button({\n text: \"SAME_BUTTON_TEXT\",\n position: { x: 100, y: 700 },\n size: { width: 150, height: 50 },\n });\n shapeResponseScene.addChild(sameButton);\n sameButton.onTapDown(() => {\n sameButton.isUserInteractionEnabled = false;\n handleSelection(false);\n });\n\n const differentButton = new Button({\n text: \"DIFFERENT_BUTTON_TEXT\",\n position: { x: 300, y: 700 },\n size: { width: 150, height: 50 },\n });\n shapeResponseScene.addChild(differentButton);\n differentButton.onTapDown(() => {\n differentButton.isUserInteractionEnabled = false;\n handleSelection(true);\n });\n\n const handleSelection = (differentPressed: boolean) => {\n const rt = Timer.elapsed(\"rt\");\n Timer.remove(\"rt\");\n responseGrid.removeAllGridChildren();\n\n game.addTrialData(\n \"trial_end_iso8601_timestamp\",\n new Date().toISOString(),\n );\n const trialConfiguration = trialConfigurations[game.trialIndex];\n game.addTrialData(\"response_time_duration_ms\", rt);\n game.addTrialData(\n \"user_response\",\n differentPressed ? \"different\" : \"same\",\n );\n const correctResponse =\n (trialConfiguration.numberOfShapesWithDifferentColors === 0 &&\n !differentPressed) ||\n (trialConfiguration.numberOfShapesWithDifferentColors > 0 &&\n differentPressed);\n game.addTrialData(\"user_response_correct\", correctResponse);\n\n const presentShapes = trialConfiguration.presentShapes.map((p) => {\n return {\n shape_index: p.shapeIndex,\n color_name: p.colorName,\n rgba_color: p.color,\n location: p.location,\n };\n });\n game.addTrialData(\"present_shapes\", presentShapes);\n game.addTrialData(\"quit_button_pressed\", false);\n\n const responseShapes = trialConfiguration.responseShapes.map((p) => {\n return {\n shape_index: p.shapeIndex,\n color_name: p.colorName,\n rgba_color: p.color,\n location: p.location,\n };\n });\n game.addTrialData(\"response_shapes\", responseShapes);\n game.addTrialData(\"trial_index\", game.trialIndex);\n\n game.trialComplete();\n if (game.trialIndex < numberOfTrials) {\n game.presentScene(fixationScene);\n } else {\n if (game.getParameter<boolean>(\"scoring\")) {\n const scores = game.calculateScores(game.data.trials, {\n numberOfTrials: game.getParameter<number>(\"number_of_trials\"),\n });\n game.addScoringData(scores);\n game.scoringComplete();\n }\n\n if (game.getParameter(\"show_trials_complete_scene\")) {\n game.presentScene(\n doneScene,\n Transition.slide({\n direction: TransitionDirection.Left,\n duration: 500,\n easing: Easings.sinusoidalInOut,\n }),\n );\n } else {\n game.end();\n }\n }\n };\n\n // ==============================================================\n // SCENE: done. Show done message, with a button to exit.\n const doneScene = new Scene();\n game.addScene(doneScene);\n\n const doneSceneText = new Label({\n text: \"TRIALS_COMPLETE_SCENE_TEXT\",\n position: { x: 200, y: 400 },\n });\n doneScene.addChild(doneSceneText);\n\n const okButton = new Button({\n text: \"TRIALS_COMPLETE_SCENE_BUTTON_TEXT\",\n position: { x: 200, y: 650 },\n });\n okButton.isUserInteractionEnabled = true;\n okButton.onTapDown(() => {\n // don't allow repeat taps of ok button\n okButton.isUserInteractionEnabled = false;\n doneScene.removeAllChildren();\n game.end();\n });\n doneScene.addChild(okButton);\n doneScene.onSetup(() => {\n // no need to have cancel button, because we're done\n game.removeAllFreeNodes();\n });\n }\n\n calculateScores(\n data: ActivityKeyValueData[],\n extras: {\n numberOfTrials: number;\n },\n ) {\n const dc = new DataCalc(data);\n const scores = dc\n .summarize({\n activity_begin_iso8601_timestamp: this.beginIso8601Timestamp,\n first_trial_begin_iso8601_timestamp: dc\n .arrange(\"trial_begin_iso8601_timestamp\")\n .slice(0)\n .pull(\"trial_begin_iso8601_timestamp\"),\n last_trial_end_iso8601_timestamp: dc\n .arrange(\"-trial_end_iso8601_timestamp\")\n .slice(0)\n .pull(\"trial_end_iso8601_timestamp\"),\n n_trials: dc.length,\n flag_trials_match_expected: dc.length === extras.numberOfTrials ? 1 : 0,\n n_trials_correct: dc.filter((obs) => obs.user_response_correct === true)\n .length,\n n_trials_incorrect: dc.filter(\n (obs) => obs.user_response_correct === false,\n ).length,\n })\n .mutate({\n participant_score: (obs) =>\n obs.n_trials > 0 ? (obs.n_trials_correct / obs.n_trials) * 100 : null,\n });\n return scores.observations;\n }\n\n private makeShapes(svgHeight: number) {\n const shape01 = new Shape({\n path: {\n pathString: shapePathStrings[0],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shape02 = new Shape({\n path: {\n pathString: shapePathStrings[1],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n // note: shape03 is purposively smaller (.8 height of other shapes)\n const shape03 = new Shape({\n path: {\n pathString: shapePathStrings[2],\n height: svgHeight * 0.8,\n },\n lineWidth: 0,\n });\n\n const shape04 = new Shape({\n path: {\n pathString: shapePathStrings[3],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n // note: shape05 is purposively smaller (.8 height of other shapes)\n const shape05 = new Shape({\n path: {\n pathString: shapePathStrings[4],\n height: svgHeight * 0.8,\n },\n lineWidth: 0,\n });\n\n const shape06 = new Shape({\n path: {\n pathString: shapePathStrings[5],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shape07 = new Shape({\n path: {\n pathString: shapePathStrings[6],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shape08 = new Shape({\n path: {\n pathString: shapePathStrings[7],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shapes = [\n shape01,\n shape02,\n shape03,\n shape04,\n shape05,\n shape06,\n shape07,\n shape08,\n ];\n return shapes;\n }\n}\n\nconst shapePathStrings = [\n \"M0 89.94v-2L131.95 0h2v88.7c2.34 1.6 4.47 3.11 6.65 4.55 42.77 28.22 85.54 56.42 128.3 84.63v2c-44.65 29.65-89.3 59.29-133.95 88.94h-1v-90.84C89.44 148.72 44.72 119.33 0 89.94Z\",\n \"M162 188c-.33 27-.67 54-1 81-26.87-26.18-53.74-52.35-80-77.94V269H0C0 180.83 0 92.67.04 4.5.04 3 .67 1.5 1 0c24.64 29.1 49.15 58.31 73.96 87.26 28.88 33.7 58.01 67.17 87.04 100.74Z\",\n \"M3 148.86V61.12C41.76 40.75 80.52 20.37 119.28 0h2.91c21.32 20.7 42.64 41.4 63.96 62.11v89.71c-38.44 20.04-76.88 40.09-115.31 60.13h-2.91L3.01 148.86Z\",\n \"M134 0h2c7.26 22.31 14.38 44.67 21.86 66.9 3.91 11.61 5.47 29.91 13.25 33.27C203 113.94 236.86 123.13 270 134v1L136 269h-1c-11.04-33.58-22.08-67.16-33.21-101.03C67.87 156.98 33.93 145.99 0 135v-1L134 0Z\",\n \"M107 0h1l108 108v1c-26.67 35.33-53.33 70.66-80 106h-1c-8.82-35.03-17.64-70.07-27-107.28C98.62 145.01 89.81 180 81.01 215h-1C53.33 179.66 26.67 144.33 0 109v-2L107 0Z\",\n \"M0 1C2.17.67 4.33.05 6.5.04 58.33-.01 110.17 0 162 0v270H2c26.2-22.17 52.41-44.33 78.86-66.71V67.4c-3.85-3.22-7.35-6.2-10.9-9.11C46.64 39.18 23.32 20.09 0 1Z\",\n \"M95 268.99h-1C62.66 238.66 31.33 208.33 0 178V88C26.67 58.67 53.33 29.33 80 0h1c0 29.45 0 58.89-.01 88.38 35.99 29.57 72 59.09 108.01 88.61v1l-94 91Z\",\n \"M13 0h67l135 135v1L81 270c-27-.33-54-.67-81-1 11.73-12.51 23.61-24.87 35.16-37.54 33.14-36.35 66.14-72.82 100.23-110.38C94.4 80.52 53.7 40.26 13 0Z\",\n];\n\nexport { ColorShapes };\n"],"names":["M2Error"],"mappings":";;;AAAA,MAAM,gBAAgB,KAAA,CAAM;AAAA,EAC1B,eAAe,MAAA,EAAQ;AACrB,IAAA,KAAA,CAAM,GAAG,MAAM,CAAA;AACf,IAAA,IAAA,CAAK,IAAA,GAAO,SAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,OAAA,CAAQ,SAAS,C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IAAA,MAAM,OAAA,GAAU,IAAI,KAAA,CAAM;AAAA,MACxB,IAAA,EAAM;AAAA,QACJ,UAAA,EAAY,iBAAiB,CAAC,CAAA;AAAA,QAC9B,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,SAAA,EAAW;AAAA,KACZ,CAAA;AAED,IAAA,MAAM,OAAA,GAAU,IAAI,KAAA,CAAM;AAAA,MACxB,IAAA,EAAM;AAAA,QACJ,UAAA,EAAY,iBAAiB,CAAC,CAAA;AAAA,QAC9B,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,SAAA,EAAW;AAAA,KACZ,CAAA;AAED,IAAA,MAAM,OAAA,GAAU,IAAI,KAAA,CAAM;AAAA,MACxB,IAAA,EAAM;AAAA,QACJ,UAAA,EAAY,iBAAiB,CAAC,CAAA;AAAA,QAC9B,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,SAAA,EAAW;AAAA,KACZ,CAAA;AAED,IAAA,MAAM,MAAA,GAAS;AAAA,MACb,OAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACF;AAEA,MAAM,gBAAA,GAAmB;AAAA,EACvB,kLAAA;AAAA,EACA,sLAAA;AAAA,EACA,wJAAA;AAAA,EACA,4MAAA;AAAA,EACA,uKAAA;AAAA,EACA,+JAAA;AAAA,EACA,uJAAA;AAAA,EACA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../data-calc/dist/index.js","../src/index.ts"],"sourcesContent":["//#region src/M2Error.ts\n/**\n* Custom error class for m2c2kit errors.\n*\n* @remarks This is the same class as in the m2c2kit core package. This simple\n* code is copied from that package to avoid taking a dependency on it.\n*/\nvar M2Error = class extends Error {\n\t/**\n\t* @param message - The error message.\n\t* @param options - Optional object containing an error 'cause' for error chaining.\n\t*/\n\tconstructor(message, options) {\n\t\tsuper(message);\n\t\tif (options && \"cause\" in options) this.cause = options.cause;\n\t\tthis.name = \"M2Error\";\n\t\tif (new.target) Object.setPrototypeOf(this, new.target.prototype);\n\t\tif (\"captureStackTrace\" in Error && typeof Error.captureStackTrace === \"function\") Error.captureStackTrace(this, new.target);\n\t\telse if (!this.stack) this.stack = new Error(message).stack;\n\t}\n\t/**\n\t* Structured JSON representation for logging, telemetry, and transport.\n\t*/\n\ttoJSON() {\n\t\tconst json = {\n\t\t\tname: this.name,\n\t\t\tmessage: this.message,\n\t\t\tstack: this.stack\n\t\t};\n\t\tif (this.cause !== void 0) if (this.cause instanceof Error) {\n\t\t\tconst causeWithToJSON = this.cause;\n\t\t\tif (typeof causeWithToJSON.toJSON === \"function\") json.cause = causeWithToJSON.toJSON();\n\t\t\telse {\n\t\t\t\tconst serialized = {\n\t\t\t\t\tname: this.cause.name,\n\t\t\t\t\tmessage: this.cause.message,\n\t\t\t\t\tstack: this.cause.stack\n\t\t\t\t};\n\t\t\t\tconst causeRecord = this.cause;\n\t\t\t\tfor (const key of Object.keys(causeRecord)) if (!(key in serialized)) serialized[key] = causeRecord[key];\n\t\t\t\tjson.cause = serialized;\n\t\t\t}\n\t\t} else json.cause = this.cause;\n\t\tconst thisRecord = this;\n\t\tfor (const key of Object.keys(thisRecord)) if (!(key in json)) json[key] = thisRecord[key];\n\t\treturn json;\n\t}\n};\n//#endregion\n//#region \\0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js\nfunction _typeof(o) {\n\t\"@babel/helpers - typeof\";\n\treturn _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o) {\n\t\treturn typeof o;\n\t} : function(o) {\n\t\treturn o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n\t}, _typeof(o);\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js\nfunction toPrimitive(t, r) {\n\tif (\"object\" != _typeof(t) || !t) return t;\n\tvar e = t[Symbol.toPrimitive];\n\tif (void 0 !== e) {\n\t\tvar i = e.call(t, r || \"default\");\n\t\tif (\"object\" != _typeof(i)) return i;\n\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t}\n\treturn (\"string\" === r ? String : Number)(t);\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js\nfunction toPropertyKey(t) {\n\tvar i = toPrimitive(t, \"string\");\n\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js\nfunction _defineProperty(e, r, t) {\n\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\tvalue: t,\n\t\tenumerable: !0,\n\t\tconfigurable: !0,\n\t\twritable: !0\n\t}) : e[r] = t, e;\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.134.0/helpers/esm/objectSpread2.js\nfunction ownKeys(e, r) {\n\tvar t = Object.keys(e);\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\tr && (o = o.filter(function(r) {\n\t\t\treturn Object.getOwnPropertyDescriptor(e, r).enumerable;\n\t\t})), t.push.apply(t, o);\n\t}\n\treturn t;\n}\nfunction _objectSpread2(e) {\n\tfor (var r = 1; r < arguments.length; r++) {\n\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r) {\n\t\t\t_defineProperty(e, r, t[r]);\n\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {\n\t\t\tObject.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n\t\t});\n\t}\n\treturn e;\n}\n//#endregion\n//#region src/ChainBuilder.ts\nconst CHAIN_REGISTRY = /* @__PURE__ */ new Map();\nconst MAX_CHAIN_REGISTRY_SIZE = 1e4;\nlet CHAIN_COUNTER = 0;\nfunction getChainOps(id) {\n\treturn CHAIN_REGISTRY.get(id);\n}\nfunction clearChainOps(id) {\n\tCHAIN_REGISTRY.delete(id);\n}\nfunction makeChainFn() {\n\tconst fn = ((dataCalc) => {\n\t\tif (!dataCalc) return void 0;\n\t\tlet current = dataCalc;\n\t\tfor (const op of fn.ops) {\n\t\t\tconst method = current[op.name];\n\t\t\tif (typeof method !== \"function\") throw new M2Error(`chain: method ${op.name} does not exist on DataCalc`);\n\t\t\tconst res = method.apply(current, op.args);\n\t\t\tif (res instanceof DataCalc) {\n\t\t\t\tcurrent = res;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\t});\n\tfn.ops = [];\n\tconst record = (name, args) => {\n\t\tfn.ops.push({\n\t\t\tname,\n\t\t\targs\n\t\t});\n\t\treturn fn;\n\t};\n\tfn.arrange = (...variables) => record(\"arrange\", variables);\n\tfn.slice = (start, end) => record(\"slice\", [start, end]);\n\tfn.pull = (variable) => record(\"pull\", [variable]);\n\tfn.filter = (predicate) => record(\"filter\", [predicate]);\n\tfn.mutate = (mutations) => record(\"mutate\", [mutations]);\n\tfn.select = (...variables) => record(\"select\", variables);\n\tfn.groupBy = (...groups) => record(\"groupBy\", groups);\n\tfn.ungroup = () => record(\"ungroup\", []);\n\tfn.rename = (renames) => record(\"rename\", [renames]);\n\tfn.distinct = () => record(\"distinct\", []);\n\tObject.defineProperty(fn, \"length\", {\n\t\tconfigurable: true,\n\t\tget: function() {\n\t\t\ttry {\n\t\t\t\tconst id = `c${++CHAIN_COUNTER}`;\n\t\t\t\tCHAIN_REGISTRY.set(id, (fn.ops || []).map((o) => _objectSpread2({}, o)));\n\t\t\t\tif (CHAIN_REGISTRY.size > MAX_CHAIN_REGISTRY_SIZE) {\n\t\t\t\t\tconst firstKey = CHAIN_REGISTRY.keys().next().value;\n\t\t\t\t\tif (firstKey) CHAIN_REGISTRY.delete(firstKey);\n\t\t\t\t}\n\t\t\t\treturn `__CHAIN_EXPR__[${id}]`;\n\t\t\t} catch (err) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n\treturn fn;\n}\n/**\n* Adds an `arrange` operation to the chain for use in `summarize()`.\n*\n* Sorts the observations based on one or more variables. Variables may be\n* prefixed with `-` for descending order.\n*\n* Mirrors the instance method {@link DataCalc.arrange()}\n*\n* @param variables Names of variables to sort by, prefixed with '-' for descending order\n* @returns A chain function with the arrange operation added\n* @example\n* arrange('a', '-b')\n*/\nfunction arrange(...variables) {\n\treturn makeChainFn().arrange(...variables);\n}\n/**\n* Adds a `slice` operation to the chain for use in `summarize()`.\n*\n* Subsets observations by index range.\n* The `start` index is inclusive and `end` is exclusive when provided.\n*\n* Mirrors the instance method {@link DataCalc.slice()}\n*\n* @param start Inclusive start index\n* @param end Optional exclusive end index\n* @returns A chain function with the slice operation added\n* @example\n* slice(0, 10)\n*/\nfunction slice(start, end) {\n\treturn makeChainFn().slice(start, end);\n}\n/**\n* Adds a `pull(variable)` operation to the chain for use in `summarize()`.\n*\n* Extracts a single variable from the data. If the variable length is 1 a\n* scalar is returned, otherwise an array of values is returned.\n*\n* Mirrors the instance method {@link DataCalc.pull()}\n*\n* @param variable Name of the variable to pull\n* @returns A chain function with the pull operation added\n* @example\n* pull('response_time')\n*/\nfunction pull(variable) {\n\treturn makeChainFn().pull(variable);\n}\n/**\n* Adds a `filter(predicate)` operation to the chain for use in `summarize()`.\n*\n* Filters observations based on a predicate function.\n*\n* Mirrors the instance method {@link DataCalc.filter()}\n*\n* @param predicate A function that returns true for observations to keep\n* @returns A chain function with the filter operation added\n* @example\n* filter(obs => obs.correct)\n*/\nfunction filter(predicate) {\n\treturn makeChainFn().filter(predicate);\n}\n/**\n* Adds a `mutate(mutations)` operation to the chain for use in `summarize()`.\n*\n* Adds new variables to observations based on the provided mutation options.\n* `mutations` is an object where keys are the names of the new variables and\n* values are functions that take an observation and return the value for the\n* new variable.\n*\n* Mirrors the instance method {@link DataCalc.mutate()}\n*\n* @param mutations Object mapping new variable names to transform functions\n* @returns A chain function with the mutate operation added\n* @example\n* mutate({ doubledA: obs => obs.a * 2 })\n*/\nfunction mutate(mutations) {\n\treturn makeChainFn().mutate(mutations);\n}\n/**\n* Adds a `select(...variables)` operation to the chain for use in `summarize()`.\n*\n* Selects specific variables to keep in the dataset. Variables prefixed with\n* `-` will be excluded from the result.\n*\n* Mirrors the instance method {@link DataCalc.select()}\n*\n* @param variables Names of variables to select; prefix with '-' to exclude\n* @returns A chain function with the select operation added\n* @example\n* select('a', 'c')\n*/\nfunction select(...variables) {\n\treturn makeChainFn().select(...variables);\n}\n/**\n* Adds a `groupBy(...groups)` operation to the chain for use in `summarize()`.\n*\n* Groups observations by one or more variables. This is used with\n* `summarize()` to calculate summaries by group. Grouping variables must be\n* primitive values (string, number, boolean).\n*\n* Mirrors the instance method {@link DataCalc.groupBy()}\n*\n* @param groups Variable names to group by\n* @returns A chain function with the groupBy operation added\n* @example\n* groupBy('condition')\n*/\nfunction groupBy(...groups) {\n\treturn makeChainFn().groupBy(...groups);\n}\n/**\n* Adds an `ungroup()` operation to the chain for use in `summarize()`.\n*\n* Ungroups observations so subsequent operations are applied globally.\n*\n* Mirrors the instance method {@link DataCalc.ungroup()}\n*\n* @returns A chain function with the ungroup operation added\n*/\nfunction ungroup() {\n\treturn makeChainFn().ungroup();\n}\n/**\n* Adds a `rename(renames)` operation to the chain for use in `summarize()`.\n*\n* Renames variables in the observations. `renames` should be an object\n* mapping new variable names to old variable names.\n*\n* Mirrors the instance method {@link DataCalc.rename()}\n*\n* @param renames Object mapping new variable names to old variable names\n* @returns A chain function with the rename operation added\n* @example\n* rename({ x: 'a', z: 'c' })\n*/\nfunction rename(renames) {\n\treturn makeChainFn().rename(renames);\n}\n/**\n* Adds a `distinct()` operation to the chain for use in `summarize()`.\n*\n* Keeps only unique observations.\n*\n* Mirrors the instance method {@link DataCalc.distinct()}\n*\n* @returns A chain function with the distinct operation added\n*/\nfunction distinct() {\n\treturn makeChainFn().distinct();\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.134.0/helpers/esm/objectWithoutPropertiesLoose.js\nfunction _objectWithoutPropertiesLoose(r, e) {\n\tif (null == r) return {};\n\tvar t = {};\n\tfor (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n\t\tif (e.includes(n)) continue;\n\t\tt[n] = r[n];\n\t}\n\treturn t;\n}\n//#endregion\n//#region \\0@oxc-project+runtime@0.134.0/helpers/esm/objectWithoutProperties.js\nfunction _objectWithoutProperties(e, t) {\n\tif (null == e) return {};\n\tvar o, r, i = _objectWithoutPropertiesLoose(e, t);\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar s = Object.getOwnPropertySymbols(e);\n\t\tfor (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n\t}\n\treturn i;\n}\n//#endregion\n//#region src/DataCalc.ts\nconst _excluded = [\"get\", \"set\"];\nvar DataCalc = class DataCalc {\n\t/**\n\t* A class for transformation and calculation of m2c2kit data.\n\t*\n\t* @remarks The purpose is to provide a simple and intuitive interface for\n\t* assessments to score and summarize their own data. It is not meant for\n\t* data analysis or statistical modeling. The idiomatic approach is based on the\n\t* dplyr R package.\n\t*\n\t* @param data - An array of observations, where each observation is a set of\n\t* key-value pairs of variable names and values.\n\t* @param options - Options, such as groups to group the data by\n\t* @example\n\t* ```js\n\t* const dc = new DataCalc(gameData.trials);\n\t* const mean_response_time_correct_trials = dc\n\t* .filter((obs) => obs.correct_response_index === obs.user_response_index)\n\t* .summarize({ mean_rt: mean(\"response_time_duration_ms\") })\n\t* .pull(\"mean_rt\");\n\t* ```\n\t*/\n\tconstructor(data, options) {\n\t\tthis._groups = new Array();\n\t\tthis._warnings = false;\n\t\tif (!Array.isArray(data)) throw new M2Error(\"DataCalc constructor expects an array of observations as first argument\");\n\t\tfor (let i = 0; i < data.length; i++) if (data[i] === null || typeof data[i] !== \"object\" || Array.isArray(data[i])) throw new M2Error(`DataCalc constructor expects all elements to be objects (observations). Element at index ${i} is ${typeof data[i]}. Element: ${JSON.stringify(data[i])}`);\n\t\tthis._observations = this.deepCopy(data);\n\t\tif (!(options === null || options === void 0 ? void 0 : options.skipNormalization)) {\n\t\t\tconst allVariables = /* @__PURE__ */ new Set();\n\t\t\tfor (const observation of data) for (const key of Object.keys(observation)) allVariables.add(key);\n\t\t\tfor (const observation of this._observations) for (const variable of allVariables) if (!(variable in observation)) observation[variable] = null;\n\t\t}\n\t\tif (options === null || options === void 0 ? void 0 : options.groups) this._groups = Array.from(options.groups);\n\t\tif (options === null || options === void 0 ? void 0 : options.warnings) this._warnings = true;\n\t}\n\t/**\n\t* Returns the groups in the data.\n\t*/\n\tget groups() {\n\t\treturn this._groups;\n\t}\n\t/**\n\t* Returns the observations in the data.\n\t*\n\t* @remarks An observation is conceptually similar to a row in a dataset,\n\t* where the keys are the variable names and the values are the variable values.\n\t*/\n\tget observations() {\n\t\treturn this._observations;\n\t}\n\t/**\n\t* Alias for the observations property.\n\t*/\n\tget rows() {\n\t\treturn this._observations;\n\t}\n\t/**\n\t* Returns a single variable from the data.\n\t*\n\t* @remarks If the variable length is 1, the value is returned. If the\n\t* variable has length > 1, an array of values is returned. If an empty\n\t* dataset is provided, `null` is returned and a warning is logged.\n\t*\n\t* @param variable - Name of variable to pull from the data\n\t* @returns the value of the variable\n\t*\n\t* @example\n\t* ```js\n\t* const d = [{ a: 1, b: 2, c: 3 }];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.pull(\"c\")\n\t* ); // 3\n\t* ```\n\t*/\n\tpull(variable) {\n\t\tif (this._observations.length === 0) {\n\t\t\tif (this._warnings) console.warn(`DataCalc.pull(): No observations available to pull variable \"${variable}\" from. Returning null.`);\n\t\t\treturn null;\n\t\t}\n\t\tthis.verifyObservationsContainVariable(variable);\n\t\tconst values = this._observations.map((o) => o[variable]);\n\t\tif (values.length === 1) return values[0];\n\t\treturn values;\n\t}\n\t/**\n\t* Returns a single variable value from the data, throwing an error if more than one row exists.\n\t*\n\t* @remarks If the variable length is 1, the value is returned. If the\n\t* variable has length > 1, an error is thrown. If an empty dataset is\n\t* provided, `null` is returned and a warning is logged.\n\t*\n\t* @param variable - Name of variable to pull from the data\n\t* @returns the value of the variable\n\t*\n\t* @example\n\t* ```js\n\t* const d = [{ a: 1, b: 2, c: 3 }];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.pullScalar(\"c\")\n\t* ); // 3\n\t* ```\n\t*/\n\tpullScalar(variable) {\n\t\tif (this._observations.length === 0) {\n\t\t\tif (this._warnings) console.warn(`DataCalc.pullScalar(): No observations available to pull variable \"${variable}\" from. Returning null.`);\n\t\t\treturn null;\n\t\t}\n\t\tif (this._observations.length > 1) throw new M2Error(`DataCalc.pullScalar(): Expected 1 observation, but found ${this._observations.length}. Use pull() or pullArray() instead.`);\n\t\tthis.verifyObservationsContainVariable(variable);\n\t\treturn this._observations[0][variable];\n\t}\n\t/**\n\t* Returns a variable from the data as an array, even if there is only one row.\n\t*\n\t* @remarks If an empty dataset is provided, `null` is returned and a warning is logged.\n\t*\n\t* @param variable - Name of variable to pull from the data\n\t* @returns an array of values for the variable\n\t*\n\t* @example\n\t* ```js\n\t* const d = [{ a: 1, b: 2, c: 3 }];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.pullArray(\"c\")\n\t* ); // [3]\n\t* ```\n\t*/\n\tpullArray(variable) {\n\t\tif (this._observations.length === 0) {\n\t\t\tif (this._warnings) console.warn(`DataCalc.pullArray(): No observations available to pull variable \"${variable}\" from. Returning null.`);\n\t\t\treturn null;\n\t\t}\n\t\tthis.verifyObservationsContainVariable(variable);\n\t\treturn this._observations.map((o) => o[variable]);\n\t}\n\t/**\n\t* Returns the number of observations in the data.\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 }\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.length\n\t* ); // 2\n\t* ```\n\t*/\n\tget length() {\n\t\treturn this._observations.length;\n\t}\n\t/**\n\t* Filters observations based on a predicate function.\n\t*\n\t* @param predicate - A function that returns true for observations to keep and\n\t* false for observations to discard\n\t* @returns A new `DataCalc` object with only the observations that pass the\n\t* predicate function\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(dc.filter((obs) => obs.b >= 3).observations);\n\t* // [ { a: 0, b: 8, c: 3 }, { a: 9, b: 4, c: 7 } ]\n\t* ```\n\t*/\n\tfilter(predicate) {\n\t\tif (this._groups.length > 0) throw new M2Error(`filter() cannot be used on grouped data. The data are currently grouped by ${this._groups.join(\", \")}. Ungroup the data first using ungroup().`);\n\t\treturn new DataCalc(this._observations.filter(predicate), {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings,\n\t\t\tskipNormalization: true\n\t\t});\n\t}\n\t/**\n\t* Groups observations by one or more variables.\n\t*\n\t* @remarks This is used with the `summarize()` method to calculate summaries\n\t* by group.\n\t*\n\t* @param groups - variable names to group by. Grouping variables must be\n\t* primitive values (string, number, boolean).\n\t* @returns A new `DataCalc` object with the observations grouped by one or\n\t* more variables\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* { a: 5, b: 0, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* const grouped = dc.groupBy(\"c\");\n\t* // subsequent summarize operations will be performed separately by\n\t* // each unique level of c, in this case, 3 and 7\n\t* ```\n\t*/\n\tgroupBy(...groups) {\n\t\tgroups.forEach((group) => {\n\t\t\tthis.verifyObservationsContainVariable(group);\n\t\t\tfor (let i = 0; i < this._observations.length; i++) {\n\t\t\t\tconst val = this._observations[i][group];\n\t\t\t\tif (val === null) continue;\n\t\t\t\tconst t = typeof val;\n\t\t\t\tif (t !== \"number\" && t !== \"string\" && t !== \"boolean\") throw new M2Error(`groupBy(): variable \"${group}\" contains non-primitive value at index ${i} (type=${t}). Only number, string, boolean, or null are allowed for grouping.`);\n\t\t\t}\n\t\t});\n\t\treturn new DataCalc(this._observations, {\n\t\t\tgroups,\n\t\t\tskipNormalization: true\n\t\t});\n\t}\n\t/**\n\t* Ungroups observations.\n\t*\n\t* @returns A new DataCalc object with the observations ungrouped\n\t*/\n\tungroup() {\n\t\treturn new DataCalc(this._observations, { skipNormalization: true });\n\t}\n\t/**\n\t* Adds new variables to the observations based on the provided mutation options.\n\t*\n\t* @param mutations - An object where the keys are the names of the new variables\n\t* and the values are functions that take an observation and return the value\n\t* for the new variable.\n\t* @returns A new DataCalc object with the new variables added to the observations.\n\t*\n\t* @example\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.mutate({ doubledA: (obs) => obs.a * 2 }).observations\n\t* );\n\t* // [ { a: 1, b: 2, c: 3, doubledA: 2 },\n\t* // { a: 0, b: 8, c: 3, doubledA: 0 },\n\t* // { a: 9, b: 4, c: 7, doubledA: 18 } ]\n\t*/\n\tmutate(mutations) {\n\t\tif (this._groups.length > 0) throw new M2Error(`mutate() cannot be used on grouped data. The data are currently grouped by ${this._groups.join(\", \")}. Ungroup the data first using ungroup().`);\n\t\treturn new DataCalc(this._observations.map((observation) => {\n\t\t\tlet newObservation = _objectSpread2({}, observation);\n\t\t\tfor (const [newVariable, transformFunction] of Object.entries(mutations)) newObservation = _objectSpread2(_objectSpread2({}, newObservation), {}, { [newVariable]: transformFunction(observation) });\n\t\t\treturn newObservation;\n\t\t}), {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings\n\t\t});\n\t}\n\t/**\n\t* Calculates summaries of the data.\n\t*\n\t* @param summarizations - An object where the keys are the names of the new\n\t* variables and the values are `DataCalc` summary functions: `sum()`,\n\t* `mean()`, `median()`, `variance()`, `sd()`, `min()`, `max()`, or `n()`.\n\t* The summary functions take a variable name as a string, or alternatively,\n\t* a value or array of values to summarize.\n\t* @returns A new `DataCalc` object with the new summary variables.\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* { a: 5, b: 0, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.summarize({\n\t* meanA: mean(\"a\"),\n\t* varA: variance(\"a\"),\n\t* totalB: sum(\"b\")\n\t* }).observations\n\t* );\n\t* // [ { meanA: 3.75, varA: 16.916666666666668, totalB: 14 } ]\n\t*\n\t* console.log(\n\t* dc.summarize({\n\t* filteredTotalC: sum(dc.filter(obs => obs.b > 2).pull(\"c\"))\n\t* }).observations\n\t* );\n\t* // [ { filteredTotalC: 10 } ]\n\t* ```\n\t*\n\t* @remarks Within a `summarize()` call, regular arithmetic operations\n\t* (+, -, *, /, etc.) must not be used directly on `DataCalc` objects\n\t* or summary functions. This is not allowed:\n\t*\n\t* @example\n\t* ```js\n\t* dc.summarize({\n\t* meanA: mean(\"a\"),\n\t* // The below will cause an error because it attempts to add a number\n\t* // to a DataCalc object, which is not supported\n\t* totalBPlus5: sum(\"b\") + 5\n\t* })\n\t* ```\n\t*\n\t* Instead, use the `DataCalc` helper functions such as `add` to perform\n\t* calculations within summary results. For example, to add 5 to the sum\n\t* of \"b\", you can do:\n\t* @example\n\t* ```js\n\t* dc.summarize({\n\t* meanA: mean(\"a\"),\n\t* totalBPlus5: sum(\"b\").add(5)\n\t* })\n\t* ```\n\t*/\n\tsummarize(summarizations) {\n\t\tif (this._groups.length === 0) {\n\t\t\tconst obs = {};\n\t\t\tfor (const [newVariable, value] of Object.entries(summarizations)) if (typeof value === \"object\" && value !== null && \"summarizeFunction\" in value) {\n\t\t\t\tconst summarizeOperation = value;\n\t\t\t\tobs[newVariable] = summarizeOperation.summarizeFunction(this, summarizeOperation.parameters, summarizeOperation.options);\n\t\t\t} else if (typeof value === \"function\") try {\n\t\t\t\tconst res = value(this);\n\t\t\t\tif (typeof res === \"function\") throw new M2Error(`summarize(): lazy callback for ${newVariable} returned a function; expected a value or array of values.`);\n\t\t\t\tif (res instanceof DataCalc) throw new M2Error(`summarize(): lazy callback for ${newVariable} returned a DataCalc; expected a value or array of values.`);\n\t\t\t\tobs[newVariable] = res;\n\t\t\t} catch (err) {\n\t\t\t\tthrow new M2Error(`summarize(): lazy callback for ${newVariable} threw an error: ${err && err.message ? err.message : String(err)}`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (typeof value === \"string\") {\n\t\t\t\t\tconst matches = Array.from(Helpers.matchAll(value, /__CHAIN_EXPR__\\[(.*?)\\]/g));\n\t\t\t\t\tif (matches.length > 0) {\n\t\t\t\t\t\tlet sum = 0;\n\t\t\t\t\t\tfor (const m of matches) {\n\t\t\t\t\t\t\tconst payload = m[1];\n\t\t\t\t\t\t\tlet ops = getChainOps(payload);\n\t\t\t\t\t\t\tif (!ops) try {\n\t\t\t\t\t\t\t\tops = JSON.parse(decodeURIComponent(payload));\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tthrow new M2Error(`summarize(): failed to parse chain payload for ${newVariable}`);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet current = this;\n\t\t\t\t\t\t\tlet evaluated = void 0;\n\t\t\t\t\t\t\tif (!ops) throw new M2Error(`summarize(): empty chain ops for ${newVariable}`);\n\t\t\t\t\t\t\tfor (const op of ops) {\n\t\t\t\t\t\t\t\tconst method = current[op.name];\n\t\t\t\t\t\t\t\tif (typeof method !== \"function\") throw new M2Error(`summarize(): chain method ${op.name} does not exist on DataCalc`);\n\t\t\t\t\t\t\t\tconst res = method.apply(current, op.args);\n\t\t\t\t\t\t\t\tif (res instanceof DataCalc) {\n\t\t\t\t\t\t\t\t\tcurrent = res;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (Array.isArray(res)) {\n\t\t\t\t\t\t\t\t\tevaluated = res.length;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (typeof res === \"boolean\") {\n\t\t\t\t\t\t\t\t\tevaluated = res ? 1 : 0;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tevaluated = typeof res === \"number\" ? res : Number(res);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (evaluated === void 0) evaluated = current instanceof DataCalc ? current.length : 0;\n\t\t\t\t\t\t\tsum += evaluated;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet leftover = value;\n\t\t\t\t\t\tfor (const m of matches) leftover = leftover.replace(m[0], \"\");\n\t\t\t\t\t\tconst leftoverNum = Number(leftover);\n\t\t\t\t\t\tif (!Number.isNaN(leftoverNum)) sum += leftoverNum;\n\t\t\t\t\t\tobs[newVariable] = sum;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tobs[newVariable] = value;\n\t\t\t}\n\t\t\treturn new DataCalc([obs], {\n\t\t\t\tgroups: this._groups,\n\t\t\t\twarnings: this._warnings\n\t\t\t});\n\t\t}\n\t\treturn this.summarizeByGroups(summarizations);\n\t}\n\tsummarizeByGroups(summarizations) {\n\t\tconst groupMap = /* @__PURE__ */ new Map();\n\t\tthis._observations.forEach((obs) => {\n\t\t\tconst groupKey = this._groups.map((g) => String(obs[g])).join(\"|\");\n\t\t\tif (!groupMap.has(groupKey)) groupMap.set(groupKey, []);\n\t\t\tconst groupArray = groupMap.get(groupKey);\n\t\t\tif (groupArray) groupArray.push(obs);\n\t\t\telse groupMap.set(groupKey, [obs]);\n\t\t});\n\t\tconst summarizedObservations = [];\n\t\tgroupMap.forEach((groupObs, groupKey) => {\n\t\t\tconst groupValues = groupKey.split(\"|\");\n\t\t\tconst firstObs = groupObs[0];\n\t\t\tconst summaryObj = {};\n\t\t\tthis._groups.forEach((group, i) => {\n\t\t\t\tconst valueStr = groupValues[i];\n\t\t\t\tif (firstObs[group] === null) summaryObj[group] = null;\n\t\t\t\telse {\n\t\t\t\t\tconst originalType = typeof firstObs[group];\n\t\t\t\t\tif (originalType === \"number\") summaryObj[group] = Number(valueStr);\n\t\t\t\t\telse if (originalType === \"boolean\") summaryObj[group] = valueStr === \"true\";\n\t\t\t\t\telse summaryObj[group] = valueStr;\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst groupDataCalc = new DataCalc(groupObs);\n\t\t\tfor (const [newVariable, value] of Object.entries(summarizations)) if (typeof value === \"object\" && value !== null && \"summarizeFunction\" in value) {\n\t\t\t\tconst summarizeOperation = value;\n\t\t\t\tsummaryObj[newVariable] = summarizeOperation.summarizeFunction(groupDataCalc, summarizeOperation.parameters, summarizeOperation.options);\n\t\t\t} else if (typeof value === \"function\") try {\n\t\t\t\tconst res = value(groupDataCalc);\n\t\t\t\tif (typeof res === \"function\") throw new M2Error(`summarize(): lazy callback for ${newVariable} returned a function; expected a value or array of values.`);\n\t\t\t\tif (res instanceof DataCalc) throw new M2Error(`summarize(): lazy callback for ${newVariable} returned a DataCalc; expected a value or array of values.`);\n\t\t\t\tsummaryObj[newVariable] = res;\n\t\t\t} catch (err) {\n\t\t\t\tthrow new M2Error(`summarize(): lazy callback for ${newVariable} threw an error: ${err && err.message ? err.message : String(err)}`);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (typeof value === \"string\") {\n\t\t\t\t\tconst matches = Array.from(Helpers.matchAll(value, /__CHAIN_EXPR__\\[(.*?)\\]/g));\n\t\t\t\t\tif (matches.length > 0) {\n\t\t\t\t\t\tlet sum = 0;\n\t\t\t\t\t\tfor (const m of matches) {\n\t\t\t\t\t\t\tconst payload = m[1];\n\t\t\t\t\t\t\tlet ops = getChainOps(payload);\n\t\t\t\t\t\t\tif (!ops) try {\n\t\t\t\t\t\t\t\tops = JSON.parse(decodeURIComponent(payload));\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\tthrow new M2Error(`summarize(): failed to parse chain payload for ${newVariable}`);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet current = groupDataCalc;\n\t\t\t\t\t\t\tlet evaluated = void 0;\n\t\t\t\t\t\t\tif (!ops) throw new M2Error(`summarize(): empty chain ops for ${newVariable}`);\n\t\t\t\t\t\t\tfor (const op of ops) {\n\t\t\t\t\t\t\t\tconst method = current[op.name];\n\t\t\t\t\t\t\t\tif (typeof method !== \"function\") throw new M2Error(`summarize(): chain method ${op.name} does not exist on DataCalc`);\n\t\t\t\t\t\t\t\tconst res = method.apply(current, op.args);\n\t\t\t\t\t\t\t\tif (res instanceof DataCalc) {\n\t\t\t\t\t\t\t\t\tcurrent = res;\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (Array.isArray(res)) {\n\t\t\t\t\t\t\t\t\tevaluated = res.length;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (typeof res === \"boolean\") {\n\t\t\t\t\t\t\t\t\tevaluated = res ? 1 : 0;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tevaluated = typeof res === \"number\" ? res : Number(res);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (evaluated === void 0) evaluated = current instanceof DataCalc ? current.length : 0;\n\t\t\t\t\t\t\tsum += evaluated;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet leftover = value;\n\t\t\t\t\t\tfor (const m of matches) leftover = leftover.replace(m[0], \"\");\n\t\t\t\t\t\tconst leftoverNum = Number(leftover);\n\t\t\t\t\t\tif (!Number.isNaN(leftoverNum)) sum += leftoverNum;\n\t\t\t\t\t\tsummaryObj[newVariable] = sum;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsummaryObj[newVariable] = value;\n\t\t\t}\n\t\t\tsummarizedObservations.push(summaryObj);\n\t\t});\n\t\treturn new DataCalc(summarizedObservations, {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings\n\t\t});\n\t}\n\t/**\n\t* Selects specific variables to keep in the dataset.\n\t* Variables prefixed with \"-\" will be excluded from the result.\n\t*\n\t* @param variables - Names of variables to select; prefix with '-' to exclude instead\n\t* @returns A new DataCalc object with only the selected variables (minus excluded ones)\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3, d: 4 },\n\t* { a: 5, b: 6, c: 7, d: 8 }\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* // Keep a and c\n\t* console.log(dc.select(\"a\", \"c\").observations);\n\t* // [ { a: 1, c: 3 }, { a: 5, c: 7 } ]\n\t* ```\n\t*/\n\tselect(...variables) {\n\t\tconst includeVars = [];\n\t\tconst excludeVars = [];\n\t\tvariables.forEach((variable) => {\n\t\t\tif (variable.startsWith(\"-\")) excludeVars.push(variable.substring(1));\n\t\t\telse includeVars.push(variable);\n\t\t});\n\t\t[...includeVars.length > 0 ? includeVars : Object.keys(this._observations[0] || {}), ...excludeVars].forEach((variable) => {\n\t\t\tthis.verifyObservationsContainVariable(variable);\n\t\t});\n\t\tconst excludeSet = new Set(excludeVars);\n\t\treturn new DataCalc(this._observations.map((observation) => {\n\t\t\tconst newObservation = {};\n\t\t\tif (includeVars.length > 0) includeVars.forEach((variable) => {\n\t\t\t\tif (!excludeSet.has(variable)) newObservation[variable] = observation[variable];\n\t\t\t});\n\t\t\telse Object.keys(observation).forEach((key) => {\n\t\t\t\tif (!excludeSet.has(key)) newObservation[key] = observation[key];\n\t\t\t});\n\t\t\treturn newObservation;\n\t\t}), {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings\n\t\t});\n\t}\n\t/**\n\t* Arranges (sorts) the observations based on one or more variables.\n\t*\n\t* @param variables - Names of variables to sort by, prefixed with '-' for descending order\n\t* @returns A new DataCalc object with the observations sorted\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 5, b: 2 },\n\t* { a: 3, b: 7 },\n\t* { a: 5, b: 1 }\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* // Sort by a (ascending), then by b (descending)\n\t* console.log(dc.arrange(\"a\", \"-b\").observations);\n\t* // [ { a: 3, b: 7 }, { a: 5, b: 2 }, { a: 5, b: 1 } ]\n\t* ```\n\t*/\n\tarrange(...variables) {\n\t\tif (this._groups.length > 0) throw new M2Error(`arrange() cannot be used on grouped data. The data are currently grouped by ${this._groups.join(\", \")}. Ungroup the data first using ungroup().`);\n\t\treturn new DataCalc([...this._observations].sort((a, b) => {\n\t\t\tfor (const variable of variables) {\n\t\t\t\tlet varName = variable;\n\t\t\t\tlet direction = 1;\n\t\t\t\tif (variable.startsWith(\"-\")) {\n\t\t\t\t\tvarName = variable.substring(1);\n\t\t\t\t\tdirection = -1;\n\t\t\t\t}\n\t\t\t\tif (!(varName in a) || !(varName in b)) throw new M2Error(`arrange(): variable ${varName} does not exist in all observations`);\n\t\t\t\tconst aVal = a[varName];\n\t\t\t\tconst bVal = b[varName];\n\t\t\t\tif (typeof aVal !== typeof bVal) return direction * (String(aVal) < String(bVal) ? -1 : 1);\n\t\t\t\tif (aVal < bVal) return -1 * direction;\n\t\t\t\tif (aVal > bVal) return 1 * direction;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}), {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings,\n\t\t\tskipNormalization: true\n\t\t});\n\t}\n\t/**\n\t* Keeps only unique/distinct observations.\n\t*\n\t* @returns A new `DataCalc` object with only unique observations\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 1, b: 2, c: 3 }, // Duplicate\n\t* { a: 2, b: 3, c: 5 },\n\t* { a: 1, b: 2, c: { name: \"dog\" } },\n\t* { a: 1, b: 2, c: { name: \"dog\" } } // Duplicate with nested object\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(dc.distinct().observations);\n\t* // [ { a: 1, b: 2, c: 3 }, { a: 2, b: 3, c: 5 }, { a: 1, b: 2, c: { name: \"dog\" } } ]\n\t* ```\n\t*/\n\tdistinct() {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\treturn new DataCalc(this._observations.filter((obs) => {\n\t\t\tconst key = JSON.stringify(this.normalizeForComparison(obs));\n\t\t\tif (seen.has(key)) return false;\n\t\t\tseen.add(key);\n\t\t\treturn true;\n\t\t}), {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings,\n\t\t\tskipNormalization: true\n\t\t});\n\t}\n\t/**\n\t* Renames variables in the observations.\n\t*\n\t* @remarks If a target name in `renames` already exists in the dataset (and is not\n\t* simply the source name being renamed), the rename will overwrite the existing\n\t* variable. When warnings are enabled, a warning will be logged to make users aware\n\t* of the potential overwrite.\n\t*\n\t* @param renames - Object mapping new variable names to old variable names\n\t* @returns A new DataCalc object with renamed variables\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 4, b: 5, c: 6 }\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(dc.rename({ x: 'a', z: 'c' }).observations);\n\t* // [ { x: 1, b: 2, z: 3 }, { x: 4, b: 5, z: 6 } ]\n\t* ```\n\t*/\n\trename(renames) {\n\t\tif (this._observations.length === 0) throw new M2Error(\"Cannot rename variables on an empty dataset\");\n\t\tObject.values(renames).forEach((oldName) => {\n\t\t\tthis.verifyObservationsContainVariable(oldName);\n\t\t});\n\t\tif (this._observations.length > 0) {\n\t\t\tconst existingKeys = new Set(Object.keys(this._observations[0]));\n\t\t\tconst oldNames = new Set(Object.values(renames));\n\t\t\tconst collisions = Object.keys(renames).filter((n) => existingKeys.has(n) && !oldNames.has(n));\n\t\t\tif (collisions.length > 0 && this._warnings) console.warn(`DataCalc.rename(): renaming will overwrite existing variables: ${collisions.join(\", \")}`);\n\t\t}\n\t\treturn new DataCalc(this._observations.map((observation) => {\n\t\t\tconst newObservation = {};\n\t\t\tconst newNames = new Set(Object.keys(renames));\n\t\t\tfor (const [key, value] of Object.entries(observation)) {\n\t\t\t\tvar _Object$entries$find;\n\t\t\t\tconst newKey = (_Object$entries$find = Object.entries(renames).find(([, old]) => old === key)) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0];\n\t\t\t\tif (newKey) newObservation[newKey] = value;\n\t\t\t\telse if (!newNames.has(key)) newObservation[key] = value;\n\t\t\t}\n\t\t\treturn newObservation;\n\t\t}), {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings\n\t\t});\n\t}\n\t/**\n\t* Performs an inner join with another DataCalc object.\n\t* Only rows with matching keys in both datasets are included.\n\t*\n\t* @param other - The other DataCalc object to join with\n\t* @param by - The variables to join on\n\t* @returns A new DataCalc object with joined observations\n\t*\n\t* @example\n\t* ```js\n\t* const d1 = [\n\t* { id: 1, x: 'a' },\n\t* { id: 2, x: 'b' },\n\t* { id: 3, x: 'c' }\n\t* ];\n\t* const d2 = [\n\t* { id: 1, y: 100 },\n\t* { id: 2, y: 200 },\n\t* { id: 4, y: 400 }\n\t* ];\n\t* const dc1 = new DataCalc(d1);\n\t* const dc2 = new DataCalc(d2);\n\t* console.log(dc1.innerJoin(dc2, [\"id\"]).observations);\n\t* // [ { id: 1, x: 'a', y: 100 }, { id: 2, x: 'b', y: 200 } ]\n\t* ```\n\t*/\n\tinnerJoin(other, by) {\n\t\tif (this._groups.length > 0 || other._groups.length > 0) throw new M2Error(`innerJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`);\n\t\tby.forEach((key) => {\n\t\t\tthis.verifyObservationsContainVariable(key);\n\t\t\tother.verifyObservationsContainVariable(key);\n\t\t});\n\t\tconst rightMap = /* @__PURE__ */ new Map();\n\t\tother.observations.forEach((obs) => {\n\t\t\tif (this.hasNullJoinKeys(obs, by)) return;\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n\t\t\tconst matches = rightMap.get(key) || [];\n\t\t\tmatches.push(obs);\n\t\t\trightMap.set(key, matches);\n\t\t});\n\t\tconst result = [];\n\t\tthis._observations.forEach((leftObs) => {\n\t\t\tif (this.hasNullJoinKeys(leftObs, by)) return;\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n\t\t\tconst rightMatches = rightMap.get(key) || [];\n\t\t\tif (rightMatches.length > 0) rightMatches.forEach((rightObs) => {\n\t\t\t\tconst joinedObs = _objectSpread2({}, leftObs);\n\t\t\t\tObject.entries(rightObs).forEach(([k, v]) => {\n\t\t\t\t\tif (!by.includes(k)) joinedObs[k] = v;\n\t\t\t\t});\n\t\t\t\tresult.push(joinedObs);\n\t\t\t});\n\t\t});\n\t\treturn new DataCalc(result);\n\t}\n\t/**\n\t* Performs a left join with another DataCalc object.\n\t* All rows from the left dataset are included, along with matching rows from the right.\n\t*\n\t* @param other - The other DataCalc object to join with\n\t* @param by - The variables to join on\n\t* @returns A new DataCalc object with joined observations\n\t*\n\t* @example\n\t* ```js\n\t* const d1 = [\n\t* { id: 1, x: 'a' },\n\t* { id: 2, x: 'b' },\n\t* { id: 3, x: 'c' }\n\t* ];\n\t* const d2 = [\n\t* { id: 1, y: 100 },\n\t* { id: 2, y: 200 }\n\t* ];\n\t* const dc1 = new DataCalc(d1);\n\t* const dc2 = new DataCalc(d2);\n\t* console.log(dc1.leftJoin(dc2, [\"id\"]).observations);\n\t* // [ { id: 1, x: 'a', y: 100 }, { id: 2, x: 'b', y: 200 }, { id: 3, x: 'c' } ]\n\t* ```\n\t*/\n\tleftJoin(other, by) {\n\t\tif (this._groups.length > 0 || other._groups.length > 0) throw new M2Error(`leftJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`);\n\t\tby.forEach((key) => {\n\t\t\tthis.verifyObservationsContainVariable(key);\n\t\t\tother.verifyObservationsContainVariable(key);\n\t\t});\n\t\tconst rightMap = /* @__PURE__ */ new Map();\n\t\tother.observations.forEach((obs) => {\n\t\t\tif (this.hasNullJoinKeys(obs, by)) return;\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n\t\t\tconst matches = rightMap.get(key) || [];\n\t\t\tmatches.push(obs);\n\t\t\trightMap.set(key, matches);\n\t\t});\n\t\tconst result = [];\n\t\tthis._observations.forEach((leftObs) => {\n\t\t\tif (this.hasNullJoinKeys(leftObs, by)) {\n\t\t\t\tresult.push(_objectSpread2({}, leftObs));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n\t\t\tconst rightMatches = rightMap.get(key) || [];\n\t\t\tif (rightMatches.length > 0) rightMatches.forEach((rightObs) => {\n\t\t\t\tconst joinedObs = _objectSpread2({}, leftObs);\n\t\t\t\tObject.entries(rightObs).forEach(([k, v]) => {\n\t\t\t\t\tif (!by.includes(k)) joinedObs[k] = v;\n\t\t\t\t});\n\t\t\t\tresult.push(joinedObs);\n\t\t\t});\n\t\t\telse result.push(_objectSpread2({}, leftObs));\n\t\t});\n\t\treturn new DataCalc(result);\n\t}\n\t/**\n\t* Performs a right join with another DataCalc object.\n\t* All rows from the right dataset are included, along with matching rows from the left.\n\t*\n\t* @param other - The other DataCalc object to join with\n\t* @param by - The variables to join on\n\t* @returns A new DataCalc object with joined observations\n\t*\n\t* @example\n\t* ```js\n\t* const d1 = [\n\t* { id: 1, x: 'a' },\n\t* { id: 2, x: 'b' }\n\t* ];\n\t* const d2 = [\n\t* { id: 1, y: 100 },\n\t* { id: 2, y: 200 },\n\t* { id: 4, y: 400 }\n\t* ];\n\t* const dc1 = new DataCalc(d1);\n\t* const dc2 = new DataCalc(d2);\n\t* console.log(dc1.rightJoin(dc2, [\"id\"]).observations);\n\t* // [ { id: 1, x: 'a', y: 100 }, { id: 2, x: 'b', y: 200 }, { id: 4, y: 400 } ]\n\t* ```\n\t*/\n\trightJoin(other, by) {\n\t\tif (this._groups.length > 0 || other._groups.length > 0) throw new M2Error(`rightJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`);\n\t\tby.forEach((key) => {\n\t\t\tthis.verifyObservationsContainVariable(key);\n\t\t\tother.verifyObservationsContainVariable(key);\n\t\t});\n\t\tconst rightMap = /* @__PURE__ */ new Map();\n\t\tconst rightObsWithNullKeys = [];\n\t\tother.observations.forEach((obs) => {\n\t\t\tif (this.hasNullJoinKeys(obs, by)) {\n\t\t\t\trightObsWithNullKeys.push(obs);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n\t\t\tconst matches = rightMap.get(key) || [];\n\t\t\tmatches.push(obs);\n\t\t\trightMap.set(key, matches);\n\t\t});\n\t\tconst result = [];\n\t\tconst processedRightKeys = /* @__PURE__ */ new Set();\n\t\tthis._observations.forEach((leftObs) => {\n\t\t\tif (this.hasNullJoinKeys(leftObs, by)) return;\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n\t\t\tconst rightMatches = rightMap.get(key) || [];\n\t\t\tif (rightMatches.length > 0) {\n\t\t\t\trightMatches.forEach((rightObs) => {\n\t\t\t\t\tconst joinedObs = _objectSpread2({}, leftObs);\n\t\t\t\t\tObject.entries(rightObs).forEach(([k, v]) => {\n\t\t\t\t\t\tif (!by.includes(k)) joinedObs[k] = v;\n\t\t\t\t\t});\n\t\t\t\t\tresult.push(joinedObs);\n\t\t\t\t});\n\t\t\t\tprocessedRightKeys.add(key);\n\t\t\t}\n\t\t});\n\t\tother.observations.forEach((rightObs) => {\n\t\t\tif (this.hasNullJoinKeys(rightObs, by)) {\n\t\t\t\tresult.push(_objectSpread2({}, rightObs));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(rightObs[k]))).join(\"|\");\n\t\t\tif (!processedRightKeys.has(key)) {\n\t\t\t\tresult.push(_objectSpread2({}, rightObs));\n\t\t\t\tprocessedRightKeys.add(key);\n\t\t\t}\n\t\t});\n\t\treturn new DataCalc(result);\n\t}\n\t/**\n\t* Performs a full join with another DataCalc object.\n\t* All rows from both datasets are included.\n\t*\n\t* @param other - The other DataCalc object to join with\n\t* @param by - The variables to join on\n\t* @returns A new DataCalc object with joined observations\n\t*\n\t* @example\n\t* ```js\n\t* const d1 = [\n\t* { id: 1, x: 'a' },\n\t* { id: 2, x: 'b' },\n\t* { id: 3, x: 'c' }\n\t* ];\n\t* const d2 = [\n\t* { id: 1, y: 100 },\n\t* { id: 2, y: 200 },\n\t* { id: 4, y: 400 }\n\t* ];\n\t* const dc1 = new DataCalc(d1);\n\t* const dc2 = new DataCalc(d2);\n\t* console.log(dc1.fullJoin(dc2, [\"id\"]).observations);\n\t* // [\n\t* // { id: 1, x: 'a', y: 100 },\n\t* // { id: 2, x: 'b', y: 200 },\n\t* // { id: 3, x: 'c' },\n\t* // { id: 4, y: 400 }\n\t* // ]\n\t* ```\n\t*/\n\tfullJoin(other, by) {\n\t\tif (this._groups.length > 0 || other._groups.length > 0) throw new M2Error(`fullJoin() cannot be used on grouped data. Ungroup the data first using ungroup().`);\n\t\tby.forEach((key) => {\n\t\t\tthis.verifyObservationsContainVariable(key);\n\t\t\tother.verifyObservationsContainVariable(key);\n\t\t});\n\t\tconst rightMap = /* @__PURE__ */ new Map();\n\t\tconst rightObsWithNullKeys = [];\n\t\tother.observations.forEach((obs) => {\n\t\t\tif (this.hasNullJoinKeys(obs, by)) {\n\t\t\t\trightObsWithNullKeys.push(obs);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(obs[k]))).join(\"|\");\n\t\t\tconst matches = rightMap.get(key) || [];\n\t\t\tmatches.push(obs);\n\t\t\trightMap.set(key, matches);\n\t\t});\n\t\tconst result = [];\n\t\tconst processedRightKeys = /* @__PURE__ */ new Set();\n\t\tthis._observations.forEach((leftObs) => {\n\t\t\tif (this.hasNullJoinKeys(leftObs, by)) {\n\t\t\t\tresult.push(_objectSpread2({}, leftObs));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(leftObs[k]))).join(\"|\");\n\t\t\tconst rightMatches = rightMap.get(key) || [];\n\t\t\tif (rightMatches.length > 0) {\n\t\t\t\trightMatches.forEach((rightObs) => {\n\t\t\t\t\tconst joinedObs = _objectSpread2({}, leftObs);\n\t\t\t\t\tObject.entries(rightObs).forEach(([k, v]) => {\n\t\t\t\t\t\tif (!by.includes(k)) joinedObs[k] = v;\n\t\t\t\t\t});\n\t\t\t\t\tresult.push(joinedObs);\n\t\t\t\t});\n\t\t\t\tprocessedRightKeys.add(key);\n\t\t\t} else result.push(_objectSpread2({}, leftObs));\n\t\t});\n\t\tother.observations.forEach((rightObs) => {\n\t\t\tif (this.hasNullJoinKeys(rightObs, by)) {\n\t\t\t\tresult.push(_objectSpread2({}, rightObs));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst key = by.map((k) => JSON.stringify(this.normalizeForComparison(rightObs[k]))).join(\"|\");\n\t\t\tif (!processedRightKeys.has(key)) {\n\t\t\t\tresult.push(_objectSpread2({}, rightObs));\n\t\t\t\tprocessedRightKeys.add(key);\n\t\t\t}\n\t\t});\n\t\treturn new DataCalc(result);\n\t}\n\t/**\n\t* Slice observations by position.\n\t*\n\t* @param start - Starting position (0-based). Negative values count from\n\t* the end.\n\t* @param end - Ending position (exclusive)\n\t* @returns A new DataCalc object with sliced observations\n\t*\n\t* @remarks If `end` is not provided, it will return a single observation at\n\t* `start` position. If `start` is beyond the length of observations,\n\t* it will return an empty DataCalc.\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2 },\n\t* { a: 3, b: 4 },\n\t* { a: 5, b: 6 },\n\t* { a: 7, b: 8 }\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(dc.slice(1, 3).observations);\n\t* // [ { a: 3, b: 4 }, { a: 5, b: 6 } ]\n\t* console.log(dc.slice(0).observations);\n\t* // [ { a: 1, b: 2 } ]\n\t* ```\n\t*/\n\tslice(start, end) {\n\t\tif (this._groups.length > 0) throw new M2Error(`slice() cannot be used on grouped data. Ungroup the data first using ungroup().`);\n\t\tlet sliced;\n\t\tif (start >= this._observations.length) return new DataCalc([], {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings,\n\t\t\tskipNormalization: true\n\t\t});\n\t\tif (end === void 0) {\n\t\t\tconst index = start < 0 ? this._observations.length + start : start;\n\t\t\tsliced = [this._observations[index]];\n\t\t} else sliced = this._observations.slice(start, end);\n\t\treturn new DataCalc(sliced, {\n\t\t\tgroups: this._groups,\n\t\t\twarnings: this._warnings,\n\t\t\tskipNormalization: true\n\t\t});\n\t}\n\t/**\n\t* Combines observations from two DataCalc objects by rows.\n\t*\n\t* @param other - The other DataCalc object to bind with\n\t* @returns A new DataCalc object with combined observations\n\t*\n\t* @example\n\t* ```js\n\t* const d1 = [\n\t* { a: 1, b: 2 },\n\t* { a: 3, b: 4 }\n\t* ];\n\t* const d2 = [\n\t* { a: 5, b: 6 },\n\t* { a: 7, b: 8 }\n\t* ];\n\t* const dc1 = new DataCalc(d1);\n\t* const dc2 = new DataCalc(d2);\n\t* console.log(dc1.bindRows(dc2).observations);\n\t* // [ { a: 1, b: 2 }, { a: 3, b: 4 }, { a: 5, b: 6 }, { a: 7, b: 8 } ]\n\t* ```\n\t*/\n\tbindRows(other) {\n\t\tif (this._observations.length > 0 && other.observations.length > 0) {\n\t\t\tconst thisVariables = new Set(Object.keys(this._observations[0]));\n\t\t\tconst otherVariables = new Set(Object.keys(other.observations[0]));\n\t\t\t[...thisVariables].filter((variable) => otherVariables.has(variable)).forEach((variable) => {\n\t\t\t\tconst thisType = this.getVariableType(variable);\n\t\t\t\tconst otherType = other.getVariableType(variable);\n\t\t\t\tif (thisType !== otherType) console.warn(`Warning: bindRows() is combining datasets with different data types for variable '${variable}'. Left dataset has type '${thisType}' and right dataset has type '${otherType}'.`);\n\t\t\t});\n\t\t}\n\t\treturn new DataCalc([...this._observations, ...other.observations]);\n\t}\n\t/**\n\t* Helper method to determine the primary type of a variable across observations\n\t* @internal\n\t*\n\t* @param variable - The variable name to check\n\t* @returns The most common type for the variable or 'mixed' if no clear type exists\n\t*/\n\tgetVariableType(variable) {\n\t\tif (this._observations.length === 0) return \"unknown\";\n\t\tconst typeCounts = {};\n\t\tthis._observations.forEach((obs) => {\n\t\t\tif (variable in obs) {\n\t\t\t\tconst value = obs[variable];\n\t\t\t\tconst type = value === null ? \"null\" : Array.isArray(value) ? \"array\" : typeof value;\n\t\t\t\ttypeCounts[type] = (typeCounts[type] || 0) + 1;\n\t\t\t}\n\t\t});\n\t\tlet maxCount = 0;\n\t\tlet dominantType = \"unknown\";\n\t\tfor (const [type, count] of Object.entries(typeCounts)) if (count > maxCount) {\n\t\t\tmaxCount = count;\n\t\t\tdominantType = type;\n\t\t}\n\t\treturn dominantType;\n\t}\n\t/**\n\t* Verifies that the variable exists in each observation in the data.\n\t*\n\t* @remarks Throws an error if the variable does not exist in each\n\t* observation. This is not meant to be called by users of the library, but\n\t* is used internally.\n\t* @internal\n\t*\n\t* @param variable - The variable to check for\n\t*/\n\tverifyObservationsContainVariable(variable) {\n\t\tif (!this._observations.every((observation) => variable in observation)) throw new M2Error(`Variable ${variable} does not exist for each item (row) in the data array.`);\n\t}\n\t/**\n\t* Checks if the variable exists for at least one observation in the data.\n\t*\n\t* @remarks This is not meant to be called by users of the library, but\n\t* is used internally.\n\t* @internal\n\t*\n\t* @param variable - The variable to check for\n\t* @returns true if the variable exists in at least one observation, false\n\t* otherwise\n\t*/\n\tvariableExists(variable) {\n\t\treturn this._observations.some((observation) => variable in observation);\n\t}\n\t/**\n\t* Checks if a value is a non-missing numeric value.\n\t*\n\t* @remarks A non-missing numeric value is a value that is a number and is\n\t* not NaN or infinite.\n\t*\n\t* @param value - The value to check\n\t* @returns true if the value is a non-missing numeric value, false otherwise\n\t*/\n\tisNonMissingNumeric(value) {\n\t\treturn typeof value === \"number\" && !isNaN(value) && isFinite(value);\n\t}\n\t/**\n\t* Checks if a value is a missing numeric value.\n\t*\n\t* @remarks A missing numeric value is a number that is NaN or infinite, or any\n\t* value that is null or undefined. Thus, a null or undefined value is\n\t* considered to be a missing numeric value.\n\t*\n\t* @param value - The value to check\n\t* @returns true if the value is a missing numeric value, false otherwise\n\t*/\n\tisMissingNumeric(value) {\n\t\treturn typeof value === \"number\" && (isNaN(value) || !isFinite(value)) || value === null || typeof value === \"undefined\";\n\t}\n\t/**\n\t* Normalizes an object for stable comparison by sorting keys\n\t* @internal\n\t*\n\t* @remarks Normalizing is needed to handle situations where objects have the\n\t* same properties but in different orders because we are using\n\t* JSON.stringify() for comparison.\n\t*/\n\tnormalizeForComparison(obj) {\n\t\tif (obj === null || typeof obj !== \"object\") return obj;\n\t\tif (Array.isArray(obj)) return obj.map((item) => this.normalizeForComparison(item));\n\t\treturn Object.keys(obj).sort().reduce((result, key) => {\n\t\t\tresult[key] = this.normalizeForComparison(obj[key]);\n\t\t\treturn result;\n\t\t}, {});\n\t}\n\t/**\n\t* Creates a deep copy of an object.\n\t* @internal\n\t*\n\t* @remarks We create a deep copy of the object, in our case an instance\n\t* of `DataCalc`, to ensure that we are working with a new object\n\t* without any references to the original object. This is important\n\t* to avoid unintended side effects when modifying an object.\n\t*\n\t* @param source - object to copy\n\t* @param map - map of objects that have already been copied\n\t* @returns a deep copy of the object\n\t*/\n\tdeepCopy(source, map = /* @__PURE__ */ new WeakMap()) {\n\t\tconst sClone = globalThis.structuredClone;\n\t\tif (typeof sClone === \"function\") try {\n\t\t\tconst proto = source && typeof source === \"object\" ? Object.getPrototypeOf(source) : null;\n\t\t\tif (Array.isArray(source) || proto === Object.prototype || proto === null) {\n\t\t\t\tif (!Object.values(Object.getOwnPropertyDescriptors(source)).some((d) => typeof d.get === \"function\" || typeof d.set === \"function\")) return sClone(source);\n\t\t\t}\n\t\t} catch (_unused) {}\n\t\tif (source === null || typeof source !== \"object\") return source;\n\t\tif (map.has(source)) return map.get(source);\n\t\tconst copy = Array.isArray(source) ? [] : Object.create(Object.getPrototypeOf(source));\n\t\tmap.set(source, copy);\n\t\tconst keys = [...Object.getOwnPropertyNames(source), ...Object.getOwnPropertySymbols(source)];\n\t\tfor (const key of keys) {\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(source, key);\n\t\t\tif (descriptor) {\n\t\t\t\tconst { get, set } = descriptor, descWithoutAccessors = _objectWithoutProperties(descriptor, _excluded);\n\t\t\t\tObject.defineProperty(copy, key, _objectSpread2(_objectSpread2({}, descWithoutAccessors), {}, { value: this.deepCopy(source[key], map) }));\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}\n\t/**\n\t* Checks if an observation has null or undefined values in any of the join columns.\n\t* @internal\n\t*\n\t* @param obs - The observation to check\n\t* @param keys - The join columns to check\n\t* @returns true if any join column has a null or undefined value\n\t*/\n\thasNullJoinKeys(obs, keys) {\n\t\treturn keys.some((key) => obs[key] === null || obs[key] === void 0);\n\t}\n};\nconst Helpers = { \n/**\n* Returns an iterator of all results matching a string against a regular expression.\n* ES2020-compliant matchAll utility, Target: ES2017 minimum\n*\n* @param str - The string to search for matches.\n* @param regexp - A regular expression object (must have the 'g' flag) or a string.\n* @returns An iterator yielding RegExp match arrays.\n*/\nmatchAll: function* (str, regexp) {\n\tif (str == null) throw new TypeError(\"String is null or not defined\");\n\tconst stringValue = String(str);\n\tlet matcher;\n\tif (regexp instanceof RegExp) {\n\t\tif (!regexp.global) throw new TypeError(\"matchAll called with a non-global RegExp argument\");\n\t\tmatcher = new RegExp(regexp.source, regexp.flags);\n\t} else matcher = new RegExp(regexp, \"g\");\n\tlet match;\n\twhile ((match = matcher.exec(stringValue)) !== null) {\n\t\tyield match;\n\t\tif (match[0].length === 0) {\n\t\t\tif (matcher.unicode) {\n\t\t\t\tconst charCode = stringValue.charCodeAt(matcher.lastIndex);\n\t\t\t\tif (charCode >= 55296 && charCode <= 56319) matcher.lastIndex++;\n\t\t\t}\n\t\t\tmatcher.lastIndex++;\n\t\t}\n\t}\n} };\n//#endregion\n//#region src/SummarizeOperation.ts\nconst PRECEDENCE = {\n\t\"+\": 1,\n\t\"-\": 1,\n\t\"*\": 2,\n\t\"/\": 2,\n\t\"^\": 3\n};\n/**\n* `SummarizeOperation` is a builder for summary expressions.\n*\n* It stores a token stream of operands and operators. Operands can be:\n* - a numeric literal\n* - another `SummarizeOperation` (including leaf reducers like `mean()` or `sum()`)\n*\n* The instance exposes arithmetic methods (`add`, `sub`, `mul`, `div`, `pow`)\n* which append operator + operand tokens and return a new `SummarizeOperation`.\n*\n* When `DataCalc.summarize()` calls the `.summarizeFunction(dc, params, opts)`,\n* the token stream is evaluated with correct operator precedence.\n*\n* A leaf reducer should create a `SummarizeOperation` with a `leafFn`; the token\n* stream for a leaf starts as a single operand referencing the leaf itself.\n*/\nvar SummarizeOperation = class SummarizeOperation {\n\tconstructor(leafFn, parameters, options, tokens) {\n\t\tthis.leafFn = leafFn;\n\t\tthis.parameters = parameters;\n\t\tthis.options = options;\n\t\tif (tokens && tokens.length > 0) this.tokens = tokens.slice();\n\t\telse if (leafFn) this.tokens = [{\n\t\t\tt: \"operand\",\n\t\t\tv: this\n\t\t}];\n\t\telse this.tokens = [];\n\t\tthis.summarizeFunction = (dc) => {\n\t\t\treturn this.evaluateAsValue(dc);\n\t\t};\n\t}\n\tstatic leaf(leafFn, parameters, options) {\n\t\treturn new SummarizeOperation(leafFn, parameters, options);\n\t}\n\tcloneWithTokens(newTokens) {\n\t\treturn new SummarizeOperation(void 0, void 0, void 0, newTokens);\n\t}\n\tappendOp(op, operand) {\n\t\tconst newTokens = this.tokens.slice();\n\t\tnewTokens.push({\n\t\t\tt: \"op\",\n\t\t\tv: op\n\t\t});\n\t\tnewTokens.push({\n\t\t\tt: \"operand\",\n\t\t\tv: operand\n\t\t});\n\t\treturn this.cloneWithTokens(newTokens);\n\t}\n\t/**\n\t* Append addition to this expression.\n\t*\n\t* @param x - A numeric literal or another `SummarizeOperation` to add to this expression\n\t* @returns A new `SummarizeOperation` representing `(this + x)`\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.summarize({\n\t* result: mean(\"a\").add(10),\n\t* }).observations\n\t* );\n\t* // [ { result: 13.33333 } ]\n\t* ```\n\t*/\n\tadd(x) {\n\t\treturn this.appendOp(\"+\", x);\n\t}\n\t/**\n\t* Append subtraction to this expression.\n\t*\n\t* @param x - A numeric literal or another `SummarizeOperation` to subtract from this expression\n\t* @returns A new `SummarizeOperation` representing `(this - x)`\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.summarize({\n\t* result: mean(\"a\").sub(10),\n\t* }).observations\n\t* );\n\t* // [ { result: -6.6667 } ]\n\t* ```\n\t*/\n\tsub(x) {\n\t\treturn this.appendOp(\"-\", x);\n\t}\n\t/**\n\t* Append multiplication to this expression. Multiplication has higher\n\t* precedence than addition/subtraction.\n\t*\n\t* @param x - A numeric literal or another `SummarizeOperation` to multiply with this expression\n\t* @returns A new `SummarizeOperation` representing `(this * x)`\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.summarize({\n\t* result: mean(\"a\").mul(10),\n\t* }).observations\n\t* );\n\t* // [ { result: 33.3333 } ]\n\t* ```\n\t*/\n\tmul(x) {\n\t\treturn this.appendOp(\"*\", x);\n\t}\n\t/**\n\t* Append division to this expression.\n\t*\n\t* @param x - A numeric literal or another `SummarizeOperation` to divide this expression by\n\t* @returns A new `SummarizeOperation` representing `(this / x)`\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.summarize({\n\t* result: mean(\"a\").div(10),\n\t* }).observations\n\t* );\n\t* // [ { result: .3333 } ]\n\t* ```\n\t*/\n\tdiv(x) {\n\t\treturn this.appendOp(\"/\", x);\n\t}\n\t/**\n\t* Append exponentiation (power) to this expression.\n\t*\n\t* Note: exponentiation uses right-associative semantics (a ^ b ^ c -> a ^ (b ^ c)).\n\t*\n\t* @param x - A numeric literal or another `SummarizeOperation` used as the exponent\n\t* @returns A new `SummarizeOperation` representing `(this ^ x)`\n\t*\n\t* @example\n\t* ```js\n\t* const d = [\n\t* { a: 1, b: 2, c: 3 },\n\t* { a: 0, b: 8, c: 3 },\n\t* { a: 9, b: 4, c: 7 },\n\t* ];\n\t* const dc = new DataCalc(d);\n\t* console.log(\n\t* dc.summarize({\n\t* result: mean(\"a\").pow(2),\n\t* }).observations\n\t* );\n\t* // [ { result: 11.1111 } ]\n\t* ```\n\t*/\n\tpow(x) {\n\t\treturn this.appendOp(\"^\", x);\n\t}\n\tevaluateOperandToNumber(opd, dc) {\n\t\tif (typeof opd === \"number\") return opd;\n\t\tif (typeof opd === \"string\") {\n\t\t\tconst m = /^__CHAIN_EXPR__\\[(.*?)\\]$/.exec(opd);\n\t\t\tif (m) {\n\t\t\t\tconst payload = m[1];\n\t\t\t\tlet ops = getChainOps(payload);\n\t\t\t\tif (!ops) try {\n\t\t\t\t\tops = JSON.parse(decodeURIComponent(payload));\n\t\t\t\t} catch (_unused) {\n\t\t\t\t\tops = void 0;\n\t\t\t\t}\n\t\t\t\tif (!ops) return NaN;\n\t\t\t\tlet current = dc;\n\t\t\t\tlet evaluated = void 0;\n\t\t\t\tfor (const op of ops) {\n\t\t\t\t\tconst method = current[op.name];\n\t\t\t\t\tif (typeof method !== \"function\") return NaN;\n\t\t\t\t\tconst res = method.apply(current, op.args);\n\t\t\t\t\tif (res instanceof DataCalc) {\n\t\t\t\t\t\tcurrent = res;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (Array.isArray(res)) {\n\t\t\t\t\t\tevaluated = res.length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof res === \"boolean\") if (this.options && typeof this.options.coerceBooleans === \"boolean\" ? this.options.coerceBooleans : true) {\n\t\t\t\t\t\tevaluated = res ? 1 : 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else return NaN;\n\t\t\t\t\tevaluated = typeof res === \"number\" ? res : Number(res);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (evaluated === void 0) evaluated = current instanceof DataCalc ? current.length : NaN;\n\t\t\t\treturn typeof evaluated === \"number\" && !isNaN(evaluated) ? evaluated : NaN;\n\t\t\t}\n\t\t}\n\t\tconst params = Array.isArray(opd.parameters) ? opd.parameters : opd.parameters === void 0 ? void 0 : [opd.parameters];\n\t\tconst raw = opd.leafFn ? opd.leafFn(dc, params, opd.options) : opd.evaluateAsValue(dc);\n\t\tif (raw === null || raw === void 0) return NaN;\n\t\tconst num = Number(raw);\n\t\treturn typeof num === \"number\" && !isNaN(num) ? num : NaN;\n\t}\n\tevaluateFlatTokens(tokens, dc) {\n\t\tconst operands = [];\n\t\tconst ops = [];\n\t\tfor (const tk of tokens) if (tk.t === \"operand\") operands.push(tk.v);\n\t\telse ops.push(tk.v);\n\t\tif (operands.length === 0) return NaN;\n\t\twhile (ops.length > 0) {\n\t\t\tvar _PRECEDENCE$ops$;\n\t\t\tlet bestIdx = 0;\n\t\t\tlet bestPrec = (_PRECEDENCE$ops$ = PRECEDENCE[ops[0]]) !== null && _PRECEDENCE$ops$ !== void 0 ? _PRECEDENCE$ops$ : 0;\n\t\t\tfor (let i = 1; i < ops.length; i++) {\n\t\t\t\tvar _PRECEDENCE$ops$i;\n\t\t\t\tconst p = (_PRECEDENCE$ops$i = PRECEDENCE[ops[i]]) !== null && _PRECEDENCE$ops$i !== void 0 ? _PRECEDENCE$ops$i : 0;\n\t\t\t\tif (p > bestPrec || p === bestPrec && ops[i] === \"^\") {\n\t\t\t\t\tbestPrec = p;\n\t\t\t\t\tbestIdx = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst op = ops.splice(bestIdx, 1)[0];\n\t\t\tconst left = operands.splice(bestIdx, 1)[0];\n\t\t\tconst right = operands.splice(bestIdx, 1)[0];\n\t\t\tconst a = this.evaluateOperandToNumber(left, dc);\n\t\t\tconst b = this.evaluateOperandToNumber(right, dc);\n\t\t\tlet res = NaN;\n\t\t\tif (op === \"+\") res = a + b;\n\t\t\telse if (op === \"-\") res = a - b;\n\t\t\telse if (op === \"*\") res = a * b;\n\t\t\telse if (op === \"/\") res = b === 0 ? NaN : a / b;\n\t\t\telse if (op === \"^\") res = Math.pow(a, b);\n\t\t\toperands.splice(bestIdx, 0, res);\n\t\t}\n\t\tconst final = operands[0];\n\t\tif (typeof final === \"number\") return final;\n\t\treturn this.evaluateOperandToNumber(final, dc);\n\t}\n\t/**\n\t* Instance helper: return a grouped version of this operation so it becomes\n\t* a single operand in outer expressions. Equivalent to parens(this).\n\t*/\n\tparens() {\n\t\treturn parens(this);\n\t}\n\tevaluateAsValue(dc) {\n\t\tif (this.leafFn) {\n\t\t\tconst params = Array.isArray(this.parameters) ? this.parameters : this.parameters === void 0 ? void 0 : [this.parameters];\n\t\t\tconst res = this.leafFn(dc, params, this.options);\n\t\t\tif (typeof res === \"number\" && Number.isNaN(res)) return null;\n\t\t\treturn res;\n\t\t}\n\t\tif (!this.tokens || this.tokens.length === 0) return NaN;\n\t\tconst val = this.evaluateFlatTokens(this.tokens, dc);\n\t\tif (typeof val === \"number\" && Number.isNaN(val)) return null;\n\t\treturn val;\n\t}\n};\n/**\n* Wraps an existing `SummarizeOperation` as a single grouped operand.\n*\n* @remarks Permits explicit parentheses in complex expressions.\n*\n* @param op - The `SummarizeOperation` to wrap\n* @returns A new `SummarizeOperation` with the wrapped operand\n*\n* @example\n* ```js\n* const d = [\n* { a: 1 },\n* { a: 0 },\n* { a: 9 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* // (mean a + min a) * 10\n* val: parens(mean(\"a\").add(min(\"a\"))).mul(10),\n* }).observations\n* );\n* // [ { val: 33.33333333333333 } ]\n* ```\n*/\nfunction parens(op) {\n\treturn new SummarizeOperation(void 0, void 0, void 0, [{\n\t\tt: \"operand\",\n\t\tv: op\n\t}]);\n}\n//#endregion\n//#region src/SummarizeOperations.ts\n/**\n* Default options for summarize operations\n*/\nconst DEFAULT_SUMMARIZE_OPTIONS = {\n\tcoerceBooleans: true,\n\tskipMissing: false\n};\n/**\n* Applies default options to user-provided options\n*\n* @param options - User provided options (may be undefined)\n* @returns Options with defaults applied\n*/\nfunction applyDefaultOptions(options) {\n\treturn _objectSpread2(_objectSpread2({}, DEFAULT_SUMMARIZE_OPTIONS), options);\n}\nfunction resolveLazy(param, dataCalc, opName) {\n\tif (typeof param !== \"function\") return param;\n\ttry {\n\t\tconst res = param(dataCalc);\n\t\tif (typeof res === \"function\") throw new M2Error(`${opName || \"summarize()\"}: lazy callback returned a function; expected a value or array of values.`);\n\t\tif (res instanceof DataCalc) throw new M2Error(`${opName || \"summarize()\"}: lazy callback returned a DataCalc instance; expected a value or array of values.`);\n\t\treturn res;\n\t} catch (err) {\n\t\tthrow new M2Error(`${opName || \"summarize()\"}: lazy callback threw an error: ${err && err.message ? err.message : String(err)}`);\n\t}\n}\n/**\n* Helper function to process numeric values in a variable across observations\n* Handles error checking, type coercion and missing values in a consistent way\n*\n* @param dataCalc - The DataCalc instance to process\n* @param variable - The variable name to process\n* @param options - Summarize options for the operation\n* @param collector - Function that collects values (e.g., sum, max comparison)\n* @param errorPrefix - Prefix for error messages\n* @param initialState - Initial state for the collector function\n* @returns An object containing the processed numeric values and count\n*/\nfunction processNumericValues(dataCalc, variable, options, collector, errorPrefix, initialState) {\n\tconst mergedOptions = applyDefaultOptions(options);\n\tdataCalc.verifyObservationsContainVariable(variable);\n\tlet count = 0;\n\tlet state = initialState;\n\tlet containsMissing = false;\n\tdataCalc.observations.forEach((o) => {\n\t\tif (dataCalc.isNonMissingNumeric(o[variable])) {\n\t\t\tstate = collector(o[variable], state);\n\t\t\tcount++;\n\t\t\treturn;\n\t\t}\n\t\tif (typeof o[variable] === \"boolean\" && mergedOptions.coerceBooleans) {\n\t\t\tstate = collector(o[variable] ? 1 : 0, state);\n\t\t\tcount++;\n\t\t\treturn;\n\t\t}\n\t\tif (dataCalc.isMissingNumeric(o[variable])) {\n\t\t\tcontainsMissing = true;\n\t\t\treturn;\n\t\t}\n\t\tthrow new M2Error(`${errorPrefix}: variable ${variable} has non-numeric value ${o[variable]} in this observation: ${JSON.stringify(o)}`);\n\t});\n\treturn {\n\t\tstate,\n\t\tcount,\n\t\tcontainsMissing\n\t};\n}\n/**\n* Processes an array of numeric values directly rather than through a\n* variable name.\n*/\nfunction processDirectValues(values, options, collector, errorPrefix, initialState) {\n\tconst mergedOptions = applyDefaultOptions(options);\n\tlet state = initialState;\n\tlet count = 0;\n\tlet containsMissing = false;\n\tfor (const value of values) if (typeof value === \"number\" && !isNaN(value) && isFinite(value)) {\n\t\tstate = collector(value, state);\n\t\tcount++;\n\t} else if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) {\n\t\tstate = collector(value ? 1 : 0, state);\n\t\tcount++;\n\t} else if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) containsMissing = true;\n\telse throw new M2Error(`${errorPrefix}: has non-numeric value ${value}`);\n\treturn {\n\t\tstate,\n\t\tcount,\n\t\tcontainsMissing\n\t};\n}\n/**\n* Processes a single value for summarize operations rather than through a\n* variable name.\n*/\nfunction processSingleValue(value, options, errorPrefix) {\n\tconst mergedOptions = applyDefaultOptions(options);\n\tif (typeof value === \"number\" && !isNaN(value) && isFinite(value)) return {\n\t\tvalue,\n\t\tisMissing: false\n\t};\n\telse if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) return {\n\t\tvalue: value ? 1 : 0,\n\t\tisMissing: false\n\t};\n\telse if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) return {\n\t\tvalue: 0,\n\t\tisMissing: true\n\t};\n\telse throw new M2Error(`${errorPrefix}: has non-numeric value ${value}`);\n}\nconst nInternal = (dataCalc, params) => {\n\tconst rawParam = params ? params[0] : void 0;\n\tif (typeof rawParam === \"function\") {\n\t\tconst firstObs = dataCalc.observations[0];\n\t\tif (firstObs !== void 0) try {\n\t\t\tif (typeof rawParam(firstObs) === \"boolean\") {\n\t\t\t\tlet count = 0;\n\t\t\t\tdataCalc.observations.forEach((o) => {\n\t\t\t\t\tif (rawParam(o)) count++;\n\t\t\t\t});\n\t\t\t\treturn count;\n\t\t\t}\n\t\t} catch (_unused) {}\n\t}\n\tconst variableOrValues = resolveLazy(rawParam, dataCalc);\n\tif (variableOrValues === void 0) return dataCalc.length;\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return 0;\n\t\tlet count = 0;\n\t\tdataCalc.observations.forEach((o) => {\n\t\t\tif (o[variableOrValues] !== null && o[variableOrValues] !== void 0) count++;\n\t\t});\n\t\treturn count;\n\t}\n\tif (Array.isArray(variableOrValues)) return variableOrValues.length;\n\tif (variableOrValues === null) return 0;\n\treturn 1;\n};\n/**\n* Calculates the number of observations.\n*\n* @returns summarize operation calculating the number of observations\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* count: n()\n* }).observations\n* );\n* // [ { count: 3 } ]\n* ```\n*/\nfunction n(variableOrValues) {\n\treturn SummarizeOperation.leaf(nInternal, [variableOrValues], void 0);\n}\nconst sumInternal = (dataCalc, params, options) => {\n\tlet variableOrValues = params ? params[0] : void 0;\n\tvariableOrValues = resolveLazy(variableOrValues, dataCalc);\n\tconst mergedOptions = applyDefaultOptions(options);\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return null;\n\t\tconst result = processNumericValues(dataCalc, variableOrValues, options, (value, sum) => sum + value, \"sum()\", 0);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state;\n\t} else if (Array.isArray(variableOrValues)) {\n\t\tconst result = processDirectValues(variableOrValues, options, (value, sum) => sum + value, \"sum()\", 0);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state;\n\t} else {\n\t\tconst result = processSingleValue(variableOrValues, options, \"sum()\");\n\t\tif (result.isMissing && !mergedOptions.skipMissing) return null;\n\t\treturn result.isMissing ? null : result.value;\n\t}\n};\n/**\n* Calculates the sum of a variable, value, or array of values\n*\n* @param variableOrValues - name of variable, or alternatively, a value or\n* array of values\n* @param options - options for handling missing values and boolean coercion\n* @returns summarize operation calculating the sum\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* totalB: sum(\"b\")\n* }).observations\n* );\n* // [ { totalB: 14 } ]\n* ```\n*/\nfunction sum(variableOrValues, options) {\n\treturn SummarizeOperation.leaf(sumInternal, [variableOrValues], options);\n}\nconst meanInternal = (dataCalc, params, options) => {\n\tlet variableOrValues = params ? params[0] : void 0;\n\tvariableOrValues = resolveLazy(variableOrValues, dataCalc);\n\tconst mergedOptions = applyDefaultOptions(options);\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return null;\n\t\tconst result = processNumericValues(dataCalc, variableOrValues, options, (value, sum) => sum + value, \"mean()\", 0);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state / result.count;\n\t} else if (Array.isArray(variableOrValues)) {\n\t\tconst result = processDirectValues(variableOrValues, options, (value, sum) => sum + value, \"mean()\", 0);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state / result.count;\n\t} else {\n\t\tconst result = processSingleValue(variableOrValues, options, \"mean()\");\n\t\treturn result.isMissing && !mergedOptions.skipMissing ? null : result.value;\n\t}\n};\n/**\n* Calculates the mean of a variable, value, or array of values\n*\n* @param variableOrValues - name of variable, or alternatively, a value or\n* array of values\n* @param options - options for handling missing values and boolean coercion\n* @returns summarize operation calculating the mean\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* meanA: mean(\"a\")\n* }).observations\n* );\n* // [ { meanA: 3.3333333333333335 } ]\n* ```\n*/\nfunction mean(variableOrValues, options) {\n\treturn SummarizeOperation.leaf(meanInternal, [variableOrValues], options);\n}\nconst varianceInternal = (dataCalc, params, options) => {\n\tlet variableOrValues = params ? params[0] : void 0;\n\tvariableOrValues = resolveLazy(variableOrValues, dataCalc);\n\tconst mergedOptions = applyDefaultOptions(options);\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return null;\n\t\tconst variable = variableOrValues;\n\t\tconst meanResult = processNumericValues(dataCalc, variable, options, (value, sum) => sum + value, \"variance()\", 0);\n\t\tif (meanResult.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (meanResult.count <= 1) return null;\n\t\tconst meanValue = meanResult.state / meanResult.count;\n\t\treturn processNumericValues(dataCalc, variable, options, (value, sum) => {\n\t\t\tconst actualValue = typeof value === \"boolean\" && mergedOptions.coerceBooleans ? value ? 1 : 0 : value;\n\t\t\treturn sum + Math.pow(actualValue - meanValue, 2);\n\t\t}, \"variance()\", 0).state / (meanResult.count - 1);\n\t} else if (Array.isArray(variableOrValues)) {\n\t\tconst validValues = [];\n\t\tlet containsMissing = false;\n\t\tfor (const value of variableOrValues) if (typeof value === \"number\" && !isNaN(value) && isFinite(value)) validValues.push(value);\n\t\telse if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) validValues.push(value ? 1 : 0);\n\t\telse if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) containsMissing = true;\n\t\telse throw new M2Error(`variance(): has non-numeric value ${value}`);\n\t\tif (containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (validValues.length <= 1) return null;\n\t\tconst mean = validValues.reduce((acc, val) => acc + val, 0) / validValues.length;\n\t\treturn validValues.reduce((acc, val) => acc + Math.pow(val - mean, 2), 0) / (validValues.length - 1);\n\t} else return null;\n};\n/**\n* Calculates the variance of a variable, value, or array of values\n*\n* @param variableOrValues - name of variable, or alternatively, a value or\n* array of values\n* @param options - options for handling missing values and boolean coercion\n* @returns summarize operation calculating the variance\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* { a: 5, b: 0, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* varA: variance(\"a\")\n* }).observations\n* );\n* // [ { varA: 16.916666666666668 } ]\n* ```\n*/\nfunction variance(variableOrValues, options) {\n\treturn SummarizeOperation.leaf(varianceInternal, [variableOrValues], options);\n}\nconst minInternal = (dataCalc, params, options) => {\n\tlet variableOrValues = params ? params[0] : void 0;\n\tvariableOrValues = resolveLazy(variableOrValues, dataCalc);\n\tconst mergedOptions = applyDefaultOptions(options);\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return null;\n\t\tconst result = processNumericValues(dataCalc, variableOrValues, options, (value, min) => min === Number.POSITIVE_INFINITY || value < min ? value : min, \"min()\", Number.POSITIVE_INFINITY);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state;\n\t} else if (Array.isArray(variableOrValues)) {\n\t\tconst result = processDirectValues(variableOrValues, options, (value, min) => min === Number.POSITIVE_INFINITY || value < min ? value : min, \"min()\", Number.POSITIVE_INFINITY);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state;\n\t} else {\n\t\tconst result = processSingleValue(variableOrValues, options, \"min()\");\n\t\tif (result.isMissing && !mergedOptions.skipMissing) return null;\n\t\treturn result.isMissing ? null : result.value;\n\t}\n};\n/**\n* Calculates the minimum value of a variable, value, or array of values\n*\n* @param variableOrValues - name of variable, or alternatively, a value or\n* array of values\n* @param options - options for handling missing values and boolean coercion\n* @returns summarize operation calculating the minimum\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* { a: 5, b: 0, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* minA: min(\"a\")\n* }).observations\n* );\n* // [ { minA: 0 } ]\n* ```\n*/\nfunction min(variableOrValues, options) {\n\treturn SummarizeOperation.leaf(minInternal, [variableOrValues], options);\n}\nconst maxInternal = (dataCalc, params, options) => {\n\tlet variableOrValues = params ? params[0] : void 0;\n\tvariableOrValues = resolveLazy(variableOrValues, dataCalc);\n\tconst mergedOptions = applyDefaultOptions(options);\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return null;\n\t\tconst result = processNumericValues(dataCalc, variableOrValues, options, (value, max) => max === Number.NEGATIVE_INFINITY || value > max ? value : max, \"max()\", Number.NEGATIVE_INFINITY);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state;\n\t} else if (Array.isArray(variableOrValues)) {\n\t\tconst result = processDirectValues(variableOrValues, options, (value, max) => max === Number.NEGATIVE_INFINITY || value > max ? value : max, \"max()\", Number.NEGATIVE_INFINITY);\n\t\tif (result.containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (result.count === 0) return null;\n\t\treturn result.state;\n\t} else {\n\t\tconst result = processSingleValue(variableOrValues, options, \"max()\");\n\t\tif (result.isMissing && !mergedOptions.skipMissing) return null;\n\t\treturn result.isMissing ? null : result.value;\n\t}\n};\n/**\n* Calculates the maximum value of a variable, value, or array of values\n*\n* @param variableOrValues - name of variable, or alternatively, a value or\n* array of values\n* @param options - options for handling missing values and boolean coercion\n* @returns summarize operation calculating the maximum\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* { a: 5, b: 0, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* maxA: max(\"a\")\n* }).observations\n* );\n* // [ { maxA: 9 } ]\n* ```\n*/\nfunction max(variableOrValues, options) {\n\treturn SummarizeOperation.leaf(maxInternal, [variableOrValues], options);\n}\nconst medianInternal = (dataCalc, params, options) => {\n\tlet variableOrValues = params ? params[0] : void 0;\n\tvariableOrValues = resolveLazy(variableOrValues, dataCalc);\n\tconst mergedOptions = applyDefaultOptions(options);\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return null;\n\t\tconst variable = variableOrValues;\n\t\tdataCalc.verifyObservationsContainVariable(variable);\n\t\tconst values = [];\n\t\tlet containsMissing = false;\n\t\tdataCalc.observations.forEach((o) => {\n\t\t\tif (dataCalc.isNonMissingNumeric(o[variable])) values.push(o[variable]);\n\t\t\telse if (typeof o[variable] === \"boolean\" && mergedOptions.coerceBooleans) values.push(o[variable] ? 1 : 0);\n\t\t\telse if (dataCalc.isMissingNumeric(o[variable])) containsMissing = true;\n\t\t\telse throw new M2Error(`median(): variable ${variable} has non-numeric value ${o[variable]} in this observation: ${JSON.stringify(o)}`);\n\t\t});\n\t\tif (containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (values.length === 0) return null;\n\t\tvalues.sort((a, b) => a - b);\n\t\tconst mid = Math.floor(values.length / 2);\n\t\tif (values.length % 2 === 0) return (values[mid - 1] + values[mid]) / 2;\n\t\telse return values[mid];\n\t} else if (Array.isArray(variableOrValues)) {\n\t\tconst values = [];\n\t\tlet containsMissing = false;\n\t\tfor (const value of variableOrValues) if (typeof value === \"number\" && !isNaN(value) && isFinite(value)) values.push(value);\n\t\telse if (typeof value === \"boolean\" && mergedOptions.coerceBooleans) values.push(value ? 1 : 0);\n\t\telse if (value === null || value === void 0 || typeof value === \"number\" && (isNaN(value) || !isFinite(value))) containsMissing = true;\n\t\telse throw new M2Error(`median(): has non-numeric value ${value}`);\n\t\tif (containsMissing && !mergedOptions.skipMissing) return null;\n\t\tif (values.length === 0) return null;\n\t\tvalues.sort((a, b) => a - b);\n\t\tconst mid = Math.floor(values.length / 2);\n\t\tif (values.length % 2 === 0) return (values[mid - 1] + values[mid]) / 2;\n\t\telse return values[mid];\n\t} else {\n\t\tconst result = processSingleValue(variableOrValues, options, \"median()\");\n\t\tif (result.isMissing && !mergedOptions.skipMissing) return null;\n\t\treturn result.isMissing ? null : result.value;\n\t}\n};\n/**\n* Calculates the median value of a variable, value, or array of values\n*\n* @param variableOrValues - name of variable, or alternatively, a value or\n* array of values\n* @param options - options for handling missing values and boolean coercion\n* @returns summarize operation calculating the median\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* { a: 5, b: 0, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* medA: median(\"a\")\n* }).observations\n* );\n* // [ { medA: 3 } ]\n* ```\n*/\nfunction median(variableOrValues, options) {\n\treturn SummarizeOperation.leaf(medianInternal, [variableOrValues], options);\n}\nconst sdInternal = (dataCalc, params, options) => {\n\tlet variableOrValues = params ? params[0] : void 0;\n\tvariableOrValues = resolveLazy(variableOrValues, dataCalc);\n\tif (typeof variableOrValues === \"string\") {\n\t\tif (!dataCalc.variableExists(variableOrValues)) return null;\n\t\tconst varianceValue = varianceInternal(dataCalc, params, options);\n\t\tif (varianceValue === null) return null;\n\t\treturn Math.sqrt(varianceValue);\n\t} else if (Array.isArray(variableOrValues)) {\n\t\tconst varianceValue = varianceInternal(dataCalc, params ? [...params] : [variableOrValues], options);\n\t\tif (varianceValue === null) return null;\n\t\treturn Math.sqrt(varianceValue);\n\t} else return null;\n};\n/**\n* Calculates the standard deviation of a variable, value, or array of values\n*\n* @param variableOrValues - name of variable, or alternatively, a value or\n* array of values\n* @param options - options for handling missing values and boolean coercion\n* @returns summarize operation calculating the standard deviation\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* { a: 5, b: 0, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* sdA: sd(\"a\")\n* }).observations\n* );\n* // [ { sdA: 4.112987559751022 } ]\n* ```\n*/\nfunction sd(variableOrValues, options) {\n\treturn SummarizeOperation.leaf(sdInternal, [variableOrValues], options);\n}\n/**\n* Scalar / identity helper: wrap a numeric (or boolean) literal as a SummarizeOperation\n* so it can participate in expression chaining (e.g. s(10).mul(mean('a')) ).\n*/\nconst scalarInternal = (_dataCalc, params, options) => {\n\tlet v = params ? params[0] : void 0;\n\tif (typeof v === \"function\") v = v(_dataCalc);\n\tif (typeof v === \"string\") {\n\t\tconst m = /^__CHAIN_EXPR__\\[(.*?)\\]$/.exec(v);\n\t\tif (m) {\n\t\t\tconst payload = m[1];\n\t\t\tlet ops = getChainOps(payload);\n\t\t\tif (!ops) try {\n\t\t\t\tops = JSON.parse(decodeURIComponent(payload));\n\t\t\t} catch (_unused2) {\n\t\t\t\tops = void 0;\n\t\t\t}\n\t\t\tif (ops) {\n\t\t\t\tlet current = _dataCalc;\n\t\t\t\tlet evaluated = void 0;\n\t\t\t\tfor (const op of ops) {\n\t\t\t\t\tconst method = current[op.name];\n\t\t\t\t\tif (typeof method !== \"function\") {\n\t\t\t\t\t\tevaluated = NaN;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst res = method.apply(current, op.args);\n\t\t\t\t\tif (res instanceof DataCalc) {\n\t\t\t\t\t\tcurrent = res;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (Array.isArray(res)) {\n\t\t\t\t\t\tevaluated = res.length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof res === \"boolean\") {\n\t\t\t\t\t\tevaluated = res;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tevaluated = typeof res === \"number\" ? res : Number(res);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (evaluated === void 0) evaluated = current instanceof DataCalc ? current.length : NaN;\n\t\t\t\tif (!Number.isNaN(evaluated)) v = evaluated;\n\t\t\t\telse v = null;\n\t\t\t}\n\t\t}\n\t}\n\tif (typeof v === \"object\" && v !== null && \"summarizeFunction\" in v) try {\n\t\tconst op = v;\n\t\tconst paramsForOp = Array.isArray(op.parameters) ? op.parameters : op.parameters === void 0 ? void 0 : [op.parameters];\n\t\tv = op.summarizeFunction(_dataCalc, paramsForOp, op.options);\n\t} catch (_unused3) {\n\t\tv = null;\n\t}\n\tconst result = processSingleValue(v, options, \"scalar()\");\n\treturn result.isMissing ? null : result.value;\n};\n/**\n* Wraps a scalar literal as a `SummarizeOperation` so it can participate in\n* expression chaining with other summarize operations.\n*\n* @remarks Accepted inputs:\n* - number: returned as-is\n* - boolean: coerced to 1 (true) or 0 (false)\n* - null/undefined: treated as a missing value and yields `null` when\n* evaluated in a summarize context\n*\n* `s` is provided as a shorthand alias for `scalar`.\n*\n* @example\n* ```js\n* const d = [\n* { a: 1, b: 2, c: 3 },\n* { a: 0, b: 8, c: 3 },\n* { a: 9, b: 4, c: 7 },\n* ];\n* const dc = new DataCalc(d);\n* console.log(\n* dc.summarize({\n* meanA: scalar(10).mul(mean(\"a\")),\n* meanA2: s(10).mul(mean(\"a\")),\n* }).observations\n* );\n* // [ { meanA: 33.3333, meanA2: 33.3333 } ]\n* ```\n*/\nfunction scalar(value) {\n\treturn SummarizeOperation.leaf(scalarInternal, [value], void 0);\n}\nconst s = scalar;\n//#endregion\n//#region src/index.ts\nconsole.log(\"⚪ @m2c2kit/data-calc version 0.8.8 (35887002)\");\n//#endregion\nexport { DataCalc, SummarizeOperation, arrange, clearChainOps, distinct, filter, getChainOps, groupBy, max, mean, median, min, mutate, n, parens, pull, rename, s, scalar, sd, select, slice, sum, ungroup, variance };\n\n//# sourceMappingURL=index.js.map","import {\n Game,\n Action,\n Scene,\n Shape,\n Label,\n Transition,\n TransitionDirection,\n WebColors,\n RandomDraws,\n GameParameters,\n GameOptions,\n TrialSchema,\n Timer,\n Easings,\n RgbaColor,\n Sprite,\n Constants,\n Translation,\n M2Error,\n ScoringProvider,\n ActivityKeyValueData,\n ScoringSchema,\n} from \"@m2c2kit/core\";\nimport {\n Button,\n Grid,\n Instructions,\n CountdownScene,\n InstructionsOptions,\n LocalePicker,\n} from \"@m2c2kit/addons\";\nimport {\n arrange,\n DataCalc,\n filter,\n median,\n parens,\n scalar,\n sd,\n} from \"@m2c2kit/data-calc\";\n\n/**\n * Color Shapes is a visual array change detection task, measuring intra-item\n * feature binding, where participants determine if shapes change color across\n * two sequential presentations of shape stimuli.\n */\nclass ColorShapes extends Game implements ScoringProvider {\n constructor() {\n /**\n * These are configurable game parameters and their defaults.\n * Each game parameter should have a type, default (this is the default\n * value), and a description.\n */\n const defaultParameters: GameParameters = {\n fixation_duration_ms: {\n default: 500,\n description: \"How long fixation scene is shown, milliseconds.\",\n type: \"number\",\n },\n shape_colors: {\n type: \"array\",\n description: \"Array of colors for shapes.\",\n items: {\n type: \"object\",\n properties: {\n colorName: {\n type: \"string\",\n description: \"Human-friendly name of color.\",\n },\n rgbaColor: {\n type: \"array\",\n description: \"Color as array, [r,g,b,a].\",\n items: {\n type: \"number\",\n },\n },\n },\n },\n default: [\n { colorName: \"black\", rgbaColor: [0, 0, 0, 1] },\n { colorName: \"green\", rgbaColor: [0, 158, 115, 1] },\n { colorName: \"yellow\", rgbaColor: [240, 228, 66, 1] },\n { colorName: \"blue\", rgbaColor: [0, 114, 178, 1] },\n { colorName: \"orange\", rgbaColor: [213, 94, 0, 1] },\n { colorName: \"pink\", rgbaColor: [204, 121, 167, 1] },\n ],\n },\n number_of_shapes_shown: {\n default: 3,\n description: \"How many shapes to show on the grid at one time.\",\n type: \"integer\",\n },\n number_of_shapes_changing_color: {\n default: 2,\n description:\n \"If a different color trial, how many shapes should change color (minimum is 2, because changes are swaps with other shapes).\",\n type: \"integer\",\n },\n shapes_presented_duration_ms: {\n default: 2000,\n description: \"How long the shapes are shown, milliseconds.\",\n type: \"number\",\n },\n shapes_removed_duration_ms: {\n default: 1000,\n description:\n \"How long to show a blank square after shapes are removed, milliseconds.\",\n type: \"number\",\n },\n cells_per_side: {\n default: 3,\n description:\n \"How many cell positions for each side of the square grid (e.g., 3 is a 3x3 grid; 4 is a 4x4 grid).\",\n type: \"integer\",\n },\n number_of_different_colors_trials: {\n default: 6,\n type: \"integer\",\n description: \"Number of trials where the shapes have different colors.\",\n },\n number_of_trials: {\n default: 12,\n description: \"How many trials to run.\",\n type: \"integer\",\n },\n show_trials_complete_scene: {\n default: true,\n type: \"boolean\",\n description:\n \"After the final trial, should a completion scene be shown? Otherwise, the game will immediately end.\",\n },\n instruction_type: {\n default: \"long\",\n description: \"Type of instructions to show, 'short' or 'long'.\",\n type: \"string\",\n enum: [\"short\", \"long\"],\n },\n instructions: {\n default: null,\n type: [\"object\", \"null\"],\n description:\n \"When non-null, an InstructionsOptions object that will completely override the built-in instructions.\",\n },\n show_quit_button: {\n type: \"boolean\",\n default: false,\n description: \"Should the activity quit button be shown?\",\n },\n show_fps: {\n type: \"boolean\",\n default: false,\n description: \"Should the FPS be shown?\",\n },\n show_locale_picker: {\n type: \"boolean\",\n default: false,\n description:\n \"Should the icon that allows the participant to switch the locale be shown?\",\n },\n seed: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Optional seed for the seeded pseudo-random number generator. When null, the default Math.random() is used.\",\n },\n scoring: {\n type: \"boolean\",\n default: false,\n description: \"Should scoring data be generated? Default is false.\",\n },\n scoring_filter_response_time_duration_ms: {\n type: \"array\",\n items: {\n type: \"number\",\n },\n default: [100, 10000],\n description:\n \"When scoring, values of response_time_duration_ms less than the lower bound or greater than the upper bound are discarded. This array contains two numbers, the lower and upper bounds.\",\n },\n };\n\n /**\n * This describes all the data that will be generated by the assessment.\n * At runtime, when a trial completes, the data will be returned to the\n * session with a callback, along with this schema transformed into\n * JSON Schema.\n */\n const colorShapesTrialSchema: TrialSchema = {\n activity_begin_iso8601_timestamp: {\n type: \"string\",\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the game activity.\",\n },\n trial_begin_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the trial. Null if trial was skipped.\",\n },\n trial_end_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the end of the trial (when user presses 'Same' or 'Different'). Null if trial was skipped.\",\n },\n trial_index: {\n type: [\"integer\", \"null\"],\n description: \"Index of the trial within this assessment, 0-based.\",\n },\n present_shapes: {\n description:\n \"Configuration of shapes shown to the user in the presentation phase. Null if trial was skipped.\",\n type: [\"array\", \"null\"],\n items: {\n type: \"object\",\n properties: {\n shape_index: {\n type: \"integer\",\n description:\n \"Index of the shape within the library of shapes, 0-based\",\n },\n color_name: {\n type: \"string\",\n description: \"Human-friendly name of color.\",\n },\n rgba_color: {\n type: \"array\",\n description: \"Color as array, [r,g,b,a].\",\n items: {\n type: \"number\",\n },\n },\n location: {\n type: \"object\",\n description: \"Location of shape.\",\n properties: {\n row: {\n type: \"number\",\n description: \"Row of the shape, 0-based.\",\n },\n column: {\n type: \"number\",\n description: \"Column of the shape, 0-based.\",\n },\n },\n },\n },\n },\n },\n response_shapes: {\n description:\n \"Configuration of shapes shown to the user in the response phase. Null if trial was skipped.\",\n type: [\"array\", \"null\"],\n items: {\n type: \"object\",\n properties: {\n shape_index: {\n type: \"integer\",\n description:\n \"Index of the shape within the library of shapes, 0-based\",\n },\n color_name: {\n type: \"string\",\n description: \"Human-friendly name of color.\",\n },\n rgba_color: {\n type: \"array\",\n description: \"Color as array, [r,g,b,a].\",\n items: {\n type: \"number\",\n },\n },\n location: {\n type: \"object\",\n description: \"Location of shape.\",\n properties: {\n row: {\n type: \"number\",\n description: \"Row of the shape, 0-based.\",\n },\n column: {\n type: \"number\",\n description: \"Column of the shape, 0-based.\",\n },\n },\n },\n },\n },\n },\n response_time_duration_ms: {\n type: [\"number\", \"null\"],\n description:\n \"Milliseconds from when the response configuration of shapes is shown until the user taps a response. Null if trial was skipped.\",\n },\n user_response: {\n type: [\"string\", \"null\"],\n enum: [\"same\", \"different\"],\n description:\n \"User's response to whether the shapes are same colors or different.\",\n },\n user_response_correct: {\n type: [\"boolean\", \"null\"],\n description: \"Was the user's response correct?\",\n },\n quit_button_pressed: {\n type: \"boolean\",\n description: \"Was the quit button pressed?\",\n },\n };\n\n const colorShapesScoringSchema: ScoringSchema = {\n activity_begin_iso8601_timestamp: {\n type: \"string\",\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the game activity.\",\n },\n first_trial_begin_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the beginning of the first trial. Null if no trials were completed.\",\n },\n last_trial_end_iso8601_timestamp: {\n type: [\"string\", \"null\"],\n format: \"date-time\",\n description:\n \"ISO 8601 timestamp at the end of the last trial. Null if no trials were completed.\",\n },\n response_time_filter_lower_bound: {\n type: \"number\",\n description:\n \"Response times less than this lower bound were discarded when calculating filtered response times.\",\n },\n response_time_filter_upper_bound: {\n type: \"number\",\n description:\n \"Response times greater than this upper bound were discarded when calculating filtered response times.\",\n },\n n_trials: {\n type: \"integer\",\n description: \"Number of trials completed.\",\n },\n flag_trials_match_expected: {\n type: \"integer\",\n description:\n \"Does the number of completed and expected trials match? 1 = true, 0 = false.\",\n },\n n_trials_correct: {\n type: \"integer\",\n description: \"Number of correct trials.\",\n },\n n_trials_incorrect: {\n type: \"integer\",\n description: \"Number of incorrect trials.\",\n },\n participant_score: {\n type: [\"number\", \"null\"],\n description:\n \"Participant-facing score, calculated as (number of correct trials / number of trials attempted) * 100. This is a simple metric to provide feedback to the participant. Null if no trials attempted.\",\n },\n flag_trials_lt_expected: {\n type: \"number\",\n description:\n \"Is the number of completed trials fewer than expected? 1 = true, 0 = false.\",\n },\n flag_trials_gt_expected: {\n type: \"number\",\n description:\n \"Is the number of completed trials greater than expected? 1 = true, 0 = false.\",\n },\n n_trials_HIT: {\n type: \"number\",\n description:\n \"Number of HIT trials (correctly identified a 'different' trial)\",\n },\n n_trials_MISS: {\n type: \"number\",\n description:\n \"Number of MISS trials (failed to detect a 'different' trial, responded 'same')\",\n },\n n_trials_FA: {\n type: \"number\",\n description:\n \"Number of False Alarm trials (incorrectly responded 'different' on a 'same' trial)\",\n },\n n_trials_CR: {\n type: \"number\",\n description:\n \"Number of Correct Rejection trials (correctly responded 'same' on a 'same' trial)\",\n },\n n_trials_type_same: {\n type: \"number\",\n description:\n \"Number of trials where the true signal type was 'SAME' (presented and response shapes were identical)\",\n },\n n_trials_type_different: {\n type: \"number\",\n description:\n \"Number of trials where the true signal type was 'DIFFERENT' (response shapes differed from presented)\",\n },\n HIT_rate: {\n type: [\"number\", \"null\"],\n description:\n \"Proportion of 'different' trials correctly identified as different. Calculated as n_trials_HIT / n_trials_type_different\",\n },\n MISS_rate: {\n type: [\"number\", \"null\"],\n description:\n \"Proportion of 'different' trials incorrectly identified as same. Calculated as 1 - HIT_rate\",\n },\n FA_rate: {\n type: [\"number\", \"null\"],\n description:\n \"Proportion of 'same' trials incorrectly identified as different. Calculated as n_trials_FA / n_trials_type_same\",\n },\n CR_rate: {\n type: [\"number\", \"null\"],\n description:\n \"Proportion of 'same' trials correctly identified as same. Calculated as 1 - FA_rate\",\n },\n\n n_trials_rt_invalid: {\n type: \"number\",\n description:\n \"Number of trials with null or non-positive response times (excluded from RT calculations)\",\n },\n median_rt_overall_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) across all trials with valid (non-null, positive) response times. No outlier filtering applied\",\n },\n sd_rt_overall_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) across all trials with valid response times. No outlier filtering applied\",\n },\n median_rt_HIT_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for HIT trials with valid response times. No outlier filtering\",\n },\n sd_rt_HIT_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for HIT trials with valid response times. No outlier filtering\",\n },\n median_rt_MISS_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for MISS trials with valid response times. No outlier filtering\",\n },\n sd_rt_MISS_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for MISS trials with valid response times. No outlier filtering\",\n },\n median_rt_FA_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for False Alarm trials with valid response times. No outlier filtering\",\n },\n sd_rt_FA_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for False Alarm trials with valid response times. No outlier filtering\",\n },\n median_rt_CR_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for Correct Rejection trials with valid response times. No outlier filtering\",\n },\n sd_rt_CR_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for Correct Rejection trials with valid response times. No outlier filtering\",\n },\n median_rt_overall_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) across all valid trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n sd_rt_overall_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) across all valid trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n n_outliers_rt_overall_valid: {\n type: \"number\",\n description:\n \"Number of valid trials removed as RT outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n median_rt_HIT_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for HIT trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n sd_rt_HIT_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for HIT trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n n_outliers_rt_HIT_valid: {\n type: \"number\",\n description:\n \"Number of HIT trials removed as RT outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n median_rt_MISS_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for MISS trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n sd_rt_MISS_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for MISS trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n n_outliers_rt_MISS_valid: {\n type: \"number\",\n description:\n \"Number of MISS trials removed as RT outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n median_rt_FA_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for False Alarm trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n sd_rt_FA_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for False Alarm trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n n_outliers_rt_FA_valid: {\n type: \"number\",\n description:\n \"Number of False Alarm trials removed as RT outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n median_rt_CR_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Median response time (ms) for Correct Rejection trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n sd_rt_CR_valid_filtered: {\n type: [\"number\", \"null\"],\n description:\n \"Standard deviation of response time (ms) for Correct Rejection trials after removing outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n n_outliers_rt_CR_valid: {\n type: [\"number\", \"null\"],\n description:\n \"Number of Correct Rejection trials removed as RT outliers, as specified in response_time_filter_lower_bound and response_time_filter_upper_bound.\",\n },\n };\n\n const translation: Translation = {\n configuration: {\n baseLocale: \"en-US\",\n },\n \"en-US\": {\n localeName: \"English\",\n INSTRUCTIONS_TITLE: \"Color Shapes\",\n SHORT_INSTRUCTIONS_TEXT_PAGE_1:\n \"Try to remember the color of 3 shapes, because they will soon disappear. When the shapes reappear, answer whether they have the SAME or DIFFERENT colors as they had before\",\n INSTRUCTIONS_TEXT_PAGE_1:\n \"Try to remember the color of 3 shapes, because they will soon disappear.\",\n INSTRUCTIONS_TEXT_PAGE_2: \"Next you will see the same shapes reappear.\",\n INSTRUCTIONS_TEXT_PAGE_3:\n \"Answer whether the shapes have the SAME or DIFFERENT colors as they had before.\",\n START_BUTTON_TEXT: \"START\",\n NEXT_BUTTON_TEXT: \"Next\",\n BACK_BUTTON_TEXT: \"Back\",\n GET_READY_COUNTDOWN_TEXT: \"GET READY!\",\n SAME_BUTTON_TEXT: \"Same\",\n DIFFERENT_BUTTON_TEXT: \"Different\",\n TRIALS_COMPLETE_SCENE_TEXT: \"This activity is complete.\",\n TRIALS_COMPLETE_SCENE_BUTTON_TEXT: \"OK\",\n },\n // cSpell:disable (for VS Code extension, Code Spell Checker)\n \"es-MX\": {\n localeName: \"Español\",\n INSTRUCTIONS_TITLE: \"Formas de Color\",\n // Short instructions need to be translated.\n // SHORT_INSTRUCTIONS_TEXT_PAGE_1: \"\",\n INSTRUCTIONS_TEXT_PAGE_1:\n \"Intenta recordar el color de las 3 formas, porque pronto desaparecerán.\",\n INSTRUCTIONS_TEXT_PAGE_2: \"Luego verás reaparecer las mismas formas.\",\n INSTRUCTIONS_TEXT_PAGE_3:\n \"Responde si las formas tienen el MISMO o DIFERENTE color que antes.\",\n START_BUTTON_TEXT: \"COMENZAR\",\n NEXT_BUTTON_TEXT: \"Siguiente\",\n BACK_BUTTON_TEXT: \"Atrás\",\n GET_READY_COUNTDOWN_TEXT: \"PREPÁRESE\",\n SAME_BUTTON_TEXT: \"Mismo\",\n DIFFERENT_BUTTON_TEXT: \"Diferente\",\n TRIALS_COMPLETE_SCENE_TEXT: \"Esta actividad está completa.\",\n TRIALS_COMPLETE_SCENE_BUTTON_TEXT: \"OK\",\n },\n \"de-DE\": {\n localeName: \"Deutsch\",\n INSTRUCTIONS_TITLE: \"Farb-Formen\",\n // Short instructions need to be translated.\n // SHORT_INSTRUCTIONS_TEXT_PAGE_1: \"\",\n INSTRUCTIONS_TEXT_PAGE_1: \"Oben und unten sehen Sie Symbolpaare.\",\n INSTRUCTIONS_TEXT_PAGE_2:\n \"Ihre Aufgabe wird es sein, auf dasjenige untere Paar zu tippen, welches mit einem der obigen Paare exakt übereinstimmt.\",\n INSTRUCTIONS_TEXT_PAGE_3:\n \"Versuchen Sie bitte, so schnell und korrekt wie möglich zu sein.\",\n START_BUTTON_TEXT: \"START\",\n NEXT_BUTTON_TEXT: \"Weiter\",\n BACK_BUTTON_TEXT: \"Vorherige\",\n GET_READY_COUNTDOWN_TEXT: \"BEREIT MACHEN\",\n SAME_BUTTON_TEXT: \"Gleich\",\n DIFFERENT_BUTTON_TEXT: \"Unterschiedlich\",\n TRIALS_COMPLETE_SCENE_TEXT: \"Die Aufgabe ist beendet.\",\n TRIALS_COMPLETE_SCENE_BUTTON_TEXT: \"OK\",\n },\n // cSpell:enable\n };\n\n const options: GameOptions = {\n name: \"Color Shapes\",\n /**\n * This id must match the property m2c2kit.assessmentId in package.json\n */\n id: \"color-shapes\",\n publishUuid: \"394cb010-2ccf-4a87-9d23-cda7fb07a960\",\n version: \"0.8.35 (35887002)\",\n moduleMetadata: Constants.MODULE_METADATA_PLACEHOLDER,\n translation: translation,\n shortDescription:\n \"Color Shapes is a visual array change detection \\\ntask, measuring intra-item feature binding, where participants determine \\\nif shapes change color across two sequential presentations of shape \\\nstimuli.\",\n longDescription: `Color Shapes is a change detection paradigm used \\\nto measure visual short-term memory binding (Parra et al., 2009). \\\nParticipants are asked to memorize the shapes and colors of three different \\\npolygons for 3 seconds. The three polygons are then removed from the screen \\\nand re-displayed at different locations, either having the same or different \\\ncolors. Participants are then asked to decide whether the combination of \\\ncolors and shapes are the \"Same\" or \"Different\" between the study and test \\\nphases.`,\n showFps: defaultParameters.show_fps.default,\n width: 400,\n height: 800,\n trialSchema: colorShapesTrialSchema,\n scoringSchema: colorShapesScoringSchema,\n parameters: defaultParameters,\n fonts: [\n {\n fontName: \"roboto\",\n url: \"fonts/roboto/Roboto-Regular.ttf\",\n },\n ],\n images: [\n {\n imageName: \"instructions-1\",\n height: 256,\n width: 256,\n url: \"images/cs-instructions-1.png\",\n },\n {\n imageName: \"instructions-2\",\n height: 256,\n width: 256,\n url: \"images/cs-instructions-2.png\",\n },\n {\n imageName: \"instructions-3\",\n height: 350,\n width: 300,\n url: \"images/cs-instructions-3.png\",\n localize: true,\n },\n {\n imageName: \"circle-x\",\n height: 32,\n width: 32,\n // the svg is from evericons and is licensed under CC0 1.0\n // Universal (Public Domain). see https://www.patreon.com/evericons\n url: \"images/circle-x.svg\",\n },\n ],\n };\n\n super(options);\n }\n\n override async initialize() {\n await super.initialize();\n // just for convenience, alias the variable game to \"this\"\n // (even though eslint doesn't like it)\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const game = this;\n\n const seed = game.getParameter<string | null>(\"seed\");\n if (typeof seed === \"string\") {\n RandomDraws.setSeed(seed);\n }\n\n const SHAPE_SVG_HEIGHT = 96;\n const SQUARE_SIDE_LENGTH = 350;\n const numberOfShapesShown = game.getParameter<number>(\n \"number_of_shapes_shown\",\n );\n const shapeLibrary = this.makeShapes(SHAPE_SVG_HEIGHT);\n\n // ==============================================================\n\n if (game.getParameter<boolean>(\"show_quit_button\")) {\n const quitSprite = new Sprite({\n imageName: \"circle-x\",\n position: { x: 380, y: 20 },\n isUserInteractionEnabled: true,\n });\n game.addFreeNode(quitSprite);\n quitSprite.onTapDown((e) => {\n game.removeAllFreeNodes();\n e.handled = true;\n const blankScene = new Scene();\n game.addScene(blankScene);\n game.presentScene(blankScene);\n game.addTrialData(\"quit_button_pressed\", true);\n game.trialComplete();\n if (game.getParameter<boolean>(\"scoring\")) {\n // Score the data only if user does not quit. If user quits, pass\n // empty data to calculateScores so a \"blank\" set of scores is\n // generated.\n const scores = game.calculateScores([], {\n rtLowerBound: game.getParameter<Array<number>>(\n \"scoring_filter_response_time_duration_ms\",\n )[0],\n rtUpperBound: game.getParameter<Array<number>>(\n \"scoring_filter_response_time_duration_ms\",\n )[1],\n numberOfTrials: game.getParameter<number>(\"number_of_trials\"),\n });\n game.addScoringData(scores);\n game.scoringComplete();\n }\n game.cancel();\n });\n }\n\n let localePicker: LocalePicker;\n if (game.getParameter<boolean>(\"show_locale_picker\")) {\n localePicker = new LocalePicker();\n game.addFreeNode(localePicker);\n }\n\n // ==============================================================\n // SCENES: instructions\n let instructionsScenes: Array<Scene>;\n\n const customInstructions = game.getParameter<InstructionsOptions | null>(\n \"instructions\",\n );\n if (customInstructions) {\n instructionsScenes = Instructions.create(customInstructions);\n } else {\n switch (game.getParameter(\"instruction_type\")) {\n case \"short\": {\n instructionsScenes = Instructions.create({\n instructionScenes: [\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"SHORT_INSTRUCTIONS_TEXT_PAGE_1\",\n imageName: \"instructions-1\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"START_BUTTON_TEXT\",\n nextButtonBackgroundColor: WebColors.Green,\n nextSceneTransition: Transition.none(),\n },\n ],\n });\n break;\n }\n case \"long\": {\n instructionsScenes = Instructions.create({\n instructionScenes: [\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"INSTRUCTIONS_TEXT_PAGE_1\",\n imageName: \"instructions-1\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"NEXT_BUTTON_TEXT\",\n backButtonText: \"BACK_BUTTON_TEXT\",\n },\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"INSTRUCTIONS_TEXT_PAGE_2\",\n imageName: \"instructions-2\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"NEXT_BUTTON_TEXT\",\n backButtonText: \"BACK_BUTTON_TEXT\",\n },\n {\n title: \"INSTRUCTIONS_TITLE\",\n text: \"INSTRUCTIONS_TEXT_PAGE_3\",\n imageName: \"instructions-3\",\n imageAboveText: false,\n imageMarginTop: 32,\n textFontSize: 24,\n titleFontSize: 30,\n textVerticalBias: 0.2,\n nextButtonText: \"START_BUTTON_TEXT\",\n nextButtonBackgroundColor: WebColors.Green,\n backButtonText: \"BACK_BUTTON_TEXT\",\n },\n ],\n });\n break;\n }\n default: {\n throw new M2Error(\"invalid value for instruction_type\");\n }\n }\n }\n instructionsScenes[0].onAppear(() => {\n // in case user quits before starting a trial, record the\n // timestamp\n game.addTrialData(\n \"activity_begin_iso8601_timestamp\",\n this.beginIso8601Timestamp,\n );\n });\n game.addScenes(instructionsScenes);\n\n // ==============================================================\n // SCENE: countdown. Show 3 second countdown.\n const countdownScene = new CountdownScene({\n milliseconds: 3000,\n text: \"GET_READY_COUNTDOWN_TEXT\",\n zeroDwellMilliseconds: 1000,\n transition: Transition.none(),\n });\n game.addScene(countdownScene);\n\n const gridRows = game.getParameter<number>(\"cells_per_side\");\n const gridColumns = game.getParameter<number>(\"cells_per_side\");\n const numberOfTrials = game.getParameter<number>(\"number_of_trials\");\n const shapeColors =\n game.getParameter<Array<{ colorName: string; rgbaColor: RgbaColor }>>(\n \"shape_colors\",\n );\n\n interface DisplayShape {\n shape: Shape;\n shapeIndex: number;\n color: RgbaColor;\n colorName: string;\n location: {\n row: number;\n column: number;\n };\n }\n\n interface TrialConfiguration {\n presentShapes: Array<DisplayShape>;\n responseShapes: Array<DisplayShape>;\n numberOfShapesWithDifferentColors: number;\n }\n\n const trialConfigurations: Array<TrialConfiguration> = [];\n const rows = game.getParameter<number>(\"cells_per_side\");\n const columns = rows;\n const numberOfDifferentColorsTrials = game.getParameter<number>(\n \"number_of_different_colors_trials\",\n );\n const differentColorsTrialIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfDifferentColorsTrials,\n 0,\n numberOfTrials - 1,\n );\n\n for (let i = 0; i < numberOfTrials; i++) {\n const presentShapes = new Array<DisplayShape>();\n const responseShapes = new Array<DisplayShape>();\n const shapesToShowIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfShapesShown,\n 0,\n shapeLibrary.length - 1,\n );\n const shapeColorsIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfShapesShown,\n 0,\n shapeColors.length - 1,\n );\n\n // do not allow shapes to be in the same row or column\n // or along the diagonal\n const onDiagonal = (\n locations: {\n row: number;\n column: number;\n }[],\n ): boolean => {\n if (\n locations\n .map((c) => c.row === 0 && c.column === 0)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 1 && c.column === 1)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 2 && c.column === 2)\n .some((e) => e === true)\n ) {\n return true;\n }\n if (\n locations\n .map((c) => c.row === 2 && c.column === 0)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 1 && c.column === 1)\n .some((e) => e === true) &&\n locations\n .map((c) => c.row === 0 && c.column === 2)\n .some((e) => e === true)\n ) {\n return true;\n }\n return false;\n };\n\n const inLine = (\n locations: {\n row: number;\n column: number;\n }[],\n ): boolean => {\n const uniqueRows = new Set(locations.map((l) => l.row)).size;\n const uniqueColumns = new Set(locations.map((l) => l.column)).size;\n\n if (uniqueRows !== 1 && uniqueColumns !== 1) {\n return false;\n }\n return true;\n };\n\n // assign present shapes' locations and colors\n let presentLocationsOk = false;\n let presentLocations: {\n row: number;\n column: number;\n }[];\n do {\n presentLocations = RandomDraws.fromGridWithoutReplacement(\n numberOfShapesShown,\n rows,\n columns,\n );\n\n if (!inLine(presentLocations) && !onDiagonal(presentLocations)) {\n presentLocationsOk = true;\n } else {\n presentLocationsOk = false;\n }\n } while (!presentLocationsOk);\n for (let j = 0; j < numberOfShapesShown; j++) {\n const presentShape: DisplayShape = {\n shape: shapeLibrary[shapesToShowIndexes[j]],\n shapeIndex: shapesToShowIndexes[j],\n color: shapeColors[shapeColorsIndexes[j]].rgbaColor,\n colorName: shapeColors[shapeColorsIndexes[j]].colorName,\n location: presentLocations[j],\n };\n presentShapes.push(presentShape);\n }\n\n // assign response shapes' locations\n let responseLocationsOk = false;\n let responseLocations: {\n row: number;\n column: number;\n }[];\n do {\n responseLocations = RandomDraws.fromGridWithoutReplacement(\n numberOfShapesShown,\n rows,\n columns,\n );\n\n if (!inLine(responseLocations) && !onDiagonal(responseLocations)) {\n responseLocationsOk = true;\n } else {\n responseLocationsOk = false;\n }\n } while (!responseLocationsOk);\n for (let j = 0; j < numberOfShapesShown; j++) {\n const responseShape: DisplayShape = {\n shape: presentShapes[j].shape,\n shapeIndex: shapesToShowIndexes[j],\n color: presentShapes[j].color,\n colorName: shapeColors[shapeColorsIndexes[j]].colorName,\n location: responseLocations[j],\n };\n responseShapes.push(responseShape);\n }\n\n let numberOfShapesWithDifferentColors = 0;\n const differentColorTrial = differentColorsTrialIndexes.includes(i);\n\n if (differentColorTrial) {\n const numberOfShapesToChange = game.getParameter<number>(\n \"number_of_shapes_changing_color\",\n );\n if (numberOfShapesToChange > numberOfShapesShown) {\n throw new M2Error(\n `number_of_shapes_changing_color is ${numberOfShapesToChange}, but it must be less than or equal to number_of_shapes_shown (which is ${numberOfShapesShown}).`,\n );\n }\n const shapesToChangeIndexes = RandomDraws.fromRangeWithoutReplacement(\n numberOfShapesToChange,\n 0,\n numberOfShapesShown - 1,\n );\n const shapesToChange = shapesToChangeIndexes.map(\n (index) => responseShapes[index],\n );\n numberOfShapesWithDifferentColors = shapesToChange.length;\n\n /**\n * rotate each shape's color to the next one. The last shape\n * gets the first shape's color\n */\n const firstShapeColor = shapesToChange[0].color;\n for (let j = 0; j < numberOfShapesToChange; j++) {\n const shape = shapesToChange[j];\n if (j + 1 < numberOfShapesToChange) {\n shape.color = shapesToChange[j + 1].color;\n } else {\n shape.color = firstShapeColor;\n }\n }\n }\n\n trialConfigurations.push({\n presentShapes: presentShapes,\n responseShapes: responseShapes,\n numberOfShapesWithDifferentColors: numberOfShapesWithDifferentColors,\n });\n }\n\n // ==============================================================\n // SCENE: fixation. Show get ready message, then advance after XXXX\n // milliseconds (as defined in fixation_duration_ms parameter)\n const fixationScene = new Scene();\n game.addScene(fixationScene);\n\n const fixationSceneSquare = new Shape({\n rect: { size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH } },\n fillColor: WebColors.Transparent,\n strokeColor: WebColors.Gray,\n lineWidth: 4,\n position: { x: 200, y: 300 },\n });\n fixationScene.addChild(fixationSceneSquare);\n\n const plusLabel = new Label({\n text: \"+\",\n fontSize: 32,\n fontColor: WebColors.Black,\n localize: false,\n });\n fixationSceneSquare.addChild(plusLabel);\n\n fixationScene.onAppear(() => {\n game.addTrialData(\n \"activity_begin_iso8601_timestamp\",\n this.beginIso8601Timestamp,\n );\n game.addTrialData(\n \"trial_begin_iso8601_timestamp\",\n new Date().toISOString(),\n );\n fixationScene.run(\n Action.sequence([\n Action.wait({ duration: game.getParameter(\"fixation_duration_ms\") }),\n Action.custom({\n callback: () => {\n game.presentScene(shapePresentationScene);\n },\n }),\n ]),\n );\n });\n\n // ==============================================================\n // SCENE: Shape Presentation.\n const shapePresentationScene = new Scene();\n game.addScene(shapePresentationScene);\n\n const presentationSceneSquare = new Shape({\n rect: { size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH } },\n fillColor: WebColors.Transparent,\n strokeColor: WebColors.Gray,\n lineWidth: 4,\n position: { x: 200, y: 300 },\n });\n shapePresentationScene.addChild(presentationSceneSquare);\n\n const presentationGrid = new Grid({\n rows: gridRows,\n columns: gridColumns,\n size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH },\n position: { x: 200, y: 300 },\n backgroundColor: WebColors.Transparent,\n gridLineColor: WebColors.Transparent,\n });\n shapePresentationScene.addChild(presentationGrid);\n\n shapePresentationScene.onAppear(() => {\n const trialConfiguration = trialConfigurations[game.trialIndex];\n for (let i = 0; i < trialConfiguration.presentShapes.length; i++) {\n const presentShape = trialConfiguration.presentShapes[i].shape;\n presentShape.fillColor = trialConfiguration.presentShapes[i].color;\n /**\n * Because we are repositioning children of a grid, we need to\n * set its position back to zero, because in the grid, it recalculates\n * the position. If we don't do this, the shapes will be positioned\n * incorrectly if they are positioned a second time.\n */\n presentShape.position = { x: 0, y: 0 };\n presentationGrid.addAtCell(\n presentShape,\n trialConfiguration.presentShapes[i].location.row,\n trialConfiguration.presentShapes[i].location.column,\n );\n }\n shapePresentationScene.run(\n Action.sequence([\n Action.wait({\n duration: game.getParameter(\"shapes_presented_duration_ms\"),\n }),\n Action.custom({\n callback: () => {\n presentationGrid.removeAllGridChildren();\n },\n }),\n Action.wait({\n duration: game.getParameter(\"shapes_removed_duration_ms\"),\n }),\n Action.custom({\n callback: () => {\n presentationGrid.removeAllGridChildren();\n game.presentScene(shapeResponseScene);\n },\n }),\n ]),\n );\n });\n\n // ==============================================================\n // SCENE: Shape Response.\n const shapeResponseScene = new Scene();\n game.addScene(shapeResponseScene);\n\n const responseSceneSquare = new Shape({\n rect: { size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH } },\n fillColor: WebColors.Transparent,\n strokeColor: WebColors.Gray,\n lineWidth: 4,\n position: { x: 200, y: 300 },\n });\n shapeResponseScene.addChild(responseSceneSquare);\n\n const responseGrid = new Grid({\n rows: gridRows,\n columns: gridColumns,\n size: { width: SQUARE_SIDE_LENGTH, height: SQUARE_SIDE_LENGTH },\n position: { x: 200, y: 300 },\n backgroundColor: WebColors.Transparent,\n gridLineColor: WebColors.Transparent,\n });\n shapeResponseScene.addChild(responseGrid);\n\n shapeResponseScene.onAppear(() => {\n const trialConfiguration = trialConfigurations[game.trialIndex];\n for (let i = 0; i < trialConfiguration.responseShapes.length; i++) {\n const responseShape = trialConfiguration.responseShapes[i].shape;\n responseShape.fillColor = trialConfiguration.responseShapes[i].color;\n /**\n * Because we are repositioning children of a grid, we need to\n * set its position back to zero, because in the grid, it recalculates\n * the position. If we don't do this, the shapes will be positioned\n * incorrectly if they are positioned a second time.\n */\n responseShape.position = { x: 0, y: 0 };\n responseGrid.addAtCell(\n responseShape,\n trialConfiguration.responseShapes[i].location.row,\n trialConfiguration.responseShapes[i].location.column,\n );\n }\n sameButton.isUserInteractionEnabled = true;\n differentButton.isUserInteractionEnabled = true;\n Timer.startNew(\"rt\");\n });\n\n const sameButton = new Button({\n text: \"SAME_BUTTON_TEXT\",\n position: { x: 100, y: 700 },\n size: { width: 150, height: 50 },\n });\n shapeResponseScene.addChild(sameButton);\n sameButton.onTapDown(() => {\n sameButton.isUserInteractionEnabled = false;\n handleSelection(false);\n });\n\n const differentButton = new Button({\n text: \"DIFFERENT_BUTTON_TEXT\",\n position: { x: 300, y: 700 },\n size: { width: 150, height: 50 },\n });\n shapeResponseScene.addChild(differentButton);\n differentButton.onTapDown(() => {\n differentButton.isUserInteractionEnabled = false;\n handleSelection(true);\n });\n\n const handleSelection = (differentPressed: boolean) => {\n const rt = Timer.elapsed(\"rt\");\n Timer.remove(\"rt\");\n responseGrid.removeAllGridChildren();\n\n game.addTrialData(\n \"trial_end_iso8601_timestamp\",\n new Date().toISOString(),\n );\n const trialConfiguration = trialConfigurations[game.trialIndex];\n game.addTrialData(\"response_time_duration_ms\", rt);\n game.addTrialData(\n \"user_response\",\n differentPressed ? \"different\" : \"same\",\n );\n const correctResponse =\n (trialConfiguration.numberOfShapesWithDifferentColors === 0 &&\n !differentPressed) ||\n (trialConfiguration.numberOfShapesWithDifferentColors > 0 &&\n differentPressed);\n game.addTrialData(\"user_response_correct\", correctResponse);\n\n const presentShapes = trialConfiguration.presentShapes.map((p) => {\n return {\n shape_index: p.shapeIndex,\n color_name: p.colorName,\n rgba_color: p.color,\n location: p.location,\n };\n });\n game.addTrialData(\"present_shapes\", presentShapes);\n game.addTrialData(\"quit_button_pressed\", false);\n\n const responseShapes = trialConfiguration.responseShapes.map((p) => {\n return {\n shape_index: p.shapeIndex,\n color_name: p.colorName,\n rgba_color: p.color,\n location: p.location,\n };\n });\n game.addTrialData(\"response_shapes\", responseShapes);\n game.addTrialData(\"trial_index\", game.trialIndex);\n\n game.trialComplete();\n if (game.trialIndex < numberOfTrials) {\n game.presentScene(fixationScene);\n } else {\n if (game.getParameter<boolean>(\"scoring\")) {\n const scores = game.calculateScores(game.data.trials, {\n rtLowerBound: game.getParameter<Array<number>>(\n \"scoring_filter_response_time_duration_ms\",\n )[0],\n rtUpperBound: game.getParameter<Array<number>>(\n \"scoring_filter_response_time_duration_ms\",\n )[1],\n numberOfTrials: game.getParameter<number>(\"number_of_trials\"),\n });\n game.addScoringData(scores);\n game.scoringComplete();\n }\n\n if (game.getParameter(\"show_trials_complete_scene\")) {\n game.presentScene(\n doneScene,\n Transition.slide({\n direction: TransitionDirection.Left,\n duration: 500,\n easing: Easings.sinusoidalInOut,\n }),\n );\n } else {\n game.end();\n }\n }\n };\n\n // ==============================================================\n // SCENE: done. Show done message, with a button to exit.\n const doneScene = new Scene();\n game.addScene(doneScene);\n\n const doneSceneText = new Label({\n text: \"TRIALS_COMPLETE_SCENE_TEXT\",\n position: { x: 200, y: 400 },\n });\n doneScene.addChild(doneSceneText);\n\n const okButton = new Button({\n text: \"TRIALS_COMPLETE_SCENE_BUTTON_TEXT\",\n position: { x: 200, y: 650 },\n });\n okButton.isUserInteractionEnabled = true;\n okButton.onTapDown(() => {\n // don't allow repeat taps of ok button\n okButton.isUserInteractionEnabled = false;\n doneScene.removeAllChildren();\n game.end();\n });\n doneScene.addChild(okButton);\n doneScene.onSetup(() => {\n // no need to have cancel button, because we're done\n game.removeAllFreeNodes();\n });\n }\n\n calculateScores(\n data: ActivityKeyValueData[],\n extras: {\n rtLowerBound: number;\n rtUpperBound: number;\n numberOfTrials: number;\n },\n ) {\n const dc = new DataCalc(data);\n\n // Trials participant completed; remove quit trials from the count.\n const n_trials = dc.filter((o) => o.quit_button_pressed === false).length;\n\n // mutate to add metric fields, then summarize\n const scores = dc\n .mutate({\n metric_accuracy: (obs) => {\n const ur = obs.user_response;\n const uc = obs.user_response_correct;\n if (ur === \"same\" && uc === true) return \"CR\";\n if (ur === \"same\" && uc === false) return \"MISS\";\n if (ur === \"different\" && uc === true) return \"HIT\";\n if (ur === \"different\" && uc === false) return \"FA\";\n return null;\n },\n metric_trial_type: (obs) => {\n const ur = obs.user_response;\n const uc = obs.user_response_correct;\n if (ur === \"same\" && uc === true) return \"SAME\";\n if (ur === \"same\" && uc === false) return \"DIFFERENT\";\n if (ur === \"different\" && uc === true) return \"DIFFERENT\";\n if (ur === \"different\" && uc === false) return \"SAME\";\n return null;\n },\n is_valid: (obs) =>\n typeof obs.response_time_duration_ms === \"number\" &&\n obs.response_time_duration_ms > 0,\n })\n .summarize({\n activity_begin_iso8601_timestamp: this.beginIso8601Timestamp,\n first_trial_begin_iso8601_timestamp: arrange(\n \"trial_begin_iso8601_timestamp\",\n )\n .slice(0)\n .pull(\"trial_begin_iso8601_timestamp\"),\n last_trial_end_iso8601_timestamp: arrange(\n \"-trial_end_iso8601_timestamp\",\n )\n .slice(0)\n .pull(\"trial_end_iso8601_timestamp\"),\n n_trials: n_trials,\n flag_trials_match_expected: n_trials === extras.numberOfTrials ? 1 : 0,\n flag_trials_lt_expected: n_trials < extras.numberOfTrials ? 1 : 0,\n flag_trials_gt_expected: n_trials > extras.numberOfTrials ? 1 : 0,\n\n // counts by accuracy\n n_trials_HIT: filter((o) => o.metric_accuracy === \"HIT\").length,\n n_trials_MISS: filter((o) => o.metric_accuracy === \"MISS\").length,\n n_trials_FA: filter((o) => o.metric_accuracy === \"FA\").length,\n n_trials_CR: filter((o) => o.metric_accuracy === \"CR\").length,\n\n // trial types\n n_trials_type_same: filter((o) => o.metric_trial_type === \"SAME\")\n .length,\n n_trials_type_different: filter(\n (o) => o.metric_trial_type === \"DIFFERENT\",\n ).length,\n\n // Note: When the summarize operation is a custom function,\n // () => value, rather than a built in function like sum or mean,\n // we must provide the DataCalc object as an argument to the\n // function, and do the filtering and pulling of values on that\n // object within the function. Specifically below, we must do:\n // const denom = d.filter(...).length\n // NOT\n // const denom = filter(...).length\n\n // rates\n HIT_rate: (d: DataCalc) => {\n const denom = d.filter(\n (o) => o.metric_trial_type === \"DIFFERENT\",\n ).length;\n return denom > 0\n ? d.filter((o) => o.metric_accuracy === \"HIT\").length / denom\n : null;\n },\n MISS_rate: (d: DataCalc) => {\n const denom = d.filter(\n (o) => o.metric_trial_type === \"DIFFERENT\",\n ).length;\n return denom > 0\n ? 1 - d.filter((o) => o.metric_accuracy === \"HIT\").length / denom\n : null;\n },\n FA_rate: (d: DataCalc) => {\n const denom = d.filter((o) => o.metric_trial_type === \"SAME\").length;\n return denom > 0\n ? d.filter((o) => o.metric_accuracy === \"FA\").length / denom\n : null;\n },\n CR_rate: (d: DataCalc) => {\n const denom = d.filter((o) => o.metric_trial_type === \"SAME\").length;\n return denom > 0\n ? 1 - d.filter((o) => o.metric_accuracy === \"FA\").length / denom\n : null;\n },\n\n // response time summaries\n // overall valid RTs (>0)\n median_rt_overall_valid: median(\n filter((o) => o.is_valid).pull(\"response_time_duration_ms\"),\n ),\n sd_rt_overall_valid: sd(\n filter((o) => o.is_valid).pull(\"response_time_duration_ms\"),\n ),\n\n // filtered overall RTs\n median_rt_overall_valid_filtered: median(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_overall_valid_filtered: sd(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n\n // counts of invalid/outliers\n n_trials_rt_invalid: filter((o) => !o.is_valid).length,\n n_outliers_rt_overall_valid: filter((o) => o.is_valid).filter(\n (o) =>\n o.response_time_duration_ms < extras.rtLowerBound ||\n o.response_time_duration_ms > extras.rtUpperBound,\n ).length,\n\n response_time_filter_lower_bound: extras.rtLowerBound,\n response_time_filter_upper_bound: extras.rtUpperBound,\n\n // per-metric RT summaries\n median_rt_HIT_valid: median(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"HIT\")\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_HIT_valid: sd(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"HIT\")\n .pull(\"response_time_duration_ms\"),\n ),\n median_rt_HIT_valid_filtered: median(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"HIT\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_HIT_valid_filtered: sd(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"HIT\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n n_outliers_rt_HIT_valid: filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"HIT\")\n .filter(\n (o) =>\n o.response_time_duration_ms < extras.rtLowerBound ||\n o.response_time_duration_ms > extras.rtUpperBound,\n ).length,\n median_rt_MISS_valid: median(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"MISS\")\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_MISS_valid: sd(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"MISS\")\n .pull(\"response_time_duration_ms\"),\n ),\n median_rt_MISS_valid_filtered: median(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"MISS\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_MISS_valid_filtered: sd(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"MISS\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n n_outliers_rt_MISS_valid: filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"MISS\")\n .filter(\n (o) =>\n o.response_time_duration_ms < extras.rtLowerBound ||\n o.response_time_duration_ms > extras.rtUpperBound,\n ).length,\n\n median_rt_FA_valid: median(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"FA\")\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_FA_valid: sd(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"FA\")\n .pull(\"response_time_duration_ms\"),\n ),\n median_rt_FA_valid_filtered: median(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"FA\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_FA_valid_filtered: sd(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"FA\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n n_outliers_rt_FA_valid: filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"FA\")\n .filter(\n (o) =>\n o.response_time_duration_ms < extras.rtLowerBound ||\n o.response_time_duration_ms > extras.rtUpperBound,\n ).length,\n\n median_rt_CR_valid: median(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"CR\")\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_CR_valid: sd(\n filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"CR\")\n .pull(\"response_time_duration_ms\"),\n ),\n median_rt_CR_valid_filtered: median(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"CR\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n sd_rt_CR_valid_filtered: sd(\n filter((o) => o.is_valid)\n .filter(\n (o) =>\n o.metric_accuracy === \"CR\" &&\n o.response_time_duration_ms >= extras.rtLowerBound &&\n o.response_time_duration_ms <= extras.rtUpperBound,\n )\n .pull(\"response_time_duration_ms\"),\n ),\n n_outliers_rt_CR_valid: filter((o) => o.is_valid)\n .filter((o) => o.metric_accuracy === \"CR\")\n .filter(\n (o) =>\n o.response_time_duration_ms < extras.rtLowerBound ||\n o.response_time_duration_ms > extras.rtUpperBound,\n ).length,\n\n n_trials_correct: filter(\n (o) => o.metric_accuracy === \"HIT\" || o.metric_accuracy === \"CR\",\n ).length,\n n_trials_incorrect: filter(\n (o) => o.metric_accuracy === \"MISS\" || o.metric_accuracy === \"FA\",\n ).length,\n participant_score: (d: DataCalc) => {\n const total = d.length;\n if (total === 0) return null;\n\n // for this metric, both HITs and CRs are considered correct, so we add\n // those together for the numerator, and the denominator is total trials.\n // Then we multiply by 100 to get a percentage. Namely:\n // ((#HIT + #CR) / total) * 100\n // Note the need to use parens() and scalar() to do the math operations,\n // and passing in the DataCalc object as an argument to the function,\n // because this is a custom function within summarize.\n return d\n .summarize({\n correct: parens(\n scalar(d.filter((o) => o.metric_accuracy === \"HIT\").length).add(\n scalar(d.filter((o) => o.metric_accuracy === \"CR\").length),\n ),\n )\n .div(scalar(total))\n .mul(scalar(100)),\n })\n .pull(\"correct\");\n },\n });\n return scores.observations;\n }\n\n private makeShapes(svgHeight: number) {\n const shape01 = new Shape({\n path: {\n pathString: shapePathStrings[0],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shape02 = new Shape({\n path: {\n pathString: shapePathStrings[1],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n // note: shape03 is purposively smaller (.8 height of other shapes)\n const shape03 = new Shape({\n path: {\n pathString: shapePathStrings[2],\n height: svgHeight * 0.8,\n },\n lineWidth: 0,\n });\n\n const shape04 = new Shape({\n path: {\n pathString: shapePathStrings[3],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n // note: shape05 is purposively smaller (.8 height of other shapes)\n const shape05 = new Shape({\n path: {\n pathString: shapePathStrings[4],\n height: svgHeight * 0.8,\n },\n lineWidth: 0,\n });\n\n const shape06 = new Shape({\n path: {\n pathString: shapePathStrings[5],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shape07 = new Shape({\n path: {\n pathString: shapePathStrings[6],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shape08 = new Shape({\n path: {\n pathString: shapePathStrings[7],\n height: svgHeight,\n },\n lineWidth: 0,\n });\n\n const shapes = [\n shape01,\n shape02,\n shape03,\n shape04,\n shape05,\n shape06,\n shape07,\n shape08,\n ];\n return shapes;\n }\n}\n\nconst shapePathStrings = [\n \"M0 89.94v-2L131.95 0h2v88.7c2.34 1.6 4.47 3.11 6.65 4.55 42.77 28.22 85.54 56.42 128.3 84.63v2c-44.65 29.65-89.3 59.29-133.95 88.94h-1v-90.84C89.44 148.72 44.72 119.33 0 89.94Z\",\n \"M162 188c-.33 27-.67 54-1 81-26.87-26.18-53.74-52.35-80-77.94V269H0C0 180.83 0 92.67.04 4.5.04 3 .67 1.5 1 0c24.64 29.1 49.15 58.31 73.96 87.26 28.88 33.7 58.01 67.17 87.04 100.74Z\",\n \"M3 148.86V61.12C41.76 40.75 80.52 20.37 119.28 0h2.91c21.32 20.7 42.64 41.4 63.96 62.11v89.71c-38.44 20.04-76.88 40.09-115.31 60.13h-2.91L3.01 148.86Z\",\n \"M134 0h2c7.26 22.31 14.38 44.67 21.86 66.9 3.91 11.61 5.47 29.91 13.25 33.27C203 113.94 236.86 123.13 270 134v1L136 269h-1c-11.04-33.58-22.08-67.16-33.21-101.03C67.87 156.98 33.93 145.99 0 135v-1L134 0Z\",\n \"M107 0h1l108 108v1c-26.67 35.33-53.33 70.66-80 106h-1c-8.82-35.03-17.64-70.07-27-107.28C98.62 145.01 89.81 180 81.01 215h-1C53.33 179.66 26.67 144.33 0 109v-2L107 0Z\",\n \"M0 1C2.17.67 4.33.05 6.5.04 58.33-.01 110.17 0 162 0v270H2c26.2-22.17 52.41-44.33 78.86-66.71V67.4c-3.85-3.22-7.35-6.2-10.9-9.11C46.64 39.18 23.32 20.09 0 1Z\",\n \"M95 268.99h-1C62.66 238.66 31.33 208.33 0 178V88C26.67 58.67 53.33 29.33 80 0h1c0 29.45 0 58.89-.01 88.38 35.99 29.57 72 59.09 108.01 88.61v1l-94 91Z\",\n \"M13 0h67l135 135v1L81 270c-27-.33-54-.67-81-1 11.73-12.51 23.61-24.87 35.16-37.54 33.14-36.35 66.14-72.82 100.23-110.38C94.4 80.52 53.7 40.26 13 0Z\",\n];\n\nexport { ColorShapes };\n"],"mappings":";;;;;;;;;AAOA,IAAI,YAAU,cAAc,MAAM;;;;;CAKjC,YAAY,SAAS,SAAS;EAC7B,MAAM,OAAO;EACb,IAAI,WAAW,WAAW,SAAS,KAAK,QAAQ,QAAQ;EACxD,KAAK,OAAO;EACZ,IAAI,IAAI,QAAQ,OAAO,eAAe,MAAM,IAAI,OAAO,SAAS;EAChE,IAAI,uBAAuB,SAAS,OAAO,MAAM,sBAAsB,YAAY,MAAM,kBAAkB,MAAM,IAAI,MAAM;OACtH,IAAI,CAAC,KAAK,OAAO,KAAK,QAAQ,IAAI,MAAM,OAAO,CAAC,CAAC;CACvD;;;;CAIA,SAAS;EACR,MAAM,OAAO;GACZ,MAAM,KAAK;GACX,SAAS,KAAK;GACd,OAAO,KAAK;EACb;EACA,IAAI,KAAK,UAAU,KAAK,GAAG,IAAI,KAAK,iBAAiB,OAAO;GAC3D,MAAM,kBAAkB,KAAK;GAC7B,IAAI,OAAO,gBAAgB,WAAW,YAAY,KAAK,QAAQ,gBAAgB,OAAO;QACjF;IACJ,MAAM,aAAa;KAClB,MAAM,KAAK,MAAM;KACjB,SAAS,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