@pie-element/match 12.1.2-next.5 → 12.1.2-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"browser-kkT1XVKw.js","names":[],"sources":["../../../../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;;;;;;;;;;CAIA,IAAI,IAAI,KACJ,IAAI,IAAI,IACR,IAAI,IAAI,IACR,IAAI,IAAI,IACR,IAAI,IAAI,GACR,IAAI,IAAI;CAgBZ,EAAO,UAAU,SAAU,GAAK,GAAS;EACvC,MAAqB,CAAC;EACtB,IAAI,IAAO,OAAO;EAClB,IAAI,MAAS,YAAY,EAAI,SAAS,GACpC,OAAO,EAAM,CAAG;EACX,IAAI,MAAS,YAAY,SAAS,CAAG,GAC1C,OAAO,EAAQ,OAAO,EAAQ,CAAG,IAAI,EAAS,CAAG;EAEnD,MAAU,MACR,0DACE,KAAK,UAAU,CAAG,CACtB;CACF;CAUA,SAAS,EAAM,GAAK;EAClB,QAAM,OAAO,CAAG,GACZ,IAAI,SAAS,MAGjB;OAAI,IAAQ,mIAAmI,KAC7I,CACF;GACK,OAGL;QAAI,IAAI,WAAW,EAAM,EAAE;IAE3B,SADY,EAAM,MAAM,MAAM,YACnB,GAAX;KACE,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb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names":[],"sources":["../../../../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js","../../../../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;;;;;;;;;;CAIA,IAAI,IAAI,KACJ,IAAI,IAAI,IACR,IAAI,IAAI,IACR,IAAI,IAAI,IACR,IAAI,IAAI,GACR,IAAI,IAAI;CAgBZ,EAAO,UAAU,SAAU,GAAK,GAAS;EACvC,MAAqB,CAAC;EACtB,IAAI,IAAO,OAAO;EAClB,IAAI,MAAS,YAAY,EAAI,SAAS,GACpC,OAAO,EAAM,CAAG;EACX,IAAI,MAAS,YAAY,SAAS,CAAG,GAC1C,OAAO,EAAQ,OAAO,EAAQ,CAAG,IAAI,EAAS,CAAG;EAEnD,MAAU,MACR,0DACE,KAAK,UAAU,CAAG,CACtB;CACF;CAUA,SAAS,EAAM,GAAK;EAClB,QAAM,OAAO,CAAG,GACZ,IAAI,SAAS,MAGjB;OAAI,IAAQ,mIAAmI,KAC7I,CACF;GACK,OAGL;QAAI,IAAI,WAAW,EAAM,EAAE;IAE3B,SADY,EAAM,MAAM,KAAA,CAAM,YACnB,GAAX;KACE,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,KACH,OAAO,IAAI;KACb,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK;KACL,KAAK,MACH,OAAO;KACT,SACE;IACJ;GA3C2B;EAJ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n, c as r, t as i } from "../dist-C4gh2n2Z.js";
3
3
  //#region ../../shared/feedback/dist/index.js
4
4
  var a = {
5
5
  correct: {
@@ -66,7 +66,7 @@ function f(e) {
66
66
  return t;
67
67
  }
68
68
  function p(e) {
69
- return e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
69
+ return e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
70
70
  }
71
71
  async function m(e, t, n, r = "value") {
72
72
  let i = d(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);
@@ -90,7 +90,7 @@ function h(e, t, n) {
90
90
  }
91
91
  var g = /* @__PURE__ */ u({ enabled: () => _ });
92
92
  function _(e, t, n) {
93
- return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == "boolean" ? n : !0;
93
+ return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != "boolean" || n;
94
94
  }
95
95
  //#endregion
96
96
  //#region src/controller/defaults.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" ? Object.keys(e).length === 0 : !1;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == \"boolean\" ? n : !0;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/match/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceMode: 'radio',\n feedbackEnabled: false,\n headers: ['Column 1', 'Column 2', 'Column 3'],\n layout: 3,\n lockChoiceOrder: true,\n partialScoring: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n rows: [],\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/match/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { cloneDeep, isEmpty, isEqual } from '@pie-element/shared-lodash';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nconst log = debug('@pie-element:match:controller');\n\nimport defaults from './defaults.js';\n\nconst getResponseCorrectness = (model, answers, env = {}) => {\n const isPartialScoring = partialScoring.enabled(model, env);\n const rows = model.rows;\n const checkboxMode = model.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n return 'unanswered';\n }\n\n const totalCorrectAnswers = checkboxMode ? getTotalCorrectAnswers(model) : getTotalCorrect(model);\n let correctAnswers;\n let incorrectAnswers = 0;\n\n if (checkboxMode) {\n const checkboxes = getCheckboxes(rows, answers);\n\n correctAnswers = checkboxes.correctAnswers;\n incorrectAnswers = checkboxes.incorrectAnswers;\n } else {\n correctAnswers = getCorrectRadios(rows, answers);\n }\n\n if (totalCorrectAnswers === correctAnswers && !incorrectAnswers) {\n return 'correct';\n } else if (correctAnswers === 0) {\n return 'incorrect';\n } else if (isPartialScoring) {\n return 'partial';\n }\n\n return 'incorrect';\n};\n\nconst getCorrectness = (question, env, answers = {}) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\nconst getCheckboxes = (rows, answers) => {\n let correctAnswers = 0;\n let incorrectAnswers = 0;\n\n rows.forEach((row) => {\n const answer = answers[row.id];\n\n if (answer) {\n row.values.forEach((v, i) => {\n if (answer[i] && answer[i] === v) {\n correctAnswers += 1;\n } else if (answer[i] && answer[i] !== v) {\n incorrectAnswers += 1;\n }\n });\n }\n });\n\n return { correctAnswers, incorrectAnswers };\n};\n\nconst getCorrectRadios = (rows, answers) => {\n let correctAnswers = 0;\n\n rows.forEach((row) => {\n if (isEqual(row.values, answers[row.id])) {\n correctAnswers += 1;\n }\n });\n\n return correctAnswers;\n};\n\nconst getTotalCorrect = (question) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n const matchingTable = checkboxMode ? question.layout - 1 : 1;\n return (question.rows.length || 0) * matchingTable;\n};\n\nconst getTotalCorrectAnswers = (question) => {\n let noOfTotalCorrectAnswers = 0;\n\n question.rows.forEach((row) => {\n row.values.forEach((value) => {\n if (value) {\n noOfTotalCorrectAnswers += 1;\n }\n });\n });\n\n return noOfTotalCorrectAnswers;\n};\n\nconst getPartialScore = (question, answers) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (checkboxMode) {\n const { correctAnswers, incorrectAnswers } = getCheckboxes(question.rows, answers);\n const totalCorrect = getTotalCorrectAnswers(question);\n\n const total = totalCorrect === 0 ? 1 : totalCorrect;\n\n if (correctAnswers + incorrectAnswers > totalCorrect) {\n const extraAnswers = correctAnswers + incorrectAnswers - totalCorrect;\n const score = parseFloat(((correctAnswers - extraAnswers) / total).toFixed(2));\n\n return score < 0 ? 0 : score;\n } else {\n return parseFloat((correctAnswers / total).toFixed(2));\n }\n } else {\n const correctAnswers = getCorrectRadios(question.rows, answers);\n const totalCorrect = getTotalCorrect(question) === 0 ? 1 : getTotalCorrect(question);\n\n return parseFloat((correctAnswers / totalCorrect).toFixed(2));\n }\n};\n\nconst getOutComeScore = (question, env, answers = {}) => {\n const correctness = getCorrectness(question, env, answers);\n const isPartialScoring = partialScoring.enabled(question, env);\n\n return correctness === 'correct'\n ? 1\n : correctness === 'partial' && isPartialScoring\n ? getPartialScore(question, answers)\n : 0;\n};\n\n/**\n * Generates detailed trace log for match item scoring evaluation\n * @param {Object} question\n * @param {Object} session\n * @param {Object} env\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const answers = session?.answers || {};\n const rows = question?.rows || [];\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n traceLog.push('Student did not provide any answer.');\n return traceLog;\n }\n\n traceLog.push(`Match item contains ${rows.length} row(s).`);\n traceLog.push(`Matching mode: ${checkboxMode ? 'checkbox (multiple matches allowed)' : 'radio (single match per row)'}.`);\n\n let correctCount = 0;\n let incorrectCount = 0;\n let totalCorrect = 0;\n\n rows.forEach((row) => {\n const studentAnswer = answers[row.id];\n const correctValues = row.values || [];\n\n if (checkboxMode) {\n correctValues.forEach((v, idx) => {\n if (v) {\n totalCorrect++;\n }\n\n if (studentAnswer && studentAnswer[idx]) {\n if (studentAnswer[idx] === v) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n });\n } else {\n totalCorrect++;\n if (studentAnswer) {\n if (isEqual(correctValues, studentAnswer)) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n }\n });\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} correct match(es) selected.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} incorrect match(es) selected.`);\n }\n\n if (correctCount === 0 && incorrectCount === 0) {\n traceLog.push('Student provided answers, but none matched the correct responses.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(question, env);\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n\n if (checkboxMode) {\n traceLog.push(\n 'Score is based on the number of correct minus extra incorrect matches, divided by the total number of correct matches.',\n );\n\n if (correctCount + incorrectCount > totalCorrect) {\n traceLog.push('Extra selected matches beyond the correct set reduce the score.');\n }\n } else {\n traceLog.push(\n 'Score is based on the number of correctly matched rows divided by the total number of rows.',\n );\n }\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n traceLog.push('Student must match all rows correctly to receive full credit.');\n }\n\n const rawScore = getOutComeScore(question, env, answers);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport const outcome = (question, session, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined, logTrace: [] });\n } else {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true, logTrace: ['Student did not provide any answer.'] });\n }\n\n const out = {\n score: getOutComeScore(question, env, session.answers),\n empty: false,\n logTrace: getLogTrace(question, session, env),\n };\n\n resolve(out);\n }\n });\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = cloneDeep(normalize(question));\n let correctness, score;\n\n if ((!session || isEmpty(session)) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(normalizedQuestion, env, session && session.answers);\n score = `${getOutComeScore(normalizedQuestion, env, session && session.answers) * 100}%`;\n }\n\n const correctResponse = {};\n const correctInfo = {\n score,\n correctness,\n };\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n normalizedQuestion.rows = await getShuffledChoices(normalizedQuestion.rows, session, updateSession, 'id');\n }\n\n normalizedQuestion.rows.forEach((row) => {\n correctResponse[row.id] = row.values;\n\n if (env.mode !== 'evaluate') {\n delete row.values;\n }\n });\n\n const feedback =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(correctInfo.correctness, normalizedQuestion.feedback)\n : undefined;\n\n const {\n extraCSSRules,\n feedbackEnabled,\n promptEnabled,\n prompt,\n lockChoiceOrder: _,\n ...essentials\n } = normalizedQuestion;\n const out = {\n ...essentials,\n extraCSSRules,\n allowFeedback: feedbackEnabled,\n prompt: promptEnabled ? prompt : null,\n shuffled: !lockChoiceOrder,\n feedback,\n disabled: env.mode !== 'gather',\n view: env.mode === 'view',\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctResponse,\n correctness: correctInfo,\n });\n }\n\n log('out: ', out);\n return out;\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { rows } = question;\n const answers = {};\n\n rows.forEach((r) => {\n answers[r.id] = r.values;\n });\n\n resolve({\n answers,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { rows, choiceMode, headers } = model;\n const {\n minQuestions,\n maxQuestions,\n maxLengthQuestionsHeading,\n maxAnswers,\n maxLengthAnswers,\n maxLengthFirstColumnHeading,\n } = config;\n const rowsErrors = {};\n const columnsErrors = {};\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n if (rows.length < minQuestions) {\n errors.noOfRowsError = `There should be at least ${minQuestions} question rows.`;\n } else if (rows.length > maxQuestions) {\n errors.noOfRowsError = `No more than ${maxQuestions} question rows should be defined.`;\n }\n\n (rows || []).forEach((row, index) => {\n const { id, values = [], title } = row;\n rowsErrors[id] = '';\n\n if (maxLengthQuestionsHeading && getInnerText(title).length > maxLengthQuestionsHeading) {\n rowsErrors[id] += `Content length should be maximum ${maxLengthQuestionsHeading} characters. `;\n }\n\n if (!getContent(title)) {\n rowsErrors[id] += 'Content should not be empty. ';\n } else {\n // check for identical content with the previous answers\n const identicalAnswer = rows.slice(0, index).some((r) => getContent(r.title) === getContent(title));\n\n if (identicalAnswer) {\n rowsErrors[id] += 'Content should be unique. ';\n }\n }\n\n const hasCorrectResponse = values.some((value) => !!value);\n\n if (!hasCorrectResponse) {\n rowsErrors[id] += 'No correct response defined.';\n }\n });\n\n if (maxAnswers && headers.length - 1 > maxAnswers) {\n errors.columnsLengthError = `There should be maximum ${maxAnswers} answers.`;\n }\n\n if (maxLengthFirstColumnHeading && headers[0].length > maxLengthFirstColumnHeading) {\n columnsErrors[0] = `Content length should be maximum ${maxLengthFirstColumnHeading} characters.`;\n }\n\n const headersContent = (headers || []).map((heading) => getContent(heading));\n headersContent.shift(); // remove first column since it does not require validation\n\n headersContent.forEach((heading, index) => {\n const headerIndex = index + 1; // we need to add 1 because we removed first header from validation\n columnsErrors[headerIndex] = '';\n\n if (maxLengthAnswers && getInnerText(heading).length > maxLengthAnswers) {\n columnsErrors[headerIndex] += `Content length should be maximum ${maxLengthAnswers} characters. `;\n }\n\n if (!heading) {\n columnsErrors[headerIndex] += 'Content should not be empty.';\n } else {\n // check for identical content with the previous headers\n const identicalAnswer = headersContent.slice(0, index).some((head) => head === heading);\n\n if (identicalAnswer) {\n columnsErrors[index + 1] += 'Content should be unique.';\n }\n }\n });\n\n const hasRowErrors = Object.values(rowsErrors).some((error) => (error || '').length);\n\n if (hasRowErrors) {\n errors.rowsErrors = rowsErrors;\n\n const noCorrectAnswer = Object.values(rowsErrors).some((error) =>\n (error || '').includes('No correct response defined.'),\n );\n\n if (noCorrectAnswer) {\n errors.correctResponseError =\n choiceMode === 'radio'\n ? 'There should be a correct response defined for every row.'\n : 'There should be at least one correct response defined for every row.';\n }\n }\n\n const hasColumnErrors = Object.values(columnsErrors).some((error) => (error || '').length);\n\n if (hasColumnErrors) {\n errors.columnsErrors = columnsErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;AACA,IAAI,IAAI;CACP,SAAS;EACR,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,WAAW;EACV,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,SAAS;EACR,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,YAAY;EACX,MAAM;EACN,SAAS;EACT,QAAQ;CACT;AAC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K,EAAE,MAAM,MAAM,EAAW,EAAE,KAAK,MAAM,EAAW,CAAK,CAE7F,MACF,EAAW,MAAO,gCANpB,EAAW,MAAO,iCAUO,EAAO,MAAM,MAAU,CAAC,CAAC,CAE/C,MACH,EAAW,MAAO;CAEtB,CAAC,GAEG,KAAc,EAAQ,SAAS,IAAI,MACrC,EAAO,qBAAqB,2BAA2B,EAAW,aAGhE,KAA+B,EAAQ,GAAG,SAAS,MACrD,EAAc,KAAK,oCAAoC,EAA4B;CAGrF,IAAM,KAAkB,KAAW,CAAC,GAAG,KAAK,MAAY,EAAW,CAAO,CAAC;CA8C3E,OA7CA,EAAe,MAAM,GAErB,EAAe,SAAS,GAAS,MAAU;EACzC,IAAM,IAAc,IAAQ;EAO5B,AANA,EAAc,KAAe,IAEzB,KAAoB,EAAa,CAAO,EAAE,SAAS,MACrD,EAAc,MAAgB,oCAAoC,EAAiB,iBAGhF,IAIqB,EAAe,MAAM,GAAG,CAAK,EAAE,MAAM,MAAS,MAAS,CAE3E,MACF,EAAc,IAAQ,MAAM,+BAN9B,EAAc,MAAgB;CASlC,CAAC,GAEoB,OAAO,OAAO,CAAU,EAAE,MAAM,OAAW,KAAS,IAAI,MAEzE,MACF,EAAO,aAAa,GAEI,OAAO,OAAO,CAAU,EAAE,MAAM,OACrD,KAAS,IAAI,SAAS,8BAA8B,CAGnD,MACF,EAAO,uBACL,MAAe,UACX,8DACA,0EAIc,OAAO,OAAO,CAAa,EAAE,MAAM,OAAW,KAAS,IAAI,MAE/E,MACF,EAAO,gBAAgB,IAGlB;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/feedback/dist/index.js","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region src/defaults.ts\nvar e = {\n\tcorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Correct\",\n\t\tcustom: \"Correct\"\n\t},\n\tincorrect: {\n\t\ttype: \"default\",\n\t\tdefault: \"Incorrect\",\n\t\tcustom: \"Incorrect\"\n\t},\n\tpartial: {\n\t\ttype: \"default\",\n\t\tdefault: \"Nearly\",\n\t\tcustom: \"Nearly\"\n\t},\n\tunanswered: {\n\t\ttype: \"default\",\n\t\tdefault: \"You have not entered a response\",\n\t\tcustom: \"You have not entered a response\"\n\t}\n};\n//#endregion\n//#region src/utils.ts\nfunction t(e) {\n\treturn e === \"partially-correct\" ? \"partial\" : e;\n}\n//#endregion\n//#region src/index.ts\nfunction n(n, i = {}) {\n\treturn new Promise((a) => {\n\t\tlet o = {\n\t\t\t...e,\n\t\t\t...i\n\t\t}, s = t(n), c = o[s], l = e[s];\n\t\tr(c, l[c.type]).then(a);\n\t});\n}\nfunction r(e, t) {\n\treturn new Promise((n) => {\n\t\tif (!e || e.type === \"none\") {\n\t\t\tn(void 0);\n\t\t\treturn;\n\t\t}\n\t\tn(e[e.type] || t);\n\t});\n}\nfunction i(n, r = {}) {\n\tlet i = {\n\t\t...e,\n\t\t...r\n\t}, o = t(n), s = i[o], c = e[o];\n\treturn a(s, c[s.type]);\n}\nfunction a(e, t) {\n\tif (!(!e || e.type === \"none\")) return e[e.type] || t;\n}\n//#endregion\nexport { e as defaultFeedback, a as getActualFeedback, i as getActualFeedbackForCorrectness, r as getFeedback, n as getFeedbackForCorrectness, t as normalizeCorrectness };\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" && Object.keys(e).length === 0;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != \"boolean\" || n;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/match/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n choiceMode: 'radio',\n feedbackEnabled: false,\n headers: ['Column 1', 'Column 2', 'Column 3'],\n layout: 3,\n lockChoiceOrder: true,\n partialScoring: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n rows: [],\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/match/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { cloneDeep, isEmpty, isEqual } from '@pie-element/shared-lodash';\nimport { getFeedbackForCorrectness } from '@pie-element/shared-feedback';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport debug from 'debug';\n\nconst log = debug('@pie-element:match:controller');\n\nimport defaults from './defaults.js';\n\nconst getResponseCorrectness = (model, answers, env = {}) => {\n const isPartialScoring = partialScoring.enabled(model, env);\n const rows = model.rows;\n const checkboxMode = model.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n return 'unanswered';\n }\n\n const totalCorrectAnswers = checkboxMode ? getTotalCorrectAnswers(model) : getTotalCorrect(model);\n let correctAnswers;\n let incorrectAnswers = 0;\n\n if (checkboxMode) {\n const checkboxes = getCheckboxes(rows, answers);\n\n correctAnswers = checkboxes.correctAnswers;\n incorrectAnswers = checkboxes.incorrectAnswers;\n } else {\n correctAnswers = getCorrectRadios(rows, answers);\n }\n\n if (totalCorrectAnswers === correctAnswers && !incorrectAnswers) {\n return 'correct';\n } else if (correctAnswers === 0) {\n return 'incorrect';\n } else if (isPartialScoring) {\n return 'partial';\n }\n\n return 'incorrect';\n};\n\nconst getCorrectness = (question, env, answers = {}) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, answers, env);\n }\n};\n\nconst getCheckboxes = (rows, answers) => {\n let correctAnswers = 0;\n let incorrectAnswers = 0;\n\n rows.forEach((row) => {\n const answer = answers[row.id];\n\n if (answer) {\n row.values.forEach((v, i) => {\n if (answer[i] && answer[i] === v) {\n correctAnswers += 1;\n } else if (answer[i] && answer[i] !== v) {\n incorrectAnswers += 1;\n }\n });\n }\n });\n\n return { correctAnswers, incorrectAnswers };\n};\n\nconst getCorrectRadios = (rows, answers) => {\n let correctAnswers = 0;\n\n rows.forEach((row) => {\n if (isEqual(row.values, answers[row.id])) {\n correctAnswers += 1;\n }\n });\n\n return correctAnswers;\n};\n\nconst getTotalCorrect = (question) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n const matchingTable = checkboxMode ? question.layout - 1 : 1;\n return (question.rows.length || 0) * matchingTable;\n};\n\nconst getTotalCorrectAnswers = (question) => {\n let noOfTotalCorrectAnswers = 0;\n\n question.rows.forEach((row) => {\n row.values.forEach((value) => {\n if (value) {\n noOfTotalCorrectAnswers += 1;\n }\n });\n });\n\n return noOfTotalCorrectAnswers;\n};\n\nconst getPartialScore = (question, answers) => {\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (checkboxMode) {\n const { correctAnswers, incorrectAnswers } = getCheckboxes(question.rows, answers);\n const totalCorrect = getTotalCorrectAnswers(question);\n\n const total = totalCorrect === 0 ? 1 : totalCorrect;\n\n if (correctAnswers + incorrectAnswers > totalCorrect) {\n const extraAnswers = correctAnswers + incorrectAnswers - totalCorrect;\n const score = parseFloat(((correctAnswers - extraAnswers) / total).toFixed(2));\n\n return score < 0 ? 0 : score;\n } else {\n return parseFloat((correctAnswers / total).toFixed(2));\n }\n } else {\n const correctAnswers = getCorrectRadios(question.rows, answers);\n const totalCorrect = getTotalCorrect(question) === 0 ? 1 : getTotalCorrect(question);\n\n return parseFloat((correctAnswers / totalCorrect).toFixed(2));\n }\n};\n\nconst getOutComeScore = (question, env, answers = {}) => {\n const correctness = getCorrectness(question, env, answers);\n const isPartialScoring = partialScoring.enabled(question, env);\n\n return correctness === 'correct'\n ? 1\n : correctness === 'partial' && isPartialScoring\n ? getPartialScore(question, answers)\n : 0;\n};\n\n/**\n * Generates detailed trace log for match item scoring evaluation\n * @param {Object} question\n * @param {Object} session\n * @param {Object} env\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n const answers = session?.answers || {};\n const rows = question?.rows || [];\n const checkboxMode = question.choiceMode === 'checkbox';\n\n if (!answers || Object.keys(answers).length === 0) {\n traceLog.push('Student did not provide any answer.');\n return traceLog;\n }\n\n traceLog.push(`Match item contains ${rows.length} row(s).`);\n traceLog.push(`Matching mode: ${checkboxMode ? 'checkbox (multiple matches allowed)' : 'radio (single match per row)'}.`);\n\n let correctCount = 0;\n let incorrectCount = 0;\n let totalCorrect = 0;\n\n rows.forEach((row) => {\n const studentAnswer = answers[row.id];\n const correctValues = row.values || [];\n\n if (checkboxMode) {\n correctValues.forEach((v, idx) => {\n if (v) {\n totalCorrect++;\n }\n\n if (studentAnswer && studentAnswer[idx]) {\n if (studentAnswer[idx] === v) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n });\n } else {\n totalCorrect++;\n if (studentAnswer) {\n if (isEqual(correctValues, studentAnswer)) {\n correctCount++;\n } else {\n incorrectCount++;\n }\n }\n }\n });\n\n if (correctCount > 0) {\n traceLog.push(`${correctCount} correct match(es) selected.`);\n }\n\n if (incorrectCount > 0) {\n traceLog.push(`${incorrectCount} incorrect match(es) selected.`);\n }\n\n if (correctCount === 0 && incorrectCount === 0) {\n traceLog.push('Student provided answers, but none matched the correct responses.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(question, env);\n\n if (partialScoringEnabled) {\n traceLog.push('Score calculated using partial scoring.');\n\n if (checkboxMode) {\n traceLog.push(\n 'Score is based on the number of correct minus extra incorrect matches, divided by the total number of correct matches.',\n );\n\n if (correctCount + incorrectCount > totalCorrect) {\n traceLog.push('Extra selected matches beyond the correct set reduce the score.');\n }\n } else {\n traceLog.push(\n 'Score is based on the number of correctly matched rows divided by the total number of rows.',\n );\n }\n } else {\n traceLog.push('Score calculated using all-or-nothing scoring.');\n traceLog.push('Student must match all rows correctly to receive full credit.');\n }\n\n const rawScore = getOutComeScore(question, env, answers);\n const finalScore = partialScoringEnabled ? rawScore : rawScore === 1 ? 1 : 0;\n\n traceLog.push(`Final score: ${finalScore}.`);\n\n return traceLog;\n};\n\nexport const outcome = (question, session, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined, logTrace: [] });\n } else {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true, logTrace: ['Student did not provide any answer.'] });\n }\n\n const out = {\n score: getOutComeScore(question, env, session.answers),\n empty: false,\n logTrace: getLogTrace(question, session, env),\n };\n\n resolve(out);\n }\n });\n};\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = cloneDeep(normalize(question));\n let correctness, score;\n\n if ((!session || isEmpty(session)) && env.mode === 'evaluate') {\n correctness = 'unanswered';\n score = '0%';\n } else {\n correctness = getCorrectness(normalizedQuestion, env, session && session.answers);\n score = `${getOutComeScore(normalizedQuestion, env, session && session.answers) * 100}%`;\n }\n\n const correctResponse = {};\n const correctInfo = {\n score,\n correctness,\n };\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n normalizedQuestion.rows = await getShuffledChoices(normalizedQuestion.rows, session, updateSession, 'id');\n }\n\n normalizedQuestion.rows.forEach((row) => {\n correctResponse[row.id] = row.values;\n\n if (env.mode !== 'evaluate') {\n delete row.values;\n }\n });\n\n const feedback =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? await getFeedbackForCorrectness(correctInfo.correctness, normalizedQuestion.feedback)\n : undefined;\n\n const {\n extraCSSRules,\n feedbackEnabled,\n promptEnabled,\n prompt,\n lockChoiceOrder: _,\n ...essentials\n } = normalizedQuestion;\n const out = {\n ...essentials,\n extraCSSRules,\n allowFeedback: feedbackEnabled,\n prompt: promptEnabled ? prompt : null,\n shuffled: !lockChoiceOrder,\n feedback,\n disabled: env.mode !== 'gather',\n view: env.mode === 'view',\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n if (env.mode === 'evaluate') {\n Object.assign(out, {\n correctResponse,\n correctness: correctInfo,\n });\n }\n\n log('out: ', out);\n return out;\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { rows } = question;\n const answers = {};\n\n rows.forEach((r) => {\n answers[r.id] = r.values;\n });\n\n resolve({\n answers,\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { rows, choiceMode, headers } = model;\n const {\n minQuestions,\n maxQuestions,\n maxLengthQuestionsHeading,\n maxAnswers,\n maxLengthAnswers,\n maxLengthFirstColumnHeading,\n } = config;\n const rowsErrors = {};\n const columnsErrors = {};\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n if (rows.length < minQuestions) {\n errors.noOfRowsError = `There should be at least ${minQuestions} question rows.`;\n } else if (rows.length > maxQuestions) {\n errors.noOfRowsError = `No more than ${maxQuestions} question rows should be defined.`;\n }\n\n (rows || []).forEach((row, index) => {\n const { id, values = [], title } = row;\n rowsErrors[id] = '';\n\n if (maxLengthQuestionsHeading && getInnerText(title).length > maxLengthQuestionsHeading) {\n rowsErrors[id] += `Content length should be maximum ${maxLengthQuestionsHeading} characters. `;\n }\n\n if (!getContent(title)) {\n rowsErrors[id] += 'Content should not be empty. ';\n } else {\n // check for identical content with the previous answers\n const identicalAnswer = rows.slice(0, index).some((r) => getContent(r.title) === getContent(title));\n\n if (identicalAnswer) {\n rowsErrors[id] += 'Content should be unique. ';\n }\n }\n\n const hasCorrectResponse = values.some((value) => !!value);\n\n if (!hasCorrectResponse) {\n rowsErrors[id] += 'No correct response defined.';\n }\n });\n\n if (maxAnswers && headers.length - 1 > maxAnswers) {\n errors.columnsLengthError = `There should be maximum ${maxAnswers} answers.`;\n }\n\n if (maxLengthFirstColumnHeading && headers[0].length > maxLengthFirstColumnHeading) {\n columnsErrors[0] = `Content length should be maximum ${maxLengthFirstColumnHeading} characters.`;\n }\n\n const headersContent = (headers || []).map((heading) => getContent(heading));\n headersContent.shift(); // remove first column since it does not require validation\n\n headersContent.forEach((heading, index) => {\n const headerIndex = index + 1; // we need to add 1 because we removed first header from validation\n columnsErrors[headerIndex] = '';\n\n if (maxLengthAnswers && getInnerText(heading).length > maxLengthAnswers) {\n columnsErrors[headerIndex] += `Content length should be maximum ${maxLengthAnswers} characters. `;\n }\n\n if (!heading) {\n columnsErrors[headerIndex] += 'Content should not be empty.';\n } else {\n // check for identical content with the previous headers\n const identicalAnswer = headersContent.slice(0, index).some((head) => head === heading);\n\n if (identicalAnswer) {\n columnsErrors[index + 1] += 'Content should be unique.';\n }\n }\n });\n\n const hasRowErrors = Object.values(rowsErrors).some((error) => (error || '').length);\n\n if (hasRowErrors) {\n errors.rowsErrors = rowsErrors;\n\n const noCorrectAnswer = Object.values(rowsErrors).some((error) =>\n (error || '').includes('No correct response defined.'),\n );\n\n if (noCorrectAnswer) {\n errors.correctResponseError =\n choiceMode === 'radio'\n ? 'There should be a correct response defined for every row.'\n : 'There should be at least one correct response defined for every row.';\n }\n }\n\n const hasColumnErrors = Object.values(columnsErrors).some((error) => (error || '').length);\n\n if (hasColumnErrors) {\n errors.columnsErrors = columnsErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;AACA,IAAI,IAAI;CACP,SAAS;EACR,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,WAAW;EACV,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,SAAS;EACR,MAAM;EACN,SAAS;EACT,QAAQ;CACT;CACA,YAAY;EACX,MAAM;EACN,SAAS;EACT,QAAQ;CACT;AACD;AAGA,SAAS,EAAE,GAAG;CACb,OAAO,MAAM,sBAAsB,YAAY;AAChD;AAGA,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG;CACrB,OAAO,IAAI,SAAS,MAAM;EACzB,IAAI,IAAI;GACP,GAAG;GACH,GAAG;EACJ,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,IAAI,EAAE;EAC7B,EAAE,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC;CACvB,CAAC;AACF;AACA,SAAS,EAAE,GAAG,GAAG;CAChB,OAAO,IAAI,SAAS,MAAM;EACzB,IAAI,CAAC,KAAK,EAAE,SAAS,QAAQ;GAC5B,EAAE,KAAK,CAAC;GACR;EACD;EACA,EAAE,EAAE,EAAE,SAAS,CAAC;CACjB,CAAC;AACF;;;AC9CA,IAAI,IAAI,OAAO,gBAAgB,KAAK,GAAG,MAAM;CAC5C,IAAI,IAAI,CAAC;CACT,KAAK,IAAI,KAAK,GAAG,EAAE,GAAG,GAAG;EACxB,KAAK,EAAE;EACP,YAAY,CAAC;CACd,CAAC;CACD,OAAO,KAAK,EAAE,GAAG,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC,GAAG;AAC5D;AAGA,SAAS,EAAE,GAAG;CACb,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,QAAQ,MAAM,KAAK,IAAI,IAAI,CAAC;AACzD;AACA,SAAS,EAAE,GAAG;CACb,IAAI,IAAI,CAAC,GAAG,CAAC;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AS,CAE3E,MACF,EAAc,IAAQ,MAAM,+BAN9B,EAAc,MAAgB;CASlC,CAAC,GAEoB,OAAO,OAAO,CAAU,CAAC,CAAC,MAAM,OAAW,KAAS,GAAA,CAAI,MAEzE,MACF,EAAO,aAAa,GAEI,OAAO,OAAO,CAAU,CAAC,CAAC,MAAM,OACrD,KAAS,GAAA,CAAI,SAAS,8BAA8B,CAGnD,MACF,EAAO,uBACL,MAAe,UACX,8DACA,0EAIc,OAAO,OAAO,CAAa,CAAC,CAAC,MAAM,OAAW,KAAS,GAAA,CAAI,MAE/E,MACF,EAAO,gBAAgB,IAGlB;AACT"}
@@ -1,10 +1,10 @@
1
1
  import { a as e } from "../browser-kkT1XVKw.js";
2
- import { A as t, Nt as n, O as r, a as i, d as a, dt as o, f as s, ft as c, ht as l, n as u, p as d, pt as f, r as p, t as m, u as h, x as g } from "../Typography-BRnAIZOH.js";
2
+ import { Nt as t, O as n, a as r, d as i, dt as a, f as o, ft as s, ht as c, k as l, n as u, p as d, pt as f, r as p, t as m, u as h, x as g } from "../Typography-BvyMwfyW.js";
3
3
  import _, { useRef as v } from "react";
4
4
  import { createRoot as y } from "react-dom/client";
5
5
  import { jsx as b, jsxs as x } from "react/jsx-runtime";
6
6
  //#region ../../lib-react/correct-answer-toggle/dist/expander.js
7
- var S = /* @__PURE__ */ e(n(), 1), C = "height ease-in 300ms, opacity ease-in 300ms", w = l("div")(() => ({
7
+ var S = /* @__PURE__ */ e(t(), 1), C = "height ease-in 300ms, opacity ease-in 300ms", w = c("div")(() => ({
8
8
  position: "relative",
9
9
  height: 0,
10
10
  overflow: "hidden",
@@ -137,7 +137,7 @@ D.propTypes = {
137
137
  fgFill: S.default.string.isRequired,
138
138
  borderFill: S.default.string.isRequired
139
139
  };
140
- var ee = l("div")(({ size: e }) => ({
140
+ var ee = c("div")(({ size: e }) => ({
141
141
  width: e || "25px",
142
142
  height: e || "25px"
143
143
  })), O = ({ open: e, size: t }) => /* @__PURE__ */ b(ee, {
@@ -947,7 +947,7 @@ var Ce = {}, z = (e) => !k(e) && typeof e != "boolean" && typeof e != "number",
947
947
  init(e = {}) {
948
948
  e.interpolation ||= { escapeValue: !0 };
949
949
  let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: _ } = e.interpolation;
950
- this.escape = t === void 0 ? pe : t, this.escapeValue = n === void 0 ? !0 : n, this.useRawValueToEscape = r === void 0 ? !1 : r, this.prefix = i ? N(i) : a || "{{", this.suffix = o ? N(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? N(d) : f || N("$t("), this.nestingSuffix = p ? N(p) : m || N(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ === void 0 ? !1 : _, this.resetRegExp();
950
+ this.escape = t === void 0 ? pe : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? N(i) : a || "{{", this.suffix = o ? N(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? N(d) : f || N("$t("), this.nestingSuffix = p ? N(p) : m || N(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
951
951
  }
952
952
  reset() {
953
953
  this.options && this.init(this.options);
@@ -1586,29 +1586,29 @@ function G(e) {
1586
1586
  function Ue(e, t) {
1587
1587
  return !e || G(e) ? e : G(e.default) ? e.default : t && G(e[t]) ? e[t] : t && G(e[t]?.default) ? e[t].default : e;
1588
1588
  }
1589
- var We = Ue(s, "Readable") || Ue(Ke.Readable, "Readable"), Ge = i, K = Ge.default, Ke = K && typeof K == "object" ? K : Ge, { translator: q } = He, qe = {
1589
+ var We = Ue(o, "Readable") || Ue(Ke.Readable, "Readable"), Ge = r, K = Ge.default, Ke = K && typeof K == "object" ? K : Ge, { translator: q } = He, qe = {
1590
1590
  WebkitTouchCallout: "none",
1591
1591
  WebkitUserSelect: "none",
1592
1592
  KhtmlUserSelect: "none",
1593
1593
  MozUserSelect: "none",
1594
1594
  msUserSelect: "none",
1595
1595
  userSelect: "none"
1596
- }, Je = l("div")(() => ({
1596
+ }, Je = c("div")(() => ({
1597
1597
  width: "100%",
1598
1598
  cursor: "pointer"
1599
- })), Ye = l("div")(() => ({
1599
+ })), Ye = c("div")(() => ({
1600
1600
  margin: "0 auto",
1601
1601
  textAlign: "center",
1602
1602
  display: "flex"
1603
- })), Xe = l("div")(() => ({
1603
+ })), Xe = c("div")(() => ({
1604
1604
  width: "fit-content",
1605
1605
  minWidth: "140px",
1606
1606
  alignSelf: "center",
1607
1607
  verticalAlign: "middle",
1608
- color: `var(--correct-answer-toggle-label-color, ${c.text()})`,
1608
+ color: `var(--correct-answer-toggle-label-color, ${s.text()})`,
1609
1609
  fontWeight: "normal",
1610
1610
  ...qe
1611
- })), Ze = l("div")(() => ({
1611
+ })), Ze = c("div")(() => ({
1612
1612
  position: "absolute",
1613
1613
  width: "25px",
1614
1614
  "&.enter": { opacity: "0" },
@@ -1621,7 +1621,7 @@ var We = Ue(s, "Readable") || Ue(Ke.Readable, "Readable"), Ge = i, K = Ge.defaul
1621
1621
  opacity: "0",
1622
1622
  transition: "opacity 0.3s ease-in"
1623
1623
  }
1624
- })), Qe = l("div")(() => ({
1624
+ })), Qe = c("div")(() => ({
1625
1625
  width: "25px",
1626
1626
  marginRight: "5px",
1627
1627
  display: "flex",
@@ -1712,21 +1712,21 @@ var We = Ue(s, "Readable") || Ue(Ke.Readable, "Readable"), Ge = i, K = Ge.defaul
1712
1712
  })
1713
1713
  });
1714
1714
  }
1715
- }, et = l("div")(({ theme: e }) => ({
1715
+ }, et = c("div")(({ theme: e }) => ({
1716
1716
  marginLeft: "auto",
1717
1717
  marginRight: "auto",
1718
1718
  marginTop: e.spacing(1),
1719
1719
  marginBottom: e.spacing(1)
1720
- })), tt = l("td")({ padding: "5px 0" }), nt = l(m)(({ theme: e }) => ({ margin: e.spacing(2) })), rt = l("th")({ padding: 0 }), J = l("div")(({ theme: e, isQuestionText: t }) => ({
1720
+ })), tt = c("td")({ padding: "5px 0" }), nt = c(m)(({ theme: e }) => ({ margin: e.spacing(2) })), rt = c("th")({ padding: 0 }), J = c("div")(({ theme: e, isQuestionText: t }) => ({
1721
1721
  padding: e.spacing(1.5),
1722
1722
  textAlign: t ? "left" : "center"
1723
- })), it = l("tr")({
1723
+ })), it = c("tr")({
1724
1724
  border: 0,
1725
- borderTop: `2.5px solid ${c.primaryLight()}`,
1725
+ borderTop: `2.5px solid ${s.primaryLight()}`,
1726
1726
  width: "100%"
1727
- }), at = l("table")({
1728
- color: c.text(),
1729
- backgroundColor: c.background(),
1727
+ }), at = c("table")({
1728
+ color: s.text(),
1729
+ backgroundColor: s.background(),
1730
1730
  borderCollapse: "collapse",
1731
1731
  borderSpacing: 0,
1732
1732
  marginBottom: 0
@@ -1756,7 +1756,7 @@ var We = Ue(s, "Readable") || Ue(Ke.Readable, "Readable"), Ge = i, K = Ge.defaul
1756
1756
  return r[e][n] === !0 && t === !1 || r[e][n] === !1 && t === !0;
1757
1757
  };
1758
1758
  render() {
1759
- let { showCorrect: e, headers: t, rows: n, choiceMode: r, answers: i, disabled: a, view: o } = this.props, s = r === "radio" ? p : u, l = a && !o;
1759
+ let { showCorrect: e, headers: t, rows: n, choiceMode: r, answers: i, disabled: a, view: o } = this.props, c = r === "radio" ? p : u, l = a && !o;
1760
1760
  return !n || n.length === 0 ? /* @__PURE__ */ b(et, { children: /* @__PURE__ */ b(nt, {
1761
1761
  component: "div",
1762
1762
  children: "There are currently no questions to show."
@@ -1780,16 +1780,16 @@ var We = Ue(s, "Readable") || Ue(Ke.Readable, "Readable"), Ge = i, K = Ge.defaul
1780
1780
  })
1781
1781
  }, `td-title-${n}`), (i[t.id] || []).map((r, i) => /* @__PURE__ */ b(tt, {
1782
1782
  "data-colno": `${i + 1}`,
1783
- children: /* @__PURE__ */ b(J, { children: /* @__PURE__ */ b(s, {
1783
+ children: /* @__PURE__ */ b(J, { children: /* @__PURE__ */ b(c, {
1784
1784
  sx: {
1785
1785
  padding: "6px",
1786
- color: e && r === !0 || l && this.answerIsCorrect(t.id, r, i) ? c.correct() : l && this.answerIsIncorrect(t.id, r, i) ? c.incorrect() : r === !0 && !l ? c.primary() : a ? c.disabled() : c.text(),
1786
+ color: e && r === !0 || l && this.answerIsCorrect(t.id, r, i) ? s.correct() : l && this.answerIsIncorrect(t.id, r, i) ? s.incorrect() : r === !0 && !l ? s.primary() : a ? s.disabled() : s.text(),
1787
1787
  cursor: a ? "not-allowed" : "pointer",
1788
1788
  pointerEvents: a ? "initial" : "auto",
1789
1789
  opacity: a ? .7 : 1,
1790
1790
  "& input": { width: "100% !important" },
1791
- "&:hover": { color: a ? c.disabled() : c.primaryLight() },
1792
- "&.Mui-disabled": { color: `${e && r === !0 || l && this.answerIsCorrect(t.id, r, i) ? c.correct() : l && this.answerIsIncorrect(t.id, r, i) ? c.incorrect() : r === !0 && !l ? c.primary() : c.disabled()}` }
1791
+ "&:hover": { color: a ? s.disabled() : s.primaryLight() },
1792
+ "&.Mui-disabled": { color: `${e && r === !0 || l && this.answerIsCorrect(t.id, r, i) ? s.correct() : l && this.answerIsIncorrect(t.id, r, i) ? s.incorrect() : r === !0 && !l ? s.primary() : s.disabled()}` }
1793
1793
  },
1794
1794
  disabled: a,
1795
1795
  onChange: this.onRowValueChange(t.id, i),
@@ -1808,7 +1808,7 @@ function Y(e) {
1808
1808
  function X(e, t) {
1809
1809
  return !e || Y(e) ? e : Y(e.default) ? e.default : t && Y(e[t]) ? e[t] : t && Y(e[t]?.default) ? e[t].default : e;
1810
1810
  }
1811
- var st = X(g, "UiLayout") || X($.UiLayout, "UiLayout"), Z = X(d, "PreviewPrompt") || X($.PreviewPrompt, "PreviewPrompt"), ct = X(o, "Feedback") || X($.Feedback, "Feedback"), lt = X(r, "Collapsible") || X($.Collapsible, "Collapsible"), ut = i, Q = ut.default, $ = Q && typeof Q == "object" ? Q : ut, dt = l("div")({ verticalAlign: "middle" }), ft = l(lt)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), pt = class extends _.Component {
1811
+ var st = X(g, "UiLayout") || X($.UiLayout, "UiLayout"), Z = X(d, "PreviewPrompt") || X($.PreviewPrompt, "PreviewPrompt"), ct = X(a, "Feedback") || X($.Feedback, "Feedback"), lt = X(n, "Collapsible") || X($.Collapsible, "Collapsible"), ut = r, Q = ut.default, $ = Q && typeof Q == "object" ? Q : ut, dt = c("div")({ verticalAlign: "middle" }), ft = c(lt)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), pt = class extends _.Component {
1812
1812
  static propTypes = {
1813
1813
  session: S.default.object.isRequired,
1814
1814
  onSessionChange: S.default.func,
@@ -1859,11 +1859,11 @@ var st = X(g, "UiLayout") || X($.UiLayout, "UiLayout"), Z = X(d, "PreviewPrompt"
1859
1859
  } }), this.callOnSessionChange);
1860
1860
  };
1861
1861
  render() {
1862
- let { model: e } = this.props, { showCorrect: t, session: n } = this.state, { correctness: r = {}, extraCSSRules: i, language: o } = e, s = r.correctness && r.correctness !== "correct", c = e.rationale && (a(e.rationale) || h(e.rationale));
1862
+ let { model: e } = this.props, { showCorrect: t, session: n } = this.state, { correctness: r = {}, extraCSSRules: a, language: o } = e, s = r.correctness && r.correctness !== "correct", c = e.rationale && (i(e.rationale) || h(e.rationale));
1863
1863
  return /* @__PURE__ */ x(st, {
1864
- extraCSSRules: i,
1864
+ extraCSSRules: a,
1865
1865
  children: [
1866
- e.teacherInstructions && (a(e.teacherInstructions) || h(e.teacherInstructions)) && /* @__PURE__ */ b(ft, {
1866
+ e.teacherInstructions && (i(e.teacherInstructions) || h(e.teacherInstructions)) && /* @__PURE__ */ b(ft, {
1867
1867
  labels: {
1868
1868
  hidden: "Show Teacher Instructions",
1869
1869
  visible: "Hide Teacher Instructions"
@@ -1919,8 +1919,6 @@ var st = X(g, "UiLayout") || X($.UiLayout, "UiLayout"), Z = X(d, "PreviewPrompt"
1919
1919
  }), this.component = t, this.complete = n;
1920
1920
  }
1921
1921
  });
1922
- //#endregion
1923
- //#region ../../shared/player-events/dist/index.js
1924
1922
  var mt = class e extends CustomEvent {
1925
1923
  static {
1926
1924
  this.TYPE = "session-changed";
@@ -1971,11 +1969,11 @@ var mt = class e extends CustomEvent {
1971
1969
  onSessionChange: this.sessionChanged.bind(this)
1972
1970
  });
1973
1971
  this._root ||= y(this), this._root.render(e), queueMicrotask(() => {
1974
- t(this);
1972
+ l(this);
1975
1973
  });
1976
1974
  }
1977
1975
  disconnectedCallback() {
1978
- this._root && this._root.unmount();
1976
+ this._root &&= (this._root.unmount(), null);
1979
1977
  }
1980
1978
  };
1981
1979
  //#endregion