diff --git a/dist/aicc.js b/dist/aicc.js index cc4cdac..4ee8d14 100644 --- a/dist/aicc.js +++ b/dist/aicc.js @@ -10,1964 +10,1445 @@ })(self, function() { return /******/ (function() { // webpackBootstrap /******/ "use strict"; -var __webpack_exports__ = {}; +/******/ var __webpack_modules__ = ({ -;// ./node_modules/tslib/tslib.es6.mjs -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 900: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + A: function() { return /* binding */ src_BaseAPI; } +}); -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/utilities/debounce.ts +function debounce(func, wait, immediate) { + if (immediate === void 0) { immediate = false; } + var timeout; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = this; + var later = function () { + timeout = null; + if (!immediate) + func.apply(context, args); + }; + var callNow = immediate && !timeout; + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) + func.apply(context, args); + }; +} + +;// ./src/constants/default_settings.ts + + +var DefaultSettings = { + autocommit: false, + autocommitSeconds: 10, + asyncCommit: false, + sendFullCommit: true, + lmsCommitUrl: false, + dataCommitFormat: "json", + commitRequestDataType: "application/json;charset=UTF-8", + autoProgress: false, + logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR, + selfReportSessionTime: false, + alwaysSendTotalTime: false, + renderCommonCommitFields: false, + strict_errors: true, + xhrHeaders: {}, + xhrWithCredentials: false, + responseHandler: function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var httpResult, _a, _b; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof response !== "undefined")) return [3, 2]; + _b = (_a = JSON).parse; + return [4, response.text()]; + case 1: + httpResult = _b.apply(_a, [_c.sent()]); + if (httpResult === null || + !{}.hasOwnProperty.call(httpResult, "result")) { + if (response.status === 200) { + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + else { + return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + } + else { + return [2, { + result: httpResult.result, + errorCode: httpResult.errorCode + ? httpResult.errorCode + : httpResult.result === api_constants/* default */.A.global.SCORM_TRUE + ? 0 + : 101, + }]; + } + _c.label = 2; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + }); + }); + }, + requestHandler: function (commitObject) { + return commitObject; + }, + onLogMessage: function (messageLevel, logMessage) { + switch (messageLevel) { + case api_constants/* default */.A.global.LOG_LEVEL_ERROR: + console.error(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_WARNING: + console.warn(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_INFO: + console.info(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_DEBUG: + if (console.debug) { + console.debug(logMessage); + } + else { + console.log(logMessage); + } + break; + } + }, + scoItemIds: [], + scoItemIdValidator: false, }; -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} +;// ./src/helpers/scheduled_commit.ts -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} +var ScheduledCommit = (function () { + function ScheduledCommit(API, when, callback) { + this._cancelled = false; + this._API = API; + this._timeout = setTimeout(this.wrapper.bind(this), when); + this._callback = callback; + } + ScheduledCommit.prototype.cancel = function () { + this._cancelled = true; + if (this._timeout) { + clearTimeout(this._timeout); + } + }; + ScheduledCommit.prototype.wrapper = function () { + var _this = this; + if (!this._cancelled) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this._API.commit(this._callback)]; + case 1: return [2, _a.sent()]; + } + }); }); })(); + } + }; + return ScheduledCommit; +}()); -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} +;// ./src/BaseAPI.ts -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -/* harmony default export */ var tslib_es6 = ({ - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}); - -;// ./src/cmi/common/base_cmi.ts - -var BaseCMI = (function () { - function BaseCMI() { - this.jsonString = false; - this._initialized = false; - } - Object.defineProperty(BaseCMI.prototype, "initialized", { - get: function () { - return this._initialized; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(BaseCMI.prototype, "start_time", { - get: function () { - return this._start_time; - }, - enumerable: false, - configurable: true - }); - BaseCMI.prototype.initialize = function () { - this._initialized = true; - }; - BaseCMI.prototype.setStartTime = function () { - this._start_time = new Date().getTime(); - }; - return BaseCMI; -}()); - -var BaseRootCMI = (function (_super) { - __extends(BaseRootCMI, _super); - function BaseRootCMI() { - return _super !== null && _super.apply(this, arguments) || this; - } - return BaseRootCMI; -}(BaseCMI)); - - -;// ./src/constants/error_codes.ts - -var global = { - GENERAL: 101, - INITIALIZATION_FAILED: 101, - INITIALIZED: 101, - TERMINATED: 101, - TERMINATION_FAILURE: 101, - TERMINATION_BEFORE_INIT: 101, - MULTIPLE_TERMINATION: 101, - RETRIEVE_BEFORE_INIT: 101, - RETRIEVE_AFTER_TERM: 101, - STORE_BEFORE_INIT: 101, - STORE_AFTER_TERM: 101, - COMMIT_BEFORE_INIT: 101, - COMMIT_AFTER_TERM: 101, - ARGUMENT_ERROR: 101, - CHILDREN_ERROR: 101, - COUNT_ERROR: 101, - GENERAL_GET_FAILURE: 101, - GENERAL_SET_FAILURE: 101, - GENERAL_COMMIT_FAILURE: 101, - UNDEFINED_DATA_MODEL: 101, - UNIMPLEMENTED_ELEMENT: 101, - VALUE_NOT_INITIALIZED: 101, - INVALID_SET_VALUE: 101, - READ_ONLY_ELEMENT: 101, - WRITE_ONLY_ELEMENT: 101, - TYPE_MISMATCH: 101, - VALUE_OUT_OF_RANGE: 101, - DEPENDENCY_NOT_ESTABLISHED: 101, -}; -var scorm12 = __assign(__assign({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var scorm2004 = __assign(__assign({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var ErrorCodes = { - scorm12: scorm12, - scorm2004: scorm2004, -}; -/* harmony default export */ var error_codes = (ErrorCodes); - -;// ./src/constants/api_constants.ts - -var api_constants_global = { - SCORM_TRUE: "true", - SCORM_FALSE: "false", - STATE_NOT_INITIALIZED: 0, - STATE_INITIALIZED: 1, - STATE_TERMINATED: 2, - LOG_LEVEL_DEBUG: 1, - LOG_LEVEL_INFO: 2, - LOG_LEVEL_WARNING: 3, - LOG_LEVEL_ERROR: 4, - LOG_LEVEL_NONE: 5, -}; -var api_constants_scorm12 = { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", - core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", - score_children: "raw,min,max", - comments_children: "content,location,time", - objectives_children: "id,score,status", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio,language,speed,text", - interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", - error_descriptions: { - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", - }, - "201": { - basicMessage: "Invalid argument error", - detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", - }, - "202": { - basicMessage: "Element cannot have children", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', - }, - "203": { - basicMessage: "Element not an array - cannot have count", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', - }, - "301": { - basicMessage: "Not initialized", - detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", - }, - "401": { - basicMessage: "Not implemented error", - detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", - }, - "402": { - basicMessage: "Invalid set value, element is a keyword", - detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', - }, - "403": { - basicMessage: "Element is read only", - detailMessage: "LMSSetValue was called with a data model element that can only be read.", - }, - "404": { - basicMessage: "Element is write only", - detailMessage: "LMSGetValue was called on a data model element that can only be written to.", - }, - "405": { - basicMessage: "Incorrect Data Type", - detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Element Value Out Of Range", - detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var aicc = __assign(__assign({}, api_constants_scorm12), { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", - student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", - student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", - student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", - tries_children: "time,status,score", - attempt_records_children: "score,lesson_status", - paths_children: "location_id,date,time,status,why_left,time_in_element", -}); -var api_constants_scorm2004 = { - cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", - comments_children: "comment,timestamp,location", - score_children: "max,raw,scaled,min", - objectives_children: "progress_measure,completion_status,success_status,description,score,id", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio_level,audio_captioning,delivery_speed,language", - interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", - error_descriptions: { - "0": { - basicMessage: "No Error", - detailMessage: "No error occurred, the previous API call was successful.", - }, - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", - }, - "102": { - basicMessage: "General Initialization Failure", - detailMessage: "Call to Initialize failed for an unknown reason.", - }, - "103": { - basicMessage: "Already Initialized", - detailMessage: "Call to Initialize failed because Initialize was already called.", - }, - "104": { - basicMessage: "Content Instance Terminated", - detailMessage: "Call to Initialize failed because Terminate was already called.", - }, - "111": { - basicMessage: "General Termination Failure", - detailMessage: "Call to Terminate failed for an unknown reason.", - }, - "112": { - basicMessage: "Termination Before Initialization", - detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", - }, - "113": { - basicMessage: "Termination After Termination", - detailMessage: "Call to Terminate failed because Terminate was already called.", - }, - "122": { - basicMessage: "Retrieve Data Before Initialization", - detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", - }, - "123": { - basicMessage: "Retrieve Data After Termination", - detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", - }, - "132": { - basicMessage: "Store Data Before Initialization", - detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", - }, - "133": { - basicMessage: "Store Data After Termination", - detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", - }, - "142": { - basicMessage: "Commit Before Initialization", - detailMessage: "Call to Commit failed because it was made before the call to Initialize.", - }, - "143": { - basicMessage: "Commit After Termination", - detailMessage: "Call to Commit failed because it was made after the call to Terminate.", - }, - "201": { - basicMessage: "General Argument Error", - detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", - }, - "301": { - basicMessage: "General Get Failure", - detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "351": { - basicMessage: "General Set Failure", - detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "391": { - basicMessage: "General Commit Failure", - detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "401": { - basicMessage: "Undefined Data Model Element", - detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", - }, - "402": { - basicMessage: "Unimplemented Data Model Element", - detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", - }, - "403": { - basicMessage: "Data Model Element Value Not Initialized", - detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", - }, - "404": { - basicMessage: "Data Model Element Is Read Only", - detailMessage: "SetValue was called with a data model element that can only be read.", - }, - "405": { - basicMessage: "Data Model Element Is Write Only", - detailMessage: "GetValue was called on a data model element that can only be written to.", - }, - "406": { - basicMessage: "Data Model Element Type Mismatch", - detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Data Model Element Value Out Of Range", - detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var APIConstants = { - global: api_constants_global, - scorm12: api_constants_scorm12, - aicc: aicc, - scorm2004: api_constants_scorm2004, -}; -/* harmony default export */ var api_constants = (APIConstants); - -;// ./src/exceptions.ts - - -var scorm12_errors = api_constants.scorm12.error_descriptions; -var aicc_errors = api_constants.aicc.error_descriptions; -var scorm2004_errors = api_constants.scorm2004.error_descriptions; -var BaseScormValidationError = (function (_super) { - __extends(BaseScormValidationError, _super); - function BaseScormValidationError(errorCode) { - var _this = _super.call(this, errorCode.toString()) || this; - _this._errorCode = errorCode; - _this.name = "ScormValidationError"; - return _this; - } - Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { - get: function () { - return this._errorCode; - }, - enumerable: false, - configurable: true - }); - BaseScormValidationError.prototype.setMessage = function (message) { - this.message = message; - }; - return BaseScormValidationError; -}(Error)); - -var ValidationError = (function (_super) { - __extends(ValidationError, _super); - function ValidationError(errorCode, errorMessage, detailedMessage) { - var _this = _super.call(this, errorCode) || this; - _this._detailedMessage = ""; - _this.setMessage(errorMessage); - _this._errorMessage = errorMessage; - if (detailedMessage) { - _this._detailedMessage = detailedMessage; - } - return _this; - } - Object.defineProperty(ValidationError.prototype, "errorMessage", { - get: function () { - return this._errorMessage; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ValidationError.prototype, "detailedMessage", { - get: function () { - return this._detailedMessage; - }, - enumerable: false, - configurable: true - }); - return ValidationError; -}(BaseScormValidationError)); -var Scorm12ValidationError = (function (_super) { - __extends(Scorm12ValidationError, _super); - function Scorm12ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; +var BaseAPI = (function () { + function BaseAPI(error_codes, settings) { + var _newTarget = this.constructor; + this._settings = DefaultSettings; + if (_newTarget === BaseAPI) { + throw new TypeError("Cannot construct BaseAPI instances directly"); } - else { - _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + this._error_codes = error_codes; + if (settings) { + this.settings = settings; } - return _this; + this.apiLogLevel = this.settings.logLevel; + this.selfReportSessionTime = this.settings.selfReportSessionTime; } - return Scorm12ValidationError; -}(ValidationError)); - -var AICCValidationError = (function (_super) { - __extends(AICCValidationError, _super); - function AICCValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { - _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + BaseAPI.prototype.commonReset = function (settings) { + this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings); + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + }; + BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); } - return _this; - } - return AICCValidationError; -}(ValidationError)); - -var Scorm2004ValidationError = (function (_super) { - __extends(Scorm2004ValidationError, _super); - function Scorm2004ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + else if (this.isTerminated()) { + this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); } else { - _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + if (this.selfReportSessionTime) { + this.cmi.setStartTime(); + } + this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED; + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); } - return _this; - } - return Scorm2004ValidationError; -}(ValidationError)); - - -;// ./src/cmi/common/array.ts - - - - -var scorm12_error_codes = error_codes.scorm12; -var CMIArray = (function (_super) { - __extends(CMIArray, _super); - function CMIArray(params) { - var _this = _super.call(this) || this; - _this.__children = params.children; - _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; - _this._errorClass = params.errorClass || BaseScormValidationError; - _this.childArray = []; - return _this; - } - Object.defineProperty(CMIArray.prototype, "_children", { + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { + logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement); + if (messageLevel >= this.apiLogLevel) { + this.settings.onLogMessage(messageLevel, logMessage); + } + }; + Object.defineProperty(BaseAPI.prototype, "error_codes", { get: function () { - return this.__children; - }, - set: function (_children) { - throw new this._errorClass(this._errorCode); + return this._error_codes; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIArray.prototype, "_count", { + Object.defineProperty(BaseAPI.prototype, "settings", { get: function () { - return this.childArray.length; - }, - set: function (_count) { - throw new this._errorClass(this._errorCode); - }, - enumerable: false, - configurable: true - }); - CMIArray.prototype.toJSON = function () { - this.jsonString = true; - var result = {}; - for (var i = 0; i < this.childArray.length; i++) { - result[i + ""] = this.childArray[i]; - } - delete this.jsonString; - return result; - }; - return CMIArray; -}(BaseCMI)); - - -;// ./src/utilities.ts -var SECONDS_PER_SECOND = 1.0; -var SECONDS_PER_MINUTE = 60; -var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; -var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; -var designations = { - D: SECONDS_PER_DAY, - H: SECONDS_PER_HOUR, - M: SECONDS_PER_MINUTE, - S: SECONDS_PER_SECOND, -}; -function getSecondsAsHHMMSS(totalSeconds) { - if (!totalSeconds || totalSeconds <= 0) { - return "00:00:00"; - } - var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); - var dateObj = new Date(totalSeconds * 1000); - var minutes = dateObj.getUTCMinutes(); - var seconds = dateObj.getSeconds(); - var ms = totalSeconds % 1.0; - var msStr = ""; - if (countDecimals(ms) > 0) { - if (countDecimals(ms) > 2) { - msStr = ms.toFixed(2); - } - else { - msStr = String(ms); - } - msStr = "." + msStr.split(".")[1]; - } - return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); -} -function getSecondsAsISODuration(seconds) { - if (!seconds || seconds <= 0) { - return "PT0S"; - } - var duration = "P"; - var remainder = seconds; - for (var designationsKey in designations) { - var current_seconds = designations[designationsKey]; - var value = Math.floor(remainder / current_seconds); - remainder = remainder % current_seconds; - if (countDecimals(remainder) > 2) { - remainder = Number(Number(remainder).toFixed(2)); - } - if (designationsKey === "S" && remainder > 0) { - value += remainder; - } - if (value) { - if ((duration.indexOf("D") > 0 || - designationsKey === "H" || - designationsKey === "M" || - designationsKey === "S") && - duration.indexOf("T") === -1) { - duration += "T"; - } - duration += "".concat(value).concat(designationsKey); - } - } - return duration; -} -function getTimeAsSeconds(timeString, timeRegex) { - if (typeof timeString === "number" || typeof timeString === "boolean") { - timeString = String(timeString); - } - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - if (!timeString || !timeString.match(timeRegex)) { - return 0; - } - var parts = timeString.split(":"); - var hours = Number(parts[0]); - var minutes = Number(parts[1]); - var seconds = Number(parts[2]); - return hours * 3600 + minutes * 60 + seconds; -} -function getDurationAsSeconds(duration, durationRegex) { - if (typeof durationRegex === "string") { - durationRegex = new RegExp(durationRegex); - } - if (!duration || !duration.match(durationRegex)) { - return 0; - } - var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; - var result = 0.0; - result += Number(seconds) || 0.0; - result += Number(minutes) * 60.0 || 0.0; - result += Number(hours) * 3600.0 || 0.0; - result += Number(days) * (60 * 60 * 24.0) || 0.0; - result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; - return result; -} -function addTwoDurations(first, second, durationRegex) { - var regex = typeof durationRegex === "string" - ? new RegExp(durationRegex) - : durationRegex; - return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); -} -function addHHMMSSTimeStrings(first, second, timeRegex) { - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); -} -function flatten(data) { - var result = {}; - function recurse(cur, prop) { - if (Object(cur) !== cur) { - result[prop] = cur; - } - else if (Array.isArray(cur)) { - for (var i = 0, l = cur.length; i < l; i++) { - recurse(cur[i], prop + "[" + i + "]"); - if (l === 0) - result[prop] = []; - } - } - else { - var isEmpty = true; - for (var p in cur) { - if ({}.hasOwnProperty.call(cur, p)) { - isEmpty = false; - recurse(cur[p], prop ? prop + "." + p : p); + return this._settings; + }, + set: function (settings) { + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); + }, + enumerable: false, + configurable: true + }); + BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var returnValue, result; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; + return [4, this.storeData(true)]; + case 1: + result = _a.sent(); + if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + if (checkTerminated) + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; } + }); + }); + }; + BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { + var returnValue = ""; + if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.getCMIValue(CMIElement); } - if (isEmpty && prop) - result[prop] = {}; + catch (e) { + returnValue = this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement); } - } - recurse(data, ""); - return result; -} -function unflatten(data) { - "use strict"; - if (Object(data) !== data || Array.isArray(data)) - return data; - var regex = /\.?([^.[\]]+)|\[(\d+)]/g; - var result = {}; - for (var p in data) { - if ({}.hasOwnProperty.call(data, p)) { - var cur = result; - var prop = ""; - var m = regex.exec(p); - while (m) { - cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); - prop = m[2] || m[1]; - m = regex.exec(p); + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + if (returnValue === undefined) { + return ""; + } + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { + if (value !== undefined) { + value = String(value); + } + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.setCMIValue(CMIElement, value); } - cur[prop] = data[p]; + catch (e) { + this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement, value); } - } - return result[""] || result; -} -function countDecimals(num) { - if (Math.floor(num) === num || String(num).indexOf(".") < 0) - return 0; - var parts = num.toString().split(".")[1]; - return parts.length || 0; -} -function formatMessage(functionName, message, CMIElement) { - var baseLength = 20; - var messageString = ""; - messageString += functionName; - var fillChars = baseLength - messageString.length; - for (var i = 0; i < fillChars; i++) { - messageString += " "; - } - messageString += ": "; - if (CMIElement) { - var CMIElementBaseLength = 70; - messageString += CMIElement; - fillChars = CMIElementBaseLength - messageString.length; - for (var j = 0; j < fillChars; j++) { - messageString += " "; + if (returnValue === undefined) { + returnValue = api_constants/* default */.A.global.SCORM_FALSE; } - } - if (message) { - messageString += message; - } - return messageString; -} -function stringMatches(str, tester) { - return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; -} - -;// ./src/utilities/debounce.ts -function debounce(func, wait, immediate) { - if (immediate === void 0) { immediate = false; } - var timeout; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; + if (String(this.lastErrorCode) === "0") { + if (this.settings.autocommit && !this._timeout) { + this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + } } - var context = this; - var later = function () { - timeout = null; - if (!immediate) - func.apply(context, args); - }; - var callNow = immediate && !timeout; - if (timeout) - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) - func.apply(context, args); + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + this.clearSCORMError(returnValue); + return returnValue; }; -} - -;// ./src/constants/default_settings.ts - - -var DefaultSettings = { - autocommit: false, - autocommitSeconds: 10, - asyncCommit: false, - sendFullCommit: true, - lmsCommitUrl: false, - dataCommitFormat: "json", - commitRequestDataType: "application/json;charset=UTF-8", - autoProgress: false, - logLevel: api_constants.global.LOG_LEVEL_ERROR, - selfReportSessionTime: false, - alwaysSendTotalTime: false, - renderCommonCommitFields: false, - strict_errors: true, - xhrHeaders: {}, - xhrWithCredentials: false, - responseHandler: function (response) { - return __awaiter(this, void 0, void 0, function () { - var httpResult, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { + BaseAPI.prototype.commit = function (callbackName_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { + var returnValue, result; + if (checkTerminated === void 0) { checkTerminated = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { case 0: - if (!(typeof response !== "undefined")) return [3, 2]; - _b = (_a = JSON).parse; - return [4, response.text()]; + this.clearScheduledCommit(); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; + return [4, this.storeData(false)]; case 1: - httpResult = _b.apply(_a, [_c.sent()]); - if (httpResult === null || - !{}.hasOwnProperty.call(httpResult, "result")) { - if (response.status === 200) { - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; + result = _a.sent(); + if (result.errorCode && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); + if (checkTerminated) + this.lastErrorCode = "0"; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getLastError = function (callbackName) { + var returnValue = String(this.lastErrorCode); + this.processListeners(callbackName); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { + if (this.isNotInitialized()) { + this.throwSCORMError(beforeInitError); + return false; + } + else if (checkTerminated && this.isTerminated()) { + this.throwSCORMError(afterTermError); + return false; + } + return true; + }; + BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { + if (_detail === void 0) { _detail = false; } + throw new Error("The getLmsErrorMessageDetails method has not been implemented"); + }; + BaseAPI.prototype.getCMIValue = function (_CMIElement) { + throw new Error("The getCMIValue method has not been implemented"); + }; + BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { + throw new Error("The setCMIValue method has not been implemented"); + }; + BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { + if (!CMIElement || CMIElement === "") { + return api_constants/* default */.A.global.SCORM_FALSE; + } + var structure = CMIElement.split("."); + var refObject = this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + var foundFirstIndex = false; + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + var attribute = structure[idx]; + if (idx === structure.length - 1) { + if (scorm2004 && attribute.substring(0, 8) === "{target=") { + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); + } + else { + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); + } + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && + this.isInitialized()) { + this.validateCorrectResponse(CMIElement, value); + } + if (!scorm2004 || this.lastErrorCode === "0") { + refObject[attribute] = value; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + } + } + } + else { + refObject = refObject[attribute]; + if (!refObject) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + foundFirstIndex = true; + } + else { + var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); + foundFirstIndex = true; + if (!newChild) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); } else { - return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; + if (refObject.initialized) + newChild.initialize(); + refObject.childArray.push(newChild); + refObject = newChild; } } - else { - return [2, { - result: httpResult.result, - errorCode: httpResult.errorCode - ? httpResult.errorCode - : httpResult.result === api_constants.global.SCORM_TRUE - ? 0 - : 101, - }]; - } - _c.label = 2; - case 2: return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; + idx++; + } } - }); - }); - }, - requestHandler: function (commitObject) { - return commitObject; - }, - onLogMessage: function (messageLevel, logMessage) { - switch (messageLevel) { - case api_constants.global.LOG_LEVEL_ERROR: - console.error(logMessage); - break; - case api_constants.global.LOG_LEVEL_WARNING: - console.warn(logMessage); - break; - case api_constants.global.LOG_LEVEL_INFO: - console.info(logMessage); - break; - case api_constants.global.LOG_LEVEL_DEBUG: - if (console.debug) { - console.debug(logMessage); + } + } + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); + } + return returnValue; + }; + BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { + if (!CMIElement || CMIElement === "") { + return ""; + } + var structure = CMIElement.split("."); + var refObject = this; + var attribute = null; + var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + attribute = structure[idx]; + if (!scorm2004) { + if (idx === structure.length - 1) { + if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } } - else { - console.log(logMessage); + } + else { + if (String(attribute).substring(0, 8) === "{target=" && + typeof refObject._isTargetValid == "function") { + var target = String(attribute).substring(8, String(attribute).length - 9); + return refObject._isTargetValid(target); + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; } + } + refObject = refObject[attribute]; + if (refObject === undefined) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + } + else { + this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); + break; + } + idx++; + } + } } - }, - scoItemIds: [], - scoItemIdValidator: false, -}; - -;// ./src/helpers/scheduled_commit.ts - -var ScheduledCommit = (function () { - function ScheduledCommit(API, when, callback) { - this._cancelled = false; - this._API = API; - this._timeout = setTimeout(this.wrapper.bind(this), when); - this._callback = callback; - } - ScheduledCommit.prototype.cancel = function () { - this._cancelled = true; - if (this._timeout) { - clearTimeout(this._timeout); + if (refObject === null || refObject === undefined) { + if (!scorm2004) { + if (attribute === "_children") { + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); + } + else if (attribute === "_count") { + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); + } + } + } + else { + return refObject; } }; - ScheduledCommit.prototype.wrapper = function () { - var _this = this; - if (!this._cancelled) { - (function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this._API.commit(this._callback)]; - case 1: return [2, _a.sent()]; - } - }); }); })(); + BaseAPI.prototype.isInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; + }; + BaseAPI.prototype.isNotInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + }; + BaseAPI.prototype.isTerminated = function () { + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; + }; + BaseAPI.prototype.on = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + for (var i = 0; i < listenerFunctions.length; i++) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this.listenerArray.push({ + functionName: functionName, + CMIElement: CMIElement, + callback: callback, + }); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); } }; - return ScheduledCommit; -}()); - - -;// ./src/BaseAPI.ts - - - - - - - - - -var BaseAPI = (function () { - function BaseAPI(error_codes, settings) { - var _newTarget = this.constructor; - this._settings = DefaultSettings; - if (_newTarget === BaseAPI) { - throw new TypeError("Cannot construct BaseAPI instances directly"); + BaseAPI.prototype.off = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + var _loop_1 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + var removeIndex = this_1.listenerArray.findIndex(function (obj) { + return obj.functionName === functionName && + obj.CMIElement === CMIElement && + obj.callback === callback; + }); + if (removeIndex !== -1) { + this_1.listenerArray.splice(removeIndex, 1); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + var this_1 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; } - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; - this._error_codes = error_codes; - if (settings) { - this.settings = settings; + }; + BaseAPI.prototype.clear = function (listenerName) { + var listenerFunctions = listenerName.split(" "); + var _loop_2 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this_2.listenerArray = this_2.listenerArray.filter(function (obj) { + return obj.functionName !== functionName && obj.CMIElement !== CMIElement; + }); + }; + var this_2 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_2 = _loop_2(i); + if (typeof state_2 === "object") + return state_2.value; } - this.apiLogLevel = this.settings.logLevel; - this.selfReportSessionTime = this.settings.selfReportSessionTime; - } - BaseAPI.prototype.commonReset = function (settings) { - this.settings = __assign(__assign({}, this.settings), settings); - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; }; - BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { - var returnValue = api_constants.global.SCORM_FALSE; - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); + BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + for (var i = 0; i < this.listenerArray.length; i++) { + var listener = this.listenerArray[i]; + var functionsMatch = listener.functionName === functionName; + var listenerHasCMIElement = !!listener.CMIElement; + var CMIElementsMatch = false; + if (CMIElement && + listener.CMIElement && + listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { + CMIElementsMatch = + CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + } + else { + CMIElementsMatch = listener.CMIElement === CMIElement; + } + if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + listener.callback(CMIElement, value); + } } - else if (this.isTerminated()) { - this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); + }; + BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { + if (!message) { + message = this.getLmsErrorMessageDetails(errorNumber); } - else { - if (this.selfReportSessionTime) { - this.cmi.setStartTime(); - } - this.currentState = api_constants.global.STATE_INITIALIZED; + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + this.lastErrorCode = String(errorNumber); + }; + BaseAPI.prototype.clearSCORMError = function (success) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return returnValue; }; - BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { - logMessage = formatMessage(functionName, logMessage, CMIElement); - if (messageLevel >= this.apiLogLevel) { - this.settings.onLogMessage(messageLevel, logMessage); + BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + var _this = this; + if (!CMIElement) { + CMIElement = ""; } - }; - Object.defineProperty(BaseAPI.prototype, "error_codes", { - get: function () { - return this._error_codes; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(BaseAPI.prototype, "settings", { - get: function () { - return this._settings; - }, - set: function (settings) { - this._settings = __assign(__assign({}, this._settings), settings); - }, - enumerable: false, - configurable: true - }); - BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { - return __awaiter(this, void 0, void 0, function () { - var returnValue, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; - this.currentState = api_constants.global.STATE_TERMINATED; - return [4, this.storeData(true)]; - case 1: - result = _a.sent(); - if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); + if (!this.isNotInitialized()) { + console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); + return; + } + function testPattern(a, c, a_pattern) { + var a_match = a.match(a_pattern); + var c_match; + if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { + var a_num = Number(a_match[2]); + var c_num = Number(c_match[2]); + if (a_num === c_num) { + if (a_match[3] === "id") { + return -1; + } + else if (a_match[3] === "type") { + if (c_match[3] === "id") { + return 1; } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - if (checkTerminated) - this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; + else { + return -1; + } + } + else { + return 1; + } } - }); + return a_num - c_num; + } + return null; + } + var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; + var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; + var result = Object.keys(json).map(function (key) { + return [String(key), json[key]]; }); - }; - BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { - var returnValue = ""; - if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.getCMIValue(CMIElement); + result.sort(function (_a, _c) { + var a = _a[0], _b = _a[1]; + var c = _c[0], _d = _c[1]; + var test; + if ((test = testPattern(a, c, int_pattern)) !== null) { + return test; } - catch (e) { - returnValue = this.handleValueAccessException(e, returnValue); + if ((test = testPattern(a, c, obj_pattern)) !== null) { + return test; } - this.processListeners(callbackName, CMIElement); - } - this.apiLog(callbackName, ": returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - if (returnValue === undefined) { - return ""; - } - this.clearSCORMError(returnValue); - return returnValue; - }; - BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { - if (value !== undefined) { - value = String(value); - } - var returnValue = api_constants.global.SCORM_FALSE; - if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.setCMIValue(CMIElement, value); + if (a < c) { + return -1; } - catch (e) { - this.handleValueAccessException(e, returnValue); + if (a > c) { + return 1; } - this.processListeners(callbackName, CMIElement, value); - } - if (returnValue === undefined) { - returnValue = api_constants.global.SCORM_FALSE; + return 0; + }); + var obj; + result.forEach(function (element) { + obj = {}; + obj[element[0]] = element[1]; + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); + }); + }; + BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { + if (!this.isNotInitialized()) { + console.error("loadFromJSON can only be called before the call to lmsInitialize."); + return; } - if (String(this.lastErrorCode) === "0") { - if (this.settings.autocommit && !this._timeout) { - this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; + this.startingData = json; + for (var key in json) { + if ({}.hasOwnProperty.call(json, key) && json[key]) { + var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; + var value = json[key]; + if (value["childArray"]) { + for (var i = 0; i < value["childArray"].length; i++) { + this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); + } + } + else if (value.constructor === Object) { + this.loadFromJSON(value, currentCMIElement); + } + else { + this.setCMIValue(currentCMIElement, value); + } } } - this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - this.clearSCORMError(returnValue); - return returnValue; }; - BaseAPI.prototype.commit = function (callbackName_1) { - return __awaiter(this, arguments, void 0, function (callbackName, checkTerminated) { - var returnValue, result; - if (checkTerminated === void 0) { checkTerminated = false; } - return __generator(this, function (_a) { + BaseAPI.prototype.renderCMIToJSONString = function () { + var cmi = this.cmi; + if (this.settings.sendFullCommit) { + return JSON.stringify({ cmi: cmi }); + } + return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); + }; + BaseAPI.prototype.renderCMIToJSONObject = function () { + return JSON.parse(this.renderCMIToJSONString()); + }; + BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { + var api, genericError, process, debouncedProcess; + var _this = this; + if (immediate === void 0) { immediate = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: - this.clearScheduledCommit(); - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; - return [4, this.storeData(false)]; - case 1: - result = _a.sent(); - if (result.errorCode && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); + api = this; + genericError = { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: this.error_codes.GENERAL, + }; + if (immediate) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.transformResponse(response)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); }); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - this.apiLog(callbackName, " Result: " + returnValue, api_constants.global.LOG_LEVEL_DEBUG, "HttpRequest"); - if (checkTerminated) - this.lastErrorCode = "0"; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + var response, e_1; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + params = settings.requestHandler(params); + return [4, this.performFetch(url, params)]; + case 1: + response = _a.sent(); + return [2, this.transformResponse(response)]; + case 2: + e_1 = _a.sent(); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + api.processListeners("CommitError"); + return [2, genericError]; + case 3: return [2]; + } + }); + }); }; + if (!this.settings.asyncCommit) return [3, 1]; + debouncedProcess = debounce(process, 500, immediate); + debouncedProcess(url, params, this.settings); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + case 1: return [4, process(url, params, this.settings)]; + case 2: return [2, _a.sent()]; } }); }); }; - BaseAPI.prototype.getLastError = function (callbackName) { - var returnValue = String(this.lastErrorCode); - this.processListeners(callbackName); - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; + BaseAPI.prototype.scheduleCommit = function (when, callback) { + this._timeout = new ScheduledCommit(this, when, callback); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); }; - BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); - this.processListeners(callbackName); + BaseAPI.prototype.clearScheduledCommit = function () { + if (this._timeout) { + this._timeout.cancel(); + this._timeout = undefined; + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; }; - BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); - this.processListeners(callbackName); - } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; + BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { + return (Object.hasOwnProperty.call(refObject, attribute) || + Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || + attribute in refObject); }; - BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { - if (this.isNotInitialized()) { - this.throwSCORMError(beforeInitError); - return false; + BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { + if (e instanceof exceptions/* ValidationError */.yI) { + this.lastErrorCode = String(e.errorCode); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; } - else if (checkTerminated && this.isTerminated()) { - this.throwSCORMError(afterTermError); - return false; + else { + if (e instanceof Error && e.message) { + console.error(e.message); + } + else { + console.error(e); + } + this.throwSCORMError(this._error_codes.GENERAL); } - return true; - }; - BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { - if (_detail === void 0) { _detail = false; } - throw new Error("The getLmsErrorMessageDetails method has not been implemented"); - }; - BaseAPI.prototype.getCMIValue = function (_CMIElement) { - throw new Error("The getCMIValue method has not been implemented"); + return returnValue; }; - BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { - throw new Error("The setCMIValue method has not been implemented"); + BaseAPI.prototype.performFetch = function (url, params) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + return [2, fetch(url, { + method: "POST", + body: params instanceof Array ? params.join("&") : JSON.stringify(params), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + credentials: this.settings.xhrWithCredentials ? "include" : undefined, + keepalive: true, + })]; + }); + }); }; - BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { - if (!CMIElement || CMIElement === "") { - return api_constants.global.SCORM_FALSE; - } - var structure = CMIElement.split("."); - var refObject = this; - var returnValue = api_constants.global.SCORM_FALSE; - var foundFirstIndex = false; - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - var attribute = structure[idx]; - if (idx === structure.length - 1) { - if (scorm2004 && attribute.substring(0, 8) === "{target=") { - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); - } - else { - refObject = __assign(__assign({}, refObject), { attribute: value }); - } - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (stringMatches(CMIElement, "\\.correct_responses\\.\\d+") && - this.isInitialized()) { - this.validateCorrectResponse(CMIElement, value); - } - if (!scorm2004 || this.lastErrorCode === "0") { - refObject[attribute] = value; - returnValue = api_constants.global.SCORM_TRUE; - } - } - } - else { - refObject = refObject[attribute]; - if (!refObject) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - foundFirstIndex = true; + BaseAPI.prototype.transformResponse = function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, _a; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; + return [4, this.settings.responseHandler(response)]; + case 1: + _a = _c.sent(); + return [3, 4]; + case 2: return [4, response.json()]; + case 3: + _a = _c.sent(); + _c.label = 4; + case 4: + result = _a; + if (response.status >= 200 && + response.status <= 299 && + (result.result === true || + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { + this.processListeners("CommitSuccess"); } else { - var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); - foundFirstIndex = true; - if (!newChild) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (refObject.initialized) - newChild.initialize(); - refObject.childArray.push(newChild); - refObject = newChild; - } + this.processListeners("CommitError"); } - idx++; - } + return [2, result]; } - } - } - if (returnValue === api_constants.global.SCORM_FALSE) { - this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants.global.LOG_LEVEL_WARNING); - } - return returnValue; + }); + }); }; - BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { - if (!CMIElement || CMIElement === "") { - return ""; - } - var structure = CMIElement.split("."); - var refObject = this; - var attribute = null; - var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - attribute = structure[idx]; - if (!scorm2004) { - if (idx === structure.length - 1) { - if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - } - else { - if (String(attribute).substring(0, 8) === "{target=" && - typeof refObject._isTargetValid == "function") { - var target = String(attribute).substring(8, String(attribute).length - 9); - return refObject._isTargetValid(target); - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - refObject = refObject[attribute]; - if (refObject === undefined) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - } - else { - this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); - break; - } - idx++; - } + return BaseAPI; +}()); +/* harmony default export */ var src_BaseAPI = (BaseAPI); + + +/***/ }), + +/***/ 941: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635); +/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(900); +/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(989); +/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(864); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(176); +/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(833); +/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(331); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(417); +/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(56); + + + + + + + + + + + + +var Scorm12API = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__extends */ .C6)(Scorm12API, _super); + function Scorm12API(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; } } - if (refObject === null || refObject === undefined) { - if (!scorm2004) { - if (attribute === "_children") { - this.throwSCORMError(error_codes.scorm12.CHILDREN_ERROR); - } - else if (attribute === "_count") { - this.throwSCORMError(error_codes.scorm12.COUNT_ERROR); - } - } + _this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12, settings) || this; + _this.statusSetByModule = false; + _this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__/* .CMI */ .Y(); + _this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__/* .NAV */ .A(); + _this.LMSInitialize = _this.lmsInitialize; + _this.LMSFinish = _this.lmsFinish; + _this.LMSGetValue = _this.lmsGetValue; + _this.LMSSetValue = _this.lmsSetValue; + _this.LMSCommit = _this.lmsCommit; + _this.LMSGetLastError = _this.lmsGetLastError; + _this.LMSGetErrorString = _this.lmsGetErrorString; + _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; + return _this; + } + Scorm12API.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__/* .CMI */ .Y(); + this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__/* .NAV */ .A(); + }; + Scorm12API.prototype.lmsInitialize = function () { + this.cmi.initialize(); + if (this.cmi.core.lesson_status) { + this.statusSetByModule = true; } else { - return refObject; + this.cmi.core.lesson_status = "not attempted"; } + return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); }; - BaseAPI.prototype.isInitialized = function () { - return this.currentState === api_constants.global.STATE_INITIALIZED; + Scorm12API.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE; }; - BaseAPI.prototype.isNotInitialized = function () { - return this.currentState === api_constants.global.STATE_NOT_INITIALIZED; + Scorm12API.prototype.internalFinish = function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var result; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("LMSFinish", true)]; + case 1: + result = _a.sent(); + if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE) { + if (this.nav.event !== "") { + if (this.nav.event === "continue") { + this.processListeners("SequenceNext"); + } + else { + this.processListeners("SequencePrevious"); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); }; - BaseAPI.prototype.isTerminated = function () { - return this.currentState === api_constants.global.STATE_TERMINATED; + Scorm12API.prototype.lmsGetValue = function (CMIElement) { + return this.getValue("LMSGetValue", false, CMIElement); }; - BaseAPI.prototype.on = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - for (var i = 0; i < listenerFunctions.length; i++) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - this.listenerArray.push({ - functionName: functionName, - CMIElement: CMIElement, - callback: callback, - }); - this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); + Scorm12API.prototype.lmsSetValue = function (CMIElement, value) { + if (CMIElement === "cmi.core.lesson_status") { + this.statusSetByModule = true; } + return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); }; - BaseAPI.prototype.off = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - var _loop_1 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - var removeIndex = this_1.listenerArray.findIndex(function (obj) { - return obj.functionName === functionName && - obj.CMIElement === CMIElement && - obj.callback === callback; + Scorm12API.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("LMSCommit", false)]; + case 1: + _a.sent(); + return [2]; + } }); - if (removeIndex !== -1) { - this_1.listenerArray.splice(removeIndex, 1); - this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); - } - }; - var this_1 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_1 = _loop_1(i); - if (typeof state_1 === "object") - return state_1.value; - } + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE; }; - BaseAPI.prototype.clear = function (listenerName) { - var listenerFunctions = listenerName.split(" "); - var _loop_2 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - this_2.listenerArray = this_2.listenerArray.filter(function (obj) { - return obj.functionName !== functionName && obj.CMIElement !== CMIElement; - }); - }; - var this_2 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } + Scorm12API.prototype.lmsGetLastError = function () { + return this.getLastError("LMSGetLastError"); }; - BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { - this.apiLog(functionName, value, api_constants.global.LOG_LEVEL_INFO, CMIElement); - for (var i = 0; i < this.listenerArray.length; i++) { - var listener = this.listenerArray[i]; - var functionsMatch = listener.functionName === functionName; - var listenerHasCMIElement = !!listener.CMIElement; - var CMIElementsMatch = false; - if (CMIElement && - listener.CMIElement && - listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { - CMIElementsMatch = - CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; - } - else { - CMIElementsMatch = listener.CMIElement === CMIElement; - } - if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { - this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants.global.LOG_LEVEL_INFO, CMIElement); - listener.callback(CMIElement, value); - } - } + Scorm12API.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("LMSGetErrorString", CMIErrorCode); }; - BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { - if (!message) { - message = this.getLmsErrorMessageDetails(errorNumber); - } - this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants.global.LOG_LEVEL_ERROR); - this.lastErrorCode = String(errorNumber); + Scorm12API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); }; - BaseAPI.prototype.clearSCORMError = function (success) { - if (success !== undefined && success !== api_constants.global.SCORM_FALSE) { - this.lastErrorCode = "0"; + Scorm12API.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); + }; + Scorm12API.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("getCMIValue", false, CMIElement); + }; + Scorm12API.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { + if ((0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_5__/* .CMIObjectivesObject */ .N(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsCorrectResponsesObject */ .cb(); } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsObjectivesObject */ .Oh(); + } + else if (!foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsObject */ .WP(); + } + return null; }; - BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { - var _this = this; - if (!CMIElement) { - CMIElement = ""; + Scorm12API.prototype.validateCorrectResponse = function (_CMIElement, _value) { + }; + Scorm12API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = "No Error"; + var detailMessage = "No Error"; + errorNumber = String(errorNumber); + if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber]) { + basicMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].basicMessage; + detailMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].detailMessage; } - if (!this.isNotInitialized()) { - console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); - return; + return detail ? detailMessage : basicMessage; + }; + Scorm12API.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + }; + Scorm12API.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); } - function testPattern(a, c, a_pattern) { - var a_match = a.match(a_pattern); - var c_match; - if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { - var a_num = Number(a_match[2]); - var c_num = Number(c_match[2]); - if (a_num === c_num) { - if (a_match[3] === "id") { - return -1; - } - else if (a_match[3] === "type") { - if (c_match[3] === "id") { - return 1; - } - else { - return -1; - } - } - else { - return 1; + var result = []; + var flattened = _utilities__WEBPACK_IMPORTED_MODULE_2__/* .flatten */ .Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return _utilities__WEBPACK_IMPORTED_MODULE_2__/* .flatten */ .Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); } } - return a_num - c_num; - } - return null; + return result; + case "json": + default: + return cmiExport; } - var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; - var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; - var result = Object.keys(json).map(function (key) { - return [String(key), json[key]]; - }); - result.sort(function (_a, _c) { - var a = _a[0], _b = _a[1]; - var c = _c[0], _d = _c[1]; - var test; - if ((test = testPattern(a, c, int_pattern)) !== null) { - return test; + }; + Scorm12API.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_2__/* .getTimeAsSeconds */ .f4(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.scorm12.CMITimespan); + var lessonStatus = this.cmi.core.lesson_status; + var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.unknown; + var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.unknown; + if (lessonStatus) { + completionStatus = + lessonStatus === "completed" || lessonStatus === "passed" + ? _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.completed + : _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.incomplete; + if (lessonStatus === "passed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.passed; } - if ((test = testPattern(a, c, obj_pattern)) !== null) { - return test; + else if (lessonStatus === "failed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.failed; } - if (a < c) { - return -1; + } + var score = this.cmi.core.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); } - if (a > c) { - return 1; + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); } - return 0; - }); - var obj; - result.forEach(function (element) { - obj = {}; - obj[element[0]] = element[1]; - _this.loadFromJSON(unflatten(obj), CMIElement); - }); - }; - BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { - if (!this.isNotInitialized()) { - console.error("loadFromJSON can only be called before the call to lmsInitialize."); - return; - } - CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; - this.startingData = json; - for (var key in json) { - if ({}.hasOwnProperty.call(json, key) && json[key]) { - var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; - var value = json[key]; - if (value["childArray"]) { - for (var i = 0; i < value["childArray"].length; i++) { - this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); - } - } - else if (value.constructor === Object) { - this.loadFromJSON(value, currentCMIElement); - } - else { - this.setCMIValue(currentCMIElement, value); - } + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); } } - }; - BaseAPI.prototype.renderCMIToJSONString = function () { - var cmi = this.cmi; - if (this.settings.sendFullCommit) { - return JSON.stringify({ cmi: cmi }); + var commitObject = { + successStatus: successStatus, + completionStatus: completionStatus, + runtimeData: cmiExport, + totalTimeSeconds: totalTimeSeconds, + }; + if (scoreObject) { + commitObject.score = scoreObject; } - return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); - }; - BaseAPI.prototype.renderCMIToJSONObject = function () { - return JSON.parse(this.renderCMIToJSONString()); + return commitObject; }; - BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { - return __awaiter(this, arguments, void 0, function (url, params, immediate) { - var api, genericError, process, debouncedProcess; - var _this = this; - if (immediate === void 0) { immediate = false; } - return __generator(this, function (_a) { - switch (_a.label) { + Scorm12API.prototype.storeData = function (terminateCommit) { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var originalStatus, shouldTerminateCommit, commitObject; + var _a, _b, _c; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_d) { + switch (_d.label) { case 0: - api = this; - genericError = { - result: api_constants.global.SCORM_FALSE, - errorCode: this.error_codes.GENERAL, - }; - if (immediate) { - this.performFetch(url, params).then(function (response) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.transformResponse(response)]; - case 1: - _a.sent(); - return [2]; + if (terminateCommit) { + originalStatus = this.cmi.core.lesson_status; + if (!this.cmi.core.lesson_status || + (!this.statusSetByModule && + this.cmi.core.lesson_status === "not attempted")) { + this.cmi.core.lesson_status = "completed"; + } + if (this.cmi.core.lesson_mode === "normal") { + if (this.cmi.core.credit === "credit") { + if (this.settings.mastery_override && + this.cmi.student_data.mastery_score !== "" && + this.cmi.core.score.raw !== "") { + this.cmi.core.lesson_status = + parseFloat(this.cmi.core.score.raw) >= + parseFloat(this.cmi.student_data.mastery_score) + ? "passed" + : "failed"; } - }); - }); }); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - process = function (url, params, settings) { return __awaiter(_this, void 0, void 0, function () { - var response, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - params = settings.requestHandler(params); - return [4, this.performFetch(url, params)]; - case 1: - response = _a.sent(); - return [2, this.transformResponse(response)]; - case 2: - e_1 = _a.sent(); - this.apiLog("processHttpRequest", e_1, api_constants.global.LOG_LEVEL_ERROR); - api.processListeners("CommitError"); - return [2, genericError]; - case 3: return [2]; } - }); - }); }; - if (!this.settings.asyncCommit) return [3, 1]; - debouncedProcess = debounce(process, 500, immediate); - debouncedProcess(url, params, this.settings); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - case 1: return [4, process(url, params, this.settings)]; - case 2: return [2, _a.sent()]; + } + else if (this.cmi.core.lesson_mode === "browse") { + if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && + originalStatus === "not attempted") { + this.cmi.core.lesson_status = "browsed"; + } + } + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: return [2, _d.sent()]; + case 2: return [2, { + result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE, + errorCode: 0, + }]; } }); }); }; - BaseAPI.prototype.scheduleCommit = function (when, callback) { - this._timeout = new ScheduledCommit(this, when, callback); - this.apiLog("scheduleCommit", "scheduled", api_constants.global.LOG_LEVEL_DEBUG, ""); - }; - BaseAPI.prototype.clearScheduledCommit = function () { - if (this._timeout) { - this._timeout.cancel(); - this._timeout = undefined; - this.apiLog("clearScheduledCommit", "cleared", api_constants.global.LOG_LEVEL_DEBUG, ""); - } - }; - BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { - return (Object.hasOwnProperty.call(refObject, attribute) || - Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || - attribute in refObject); - }; - BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { - if (e instanceof ValidationError) { - this.lastErrorCode = String(e.errorCode); - returnValue = api_constants.global.SCORM_FALSE; - } - else { - if (e instanceof Error && e.message) { - console.error(e.message); - } - else { - console.error(e); - } - this.throwSCORMError(this._error_codes.GENERAL); + return Scorm12API; +}(_BaseAPI__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)); +/* harmony default export */ __webpack_exports__["default"] = (Scorm12API); + + +/***/ }), + +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); + + + + +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { + var _this = _super.call(this) || this; + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; + return _this; + } + Object.defineProperty(CMIArray.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIArray.prototype, "_count", { + get: function () { + return this.childArray.length; + }, + set: function (_count) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + CMIArray.prototype.toJSON = function () { + this.jsonString = true; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; } - return returnValue; + delete this.jsonString; + return result; }; - BaseAPI.prototype.performFetch = function (url, params) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, fetch(url, { - method: "POST", - body: params instanceof Array ? params.join("&") : JSON.stringify(params), - headers: __assign(__assign({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), - credentials: this.settings.xhrWithCredentials ? "include" : undefined, - keepalive: true, - })]; - }); - }); + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; + } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseCMI.prototype, "start_time", { + get: function () { + return this._start_time; + }, + enumerable: false, + configurable: true + }); + BaseCMI.prototype.initialize = function () { + this._initialized = true; }; - BaseAPI.prototype.transformResponse = function (response) { - return __awaiter(this, void 0, void 0, function () { - var result, _a; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; - return [4, this.settings.responseHandler(response)]; - case 1: - _a = _c.sent(); - return [3, 4]; - case 2: return [4, response.json()]; - case 3: - _a = _c.sent(); - _c.label = 4; - case 4: - result = _a; - if (response.status >= 200 && - response.status <= 299 && - (result.result === true || - result.result === api_constants.global.SCORM_TRUE)) { - this.processListeners("CommitSuccess"); - } - else { - this.processListeners("CommitError"); - } - return [2, result]; - } - }); - }); + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); }; - return BaseAPI; + return BaseCMI; }()); -/* harmony default export */ var src_BaseAPI = (BaseAPI); -;// ./src/constants/regex.ts +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; +}(BaseCMI)); + + + +/***/ }), + +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { + var _this = _super.call(this) || this; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; + return _this; + } + Object.defineProperty(CMIScore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this.__error_class(this.__invalid_error_code); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "raw", { + get: function () { + return this._raw; + }, + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "min", { + get: function () { + return this._min; + }, + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "max", { + get: function () { + return this._max; + }, + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; + } + }, + enumerable: false, + configurable: true + }); + CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + -var regex_scorm12 = { - CMIString256: "^.{0,255}$", - CMIString4096: "^.{0,4096}$", - CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", - CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", - CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", - CMIFeedback: "^.{0,255}$", - CMIIndex: "[._](\\d+).", - CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", - CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", - CMIExit: "^(time-out|suspend|logout|)$", - CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", - CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", - NAVEvent: "^(previous|continue)$", - score_range: "0#100", - audio_range: "-1#100", - speed_range: "-100#100", - weighting_range: "-100#100", - text_range: "-1#1", -}; -var regex_aicc = __assign(__assign({}, regex_scorm12), { - CMIIdentifier: "^\\w{1,255}$", -}); -var regex_scorm2004 = { - CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", - CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", - CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", - CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", - CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", - CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", - CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", - CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", - CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", - CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", - CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", - CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", - CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", - CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", - CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", - CMIFeedback: "^.*$", - CMIIndex: "[._](\\d+).", - CMIIndexStore: ".N(\\d+).", - CMICStatus: "^(completed|incomplete|not attempted|unknown)$", - CMISStatus: "^(passed|failed|unknown)$", - CMIExit: "^(time-out|suspend|logout|normal)$", - CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", - CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", - NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", - NAVBoolean: "^(unknown|true|false$)", - NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", - scaled_range: "-1#1", - audio_range: "0#*", - speed_range: "0#*", - text_range: "-1#1", - progress_range: "0#1", -}; -var Regex = { - aicc: regex_aicc, - scorm12: regex_scorm12, - scorm2004: regex_scorm2004, -}; -/* harmony default export */ var regex = (Regex); -;// ./src/cmi/common/validation.ts +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { if (typeof value !== "string") { return false; @@ -1998,118 +1479,289 @@ function checkValidRange(value, rangePattern, errorCode, errorClass) { } } -;// ./src/cmi/scorm12/validation.ts +/***/ }), +/***/ 989: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -function check12ValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, error_codes.scorm12.TYPE_MISMATCH, Scorm12ValidationError, allowEmptyString); -} -function check12ValidRange(value, rangePattern, allowEmptyString) { - if (!allowEmptyString && value === "") { - throw new Scorm12ValidationError(error_codes.scorm12.VALUE_OUT_OF_RANGE); - } - return checkValidRange(value, rangePattern, error_codes.scorm12.VALUE_OUT_OF_RANGE, Scorm12ValidationError); -} -;// ./src/cmi/common/score.ts +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Y: function() { return /* binding */ CMI; } +}); +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts +var validation = __webpack_require__(915); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/cmi/aicc/core.ts -var scorm12_constants = api_constants.scorm12; -var scorm12_regex = regex.scorm12; -var score_scorm12_error_codes = error_codes.scorm12; -var CMIScore = (function (_super) { - __extends(CMIScore, _super); - function CMIScore(params) { + + + + +var CMICore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICore, _super); + function CMICore() { var _this = _super.call(this) || this; - _this._raw = ""; - _this._min = ""; - _this.__children = params.score_children || scorm12_constants.score_children; - _this.__score_range = !params.score_range - ? false - : scorm12_regex.score_range; - _this._max = params.max || params.max === "" ? params.max : "100"; - _this.__invalid_error_code = - params.invalidErrorCode || score_scorm12_error_codes.INVALID_SET_VALUE; - _this.__invalid_type_code = - params.invalidTypeCode || score_scorm12_error_codes.TYPE_MISMATCH; - _this.__invalid_range_code = - params.invalidRangeCode || score_scorm12_error_codes.VALUE_OUT_OF_RANGE; - _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; - _this.__error_class = params.errorClass; + _this.__children = api_constants/* default */.A.scorm12.core_children; + _this._student_id = ""; + _this._student_name = ""; + _this._lesson_location = ""; + _this._credit = ""; + _this._lesson_status = "not attempted"; + _this._entry = ""; + _this._total_time = ""; + _this._lesson_mode = "normal"; + _this._exit = ""; + _this._session_time = "00:00:00"; + _this._suspend_data = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.scorm12.score_children, + score_range: regex/* default */.A.scorm12.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* Scorm12ValidationError */.tQ, + }); return _this; } - Object.defineProperty(CMIScore.prototype, "_children", { + CMICore.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMICore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_id", { + get: function () { + return this._student_id; + }, + set: function (student_id) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_id = student_id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_name", { get: function () { - return this.__children; + return this._student_name; }, - set: function (_children) { - throw new this.__error_class(this.__invalid_error_code); + set: function (student_name) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_name = student_name; + } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIScore.prototype, "raw", { + Object.defineProperty(CMICore.prototype, "lesson_location", { get: function () { - return this._raw; + return this._lesson_location; }, - set: function (raw) { - if (checkValidFormat(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._raw = raw; + set: function (lesson_location) { + if ((0,validation/* check12ValidFormat */.p)(lesson_location, regex/* default */.A.scorm12.CMIString256, true)) { + this._lesson_location = lesson_location; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIScore.prototype, "min", { + Object.defineProperty(CMICore.prototype, "credit", { get: function () { - return this._min; + return this._credit; }, - set: function (min) { - if (checkValidFormat(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._min = min; + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._credit = credit; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIScore.prototype, "max", { + Object.defineProperty(CMICore.prototype, "lesson_status", { get: function () { - return this._max; + return this._lesson_status; }, - set: function (max) { - if (checkValidFormat(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._max = max; + set: function (lesson_status) { + if (this.initialized) { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus)) { + this._lesson_status = lesson_status; + } + } + else { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus2)) { + this._lesson_status = lesson_status; + } } }, enumerable: false, configurable: true }); - CMIScore.prototype.toJSON = function () { + Object.defineProperty(CMICore.prototype, "entry", { + get: function () { + return this._entry; + }, + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._entry = entry; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "total_time", { + get: function () { + return this._total_time; + }, + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._total_time = total_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_mode", { + get: function () { + return this._lesson_mode; + }, + set: function (lesson_mode) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._lesson_mode = lesson_mode; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "exit", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._exit; + }, + set: function (exit) { + if ((0,validation/* check12ValidFormat */.p)(exit, regex/* default */.A.scorm12.CMIExit, true)) { + this._exit = exit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "session_time", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._session_time; + }, + set: function (session_time) { + if ((0,validation/* check12ValidFormat */.p)(session_time, regex/* default */.A.scorm12.CMITimespan)) { + this._session_time = session_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "suspend_data", { + get: function () { + return this._suspend_data; + }, + set: function (suspend_data) { + if ((0,validation/* check12ValidFormat */.p)(suspend_data, regex/* default */.A.scorm12.CMIString4096, true)) { + this._suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + CMICore.prototype.getCurrentTotalTime = function (start_time) { + var sessionTime = this._session_time; + var startTime = start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsHHMMSS */.UZ(seconds / 1000); + } + return utilities/* addHHMMSSTimeStrings */.HT(this._total_time, sessionTime, new RegExp(regex/* default */.A.scorm12.CMITimespan)); + }; + CMICore.prototype.toJSON = function () { this.jsonString = true; var result = { - raw: this.raw, - min: this.min, - max: this.max, + student_id: this.student_id, + student_name: this.student_name, + lesson_location: this.lesson_location, + credit: this.credit, + lesson_status: this.lesson_status, + entry: this.entry, + lesson_mode: this.lesson_mode, + exit: this.exit, + session_time: this.session_time, + score: this.score, }; delete this.jsonString; return result; }; - return CMIScore; -}(BaseCMI)); + return CMICore; +}(base_cmi/* BaseCMI */.J)); -;// ./src/cmi/aicc/core.ts +// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts +var objectives = __webpack_require__(176); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var scorm12_student_data = __webpack_require__(532); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +// EXTERNAL MODULE: ./src/cmi/scorm12/interactions.ts +var interactions = __webpack_require__(833); +;// ./src/cmi/scorm12/cmi.ts @@ -2119,241 +1771,462 @@ var CMIScore = (function (_super) { -var CMICore = (function (_super) { - __extends(CMICore, _super); - function CMICore() { + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(cmi_children, student_data, initialized) { var _this = _super.call(this) || this; - _this.__children = api_constants.scorm12.core_children; - _this._student_id = ""; - _this._student_name = ""; - _this._lesson_location = ""; - _this._credit = ""; - _this._lesson_status = "not attempted"; - _this._entry = ""; - _this._total_time = ""; - _this._lesson_mode = "normal"; - _this._exit = ""; - _this._session_time = "00:00:00"; - _this._suspend_data = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, - }); + _this.__children = ""; + _this.__version = "3.4"; + _this._launch_data = ""; + _this._comments = ""; + _this._comments_from_lms = ""; + if (initialized) + _this.initialize(); + _this.__children = cmi_children + ? cmi_children + : api_constants/* default */.A.scorm12.cmi_children; + _this.core = new CMICore(); + _this.objectives = new objectives/* CMIObjectives */.C(); + _this.student_data = student_data ? student_data : new scorm12_student_data/* CMIStudentData */.X(); + _this.student_preference = new student_preference/* CMIStudentPreference */.G(); + _this.interactions = new interactions/* CMIInteractions */.Xb(); return _this; } - CMICore.prototype.initialize = function () { - var _a; + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); }; - Object.defineProperty(CMICore.prototype, "_children", { + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + interactions: this.interactions, + }; + delete this.jsonString; + return result; + }; + Object.defineProperty(CMI.prototype, "_version", { + get: function () { + return this.__version; + }, + set: function (_version) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "_children", { get: function () { return this.__children; }, set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "student_id", { + Object.defineProperty(CMI.prototype, "suspend_data", { get: function () { - return this._student_id; + var _a; + return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; }, - set: function (student_id) { + set: function (suspend_data) { + if (this.core) { + this.core.suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "launch_data", { + get: function () { + return this._launch_data; + }, + set: function (launch_data) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { - this._student_id = student_id; + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments", { + get: function () { + return this._comments; + }, + set: function (comments) { + if ((0,validation/* check12ValidFormat */.p)(comments, regex/* default */.A.scorm12.CMIString4096, true)) { + this._comments = comments; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "student_name", { + Object.defineProperty(CMI.prototype, "comments_from_lms", { get: function () { - return this._student_name; + return this._comments_from_lms; }, - set: function (student_name) { + set: function (comments_from_lms) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { - this._student_name = student_name; + this._comments_from_lms = comments_from_lms; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "lesson_location", { + CMI.prototype.getCurrentTotalTime = function () { + return this.core.getCurrentTotalTime(this.start_time); + }; + return CMI; +}(base_cmi/* BaseRootCMI */.r)); + + + +/***/ }), + +/***/ 833: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Oh: function() { return /* binding */ CMIInteractionsObjectivesObject; }, +/* harmony export */ WP: function() { return /* binding */ CMIInteractionsObject; }, +/* harmony export */ Xb: function() { return /* binding */ CMIInteractions; }, +/* harmony export */ cb: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(784); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417); + + + + + + + + +var CMIInteractions = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.interactions_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIInteractions; +}(_common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B)); + +var CMIInteractionsObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._time = ""; + _this._type = ""; + _this._weighting = ""; + _this._student_response = ""; + _this._result = ""; + _this._latency = ""; + _this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.objectives_children, + }); + _this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.correct_responses_children, + }); + return _this; + } + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { get: function () { - return this._lesson_location; + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._id; }, - set: function (lesson_location) { - if (check12ValidFormat(lesson_location, regex.scorm12.CMIString256, true)) { - this._lesson_location = lesson_location; + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "credit", { + Object.defineProperty(CMIInteractionsObject.prototype, "time", { get: function () { - return this._credit; - }, - set: function (credit) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - else { - this._credit = credit; + return this._time; + }, + set: function (time) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITime)) { + this._time = time; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "lesson_status", { + Object.defineProperty(CMIInteractionsObject.prototype, "type", { get: function () { - return this._lesson_status; - }, - set: function (lesson_status) { - if (this.initialized) { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus)) { - this._lesson_status = lesson_status; - } + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - else { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus2)) { - this._lesson_status = lesson_status; - } + return this._type; + }, + set: function (type) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIType)) { + this._type = type; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "entry", { + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { get: function () { - return this._entry; - }, - set: function (entry) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - else { - this._entry = entry; + return this._weighting; + }, + set: function (weighting) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIDecimal) && + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidRange */ .h)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.weighting_range)) { + this._weighting = weighting; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "total_time", { + Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { get: function () { - return this._total_time; - }, - set: function (total_time) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - else { - this._total_time = total_time; + return this._student_response; + }, + set: function (student_response) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._student_response = student_response; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "lesson_mode", { + Object.defineProperty(CMIInteractionsObject.prototype, "result", { get: function () { - return this._lesson_mode; - }, - set: function (lesson_mode) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - else { - this._lesson_mode = lesson_mode; + return this._result; + }, + set: function (result) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIResult)) { + this._result = result; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "exit", { + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { get: function () { if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - return this._exit; + return this._latency; }, - set: function (exit) { - if (check12ValidFormat(exit, regex.scorm12.CMIExit, true)) { - this._exit = exit; + set: function (latency) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITimespan)) { + this._latency = latency; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "session_time", { + CMIInteractionsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + time: this.time, + type: this.type, + weighting: this.weighting, + student_response: this.student_response, + result: this.result, + latency: this.latency, + objectives: this.objectives, + correct_responses: this.correct_responses, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + return _this; + } + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { get: function () { if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - return this._session_time; + return this._pattern; }, - set: function (session_time) { - if (check12ValidFormat(session_time, regex.scorm12.CMITimespan)) { - this._session_time = session_time; + set: function (pattern) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._pattern = pattern; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "suspend_data", { + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this._pattern, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsCorrectResponsesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 331: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: function() { return /* binding */ NAV; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417); + + + + +var NAV = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(NAV, _super); + function NAV() { + var _this = _super.call(this) || this; + _this._event = ""; + return _this; + } + Object.defineProperty(NAV.prototype, "event", { get: function () { - return this._suspend_data; + return this._event; }, - set: function (suspend_data) { - if (check12ValidFormat(suspend_data, regex.scorm12.CMIString4096, true)) { - this._suspend_data = suspend_data; + set: function (event) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__/* .check12ValidFormat */ .p)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.NAVEvent)) { + this._event = event; } }, enumerable: false, configurable: true }); - CMICore.prototype.getCurrentTotalTime = function (start_time) { - var sessionTime = this._session_time; - var startTime = start_time; - if (typeof startTime !== "undefined" && startTime !== null) { - var seconds = new Date().getTime() - startTime; - sessionTime = getSecondsAsHHMMSS(seconds / 1000); - } - return addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12.CMITimespan)); - }; - CMICore.prototype.toJSON = function () { + NAV.prototype.toJSON = function () { this.jsonString = true; var result = { - student_id: this.student_id, - student_name: this.student_name, - lesson_location: this.lesson_location, - credit: this.credit, - lesson_status: this.lesson_status, - entry: this.entry, - lesson_mode: this.lesson_mode, - exit: this.exit, - session_time: this.session_time, - score: this.score, + event: this.event, }; delete this.jsonString; return result; }; - return CMICore; -}(BaseCMI)); + return NAV; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + +/***/ }), -;// ./src/cmi/scorm12/objectives.ts +/***/ 176: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ CMIObjectives; }, +/* harmony export */ N: function() { return /* binding */ CMIObjectivesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _common_score__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(434); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(784); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589); @@ -2364,30 +2237,30 @@ var CMICore = (function (_super) { var CMIObjectives = (function (_super) { - __extends(CMIObjectives, _super); + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectives, _super); function CMIObjectives() { return _super.call(this, { - children: api_constants.scorm12.objectives_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.objectives_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, }) || this; } return CMIObjectives; -}(CMIArray)); +}(_common_array__WEBPACK_IMPORTED_MODULE_7__/* .CMIArray */ .B)); var CMIObjectivesObject = (function (_super) { - __extends(CMIObjectivesObject, _super); + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectivesObject, _super); function CMIObjectivesObject() { var _this = _super.call(this) || this; _this._id = ""; _this._status = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, + _this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__/* .CMIScore */ ._({ + score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.score_children, + score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.score_range, + invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, + invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, }); return _this; } @@ -2396,7 +2269,7 @@ var CMIObjectivesObject = (function (_super) { return this._id; }, set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIIdentifier)) { this._id = id; } }, @@ -2408,7 +2281,7 @@ var CMIObjectivesObject = (function (_super) { return this._status; }, set: function (status) { - if (check12ValidFormat(status, regex.scorm12.CMIStatus2)) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIStatus2)) { this._status = status; } }, @@ -2426,17 +2299,30 @@ var CMIObjectivesObject = (function (_super) { return result; }; return CMIObjectivesObject; -}(BaseCMI)); +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + +/***/ }), -;// ./src/cmi/scorm12/student_data.ts +/***/ 532: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ X: function() { return /* binding */ CMIStudentData; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); var CMIStudentData = (function (_super) { - __extends(CMIStudentData, _super); + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIStudentData, _super); function CMIStudentData(student_data_children) { var _this = _super.call(this) || this; _this._mastery_score = ""; @@ -2444,7 +2330,7 @@ var CMIStudentData = (function (_super) { _this._time_limit_action = ""; _this.__children = student_data_children ? student_data_children - : api_constants.scorm12.student_data_children; + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_data_children; return _this; } Object.defineProperty(CMIStudentData.prototype, "_children", { @@ -2452,7 +2338,7 @@ var CMIStudentData = (function (_super) { return this.__children; }, set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true @@ -2463,7 +2349,7 @@ var CMIStudentData = (function (_super) { }, set: function (mastery_score) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); } else { this._mastery_score = mastery_score; @@ -2478,7 +2364,7 @@ var CMIStudentData = (function (_super) { }, set: function (max_time_allowed) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); } else { this._max_time_allowed = max_time_allowed; @@ -2493,7 +2379,7 @@ var CMIStudentData = (function (_super) { }, set: function (time_limit_action) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); } else { this._time_limit_action = time_limit_action; @@ -2513,10 +2399,25 @@ var CMIStudentData = (function (_super) { return result; }; return CMIStudentData; -}(BaseCMI)); +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + +/***/ }), -;// ./src/cmi/scorm12/student_preference.ts +/***/ 181: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ G: function() { return /* binding */ CMIStudentPreference; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(417); @@ -2525,7 +2426,7 @@ var CMIStudentData = (function (_super) { var CMIStudentPreference = (function (_super) { - __extends(CMIStudentPreference, _super); + (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(CMIStudentPreference, _super); function CMIStudentPreference(student_preference_children) { var _this = _super.call(this) || this; _this._audio = ""; @@ -2534,7 +2435,7 @@ var CMIStudentPreference = (function (_super) { _this._text = ""; _this.__children = student_preference_children ? student_preference_children - : api_constants.scorm12.student_preference_children; + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_preference_children; return _this; } Object.defineProperty(CMIStudentPreference.prototype, "_children", { @@ -2542,7 +2443,7 @@ var CMIStudentPreference = (function (_super) { return this.__children; }, set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true @@ -2552,8 +2453,8 @@ var CMIStudentPreference = (function (_super) { return this._audio; }, set: function (audio) { - if (check12ValidFormat(audio, regex.scorm12.CMISInteger) && - check12ValidRange(audio, regex.scorm12.audio_range)) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.audio_range)) { this._audio = audio; } }, @@ -2565,7 +2466,7 @@ var CMIStudentPreference = (function (_super) { return this._language; }, set: function (language) { - if (check12ValidFormat(language, regex.scorm12.CMIString256)) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMIString256)) { this._language = language; } }, @@ -2577,8 +2478,8 @@ var CMIStudentPreference = (function (_super) { return this._speed; }, set: function (speed) { - if (check12ValidFormat(speed, regex.scorm12.CMISInteger) && - check12ValidRange(speed, regex.scorm12.speed_range)) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.speed_range)) { this._speed = speed; } }, @@ -2590,8 +2491,8 @@ var CMIStudentPreference = (function (_super) { return this._text; }, set: function (text) { - if (check12ValidFormat(text, regex.scorm12.CMISInteger) && - check12ValidRange(text, regex.scorm12.text_range)) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.text_range)) { this._text = text; } }, @@ -2610,741 +2511,1208 @@ var CMIStudentPreference = (function (_super) { return result; }; return CMIStudentPreference; -}(BaseCMI)); +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 915: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ h: function() { return /* binding */ check12ValidRange; }, +/* harmony export */ p: function() { return /* binding */ check12ValidFormat; } +/* harmony export */ }); +/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784); + + + +function check12ValidFormat(value, regexPattern, allowEmptyString) { + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidFormat */ .q)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ, allowEmptyString); +} +function check12ValidRange(value, rangePattern, allowEmptyString) { + if (!allowEmptyString && value === "") { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE); + } + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidRange */ .W)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ); +} + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + }, + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", + }, + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", + }, + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", + }, + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", + }, + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", + }, + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", + }, + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", + }, + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", + }, + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", + }, + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", + }, + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", + }, + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); + + +/***/ }), + +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +/* unused harmony export NAVBoolean */ +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); + + +/***/ }), + +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); -;// ./src/cmi/scorm12/interactions.ts +/***/ }), +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); +/***/ }), +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ gv: function() { return /* binding */ AICCValidationError; }, +/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* unused harmony export Scorm2004ValidationError */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); -var CMIInteractions = (function (_super) { - __extends(CMIInteractions, _super); - function CMIInteractions() { - return _super.call(this, { - children: api_constants.scorm12.interactions_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - }) || this; - } - return CMIInteractions; -}(CMIArray)); -var CMIInteractionsObject = (function (_super) { - __extends(CMIInteractionsObject, _super); - function CMIInteractionsObject() { - var _this = _super.call(this) || this; - _this._id = ""; - _this._time = ""; - _this._type = ""; - _this._weighting = ""; - _this._student_response = ""; - _this._result = ""; - _this._latency = ""; - _this.objectives = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.objectives_children, - }); - _this.correct_responses = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.correct_responses_children, - }); +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; return _this; } - CMIInteractionsObject.prototype.initialize = function () { - var _a, _b; - _super.prototype.initialize.call(this); - (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); - }; - Object.defineProperty(CMIInteractionsObject.prototype, "id", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._id; - }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "time", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._time; - }, - set: function (time) { - if (check12ValidFormat(time, regex.scorm12.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "type", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._type; - }, - set: function (type) { - if (check12ValidFormat(type, regex.scorm12.CMIType)) { - this._type = type; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._weighting; - }, - set: function (weighting) { - if (check12ValidFormat(weighting, regex.scorm12.CMIDecimal) && - check12ValidRange(weighting, regex.scorm12.weighting_range)) { - this._weighting = weighting; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._student_response; - }, - set: function (student_response) { - if (check12ValidFormat(student_response, regex.scorm12.CMIFeedback, true)) { - this._student_response = student_response; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "result", { + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._result; - }, - set: function (result) { - if (check12ValidFormat(result, regex.scorm12.CMIResult)) { - this._result = result; - } + return this._errorCode; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; + }; + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; + } + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._latency; - }, - set: function (latency) { - if (check12ValidFormat(latency, regex.scorm12.CMITimespan)) { - this._latency = latency; - } + return this._errorMessage; }, enumerable: false, configurable: true }); - CMIInteractionsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - time: this.time, - type: this.type, - weighting: this.weighting, - student_response: this.student_response, - result: this.result, - latency: this.latency, - objectives: this.objectives, - correct_responses: this.correct_responses, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObject; -}(BaseCMI)); - -var CMIInteractionsObjectivesObject = (function (_super) { - __extends(CMIInteractionsObjectivesObject, _super); - function CMIInteractionsObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; - return _this; - } - Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + Object.defineProperty(ValidationError.prototype, "detailedMessage", { get: function () { - return this._id; - }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } + return this._detailedMessage; }, enumerable: false, configurable: true }); - CMIInteractionsObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObjectivesObject; -}(BaseCMI)); + return ValidationError; +}(BaseScormValidationError)); -var CMIInteractionsCorrectResponsesObject = (function (_super) { - __extends(CMIInteractionsCorrectResponsesObject, _super); - function CMIInteractionsCorrectResponsesObject() { - var _this = _super.call(this) || this; - _this._pattern = ""; +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + } return _this; } - Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + } + return _this; + } + return AICCValidationError; +}(ValidationError)); + +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ HT: function() { return /* binding */ addHHMMSSTimeStrings; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ UZ: function() { return /* binding */ getSecondsAsHHMMSS; }, +/* harmony export */ f4: function() { return /* binding */ getTimeAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); + } + else { + msStr = String(ms); + } + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); + } + if (designationsKey === "S" && remainder > 0) { + value += remainder; + } + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; } - return this._pattern; - }, - set: function (pattern) { - if (check12ValidFormat(pattern, regex.scorm12.CMIFeedback, true)) { - this._pattern = pattern; + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - pattern: this._pattern, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsCorrectResponsesObject; -}(BaseCMI)); + } + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); + } + } + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); + } + cur[prop] = data[p]; + } + } + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; + } + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} -;// ./src/cmi/scorm12/cmi.ts +/***/ }), +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; -var CMI = (function (_super) { - __extends(CMI, _super); - function CMI(cmi_children, student_data, initialized) { - var _this = _super.call(this) || this; - _this.__children = ""; - _this.__version = "3.4"; - _this._launch_data = ""; - _this._comments = ""; - _this._comments_from_lms = ""; - if (initialized) - _this.initialize(); - _this.__children = cmi_children - ? cmi_children - : api_constants.scorm12.cmi_children; - _this.core = new CMICore(); - _this.objectives = new CMIObjectives(); - _this.student_data = student_data ? student_data : new CMIStudentData(); - _this.student_preference = new CMIStudentPreference(); - _this.interactions = new CMIInteractions(); - return _this; - } - CMI.prototype.initialize = function () { - var _a, _b, _c, _d, _e; - _super.prototype.initialize.call(this); - (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); - (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); - (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); - (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); - }; - CMI.prototype.toJSON = function () { - this.jsonString = true; - var result = { - suspend_data: this.suspend_data, - launch_data: this.launch_data, - comments: this.comments, - comments_from_lms: this.comments_from_lms, - core: this.core, - objectives: this.objectives, - student_data: this.student_data, - student_preference: this.student_preference, - interactions: this.interactions, - }; - delete this.jsonString; - return result; - }; - Object.defineProperty(CMI.prototype, "_version", { - get: function () { - return this.__version; - }, - set: function (_version) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "suspend_data", { - get: function () { - var _a; - return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; - }, - set: function (suspend_data) { - if (this.core) { - this.core.suspend_data = suspend_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "launch_data", { - get: function () { - return this._launch_data; - }, - set: function (launch_data) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._launch_data = launch_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "comments", { - get: function () { - return this._comments; - }, - set: function (comments) { - if (check12ValidFormat(comments, regex.scorm12.CMIString4096, true)) { - this._comments = comments; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "comments_from_lms", { - get: function () { - return this._comments_from_lms; - }, - set: function (comments_from_lms) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._comments_from_lms = comments_from_lms; - } - }, - enumerable: false, - configurable: true - }); - CMI.prototype.getCurrentTotalTime = function () { - return this.core.getCurrentTotalTime(this.start_time); - }; - return CMI; -}(BaseRootCMI)); +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); -;// ./src/cmi/scorm12/nav.ts +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} -var NAV = (function (_super) { - __extends(NAV, _super); - function NAV() { - var _this = _super.call(this) || this; - _this._event = ""; - return _this; - } - Object.defineProperty(NAV.prototype, "event", { - get: function () { - return this._event; - }, - set: function (event) { - if (check12ValidFormat(event, regex.scorm12.NAVEvent)) { - this._event = event; - } - }, - enumerable: false, - configurable: true - }); - NAV.prototype.toJSON = function () { - this.jsonString = true; - var result = { - event: this.event, - }; - delete this.jsonString; - return result; - }; - return NAV; -}(BaseCMI)); +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} -;// ./src/constants/enums.ts -var NAVBoolean; -(function (NAVBoolean) { - NAVBoolean["unknown"] = "unknown"; - NAVBoolean["true"] = "true"; - NAVBoolean["false"] = "false"; -})(NAVBoolean || (NAVBoolean = {})); -var SuccessStatus; -(function (SuccessStatus) { - SuccessStatus["passed"] = "passed"; - SuccessStatus["failed"] = "failed"; - SuccessStatus["unknown"] = "unknown"; -})(SuccessStatus || (SuccessStatus = {})); -var CompletionStatus; -(function (CompletionStatus) { - CompletionStatus["completed"] = "completed"; - CompletionStatus["incomplete"] = "incomplete"; - CompletionStatus["unknown"] = "unknown"; -})(CompletionStatus || (CompletionStatus = {})); +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} -;// ./src/Scorm12API.ts +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); -var Scorm12API = (function (_super) { - __extends(Scorm12API, _super); - function Scorm12API(settings) { - var _this = this; - if (settings) { - if (settings.mastery_override === undefined) { - settings.mastery_override = false; - } - } - _this = _super.call(this, error_codes.scorm12, settings) || this; - _this.statusSetByModule = false; - _this.cmi = new CMI(); - _this.nav = new NAV(); - _this.LMSInitialize = _this.lmsInitialize; - _this.LMSFinish = _this.lmsFinish; - _this.LMSGetValue = _this.lmsGetValue; - _this.LMSSetValue = _this.lmsSetValue; - _this.LMSCommit = _this.lmsCommit; - _this.LMSGetLastError = _this.lmsGetLastError; - _this.LMSGetErrorString = _this.lmsGetErrorString; - _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; - return _this; - } - Scorm12API.prototype.reset = function (settings) { - this.commonReset(settings); - this.cmi = new CMI(); - this.nav = new NAV(); - }; - Scorm12API.prototype.lmsInitialize = function () { - this.cmi.initialize(); - if (this.cmi.core.lesson_status) { - this.statusSetByModule = true; - } - else { - this.cmi.core.lesson_status = "not attempted"; - } - return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); - }; - Scorm12API.prototype.lmsFinish = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.internalFinish()]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm12API.prototype.internalFinish = function () { - return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.terminate("LMSFinish", true)]; - case 1: - result = _a.sent(); - if (result === api_constants.global.SCORM_TRUE) { - if (this.nav.event !== "") { - if (this.nav.event === "continue") { - this.processListeners("SequenceNext"); - } - else { - this.processListeners("SequencePrevious"); - } - } - else if (this.settings.autoProgress) { - this.processListeners("SequenceNext"); - } - } - return [2, result]; - } - }); - }); - }; - Scorm12API.prototype.lmsGetValue = function (CMIElement) { - return this.getValue("LMSGetValue", false, CMIElement); - }; - Scorm12API.prototype.lmsSetValue = function (CMIElement, value) { - if (CMIElement === "cmi.core.lesson_status") { - this.statusSetByModule = true; - } - return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); - }; - Scorm12API.prototype.lmsCommit = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.commit("LMSCommit", false)]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm12API.prototype.lmsGetLastError = function () { - return this.getLastError("LMSGetLastError"); - }; - Scorm12API.prototype.lmsGetErrorString = function (CMIErrorCode) { - return this.getErrorString("LMSGetErrorString", CMIErrorCode); - }; - Scorm12API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { - return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); - }; - Scorm12API.prototype.setCMIValue = function (CMIElement, value) { - return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); - }; - Scorm12API.prototype.getCMIValue = function (CMIElement) { - return this._commonGetCMIValue("getCMIValue", false, CMIElement); - }; - Scorm12API.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.objectives\\.\\d+")) { - return new CMIObjectivesObject(); - } - else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { - return new CMIInteractionsCorrectResponsesObject(); - } - else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { - return new CMIInteractionsObjectivesObject(); - } - else if (!foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+")) { - return new CMIInteractionsObject(); - } - return null; - }; - Scorm12API.prototype.validateCorrectResponse = function (_CMIElement, _value) { - }; - Scorm12API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { - var basicMessage = "No Error"; - var detailMessage = "No Error"; - errorNumber = String(errorNumber); - if (api_constants.scorm12.error_descriptions[errorNumber]) { - basicMessage = - api_constants.scorm12.error_descriptions[errorNumber].basicMessage; - detailMessage = - api_constants.scorm12.error_descriptions[errorNumber].detailMessage; - } - return detail ? detailMessage : basicMessage; - }; - Scorm12API.prototype.replaceWithAnotherScormAPI = function (newAPI) { - this.cmi = newAPI.cmi; - }; - Scorm12API.prototype.renderCommitCMI = function (terminateCommit) { - var cmiExport = this.renderCMIToJSONObject(); - if (terminateCommit) { - cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); - } - var result = []; - var flattened = flatten(cmiExport); - switch (this.settings.dataCommitFormat) { - case "flattened": - return flatten(cmiExport); - case "params": - for (var item in flattened) { - if ({}.hasOwnProperty.call(flattened, item)) { - result.push("".concat(item, "=").concat(flattened[item])); - } - } - return result; - case "json": - default: - return cmiExport; - } - }; - Scorm12API.prototype.renderCommitObject = function (terminateCommit) { - var cmiExport = this.renderCommitCMI(terminateCommit); - var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); - var totalTimeSeconds = getTimeAsSeconds(totalTimeHHMMSS, regex.scorm12.CMITimespan); - var lessonStatus = this.cmi.core.lesson_status; - var completionStatus = CompletionStatus.unknown; - var successStatus = SuccessStatus.unknown; - if (lessonStatus) { - completionStatus = - lessonStatus === "completed" || lessonStatus === "passed" - ? CompletionStatus.completed - : CompletionStatus.incomplete; - if (lessonStatus === "passed") { - successStatus = SuccessStatus.passed; - } - else if (lessonStatus === "failed") { - successStatus = SuccessStatus.failed; - } - } - var score = this.cmi.core.score; - var scoreObject = null; - if (score) { - scoreObject = {}; - if (!Number.isNaN(Number.parseFloat(score.raw))) { - scoreObject.raw = Number.parseFloat(score.raw); - } - if (!Number.isNaN(Number.parseFloat(score.min))) { - scoreObject.min = Number.parseFloat(score.min); - } - if (!Number.isNaN(Number.parseFloat(score.max))) { - scoreObject.max = Number.parseFloat(score.max); - } - } - var commitObject = { - successStatus: successStatus, - completionStatus: completionStatus, - runtimeData: cmiExport, - totalTimeSeconds: totalTimeSeconds, - }; - if (scoreObject) { - commitObject.score = scoreObject; - } - return commitObject; - }; - Scorm12API.prototype.storeData = function (terminateCommit) { - return __awaiter(this, void 0, void 0, function () { - var originalStatus, shouldTerminateCommit, commitObject; - var _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - if (terminateCommit) { - originalStatus = this.cmi.core.lesson_status; - if (!this.cmi.core.lesson_status || - (!this.statusSetByModule && - this.cmi.core.lesson_status === "not attempted")) { - this.cmi.core.lesson_status = "completed"; - } - if (this.cmi.core.lesson_mode === "normal") { - if (this.cmi.core.credit === "credit") { - if (this.settings.mastery_override && - this.cmi.student_data.mastery_score !== "" && - this.cmi.core.score.raw !== "") { - this.cmi.core.lesson_status = - parseFloat(this.cmi.core.score.raw) >= - parseFloat(this.cmi.student_data.mastery_score) - ? "passed" - : "failed"; - } - } - } - else if (this.cmi.core.lesson_mode === "browse") { - if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && - originalStatus === "not attempted") { - this.cmi.core.lesson_status = "browsed"; - } - } - } - shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; - commitObject = this.settings.renderCommonCommitFields - ? this.renderCommitObject(shouldTerminateCommit) - : this.renderCommitCMI(shouldTerminateCommit); - if (this.apiLogLevel === api_constants.global.LOG_LEVEL_DEBUG) { - console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); - console.debug(commitObject); - } - if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; - return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; - case 1: return [2, _d.sent()]; - case 2: return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - }); - }); - }; - return Scorm12API; -}(src_BaseAPI)); -/* harmony default export */ var src_Scorm12API = (Scorm12API); +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* binding */ src_AICC; } +}); +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/Scorm12API.ts +var Scorm12API = __webpack_require__(941); +// EXTERNAL MODULE: ./src/cmi/scorm12/cmi.ts + 1 modules +var cmi = __webpack_require__(989); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); ;// ./src/cmi/aicc/validation.ts -var aicc_error_codes = error_codes.scorm12; +var aicc_error_codes = error_codes/* default */.A.scorm12; function checkAICCValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, AICCValidationError, allowEmptyString); + return (0,validation/* checkValidFormat */.q)(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, exceptions/* AICCValidationError */.gv, allowEmptyString); } +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); ;// ./src/cmi/aicc/evaluation.ts @@ -3355,7 +3723,7 @@ function checkAICCValidFormat(value, regexPattern, allowEmptyString) { var CMIEvaluation = (function (_super) { - __extends(CMIEvaluation, _super); + (0,tslib_es6/* __extends */.C6)(CMIEvaluation, _super); function CMIEvaluation() { var _this = _super.call(this) || this; _this.comments = new CMIEvaluationComments(); @@ -3375,21 +3743,21 @@ var CMIEvaluation = (function (_super) { return result; }; return CMIEvaluation; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); var CMIEvaluationComments = (function (_super) { - __extends(CMIEvaluationComments, _super); + (0,tslib_es6/* __extends */.C6)(CMIEvaluationComments, _super); function CMIEvaluationComments() { return _super.call(this, { - children: api_constants.aicc.comments_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: AICCValidationError, + children: api_constants/* default */.A.aicc.comments_children, + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, }) || this; } return CMIEvaluationComments; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMIEvaluationCommentsObject = (function (_super) { - __extends(CMIEvaluationCommentsObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIEvaluationCommentsObject, _super); function CMIEvaluationCommentsObject() { var _this = _super.call(this) || this; _this._content = ""; @@ -3402,7 +3770,7 @@ var CMIEvaluationCommentsObject = (function (_super) { return this._content; }, set: function (content) { - if (checkAICCValidFormat(content, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(content, regex/* default */.A.aicc.CMIString256)) { this._content = content; } }, @@ -3414,7 +3782,7 @@ var CMIEvaluationCommentsObject = (function (_super) { return this._location; }, set: function (location) { - if (checkAICCValidFormat(location, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(location, regex/* default */.A.aicc.CMIString256)) { this._location = location; } }, @@ -3426,7 +3794,7 @@ var CMIEvaluationCommentsObject = (function (_super) { return this._time; }, set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { this._time = time; } }, @@ -3444,9 +3812,11 @@ var CMIEvaluationCommentsObject = (function (_super) { return result; }; return CMIEvaluationCommentsObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); ;// ./src/cmi/aicc/student_preferences.ts @@ -3457,17 +3827,17 @@ var CMIEvaluationCommentsObject = (function (_super) { var AICCStudentPreferences = (function (_super) { - __extends(AICCStudentPreferences, _super); + (0,tslib_es6/* __extends */.C6)(AICCStudentPreferences, _super); function AICCStudentPreferences() { - var _this = _super.call(this, api_constants.aicc.student_preference_children) || this; + var _this = _super.call(this, api_constants/* default */.A.aicc.student_preference_children) || this; _this._lesson_type = ""; _this._text_color = ""; _this._text_location = ""; _this._text_size = ""; _this._video = ""; - _this.windows = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: AICCValidationError, + _this.windows = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, children: "", }); return _this; @@ -3482,7 +3852,7 @@ var AICCStudentPreferences = (function (_super) { return this._lesson_type; }, set: function (lesson_type) { - if (checkAICCValidFormat(lesson_type, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(lesson_type, regex/* default */.A.aicc.CMIString256)) { this._lesson_type = lesson_type; } }, @@ -3494,7 +3864,7 @@ var AICCStudentPreferences = (function (_super) { return this._text_color; }, set: function (text_color) { - if (checkAICCValidFormat(text_color, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(text_color, regex/* default */.A.aicc.CMIString256)) { this._text_color = text_color; } }, @@ -3506,7 +3876,7 @@ var AICCStudentPreferences = (function (_super) { return this._text_location; }, set: function (text_location) { - if (checkAICCValidFormat(text_location, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(text_location, regex/* default */.A.aicc.CMIString256)) { this._text_location = text_location; } }, @@ -3518,7 +3888,7 @@ var AICCStudentPreferences = (function (_super) { return this._text_size; }, set: function (text_size) { - if (checkAICCValidFormat(text_size, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(text_size, regex/* default */.A.aicc.CMIString256)) { this._text_size = text_size; } }, @@ -3530,7 +3900,7 @@ var AICCStudentPreferences = (function (_super) { return this._video; }, set: function (video) { - if (checkAICCValidFormat(video, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(video, regex/* default */.A.aicc.CMIString256)) { this._video = video; } }, @@ -3555,7 +3925,7 @@ var AICCStudentPreferences = (function (_super) { return result; }; return AICCStudentPreferences; -}(CMIStudentPreference)); +}(student_preference/* CMIStudentPreference */.G)); ;// ./src/cmi/aicc/student_demographics.ts @@ -3565,10 +3935,10 @@ var AICCStudentPreferences = (function (_super) { var CMIStudentDemographics = (function (_super) { - __extends(CMIStudentDemographics, _super); + (0,tslib_es6/* __extends */.C6)(CMIStudentDemographics, _super); function CMIStudentDemographics() { var _this = _super.call(this) || this; - _this.__children = api_constants.aicc.student_demographics_children; + _this.__children = api_constants/* default */.A.aicc.student_demographics_children; _this._city = ""; _this._class = ""; _this._company = ""; @@ -3597,7 +3967,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (city) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._city = city; @@ -3612,7 +3982,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (clazz) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._class = clazz; @@ -3627,7 +3997,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (company) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._company = company; @@ -3642,7 +4012,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (country) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._country = country; @@ -3657,7 +4027,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (experience) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._experience = experience; @@ -3672,7 +4042,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (familiar_name) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._familiar_name = familiar_name; @@ -3687,7 +4057,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (instructor_name) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._instructor_name = instructor_name; @@ -3702,7 +4072,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (title) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._title = title; @@ -3717,7 +4087,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (native_language) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._native_language = native_language; @@ -3732,7 +4102,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (state) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._state = state; @@ -3747,7 +4117,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (street_address) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._street_address = street_address; @@ -3762,7 +4132,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (telephone) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._telephone = telephone; @@ -3777,7 +4147,7 @@ var CMIStudentDemographics = (function (_super) { }, set: function (years_experience) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._years_experience = years_experience; @@ -3807,9 +4177,11 @@ var CMIStudentDemographics = (function (_super) { return result; }; return CMIStudentDemographics; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); ;// ./src/cmi/aicc/tries.ts @@ -3821,28 +4193,28 @@ var CMIStudentDemographics = (function (_super) { var CMITries = (function (_super) { - __extends(CMITries, _super); + (0,tslib_es6/* __extends */.C6)(CMITries, _super); function CMITries() { return _super.call(this, { - children: api_constants.aicc.tries_children, + children: api_constants/* default */.A.aicc.tries_children, }) || this; } return CMITries; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMITriesObject = (function (_super) { - __extends(CMITriesObject, _super); + (0,tslib_es6/* __extends */.C6)(CMITriesObject, _super); function CMITriesObject() { var _this = _super.call(this) || this; _this._status = ""; _this._time = ""; - _this.score = new CMIScore({ - score_children: api_constants.aicc.score_children, - score_range: regex.aicc.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: AICCValidationError, + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, }); return _this; } @@ -3856,7 +4228,7 @@ var CMITriesObject = (function (_super) { return this._status; }, set: function (status) { - if (checkAICCValidFormat(status, regex.aicc.CMIStatus2)) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { this._status = status; } }, @@ -3868,7 +4240,7 @@ var CMITriesObject = (function (_super) { return this._time; }, set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { this._time = time; } }, @@ -3886,9 +4258,11 @@ var CMITriesObject = (function (_super) { return result; }; return CMITriesObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var student_data = __webpack_require__(532); ;// ./src/cmi/aicc/attempts.ts @@ -3900,27 +4274,27 @@ var CMITriesObject = (function (_super) { var CMIAttemptRecords = (function (_super) { - __extends(CMIAttemptRecords, _super); + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecords, _super); function CMIAttemptRecords() { return _super.call(this, { - children: api_constants.aicc.attempt_records_children, + children: api_constants/* default */.A.aicc.attempt_records_children, }) || this; } return CMIAttemptRecords; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMIAttemptRecordsObject = (function (_super) { - __extends(CMIAttemptRecordsObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecordsObject, _super); function CMIAttemptRecordsObject() { var _this = _super.call(this) || this; _this._lesson_status = ""; - _this.score = new CMIScore({ - score_children: api_constants.aicc.score_children, - score_range: regex.aicc.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: AICCValidationError, + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, }); return _this; } @@ -3934,7 +4308,7 @@ var CMIAttemptRecordsObject = (function (_super) { return this._lesson_status; }, set: function (lesson_status) { - if (checkAICCValidFormat(lesson_status, regex.aicc.CMIStatus2)) { + if (checkAICCValidFormat(lesson_status, regex/* default */.A.aicc.CMIStatus2)) { this._lesson_status = lesson_status; } }, @@ -3951,7 +4325,7 @@ var CMIAttemptRecordsObject = (function (_super) { return result; }; return CMIAttemptRecordsObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); ;// ./src/cmi/aicc/student_data.ts @@ -3963,9 +4337,9 @@ var CMIAttemptRecordsObject = (function (_super) { var AICCCMIStudentData = (function (_super) { - __extends(AICCCMIStudentData, _super); + (0,tslib_es6/* __extends */.C6)(AICCCMIStudentData, _super); function AICCCMIStudentData() { - var _this = _super.call(this, api_constants.aicc.student_data_children) || this; + var _this = _super.call(this, api_constants/* default */.A.aicc.student_data_children) || this; _this._tries_during_lesson = ""; _this.tries = new CMITries(); _this.attempt_records = new CMIAttemptRecords(); @@ -3983,7 +4357,7 @@ var AICCCMIStudentData = (function (_super) { }, set: function (tries_during_lesson) { if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { this._tries_during_lesson = tries_during_lesson; @@ -4005,7 +4379,7 @@ var AICCCMIStudentData = (function (_super) { return result; }; return AICCCMIStudentData; -}(CMIStudentData)); +}(student_data/* CMIStudentData */.X)); ;// ./src/cmi/aicc/paths.ts @@ -4016,17 +4390,17 @@ var AICCCMIStudentData = (function (_super) { var CMIPaths = (function (_super) { - __extends(CMIPaths, _super); + (0,tslib_es6/* __extends */.C6)(CMIPaths, _super); function CMIPaths() { return _super.call(this, { - children: api_constants.aicc.paths_children, + children: api_constants/* default */.A.aicc.paths_children, }) || this; } return CMIPaths; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMIPathsObject = (function (_super) { - __extends(CMIPathsObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIPathsObject, _super); function CMIPathsObject() { var _this = _super.call(this) || this; _this._location_id = ""; @@ -4042,7 +4416,7 @@ var CMIPathsObject = (function (_super) { return this._location_id; }, set: function (location_id) { - if (checkAICCValidFormat(location_id, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(location_id, regex/* default */.A.aicc.CMIString256)) { this._location_id = location_id; } }, @@ -4054,7 +4428,7 @@ var CMIPathsObject = (function (_super) { return this._date; }, set: function (date) { - if (checkAICCValidFormat(date, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(date, regex/* default */.A.aicc.CMIString256)) { this._date = date; } }, @@ -4066,7 +4440,7 @@ var CMIPathsObject = (function (_super) { return this._time; }, set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { this._time = time; } }, @@ -4078,7 +4452,7 @@ var CMIPathsObject = (function (_super) { return this._status; }, set: function (status) { - if (checkAICCValidFormat(status, regex.aicc.CMIStatus2)) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { this._status = status; } }, @@ -4090,7 +4464,7 @@ var CMIPathsObject = (function (_super) { return this._why_left; }, set: function (why_left) { - if (checkAICCValidFormat(why_left, regex.aicc.CMIString256)) { + if (checkAICCValidFormat(why_left, regex/* default */.A.aicc.CMIString256)) { this._why_left = why_left; } }, @@ -4102,7 +4476,7 @@ var CMIPathsObject = (function (_super) { return this._time_in_element; }, set: function (time_in_element) { - if (checkAICCValidFormat(time_in_element, regex.aicc.CMITime)) { + if (checkAICCValidFormat(time_in_element, regex/* default */.A.aicc.CMITime)) { this._time_in_element = time_in_element; } }, @@ -4123,7 +4497,7 @@ var CMIPathsObject = (function (_super) { return result; }; return CMIPathsObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); ;// ./src/cmi/aicc/cmi.ts @@ -4135,11 +4509,11 @@ var CMIPathsObject = (function (_super) { -var cmi_CMI = (function (_super) { - __extends(CMI, _super); +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); function CMI(initialized) { if (initialized === void 0) { initialized = false; } - var _this = _super.call(this, api_constants.aicc.cmi_children) || this; + var _this = _super.call(this, api_constants/* default */.A.aicc.cmi_children) || this; if (initialized) _this.initialize(); _this.student_preference = new AICCStudentPreferences(); @@ -4178,9 +4552,13 @@ var cmi_CMI = (function (_super) { return result; }; return CMI; -}(CMI)); +}(cmi/* CMI */.Y)); +// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts +var nav = __webpack_require__(331); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); ;// ./src/AICC.ts @@ -4192,26 +4570,26 @@ var cmi_CMI = (function (_super) { var AICC = (function (_super) { - __extends(AICC, _super); + (0,tslib_es6/* __extends */.C6)(AICC, _super); function AICC(settings) { var _this = _super.call(this, settings) || this; - _this.cmi = new cmi_CMI(); - _this.nav = new NAV(); + _this.cmi = new CMI(); + _this.nav = new nav/* NAV */.A(); return _this; } AICC.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex); if (!newChild) { - if (stringMatches(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) { newChild = new CMIEvaluationCommentsObject(); } - else if (stringMatches(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) { + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) { newChild = new CMITriesObject(); } - else if (stringMatches(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) { + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) { newChild = new CMIAttemptRecordsObject(); } - else if (stringMatches(CMIElement, "cmi\\.paths\\.\\d+")) { + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.paths\\.\\d+")) { newChild = new CMIPathsObject(); } } @@ -4222,14 +4600,9 @@ var AICC = (function (_super) { this.nav = newAPI.nav; }; return AICC; -}(src_Scorm12API)); +}(Scorm12API["default"])); /* harmony default export */ var src_AICC = (AICC); -;// ./src/exports/aicc.js - - -window.AICC = src_AICC; - /******/ return __webpack_exports__; /******/ })() ; diff --git a/dist/aicc.js.map b/dist/aicc.js.map index 6aa62a6..f1686a3 100644 --- a/dist/aicc.js.map +++ b/dist/aicc.js.map @@ -1 +1 @@ -{"version":3,"file":"aicc.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;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AG,EAAE,CAAC;;IACvB,CAAC;IAUD,8BAAe,GAAf,UACE,UAAkB,EAClB,KAAU,EACV,eAAwB;QAExB,IAAI,QAAQ,GAAG,gBAAK,CAAC,eAAe,YAAC,UAAU,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;QAEzE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAI,aAAa,CAAC,UAAU,EAAE,oCAAoC,CAAC,EAAE,CAAC;gBACpE,QAAQ,GAAG,IAAI,2BAA2B,EAAE,CAAC;YAC/C,CAAC;iBAAM,IACL,aAAa,CAAC,UAAU,EAAE,mCAAmC,CAAC,EAC9D,CAAC;gBACD,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;YAClC,CAAC;iBAAM,IACL,aAAa,CAAC,UAAU,EAAE,6CAA6C,CAAC,EACxE,CAAC;gBACD,QAAQ,GAAG,IAAI,uBAAuB,EAAE,CAAC;YAC3C,CAAC;iBAAM,IAAI,aAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAE,CAAC;gBAC3D,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAOD,yCAA0B,GAA1B,UAA2B,MAAY;QAErC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACxB,CAAC;IACH,WAAC;AAAD,CAAC,CAxDiC,cAAU,GAwD3C;;;;ACvE6B;;AAE9B,cAAc,QAAI","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts","webpack://scorm-again/./src/exports/aicc.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n","import AICC from \"../AICC.ts\";\n\nwindow.AICC = AICC;\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"aicc.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;ACFO,SAAS,QAAQ,CACtB,IAAO,EACP,IAAY,EACZ,SAAiB;IAAjB,6CAAiB;IAEjB,IAAI,OAA6C,CAAC;IAElD,OAAO;QAAqB,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC;QAErB,IAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEF,IAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QAEtC,IAAI,OAAO;YAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAElC,IAAI,OAAO;YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC;;;;AC7B0C;AAKpC,IAAM,eAAe,GAAa;IACvC,UAAU,EAAE,KAAK;IACjB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,IAAI;I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BAAoB,uCAAuC,kBAAkB;AAClI;;AAEO;AACP;AACA;AACA,yGAAyG,uFAAuF,cAAc;AAC9M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;UCzXF;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,QAAmB;QAC7B,kBAAK,YAAC,QAAQ,CAAC,SAAC;QAEhB,KAAI,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;QACrB,KAAI,CAAC,GAAG,GAAG,IAAI,cAAG,EAAE,CAAC;;IACvB,CAAC;IAUD,8BAAe,GAAf,UACE,UAAkB,EAClB,KAAU,EACV,eAAwB;QAExB,IAAI,QAAQ,GAAG,gBAAK,CAAC,eAAe,YAAC,UAAU,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;QAEzE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAI,mCAAa,CAAC,UAAU,EAAE,oCAAoC,CAAC,EAAE,CAAC;gBACpE,QAAQ,GAAG,IAAI,2BAA2B,EAAE,CAAC;YAC/C,CAAC;iBAAM,IACL,mCAAa,CAAC,UAAU,EAAE,mCAAmC,CAAC,EAC9D,CAAC;gBACD,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;YAClC,CAAC;iBAAM,IACL,mCAAa,CAAC,UAAU,EAAE,6CAA6C,CAAC,EACxE,CAAC;gBACD,QAAQ,GAAG,IAAI,uBAAuB,EAAE,CAAC;YAC3C,CAAC;iBAAM,IAAI,mCAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAE,CAAC;gBAC3D,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAOD,yCAA0B,GAA1B,UAA2B,MAAY;QAErC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACxB,CAAC;IACH,WAAC;AAAD,CAAC,CAxDiC,qBAAU,GAwD3C","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/aicc.min.js b/dist/aicc.min.js index 8627d4d..0d76ddf 100644 --- a/dist/aicc.min.js +++ b/dist/aicc.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,r=arguments.length;i0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&(s="."+(s=S(o)>2?o.toFixed(2):String(o)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+s}function I(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function O(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=i(i({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return r(this,void 0,void 0,(function(){var i,r;return n(this,(function(n){switch(n.label){case 0:return i=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=u.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:u.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=u.global.SCORM_TRUE,this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,u.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=u.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=u.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,u.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return r(this,arguments,void 0,(function(e,t){var i,r;return void 0===t&&(t=!1),n(this,(function(n){switch(n.label){case 0:return this.clearScheduledCommit(),i=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:u.global.SCORM_FALSE,this.apiLog(e," Result: "+i,u.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,u.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,n){if(!r||""===r)return u.global.SCORM_FALSE;for(var o=r.split("."),s=this,a=u.global.SCORM_FALSE,c=!1,l="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),_=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,d=0;d1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),u.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),u.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){for(var n=i,o="",s=t.exec(r);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(r);n[o]=e[r]}return i[""]||i}(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===u.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),N=C,w={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},R={aicc:i(i({},w),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:w,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};function A(e,t,i,r,n){if("string"!=typeof e)return!1;var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new r(i);return!0}function j(e,t,i,r){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}function D(e,t,i){return A(e,t,c.scorm12.TYPE_MISMATCH,f,i)}function V(e,t,i){if(!i&&""===e)throw new f(c.scorm12.VALUE_OUT_OF_RANGE);return j(e,t,c.scorm12.VALUE_OUT_OF_RANGE,f)}var F,x,P,z=u.scorm12,G=R.scorm12,U=c.scorm12,Y=function(e){function i(t){var i=e.call(this)||this;return i._raw="",i._min="",i.__children=t.score_children||z.score_children,i.__score_range=!!t.score_range&&G.score_range,i._max=t.max||""===t.max?t.max:"100",i.__invalid_error_code=t.invalidErrorCode||U.INVALID_SET_VALUE,i.__invalid_type_code=t.invalidTypeCode||U.TYPE_MISMATCH,i.__invalid_range_code=t.invalidRangeCode||U.VALUE_OUT_OF_RANGE,i.__decimal_regex=t.decimalRegex||G.CMIDecimal,i.__error_class=t.errorClass,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this.__error_class(this.__invalid_error_code)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"raw",{get:function(){return this._raw},set:function(e){!A(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!j(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._raw=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"min",{get:function(){return this._min},set:function(e){!A(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!j(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._min=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max",{get:function(){return this._max},set:function(e){!A(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!j(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._max=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},i}(o),$=function(e){function i(){var t=e.call(this)||this;return t.__children=u.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new Y({score_children:u.scorm12.score_children,score_range:R.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){D(e,R.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?D(e,R.scorm12.CMIStatus)&&(this._lesson_status=e):D(e,R.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"exit",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){D(e,R.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"session_time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){D(e,R.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){D(e,R.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(e){var t,i,r,n=this._session_time,o=e;null!=o&&(n=M(((new Date).getTime()-o)/1e3));return t=this._total_time,i=n,"string"==typeof(r=new RegExp(R.scorm12.CMITimespan))&&(r=new RegExp(r)),M(I(t,r)+I(i,r))},i.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},i}(o),k=function(e){function i(){return e.call(this,{children:u.scorm12.objectives_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(i,e),i}(b),J=function(e){function i(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new Y({score_children:u.scorm12.score_children,score_range:R.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){D(e,R.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){D(e,R.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},i}(o),B=function(e){function i(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||u.scorm12.student_data_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},i}(o),H=function(e){function i(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||u.scorm12.student_preference_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio",{get:function(){return this._audio},set:function(e){D(e,R.scorm12.CMISInteger)&&V(e,R.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){D(e,R.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this._speed},set:function(e){D(e,R.scorm12.CMISInteger)&&V(e,R.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this._text},set:function(e){D(e,R.scorm12.CMISInteger)&&V(e,R.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},i}(o),Z=function(e){function i(){return e.call(this,{children:u.scorm12.interactions_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(i,e),i}(b),W=function(e){function i(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new b({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.objectives_children}),t.correct_responses=new b({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){D(e,R.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){D(e,R.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){D(e,R.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){D(e,R.scorm12.CMIDecimal)&&V(e,R.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_response",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){D(e,R.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){D(e,R.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"latency",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){D(e,R.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},i}(o),q=function(e){function i(){var t=e.call(this)||this;return t._id="",t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){D(e,R.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},i}(o),K=function(e){function i(){var t=e.call(this)||this;return t._pattern="",t}return t(i,e),Object.defineProperty(i.prototype,"pattern",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){D(e,R.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},i}(o),Q=function(e){function i(t,i,r){var n=e.call(this)||this;return n.__children="",n.__version="3.4",n._launch_data="",n._comments="",n._comments_from_lms="",r&&n.initialize(),n.__children=t||u.scorm12.cmi_children,n.core=new $,n.objectives=new k,n.student_data=i||new B,n.student_preference=new H,n.interactions=new Z,n}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(i.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments",{get:function(){return this._comments},set:function(e){D(e,R.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},i}(s),X=function(e){function i(){var t=e.call(this)||this;return t._event="",t}return t(i,e),Object.defineProperty(i.prototype,"event",{get:function(){return this._event},set:function(e){D(e,R.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},i}(o);!function(e){e.unknown="unknown",e.true="true",e.false="false"}(F||(F={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(x||(x={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(P||(P={}));var ee=function(e){function i(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,c.scorm12,t)||this).statusSetByModule=!1,i.cmi=new Q,i.nav=new X,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return t(i,e),i.prototype.reset=function(e){this.commonReset(e),this.cmi=new Q,this.nav=new X},i.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},i.prototype.lmsFinish=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.internalFinish=function(){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===u.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},i.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},i.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},i.prototype.lmsCommit=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},i.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},i.prototype.getChildElement=function(e,t,i){return L(e,"cmi\\.objectives\\.\\d+")?new J:i&&L(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new K:i&&L(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new q:!i&&L(e,"cmi\\.interactions\\.\\d+")?new W:null},i.prototype.validateCorrectResponse=function(e,t){},i.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),u.scorm12.error_descriptions[e]&&(i=u.scorm12.error_descriptions[e].basicMessage,r=u.scorm12.error_descriptions[e].detailMessage),t?r:i},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=O(t);switch(this.settings.dataCommitFormat){case"flattened":return O(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=I(this.cmi.getCurrentTotalTime(),R.scorm12.CMITimespan),r=this.cmi.core.lesson_status,n=P.unknown,o=x.unknown;r&&(n="completed"===r||"passed"===r?P.completed:P.incomplete,"passed"===r?o=x.passed:"failed"===r&&(o=x.failed));var s=this.cmi.core.score,a=null;s&&(a={},Number.isNaN(Number.parseFloat(s.raw))||(a.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(a.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(a.max=Number.parseFloat(s.max)));var c={successStatus:o,completionStatus:n,runtimeData:t,totalTimeSeconds:i};return a&&(c.score=a),c},i.prototype.storeData=function(e){return r(this,void 0,void 0,(function(){var t,i,r,o,s,a;return n(this,(function(n){switch(n.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(a=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===a?void 0:a.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,r=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===u.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(r)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,r,e)];case 1:return[2,n.sent()];case 2:return[2,{result:u.global.SCORM_TRUE,errorCode:0}]}}))}))},i}(N),te=c.scorm12;function ie(e,t,i){return A(e,t,te.TYPE_MISMATCH,g,i)}var re=function(e){function i(){var t=e.call(this)||this;return t.comments=new ne,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},i}(o),ne=function(e){function i(){return e.call(this,{children:u.aicc.comments_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:g})||this}return t(i,e),i}(b),oe=function(e){function i(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return t(i,e),Object.defineProperty(i.prototype,"content",{get:function(){return this._content},set:function(e){ie(e,R.aicc.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){ie(e,R.aicc.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){ie(e,R.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},i}(o),se=function(e){function i(){var t=e.call(this,u.aicc.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new b({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:g,children:""}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){ie(e,R.aicc.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_color",{get:function(){return this._text_color},set:function(e){ie(e,R.aicc.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_location",{get:function(){return this._text_location},set:function(e){ie(e,R.aicc.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_size",{get:function(){return this._text_size},set:function(e){ie(e,R.aicc.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"video",{get:function(){return this._video},set:function(e){ie(e,R.aicc.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},i}(H),ae=function(e){function i(){var t=e.call(this)||this;return t.__children=u.aicc.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},i}(o),ce=function(e){function i(){return e.call(this,{children:u.aicc.tries_children})||this}return t(i,e),i}(b),le=function(e){function i(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new Y({score_children:u.aicc.score_children,score_range:R.aicc.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:g}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){ie(e,R.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){ie(e,R.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},i}(o),ue=function(e){function i(){return e.call(this,{children:u.aicc.attempt_records_children})||this}return t(i,e),i}(b),_e=function(e){function i(){var t=e.call(this)||this;return t._lesson_status="",t.score=new Y({score_children:u.aicc.score_children,score_range:R.aicc.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:g}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){ie(e,R.aicc.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},i}(o),de=function(e){function i(){var t=e.call(this,u.aicc.student_data_children)||this;return t._tries_during_lesson="",t.tries=new ce,t.attempt_records=new ue,t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize(),null===(i=this.attempt_records)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries,attempt_records:this.attempt_records};return delete this.jsonString,e},i}(B),he=function(e){function i(){return e.call(this,{children:u.aicc.paths_children})||this}return t(i,e),i}(b),me=function(e){function i(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}return t(i,e),Object.defineProperty(i.prototype,"location_id",{get:function(){return this._location_id},set:function(e){ie(e,R.aicc.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){ie(e,R.aicc.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){ie(e,R.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){ie(e,R.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"why_left",{get:function(){return this._why_left},set:function(e){ie(e,R.aicc.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){ie(e,R.aicc.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e},i}(o),pe=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this,u.aicc.cmi_children)||this;return t&&i.initialize(),i.student_preference=new se,i.student_data=new de,i.student_demographics=new ae,i.evaluation=new re,i.paths=new he,i}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},i}(Q),fe=function(e){function i(t){var i=e.call(this,t)||this;return i.cmi=new pe,i.nav=new X,i}return t(i,e),i.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||(L(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new oe:L(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new le:L(t,"cmi\\.student_data\\.attempt_records\\.\\d+")?n=new _e:L(t,"cmi\\.paths\\.\\d+")&&(n=new me)),n},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},i}(ee);return window.AICC=fe,{}}()})); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e={900:function(e,t,i){i.d(t,{A:function(){return d}});var r=i(635),n=i(589),o=i(784),s=i(797),a=i(340),c=i(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return void 0===e?[3,2]:(n=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(i,[r.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),_=function(){function e(t,i){var r=this.constructor;if(this._settings=l,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,r.Cl)((0,r.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,i){var r=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",r=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),r},e.prototype.apiLog=function(e,t,i,r){t=(0,c.hw)(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,_=!1,d="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=_},941:function(e,t,i){var r=i(635),n=i(900),o=i(989),s=i(864),a=i(340),c=i(797),l=i(176),u=i(833),_=i(331),d=i(417),h=i(56),m=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,c.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new o.Y,i.nav=new _.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new o.Y,this.nav=new _.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),a.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===a.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),a.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,s.J6)(e,"cmi\\.objectives\\.\\d+")?new l.N:i&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new u.cb:i&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new u.Oh:!i&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+")?new u.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),a.A.scorm12.error_descriptions[e]&&(i=a.A.scorm12.error_descriptions[e].basicMessage,r=a.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=s.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return s.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=s.f4(i,d.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,o=h.lC.unknown,a=h.YE.unknown;n&&(o="completed"===n||"passed"===n?h.lC.completed:h.lC.incomplete,"passed"===n?a=h.YE.passed:"failed"===n&&(a=h.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:o,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,s,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===a.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(n.A);t.default=m},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),_=i(864),d=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=_.UZ(r/1e3)}return _.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=i(176),m=i(532),f=i(181),p=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new d,o.objectives=new h.C,o.student_data=i||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return h},WP:function(){return d},Xb:function(){return _},cb:function(){return m}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),_=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return _},N:function(){return d}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),_=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),d=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return _},tQ:function(){return u},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l);!function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,r.C6)(t,e)}(l)},864:function(e,t,i){i.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return _},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var r=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function s(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),n(o(e,i)+o(t,i))}function a(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n","import AICC from \"../AICC.ts\";\n\nwindow.AICC = AICC;\n"],"names":["root","factory","exports","module","define","amd","self","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","v","op","pop","push","SuppressedError","jsonString","_initialized","_start_time","initialize","setStartTime","Date","getTime","BaseCMI","global","GENERAL","INITIALIZATION_FAILED","INITIALIZED","TERMINATED","TERMINATION_FAILURE","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","STORE_BEFORE_INIT","STORE_AFTER_TERM","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","ARGUMENT_ERROR","CHILDREN_ERROR","COUNT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNDEFINED_DATA_MODEL","UNIMPLEMENTED_ELEMENT","VALUE_NOT_INITIALIZED","INVALID_SET_VALUE","READ_ONLY_ELEMENT","WRITE_ONLY_ELEMENT","TYPE_MISMATCH","VALUE_OUT_OF_RANGE","DEPENDENCY_NOT_ESTABLISHED","scorm12","scorm2004","MULTIPLE_TERMINATIONS","cmi_children","core_children","score_children","comments_children","objectives_children","correct_responses_children","student_data_children","student_preference_children","interactions_children","error_descriptions","basicMessage","detailMessage","SCORM_TRUE","SCORM_FALSE","STATE_NOT_INITIALIZED","STATE_INITIALIZED","STATE_TERMINATED","LOG_LEVEL_DEBUG","LOG_LEVEL_INFO","LOG_LEVEL_WARNING","LOG_LEVEL_ERROR","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","scorm12_errors","aicc_errors","scorm2004_errors","errorCode","toString","_errorCode","name","setMessage","message","Error","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","scorm12_error_codes","params","__children","children","_errorClass","errorClass","childArray","_children","_count","toJSON","SECONDS_PER_HOUR","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","seconds","getSeconds","ms","msStr","countDecimals","toFixed","split","replace","getTimeAsSeconds","timeString","timeRegex","RegExp","match","parts","Number","flatten","data","recurse","cur","prop","isArray","l","isEmpty","num","indexOf","stringMatches","str","tester","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","status","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","warn","info","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","currentState","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","isTerminated","cmi","processListeners","apiLog","clearSCORMError","functionName","CMIElement","messageString","fillChars","j","formatMessage","terminate","checkTerminated","checkState","storeData","getValue","getCMIValue","handleValueAccessException","undefined","setValue","commitCallback","setCMIValue","scheduleCommit","clearScheduledCommit","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","_CMIElement","_value","_commonSetCMIValue","methodName","structure","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","idx","attribute","substring","_checkObjectHasProperty","validateCorrectResponse","CMIArray","index","parseInt","isNaN","item","newChild","getChildElement","initialized","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","on","listenerName","listenerFunctions","listenerSplit","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","errorNumber","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","regex","m","exec","unflatten","a_pattern","c_match","a_match","a_num","c_num","startingData","currentCMIElement","renderCMIToJSONString","stringify","k","renderCMIToJSONObject","processHttpRequest","url","immediate","api","genericError","performFetch","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","join","headers","credentials","keepalive","CMIString256","CMIString4096","CMITime","CMITimespan","CMIInteger","CMISInteger","CMIDecimal","CMIIdentifier","CMIFeedback","CMIIndex","CMIStatus","CMIStatus2","CMIExit","CMIType","CMIResult","NAVEvent","score_range","audio_range","speed_range","weighting_range","text_range","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVBoolean","NAVTarget","scaled_range","progress_range","checkValidFormat","regexPattern","allowEmptyString","formatRegex","matches","checkValidRange","rangePattern","ranges","check12ValidFormat","Scorm12ValidationError","check12ValidRange","SuccessStatus","CompletionStatus","scorm12_constants","scorm12_regex","_raw","_min","__score_range","_max","max","__invalid_error_code","__invalid_type_code","invalidTypeCode","__invalid_range_code","invalidRangeCode","__decimal_regex","decimalRegex","__error_class","raw","min","_student_id","_student_name","_lesson_location","_credit","_lesson_status","_entry","_total_time","_lesson_mode","_exit","_session_time","_suspend_data","score","CMIScore","student_id","student_name","lesson_location","credit","lesson_status","entry","total_time","lesson_mode","exit","session_time","suspend_data","getCurrentTotalTime","start_time","first","second","sessionTime","startTime","_id","_status","id","_mastery_score","_max_time_allowed","_time_limit_action","mastery_score","max_time_allowed","time_limit_action","_audio","_language","_speed","_text","audio","language","speed","_time","_type","_weighting","_student_response","_result","_latency","objectives","correct_responses","time","type","weighting","student_response","latency","_pattern","pattern","student_data","__version","_launch_data","_comments","_comments_from_lms","core","CMICore","CMIObjectives","CMIStudentData","student_preference","CMIStudentPreference","interactions","CMIInteractions","launch_data","comments","comments_from_lms","_version","BaseRootCMI","_event","event","mastery_override","statusSetByModule","CMI","nav","NAV","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","internalFinish","CMIObjectivesObject","CMIInteractionsCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","detail","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeSeconds","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","originalStatus","shouldTerminateCommit","aicc_error_codes","checkAICCValidFormat","AICCValidationError","CMIEvaluationComments","_content","_location","content","location","_lesson_type","_text_color","_text_location","_text_size","_video","windows","lesson_type","text_color","text_location","text_size","video","_city","_class","_company","_country","_experience","_familiar_name","_instructor_name","_title","_native_language","_state","_street_address","_telephone","_years_experience","city","clazz","company","country","experience","familiar_name","instructor_name","title","native_language","state","street_address","telephone","years_experience","class","_tries_during_lesson","tries","CMITries","attempt_records","CMIAttemptRecords","tries_during_lesson","_location_id","_date","_why_left","_time_in_element","location_id","date","why_left","time_in_element","AICCStudentPreferences","AICCCMIStudentData","student_demographics","CMIStudentDemographics","evaluation","CMIEvaluation","paths","CMIPaths","CMIEvaluationCommentsObject","CMITriesObject","CMIAttemptRecordsObject","CMIPathsObject","window","AICC"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"aicc.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAA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AAK,SAAE1kB,YACd,EAoBA,YAAAkP,OAAA,WAcExQ,KAAKyQ,YAAa,EAClB,IAAMlS,EAAS,CACb4V,aAAcnU,KAAKmU,aACnBgB,YAAanV,KAAKmV,YAClBC,SAAUpV,KAAKoV,SACfC,kBAAmBrV,KAAKqV,kBACxB9H,KAAMvN,KAAKuN,KACXwH,WAAY/U,KAAK+U,WACjBlF,aAAc7P,KAAK6P,aACnBoF,mBAAoBjV,KAAKiV,mBACzB2Q,qBAAsB5lB,KAAK4lB,qBAC3B1Q,aAAclV,KAAKkV,aACnB4Q,WAAY9lB,KAAK8lB,WACjBE,MAAOhmB,KAAKgmB,OAGd,cADOhmB,KAAKyQ,WACLlS,CACT,EACF,EAnFA,CAAyB,K,oBCDzB,YAKE,WAAYoC,GACV,QAAK,UAACA,IAAS,K,OAEf,EAAKqB,IAAM,IAAIkkB,EACf,EAAK7Z,IAAM,IAAI,I,CACjB,CA8CF,OAxDkC,aAoBhC,YAAA/F,gBAAA,SACE/D,EACAiB,EACA4B,GAEA,IAAIiB,EAAW,YAAMC,gBAAe,UAAC/D,EAAYiB,EAAO4B,GAkBxD,OAhBKiB,KACC,QAAc9D,EAAY,sCAC5B8D,EAAW,IAAI8f,GAEf,QAAc5jB,EAAY,qCAE1B8D,EAAW,IAAI+f,GAEf,QAAc7jB,EAAY,+CAE1B8D,EAAW,IAAIggB,GACN,QAAc9jB,EAAY,wBACnC8D,EAAW,IAAIigB,IAIZjgB,CACT,EAOA,YAAA0H,2BAAA,SAA2BC,GAEzBhO,KAAKgC,IAAMgM,EAAOhM,IAClBhC,KAAKqM,IAAM2B,EAAO3B,GACpB,EACF,EAxDA,CAAkCka,EAAA,S","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","A","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","hasOwnProperty","call","result","errorCode","SCORM_TRUE","status","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","this","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","initialize","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","cmi","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","CMIElement","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","value","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","READ_ONLY_ELEMENT","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","newChild","getChildElement","initialized","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","scorm12","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","mastery_override","statusSetByModule","nav","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","core","lesson_status","internalFinish","event","detail","basicMessage","detailMessage","error_descriptions","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","total_time","getCurrentTotalTime","flattened","renderCommitObject","totalTimeHHMMSS","totalTimeSeconds","CMITimespan","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","score","scoreObject","parseFloat","raw","min","max","runtimeData","originalStatus","lesson_mode","credit","student_data","mastery_score","shouldTerminateCommit","scorm12_error_codes","__children","children","_errorCode","_errorClass","errorClass","_children","_count","toJSON","jsonString","_initialized","_start_time","Date","getTime","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","score_children","__score_range","score_range","_max","__invalid_error_code","INVALID_SET_VALUE","__invalid_type_code","invalidTypeCode","TYPE_MISMATCH","__invalid_range_code","invalidRangeCode","VALUE_OUT_OF_RANGE","__decimal_regex","decimalRegex","CMIDecimal","__error_class","checkValidFormat","regexPattern","allowEmptyString","formatRegex","RegExp","matches","checkValidRange","rangePattern","ranges","core_children","_student_id","_student_name","_lesson_location","_credit","_lesson_status","_entry","_total_time","_lesson_mode","_exit","_session_time","_suspend_data","student_id","student_name","lesson_location","CMIString256","CMIStatus","CMIStatus2","entry","WRITE_ONLY_ELEMENT","exit","CMIExit","session_time","suspend_data","CMIString4096","start_time","sessionTime","startTime","seconds","cmi_children","__version","_launch_data","_comments","_comments_from_lms","CMICore","objectives","C","student_preference","interactions","launch_data","comments","comments_from_lms","_version","interactions_children","_id","_time","_type","_weighting","_student_response","_result","_latency","objectives_children","correct_responses","correct_responses_children","id","CMIIdentifier","time","CMITime","type","CMIType","weighting","weighting_range","student_response","CMIFeedback","CMIResult","latency","_pattern","pattern","_event","NAVEvent","_status","student_data_children","_mastery_score","_max_time_allowed","_time_limit_action","max_time_allowed","time_limit_action","student_preference_children","_audio","_language","_speed","_text","audio","CMISInteger","audio_range","language","speed","speed_range","text_range","check12ValidFormat","check12ValidRange","comments_children","APIConstants","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","NAVBoolean","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","DEPENDENCY_NOT_ESTABLISHED","ErrorCodes","MULTIPLE_TERMINATIONS","CMIInteger","CMIIndex","Regex","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVTarget","scaled_range","progress_range","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","getSeconds","ms","msStr","countDecimals","toFixed","getTimeAsSeconds","timeString","timeRegex","parts","addHHMMSSTimeStrings","first","second","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","regex","m","exec","num","formatMessage","messageString","fillChars","j","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","o","defineProperty","enumerable","get","r","toStringTag","aicc_error_codes","checkAICCValidFormat","CMIEvaluationComments","_content","_location","content","location","_lesson_type","_text_color","_text_location","_text_size","_video","windows","lesson_type","text_color","text_location","text_size","video","_city","_class","_company","_country","_experience","_familiar_name","_instructor_name","_title","_native_language","_state","_street_address","_telephone","_years_experience","city","clazz","company","country","experience","familiar_name","instructor_name","title","native_language","state","street_address","telephone","years_experience","class","_tries_during_lesson","tries","CMITries","attempt_records","CMIAttemptRecords","tries_during_lesson","_location_id","_date","_why_left","_time_in_element","location_id","date","why_left","time_in_element","AICCStudentPreferences","AICCCMIStudentData","student_demographics","CMIStudentDemographics","evaluation","CMIEvaluation","paths","CMIPaths","CMI","CMIEvaluationCommentsObject","CMITriesObject","CMIAttemptRecordsObject","CMIPathsObject","Scorm12API"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index bff4acb..0000000 --- a/dist/index.js +++ /dev/null @@ -1,6606 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["scorm-again"] = factory(); - else - root["scorm-again"] = factory(); -})(self, function() { -return /******/ (function() { // webpackBootstrap -/******/ "use strict"; -/******/ // The require scope -/******/ var __webpack_require__ = {}; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ !function() { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ }(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - AICC: function() { return /* reexport */ src_AICC; }, - Scorm12API: function() { return /* reexport */ src_Scorm12API; }, - Scorm2004API: function() { return /* reexport */ src_Scorm2004API; } -}); - -;// ./node_modules/tslib/tslib.es6.mjs -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; - -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; - -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; - -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -/* harmony default export */ var tslib_es6 = ({ - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}); - -;// ./src/cmi/common/base_cmi.ts - -var BaseCMI = (function () { - function BaseCMI() { - this.jsonString = false; - this._initialized = false; - } - Object.defineProperty(BaseCMI.prototype, "initialized", { - get: function () { - return this._initialized; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(BaseCMI.prototype, "start_time", { - get: function () { - return this._start_time; - }, - enumerable: false, - configurable: true - }); - BaseCMI.prototype.initialize = function () { - this._initialized = true; - }; - BaseCMI.prototype.setStartTime = function () { - this._start_time = new Date().getTime(); - }; - return BaseCMI; -}()); - -var BaseRootCMI = (function (_super) { - __extends(BaseRootCMI, _super); - function BaseRootCMI() { - return _super !== null && _super.apply(this, arguments) || this; - } - return BaseRootCMI; -}(BaseCMI)); - - -;// ./src/constants/error_codes.ts - -var global = { - GENERAL: 101, - INITIALIZATION_FAILED: 101, - INITIALIZED: 101, - TERMINATED: 101, - TERMINATION_FAILURE: 101, - TERMINATION_BEFORE_INIT: 101, - MULTIPLE_TERMINATION: 101, - RETRIEVE_BEFORE_INIT: 101, - RETRIEVE_AFTER_TERM: 101, - STORE_BEFORE_INIT: 101, - STORE_AFTER_TERM: 101, - COMMIT_BEFORE_INIT: 101, - COMMIT_AFTER_TERM: 101, - ARGUMENT_ERROR: 101, - CHILDREN_ERROR: 101, - COUNT_ERROR: 101, - GENERAL_GET_FAILURE: 101, - GENERAL_SET_FAILURE: 101, - GENERAL_COMMIT_FAILURE: 101, - UNDEFINED_DATA_MODEL: 101, - UNIMPLEMENTED_ELEMENT: 101, - VALUE_NOT_INITIALIZED: 101, - INVALID_SET_VALUE: 101, - READ_ONLY_ELEMENT: 101, - WRITE_ONLY_ELEMENT: 101, - TYPE_MISMATCH: 101, - VALUE_OUT_OF_RANGE: 101, - DEPENDENCY_NOT_ESTABLISHED: 101, -}; -var scorm12 = __assign(__assign({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var scorm2004 = __assign(__assign({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var ErrorCodes = { - scorm12: scorm12, - scorm2004: scorm2004, -}; -/* harmony default export */ var error_codes = (ErrorCodes); - -;// ./src/constants/api_constants.ts - -var api_constants_global = { - SCORM_TRUE: "true", - SCORM_FALSE: "false", - STATE_NOT_INITIALIZED: 0, - STATE_INITIALIZED: 1, - STATE_TERMINATED: 2, - LOG_LEVEL_DEBUG: 1, - LOG_LEVEL_INFO: 2, - LOG_LEVEL_WARNING: 3, - LOG_LEVEL_ERROR: 4, - LOG_LEVEL_NONE: 5, -}; -var api_constants_scorm12 = { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", - core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", - score_children: "raw,min,max", - comments_children: "content,location,time", - objectives_children: "id,score,status", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio,language,speed,text", - interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", - error_descriptions: { - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", - }, - "201": { - basicMessage: "Invalid argument error", - detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", - }, - "202": { - basicMessage: "Element cannot have children", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', - }, - "203": { - basicMessage: "Element not an array - cannot have count", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', - }, - "301": { - basicMessage: "Not initialized", - detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", - }, - "401": { - basicMessage: "Not implemented error", - detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", - }, - "402": { - basicMessage: "Invalid set value, element is a keyword", - detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', - }, - "403": { - basicMessage: "Element is read only", - detailMessage: "LMSSetValue was called with a data model element that can only be read.", - }, - "404": { - basicMessage: "Element is write only", - detailMessage: "LMSGetValue was called on a data model element that can only be written to.", - }, - "405": { - basicMessage: "Incorrect Data Type", - detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Element Value Out Of Range", - detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var aicc = __assign(__assign({}, api_constants_scorm12), { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", - student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", - student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", - student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", - tries_children: "time,status,score", - attempt_records_children: "score,lesson_status", - paths_children: "location_id,date,time,status,why_left,time_in_element", -}); -var api_constants_scorm2004 = { - cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", - comments_children: "comment,timestamp,location", - score_children: "max,raw,scaled,min", - objectives_children: "progress_measure,completion_status,success_status,description,score,id", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio_level,audio_captioning,delivery_speed,language", - interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", - error_descriptions: { - "0": { - basicMessage: "No Error", - detailMessage: "No error occurred, the previous API call was successful.", - }, - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", - }, - "102": { - basicMessage: "General Initialization Failure", - detailMessage: "Call to Initialize failed for an unknown reason.", - }, - "103": { - basicMessage: "Already Initialized", - detailMessage: "Call to Initialize failed because Initialize was already called.", - }, - "104": { - basicMessage: "Content Instance Terminated", - detailMessage: "Call to Initialize failed because Terminate was already called.", - }, - "111": { - basicMessage: "General Termination Failure", - detailMessage: "Call to Terminate failed for an unknown reason.", - }, - "112": { - basicMessage: "Termination Before Initialization", - detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", - }, - "113": { - basicMessage: "Termination After Termination", - detailMessage: "Call to Terminate failed because Terminate was already called.", - }, - "122": { - basicMessage: "Retrieve Data Before Initialization", - detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", - }, - "123": { - basicMessage: "Retrieve Data After Termination", - detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", - }, - "132": { - basicMessage: "Store Data Before Initialization", - detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", - }, - "133": { - basicMessage: "Store Data After Termination", - detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", - }, - "142": { - basicMessage: "Commit Before Initialization", - detailMessage: "Call to Commit failed because it was made before the call to Initialize.", - }, - "143": { - basicMessage: "Commit After Termination", - detailMessage: "Call to Commit failed because it was made after the call to Terminate.", - }, - "201": { - basicMessage: "General Argument Error", - detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", - }, - "301": { - basicMessage: "General Get Failure", - detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "351": { - basicMessage: "General Set Failure", - detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "391": { - basicMessage: "General Commit Failure", - detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "401": { - basicMessage: "Undefined Data Model Element", - detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", - }, - "402": { - basicMessage: "Unimplemented Data Model Element", - detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", - }, - "403": { - basicMessage: "Data Model Element Value Not Initialized", - detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", - }, - "404": { - basicMessage: "Data Model Element Is Read Only", - detailMessage: "SetValue was called with a data model element that can only be read.", - }, - "405": { - basicMessage: "Data Model Element Is Write Only", - detailMessage: "GetValue was called on a data model element that can only be written to.", - }, - "406": { - basicMessage: "Data Model Element Type Mismatch", - detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Data Model Element Value Out Of Range", - detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var APIConstants = { - global: api_constants_global, - scorm12: api_constants_scorm12, - aicc: aicc, - scorm2004: api_constants_scorm2004, -}; -/* harmony default export */ var api_constants = (APIConstants); - -;// ./src/exceptions.ts - - -var scorm12_errors = api_constants.scorm12.error_descriptions; -var aicc_errors = api_constants.aicc.error_descriptions; -var scorm2004_errors = api_constants.scorm2004.error_descriptions; -var BaseScormValidationError = (function (_super) { - __extends(BaseScormValidationError, _super); - function BaseScormValidationError(errorCode) { - var _this = _super.call(this, errorCode.toString()) || this; - _this._errorCode = errorCode; - _this.name = "ScormValidationError"; - return _this; - } - Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { - get: function () { - return this._errorCode; - }, - enumerable: false, - configurable: true - }); - BaseScormValidationError.prototype.setMessage = function (message) { - this.message = message; - }; - return BaseScormValidationError; -}(Error)); - -var ValidationError = (function (_super) { - __extends(ValidationError, _super); - function ValidationError(errorCode, errorMessage, detailedMessage) { - var _this = _super.call(this, errorCode) || this; - _this._detailedMessage = ""; - _this.setMessage(errorMessage); - _this._errorMessage = errorMessage; - if (detailedMessage) { - _this._detailedMessage = detailedMessage; - } - return _this; - } - Object.defineProperty(ValidationError.prototype, "errorMessage", { - get: function () { - return this._errorMessage; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ValidationError.prototype, "detailedMessage", { - get: function () { - return this._detailedMessage; - }, - enumerable: false, - configurable: true - }); - return ValidationError; -}(BaseScormValidationError)); - -var Scorm12ValidationError = (function (_super) { - __extends(Scorm12ValidationError, _super); - function Scorm12ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; - } - return _this; - } - return Scorm12ValidationError; -}(ValidationError)); - -var AICCValidationError = (function (_super) { - __extends(AICCValidationError, _super); - function AICCValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { - _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; - } - return _this; - } - return AICCValidationError; -}(ValidationError)); - -var Scorm2004ValidationError = (function (_super) { - __extends(Scorm2004ValidationError, _super); - function Scorm2004ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; - } - return _this; - } - return Scorm2004ValidationError; -}(ValidationError)); - - -;// ./src/cmi/common/array.ts - - - - -var scorm12_error_codes = error_codes.scorm12; -var CMIArray = (function (_super) { - __extends(CMIArray, _super); - function CMIArray(params) { - var _this = _super.call(this) || this; - _this.__children = params.children; - _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; - _this._errorClass = params.errorClass || BaseScormValidationError; - _this.childArray = []; - return _this; - } - Object.defineProperty(CMIArray.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new this._errorClass(this._errorCode); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIArray.prototype, "_count", { - get: function () { - return this.childArray.length; - }, - set: function (_count) { - throw new this._errorClass(this._errorCode); - }, - enumerable: false, - configurable: true - }); - CMIArray.prototype.toJSON = function () { - this.jsonString = true; - var result = {}; - for (var i = 0; i < this.childArray.length; i++) { - result[i + ""] = this.childArray[i]; - } - delete this.jsonString; - return result; - }; - return CMIArray; -}(BaseCMI)); - - -;// ./src/utilities.ts -var SECONDS_PER_SECOND = 1.0; -var SECONDS_PER_MINUTE = 60; -var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; -var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; -var designations = { - D: SECONDS_PER_DAY, - H: SECONDS_PER_HOUR, - M: SECONDS_PER_MINUTE, - S: SECONDS_PER_SECOND, -}; -function getSecondsAsHHMMSS(totalSeconds) { - if (!totalSeconds || totalSeconds <= 0) { - return "00:00:00"; - } - var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); - var dateObj = new Date(totalSeconds * 1000); - var minutes = dateObj.getUTCMinutes(); - var seconds = dateObj.getSeconds(); - var ms = totalSeconds % 1.0; - var msStr = ""; - if (countDecimals(ms) > 0) { - if (countDecimals(ms) > 2) { - msStr = ms.toFixed(2); - } - else { - msStr = String(ms); - } - msStr = "." + msStr.split(".")[1]; - } - return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); -} -function getSecondsAsISODuration(seconds) { - if (!seconds || seconds <= 0) { - return "PT0S"; - } - var duration = "P"; - var remainder = seconds; - for (var designationsKey in designations) { - var current_seconds = designations[designationsKey]; - var value = Math.floor(remainder / current_seconds); - remainder = remainder % current_seconds; - if (countDecimals(remainder) > 2) { - remainder = Number(Number(remainder).toFixed(2)); - } - if (designationsKey === "S" && remainder > 0) { - value += remainder; - } - if (value) { - if ((duration.indexOf("D") > 0 || - designationsKey === "H" || - designationsKey === "M" || - designationsKey === "S") && - duration.indexOf("T") === -1) { - duration += "T"; - } - duration += "".concat(value).concat(designationsKey); - } - } - return duration; -} -function getTimeAsSeconds(timeString, timeRegex) { - if (typeof timeString === "number" || typeof timeString === "boolean") { - timeString = String(timeString); - } - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - if (!timeString || !timeString.match(timeRegex)) { - return 0; - } - var parts = timeString.split(":"); - var hours = Number(parts[0]); - var minutes = Number(parts[1]); - var seconds = Number(parts[2]); - return hours * 3600 + minutes * 60 + seconds; -} -function getDurationAsSeconds(duration, durationRegex) { - if (typeof durationRegex === "string") { - durationRegex = new RegExp(durationRegex); - } - if (!duration || !duration.match(durationRegex)) { - return 0; - } - var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; - var result = 0.0; - result += Number(seconds) || 0.0; - result += Number(minutes) * 60.0 || 0.0; - result += Number(hours) * 3600.0 || 0.0; - result += Number(days) * (60 * 60 * 24.0) || 0.0; - result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; - return result; -} -function addTwoDurations(first, second, durationRegex) { - var regex = typeof durationRegex === "string" - ? new RegExp(durationRegex) - : durationRegex; - return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); -} -function addHHMMSSTimeStrings(first, second, timeRegex) { - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); -} -function flatten(data) { - var result = {}; - function recurse(cur, prop) { - if (Object(cur) !== cur) { - result[prop] = cur; - } - else if (Array.isArray(cur)) { - for (var i = 0, l = cur.length; i < l; i++) { - recurse(cur[i], prop + "[" + i + "]"); - if (l === 0) - result[prop] = []; - } - } - else { - var isEmpty = true; - for (var p in cur) { - if ({}.hasOwnProperty.call(cur, p)) { - isEmpty = false; - recurse(cur[p], prop ? prop + "." + p : p); - } - } - if (isEmpty && prop) - result[prop] = {}; - } - } - recurse(data, ""); - return result; -} -function unflatten(data) { - "use strict"; - if (Object(data) !== data || Array.isArray(data)) - return data; - var regex = /\.?([^.[\]]+)|\[(\d+)]/g; - var result = {}; - for (var p in data) { - if ({}.hasOwnProperty.call(data, p)) { - var cur = result; - var prop = ""; - var m = regex.exec(p); - while (m) { - cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); - prop = m[2] || m[1]; - m = regex.exec(p); - } - cur[prop] = data[p]; - } - } - return result[""] || result; -} -function countDecimals(num) { - if (Math.floor(num) === num || String(num).indexOf(".") < 0) - return 0; - var parts = num.toString().split(".")[1]; - return parts.length || 0; -} -function formatMessage(functionName, message, CMIElement) { - var baseLength = 20; - var messageString = ""; - messageString += functionName; - var fillChars = baseLength - messageString.length; - for (var i = 0; i < fillChars; i++) { - messageString += " "; - } - messageString += ": "; - if (CMIElement) { - var CMIElementBaseLength = 70; - messageString += CMIElement; - fillChars = CMIElementBaseLength - messageString.length; - for (var j = 0; j < fillChars; j++) { - messageString += " "; - } - } - if (message) { - messageString += message; - } - return messageString; -} -function stringMatches(str, tester) { - return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; -} - -;// ./src/utilities/debounce.ts -function debounce(func, wait, immediate) { - if (immediate === void 0) { immediate = false; } - var timeout; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var context = this; - var later = function () { - timeout = null; - if (!immediate) - func.apply(context, args); - }; - var callNow = immediate && !timeout; - if (timeout) - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) - func.apply(context, args); - }; -} - -;// ./src/constants/default_settings.ts - - -var DefaultSettings = { - autocommit: false, - autocommitSeconds: 10, - asyncCommit: false, - sendFullCommit: true, - lmsCommitUrl: false, - dataCommitFormat: "json", - commitRequestDataType: "application/json;charset=UTF-8", - autoProgress: false, - logLevel: api_constants.global.LOG_LEVEL_ERROR, - selfReportSessionTime: false, - alwaysSendTotalTime: false, - renderCommonCommitFields: false, - strict_errors: true, - xhrHeaders: {}, - xhrWithCredentials: false, - responseHandler: function (response) { - return __awaiter(this, void 0, void 0, function () { - var httpResult, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof response !== "undefined")) return [3, 2]; - _b = (_a = JSON).parse; - return [4, response.text()]; - case 1: - httpResult = _b.apply(_a, [_c.sent()]); - if (httpResult === null || - !{}.hasOwnProperty.call(httpResult, "result")) { - if (response.status === 200) { - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - else { - return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; - } - } - else { - return [2, { - result: httpResult.result, - errorCode: httpResult.errorCode - ? httpResult.errorCode - : httpResult.result === api_constants.global.SCORM_TRUE - ? 0 - : 101, - }]; - } - _c.label = 2; - case 2: return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; - } - }); - }); - }, - requestHandler: function (commitObject) { - return commitObject; - }, - onLogMessage: function (messageLevel, logMessage) { - switch (messageLevel) { - case api_constants.global.LOG_LEVEL_ERROR: - console.error(logMessage); - break; - case api_constants.global.LOG_LEVEL_WARNING: - console.warn(logMessage); - break; - case api_constants.global.LOG_LEVEL_INFO: - console.info(logMessage); - break; - case api_constants.global.LOG_LEVEL_DEBUG: - if (console.debug) { - console.debug(logMessage); - } - else { - console.log(logMessage); - } - break; - } - }, - scoItemIds: [], - scoItemIdValidator: false, -}; - -;// ./src/helpers/scheduled_commit.ts - -var ScheduledCommit = (function () { - function ScheduledCommit(API, when, callback) { - this._cancelled = false; - this._API = API; - this._timeout = setTimeout(this.wrapper.bind(this), when); - this._callback = callback; - } - ScheduledCommit.prototype.cancel = function () { - this._cancelled = true; - if (this._timeout) { - clearTimeout(this._timeout); - } - }; - ScheduledCommit.prototype.wrapper = function () { - var _this = this; - if (!this._cancelled) { - (function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this._API.commit(this._callback)]; - case 1: return [2, _a.sent()]; - } - }); }); })(); - } - }; - return ScheduledCommit; -}()); - - -;// ./src/BaseAPI.ts - - - - - - - - - -var BaseAPI = (function () { - function BaseAPI(error_codes, settings) { - var _newTarget = this.constructor; - this._settings = DefaultSettings; - if (_newTarget === BaseAPI) { - throw new TypeError("Cannot construct BaseAPI instances directly"); - } - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; - this._error_codes = error_codes; - if (settings) { - this.settings = settings; - } - this.apiLogLevel = this.settings.logLevel; - this.selfReportSessionTime = this.settings.selfReportSessionTime; - } - BaseAPI.prototype.commonReset = function (settings) { - this.settings = __assign(__assign({}, this.settings), settings); - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; - }; - BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { - var returnValue = api_constants.global.SCORM_FALSE; - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); - } - else if (this.isTerminated()) { - this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); - } - else { - if (this.selfReportSessionTime) { - this.cmi.setStartTime(); - } - this.currentState = api_constants.global.STATE_INITIALIZED; - this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); - } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return returnValue; - }; - BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { - logMessage = formatMessage(functionName, logMessage, CMIElement); - if (messageLevel >= this.apiLogLevel) { - this.settings.onLogMessage(messageLevel, logMessage); - } - }; - Object.defineProperty(BaseAPI.prototype, "error_codes", { - get: function () { - return this._error_codes; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(BaseAPI.prototype, "settings", { - get: function () { - return this._settings; - }, - set: function (settings) { - this._settings = __assign(__assign({}, this._settings), settings); - }, - enumerable: false, - configurable: true - }); - BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { - return __awaiter(this, void 0, void 0, function () { - var returnValue, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; - this.currentState = api_constants.global.STATE_TERMINATED; - return [4, this.storeData(true)]; - case 1: - result = _a.sent(); - if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); - } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - if (checkTerminated) - this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; - } - }); - }); - }; - BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { - var returnValue = ""; - if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.getCMIValue(CMIElement); - } - catch (e) { - returnValue = this.handleValueAccessException(e, returnValue); - } - this.processListeners(callbackName, CMIElement); - } - this.apiLog(callbackName, ": returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - if (returnValue === undefined) { - return ""; - } - this.clearSCORMError(returnValue); - return returnValue; - }; - BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { - if (value !== undefined) { - value = String(value); - } - var returnValue = api_constants.global.SCORM_FALSE; - if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.setCMIValue(CMIElement, value); - } - catch (e) { - this.handleValueAccessException(e, returnValue); - } - this.processListeners(callbackName, CMIElement, value); - } - if (returnValue === undefined) { - returnValue = api_constants.global.SCORM_FALSE; - } - if (String(this.lastErrorCode) === "0") { - if (this.settings.autocommit && !this._timeout) { - this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); - } - } - this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - this.clearSCORMError(returnValue); - return returnValue; - }; - BaseAPI.prototype.commit = function (callbackName_1) { - return __awaiter(this, arguments, void 0, function (callbackName, checkTerminated) { - var returnValue, result; - if (checkTerminated === void 0) { checkTerminated = false; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.clearScheduledCommit(); - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; - return [4, this.storeData(false)]; - case 1: - result = _a.sent(); - if (result.errorCode && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); - } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - this.apiLog(callbackName, " Result: " + returnValue, api_constants.global.LOG_LEVEL_DEBUG, "HttpRequest"); - if (checkTerminated) - this.lastErrorCode = "0"; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; - } - }); - }); - }; - BaseAPI.prototype.getLastError = function (callbackName) { - var returnValue = String(this.lastErrorCode); - this.processListeners(callbackName); - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; - }; - BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); - this.processListeners(callbackName); - } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; - }; - BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); - this.processListeners(callbackName); - } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; - }; - BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { - if (this.isNotInitialized()) { - this.throwSCORMError(beforeInitError); - return false; - } - else if (checkTerminated && this.isTerminated()) { - this.throwSCORMError(afterTermError); - return false; - } - return true; - }; - BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { - if (_detail === void 0) { _detail = false; } - throw new Error("The getLmsErrorMessageDetails method has not been implemented"); - }; - BaseAPI.prototype.getCMIValue = function (_CMIElement) { - throw new Error("The getCMIValue method has not been implemented"); - }; - BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { - throw new Error("The setCMIValue method has not been implemented"); - }; - BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { - if (!CMIElement || CMIElement === "") { - return api_constants.global.SCORM_FALSE; - } - var structure = CMIElement.split("."); - var refObject = this; - var returnValue = api_constants.global.SCORM_FALSE; - var foundFirstIndex = false; - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - var attribute = structure[idx]; - if (idx === structure.length - 1) { - if (scorm2004 && attribute.substring(0, 8) === "{target=") { - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); - } - else { - refObject = __assign(__assign({}, refObject), { attribute: value }); - } - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (stringMatches(CMIElement, "\\.correct_responses\\.\\d+") && - this.isInitialized()) { - this.validateCorrectResponse(CMIElement, value); - } - if (!scorm2004 || this.lastErrorCode === "0") { - refObject[attribute] = value; - returnValue = api_constants.global.SCORM_TRUE; - } - } - } - else { - refObject = refObject[attribute]; - if (!refObject) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - foundFirstIndex = true; - } - else { - var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); - foundFirstIndex = true; - if (!newChild) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (refObject.initialized) - newChild.initialize(); - refObject.childArray.push(newChild); - refObject = newChild; - } - } - idx++; - } - } - } - } - if (returnValue === api_constants.global.SCORM_FALSE) { - this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants.global.LOG_LEVEL_WARNING); - } - return returnValue; - }; - BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { - if (!CMIElement || CMIElement === "") { - return ""; - } - var structure = CMIElement.split("."); - var refObject = this; - var attribute = null; - var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - attribute = structure[idx]; - if (!scorm2004) { - if (idx === structure.length - 1) { - if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - } - else { - if (String(attribute).substring(0, 8) === "{target=" && - typeof refObject._isTargetValid == "function") { - var target = String(attribute).substring(8, String(attribute).length - 9); - return refObject._isTargetValid(target); - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - refObject = refObject[attribute]; - if (refObject === undefined) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - } - else { - this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); - break; - } - idx++; - } - } - } - if (refObject === null || refObject === undefined) { - if (!scorm2004) { - if (attribute === "_children") { - this.throwSCORMError(error_codes.scorm12.CHILDREN_ERROR); - } - else if (attribute === "_count") { - this.throwSCORMError(error_codes.scorm12.COUNT_ERROR); - } - } - } - else { - return refObject; - } - }; - BaseAPI.prototype.isInitialized = function () { - return this.currentState === api_constants.global.STATE_INITIALIZED; - }; - BaseAPI.prototype.isNotInitialized = function () { - return this.currentState === api_constants.global.STATE_NOT_INITIALIZED; - }; - BaseAPI.prototype.isTerminated = function () { - return this.currentState === api_constants.global.STATE_TERMINATED; - }; - BaseAPI.prototype.on = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - for (var i = 0; i < listenerFunctions.length; i++) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - this.listenerArray.push({ - functionName: functionName, - CMIElement: CMIElement, - callback: callback, - }); - this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); - } - }; - BaseAPI.prototype.off = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - var _loop_1 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - var removeIndex = this_1.listenerArray.findIndex(function (obj) { - return obj.functionName === functionName && - obj.CMIElement === CMIElement && - obj.callback === callback; - }); - if (removeIndex !== -1) { - this_1.listenerArray.splice(removeIndex, 1); - this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); - } - }; - var this_1 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_1 = _loop_1(i); - if (typeof state_1 === "object") - return state_1.value; - } - }; - BaseAPI.prototype.clear = function (listenerName) { - var listenerFunctions = listenerName.split(" "); - var _loop_2 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - this_2.listenerArray = this_2.listenerArray.filter(function (obj) { - return obj.functionName !== functionName && obj.CMIElement !== CMIElement; - }); - }; - var this_2 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } - }; - BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { - this.apiLog(functionName, value, api_constants.global.LOG_LEVEL_INFO, CMIElement); - for (var i = 0; i < this.listenerArray.length; i++) { - var listener = this.listenerArray[i]; - var functionsMatch = listener.functionName === functionName; - var listenerHasCMIElement = !!listener.CMIElement; - var CMIElementsMatch = false; - if (CMIElement && - listener.CMIElement && - listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { - CMIElementsMatch = - CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; - } - else { - CMIElementsMatch = listener.CMIElement === CMIElement; - } - if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { - this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants.global.LOG_LEVEL_INFO, CMIElement); - listener.callback(CMIElement, value); - } - } - }; - BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { - if (!message) { - message = this.getLmsErrorMessageDetails(errorNumber); - } - this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants.global.LOG_LEVEL_ERROR); - this.lastErrorCode = String(errorNumber); - }; - BaseAPI.prototype.clearSCORMError = function (success) { - if (success !== undefined && success !== api_constants.global.SCORM_FALSE) { - this.lastErrorCode = "0"; - } - }; - BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { - var _this = this; - if (!CMIElement) { - CMIElement = ""; - } - if (!this.isNotInitialized()) { - console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); - return; - } - function testPattern(a, c, a_pattern) { - var a_match = a.match(a_pattern); - var c_match; - if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { - var a_num = Number(a_match[2]); - var c_num = Number(c_match[2]); - if (a_num === c_num) { - if (a_match[3] === "id") { - return -1; - } - else if (a_match[3] === "type") { - if (c_match[3] === "id") { - return 1; - } - else { - return -1; - } - } - else { - return 1; - } - } - return a_num - c_num; - } - return null; - } - var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; - var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; - var result = Object.keys(json).map(function (key) { - return [String(key), json[key]]; - }); - result.sort(function (_a, _c) { - var a = _a[0], _b = _a[1]; - var c = _c[0], _d = _c[1]; - var test; - if ((test = testPattern(a, c, int_pattern)) !== null) { - return test; - } - if ((test = testPattern(a, c, obj_pattern)) !== null) { - return test; - } - if (a < c) { - return -1; - } - if (a > c) { - return 1; - } - return 0; - }); - var obj; - result.forEach(function (element) { - obj = {}; - obj[element[0]] = element[1]; - _this.loadFromJSON(unflatten(obj), CMIElement); - }); - }; - BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { - if (!this.isNotInitialized()) { - console.error("loadFromJSON can only be called before the call to lmsInitialize."); - return; - } - CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; - this.startingData = json; - for (var key in json) { - if ({}.hasOwnProperty.call(json, key) && json[key]) { - var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; - var value = json[key]; - if (value["childArray"]) { - for (var i = 0; i < value["childArray"].length; i++) { - this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); - } - } - else if (value.constructor === Object) { - this.loadFromJSON(value, currentCMIElement); - } - else { - this.setCMIValue(currentCMIElement, value); - } - } - } - }; - BaseAPI.prototype.renderCMIToJSONString = function () { - var cmi = this.cmi; - if (this.settings.sendFullCommit) { - return JSON.stringify({ cmi: cmi }); - } - return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); - }; - BaseAPI.prototype.renderCMIToJSONObject = function () { - return JSON.parse(this.renderCMIToJSONString()); - }; - BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { - return __awaiter(this, arguments, void 0, function (url, params, immediate) { - var api, genericError, process, debouncedProcess; - var _this = this; - if (immediate === void 0) { immediate = false; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - api = this; - genericError = { - result: api_constants.global.SCORM_FALSE, - errorCode: this.error_codes.GENERAL, - }; - if (immediate) { - this.performFetch(url, params).then(function (response) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.transformResponse(response)]; - case 1: - _a.sent(); - return [2]; - } - }); - }); }); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - process = function (url, params, settings) { return __awaiter(_this, void 0, void 0, function () { - var response, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - params = settings.requestHandler(params); - return [4, this.performFetch(url, params)]; - case 1: - response = _a.sent(); - return [2, this.transformResponse(response)]; - case 2: - e_1 = _a.sent(); - this.apiLog("processHttpRequest", e_1, api_constants.global.LOG_LEVEL_ERROR); - api.processListeners("CommitError"); - return [2, genericError]; - case 3: return [2]; - } - }); - }); }; - if (!this.settings.asyncCommit) return [3, 1]; - debouncedProcess = debounce(process, 500, immediate); - debouncedProcess(url, params, this.settings); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - case 1: return [4, process(url, params, this.settings)]; - case 2: return [2, _a.sent()]; - } - }); - }); - }; - BaseAPI.prototype.scheduleCommit = function (when, callback) { - this._timeout = new ScheduledCommit(this, when, callback); - this.apiLog("scheduleCommit", "scheduled", api_constants.global.LOG_LEVEL_DEBUG, ""); - }; - BaseAPI.prototype.clearScheduledCommit = function () { - if (this._timeout) { - this._timeout.cancel(); - this._timeout = undefined; - this.apiLog("clearScheduledCommit", "cleared", api_constants.global.LOG_LEVEL_DEBUG, ""); - } - }; - BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { - return (Object.hasOwnProperty.call(refObject, attribute) || - Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || - attribute in refObject); - }; - BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { - if (e instanceof ValidationError) { - this.lastErrorCode = String(e.errorCode); - returnValue = api_constants.global.SCORM_FALSE; - } - else { - if (e instanceof Error && e.message) { - console.error(e.message); - } - else { - console.error(e); - } - this.throwSCORMError(this._error_codes.GENERAL); - } - return returnValue; - }; - BaseAPI.prototype.performFetch = function (url, params) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, fetch(url, { - method: "POST", - body: params instanceof Array ? params.join("&") : JSON.stringify(params), - headers: __assign(__assign({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), - credentials: this.settings.xhrWithCredentials ? "include" : undefined, - keepalive: true, - })]; - }); - }); - }; - BaseAPI.prototype.transformResponse = function (response) { - return __awaiter(this, void 0, void 0, function () { - var result, _a; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; - return [4, this.settings.responseHandler(response)]; - case 1: - _a = _c.sent(); - return [3, 4]; - case 2: return [4, response.json()]; - case 3: - _a = _c.sent(); - _c.label = 4; - case 4: - result = _a; - if (response.status >= 200 && - response.status <= 299 && - (result.result === true || - result.result === api_constants.global.SCORM_TRUE)) { - this.processListeners("CommitSuccess"); - } - else { - this.processListeners("CommitError"); - } - return [2, result]; - } - }); - }); - }; - return BaseAPI; -}()); -/* harmony default export */ var src_BaseAPI = (BaseAPI); - -;// ./src/constants/regex.ts - -var regex_scorm12 = { - CMIString256: "^.{0,255}$", - CMIString4096: "^.{0,4096}$", - CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", - CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", - CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", - CMIFeedback: "^.{0,255}$", - CMIIndex: "[._](\\d+).", - CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", - CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", - CMIExit: "^(time-out|suspend|logout|)$", - CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", - CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", - NAVEvent: "^(previous|continue)$", - score_range: "0#100", - audio_range: "-1#100", - speed_range: "-100#100", - weighting_range: "-100#100", - text_range: "-1#1", -}; -var regex_aicc = __assign(__assign({}, regex_scorm12), { - CMIIdentifier: "^\\w{1,255}$", -}); -var regex_scorm2004 = { - CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", - CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", - CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", - CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", - CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", - CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", - CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", - CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", - CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", - CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", - CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", - CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", - CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", - CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", - CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", - CMIFeedback: "^.*$", - CMIIndex: "[._](\\d+).", - CMIIndexStore: ".N(\\d+).", - CMICStatus: "^(completed|incomplete|not attempted|unknown)$", - CMISStatus: "^(passed|failed|unknown)$", - CMIExit: "^(time-out|suspend|logout|normal)$", - CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", - CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", - NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", - NAVBoolean: "^(unknown|true|false$)", - NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", - scaled_range: "-1#1", - audio_range: "0#*", - speed_range: "0#*", - text_range: "-1#1", - progress_range: "0#1", -}; -var Regex = { - aicc: regex_aicc, - scorm12: regex_scorm12, - scorm2004: regex_scorm2004, -}; -/* harmony default export */ var regex = (Regex); - -;// ./src/cmi/common/validation.ts -function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { - if (typeof value !== "string") { - return false; - } - var formatRegex = new RegExp(regexPattern); - var matches = value.match(formatRegex); - if (allowEmptyString && value === "") { - return true; - } - if (value === undefined || !matches || matches[0] === "") { - throw new errorClass(errorCode); - } - return true; -} -function checkValidRange(value, rangePattern, errorCode, errorClass) { - var ranges = rangePattern.split("#"); - value = value * 1.0; - if (value >= ranges[0]) { - if (ranges[1] === "*" || value <= ranges[1]) { - return true; - } - else { - throw new errorClass(errorCode); - } - } - else { - throw new errorClass(errorCode); - } -} - -;// ./src/cmi/scorm2004/validation.ts - - - -function check2004ValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, error_codes.scorm2004.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString); -} -function check2004ValidRange(value, rangePattern) { - return checkValidRange(value, rangePattern, error_codes.scorm2004.VALUE_OUT_OF_RANGE, Scorm2004ValidationError); -} - -;// ./src/cmi/scorm2004/learner_preference.ts - - - - - - - -var CMILearnerPreference = (function (_super) { - __extends(CMILearnerPreference, _super); - function CMILearnerPreference() { - var _this = _super.call(this) || this; - _this.__children = api_constants.scorm2004.student_preference_children; - _this._audio_level = "1"; - _this._language = ""; - _this._delivery_speed = "1"; - _this._audio_captioning = "0"; - return _this; - } - Object.defineProperty(CMILearnerPreference.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "audio_level", { - get: function () { - return this._audio_level; - }, - set: function (audio_level) { - if (check2004ValidFormat(audio_level, regex.scorm2004.CMIDecimal) && - check2004ValidRange(audio_level, regex.scorm2004.audio_range)) { - this._audio_level = audio_level; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "language", { - get: function () { - return this._language; - }, - set: function (language) { - if (check2004ValidFormat(language, regex.scorm2004.CMILang)) { - this._language = language; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "delivery_speed", { - get: function () { - return this._delivery_speed; - }, - set: function (delivery_speed) { - if (check2004ValidFormat(delivery_speed, regex.scorm2004.CMIDecimal) && - check2004ValidRange(delivery_speed, regex.scorm2004.speed_range)) { - this._delivery_speed = delivery_speed; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "audio_captioning", { - get: function () { - return this._audio_captioning; - }, - set: function (audio_captioning) { - if (check2004ValidFormat(audio_captioning, regex.scorm2004.CMISInteger) && - check2004ValidRange(audio_captioning, regex.scorm2004.text_range)) { - this._audio_captioning = audio_captioning; - } - }, - enumerable: false, - configurable: true - }); - CMILearnerPreference.prototype.toJSON = function () { - this.jsonString = true; - var result = { - audio_level: this.audio_level, - language: this.language, - delivery_speed: this.delivery_speed, - audio_captioning: this.audio_captioning, - }; - delete this.jsonString; - return result; - }; - return CMILearnerPreference; -}(BaseCMI)); - - -;// ./src/constants/response_constants.ts - -var scorm2004_regex = regex.scorm2004; -var LearnerResponses = { - "true-false": { - format: "^true$|^false$", - max: 1, - delimiter: "", - unique: false, - }, - choice: { - format: scorm2004_regex.CMILongIdentifier, - max: 36, - delimiter: "[,]", - unique: true, - }, - "fill-in": { - format: scorm2004_regex.CMILangString250, - max: 10, - delimiter: "[,]", - unique: false, - }, - "long-fill-in": { - format: scorm2004_regex.CMILangString4000, - max: 1, - delimiter: "", - unique: false, - }, - matching: { - format: scorm2004_regex.CMIShortIdentifier, - format2: scorm2004_regex.CMIShortIdentifier, - max: 36, - delimiter: "[,]", - delimiter2: "[.]", - unique: false, - }, - performance: { - format: "^$|" + scorm2004_regex.CMIShortIdentifier, - format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier, - max: 250, - delimiter: "[,]", - delimiter2: "[.]", - unique: false, - }, - sequencing: { - format: scorm2004_regex.CMIShortIdentifier, - max: 36, - delimiter: "[,]", - unique: false, - }, - likert: { - format: scorm2004_regex.CMIShortIdentifier, - max: 1, - delimiter: "", - unique: false, - }, - numeric: { - format: scorm2004_regex.CMIDecimal, - max: 1, - delimiter: "", - unique: false, - }, - other: { - format: scorm2004_regex.CMIString4000, - max: 1, - delimiter: "", - unique: false, - }, -}; -var CorrectResponses = { - "true-false": { - max: 1, - delimiter: "", - unique: false, - duplicate: false, - format: "^true$|^false$", - limit: 1, - }, - choice: { - max: 36, - delimiter: "[,]", - unique: true, - duplicate: false, - format: scorm2004_regex.CMILongIdentifier, - }, - "fill-in": { - max: 10, - delimiter: "[,]", - unique: false, - duplicate: false, - format: scorm2004_regex.CMILangString250cr, - }, - "long-fill-in": { - max: 1, - delimiter: "", - unique: false, - duplicate: true, - format: scorm2004_regex.CMILangString4000, - }, - matching: { - max: 36, - delimiter: "[,]", - delimiter2: "[.]", - unique: false, - duplicate: false, - format: scorm2004_regex.CMIShortIdentifier, - format2: scorm2004_regex.CMIShortIdentifier, - }, - performance: { - max: 250, - delimiter: "[,]", - delimiter2: "[.]", - delimiter3: "[:]", - unique: false, - duplicate: false, - format: "^$|" + scorm2004_regex.CMIShortIdentifier, - format2: scorm2004_regex.CMIDecimal + "|^$|" + scorm2004_regex.CMIShortIdentifier, - }, - sequencing: { - max: 36, - delimiter: "[,]", - unique: false, - duplicate: false, - format: scorm2004_regex.CMIShortIdentifier, - }, - likert: { - max: 1, - delimiter: "", - unique: false, - duplicate: false, - format: scorm2004_regex.CMIShortIdentifier, - limit: 1, - }, - numeric: { - max: 2, - delimiter: "[:]", - unique: false, - duplicate: false, - format: scorm2004_regex.CMIDecimal, - limit: 1, - }, - other: { - max: 1, - delimiter: "", - unique: false, - duplicate: false, - format: scorm2004_regex.CMIString4000, - limit: 1, - }, -}; - -;// ./src/cmi/scorm2004/interactions.ts - - - - - - - - - -var CMIInteractions = (function (_super) { - __extends(CMIInteractions, _super); - function CMIInteractions() { - return _super.call(this, { - children: api_constants.scorm2004.interactions_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - }) || this; - } - return CMIInteractions; -}(CMIArray)); - -var CMIInteractionsObject = (function (_super) { - __extends(CMIInteractionsObject, _super); - function CMIInteractionsObject() { - var _this = _super.call(this) || this; - _this._id = ""; - _this._type = ""; - _this._timestamp = ""; - _this._weighting = ""; - _this._learner_response = ""; - _this._result = ""; - _this._latency = ""; - _this._description = ""; - _this.objectives = new CMIArray({ - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - children: api_constants.scorm2004.objectives_children, - }); - _this.correct_responses = new CMIArray({ - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - children: api_constants.scorm2004.correct_responses_children, - }); - return _this; - } - CMIInteractionsObject.prototype.initialize = function () { - var _a, _b; - _super.prototype.initialize.call(this); - (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); - }; - Object.defineProperty(CMIInteractionsObject.prototype, "id", { - get: function () { - return this._id; - }, - set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "type", { - get: function () { - return this._type; - }, - set: function (type) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(type, regex.scorm2004.CMIType)) { - this._type = type; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "timestamp", { - get: function () { - return this._timestamp; - }, - set: function (timestamp) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(timestamp, regex.scorm2004.CMITime)) { - this._timestamp = timestamp; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { - get: function () { - return this._weighting; - }, - set: function (weighting) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(weighting, regex.scorm2004.CMIDecimal)) { - this._weighting = weighting; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "learner_response", { - get: function () { - return this._learner_response; - }, - set: function (learner_response) { - if (this.initialized && (this._type === "" || this._id === "")) { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - var nodes = []; - var response_type = LearnerResponses[this.type]; - if (response_type) { - if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { - nodes = learner_response.split(response_type.delimiter); - } - else { - nodes[0] = learner_response; - } - if (nodes.length > 0 && nodes.length <= response_type.max) { - var formatRegex = new RegExp(response_type.format); - for (var i = 0; i < nodes.length; i++) { - if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter2) { - var values = nodes[i].split(response_type.delimiter2); - if (values.length === 2) { - if (!values[0].match(formatRegex)) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - else { - if (!response_type.format2 || - !values[1].match(new RegExp(response_type.format2))) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - else { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - else { - if (!nodes[i].match(formatRegex)) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - else { - if (nodes[i] !== "" && response_type.unique) { - for (var j = 0; j < i; j++) { - if (nodes[i] === nodes[j]) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - } - } - } - } - else { - throw new Scorm2004ValidationError(error_codes.scorm2004.GENERAL_SET_FAILURE); - } - this._learner_response = learner_response; - } - else { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "result", { - get: function () { - return this._result; - }, - set: function (result) { - if (check2004ValidFormat(result, regex.scorm2004.CMIResult)) { - this._result = result; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "latency", { - get: function () { - return this._latency; - }, - set: function (latency) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(latency, regex.scorm2004.CMITimespan)) { - this._latency = latency; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "description", { - get: function () { - return this._description; - }, - set: function (description) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(description, regex.scorm2004.CMILangString250, true)) { - this._description = description; - } - } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - type: this.type, - objectives: this.objectives, - timestamp: this.timestamp, - weighting: this.weighting, - learner_response: this.learner_response, - result: this.result, - latency: this.latency, - description: this.description, - correct_responses: this.correct_responses, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObject; -}(BaseCMI)); - -var CMIInteractionsObjectivesObject = (function (_super) { - __extends(CMIInteractionsObjectivesObject, _super); - function CMIInteractionsObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; - return _this; - } - Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { - get: function () { - return this._id; - }, - set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObjectivesObject; -}(BaseCMI)); - -var CMIInteractionsCorrectResponsesObject = (function (_super) { - __extends(CMIInteractionsCorrectResponsesObject, _super); - function CMIInteractionsCorrectResponsesObject() { - var _this = _super.call(this) || this; - _this._pattern = ""; - return _this; - } - Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { - get: function () { - return this._pattern; - }, - set: function (pattern) { - if (check2004ValidFormat(pattern, regex.scorm2004.CMIFeedback)) { - this._pattern = pattern; - } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - pattern: this.pattern, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsCorrectResponsesObject; -}(BaseCMI)); - - -;// ./src/cmi/common/score.ts - - - - - - -var scorm12_constants = api_constants.scorm12; -var scorm12_regex = regex.scorm12; -var score_scorm12_error_codes = error_codes.scorm12; -var CMIScore = (function (_super) { - __extends(CMIScore, _super); - function CMIScore(params) { - var _this = _super.call(this) || this; - _this._raw = ""; - _this._min = ""; - _this.__children = params.score_children || scorm12_constants.score_children; - _this.__score_range = !params.score_range - ? false - : scorm12_regex.score_range; - _this._max = params.max || params.max === "" ? params.max : "100"; - _this.__invalid_error_code = - params.invalidErrorCode || score_scorm12_error_codes.INVALID_SET_VALUE; - _this.__invalid_type_code = - params.invalidTypeCode || score_scorm12_error_codes.TYPE_MISMATCH; - _this.__invalid_range_code = - params.invalidRangeCode || score_scorm12_error_codes.VALUE_OUT_OF_RANGE; - _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; - _this.__error_class = params.errorClass; - return _this; - } - Object.defineProperty(CMIScore.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new this.__error_class(this.__invalid_error_code); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "raw", { - get: function () { - return this._raw; - }, - set: function (raw) { - if (checkValidFormat(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._raw = raw; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "min", { - get: function () { - return this._min; - }, - set: function (min) { - if (checkValidFormat(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._min = min; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "max", { - get: function () { - return this._max; - }, - set: function (max) { - if (checkValidFormat(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._max = max; - } - }, - enumerable: false, - configurable: true - }); - CMIScore.prototype.toJSON = function () { - this.jsonString = true; - var result = { - raw: this.raw, - min: this.min, - max: this.max, - }; - delete this.jsonString; - return result; - }; - return CMIScore; -}(BaseCMI)); - - -;// ./src/cmi/scorm2004/score.ts - - - - - - - -var Scorm2004CMIScore = (function (_super) { - __extends(Scorm2004CMIScore, _super); - function Scorm2004CMIScore() { - var _this = _super.call(this, { - score_children: api_constants.scorm2004.score_children, - max: "", - invalidErrorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - invalidTypeCode: error_codes.scorm2004.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm2004.VALUE_OUT_OF_RANGE, - decimalRegex: regex.scorm2004.CMIDecimal, - errorClass: Scorm2004ValidationError, - }) || this; - _this._scaled = ""; - return _this; - } - Object.defineProperty(Scorm2004CMIScore.prototype, "scaled", { - get: function () { - return this._scaled; - }, - set: function (scaled) { - if (check2004ValidFormat(scaled, regex.scorm2004.CMIDecimal) && - check2004ValidRange(scaled, regex.scorm2004.scaled_range)) { - this._scaled = scaled; - } - }, - enumerable: false, - configurable: true - }); - Scorm2004CMIScore.prototype.toJSON = function () { - this.jsonString = true; - var result = { - scaled: this.scaled, - raw: this.raw, - min: this.min, - max: this.max, - }; - delete this.jsonString; - return result; - }; - return Scorm2004CMIScore; -}(CMIScore)); - - -;// ./src/cmi/scorm2004/comments.ts - - - - - - - - -var CMICommentsFromLMS = (function (_super) { - __extends(CMICommentsFromLMS, _super); - function CMICommentsFromLMS() { - return _super.call(this, { - children: api_constants.scorm2004.comments_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - }) || this; - } - return CMICommentsFromLMS; -}(CMIArray)); - -var CMICommentsFromLearner = (function (_super) { - __extends(CMICommentsFromLearner, _super); - function CMICommentsFromLearner() { - return _super.call(this, { - children: api_constants.scorm2004.comments_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - }) || this; - } - return CMICommentsFromLearner; -}(CMIArray)); - -var CMICommentsObject = (function (_super) { - __extends(CMICommentsObject, _super); - function CMICommentsObject(readOnlyAfterInit) { - if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; } - var _this = _super.call(this) || this; - _this._comment = ""; - _this._location = ""; - _this._timestamp = ""; - _this._comment = ""; - _this._location = ""; - _this._timestamp = ""; - _this._readOnlyAfterInit = readOnlyAfterInit; - return _this; - } - Object.defineProperty(CMICommentsObject.prototype, "comment", { - get: function () { - return this._comment; - }, - set: function (comment) { - if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - if (check2004ValidFormat(comment, regex.scorm2004.CMILangString4000, true)) { - this._comment = comment; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICommentsObject.prototype, "location", { - get: function () { - return this._location; - }, - set: function (location) { - if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - if (check2004ValidFormat(location, regex.scorm2004.CMIString250)) { - this._location = location; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICommentsObject.prototype, "timestamp", { - get: function () { - return this._timestamp; - }, - set: function (timestamp) { - if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - if (check2004ValidFormat(timestamp, regex.scorm2004.CMITime)) { - this._timestamp = timestamp; - } - } - }, - enumerable: false, - configurable: true - }); - CMICommentsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - comment: this.comment, - location: this.location, - timestamp: this.timestamp, - }; - delete this.jsonString; - return result; - }; - return CMICommentsObject; -}(BaseCMI)); - - -;// ./src/cmi/scorm2004/objectives.ts - - - - - - - - - -var CMIObjectives = (function (_super) { - __extends(CMIObjectives, _super); - function CMIObjectives() { - return _super.call(this, { - children: api_constants.scorm2004.objectives_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - }) || this; - } - return CMIObjectives; -}(CMIArray)); - -var CMIObjectivesObject = (function (_super) { - __extends(CMIObjectivesObject, _super); - function CMIObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; - _this._success_status = "unknown"; - _this._completion_status = "unknown"; - _this._progress_measure = ""; - _this._description = ""; - _this.score = new Scorm2004CMIScore(); - return _this; - } - CMIObjectivesObject.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(CMIObjectivesObject.prototype, "id", { - get: function () { - return this._id; - }, - set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIObjectivesObject.prototype, "success_status", { - get: function () { - return this._success_status; - }, - set: function (success_status) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(success_status, regex.scorm2004.CMISStatus)) { - this._success_status = success_status; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIObjectivesObject.prototype, "completion_status", { - get: function () { - return this._completion_status; - }, - set: function (completion_status) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(completion_status, regex.scorm2004.CMICStatus)) { - this._completion_status = completion_status; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIObjectivesObject.prototype, "progress_measure", { - get: function () { - return this._progress_measure; - }, - set: function (progress_measure) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(progress_measure, regex.scorm2004.CMIDecimal) && - check2004ValidRange(progress_measure, regex.scorm2004.progress_range)) { - this._progress_measure = progress_measure; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIObjectivesObject.prototype, "description", { - get: function () { - return this._description; - }, - set: function (description) { - if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - if (check2004ValidFormat(description, regex.scorm2004.CMILangString250, true)) { - this._description = description; - } - } - }, - enumerable: false, - configurable: true - }); - CMIObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - success_status: this.success_status, - completion_status: this.completion_status, - progress_measure: this.progress_measure, - description: this.description, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMIObjectivesObject; -}(BaseCMI)); - - -;// ./src/cmi/scorm2004/cmi.ts - - - - - - - - - - - - - -var CMI = (function (_super) { - __extends(CMI, _super); - function CMI(initialized) { - if (initialized === void 0) { initialized = false; } - var _this = _super.call(this) || this; - _this.__version = "1.0"; - _this.__children = api_constants.scorm2004.cmi_children; - _this._completion_status = "unknown"; - _this._completion_threshold = ""; - _this._credit = "credit"; - _this._entry = ""; - _this._exit = ""; - _this._launch_data = ""; - _this._learner_id = ""; - _this._learner_name = ""; - _this._location = ""; - _this._max_time_allowed = ""; - _this._mode = "normal"; - _this._progress_measure = ""; - _this._scaled_passing_score = ""; - _this._session_time = "PT0H0M0S"; - _this._success_status = "unknown"; - _this._suspend_data = ""; - _this._time_limit_action = "continue,no message"; - _this._total_time = ""; - _this.learner_preference = new CMILearnerPreference(); - _this.score = new Scorm2004CMIScore(); - _this.comments_from_learner = new CMICommentsFromLearner(); - _this.comments_from_lms = new CMICommentsFromLMS(); - _this.interactions = new CMIInteractions(); - _this.objectives = new CMIObjectives(); - if (initialized) - _this.initialize(); - return _this; - } - CMI.prototype.initialize = function () { - var _a, _b, _c, _d, _e, _f; - _super.prototype.initialize.call(this); - (_a = this.learner_preference) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.score) === null || _b === void 0 ? void 0 : _b.initialize(); - (_c = this.comments_from_learner) === null || _c === void 0 ? void 0 : _c.initialize(); - (_d = this.comments_from_lms) === null || _d === void 0 ? void 0 : _d.initialize(); - (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); - (_f = this.objectives) === null || _f === void 0 ? void 0 : _f.initialize(); - }; - Object.defineProperty(CMI.prototype, "_version", { - get: function () { - return this.__version; - }, - set: function (_version) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "completion_status", { - get: function () { - return this._completion_status; - }, - set: function (completion_status) { - if (check2004ValidFormat(completion_status, regex.scorm2004.CMICStatus)) { - this._completion_status = completion_status; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "completion_threshold", { - get: function () { - return this._completion_threshold; - }, - set: function (completion_threshold) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._completion_threshold = completion_threshold; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "credit", { - get: function () { - return this._credit; - }, - set: function (credit) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._credit = credit; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "entry", { - get: function () { - return this._entry; - }, - set: function (entry) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._entry = entry; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "exit", { - get: function () { - if (!this.jsonString) { - throw new Scorm2004ValidationError(error_codes.scorm2004.WRITE_ONLY_ELEMENT); - } - return this._exit; - }, - set: function (exit) { - if (check2004ValidFormat(exit, regex.scorm2004.CMIExit, true)) { - this._exit = exit; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "launch_data", { - get: function () { - return this._launch_data; - }, - set: function (launch_data) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._launch_data = launch_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "learner_id", { - get: function () { - return this._learner_id; - }, - set: function (learner_id) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._learner_id = learner_id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "learner_name", { - get: function () { - return this._learner_name; - }, - set: function (learner_name) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._learner_name = learner_name; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "location", { - get: function () { - return this._location; - }, - set: function (location) { - if (check2004ValidFormat(location, regex.scorm2004.CMIString1000)) { - this._location = location; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "max_time_allowed", { - get: function () { - return this._max_time_allowed; - }, - set: function (max_time_allowed) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._max_time_allowed = max_time_allowed; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "mode", { - get: function () { - return this._mode; - }, - set: function (mode) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._mode = mode; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "progress_measure", { - get: function () { - return this._progress_measure; - }, - set: function (progress_measure) { - if (check2004ValidFormat(progress_measure, regex.scorm2004.CMIDecimal) && - check2004ValidRange(progress_measure, regex.scorm2004.progress_range)) { - this._progress_measure = progress_measure; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "scaled_passing_score", { - get: function () { - return this._scaled_passing_score; - }, - set: function (scaled_passing_score) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._scaled_passing_score = scaled_passing_score; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "session_time", { - get: function () { - if (!this.jsonString) { - throw new Scorm2004ValidationError(error_codes.scorm2004.WRITE_ONLY_ELEMENT); - } - return this._session_time; - }, - set: function (session_time) { - if (check2004ValidFormat(session_time, regex.scorm2004.CMITimespan)) { - this._session_time = session_time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "success_status", { - get: function () { - return this._success_status; - }, - set: function (success_status) { - if (check2004ValidFormat(success_status, regex.scorm2004.CMISStatus)) { - this._success_status = success_status; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "suspend_data", { - get: function () { - return this._suspend_data; - }, - set: function (suspend_data) { - if (check2004ValidFormat(suspend_data, regex.scorm2004.CMIString64000, true)) { - this._suspend_data = suspend_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "time_limit_action", { - get: function () { - return this._time_limit_action; - }, - set: function (time_limit_action) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._time_limit_action = time_limit_action; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "total_time", { - get: function () { - return this._total_time; - }, - set: function (total_time) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - else { - this._total_time = total_time; - } - }, - enumerable: false, - configurable: true - }); - CMI.prototype.getCurrentTotalTime = function () { - var sessionTime = this._session_time; - var startTime = this.start_time; - if (typeof startTime !== "undefined" && startTime !== null) { - var seconds = new Date().getTime() - startTime; - sessionTime = getSecondsAsISODuration(seconds / 1000); - } - return addTwoDurations(this._total_time, sessionTime, regex.scorm2004.CMITimespan); - }; - CMI.prototype.toJSON = function () { - this.jsonString = true; - var result = { - comments_from_learner: this.comments_from_learner, - comments_from_lms: this.comments_from_lms, - completion_status: this.completion_status, - completion_threshold: this.completion_threshold, - credit: this.credit, - entry: this.entry, - exit: this.exit, - interactions: this.interactions, - launch_data: this.launch_data, - learner_id: this.learner_id, - learner_name: this.learner_name, - learner_preference: this.learner_preference, - location: this.location, - max_time_allowed: this.max_time_allowed, - mode: this.mode, - objectives: this.objectives, - progress_measure: this.progress_measure, - scaled_passing_score: this.scaled_passing_score, - score: this.score, - session_time: this.session_time, - success_status: this.success_status, - suspend_data: this.suspend_data, - time_limit_action: this.time_limit_action, - }; - delete this.jsonString; - return result; - }; - return CMI; -}(BaseRootCMI)); - - -;// ./src/constants/language_constants.ts -var ValidLanguages = [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bh", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "he", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mo", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "sh", - "si", - "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yo", - "za", - "zh", - "zu", - "aar", - "abk", - "ave", - "afr", - "aka", - "amh", - "arg", - "ara", - "asm", - "ava", - "aym", - "aze", - "bak", - "bel", - "bul", - "bih", - "bis", - "bam", - "ben", - "tib", - "bod", - "bre", - "bos", - "cat", - "che", - "cha", - "cos", - "cre", - "cze", - "ces", - "chu", - "chv", - "wel", - "cym", - "dan", - "ger", - "deu", - "div", - "dzo", - "ewe", - "gre", - "ell", - "eng", - "epo", - "spa", - "est", - "baq", - "eus", - "per", - "fas", - "ful", - "fin", - "fij", - "fao", - "fre", - "fra", - "fry", - "gle", - "gla", - "glg", - "grn", - "guj", - "glv", - "hau", - "heb", - "hin", - "hmo", - "hrv", - "hat", - "hun", - "arm", - "hye", - "her", - "ina", - "ind", - "ile", - "ibo", - "iii", - "ipk", - "ido", - "ice", - "isl", - "ita", - "iku", - "jpn", - "jav", - "geo", - "kat", - "kon", - "kik", - "kua", - "kaz", - "kal", - "khm", - "kan", - "kor", - "kau", - "kas", - "kur", - "kom", - "cor", - "kir", - "lat", - "ltz", - "lug", - "lim", - "lin", - "lao", - "lit", - "lub", - "lav", - "mlg", - "mah", - "mao", - "mri", - "mac", - "mkd", - "mal", - "mon", - "mol", - "mar", - "may", - "msa", - "mlt", - "bur", - "mya", - "nau", - "nob", - "nde", - "nep", - "ndo", - "dut", - "nld", - "nno", - "nor", - "nbl", - "nav", - "nya", - "oci", - "oji", - "orm", - "ori", - "oss", - "pan", - "pli", - "pol", - "pus", - "por", - "que", - "roh", - "run", - "rum", - "ron", - "rus", - "kin", - "san", - "srd", - "snd", - "sme", - "sag", - "slo", - "sin", - "slk", - "slv", - "smo", - "sna", - "som", - "alb", - "sqi", - "srp", - "ssw", - "sot", - "sun", - "swe", - "swa", - "tam", - "tel", - "tgk", - "tha", - "tir", - "tuk", - "tgl", - "tsn", - "ton", - "tur", - "tso", - "tat", - "twi", - "tah", - "uig", - "ukr", - "urd", - "uzb", - "ven", - "vie", - "vol", - "wln", - "wol", - "xho", - "yid", - "yor", - "zha", - "chi", - "zho", - "zul", -]; -/* harmony default export */ var language_constants = (ValidLanguages); - -;// ./src/constants/enums.ts -var NAVBoolean; -(function (NAVBoolean) { - NAVBoolean["unknown"] = "unknown"; - NAVBoolean["true"] = "true"; - NAVBoolean["false"] = "false"; -})(NAVBoolean || (NAVBoolean = {})); -var SuccessStatus; -(function (SuccessStatus) { - SuccessStatus["passed"] = "passed"; - SuccessStatus["failed"] = "failed"; - SuccessStatus["unknown"] = "unknown"; -})(SuccessStatus || (SuccessStatus = {})); -var CompletionStatus; -(function (CompletionStatus) { - CompletionStatus["completed"] = "completed"; - CompletionStatus["incomplete"] = "incomplete"; - CompletionStatus["unknown"] = "unknown"; -})(CompletionStatus || (CompletionStatus = {})); - -;// ./src/cmi/scorm2004/adl.ts - - - - - - - -var ADL = (function (_super) { - __extends(ADL, _super); - function ADL() { - var _this = _super.call(this) || this; - _this.nav = new ADLNav(); - return _this; - } - ADL.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - ADL.prototype.toJSON = function () { - this.jsonString = true; - var result = { - nav: this.nav, - }; - delete this.jsonString; - return result; - }; - return ADL; -}(BaseCMI)); - -var ADLNav = (function (_super) { - __extends(ADLNav, _super); - function ADLNav() { - var _this = _super.call(this) || this; - _this._request = "_none_"; - _this.request_valid = new ADLNavRequestValid(); - return _this; - } - ADLNav.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(ADLNav.prototype, "request", { - get: function () { - return this._request; - }, - set: function (request) { - if (check2004ValidFormat(request, regex.scorm2004.NAVEvent)) { - this._request = request; - } - }, - enumerable: false, - configurable: true - }); - ADLNav.prototype.toJSON = function () { - this.jsonString = true; - var result = { - request: this.request, - }; - delete this.jsonString; - return result; - }; - return ADLNav; -}(BaseCMI)); - -var ADLNavRequestValid = (function (_super) { - __extends(ADLNavRequestValid, _super); - function ADLNavRequestValid() { - var _this = _super.call(this) || this; - _this._continue = "unknown"; - _this._previous = "unknown"; - _this._choice = {}; - _this._jump = {}; - return _this; - } - Object.defineProperty(ADLNavRequestValid.prototype, "continue", { - get: function () { - return this._continue; - }, - set: function (_continue) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (check2004ValidFormat(_continue, regex.scorm2004.NAVBoolean)) { - this._continue = _continue; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ADLNavRequestValid.prototype, "previous", { - get: function () { - return this._previous; - }, - set: function (_previous) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (check2004ValidFormat(_previous, regex.scorm2004.NAVBoolean)) { - this._previous = _previous; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ADLNavRequestValid.prototype, "choice", { - get: function () { - return this._choice; - }, - set: function (choice) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (typeof choice !== "object") { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - for (var key in choice) { - if ({}.hasOwnProperty.call(choice, key)) { - if (check2004ValidFormat(choice[key], regex.scorm2004.NAVBoolean) && - check2004ValidFormat(key, regex.scorm2004.NAVTarget)) { - this._choice[key] = - NAVBoolean[choice[key]]; - } - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ADLNavRequestValid.prototype, "jump", { - get: function () { - return this._jump; - }, - set: function (jump) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (typeof jump !== "object") { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - for (var key in jump) { - if ({}.hasOwnProperty.call(jump, key)) { - if (check2004ValidFormat(jump[key], regex.scorm2004.NAVBoolean) && - check2004ValidFormat(key, regex.scorm2004.NAVTarget)) { - this._jump[key] = NAVBoolean[jump[key]]; - } - } - } - }, - enumerable: false, - configurable: true - }); - ADLNavRequestValid.prototype.toJSON = function () { - this.jsonString = true; - var result = { - previous: this._previous, - continue: this._continue, - choice: this._choice, - jump: this._jump, - }; - delete this.jsonString; - return result; - }; - return ADLNavRequestValid; -}(BaseCMI)); - - -;// ./src/Scorm2004API.ts - - - - - - - - - - - - - - - - -var Scorm2004API = (function (_super) { - __extends(Scorm2004API, _super); - function Scorm2004API(settings) { - var _this = this; - if (settings) { - if (settings.mastery_override === undefined) { - settings.mastery_override = false; - } - } - _this = _super.call(this, error_codes.scorm2004, settings) || this; - _this._version = "1.0"; - _this.cmi = new CMI(); - _this.adl = new ADL(); - _this.Initialize = _this.lmsInitialize; - _this.Terminate = _this.lmsFinish; - _this.GetValue = _this.lmsGetValue; - _this.SetValue = _this.lmsSetValue; - _this.Commit = _this.lmsCommit; - _this.GetLastError = _this.lmsGetLastError; - _this.GetErrorString = _this.lmsGetErrorString; - _this.GetDiagnostic = _this.lmsGetDiagnostic; - return _this; - } - Scorm2004API.prototype.reset = function (settings) { - this.commonReset(settings); - this.cmi = new CMI(); - this.adl = new ADL(); - }; - Object.defineProperty(Scorm2004API.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: false, - configurable: true - }); - Scorm2004API.prototype.lmsInitialize = function () { - this.cmi.initialize(); - return this.initialize("Initialize"); - }; - Scorm2004API.prototype.lmsFinish = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.internalFinish()]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm2004API.prototype.internalFinish = function () { - return __awaiter(this, void 0, void 0, function () { - var result, navActions, request, choiceJumpRegex, matches, target, action; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.terminate("Terminate", true)]; - case 1: - result = _a.sent(); - if (result === api_constants.global.SCORM_TRUE) { - if (this.adl.nav.request !== "_none_") { - navActions = { - continue: "SequenceNext", - previous: "SequencePrevious", - choice: "SequenceChoice", - jump: "SequenceJump", - exit: "SequenceExit", - exitAll: "SequenceExitAll", - abandon: "SequenceAbandon", - abandonAll: "SequenceAbandonAll", - }; - request = this.adl.nav.request; - choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent); - matches = request.match(choiceJumpRegex); - target = ""; - if (matches && matches.length > 2) { - target = matches[2]; - request = matches[1].replace(target, ""); - } - action = navActions[request]; - if (action) { - this.processListeners(action, "adl.nav.request", target); - } - } - else if (this.settings.autoProgress) { - this.processListeners("SequenceNext"); - } - } - return [2, result]; - } - }); - }); - }; - Scorm2004API.prototype.lmsGetValue = function (CMIElement) { - var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$"; - if (stringMatches(CMIElement, adlNavRequestRegex)) { - var matches = CMIElement.match(adlNavRequestRegex); - var request = matches[1]; - var target = matches[2].replace("{target=", "").replace("}", ""); - if (request === "choice" || request === "jump") { - if (this.settings.scoItemIdValidator) { - return String(this.settings.scoItemIdValidator(target)); - } - return String(this.settings.scoItemIds.includes(target)); - } - } - return this.getValue("GetValue", true, CMIElement); - }; - Scorm2004API.prototype.lmsSetValue = function (CMIElement, value) { - return this.setValue("SetValue", "Commit", true, CMIElement, value); - }; - Scorm2004API.prototype.lmsCommit = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.commit("Commit")]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm2004API.prototype.lmsGetLastError = function () { - return this.getLastError("GetLastError"); - }; - Scorm2004API.prototype.lmsGetErrorString = function (CMIErrorCode) { - return this.getErrorString("GetErrorString", CMIErrorCode); - }; - Scorm2004API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { - return this.getDiagnostic("GetDiagnostic", CMIErrorCode); - }; - Scorm2004API.prototype.setCMIValue = function (CMIElement, value) { - return this._commonSetCMIValue("SetValue", true, CMIElement, value); - }; - Scorm2004API.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.objectives\\.\\d+")) { - return new CMIObjectivesObject(); - } - if (foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { - return this.createCorrectResponsesObject(CMIElement, value); - } - else if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { - return new CMIInteractionsObjectivesObject(); - } - } - else if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+")) { - return new CMIInteractionsObject(); - } - if (stringMatches(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) { - return new CMICommentsObject(); - } - else if (stringMatches(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) { - return new CMICommentsObject(true); - } - return null; - }; - Scorm2004API.prototype.createCorrectResponsesObject = function (CMIElement, value) { - var parts = CMIElement.split("."); - var index = Number(parts[2]); - var interaction = this.cmi.interactions.childArray[index]; - if (this.isInitialized()) { - if (!interaction.type) { - this.throwSCORMError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - this.checkDuplicateChoiceResponse(interaction, value); - var response_type = CorrectResponses[interaction.type]; - if (response_type) { - this.checkValidResponseType(response_type, value, interaction.type); - } - else { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type); - } - } - } - if (this.lastErrorCode === "0") { - return new CMIInteractionsCorrectResponsesObject(); - } - return null; - }; - Scorm2004API.prototype.checkValidResponseType = function (response_type, value, interaction_type) { - var nodes = []; - if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { - nodes = String(value).split(response_type.delimiter); - } - else { - nodes[0] = value; - } - if (nodes.length > 0 && nodes.length <= response_type.max) { - this.checkCorrectResponseValue(interaction_type, nodes, value); - } - else if (nodes.length > response_type.max) { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long"); - } - }; - Scorm2004API.prototype.checkDuplicateChoiceResponse = function (interaction, value) { - var interaction_count = interaction.correct_responses._count; - if (interaction.type === "choice") { - for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) { - var response = interaction.correct_responses.childArray[i]; - if (response.pattern === value) { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE); - } - } - } - }; - Scorm2004API.prototype.validateCorrectResponse = function (CMIElement, value) { - var parts = CMIElement.split("."); - var index = Number(parts[2]); - var pattern_index = Number(parts[4]); - var interaction = this.cmi.interactions.childArray[index]; - var interaction_count = interaction.correct_responses._count; - this.checkDuplicateChoiceResponse(interaction, value); - var response_type = CorrectResponses[interaction.type]; - if (typeof response_type.limit === "undefined" || - interaction_count <= response_type.limit) { - this.checkValidResponseType(response_type, value, interaction.type); - if ((this.lastErrorCode === "0" && - (!response_type.duplicate || - !this.checkDuplicatedPattern(interaction.correct_responses, pattern_index, value))) || - (this.lastErrorCode === "0" && value === "")) { - } - else { - if (this.lastErrorCode === "0") { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists"); - } - } - } - else { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached"); - } - }; - Scorm2004API.prototype.getCMIValue = function (CMIElement) { - return this._commonGetCMIValue("GetValue", true, CMIElement); - }; - Scorm2004API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { - var basicMessage = ""; - var detailMessage = ""; - errorNumber = String(errorNumber); - if (api_constants.scorm2004.error_descriptions[errorNumber]) { - basicMessage = - api_constants.scorm2004.error_descriptions[errorNumber].basicMessage; - detailMessage = - api_constants.scorm2004.error_descriptions[errorNumber].detailMessage; - } - return detail ? detailMessage : basicMessage; - }; - Scorm2004API.prototype.checkDuplicatedPattern = function (correct_response, current_index, value) { - var found = false; - var count = correct_response._count; - for (var i = 0; i < count && !found; i++) { - if (i !== current_index && correct_response.childArray[i] === value) { - found = true; - } - } - return found; - }; - Scorm2004API.prototype.checkCorrectResponseValue = function (interaction_type, nodes, value) { - var response = CorrectResponses[interaction_type]; - var formatRegex = new RegExp(response.format); - for (var i = 0; i < nodes.length && this.lastErrorCode === "0"; i++) { - if (interaction_type.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")) { - nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]); - } - if (response === null || response === void 0 ? void 0 : response.delimiter2) { - var values = nodes[i].split(response.delimiter2); - if (values.length === 2) { - var matches = values[0].match(formatRegex); - if (!matches) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - else { - if (!response.format2 || - !values[1].match(new RegExp(response.format2))) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - else { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - else { - var matches = nodes[i].match(formatRegex); - if ((!matches && value !== "") || - (!matches && interaction_type === "true-false")) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - else { - if (interaction_type === "numeric" && nodes.length > 1) { - if (Number(nodes[0]) > Number(nodes[1])) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - else { - if (nodes[i] !== "" && response.unique) { - for (var j = 0; j < i && this.lastErrorCode === "0"; j++) { - if (nodes[i] === nodes[j]) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - } - } - } - } - }; - Scorm2004API.prototype.removeCorrectResponsePrefixes = function (node) { - var seenOrder = false; - var seenCase = false; - var seenLang = false; - var prefixRegex = new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"); - var matches = node.match(prefixRegex); - var langMatches = null; - while (matches) { - switch (matches[2]) { - case "lang": - langMatches = node.match(regex.scorm2004.CMILangcr); - if (langMatches) { - var lang = langMatches[3]; - if (lang !== undefined && lang.length > 0) { - if (!language_constants.includes(lang.toLowerCase())) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - seenLang = true; - break; - case "case_matters": - if (!seenLang && !seenOrder && !seenCase) { - if (matches[3] !== "true" && matches[3] !== "false") { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - seenCase = true; - break; - case "order_matters": - if (!seenCase && !seenLang && !seenOrder) { - if (matches[3] !== "true" && matches[3] !== "false") { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - seenOrder = true; - break; - } - node = node.substring(matches[1].length); - matches = node.match(prefixRegex); - } - return node; - }; - Scorm2004API.prototype.replaceWithAnotherScormAPI = function (newAPI) { - this.cmi = newAPI.cmi; - this.adl = newAPI.adl; - }; - Scorm2004API.prototype.renderCommitCMI = function (terminateCommit) { - var cmiExport = this.renderCMIToJSONObject(); - if (terminateCommit) { - cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime(); - } - var result = []; - var flattened = flatten(cmiExport); - switch (this.settings.dataCommitFormat) { - case "flattened": - return flatten(cmiExport); - case "params": - for (var item in flattened) { - if ({}.hasOwnProperty.call(flattened, item)) { - result.push("".concat(item, "=").concat(flattened[item])); - } - } - return result; - case "json": - default: - return cmiExport; - } - }; - Scorm2004API.prototype.renderCommitObject = function (terminateCommit) { - var cmiExport = this.renderCommitCMI(terminateCommit); - var totalTimeDuration = this.cmi.getCurrentTotalTime(); - var totalTimeSeconds = getDurationAsSeconds(totalTimeDuration, regex.scorm2004.CMITimespan); - var completionStatus = CompletionStatus.unknown; - var successStatus = SuccessStatus.unknown; - if (this.cmi.completion_status) { - if (this.cmi.completion_status === "completed") { - completionStatus = CompletionStatus.completed; - } - else if (this.cmi.completion_status === "incomplete") { - completionStatus = CompletionStatus.incomplete; - } - } - if (this.cmi.success_status) { - if (this.cmi.success_status === "passed") { - successStatus = SuccessStatus.passed; - } - else if (this.cmi.success_status === "failed") { - successStatus = SuccessStatus.failed; - } - } - var score = this.cmi.score; - var scoreObject = null; - if (score) { - scoreObject = {}; - if (!Number.isNaN(Number.parseFloat(score.raw))) { - scoreObject.raw = Number.parseFloat(score.raw); - } - if (!Number.isNaN(Number.parseFloat(score.min))) { - scoreObject.min = Number.parseFloat(score.min); - } - if (!Number.isNaN(Number.parseFloat(score.max))) { - scoreObject.max = Number.parseFloat(score.max); - } - if (!Number.isNaN(Number.parseFloat(score.scaled))) { - scoreObject.scaled = Number.parseFloat(score.scaled); - } - } - var commitObject = { - completionStatus: completionStatus, - successStatus: successStatus, - totalTimeSeconds: totalTimeSeconds, - runtimeData: cmiExport, - }; - if (scoreObject) { - commitObject.score = scoreObject; - } - return commitObject; - }; - Scorm2004API.prototype.storeData = function (terminateCommit) { - return __awaiter(this, void 0, void 0, function () { - var navRequest, shouldTerminateCommit, commitObject, result; - var _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - if (terminateCommit) { - if (this.cmi.mode === "normal") { - if (this.cmi.credit === "credit") { - if (this.cmi.completion_threshold && this.cmi.progress_measure) { - if (this.cmi.progress_measure >= this.cmi.completion_threshold) { - this.cmi.completion_status = "completed"; - } - else { - this.cmi.completion_status = "incomplete"; - } - } - if (this.cmi.scaled_passing_score && this.cmi.score.scaled) { - if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) { - this.cmi.success_status = "passed"; - } - else { - this.cmi.success_status = "failed"; - } - } - } - } - } - navRequest = false; - if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) && - this.adl.nav.request !== "_none_") { - this.adl.nav.request = encodeURIComponent(this.adl.nav.request); - navRequest = true; - } - shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; - commitObject = this.settings.renderCommonCommitFields - ? this.renderCommitObject(shouldTerminateCommit) - : this.renderCommitCMI(shouldTerminateCommit); - if (this.apiLogLevel === api_constants.global.LOG_LEVEL_DEBUG) { - console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); - console.debug(commitObject); - } - if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; - return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; - case 1: - result = _d.sent(); - { - if (navRequest && - result.navRequest !== undefined && - result.navRequest !== "") { - Function("\"use strict\";(() => { ".concat(result.navRequest, " })()"))(); - } - } - return [2, result]; - case 2: return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - }); - }); - }; - return Scorm2004API; -}(src_BaseAPI)); -/* harmony default export */ var src_Scorm2004API = (Scorm2004API); - -;// ./src/cmi/scorm12/validation.ts - - - -function check12ValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, error_codes.scorm12.TYPE_MISMATCH, Scorm12ValidationError, allowEmptyString); -} -function check12ValidRange(value, rangePattern, allowEmptyString) { - if (!allowEmptyString && value === "") { - throw new Scorm12ValidationError(error_codes.scorm12.VALUE_OUT_OF_RANGE); - } - return checkValidRange(value, rangePattern, error_codes.scorm12.VALUE_OUT_OF_RANGE, Scorm12ValidationError); -} - -;// ./src/cmi/aicc/core.ts - - - - - - - - - -var CMICore = (function (_super) { - __extends(CMICore, _super); - function CMICore() { - var _this = _super.call(this) || this; - _this.__children = api_constants.scorm12.core_children; - _this._student_id = ""; - _this._student_name = ""; - _this._lesson_location = ""; - _this._credit = ""; - _this._lesson_status = "not attempted"; - _this._entry = ""; - _this._total_time = ""; - _this._lesson_mode = "normal"; - _this._exit = ""; - _this._session_time = "00:00:00"; - _this._suspend_data = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, - }); - return _this; - } - CMICore.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(CMICore.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "student_id", { - get: function () { - return this._student_id; - }, - set: function (student_id) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._student_id = student_id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "student_name", { - get: function () { - return this._student_name; - }, - set: function (student_name) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._student_name = student_name; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "lesson_location", { - get: function () { - return this._lesson_location; - }, - set: function (lesson_location) { - if (check12ValidFormat(lesson_location, regex.scorm12.CMIString256, true)) { - this._lesson_location = lesson_location; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "credit", { - get: function () { - return this._credit; - }, - set: function (credit) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._credit = credit; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "lesson_status", { - get: function () { - return this._lesson_status; - }, - set: function (lesson_status) { - if (this.initialized) { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus)) { - this._lesson_status = lesson_status; - } - } - else { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus2)) { - this._lesson_status = lesson_status; - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "entry", { - get: function () { - return this._entry; - }, - set: function (entry) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._entry = entry; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "total_time", { - get: function () { - return this._total_time; - }, - set: function (total_time) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._total_time = total_time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "lesson_mode", { - get: function () { - return this._lesson_mode; - }, - set: function (lesson_mode) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._lesson_mode = lesson_mode; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "exit", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._exit; - }, - set: function (exit) { - if (check12ValidFormat(exit, regex.scorm12.CMIExit, true)) { - this._exit = exit; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "session_time", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._session_time; - }, - set: function (session_time) { - if (check12ValidFormat(session_time, regex.scorm12.CMITimespan)) { - this._session_time = session_time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "suspend_data", { - get: function () { - return this._suspend_data; - }, - set: function (suspend_data) { - if (check12ValidFormat(suspend_data, regex.scorm12.CMIString4096, true)) { - this._suspend_data = suspend_data; - } - }, - enumerable: false, - configurable: true - }); - CMICore.prototype.getCurrentTotalTime = function (start_time) { - var sessionTime = this._session_time; - var startTime = start_time; - if (typeof startTime !== "undefined" && startTime !== null) { - var seconds = new Date().getTime() - startTime; - sessionTime = getSecondsAsHHMMSS(seconds / 1000); - } - return addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12.CMITimespan)); - }; - CMICore.prototype.toJSON = function () { - this.jsonString = true; - var result = { - student_id: this.student_id, - student_name: this.student_name, - lesson_location: this.lesson_location, - credit: this.credit, - lesson_status: this.lesson_status, - entry: this.entry, - lesson_mode: this.lesson_mode, - exit: this.exit, - session_time: this.session_time, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMICore; -}(BaseCMI)); - - -;// ./src/cmi/scorm12/objectives.ts - - - - - - - - - -var objectives_CMIObjectives = (function (_super) { - __extends(CMIObjectives, _super); - function CMIObjectives() { - return _super.call(this, { - children: api_constants.scorm12.objectives_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - }) || this; - } - return CMIObjectives; -}(CMIArray)); - -var objectives_CMIObjectivesObject = (function (_super) { - __extends(CMIObjectivesObject, _super); - function CMIObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; - _this._status = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, - }); - return _this; - } - Object.defineProperty(CMIObjectivesObject.prototype, "id", { - get: function () { - return this._id; - }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIObjectivesObject.prototype, "status", { - get: function () { - return this._status; - }, - set: function (status) { - if (check12ValidFormat(status, regex.scorm12.CMIStatus2)) { - this._status = status; - } - }, - enumerable: false, - configurable: true - }); - CMIObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - status: this.status, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMIObjectivesObject; -}(BaseCMI)); - - -;// ./src/cmi/scorm12/student_data.ts - - - - - -var CMIStudentData = (function (_super) { - __extends(CMIStudentData, _super); - function CMIStudentData(student_data_children) { - var _this = _super.call(this) || this; - _this._mastery_score = ""; - _this._max_time_allowed = ""; - _this._time_limit_action = ""; - _this.__children = student_data_children - ? student_data_children - : api_constants.scorm12.student_data_children; - return _this; - } - Object.defineProperty(CMIStudentData.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "mastery_score", { - get: function () { - return this._mastery_score; - }, - set: function (mastery_score) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._mastery_score = mastery_score; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { - get: function () { - return this._max_time_allowed; - }, - set: function (max_time_allowed) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._max_time_allowed = max_time_allowed; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { - get: function () { - return this._time_limit_action; - }, - set: function (time_limit_action) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._time_limit_action = time_limit_action; - } - }, - enumerable: false, - configurable: true - }); - CMIStudentData.prototype.toJSON = function () { - this.jsonString = true; - var result = { - mastery_score: this.mastery_score, - max_time_allowed: this.max_time_allowed, - time_limit_action: this.time_limit_action, - }; - delete this.jsonString; - return result; - }; - return CMIStudentData; -}(BaseCMI)); - - -;// ./src/cmi/scorm12/student_preference.ts - - - - - - - -var CMIStudentPreference = (function (_super) { - __extends(CMIStudentPreference, _super); - function CMIStudentPreference(student_preference_children) { - var _this = _super.call(this) || this; - _this._audio = ""; - _this._language = ""; - _this._speed = ""; - _this._text = ""; - _this.__children = student_preference_children - ? student_preference_children - : api_constants.scorm12.student_preference_children; - return _this; - } - Object.defineProperty(CMIStudentPreference.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "audio", { - get: function () { - return this._audio; - }, - set: function (audio) { - if (check12ValidFormat(audio, regex.scorm12.CMISInteger) && - check12ValidRange(audio, regex.scorm12.audio_range)) { - this._audio = audio; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "language", { - get: function () { - return this._language; - }, - set: function (language) { - if (check12ValidFormat(language, regex.scorm12.CMIString256)) { - this._language = language; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "speed", { - get: function () { - return this._speed; - }, - set: function (speed) { - if (check12ValidFormat(speed, regex.scorm12.CMISInteger) && - check12ValidRange(speed, regex.scorm12.speed_range)) { - this._speed = speed; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "text", { - get: function () { - return this._text; - }, - set: function (text) { - if (check12ValidFormat(text, regex.scorm12.CMISInteger) && - check12ValidRange(text, regex.scorm12.text_range)) { - this._text = text; - } - }, - enumerable: false, - configurable: true - }); - CMIStudentPreference.prototype.toJSON = function () { - this.jsonString = true; - var result = { - audio: this.audio, - language: this.language, - speed: this.speed, - text: this.text, - }; - delete this.jsonString; - return result; - }; - return CMIStudentPreference; -}(BaseCMI)); - - -;// ./src/cmi/scorm12/interactions.ts - - - - - - - - -var interactions_CMIInteractions = (function (_super) { - __extends(CMIInteractions, _super); - function CMIInteractions() { - return _super.call(this, { - children: api_constants.scorm12.interactions_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - }) || this; - } - return CMIInteractions; -}(CMIArray)); - -var interactions_CMIInteractionsObject = (function (_super) { - __extends(CMIInteractionsObject, _super); - function CMIInteractionsObject() { - var _this = _super.call(this) || this; - _this._id = ""; - _this._time = ""; - _this._type = ""; - _this._weighting = ""; - _this._student_response = ""; - _this._result = ""; - _this._latency = ""; - _this.objectives = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.objectives_children, - }); - _this.correct_responses = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.correct_responses_children, - }); - return _this; - } - CMIInteractionsObject.prototype.initialize = function () { - var _a, _b; - _super.prototype.initialize.call(this); - (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); - }; - Object.defineProperty(CMIInteractionsObject.prototype, "id", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._id; - }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "time", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._time; - }, - set: function (time) { - if (check12ValidFormat(time, regex.scorm12.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "type", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._type; - }, - set: function (type) { - if (check12ValidFormat(type, regex.scorm12.CMIType)) { - this._type = type; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._weighting; - }, - set: function (weighting) { - if (check12ValidFormat(weighting, regex.scorm12.CMIDecimal) && - check12ValidRange(weighting, regex.scorm12.weighting_range)) { - this._weighting = weighting; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._student_response; - }, - set: function (student_response) { - if (check12ValidFormat(student_response, regex.scorm12.CMIFeedback, true)) { - this._student_response = student_response; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "result", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._result; - }, - set: function (result) { - if (check12ValidFormat(result, regex.scorm12.CMIResult)) { - this._result = result; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "latency", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._latency; - }, - set: function (latency) { - if (check12ValidFormat(latency, regex.scorm12.CMITimespan)) { - this._latency = latency; - } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - time: this.time, - type: this.type, - weighting: this.weighting, - student_response: this.student_response, - result: this.result, - latency: this.latency, - objectives: this.objectives, - correct_responses: this.correct_responses, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObject; -}(BaseCMI)); - -var interactions_CMIInteractionsObjectivesObject = (function (_super) { - __extends(CMIInteractionsObjectivesObject, _super); - function CMIInteractionsObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; - return _this; - } - Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { - get: function () { - return this._id; - }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObjectivesObject; -}(BaseCMI)); - -var interactions_CMIInteractionsCorrectResponsesObject = (function (_super) { - __extends(CMIInteractionsCorrectResponsesObject, _super); - function CMIInteractionsCorrectResponsesObject() { - var _this = _super.call(this) || this; - _this._pattern = ""; - return _this; - } - Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._pattern; - }, - set: function (pattern) { - if (check12ValidFormat(pattern, regex.scorm12.CMIFeedback, true)) { - this._pattern = pattern; - } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - pattern: this._pattern, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsCorrectResponsesObject; -}(BaseCMI)); - - -;// ./src/cmi/scorm12/cmi.ts - - - - - - - - - - - - -var cmi_CMI = (function (_super) { - __extends(CMI, _super); - function CMI(cmi_children, student_data, initialized) { - var _this = _super.call(this) || this; - _this.__children = ""; - _this.__version = "3.4"; - _this._launch_data = ""; - _this._comments = ""; - _this._comments_from_lms = ""; - if (initialized) - _this.initialize(); - _this.__children = cmi_children - ? cmi_children - : api_constants.scorm12.cmi_children; - _this.core = new CMICore(); - _this.objectives = new objectives_CMIObjectives(); - _this.student_data = student_data ? student_data : new CMIStudentData(); - _this.student_preference = new CMIStudentPreference(); - _this.interactions = new interactions_CMIInteractions(); - return _this; - } - CMI.prototype.initialize = function () { - var _a, _b, _c, _d, _e; - _super.prototype.initialize.call(this); - (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); - (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); - (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); - (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); - }; - CMI.prototype.toJSON = function () { - this.jsonString = true; - var result = { - suspend_data: this.suspend_data, - launch_data: this.launch_data, - comments: this.comments, - comments_from_lms: this.comments_from_lms, - core: this.core, - objectives: this.objectives, - student_data: this.student_data, - student_preference: this.student_preference, - interactions: this.interactions, - }; - delete this.jsonString; - return result; - }; - Object.defineProperty(CMI.prototype, "_version", { - get: function () { - return this.__version; - }, - set: function (_version) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "suspend_data", { - get: function () { - var _a; - return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; - }, - set: function (suspend_data) { - if (this.core) { - this.core.suspend_data = suspend_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "launch_data", { - get: function () { - return this._launch_data; - }, - set: function (launch_data) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._launch_data = launch_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "comments", { - get: function () { - return this._comments; - }, - set: function (comments) { - if (check12ValidFormat(comments, regex.scorm12.CMIString4096, true)) { - this._comments = comments; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "comments_from_lms", { - get: function () { - return this._comments_from_lms; - }, - set: function (comments_from_lms) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._comments_from_lms = comments_from_lms; - } - }, - enumerable: false, - configurable: true - }); - CMI.prototype.getCurrentTotalTime = function () { - return this.core.getCurrentTotalTime(this.start_time); - }; - return CMI; -}(BaseRootCMI)); - - -;// ./src/cmi/scorm12/nav.ts - - - - -var NAV = (function (_super) { - __extends(NAV, _super); - function NAV() { - var _this = _super.call(this) || this; - _this._event = ""; - return _this; - } - Object.defineProperty(NAV.prototype, "event", { - get: function () { - return this._event; - }, - set: function (event) { - if (check12ValidFormat(event, regex.scorm12.NAVEvent)) { - this._event = event; - } - }, - enumerable: false, - configurable: true - }); - NAV.prototype.toJSON = function () { - this.jsonString = true; - var result = { - event: this.event, - }; - delete this.jsonString; - return result; - }; - return NAV; -}(BaseCMI)); - - -;// ./src/Scorm12API.ts - - - - - - - - - - - - -var Scorm12API = (function (_super) { - __extends(Scorm12API, _super); - function Scorm12API(settings) { - var _this = this; - if (settings) { - if (settings.mastery_override === undefined) { - settings.mastery_override = false; - } - } - _this = _super.call(this, error_codes.scorm12, settings) || this; - _this.statusSetByModule = false; - _this.cmi = new cmi_CMI(); - _this.nav = new NAV(); - _this.LMSInitialize = _this.lmsInitialize; - _this.LMSFinish = _this.lmsFinish; - _this.LMSGetValue = _this.lmsGetValue; - _this.LMSSetValue = _this.lmsSetValue; - _this.LMSCommit = _this.lmsCommit; - _this.LMSGetLastError = _this.lmsGetLastError; - _this.LMSGetErrorString = _this.lmsGetErrorString; - _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; - return _this; - } - Scorm12API.prototype.reset = function (settings) { - this.commonReset(settings); - this.cmi = new cmi_CMI(); - this.nav = new NAV(); - }; - Scorm12API.prototype.lmsInitialize = function () { - this.cmi.initialize(); - if (this.cmi.core.lesson_status) { - this.statusSetByModule = true; - } - else { - this.cmi.core.lesson_status = "not attempted"; - } - return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); - }; - Scorm12API.prototype.lmsFinish = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.internalFinish()]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm12API.prototype.internalFinish = function () { - return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.terminate("LMSFinish", true)]; - case 1: - result = _a.sent(); - if (result === api_constants.global.SCORM_TRUE) { - if (this.nav.event !== "") { - if (this.nav.event === "continue") { - this.processListeners("SequenceNext"); - } - else { - this.processListeners("SequencePrevious"); - } - } - else if (this.settings.autoProgress) { - this.processListeners("SequenceNext"); - } - } - return [2, result]; - } - }); - }); - }; - Scorm12API.prototype.lmsGetValue = function (CMIElement) { - return this.getValue("LMSGetValue", false, CMIElement); - }; - Scorm12API.prototype.lmsSetValue = function (CMIElement, value) { - if (CMIElement === "cmi.core.lesson_status") { - this.statusSetByModule = true; - } - return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); - }; - Scorm12API.prototype.lmsCommit = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.commit("LMSCommit", false)]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm12API.prototype.lmsGetLastError = function () { - return this.getLastError("LMSGetLastError"); - }; - Scorm12API.prototype.lmsGetErrorString = function (CMIErrorCode) { - return this.getErrorString("LMSGetErrorString", CMIErrorCode); - }; - Scorm12API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { - return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); - }; - Scorm12API.prototype.setCMIValue = function (CMIElement, value) { - return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); - }; - Scorm12API.prototype.getCMIValue = function (CMIElement) { - return this._commonGetCMIValue("getCMIValue", false, CMIElement); - }; - Scorm12API.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.objectives\\.\\d+")) { - return new objectives_CMIObjectivesObject(); - } - else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { - return new interactions_CMIInteractionsCorrectResponsesObject(); - } - else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { - return new interactions_CMIInteractionsObjectivesObject(); - } - else if (!foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+")) { - return new interactions_CMIInteractionsObject(); - } - return null; - }; - Scorm12API.prototype.validateCorrectResponse = function (_CMIElement, _value) { - }; - Scorm12API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { - var basicMessage = "No Error"; - var detailMessage = "No Error"; - errorNumber = String(errorNumber); - if (api_constants.scorm12.error_descriptions[errorNumber]) { - basicMessage = - api_constants.scorm12.error_descriptions[errorNumber].basicMessage; - detailMessage = - api_constants.scorm12.error_descriptions[errorNumber].detailMessage; - } - return detail ? detailMessage : basicMessage; - }; - Scorm12API.prototype.replaceWithAnotherScormAPI = function (newAPI) { - this.cmi = newAPI.cmi; - }; - Scorm12API.prototype.renderCommitCMI = function (terminateCommit) { - var cmiExport = this.renderCMIToJSONObject(); - if (terminateCommit) { - cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); - } - var result = []; - var flattened = flatten(cmiExport); - switch (this.settings.dataCommitFormat) { - case "flattened": - return flatten(cmiExport); - case "params": - for (var item in flattened) { - if ({}.hasOwnProperty.call(flattened, item)) { - result.push("".concat(item, "=").concat(flattened[item])); - } - } - return result; - case "json": - default: - return cmiExport; - } - }; - Scorm12API.prototype.renderCommitObject = function (terminateCommit) { - var cmiExport = this.renderCommitCMI(terminateCommit); - var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); - var totalTimeSeconds = getTimeAsSeconds(totalTimeHHMMSS, regex.scorm12.CMITimespan); - var lessonStatus = this.cmi.core.lesson_status; - var completionStatus = CompletionStatus.unknown; - var successStatus = SuccessStatus.unknown; - if (lessonStatus) { - completionStatus = - lessonStatus === "completed" || lessonStatus === "passed" - ? CompletionStatus.completed - : CompletionStatus.incomplete; - if (lessonStatus === "passed") { - successStatus = SuccessStatus.passed; - } - else if (lessonStatus === "failed") { - successStatus = SuccessStatus.failed; - } - } - var score = this.cmi.core.score; - var scoreObject = null; - if (score) { - scoreObject = {}; - if (!Number.isNaN(Number.parseFloat(score.raw))) { - scoreObject.raw = Number.parseFloat(score.raw); - } - if (!Number.isNaN(Number.parseFloat(score.min))) { - scoreObject.min = Number.parseFloat(score.min); - } - if (!Number.isNaN(Number.parseFloat(score.max))) { - scoreObject.max = Number.parseFloat(score.max); - } - } - var commitObject = { - successStatus: successStatus, - completionStatus: completionStatus, - runtimeData: cmiExport, - totalTimeSeconds: totalTimeSeconds, - }; - if (scoreObject) { - commitObject.score = scoreObject; - } - return commitObject; - }; - Scorm12API.prototype.storeData = function (terminateCommit) { - return __awaiter(this, void 0, void 0, function () { - var originalStatus, shouldTerminateCommit, commitObject; - var _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - if (terminateCommit) { - originalStatus = this.cmi.core.lesson_status; - if (!this.cmi.core.lesson_status || - (!this.statusSetByModule && - this.cmi.core.lesson_status === "not attempted")) { - this.cmi.core.lesson_status = "completed"; - } - if (this.cmi.core.lesson_mode === "normal") { - if (this.cmi.core.credit === "credit") { - if (this.settings.mastery_override && - this.cmi.student_data.mastery_score !== "" && - this.cmi.core.score.raw !== "") { - this.cmi.core.lesson_status = - parseFloat(this.cmi.core.score.raw) >= - parseFloat(this.cmi.student_data.mastery_score) - ? "passed" - : "failed"; - } - } - } - else if (this.cmi.core.lesson_mode === "browse") { - if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && - originalStatus === "not attempted") { - this.cmi.core.lesson_status = "browsed"; - } - } - } - shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; - commitObject = this.settings.renderCommonCommitFields - ? this.renderCommitObject(shouldTerminateCommit) - : this.renderCommitCMI(shouldTerminateCommit); - if (this.apiLogLevel === api_constants.global.LOG_LEVEL_DEBUG) { - console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); - console.debug(commitObject); - } - if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; - return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; - case 1: return [2, _d.sent()]; - case 2: return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - }); - }); - }; - return Scorm12API; -}(src_BaseAPI)); -/* harmony default export */ var src_Scorm12API = (Scorm12API); - -;// ./src/cmi/aicc/validation.ts - - - -var aicc_error_codes = error_codes.scorm12; -function checkAICCValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, AICCValidationError, allowEmptyString); -} - -;// ./src/cmi/aicc/evaluation.ts - - - - - - - - -var CMIEvaluation = (function (_super) { - __extends(CMIEvaluation, _super); - function CMIEvaluation() { - var _this = _super.call(this) || this; - _this.comments = new CMIEvaluationComments(); - return _this; - } - CMIEvaluation.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - CMIEvaluation.prototype.toJSON = function () { - this.jsonString = true; - var result = { - comments: this.comments, - }; - delete this.jsonString; - return result; - }; - return CMIEvaluation; -}(BaseCMI)); - -var CMIEvaluationComments = (function (_super) { - __extends(CMIEvaluationComments, _super); - function CMIEvaluationComments() { - return _super.call(this, { - children: api_constants.aicc.comments_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: AICCValidationError, - }) || this; - } - return CMIEvaluationComments; -}(CMIArray)); -var CMIEvaluationCommentsObject = (function (_super) { - __extends(CMIEvaluationCommentsObject, _super); - function CMIEvaluationCommentsObject() { - var _this = _super.call(this) || this; - _this._content = ""; - _this._location = ""; - _this._time = ""; - return _this; - } - Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", { - get: function () { - return this._content; - }, - set: function (content) { - if (checkAICCValidFormat(content, regex.aicc.CMIString256)) { - this._content = content; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIEvaluationCommentsObject.prototype, "location", { - get: function () { - return this._location; - }, - set: function (location) { - if (checkAICCValidFormat(location, regex.aicc.CMIString256)) { - this._location = location; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIEvaluationCommentsObject.prototype, "time", { - get: function () { - return this._time; - }, - set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - CMIEvaluationCommentsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - content: this.content, - location: this.location, - time: this.time, - }; - delete this.jsonString; - return result; - }; - return CMIEvaluationCommentsObject; -}(BaseCMI)); - - -;// ./src/cmi/aicc/student_preferences.ts - - - - - - - - -var AICCStudentPreferences = (function (_super) { - __extends(AICCStudentPreferences, _super); - function AICCStudentPreferences() { - var _this = _super.call(this, api_constants.aicc.student_preference_children) || this; - _this._lesson_type = ""; - _this._text_color = ""; - _this._text_location = ""; - _this._text_size = ""; - _this._video = ""; - _this.windows = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: AICCValidationError, - children: "", - }); - return _this; - } - AICCStudentPreferences.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.windows) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(AICCStudentPreferences.prototype, "lesson_type", { - get: function () { - return this._lesson_type; - }, - set: function (lesson_type) { - if (checkAICCValidFormat(lesson_type, regex.aicc.CMIString256)) { - this._lesson_type = lesson_type; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AICCStudentPreferences.prototype, "text_color", { - get: function () { - return this._text_color; - }, - set: function (text_color) { - if (checkAICCValidFormat(text_color, regex.aicc.CMIString256)) { - this._text_color = text_color; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AICCStudentPreferences.prototype, "text_location", { - get: function () { - return this._text_location; - }, - set: function (text_location) { - if (checkAICCValidFormat(text_location, regex.aicc.CMIString256)) { - this._text_location = text_location; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AICCStudentPreferences.prototype, "text_size", { - get: function () { - return this._text_size; - }, - set: function (text_size) { - if (checkAICCValidFormat(text_size, regex.aicc.CMIString256)) { - this._text_size = text_size; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AICCStudentPreferences.prototype, "video", { - get: function () { - return this._video; - }, - set: function (video) { - if (checkAICCValidFormat(video, regex.aicc.CMIString256)) { - this._video = video; - } - }, - enumerable: false, - configurable: true - }); - AICCStudentPreferences.prototype.toJSON = function () { - this.jsonString = true; - var result = { - audio: this.audio, - language: this.language, - lesson_type: this.lesson_type, - speed: this.speed, - text: this.text, - text_color: this.text_color, - text_location: this.text_location, - text_size: this.text_size, - video: this.video, - windows: this.windows, - }; - delete this.jsonString; - return result; - }; - return AICCStudentPreferences; -}(CMIStudentPreference)); - - -;// ./src/cmi/aicc/student_demographics.ts - - - - - -var CMIStudentDemographics = (function (_super) { - __extends(CMIStudentDemographics, _super); - function CMIStudentDemographics() { - var _this = _super.call(this) || this; - _this.__children = api_constants.aicc.student_demographics_children; - _this._city = ""; - _this._class = ""; - _this._company = ""; - _this._country = ""; - _this._experience = ""; - _this._familiar_name = ""; - _this._instructor_name = ""; - _this._title = ""; - _this._native_language = ""; - _this._state = ""; - _this._street_address = ""; - _this._telephone = ""; - _this._years_experience = ""; - return _this; - } - Object.defineProperty(CMIStudentDemographics.prototype, "_children", { - get: function () { - return this.__children; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "city", { - get: function () { - return this._city; - }, - set: function (city) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._city = city; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "class", { - get: function () { - return this._class; - }, - set: function (clazz) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._class = clazz; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "company", { - get: function () { - return this._company; - }, - set: function (company) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._company = company; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "country", { - get: function () { - return this._country; - }, - set: function (country) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._country = country; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "experience", { - get: function () { - return this._experience; - }, - set: function (experience) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._experience = experience; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "familiar_name", { - get: function () { - return this._familiar_name; - }, - set: function (familiar_name) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._familiar_name = familiar_name; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "instructor_name", { - get: function () { - return this._instructor_name; - }, - set: function (instructor_name) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._instructor_name = instructor_name; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "title", { - get: function () { - return this._title; - }, - set: function (title) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._title = title; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "native_language", { - get: function () { - return this._native_language; - }, - set: function (native_language) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._native_language = native_language; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "state", { - get: function () { - return this._state; - }, - set: function (state) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._state = state; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "street_address", { - get: function () { - return this._street_address; - }, - set: function (street_address) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._street_address = street_address; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "telephone", { - get: function () { - return this._telephone; - }, - set: function (telephone) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._telephone = telephone; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "years_experience", { - get: function () { - return this._years_experience; - }, - set: function (years_experience) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._years_experience = years_experience; - } - }, - enumerable: false, - configurable: true - }); - CMIStudentDemographics.prototype.toJSON = function () { - this.jsonString = true; - var result = { - city: this.city, - class: this.class, - company: this.company, - country: this.country, - experience: this.experience, - familiar_name: this.familiar_name, - instructor_name: this.instructor_name, - title: this.title, - native_language: this.native_language, - state: this.state, - street_address: this.street_address, - telephone: this.telephone, - years_experience: this.years_experience, - }; - delete this.jsonString; - return result; - }; - return CMIStudentDemographics; -}(BaseCMI)); - - -;// ./src/cmi/aicc/tries.ts - - - - - - - - - -var CMITries = (function (_super) { - __extends(CMITries, _super); - function CMITries() { - return _super.call(this, { - children: api_constants.aicc.tries_children, - }) || this; - } - return CMITries; -}(CMIArray)); - -var CMITriesObject = (function (_super) { - __extends(CMITriesObject, _super); - function CMITriesObject() { - var _this = _super.call(this) || this; - _this._status = ""; - _this._time = ""; - _this.score = new CMIScore({ - score_children: api_constants.aicc.score_children, - score_range: regex.aicc.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: AICCValidationError, - }); - return _this; - } - CMITriesObject.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(CMITriesObject.prototype, "status", { - get: function () { - return this._status; - }, - set: function (status) { - if (checkAICCValidFormat(status, regex.aicc.CMIStatus2)) { - this._status = status; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMITriesObject.prototype, "time", { - get: function () { - return this._time; - }, - set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - CMITriesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - status: this.status, - time: this.time, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMITriesObject; -}(BaseCMI)); - - -;// ./src/cmi/aicc/attempts.ts - - - - - - - - - -var CMIAttemptRecords = (function (_super) { - __extends(CMIAttemptRecords, _super); - function CMIAttemptRecords() { - return _super.call(this, { - children: api_constants.aicc.attempt_records_children, - }) || this; - } - return CMIAttemptRecords; -}(CMIArray)); - -var CMIAttemptRecordsObject = (function (_super) { - __extends(CMIAttemptRecordsObject, _super); - function CMIAttemptRecordsObject() { - var _this = _super.call(this) || this; - _this._lesson_status = ""; - _this.score = new CMIScore({ - score_children: api_constants.aicc.score_children, - score_range: regex.aicc.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: AICCValidationError, - }); - return _this; - } - CMIAttemptRecordsObject.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", { - get: function () { - return this._lesson_status; - }, - set: function (lesson_status) { - if (checkAICCValidFormat(lesson_status, regex.aicc.CMIStatus2)) { - this._lesson_status = lesson_status; - } - }, - enumerable: false, - configurable: true - }); - CMIAttemptRecordsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - lesson_status: this.lesson_status, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMIAttemptRecordsObject; -}(BaseCMI)); - - -;// ./src/cmi/aicc/student_data.ts - - - - - - - -var AICCCMIStudentData = (function (_super) { - __extends(AICCCMIStudentData, _super); - function AICCCMIStudentData() { - var _this = _super.call(this, api_constants.aicc.student_data_children) || this; - _this._tries_during_lesson = ""; - _this.tries = new CMITries(); - _this.attempt_records = new CMIAttemptRecords(); - return _this; - } - AICCCMIStudentData.prototype.initialize = function () { - var _a, _b; - _super.prototype.initialize.call(this); - (_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize(); - }; - Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", { - get: function () { - return this._tries_during_lesson; - }, - set: function (tries_during_lesson) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._tries_during_lesson = tries_during_lesson; - } - }, - enumerable: false, - configurable: true - }); - AICCCMIStudentData.prototype.toJSON = function () { - this.jsonString = true; - var result = { - mastery_score: this.mastery_score, - max_time_allowed: this.max_time_allowed, - time_limit_action: this.time_limit_action, - tries: this.tries, - attempt_records: this.attempt_records, - }; - delete this.jsonString; - return result; - }; - return AICCCMIStudentData; -}(CMIStudentData)); - - -;// ./src/cmi/aicc/paths.ts - - - - - - -var CMIPaths = (function (_super) { - __extends(CMIPaths, _super); - function CMIPaths() { - return _super.call(this, { - children: api_constants.aicc.paths_children, - }) || this; - } - return CMIPaths; -}(CMIArray)); - -var CMIPathsObject = (function (_super) { - __extends(CMIPathsObject, _super); - function CMIPathsObject() { - var _this = _super.call(this) || this; - _this._location_id = ""; - _this._date = ""; - _this._time = ""; - _this._status = ""; - _this._why_left = ""; - _this._time_in_element = ""; - return _this; - } - Object.defineProperty(CMIPathsObject.prototype, "location_id", { - get: function () { - return this._location_id; - }, - set: function (location_id) { - if (checkAICCValidFormat(location_id, regex.aicc.CMIString256)) { - this._location_id = location_id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "date", { - get: function () { - return this._date; - }, - set: function (date) { - if (checkAICCValidFormat(date, regex.aicc.CMIString256)) { - this._date = date; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "time", { - get: function () { - return this._time; - }, - set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "status", { - get: function () { - return this._status; - }, - set: function (status) { - if (checkAICCValidFormat(status, regex.aicc.CMIStatus2)) { - this._status = status; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "why_left", { - get: function () { - return this._why_left; - }, - set: function (why_left) { - if (checkAICCValidFormat(why_left, regex.aicc.CMIString256)) { - this._why_left = why_left; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "time_in_element", { - get: function () { - return this._time_in_element; - }, - set: function (time_in_element) { - if (checkAICCValidFormat(time_in_element, regex.aicc.CMITime)) { - this._time_in_element = time_in_element; - } - }, - enumerable: false, - configurable: true - }); - CMIPathsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - location_id: this.location_id, - date: this.date, - time: this.time, - status: this.status, - why_left: this.why_left, - time_in_element: this.time_in_element, - }; - delete this.jsonString; - return result; - }; - return CMIPathsObject; -}(BaseCMI)); - - -;// ./src/cmi/aicc/cmi.ts - - - - - - - - -var aicc_cmi_CMI = (function (_super) { - __extends(CMI, _super); - function CMI(initialized) { - if (initialized === void 0) { initialized = false; } - var _this = _super.call(this, api_constants.aicc.cmi_children) || this; - if (initialized) - _this.initialize(); - _this.student_preference = new AICCStudentPreferences(); - _this.student_data = new AICCCMIStudentData(); - _this.student_demographics = new CMIStudentDemographics(); - _this.evaluation = new CMIEvaluation(); - _this.paths = new CMIPaths(); - return _this; - } - CMI.prototype.initialize = function () { - var _a, _b, _c, _d, _e; - _super.prototype.initialize.call(this); - (_a = this.student_preference) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.student_data) === null || _b === void 0 ? void 0 : _b.initialize(); - (_c = this.student_demographics) === null || _c === void 0 ? void 0 : _c.initialize(); - (_d = this.evaluation) === null || _d === void 0 ? void 0 : _d.initialize(); - (_e = this.paths) === null || _e === void 0 ? void 0 : _e.initialize(); - }; - CMI.prototype.toJSON = function () { - this.jsonString = true; - var result = { - suspend_data: this.suspend_data, - launch_data: this.launch_data, - comments: this.comments, - comments_from_lms: this.comments_from_lms, - core: this.core, - objectives: this.objectives, - student_data: this.student_data, - student_preference: this.student_preference, - student_demographics: this.student_demographics, - interactions: this.interactions, - evaluation: this.evaluation, - paths: this.paths, - }; - delete this.jsonString; - return result; - }; - return CMI; -}(cmi_CMI)); - - -;// ./src/AICC.ts - - - - - - - - - -var AICC = (function (_super) { - __extends(AICC, _super); - function AICC(settings) { - var _this = _super.call(this, settings) || this; - _this.cmi = new aicc_cmi_CMI(); - _this.nav = new NAV(); - return _this; - } - AICC.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { - var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex); - if (!newChild) { - if (stringMatches(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) { - newChild = new CMIEvaluationCommentsObject(); - } - else if (stringMatches(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) { - newChild = new CMITriesObject(); - } - else if (stringMatches(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) { - newChild = new CMIAttemptRecordsObject(); - } - else if (stringMatches(CMIElement, "cmi\\.paths\\.\\d+")) { - newChild = new CMIPathsObject(); - } - } - return newChild; - }; - AICC.prototype.replaceWithAnotherScormAPI = function (newAPI) { - this.cmi = newAPI.cmi; - this.nav = newAPI.nav; - }; - return AICC; -}(src_Scorm12API)); -/* harmony default export */ var src_AICC = (AICC); - -;// ./src/exports/index.js - - - - - - -/******/ return __webpack_exports__; -/******/ })() -; -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index 38e6e32..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;UCVA;UACA;;;;;WCDA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,gBAAgB,sCAAsC,kBAAkB;AACjF,wBAAwB;AACxB;AACA;;AAEO;AACP;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEO;AACP;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;;AAEO;AACP,kCAAkC;AAClC;;AAEO;AACP,uBAAuB,uFAAuF;AAC9G;AACA;AACA,yGAAyG;AACzG;AACA,sCAAsC,QAAQ;AAC9C;AACA,gEAAgE;AAChE;AACA,8CAA8C,yFAAyF;AACvI,8DAA8D,2CAA2C;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,4CAA4C,yEAAyE;AACrH;;AAEO;AACP;AACA;;AAEO;AACP,0BAA0B,+DAA+D,iBAAiB;AAC1G;AACA,kCAAkC,MAAM,+BAA+B,YAAY;AACnF,iCAAiC,MAAM,mCAAmC,YAAY;AACtF,8BAA8B;AAC9B;AACA,GAAG;AACH;;AAEO;AACP,YAAY,6BAA6B,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G,uFAAuF,cAAc;AAC9M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;ACtXF;IAAA;QACE,eAAU,GAAI,KAAK,CAAC;QACZ,iBAAY,GAAG,KAAK,CAAC;IAiC/B,CAAC;IA1BC,sBAAI,gCAAW;aAAf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAMD,sBAAI,+BAAU;aAAd;YACE,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;;;OAAA;IAKD,4BAAU,GAAV;QACE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAMD,8BAAY,GAAZ;QACE,IAAI,CAAC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L,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;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GAAG,IAAI,uBAAuB,EAAE,CAAC;YAC3C,CAAC;iBAAM,IAAI,aAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAE,CAAC;gBAC3D,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAOD,yCAA0B,GAA1B,UAA2B,MAAY;QAErC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACxB,CAAC;IACH,WAAC;AAAD,CAAC,CAxDiC,cAAU,GAwD3C;;;;ACvE6C;AACJ;AACZ;;AAEY","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts","webpack://scorm-again/./src/exports/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n","import Scorm2004API from \"../Scorm2004API.ts\";\nimport Scorm12API from \"../Scorm12API.ts\";\nimport AICC from \"../AICC.ts\";\n\nexport { Scorm12API, Scorm2004API, AICC };\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/index.min.js b/dist/index.min.js deleted file mode 100644 index 502b0db..0000000 --- a/dist/index.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e={d:function(t,i){for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{AICC:function(){return qe},Scorm12API:function(){return Le},Scorm2004API:function(){return de}});var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},i(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,i=1,r=arguments.length;i0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&(s="."+(s=N(o)>2?o.toFixed(2):String(o)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+s}function C(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in v){var n=v[r],o=Math.floor(i/n);N(i%=n)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(o+=i),o&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(o).concat(r))}return t}function T(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function L(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function w(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=n(n({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return o(this,void 0,void 0,(function(){var i,r;return s(this,(function(n){switch(n.label){case 0:return i=_.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=_.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:_.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=_.global.SCORM_TRUE,this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,_.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,_.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=_.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=_.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,_.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return o(this,arguments,void 0,(function(e,t){var i,r;return void 0===t&&(t=!1),s(this,(function(n){switch(n.label){case 0:return this.clearScheduledCommit(),i=_.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:_.global.SCORM_FALSE,this.apiLog(e," Result: "+i,_.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,_.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,_.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,_.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,_.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,r){if(!i||""===i)return _.global.SCORM_FALSE;for(var o=i.split("."),s=this,a=_.global.SCORM_FALSE,c=!1,l="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),u=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,h=0;h1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),_.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),_.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){for(var n=i,o="",s=t.exec(r);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(r);n[o]=e[r]}return i[""]||i}(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===_.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),P=D,x={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},z={aicc:n(n({},x),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:x,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};function V(e,t,i,r,n){if("string"!=typeof e)return!1;var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new r(i);return!0}function F(e,t,i,r){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}function G(e,t,i){return V(e,t,u.scorm2004.TYPE_MISMATCH,y,i)}function k(e,t){return F(e,t,u.scorm2004.VALUE_OUT_OF_RANGE,y)}var U,Y,q,H=function(e){function t(){var t=e.call(this)||this;return t.__children=_.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return r(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new y(u.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){G(e,z.scorm2004.CMIDecimal)&&k(e,z.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){G(e,z.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){G(e,z.scorm2004.CMIDecimal)&&k(e,z.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){G(e,z.scorm2004.CMISInteger)&&k(e,z.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},t}(a),$=z.scorm2004,B={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:$.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:$.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:$.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:$.CMIShortIdentifier,format2:$.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+$.CMIShortIdentifier,format2:$.CMIDecimal+"|^$|"+$.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:$.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:$.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:$.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:$.CMIString4000,max:1,delimiter:"",unique:!1}},J={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:$.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:$.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:$.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:$.CMIShortIdentifier,format2:$.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+$.CMIShortIdentifier,format2:$.CMIDecimal+"|^$|"+$.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:$.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:$.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:$.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:$.CMIString4000,limit:1}},Z=function(e){function t(){return e.call(this,{children:_.scorm2004.interactions_children,errorCode:u.scorm2004.READ_ONLY_ELEMENT,errorClass:y})||this}return r(t,e),t}(S),W=function(e){function t(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new S({errorCode:u.scorm2004.READ_ONLY_ELEMENT,errorClass:y,children:_.scorm2004.objectives_children}),t.correct_responses=new S({errorCode:u.scorm2004.READ_ONLY_ELEMENT,errorClass:y,children:_.scorm2004.correct_responses_children}),t}return r(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){G(e,z.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new y(u.scorm2004.DEPENDENCY_NOT_ESTABLISHED);G(e,z.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new y(u.scorm2004.DEPENDENCY_NOT_ESTABLISHED);G(e,z.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new y(u.scorm2004.DEPENDENCY_NOT_ESTABLISHED);G(e,z.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new y(u.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=B[this.type];if(!i)throw new y(u.scorm2004.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new y(u.scorm2004.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n2&&(o=n[2],i=n[1].replace(o,"")),(a=t[i])&&this.processListeners(a,"adl.nav.request",o)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if(R(e,t)){var i=e.match(t),r=i[1],n=i[2].replace("{target=","").replace("}","");if("choice"===r||"jump"===r)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),_.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,i){if(R(e,"cmi\\.objectives\\.\\d+"))return new ce;if(i){if(R(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if(R(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new K}else if(R(e,"cmi\\.interactions\\.\\d+"))return new W;return R(e,"cmi\\.comments_from_learner\\.\\d+")?new se:R(e,"cmi\\.comments_from_lms\\.\\d+")?new se(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var i=e.split("."),r=Number(i[2]),n=this.cmi.interactions.childArray[r];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=J[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(u.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(u.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new Q:null},t.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(u.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r1)Number(t[0])>Number(t[1])&&this.throwSCORMError(u.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var c=0;c0&&(ue.includes(a.toLowerCase())||this.throwSCORMError(u.scorm2004.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(u.scorm2004.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(u.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=w(t);switch(this.settings.dataCommitFormat){case"flattened":return w(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=L(this.cmi.getCurrentTotalTime(),z.scorm2004.CMITimespan),r=q.unknown,n=Y.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?r=q.completed:"incomplete"===this.cmi.completion_status&&(r=q.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?n=Y.passed:"failed"===this.cmi.success_status&&(n=Y.failed));var o=this.cmi.score,s=null;o&&(s={},Number.isNaN(Number.parseFloat(o.raw))||(s.raw=Number.parseFloat(o.raw)),Number.isNaN(Number.parseFloat(o.min))||(s.min=Number.parseFloat(o.min)),Number.isNaN(Number.parseFloat(o.max))||(s.max=Number.parseFloat(o.max)),Number.isNaN(Number.parseFloat(o.scaled))||(s.scaled=Number.parseFloat(o.scaled)));var a={completionStatus:r,successStatus:n,totalTimeSeconds:i,runtimeData:t};return s&&(a.score=s),a},t.prototype.storeData=function(e){return o(this,void 0,void 0,(function(){var t,i,r,n,o,a,c;return s(this,(function(s){switch(s.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(c=null===(a=null===(o=this.startingData)||void 0===o?void 0:o.adl)||void 0===a?void 0:a.nav)||void 0===c?void 0:c.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),i=e||this.settings.alwaysSendTotalTime,r=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===_.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(r)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,r,e)];case 1:return n=s.sent(),t&&void 0!==n.navRequest&&""!==n.navRequest&&Function('"use strict";(() => { '.concat(n.navRequest," })()"))(),[2,n];case 2:return[2,{result:_.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(P);function pe(e,t,i){return V(e,t,u.scorm12.TYPE_MISMATCH,E,i)}function fe(e,t,i){if(!i&&""===e)throw new E(u.scorm12.VALUE_OUT_OF_RANGE);return F(e,t,u.scorm12.VALUE_OUT_OF_RANGE,E)}var ge=function(e){function t(){var t=e.call(this)||this;return t.__children=_.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new ie({score_children:_.scorm12.score_children,score_range:z.scorm12.score_range,invalidErrorCode:u.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.scorm12.TYPE_MISMATCH,invalidRangeCode:u.scorm12.VALUE_OUT_OF_RANGE,errorClass:E}),t}return r(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new E(u.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){pe(e,z.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?pe(e,z.scorm12.CMIStatus)&&(this._lesson_status=e):pe(e,z.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){pe(e,z.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){pe(e,z.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){pe(e,z.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t,i,r,n=this._session_time,o=e;null!=o&&(n=O(((new Date).getTime()-o)/1e3));return t=this._total_time,i=n,"string"==typeof(r=new RegExp(z.scorm12.CMITimespan))&&(r=new RegExp(r)),O(T(t,r)+T(i,r))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(a),Ee=function(e){function t(){return e.call(this,{children:_.scorm12.objectives_children,errorCode:u.scorm12.INVALID_SET_VALUE,errorClass:E})||this}return r(t,e),t}(S),be=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new ie({score_children:_.scorm12.score_children,score_range:z.scorm12.score_range,invalidErrorCode:u.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.scorm12.TYPE_MISMATCH,invalidRangeCode:u.scorm12.VALUE_OUT_OF_RANGE,errorClass:E}),t}return r(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){pe(e,z.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){pe(e,z.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(a),ye=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||_.scorm12.student_data_children,i}return r(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new E(u.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(a),Me=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||_.scorm12.student_preference_children,i}return r(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new E(u.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){pe(e,z.scorm12.CMISInteger)&&fe(e,z.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){pe(e,z.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){pe(e,z.scorm12.CMISInteger)&&fe(e,z.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){pe(e,z.scorm12.CMISInteger)&&fe(e,z.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(a),Se=function(e){function t(){return e.call(this,{children:_.scorm12.interactions_children,errorCode:u.scorm12.INVALID_SET_VALUE,errorClass:E})||this}return r(t,e),t}(S),Ie=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new S({errorCode:u.scorm12.INVALID_SET_VALUE,errorClass:E,children:_.scorm12.objectives_children}),t.correct_responses=new S({errorCode:u.scorm12.INVALID_SET_VALUE,errorClass:E,children:_.scorm12.correct_responses_children}),t}return r(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){pe(e,z.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){pe(e,z.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){pe(e,z.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){pe(e,z.scorm12.CMIDecimal)&&fe(e,z.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){pe(e,z.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){pe(e,z.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){pe(e,z.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(a),ve=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return r(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){pe(e,z.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(a),Oe=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return r(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new E(u.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){pe(e,z.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(a),Ce=function(e){function t(t,i,r){var n=e.call(this)||this;return n.__children="",n.__version="3.4",n._launch_data="",n._comments="",n._comments_from_lms="",r&&n.initialize(),n.__children=t||_.scorm12.cmi_children,n.core=new ge,n.objectives=new Ee,n.student_data=i||new ye,n.student_preference=new Me,n.interactions=new Se,n}return r(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new E(u.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new E(u.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){pe(e,z.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new E(u.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c),Te=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return r(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){pe(e,z.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(a),Le=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,u.scorm12,t)||this).statusSetByModule=!1,i.cmi=new Ce,i.nav=new Te,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return r(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new Ce,this.nav=new Te},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),_.global.SCORM_TRUE},t.prototype.internalFinish=function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===_.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),_.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return R(e,"cmi\\.objectives\\.\\d+")?new be:i&&R(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new Oe:i&&R(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new ve:!i&&R(e,"cmi\\.interactions\\.\\d+")?new Ie:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),_.scorm12.error_descriptions[e]&&(i=_.scorm12.error_descriptions[e].basicMessage,r=_.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=w(t);switch(this.settings.dataCommitFormat){case"flattened":return w(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=T(this.cmi.getCurrentTotalTime(),z.scorm12.CMITimespan),r=this.cmi.core.lesson_status,n=q.unknown,o=Y.unknown;r&&(n="completed"===r||"passed"===r?q.completed:q.incomplete,"passed"===r?o=Y.passed:"failed"===r&&(o=Y.failed));var s=this.cmi.core.score,a=null;s&&(a={},Number.isNaN(Number.parseFloat(s.raw))||(a.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(a.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(a.max=Number.parseFloat(s.max)));var c={successStatus:o,completionStatus:n,runtimeData:t,totalTimeSeconds:i};return a&&(c.score=a),c},t.prototype.storeData=function(e){return o(this,void 0,void 0,(function(){var t,i,r,n,o,a;return s(this,(function(s){switch(s.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(a=null===(o=null===(n=this.startingData)||void 0===n?void 0:n.cmi)||void 0===o?void 0:o.core)||void 0===a?void 0:a.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,r=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===_.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(r)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,r,e)];case 1:return[2,s.sent()];case 2:return[2,{result:_.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(P),we=u.scorm12;function Ne(e,t,i){return V(e,t,we.TYPE_MISMATCH,b,i)}var Re=function(e){function t(){var t=e.call(this)||this;return t.comments=new Ae,t}return r(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},t}(a),Ae=function(e){function t(){return e.call(this,{children:_.aicc.comments_children,errorCode:u.scorm12.INVALID_SET_VALUE,errorClass:b})||this}return r(t,e),t}(S),je=function(e){function t(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return r(t,e),Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"location",{get:function(){return this._location},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){Ne(e,z.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},t}(a),De=function(e){function t(){var t=e.call(this,_.aicc.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new S({errorCode:u.scorm12.INVALID_SET_VALUE,errorClass:b,children:""}),t}return r(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_color",{get:function(){return this._text_color},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_location",{get:function(){return this._text_location},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_size",{get:function(){return this._text_size},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"video",{get:function(){return this._video},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},t}(Me),Pe=function(e){function t(){var t=e.call(this)||this;return t.__children=_.aicc.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return r(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},t}(a),xe=function(e){function t(){return e.call(this,{children:_.aicc.tries_children})||this}return r(t,e),t}(S),ze=function(e){function t(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new ie({score_children:_.aicc.score_children,score_range:z.aicc.score_range,invalidErrorCode:u.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.scorm12.TYPE_MISMATCH,invalidRangeCode:u.scorm12.VALUE_OUT_OF_RANGE,errorClass:b}),t}return r(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){Ne(e,z.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){Ne(e,z.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},t}(a),Ve=function(e){function t(){return e.call(this,{children:_.aicc.attempt_records_children})||this}return r(t,e),t}(S),Fe=function(e){function t(){var t=e.call(this)||this;return t._lesson_status="",t.score=new ie({score_children:_.aicc.score_children,score_range:z.aicc.score_range,invalidErrorCode:u.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.scorm12.TYPE_MISMATCH,invalidRangeCode:u.scorm12.VALUE_OUT_OF_RANGE,errorClass:b}),t}return r(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){Ne(e,z.aicc.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},t}(a),Ge=function(e){function t(){var t=e.call(this,_.aicc.student_data_children)||this;return t._tries_during_lesson="",t.tries=new xe,t.attempt_records=new Ve,t}return r(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize(),null===(i=this.attempt_records)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new b(u.scorm12.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries,attempt_records:this.attempt_records};return delete this.jsonString,e},t}(ye),ke=function(e){function t(){return e.call(this,{children:_.aicc.paths_children})||this}return r(t,e),t}(S),Ue=function(e){function t(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}return r(t,e),Object.defineProperty(t.prototype,"location_id",{get:function(){return this._location_id},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"date",{get:function(){return this._date},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){Ne(e,z.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){Ne(e,z.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"why_left",{get:function(){return this._why_left},set:function(e){Ne(e,z.aicc.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){Ne(e,z.aicc.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e},t}(a),Ye=function(e){function t(t){void 0===t&&(t=!1);var i=e.call(this,_.aicc.cmi_children)||this;return t&&i.initialize(),i.student_preference=new De,i.student_data=new Ge,i.student_demographics=new Pe,i.evaluation=new Re,i.paths=new ke,i}return r(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},t}(Ce),qe=function(e){function t(t){var i=e.call(this,t)||this;return i.cmi=new Ye,i.nav=new Te,i}return r(t,e),t.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||(R(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new je:R(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new ze:R(t,"cmi\\.student_data\\.attempt_records\\.\\d+")?n=new Fe:R(t,"cmi\\.paths\\.\\d+")&&(n=new Ue)),n},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},t}(Le);return t}()})); -//# sourceMappingURL=index.min.js.map \ No newline at end of file diff --git a/dist/index.min.js.map b/dist/index.min.js.map deleted file mode 100644 index 35544c4..0000000 --- a/dist/index.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,eAAiBD,IAEzBD,EAAK,eAAiBC,GACvB,CATD,CASGK,MAAM,WACT,O,wBCTA,IAAIC,EAAsB,CCA1BA,EAAwB,SAASL,EAASM,GACzC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAF,EAAwB,SAASQ,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECCtGT,EAAwB,SAASL,GACX,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GACvD,G,oHCUA,IAAIC,EAAgB,SAASC,EAAGC,GAI9B,OAHAF,EAAgBZ,OAAOe,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUJ,EAAGC,GAAKD,EAAEG,UAAYF,CAAG,GAC1E,SAAUD,EAAGC,GAAK,IAAK,IAAII,KAAKJ,EAAOd,OAAOM,UAAUC,eAAeC,KAAKM,EAAGI,KAAIL,EAAEK,GAAKJ,EAAEI,GAAI,EAC7FN,EAAcC,EAAGC,EAC1B,EAEO,SAASK,EAAUN,EAAGC,GAC3B,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIM,UAAU,uBAAyBC,OAAOP,GA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BC,WAAYriB,KAAKqiB,WACjBC,aAActiB,KAAKsiB,aACnBhB,mBAAoBthB,KAAKshB,mBACzBxB,SAAU9f,KAAK8f,SACfyC,iBAAkBviB,KAAKuiB,iBACvBC,KAAMxiB,KAAKwiB,KACXhF,WAAYxd,KAAKwd,WACjB8C,iBAAkBtgB,KAAKsgB,iBACvBmC,qBAAsBziB,KAAKyiB,qBAC3BvC,MAAOlgB,KAAKkgB,MACZwC,aAAc1iB,KAAK0iB,aACnBtC,eAAgBpgB,KAAKogB,eACrBuC,aAAc3iB,KAAK2iB,aACnBC,kBAAmB5iB,KAAK4iB,mBAG1B,cADO5iB,KAAK8C,WACLrB,CACT,EACF,EAtkBA,CAAyB2hB,GCyXzB,GAzYiC,CAC/B,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,QRvYF,SAAYhJ,GACV,oBACA,cACA,eACD,CAJD,CAAYA,IAAAA,EAAU,KAMtB,SAAYe,GACV,kBACA,kBACA,mBACD,CAJD,CAAYA,IAAAA,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AAE/sB,aACP,QAAV,EAAAjD,KAAKkwB,aAAK,SAAEjtB,YACd,EAoBA,YAAAyF,OAAA,WAcE1I,KAAK8C,YAAa,EAClB,IAAMrB,EAAS,CACbkhB,aAAc3iB,KAAK2iB,aACnBP,YAAapiB,KAAKoiB,YAClB+I,SAAUnrB,KAAKmrB,SACfzJ,kBAAmB1hB,KAAK0hB,kBACxBoJ,KAAM9qB,KAAK8qB,KACXtN,WAAYxd,KAAKwd,WACjBmN,aAAc3qB,KAAK2qB,aACnBM,mBAAoBjrB,KAAKirB,mBACzB6E,qBAAsB9vB,KAAK8vB,qBAC3BlO,aAAc5hB,KAAK4hB,aACnBoO,WAAYhwB,KAAKgwB,WACjBE,MAAOlwB,KAAKkwB,OAGd,cADOlwB,KAAK8C,WACLrB,CACT,EACF,EAnFA,CAAyB,I,GCDzB,YAKE,WAAYuN,GACV,QAAK,UAACA,IAAS,K,OAEf,EAAKgB,IAAM,IAAI,GACf,EAAKqT,IAAM,IAAIkI,G,CACjB,CA8CF,OAxDkC,OAoBhC,YAAAlY,gBAAA,SACEhD,EACAjR,EACAmT,GAEA,IAAIa,EAAW,YAAMC,gBAAe,UAAChD,EAAYjR,EAAOmT,GAkBxD,OAhBKa,IACCzH,EAAc0E,EAAY,sCAC5B+C,EAAW,IAAIgd,GAEfzkB,EAAc0E,EAAY,qCAE1B+C,EAAW,IAAIid,GAEf1kB,EAAc0E,EAAY,+CAE1B+C,EAAW,IAAIkd,GACN3kB,EAAc0E,EAAY,wBACnC+C,EAAW,IAAImd,KAIZnd,CACT,EAOA,YAAAwU,2BAAA,SAA2BC,GAEzB7nB,KAAKgQ,IAAM6X,EAAO7X,IAClBhQ,KAAKqjB,IAAMwE,EAAOxE,GACpB,EACF,EAxDA,CAAkC,I","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","extendStatics","d","b","setPrototypeOf","__proto__","Array","p","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","Iterator","verb","iterator","v","op","pop","push","SuppressedError","jsonString","_initialized","_start_time","initialize","setStartTime","Date","getTime","BaseCMI","global","GENERAL","INITIALIZATION_FAILED","INITIALIZED","TERMINATED","TERMINATION_FAILURE","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","STORE_BEFORE_INIT","STORE_AFTER_TERM","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","ARGUMENT_ERROR","CHILDREN_ERROR","COUNT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNDEFINED_DATA_MODEL","UNIMPLEMENTED_ELEMENT","VALUE_NOT_INITIALIZED","INVALID_SET_VALUE","READ_ONLY_ELEMENT","WRITE_ONLY_ELEMENT","TYPE_MISMATCH","VALUE_OUT_OF_RANGE","DEPENDENCY_NOT_ESTABLISHED","scorm12","scorm2004","MULTIPLE_TERMINATIONS","cmi_children","core_children","score_children","comments_children","objectives_children","correct_responses_children","student_data_children","student_preference_children","interactions_children","error_descriptions","basicMessage","detailMessage","SCORM_TRUE","SCORM_FALSE","STATE_NOT_INITIALIZED","STATE_INITIALIZED","STATE_TERMINATED","LOG_LEVEL_DEBUG","LOG_LEVEL_INFO","LOG_LEVEL_WARNING","LOG_LEVEL_ERROR","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","scorm12_errors","aicc_errors","scorm2004_errors","errorCode","toString","_errorCode","name","setMessage","message","Error","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","scorm12_error_codes","params","__children","children","_errorClass","errorClass","childArray","_children","_count","toJSON","SECONDS_PER_HOUR","designations","D","H","M","S","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","seconds","getSeconds","ms","msStr","countDecimals","toFixed","split","replace","getSecondsAsISODuration","duration","remainder","designationsKey","current_seconds","Number","indexOf","getTimeAsSeconds","timeString","timeRegex","RegExp","match","parts","getDurationAsSeconds","durationRegex","exec","years","days","flatten","data","recurse","cur","isArray","l","isEmpty","num","stringMatches","str","tester","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","status","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","warn","info","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","currentState","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","isTerminated","cmi","processListeners","apiLog","clearSCORMError","functionName","CMIElement","messageString","fillChars","j","formatMessage","terminate","checkTerminated","checkState","storeData","getValue","getCMIValue","handleValueAccessException","undefined","setValue","commitCallback","setCMIValue","scheduleCommit","clearScheduledCommit","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","_CMIElement","_value","_commonSetCMIValue","methodName","structure","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","idx","attribute","substring","_checkObjectHasProperty","validateCorrectResponse","CMIArray","index","parseInt","isNaN","item","newChild","getChildElement","initialized","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","on","listenerName","listenerFunctions","listenerSplit","off","removeIndex","findIndex","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","errorNumber","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","keys","map","sort","test","a","c","testPattern","forEach","element","loadFromJSON","regex","m","unflatten","a_pattern","c_match","a_match","a_num","c_num","startingData","currentCMIElement","renderCMIToJSONString","stringify","k","renderCMIToJSONObject","processHttpRequest","url","immediate","api","genericError","performFetch","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","join","headers","credentials","keepalive","CMIString256","CMIString4096","CMITime","CMITimespan","CMIInteger","CMISInteger","CMIDecimal","CMIIdentifier","CMIFeedback","CMIIndex","CMIStatus","CMIStatus2","CMIExit","CMIType","CMIResult","NAVEvent","score_range","audio_range","speed_range","weighting_range","text_range","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVBoolean","NAVTarget","scaled_range","progress_range","checkValidFormat","regexPattern","allowEmptyString","formatRegex","matches","checkValidRange","rangePattern","ranges","check2004ValidFormat","Scorm2004ValidationError","check2004ValidRange","SuccessStatus","CompletionStatus","_audio_level","_language","_delivery_speed","_audio_captioning","audio_level","language","delivery_speed","audio_captioning","scorm2004_regex","LearnerResponses","format","max","delimiter","unique","choice","matching","format2","delimiter2","performance","sequencing","likert","numeric","other","CorrectResponses","duplicate","limit","delimiter3","_id","_type","_timestamp","_weighting","_learner_response","_result","_latency","_description","objectives","correct_responses","id","type","timestamp","weighting","learner_response","nodes","response_type","values","latency","description","_pattern","pattern","scorm12_constants","scorm12_regex","_raw","_min","__score_range","_max","__invalid_error_code","__invalid_type_code","invalidTypeCode","__invalid_range_code","invalidRangeCode","__decimal_regex","decimalRegex","__error_class","raw","min","_scaled","scaled","CMIScore","readOnlyAfterInit","_comment","_location","_readOnlyAfterInit","comment","location","_success_status","_completion_status","_progress_measure","score","Scorm2004CMIScore","success_status","completion_status","progress_measure","__version","_completion_threshold","_credit","_entry","_exit","_launch_data","_learner_id","_learner_name","_max_time_allowed","_mode","_scaled_passing_score","_session_time","_suspend_data","_time_limit_action","_total_time","learner_preference","CMILearnerPreference","comments_from_learner","CMICommentsFromLearner","comments_from_lms","CMICommentsFromLMS","interactions","CMIInteractions","CMIObjectives","_version","completion_threshold","credit","entry","exit","launch_data","learner_id","learner_name","max_time_allowed","mode","scaled_passing_score","session_time","suspend_data","time_limit_action","total_time","getCurrentTotalTime","sessionTime","startTime","start_time","first","second","BaseRootCMI","nav","ADLNav","_request","request_valid","ADLNavRequestValid","request","_continue","_previous","_choice","_jump","jump","previous","continue","mastery_override","CMI","adl","ADL","Initialize","lmsInitialize","Terminate","lmsFinish","GetValue","lmsGetValue","SetValue","lmsSetValue","Commit","lmsCommit","GetLastError","lmsGetLastError","GetErrorString","lmsGetErrorString","GetDiagnostic","lmsGetDiagnostic","reset","internalFinish","navActions","exitAll","abandon","abandonAll","choiceJumpRegex","action","adlNavRequestRegex","includes","CMIObjectivesObject","createCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","CMICommentsObject","interaction","checkDuplicateChoiceResponse","checkValidResponseType","CMIInteractionsCorrectResponsesObject","interaction_type","checkCorrectResponseValue","interaction_count","pattern_index","checkDuplicatedPattern","detail","correct_response","current_index","found","count","removeCorrectResponsePrefixes","node","seenOrder","seenCase","seenLang","prefixRegex","langMatches","lang","toLowerCase","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeSeconds","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","navRequest","encodeURIComponent","shouldTerminateCommit","Function","check12ValidFormat","Scorm12ValidationError","check12ValidRange","_student_id","_student_name","_lesson_location","_lesson_status","_lesson_mode","student_id","student_name","lesson_location","lesson_status","lesson_mode","_status","_mastery_score","mastery_score","_audio","_speed","_text","audio","speed","_time","_student_response","time","student_response","student_data","_comments","_comments_from_lms","core","CMICore","CMIStudentData","student_preference","CMIStudentPreference","comments","_event","event","statusSetByModule","NAV","LMSInitialize","LMSFinish","LMSGetValue","LMSSetValue","LMSCommit","LMSGetLastError","LMSGetErrorString","LMSGetDiagnostic","lessonStatus","originalStatus","aicc_error_codes","checkAICCValidFormat","AICCValidationError","CMIEvaluationComments","_content","content","_lesson_type","_text_color","_text_location","_text_size","_video","windows","lesson_type","text_color","text_location","text_size","video","_city","_class","_company","_country","_experience","_familiar_name","_instructor_name","_title","_native_language","_state","_street_address","_telephone","_years_experience","city","clazz","company","country","experience","familiar_name","instructor_name","title","native_language","state","street_address","telephone","years_experience","class","_tries_during_lesson","tries","CMITries","attempt_records","CMIAttemptRecords","tries_during_lesson","_location_id","_date","_why_left","_time_in_element","location_id","date","why_left","time_in_element","AICCStudentPreferences","AICCCMIStudentData","student_demographics","CMIStudentDemographics","evaluation","CMIEvaluation","paths","CMIPaths","CMIEvaluationCommentsObject","CMITriesObject","CMIAttemptRecordsObject","CMIPathsObject"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/scorm-again.js b/dist/scorm-again.js index 599fff0..bfbd4fa 100644 --- a/dist/scorm-again.js +++ b/dist/scorm-again.js @@ -10,1094 +10,1042 @@ })(self, function() { return /******/ (function() { // webpackBootstrap /******/ "use strict"; -var __webpack_exports__ = {}; +/******/ var __webpack_modules__ = ({ -;// ./node_modules/tslib/tslib.es6.mjs -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 531: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* binding */ src_AICC; } +}); -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/Scorm12API.ts +var Scorm12API = __webpack_require__(941); +// EXTERNAL MODULE: ./src/cmi/scorm12/cmi.ts + 1 modules +var cmi = __webpack_require__(989); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); +;// ./src/cmi/aicc/validation.ts -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; +var aicc_error_codes = error_codes/* default */.A.scorm12; +function checkAICCValidFormat(value, regexPattern, allowEmptyString) { + return (0,validation/* checkValidFormat */.q)(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, exceptions/* AICCValidationError */.gv, allowEmptyString); } -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +;// ./src/cmi/aicc/evaluation.ts -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} +var CMIEvaluation = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluation, _super); + function CMIEvaluation() { + var _this = _super.call(this) || this; + _this.comments = new CMIEvaluationComments(); + return _this; + } + CMIEvaluation.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + CMIEvaluation.prototype.toJSON = function () { + this.jsonString = true; + var result = { + comments: this.comments, + }; + delete this.jsonString; + return result; + }; + return CMIEvaluation; +}(base_cmi/* BaseCMI */.J)); -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); +var CMIEvaluationComments = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluationComments, _super); + function CMIEvaluationComments() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.comments_children, + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, + }) || this; + } + return CMIEvaluationComments; +}(array/* CMIArray */.B)); +var CMIEvaluationCommentsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIEvaluationCommentsObject, _super); + function CMIEvaluationCommentsObject() { + var _this = _super.call(this) || this; + _this._content = ""; + _this._location = ""; + _this._time = ""; + return _this; + } + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", { + get: function () { + return this._content; + }, + set: function (content) { + if (checkAICCValidFormat(content, regex/* default */.A.aicc.CMIString256)) { + this._content = content; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "location", { + get: function () { + return this._location; + }, + set: function (location) { + if (checkAICCValidFormat(location, regex/* default */.A.aicc.CMIString256)) { + this._location = location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIEvaluationCommentsObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + CMIEvaluationCommentsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + content: this.content, + location: this.location, + time: this.time, + }; + delete this.jsonString; + return result; + }; + return CMIEvaluationCommentsObject; +}(base_cmi/* BaseCMI */.J)); -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +;// ./src/cmi/aicc/student_preferences.ts -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -/* harmony default export */ var tslib_es6 = ({ - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}); -;// ./src/cmi/common/base_cmi.ts -var BaseCMI = (function () { - function BaseCMI() { - this.jsonString = false; - this._initialized = false; +var AICCStudentPreferences = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCStudentPreferences, _super); + function AICCStudentPreferences() { + var _this = _super.call(this, api_constants/* default */.A.aicc.student_preference_children) || this; + _this._lesson_type = ""; + _this._text_color = ""; + _this._text_location = ""; + _this._text_size = ""; + _this._video = ""; + _this.windows = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + errorClass: exceptions/* AICCValidationError */.gv, + children: "", + }); + return _this; } - Object.defineProperty(BaseCMI.prototype, "initialized", { + AICCStudentPreferences.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.windows) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(AICCStudentPreferences.prototype, "lesson_type", { get: function () { - return this._initialized; + return this._lesson_type; + }, + set: function (lesson_type) { + if (checkAICCValidFormat(lesson_type, regex/* default */.A.aicc.CMIString256)) { + this._lesson_type = lesson_type; + } }, enumerable: false, configurable: true }); - Object.defineProperty(BaseCMI.prototype, "start_time", { + Object.defineProperty(AICCStudentPreferences.prototype, "text_color", { get: function () { - return this._start_time; + return this._text_color; + }, + set: function (text_color) { + if (checkAICCValidFormat(text_color, regex/* default */.A.aicc.CMIString256)) { + this._text_color = text_color; + } }, enumerable: false, configurable: true }); - BaseCMI.prototype.initialize = function () { - this._initialized = true; - }; - BaseCMI.prototype.setStartTime = function () { - this._start_time = new Date().getTime(); - }; - return BaseCMI; -}()); - -var BaseRootCMI = (function (_super) { - __extends(BaseRootCMI, _super); - function BaseRootCMI() { - return _super !== null && _super.apply(this, arguments) || this; - } - return BaseRootCMI; -}(BaseCMI)); - - -;// ./src/constants/error_codes.ts - -var global = { - GENERAL: 101, - INITIALIZATION_FAILED: 101, - INITIALIZED: 101, - TERMINATED: 101, - TERMINATION_FAILURE: 101, - TERMINATION_BEFORE_INIT: 101, - MULTIPLE_TERMINATION: 101, - RETRIEVE_BEFORE_INIT: 101, - RETRIEVE_AFTER_TERM: 101, - STORE_BEFORE_INIT: 101, - STORE_AFTER_TERM: 101, - COMMIT_BEFORE_INIT: 101, - COMMIT_AFTER_TERM: 101, - ARGUMENT_ERROR: 101, - CHILDREN_ERROR: 101, - COUNT_ERROR: 101, - GENERAL_GET_FAILURE: 101, - GENERAL_SET_FAILURE: 101, - GENERAL_COMMIT_FAILURE: 101, - UNDEFINED_DATA_MODEL: 101, - UNIMPLEMENTED_ELEMENT: 101, - VALUE_NOT_INITIALIZED: 101, - INVALID_SET_VALUE: 101, - READ_ONLY_ELEMENT: 101, - WRITE_ONLY_ELEMENT: 101, - TYPE_MISMATCH: 101, - VALUE_OUT_OF_RANGE: 101, - DEPENDENCY_NOT_ESTABLISHED: 101, -}; -var scorm12 = __assign(__assign({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var scorm2004 = __assign(__assign({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var ErrorCodes = { - scorm12: scorm12, - scorm2004: scorm2004, -}; -/* harmony default export */ var error_codes = (ErrorCodes); - -;// ./src/constants/api_constants.ts - -var api_constants_global = { - SCORM_TRUE: "true", - SCORM_FALSE: "false", - STATE_NOT_INITIALIZED: 0, - STATE_INITIALIZED: 1, - STATE_TERMINATED: 2, - LOG_LEVEL_DEBUG: 1, - LOG_LEVEL_INFO: 2, - LOG_LEVEL_WARNING: 3, - LOG_LEVEL_ERROR: 4, - LOG_LEVEL_NONE: 5, -}; -var api_constants_scorm12 = { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", - core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", - score_children: "raw,min,max", - comments_children: "content,location,time", - objectives_children: "id,score,status", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio,language,speed,text", - interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", - error_descriptions: { - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + Object.defineProperty(AICCStudentPreferences.prototype, "text_location", { + get: function () { + return this._text_location; }, - "201": { - basicMessage: "Invalid argument error", - detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + set: function (text_location) { + if (checkAICCValidFormat(text_location, regex/* default */.A.aicc.CMIString256)) { + this._text_location = text_location; + } }, - "202": { - basicMessage: "Element cannot have children", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "text_size", { + get: function () { + return this._text_size; }, - "203": { - basicMessage: "Element not an array - cannot have count", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + set: function (text_size) { + if (checkAICCValidFormat(text_size, regex/* default */.A.aicc.CMIString256)) { + this._text_size = text_size; + } }, - "301": { - basicMessage: "Not initialized", - detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + enumerable: false, + configurable: true + }); + Object.defineProperty(AICCStudentPreferences.prototype, "video", { + get: function () { + return this._video; }, - "401": { - basicMessage: "Not implemented error", - detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + set: function (video) { + if (checkAICCValidFormat(video, regex/* default */.A.aicc.CMIString256)) { + this._video = video; + } }, - "402": { - basicMessage: "Invalid set value, element is a keyword", - detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + enumerable: false, + configurable: true + }); + AICCStudentPreferences.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio: this.audio, + language: this.language, + lesson_type: this.lesson_type, + speed: this.speed, + text: this.text, + text_color: this.text_color, + text_location: this.text_location, + text_size: this.text_size, + video: this.video, + windows: this.windows, + }; + delete this.jsonString; + return result; + }; + return AICCStudentPreferences; +}(student_preference/* CMIStudentPreference */.G)); + + +;// ./src/cmi/aicc/student_demographics.ts + + + + + +var CMIStudentDemographics = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIStudentDemographics, _super); + function CMIStudentDemographics() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.aicc.student_demographics_children; + _this._city = ""; + _this._class = ""; + _this._company = ""; + _this._country = ""; + _this._experience = ""; + _this._familiar_name = ""; + _this._instructor_name = ""; + _this._title = ""; + _this._native_language = ""; + _this._state = ""; + _this._street_address = ""; + _this._telephone = ""; + _this._years_experience = ""; + return _this; + } + Object.defineProperty(CMIStudentDemographics.prototype, "_children", { + get: function () { + return this.__children; }, - "403": { - basicMessage: "Element is read only", - detailMessage: "LMSSetValue was called with a data model element that can only be read.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "city", { + get: function () { + return this._city; }, - "404": { - basicMessage: "Element is write only", - detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + set: function (city) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._city = city; + } }, - "405": { - basicMessage: "Incorrect Data Type", - detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "class", { + get: function () { + return this._class; }, - "407": { - basicMessage: "Element Value Out Of Range", - detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + set: function (clazz) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._class = clazz; + } }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "company", { + get: function () { + return this._company; }, - }, -}; -var aicc = __assign(__assign({}, api_constants_scorm12), { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", - student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", - student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", - student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", - tries_children: "time,status,score", - attempt_records_children: "score,lesson_status", - paths_children: "location_id,date,time,status,why_left,time_in_element", -}); -var api_constants_scorm2004 = { - cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", - comments_children: "comment,timestamp,location", - score_children: "max,raw,scaled,min", - objectives_children: "progress_measure,completion_status,success_status,description,score,id", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio_level,audio_captioning,delivery_speed,language", - interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", - error_descriptions: { - "0": { - basicMessage: "No Error", - detailMessage: "No error occurred, the previous API call was successful.", + set: function (company) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._company = company; + } }, - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "country", { + get: function () { + return this._country; }, - "102": { - basicMessage: "General Initialization Failure", - detailMessage: "Call to Initialize failed for an unknown reason.", + set: function (country) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._country = country; + } }, - "103": { - basicMessage: "Already Initialized", - detailMessage: "Call to Initialize failed because Initialize was already called.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "experience", { + get: function () { + return this._experience; }, - "104": { - basicMessage: "Content Instance Terminated", - detailMessage: "Call to Initialize failed because Terminate was already called.", + set: function (experience) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._experience = experience; + } }, - "111": { - basicMessage: "General Termination Failure", - detailMessage: "Call to Terminate failed for an unknown reason.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "familiar_name", { + get: function () { + return this._familiar_name; }, - "112": { - basicMessage: "Termination Before Initialization", - detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + set: function (familiar_name) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._familiar_name = familiar_name; + } }, - "113": { - basicMessage: "Termination After Termination", - detailMessage: "Call to Terminate failed because Terminate was already called.", - }, - "122": { - basicMessage: "Retrieve Data Before Initialization", - detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", - }, - "123": { - basicMessage: "Retrieve Data After Termination", - detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", - }, - "132": { - basicMessage: "Store Data Before Initialization", - detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", - }, - "133": { - basicMessage: "Store Data After Termination", - detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", - }, - "142": { - basicMessage: "Commit Before Initialization", - detailMessage: "Call to Commit failed because it was made before the call to Initialize.", - }, - "143": { - basicMessage: "Commit After Termination", - detailMessage: "Call to Commit failed because it was made after the call to Terminate.", - }, - "201": { - basicMessage: "General Argument Error", - detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", - }, - "301": { - basicMessage: "General Get Failure", - detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "351": { - basicMessage: "General Set Failure", - detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "391": { - basicMessage: "General Commit Failure", - detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "401": { - basicMessage: "Undefined Data Model Element", - detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", - }, - "402": { - basicMessage: "Unimplemented Data Model Element", - detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", - }, - "403": { - basicMessage: "Data Model Element Value Not Initialized", - detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", - }, - "404": { - basicMessage: "Data Model Element Is Read Only", - detailMessage: "SetValue was called with a data model element that can only be read.", - }, - "405": { - basicMessage: "Data Model Element Is Write Only", - detailMessage: "GetValue was called on a data model element that can only be written to.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "instructor_name", { + get: function () { + return this._instructor_name; }, - "406": { - basicMessage: "Data Model Element Type Mismatch", - detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", + set: function (instructor_name) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._instructor_name = instructor_name; + } }, - "407": { - basicMessage: "Data Model Element Value Out Of Range", - detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "title", { + get: function () { + return this._title; }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + set: function (title) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._title = title; + } }, - }, -}; -var APIConstants = { - global: api_constants_global, - scorm12: api_constants_scorm12, - aicc: aicc, - scorm2004: api_constants_scorm2004, -}; -/* harmony default export */ var api_constants = (APIConstants); - -;// ./src/exceptions.ts - - -var scorm12_errors = api_constants.scorm12.error_descriptions; -var aicc_errors = api_constants.aicc.error_descriptions; -var scorm2004_errors = api_constants.scorm2004.error_descriptions; -var BaseScormValidationError = (function (_super) { - __extends(BaseScormValidationError, _super); - function BaseScormValidationError(errorCode) { - var _this = _super.call(this, errorCode.toString()) || this; - _this._errorCode = errorCode; - _this.name = "ScormValidationError"; - return _this; - } - Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentDemographics.prototype, "native_language", { get: function () { - return this._errorCode; + return this._native_language; + }, + set: function (native_language) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._native_language = native_language; + } }, enumerable: false, configurable: true }); - BaseScormValidationError.prototype.setMessage = function (message) { - this.message = message; - }; - return BaseScormValidationError; -}(Error)); - -var ValidationError = (function (_super) { - __extends(ValidationError, _super); - function ValidationError(errorCode, errorMessage, detailedMessage) { - var _this = _super.call(this, errorCode) || this; - _this._detailedMessage = ""; - _this.setMessage(errorMessage); - _this._errorMessage = errorMessage; - if (detailedMessage) { - _this._detailedMessage = detailedMessage; - } - return _this; - } - Object.defineProperty(ValidationError.prototype, "errorMessage", { + Object.defineProperty(CMIStudentDemographics.prototype, "state", { get: function () { - return this._errorMessage; + return this._state; + }, + set: function (state) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._state = state; + } }, enumerable: false, configurable: true }); - Object.defineProperty(ValidationError.prototype, "detailedMessage", { + Object.defineProperty(CMIStudentDemographics.prototype, "street_address", { get: function () { - return this._detailedMessage; + return this._street_address; + }, + set: function (street_address) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._street_address = street_address; + } }, enumerable: false, configurable: true }); - return ValidationError; -}(BaseScormValidationError)); - -var Scorm12ValidationError = (function (_super) { - __extends(Scorm12ValidationError, _super); - function Scorm12ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; - } - return _this; - } - return Scorm12ValidationError; -}(ValidationError)); - -var AICCValidationError = (function (_super) { - __extends(AICCValidationError, _super); - function AICCValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { - _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; - } - return _this; - } - return AICCValidationError; -}(ValidationError)); - -var Scorm2004ValidationError = (function (_super) { - __extends(Scorm2004ValidationError, _super); - function Scorm2004ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; - } - return _this; - } - return Scorm2004ValidationError; -}(ValidationError)); - - -;// ./src/cmi/common/array.ts - - - - -var scorm12_error_codes = error_codes.scorm12; -var CMIArray = (function (_super) { - __extends(CMIArray, _super); - function CMIArray(params) { - var _this = _super.call(this) || this; - _this.__children = params.children; - _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; - _this._errorClass = params.errorClass || BaseScormValidationError; - _this.childArray = []; - return _this; - } - Object.defineProperty(CMIArray.prototype, "_children", { + Object.defineProperty(CMIStudentDemographics.prototype, "telephone", { get: function () { - return this.__children; + return this._telephone; }, - set: function (_children) { - throw new this._errorClass(this._errorCode); + set: function (telephone) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._telephone = telephone; + } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIArray.prototype, "_count", { + Object.defineProperty(CMIStudentDemographics.prototype, "years_experience", { get: function () { - return this.childArray.length; + return this._years_experience; }, - set: function (_count) { - throw new this._errorClass(this._errorCode); + set: function (years_experience) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._years_experience = years_experience; + } }, enumerable: false, configurable: true }); - CMIArray.prototype.toJSON = function () { + CMIStudentDemographics.prototype.toJSON = function () { this.jsonString = true; - var result = {}; - for (var i = 0; i < this.childArray.length; i++) { - result[i + ""] = this.childArray[i]; - } - delete this.jsonString; - return result; - }; - return CMIArray; -}(BaseCMI)); + var result = { + city: this.city, + class: this.class, + company: this.company, + country: this.country, + experience: this.experience, + familiar_name: this.familiar_name, + instructor_name: this.instructor_name, + title: this.title, + native_language: this.native_language, + state: this.state, + street_address: this.street_address, + telephone: this.telephone, + years_experience: this.years_experience, + }; + delete this.jsonString; + return result; + }; + return CMIStudentDemographics; +}(base_cmi/* BaseCMI */.J)); -;// ./src/utilities.ts -var SECONDS_PER_SECOND = 1.0; -var SECONDS_PER_MINUTE = 60; -var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; -var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; -var designations = { - D: SECONDS_PER_DAY, - H: SECONDS_PER_HOUR, - M: SECONDS_PER_MINUTE, - S: SECONDS_PER_SECOND, -}; -function getSecondsAsHHMMSS(totalSeconds) { - if (!totalSeconds || totalSeconds <= 0) { - return "00:00:00"; - } - var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); - var dateObj = new Date(totalSeconds * 1000); - var minutes = dateObj.getUTCMinutes(); - var seconds = dateObj.getSeconds(); - var ms = totalSeconds % 1.0; - var msStr = ""; - if (countDecimals(ms) > 0) { - if (countDecimals(ms) > 2) { - msStr = ms.toFixed(2); - } - else { - msStr = String(ms); - } - msStr = "." + msStr.split(".")[1]; +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +;// ./src/cmi/aicc/tries.ts + + + + + + + + + +var CMITries = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMITries, _super); + function CMITries() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.tries_children, + }) || this; } - return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); -} -function getSecondsAsISODuration(seconds) { - if (!seconds || seconds <= 0) { - return "PT0S"; + return CMITries; +}(array/* CMIArray */.B)); + +var CMITriesObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMITriesObject, _super); + function CMITriesObject() { + var _this = _super.call(this) || this; + _this._status = ""; + _this._time = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, + }); + return _this; } - var duration = "P"; - var remainder = seconds; - for (var designationsKey in designations) { - var current_seconds = designations[designationsKey]; - var value = Math.floor(remainder / current_seconds); - remainder = remainder % current_seconds; - if (countDecimals(remainder) > 2) { - remainder = Number(Number(remainder).toFixed(2)); - } - if (designationsKey === "S" && remainder > 0) { - value += remainder; - } - if (value) { - if ((duration.indexOf("D") > 0 || - designationsKey === "H" || - designationsKey === "M" || - designationsKey === "S") && - duration.indexOf("T") === -1) { - duration += "T"; + CMITriesObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMITriesObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { + this._status = status; } - duration += "".concat(value).concat(designationsKey); - } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMITriesObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + CMITriesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + status: this.status, + time: this.time, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMITriesObject; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var student_data = __webpack_require__(532); +;// ./src/cmi/aicc/attempts.ts + + + + + + + + + +var CMIAttemptRecords = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecords, _super); + function CMIAttemptRecords() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.attempt_records_children, + }) || this; } - return duration; -} -function getTimeAsSeconds(timeString, timeRegex) { - if (typeof timeString === "number" || typeof timeString === "boolean") { - timeString = String(timeString); + return CMIAttemptRecords; +}(array/* CMIArray */.B)); + +var CMIAttemptRecordsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIAttemptRecordsObject, _super); + function CMIAttemptRecordsObject() { + var _this = _super.call(this) || this; + _this._lesson_status = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.aicc.score_children, + score_range: regex/* default */.A.aicc.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* AICCValidationError */.gv, + }); + return _this; } - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); + CMIAttemptRecordsObject.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (checkAICCValidFormat(lesson_status, regex/* default */.A.aicc.CMIStatus2)) { + this._lesson_status = lesson_status; + } + }, + enumerable: false, + configurable: true + }); + CMIAttemptRecordsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + lesson_status: this.lesson_status, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIAttemptRecordsObject; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/cmi/aicc/student_data.ts + + + + + + + +var AICCCMIStudentData = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICCCMIStudentData, _super); + function AICCCMIStudentData() { + var _this = _super.call(this, api_constants/* default */.A.aicc.student_data_children) || this; + _this._tries_during_lesson = ""; + _this.tries = new CMITries(); + _this.attempt_records = new CMIAttemptRecords(); + return _this; } - if (!timeString || !timeString.match(timeRegex)) { - return 0; + AICCCMIStudentData.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", { + get: function () { + return this._tries_during_lesson; + }, + set: function (tries_during_lesson) { + if (this.initialized) { + throw new exceptions/* AICCValidationError */.gv(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._tries_during_lesson = tries_during_lesson; + } + }, + enumerable: false, + configurable: true + }); + AICCCMIStudentData.prototype.toJSON = function () { + this.jsonString = true; + var result = { + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, + tries: this.tries, + attempt_records: this.attempt_records, + }; + delete this.jsonString; + return result; + }; + return AICCCMIStudentData; +}(student_data/* CMIStudentData */.X)); + + +;// ./src/cmi/aicc/paths.ts + + + + + + +var CMIPaths = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIPaths, _super); + function CMIPaths() { + return _super.call(this, { + children: api_constants/* default */.A.aicc.paths_children, + }) || this; } - var parts = timeString.split(":"); - var hours = Number(parts[0]); - var minutes = Number(parts[1]); - var seconds = Number(parts[2]); - return hours * 3600 + minutes * 60 + seconds; -} -function getDurationAsSeconds(duration, durationRegex) { - if (typeof durationRegex === "string") { - durationRegex = new RegExp(durationRegex); - } - if (!duration || !duration.match(durationRegex)) { - return 0; - } - var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; - var result = 0.0; - result += Number(seconds) || 0.0; - result += Number(minutes) * 60.0 || 0.0; - result += Number(hours) * 3600.0 || 0.0; - result += Number(days) * (60 * 60 * 24.0) || 0.0; - result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; - return result; -} -function addTwoDurations(first, second, durationRegex) { - var regex = typeof durationRegex === "string" - ? new RegExp(durationRegex) - : durationRegex; - return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); -} -function addHHMMSSTimeStrings(first, second, timeRegex) { - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); + return CMIPaths; +}(array/* CMIArray */.B)); + +var CMIPathsObject = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMIPathsObject, _super); + function CMIPathsObject() { + var _this = _super.call(this) || this; + _this._location_id = ""; + _this._date = ""; + _this._time = ""; + _this._status = ""; + _this._why_left = ""; + _this._time_in_element = ""; + return _this; } - return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); -} -function flatten(data) { - var result = {}; - function recurse(cur, prop) { - if (Object(cur) !== cur) { - result[prop] = cur; - } - else if (Array.isArray(cur)) { - for (var i = 0, l = cur.length; i < l; i++) { - recurse(cur[i], prop + "[" + i + "]"); - if (l === 0) - result[prop] = []; + Object.defineProperty(CMIPathsObject.prototype, "location_id", { + get: function () { + return this._location_id; + }, + set: function (location_id) { + if (checkAICCValidFormat(location_id, regex/* default */.A.aicc.CMIString256)) { + this._location_id = location_id; } - } - else { - var isEmpty = true; - for (var p in cur) { - if ({}.hasOwnProperty.call(cur, p)) { - isEmpty = false; - recurse(cur[p], prop ? prop + "." + p : p); - } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "date", { + get: function () { + return this._date; + }, + set: function (date) { + if (checkAICCValidFormat(date, regex/* default */.A.aicc.CMIString256)) { + this._date = date; } - if (isEmpty && prop) - result[prop] = {}; - } - } - recurse(data, ""); - return result; -} -function unflatten(data) { - "use strict"; - if (Object(data) !== data || Array.isArray(data)) - return data; - var regex = /\.?([^.[\]]+)|\[(\d+)]/g; - var result = {}; - for (var p in data) { - if ({}.hasOwnProperty.call(data, p)) { - var cur = result; - var prop = ""; - var m = regex.exec(p); - while (m) { - cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); - prop = m[2] || m[1]; - m = regex.exec(p); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "time", { + get: function () { + return this._time; + }, + set: function (time) { + if (checkAICCValidFormat(time, regex/* default */.A.aicc.CMITime)) { + this._time = time; } - cur[prop] = data[p]; - } - } - return result[""] || result; -} -function countDecimals(num) { - if (Math.floor(num) === num || String(num).indexOf(".") < 0) - return 0; - var parts = num.toString().split(".")[1]; - return parts.length || 0; -} -function formatMessage(functionName, message, CMIElement) { - var baseLength = 20; - var messageString = ""; - messageString += functionName; - var fillChars = baseLength - messageString.length; - for (var i = 0; i < fillChars; i++) { - messageString += " "; - } - messageString += ": "; - if (CMIElement) { - var CMIElementBaseLength = 70; - messageString += CMIElement; - fillChars = CMIElementBaseLength - messageString.length; - for (var j = 0; j < fillChars; j++) { - messageString += " "; - } - } - if (message) { - messageString += message; - } - return messageString; -} -function stringMatches(str, tester) { - return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; -} - -;// ./src/utilities/debounce.ts -function debounce(func, wait, immediate) { - if (immediate === void 0) { immediate = false; } - var timeout; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var context = this; - var later = function () { - timeout = null; - if (!immediate) - func.apply(context, args); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if (checkAICCValidFormat(status, regex/* default */.A.aicc.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "why_left", { + get: function () { + return this._why_left; + }, + set: function (why_left) { + if (checkAICCValidFormat(why_left, regex/* default */.A.aicc.CMIString256)) { + this._why_left = why_left; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIPathsObject.prototype, "time_in_element", { + get: function () { + return this._time_in_element; + }, + set: function (time_in_element) { + if (checkAICCValidFormat(time_in_element, regex/* default */.A.aicc.CMITime)) { + this._time_in_element = time_in_element; + } + }, + enumerable: false, + configurable: true + }); + CMIPathsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + location_id: this.location_id, + date: this.date, + time: this.time, + status: this.status, + why_left: this.why_left, + time_in_element: this.time_in_element, }; - var callNow = immediate && !timeout; - if (timeout) - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) - func.apply(context, args); + delete this.jsonString; + return result; }; -} + return CMIPathsObject; +}(base_cmi/* BaseCMI */.J)); -;// ./src/constants/default_settings.ts +;// ./src/cmi/aicc/cmi.ts -var DefaultSettings = { - autocommit: false, - autocommitSeconds: 10, - asyncCommit: false, - sendFullCommit: true, - lmsCommitUrl: false, - dataCommitFormat: "json", - commitRequestDataType: "application/json;charset=UTF-8", - autoProgress: false, - logLevel: api_constants.global.LOG_LEVEL_ERROR, - selfReportSessionTime: false, - alwaysSendTotalTime: false, - renderCommonCommitFields: false, - strict_errors: true, - xhrHeaders: {}, - xhrWithCredentials: false, - responseHandler: function (response) { - return __awaiter(this, void 0, void 0, function () { - var httpResult, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof response !== "undefined")) return [3, 2]; - _b = (_a = JSON).parse; - return [4, response.text()]; - case 1: - httpResult = _b.apply(_a, [_c.sent()]); - if (httpResult === null || - !{}.hasOwnProperty.call(httpResult, "result")) { - if (response.status === 200) { - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - else { - return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; - } + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(initialized) { + if (initialized === void 0) { initialized = false; } + var _this = _super.call(this, api_constants/* default */.A.aicc.cmi_children) || this; + if (initialized) + _this.initialize(); + _this.student_preference = new AICCStudentPreferences(); + _this.student_data = new AICCCMIStudentData(); + _this.student_demographics = new CMIStudentDemographics(); + _this.evaluation = new CMIEvaluation(); + _this.paths = new CMIPaths(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; + _super.prototype.initialize.call(this); + (_a = this.student_preference) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.student_data) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_demographics) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.evaluation) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.paths) === null || _e === void 0 ? void 0 : _e.initialize(); + }; + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + student_demographics: this.student_demographics, + interactions: this.interactions, + evaluation: this.evaluation, + paths: this.paths, + }; + delete this.jsonString; + return result; + }; + return CMI; +}(cmi/* CMI */.Y)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/nav.ts +var nav = __webpack_require__(331); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/AICC.ts + + + + + + + + + +var AICC = (function (_super) { + (0,tslib_es6/* __extends */.C6)(AICC, _super); + function AICC(settings) { + var _this = _super.call(this, settings) || this; + _this.cmi = new CMI(); + _this.nav = new nav/* NAV */.A(); + return _this; + } + AICC.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { + var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex); + if (!newChild) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) { + newChild = new CMIEvaluationCommentsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) { + newChild = new CMITriesObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) { + newChild = new CMIAttemptRecordsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.paths\\.\\d+")) { + newChild = new CMIPathsObject(); + } + } + return newChild; + }; + AICC.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + this.nav = newAPI.nav; + }; + return AICC; +}(Scorm12API["default"])); +/* harmony default export */ var src_AICC = (AICC); + + +/***/ }), + +/***/ 900: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + A: function() { return /* binding */ src_BaseAPI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/utilities/debounce.ts +function debounce(func, wait, immediate) { + if (immediate === void 0) { immediate = false; } + var timeout; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = this; + var later = function () { + timeout = null; + if (!immediate) + func.apply(context, args); + }; + var callNow = immediate && !timeout; + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) + func.apply(context, args); + }; +} + +;// ./src/constants/default_settings.ts + + +var DefaultSettings = { + autocommit: false, + autocommitSeconds: 10, + asyncCommit: false, + sendFullCommit: true, + lmsCommitUrl: false, + dataCommitFormat: "json", + commitRequestDataType: "application/json;charset=UTF-8", + autoProgress: false, + logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR, + selfReportSessionTime: false, + alwaysSendTotalTime: false, + renderCommonCommitFields: false, + strict_errors: true, + xhrHeaders: {}, + xhrWithCredentials: false, + responseHandler: function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var httpResult, _a, _b; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof response !== "undefined")) return [3, 2]; + _b = (_a = JSON).parse; + return [4, response.text()]; + case 1: + httpResult = _b.apply(_a, [_c.sent()]); + if (httpResult === null || + !{}.hasOwnProperty.call(httpResult, "result")) { + if (response.status === 200) { + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + else { + return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } } else { return [2, { result: httpResult.result, errorCode: httpResult.errorCode ? httpResult.errorCode - : httpResult.result === api_constants.global.SCORM_TRUE + : httpResult.result === api_constants/* default */.A.global.SCORM_TRUE ? 0 : 101, }]; } _c.label = 2; case 2: return [2, { - result: api_constants.global.SCORM_FALSE, + result: api_constants/* default */.A.global.SCORM_FALSE, errorCode: 101, }]; } @@ -1109,16 +1057,16 @@ var DefaultSettings = { }, onLogMessage: function (messageLevel, logMessage) { switch (messageLevel) { - case api_constants.global.LOG_LEVEL_ERROR: + case api_constants/* default */.A.global.LOG_LEVEL_ERROR: console.error(logMessage); break; - case api_constants.global.LOG_LEVEL_WARNING: + case api_constants/* default */.A.global.LOG_LEVEL_WARNING: console.warn(logMessage); break; - case api_constants.global.LOG_LEVEL_INFO: + case api_constants/* default */.A.global.LOG_LEVEL_INFO: console.info(logMessage); break; - case api_constants.global.LOG_LEVEL_DEBUG: + case api_constants/* default */.A.global.LOG_LEVEL_DEBUG: if (console.debug) { console.debug(logMessage); } @@ -1150,7 +1098,7 @@ var ScheduledCommit = (function () { ScheduledCommit.prototype.wrapper = function () { var _this = this; if (!this._cancelled) { - (function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this._API.commit(this._callback)]; case 1: return [2, _a.sent()]; @@ -1179,7 +1127,7 @@ var BaseAPI = (function () { if (_newTarget === BaseAPI) { throw new TypeError("Cannot construct BaseAPI instances directly"); } - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; this.lastErrorCode = "0"; this.listenerArray = []; this._error_codes = error_codes; @@ -1190,13 +1138,13 @@ var BaseAPI = (function () { this.selfReportSessionTime = this.settings.selfReportSessionTime; } BaseAPI.prototype.commonReset = function (settings) { - this.settings = __assign(__assign({}, this.settings), settings); - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; + this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings); + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; this.lastErrorCode = "0"; this.listenerArray = []; }; BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { - var returnValue = api_constants.global.SCORM_FALSE; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; if (this.isInitialized()) { this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); } @@ -1207,17 +1155,17 @@ var BaseAPI = (function () { if (this.selfReportSessionTime) { this.cmi.setStartTime(); } - this.currentState = api_constants.global.STATE_INITIALIZED; + this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED; this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; this.processListeners(callbackName); } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); this.clearSCORMError(returnValue); return returnValue; }; BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { - logMessage = formatMessage(functionName, logMessage, CMIElement); + logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement); if (messageLevel >= this.apiLogLevel) { this.settings.onLogMessage(messageLevel, logMessage); } @@ -1234,20 +1182,20 @@ var BaseAPI = (function () { return this._settings; }, set: function (settings) { - this._settings = __assign(__assign({}, this._settings), settings); + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); }, enumerable: false, configurable: true }); BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { - return __awaiter(this, void 0, void 0, function () { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { var returnValue, result; - return __generator(this, function (_a) { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: - returnValue = api_constants.global.SCORM_FALSE; + returnValue = api_constants/* default */.A.global.SCORM_FALSE; if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; - this.currentState = api_constants.global.STATE_TERMINATED; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; return [4, this.storeData(true)]; case 1: result = _a.sent(); @@ -1257,14 +1205,14 @@ var BaseAPI = (function () { returnValue = typeof result !== "undefined" && result.result ? result.result - : api_constants.global.SCORM_FALSE; + : api_constants/* default */.A.global.SCORM_FALSE; if (checkTerminated) this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; this.processListeners(callbackName); _a.label = 2; case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); this.clearSCORMError(returnValue); return [2, returnValue]; } @@ -1284,7 +1232,7 @@ var BaseAPI = (function () { } this.processListeners(callbackName, CMIElement); } - this.apiLog(callbackName, ": returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); if (returnValue === undefined) { return ""; } @@ -1295,7 +1243,7 @@ var BaseAPI = (function () { if (value !== undefined) { value = String(value); } - var returnValue = api_constants.global.SCORM_FALSE; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { if (checkTerminated) this.lastErrorCode = "0"; @@ -1308,26 +1256,26 @@ var BaseAPI = (function () { this.processListeners(callbackName, CMIElement, value); } if (returnValue === undefined) { - returnValue = api_constants.global.SCORM_FALSE; + returnValue = api_constants/* default */.A.global.SCORM_FALSE; } if (String(this.lastErrorCode) === "0") { if (this.settings.autocommit && !this._timeout) { this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); } } - this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); this.clearSCORMError(returnValue); return returnValue; }; BaseAPI.prototype.commit = function (callbackName_1) { - return __awaiter(this, arguments, void 0, function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { var returnValue, result; if (checkTerminated === void 0) { checkTerminated = false; } - return __generator(this, function (_a) { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: this.clearScheduledCommit(); - returnValue = api_constants.global.SCORM_FALSE; + returnValue = api_constants/* default */.A.global.SCORM_FALSE; if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; return [4, this.storeData(false)]; case 1: @@ -1338,14 +1286,14 @@ var BaseAPI = (function () { returnValue = typeof result !== "undefined" && result.result ? result.result - : api_constants.global.SCORM_FALSE; - this.apiLog(callbackName, " Result: " + returnValue, api_constants.global.LOG_LEVEL_DEBUG, "HttpRequest"); + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); if (checkTerminated) this.lastErrorCode = "0"; this.processListeners(callbackName); _a.label = 2; case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); this.clearSCORMError(returnValue); return [2, returnValue]; } @@ -1355,7 +1303,7 @@ var BaseAPI = (function () { BaseAPI.prototype.getLastError = function (callbackName) { var returnValue = String(this.lastErrorCode); this.processListeners(callbackName); - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); return returnValue; }; BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { @@ -1364,7 +1312,7 @@ var BaseAPI = (function () { returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); this.processListeners(callbackName); } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); return returnValue; }; BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { @@ -1373,7 +1321,7 @@ var BaseAPI = (function () { returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); this.processListeners(callbackName); } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); return returnValue; }; BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { @@ -1399,11 +1347,11 @@ var BaseAPI = (function () { }; BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { if (!CMIElement || CMIElement === "") { - return api_constants.global.SCORM_FALSE; + return api_constants/* default */.A.global.SCORM_FALSE; } var structure = CMIElement.split("."); var refObject = this; - var returnValue = api_constants.global.SCORM_FALSE; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; var foundFirstIndex = false; var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); var invalidErrorCode = scorm2004 @@ -1417,20 +1365,20 @@ var BaseAPI = (function () { this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); } else { - refObject = __assign(__assign({}, refObject), { attribute: value }); + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); } } else if (!this._checkObjectHasProperty(refObject, attribute)) { this.throwSCORMError(invalidErrorCode, invalidErrorMessage); } else { - if (stringMatches(CMIElement, "\\.correct_responses\\.\\d+") && + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && this.isInitialized()) { this.validateCorrectResponse(CMIElement, value); } if (!scorm2004 || this.lastErrorCode === "0") { refObject[attribute] = value; - returnValue = api_constants.global.SCORM_TRUE; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; } } } @@ -1440,7 +1388,7 @@ var BaseAPI = (function () { this.throwSCORMError(invalidErrorCode, invalidErrorMessage); break; } - if (refObject instanceof CMIArray) { + if (refObject instanceof array/* CMIArray */.B) { var index = parseInt(structure[idx + 1], 10); if (!isNaN(index)) { var item = refObject.childArray[index]; @@ -1466,8 +1414,8 @@ var BaseAPI = (function () { } } } - if (returnValue === api_constants.global.SCORM_FALSE) { - this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants.global.LOG_LEVEL_WARNING); + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); } return returnValue; }; @@ -1509,7 +1457,7 @@ var BaseAPI = (function () { this.throwSCORMError(invalidErrorCode, invalidErrorMessage); break; } - if (refObject instanceof CMIArray) { + if (refObject instanceof array/* CMIArray */.B) { var index = parseInt(structure[idx + 1], 10); if (!isNaN(index)) { var item = refObject.childArray[index]; @@ -1527,10 +1475,10 @@ var BaseAPI = (function () { if (refObject === null || refObject === undefined) { if (!scorm2004) { if (attribute === "_children") { - this.throwSCORMError(error_codes.scorm12.CHILDREN_ERROR); + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); } else if (attribute === "_count") { - this.throwSCORMError(error_codes.scorm12.COUNT_ERROR); + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); } } } @@ -1539,13 +1487,13 @@ var BaseAPI = (function () { } }; BaseAPI.prototype.isInitialized = function () { - return this.currentState === api_constants.global.STATE_INITIALIZED; + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; }; BaseAPI.prototype.isNotInitialized = function () { - return this.currentState === api_constants.global.STATE_NOT_INITIALIZED; + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; }; BaseAPI.prototype.isTerminated = function () { - return this.currentState === api_constants.global.STATE_TERMINATED; + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; }; BaseAPI.prototype.on = function (listenerName, callback) { if (!callback) @@ -1565,7 +1513,7 @@ var BaseAPI = (function () { CMIElement: CMIElement, callback: callback, }); - this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); } }; BaseAPI.prototype.off = function (listenerName, callback) { @@ -1588,7 +1536,7 @@ var BaseAPI = (function () { }); if (removeIndex !== -1) { this_1.listenerArray.splice(removeIndex, 1); - this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); } }; var this_1 = this; @@ -1621,7 +1569,7 @@ var BaseAPI = (function () { } }; BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { - this.apiLog(functionName, value, api_constants.global.LOG_LEVEL_INFO, CMIElement); + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); for (var i = 0; i < this.listenerArray.length; i++) { var listener = this.listenerArray[i]; var functionsMatch = listener.functionName === functionName; @@ -1637,7 +1585,7 @@ var BaseAPI = (function () { CMIElementsMatch = listener.CMIElement === CMIElement; } if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { - this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants.global.LOG_LEVEL_INFO, CMIElement); + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); listener.callback(CMIElement, value); } } @@ -1646,11 +1594,11 @@ var BaseAPI = (function () { if (!message) { message = this.getLmsErrorMessageDetails(errorNumber); } - this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants.global.LOG_LEVEL_ERROR); + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); this.lastErrorCode = String(errorNumber); }; BaseAPI.prototype.clearSCORMError = function (success) { - if (success !== undefined && success !== api_constants.global.SCORM_FALSE) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { this.lastErrorCode = "0"; } }; @@ -1716,7 +1664,7 @@ var BaseAPI = (function () { result.forEach(function (element) { obj = {}; obj[element[0]] = element[1]; - _this.loadFromJSON(unflatten(obj), CMIElement); + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); }); }; BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { @@ -1755,21 +1703,21 @@ var BaseAPI = (function () { return JSON.parse(this.renderCMIToJSONString()); }; BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { - return __awaiter(this, arguments, void 0, function (url, params, immediate) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { var api, genericError, process, debouncedProcess; var _this = this; if (immediate === void 0) { immediate = false; } - return __generator(this, function (_a) { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: api = this; genericError = { - result: api_constants.global.SCORM_FALSE, + result: api_constants/* default */.A.global.SCORM_FALSE, errorCode: this.error_codes.GENERAL, }; if (immediate) { - this.performFetch(url, params).then(function (response) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this.transformResponse(response)]; case 1: @@ -1779,13 +1727,13 @@ var BaseAPI = (function () { }); }); }); return [2, { - result: api_constants.global.SCORM_TRUE, + result: api_constants/* default */.A.global.SCORM_TRUE, errorCode: 0, }]; } - process = function (url, params, settings) { return __awaiter(_this, void 0, void 0, function () { + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { var response, e_1; - return __generator(this, function (_a) { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); @@ -1796,7 +1744,7 @@ var BaseAPI = (function () { return [2, this.transformResponse(response)]; case 2: e_1 = _a.sent(); - this.apiLog("processHttpRequest", e_1, api_constants.global.LOG_LEVEL_ERROR); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); api.processListeners("CommitError"); return [2, genericError]; case 3: return [2]; @@ -1807,7 +1755,7 @@ var BaseAPI = (function () { debouncedProcess = debounce(process, 500, immediate); debouncedProcess(url, params, this.settings); return [2, { - result: api_constants.global.SCORM_TRUE, + result: api_constants/* default */.A.global.SCORM_TRUE, errorCode: 0, }]; case 1: return [4, process(url, params, this.settings)]; @@ -1818,13 +1766,13 @@ var BaseAPI = (function () { }; BaseAPI.prototype.scheduleCommit = function (when, callback) { this._timeout = new ScheduledCommit(this, when, callback); - this.apiLog("scheduleCommit", "scheduled", api_constants.global.LOG_LEVEL_DEBUG, ""); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); }; BaseAPI.prototype.clearScheduledCommit = function () { if (this._timeout) { this._timeout.cancel(); this._timeout = undefined; - this.apiLog("clearScheduledCommit", "cleared", api_constants.global.LOG_LEVEL_DEBUG, ""); + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); } }; BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { @@ -1833,9 +1781,9 @@ var BaseAPI = (function () { attribute in refObject); }; BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { - if (e instanceof ValidationError) { + if (e instanceof exceptions/* ValidationError */.yI) { this.lastErrorCode = String(e.errorCode); - returnValue = api_constants.global.SCORM_FALSE; + returnValue = api_constants/* default */.A.global.SCORM_FALSE; } else { if (e instanceof Error && e.message) { @@ -1849,12 +1797,12 @@ var BaseAPI = (function () { return returnValue; }; BaseAPI.prototype.performFetch = function (url, params) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { return [2, fetch(url, { method: "POST", body: params instanceof Array ? params.join("&") : JSON.stringify(params), - headers: __assign(__assign({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), credentials: this.settings.xhrWithCredentials ? "include" : undefined, keepalive: true, })]; @@ -1862,9 +1810,9 @@ var BaseAPI = (function () { }); }; BaseAPI.prototype.transformResponse = function (response) { - return __awaiter(this, void 0, void 0, function () { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { var result, _a; - return __generator(this, function (_c) { + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { switch (_c.label) { case 0: if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; @@ -1881,7 +1829,7 @@ var BaseAPI = (function () { if (response.status >= 200 && response.status <= 299 && (result.result === true || - result.result === api_constants.global.SCORM_TRUE)) { + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { this.processListeners("CommitSuccess"); } else { @@ -1896,120 +1844,27 @@ var BaseAPI = (function () { }()); /* harmony default export */ var src_BaseAPI = (BaseAPI); -;// ./src/constants/regex.ts -var regex_scorm12 = { - CMIString256: "^.{0,255}$", - CMIString4096: "^.{0,4096}$", - CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", - CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", - CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", - CMIFeedback: "^.{0,255}$", - CMIIndex: "[._](\\d+).", - CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", - CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", - CMIExit: "^(time-out|suspend|logout|)$", - CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", - CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", - NAVEvent: "^(previous|continue)$", - score_range: "0#100", - audio_range: "-1#100", - speed_range: "-100#100", - weighting_range: "-100#100", - text_range: "-1#1", -}; -var regex_aicc = __assign(__assign({}, regex_scorm12), { - CMIIdentifier: "^\\w{1,255}$", -}); -var regex_scorm2004 = { - CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", - CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", - CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", - CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", - CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", - CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", - CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", - CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", - CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", - CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", - CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", - CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", - CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", - CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", - CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", - CMIFeedback: "^.*$", - CMIIndex: "[._](\\d+).", - CMIIndexStore: ".N(\\d+).", - CMICStatus: "^(completed|incomplete|not attempted|unknown)$", - CMISStatus: "^(passed|failed|unknown)$", - CMIExit: "^(time-out|suspend|logout|normal)$", - CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", - CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", - NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", - NAVBoolean: "^(unknown|true|false$)", - NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", - scaled_range: "-1#1", - audio_range: "0#*", - speed_range: "0#*", - text_range: "-1#1", - progress_range: "0#1", -}; -var Regex = { - aicc: regex_aicc, - scorm12: regex_scorm12, - scorm2004: regex_scorm2004, -}; -/* harmony default export */ var regex = (Regex); +/***/ }), -;// ./src/cmi/common/validation.ts -function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { - if (typeof value !== "string") { - return false; - } - var formatRegex = new RegExp(regexPattern); - var matches = value.match(formatRegex); - if (allowEmptyString && value === "") { - return true; - } - if (value === undefined || !matches || matches[0] === "") { - throw new errorClass(errorCode); - } - return true; -} -function checkValidRange(value, rangePattern, errorCode, errorClass) { - var ranges = rangePattern.split("#"); - value = value * 1.0; - if (value >= ranges[0]) { - if (ranges[1] === "*" || value <= ranges[1]) { - return true; - } - else { - throw new errorClass(errorCode); - } - } - else { - throw new errorClass(errorCode); - } -} +/***/ 941: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -;// ./src/cmi/scorm2004/validation.ts +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635); +/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(900); +/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(989); +/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(864); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(176); +/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(833); +/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(331); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(417); +/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(56); -function check2004ValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, error_codes.scorm2004.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString); -} -function check2004ValidRange(value, rangePattern) { - return checkValidRange(value, rangePattern, error_codes.scorm2004.VALUE_OUT_OF_RANGE, Scorm2004ValidationError); -} -;// ./src/cmi/scorm2004/learner_preference.ts @@ -2017,110 +1872,436 @@ function check2004ValidRange(value, rangePattern) { -var CMILearnerPreference = (function (_super) { - __extends(CMILearnerPreference, _super); - function CMILearnerPreference() { - var _this = _super.call(this) || this; - _this.__children = api_constants.scorm2004.student_preference_children; - _this._audio_level = "1"; - _this._language = ""; - _this._delivery_speed = "1"; - _this._audio_captioning = "0"; + +var Scorm12API = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__extends */ .C6)(Scorm12API, _super); + function Scorm12API(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; + } + } + _this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12, settings) || this; + _this.statusSetByModule = false; + _this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__/* .CMI */ .Y(); + _this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__/* .NAV */ .A(); + _this.LMSInitialize = _this.lmsInitialize; + _this.LMSFinish = _this.lmsFinish; + _this.LMSGetValue = _this.lmsGetValue; + _this.LMSSetValue = _this.lmsSetValue; + _this.LMSCommit = _this.lmsCommit; + _this.LMSGetLastError = _this.lmsGetLastError; + _this.LMSGetErrorString = _this.lmsGetErrorString; + _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; return _this; } - Object.defineProperty(CMILearnerPreference.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "audio_level", { - get: function () { - return this._audio_level; - }, - set: function (audio_level) { - if (check2004ValidFormat(audio_level, regex.scorm2004.CMIDecimal) && - check2004ValidRange(audio_level, regex.scorm2004.audio_range)) { - this._audio_level = audio_level; + Scorm12API.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__/* .CMI */ .Y(); + this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__/* .NAV */ .A(); + }; + Scorm12API.prototype.lmsInitialize = function () { + this.cmi.initialize(); + if (this.cmi.core.lesson_status) { + this.statusSetByModule = true; + } + else { + this.cmi.core.lesson_status = "not attempted"; + } + return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); + }; + Scorm12API.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12API.prototype.internalFinish = function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var result; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("LMSFinish", true)]; + case 1: + result = _a.sent(); + if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE) { + if (this.nav.event !== "") { + if (this.nav.event === "continue") { + this.processListeners("SequenceNext"); + } + else { + this.processListeners("SequencePrevious"); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); + }; + Scorm12API.prototype.lmsGetValue = function (CMIElement) { + return this.getValue("LMSGetValue", false, CMIElement); + }; + Scorm12API.prototype.lmsSetValue = function (CMIElement, value) { + if (CMIElement === "cmi.core.lesson_status") { + this.statusSetByModule = true; + } + return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); + }; + Scorm12API.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("LMSCommit", false)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE; + }; + Scorm12API.prototype.lmsGetLastError = function () { + return this.getLastError("LMSGetLastError"); + }; + Scorm12API.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("LMSGetErrorString", CMIErrorCode); + }; + Scorm12API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); + }; + Scorm12API.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); + }; + Scorm12API.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("getCMIValue", false, CMIElement); + }; + Scorm12API.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { + if ((0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_5__/* .CMIObjectivesObject */ .N(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsCorrectResponsesObject */ .cb(); + } + else if (foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsObjectivesObject */ .Oh(); + } + else if (!foundFirstIndex && + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsObject */ .WP(); + } + return null; + }; + Scorm12API.prototype.validateCorrectResponse = function (_CMIElement, _value) { + }; + Scorm12API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = "No Error"; + var detailMessage = "No Error"; + errorNumber = String(errorNumber); + if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber]) { + basicMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].basicMessage; + detailMessage = + _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].detailMessage; + } + return detail ? detailMessage : basicMessage; + }; + Scorm12API.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + }; + Scorm12API.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); + } + var result = []; + var flattened = _utilities__WEBPACK_IMPORTED_MODULE_2__/* .flatten */ .Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return _utilities__WEBPACK_IMPORTED_MODULE_2__/* .flatten */ .Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); + } + } + return result; + case "json": + default: + return cmiExport; + } + }; + Scorm12API.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_2__/* .getTimeAsSeconds */ .f4(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.scorm12.CMITimespan); + var lessonStatus = this.cmi.core.lesson_status; + var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.unknown; + var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.unknown; + if (lessonStatus) { + completionStatus = + lessonStatus === "completed" || lessonStatus === "passed" + ? _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.completed + : _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.incomplete; + if (lessonStatus === "passed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.passed; } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "language", { - get: function () { - return this._language; - }, - set: function (language) { - if (check2004ValidFormat(language, regex.scorm2004.CMILang)) { - this._language = language; + else if (lessonStatus === "failed") { + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.failed; } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "delivery_speed", { - get: function () { - return this._delivery_speed; - }, - set: function (delivery_speed) { - if (check2004ValidFormat(delivery_speed, regex.scorm2004.CMIDecimal) && - check2004ValidRange(delivery_speed, regex.scorm2004.speed_range)) { - this._delivery_speed = delivery_speed; + } + var score = this.cmi.core.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMILearnerPreference.prototype, "audio_captioning", { - get: function () { - return this._audio_captioning; - }, - set: function (audio_captioning) { - if (check2004ValidFormat(audio_captioning, regex.scorm2004.CMISInteger) && - check2004ValidRange(audio_captioning, regex.scorm2004.text_range)) { - this._audio_captioning = audio_captioning; + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); } - }, - enumerable: false, - configurable: true - }); - CMILearnerPreference.prototype.toJSON = function () { - this.jsonString = true; - var result = { - audio_level: this.audio_level, - language: this.language, - delivery_speed: this.delivery_speed, - audio_captioning: this.audio_captioning, + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); + } + } + var commitObject = { + successStatus: successStatus, + completionStatus: completionStatus, + runtimeData: cmiExport, + totalTimeSeconds: totalTimeSeconds, }; - delete this.jsonString; - return result; + if (scoreObject) { + commitObject.score = scoreObject; + } + return commitObject; }; - return CMILearnerPreference; -}(BaseCMI)); - - -;// ./src/constants/response_constants.ts - -var scorm2004_regex = regex.scorm2004; -var LearnerResponses = { - "true-false": { - format: "^true$|^false$", - max: 1, - delimiter: "", - unique: false, - }, - choice: { - format: scorm2004_regex.CMILongIdentifier, - max: 36, - delimiter: "[,]", - unique: true, - }, - "fill-in": { + Scorm12API.prototype.storeData = function (terminateCommit) { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { + var originalStatus, shouldTerminateCommit, commitObject; + var _a, _b, _c; + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_d) { + switch (_d.label) { + case 0: + if (terminateCommit) { + originalStatus = this.cmi.core.lesson_status; + if (!this.cmi.core.lesson_status || + (!this.statusSetByModule && + this.cmi.core.lesson_status === "not attempted")) { + this.cmi.core.lesson_status = "completed"; + } + if (this.cmi.core.lesson_mode === "normal") { + if (this.cmi.core.credit === "credit") { + if (this.settings.mastery_override && + this.cmi.student_data.mastery_score !== "" && + this.cmi.core.score.raw !== "") { + this.cmi.core.lesson_status = + parseFloat(this.cmi.core.score.raw) >= + parseFloat(this.cmi.student_data.mastery_score) + ? "passed" + : "failed"; + } + } + } + else if (this.cmi.core.lesson_mode === "browse") { + if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && + originalStatus === "not attempted") { + this.cmi.core.lesson_status = "browsed"; + } + } + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: return [2, _d.sent()]; + case 2: return [2, { + result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + }); + }); + }; + return Scorm12API; +}(_BaseAPI__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)); +/* harmony default export */ __webpack_exports__["default"] = (Scorm12API); + + +/***/ }), + +/***/ 180: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* binding */ src_Scorm2004API; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/BaseAPI.ts + 3 modules +var BaseAPI = __webpack_require__(900); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); +;// ./src/cmi/scorm2004/validation.ts + + + +function check2004ValidFormat(value, regexPattern, allowEmptyString) { + return (0,validation/* checkValidFormat */.q)(value, regexPattern, error_codes/* default */.A.scorm2004.TYPE_MISMATCH, exceptions/* Scorm2004ValidationError */.wq, allowEmptyString); +} +function check2004ValidRange(value, rangePattern) { + return (0,validation/* checkValidRange */.W)(value, rangePattern, error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, exceptions/* Scorm2004ValidationError */.wq); +} + +;// ./src/cmi/scorm2004/learner_preference.ts + + + + + + + +var CMILearnerPreference = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMILearnerPreference, _super); + function CMILearnerPreference() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.scorm2004.student_preference_children; + _this._audio_level = "1"; + _this._language = ""; + _this._delivery_speed = "1"; + _this._audio_captioning = "0"; + return _this; + } + Object.defineProperty(CMILearnerPreference.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "audio_level", { + get: function () { + return this._audio_level; + }, + set: function (audio_level) { + if (check2004ValidFormat(audio_level, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(audio_level, regex/* default */.A.scorm2004.audio_range)) { + this._audio_level = audio_level; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "language", { + get: function () { + return this._language; + }, + set: function (language) { + if (check2004ValidFormat(language, regex/* default */.A.scorm2004.CMILang)) { + this._language = language; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "delivery_speed", { + get: function () { + return this._delivery_speed; + }, + set: function (delivery_speed) { + if (check2004ValidFormat(delivery_speed, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(delivery_speed, regex/* default */.A.scorm2004.speed_range)) { + this._delivery_speed = delivery_speed; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMILearnerPreference.prototype, "audio_captioning", { + get: function () { + return this._audio_captioning; + }, + set: function (audio_captioning) { + if (check2004ValidFormat(audio_captioning, regex/* default */.A.scorm2004.CMISInteger) && + check2004ValidRange(audio_captioning, regex/* default */.A.scorm2004.text_range)) { + this._audio_captioning = audio_captioning; + } + }, + enumerable: false, + configurable: true + }); + CMILearnerPreference.prototype.toJSON = function () { + this.jsonString = true; + var result = { + audio_level: this.audio_level, + language: this.language, + delivery_speed: this.delivery_speed, + audio_captioning: this.audio_captioning, + }; + delete this.jsonString; + return result; + }; + return CMILearnerPreference; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +;// ./src/constants/response_constants.ts + +var scorm2004_regex = regex/* default */.A.scorm2004; +var LearnerResponses = { + "true-false": { + format: "^true$|^false$", + max: 1, + delimiter: "", + unique: false, + }, + choice: { + format: scorm2004_regex.CMILongIdentifier, + max: 36, + delimiter: "[,]", + unique: true, + }, + "fill-in": { format: scorm2004_regex.CMILangString250, max: 10, delimiter: "[,]", @@ -2266,19 +2447,19 @@ var CorrectResponses = { var CMIInteractions = (function (_super) { - __extends(CMIInteractions, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractions, _super); function CMIInteractions() { return _super.call(this, { - children: api_constants.scorm2004.interactions_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.interactions_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMIInteractions; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMIInteractionsObject = (function (_super) { - __extends(CMIInteractionsObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObject, _super); function CMIInteractionsObject() { var _this = _super.call(this) || this; _this._id = ""; @@ -2289,15 +2470,15 @@ var CMIInteractionsObject = (function (_super) { _this._result = ""; _this._latency = ""; _this._description = ""; - _this.objectives = new CMIArray({ - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - children: api_constants.scorm2004.objectives_children, + _this.objectives = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.objectives_children, }); - _this.correct_responses = new CMIArray({ - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - children: api_constants.scorm2004.correct_responses_children, + _this.correct_responses = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.correct_responses_children, }); return _this; } @@ -2312,7 +2493,7 @@ var CMIInteractionsObject = (function (_super) { return this._id; }, set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { this._id = id; } }, @@ -2325,10 +2506,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (type) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(type, regex.scorm2004.CMIType)) { + if (check2004ValidFormat(type, regex/* default */.A.scorm2004.CMIType)) { this._type = type; } } @@ -2342,10 +2523,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (timestamp) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(timestamp, regex.scorm2004.CMITime)) { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { this._timestamp = timestamp; } } @@ -2359,10 +2540,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (weighting) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(weighting, regex.scorm2004.CMIDecimal)) { + if (check2004ValidFormat(weighting, regex/* default */.A.scorm2004.CMIDecimal)) { this._weighting = weighting; } } @@ -2376,7 +2557,7 @@ var CMIInteractionsObject = (function (_super) { }, set: function (learner_response) { if (this.initialized && (this._type === "" || this._id === "")) { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { var nodes = []; @@ -2395,28 +2576,28 @@ var CMIInteractionsObject = (function (_super) { var values = nodes[i].split(response_type.delimiter2); if (values.length === 2) { if (!values[0].match(formatRegex)) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } else { if (!response_type.format2 || !values[1].match(new RegExp(response_type.format2))) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } } else { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } else { if (!nodes[i].match(formatRegex)) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } else { if (nodes[i] !== "" && response_type.unique) { for (var j = 0; j < i; j++) { if (nodes[i] === nodes[j]) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } } @@ -2425,12 +2606,12 @@ var CMIInteractionsObject = (function (_super) { } } else { - throw new Scorm2004ValidationError(error_codes.scorm2004.GENERAL_SET_FAILURE); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); } this._learner_response = learner_response; } else { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } }, @@ -2442,7 +2623,7 @@ var CMIInteractionsObject = (function (_super) { return this._result; }, set: function (result) { - if (check2004ValidFormat(result, regex.scorm2004.CMIResult)) { + if (check2004ValidFormat(result, regex/* default */.A.scorm2004.CMIResult)) { this._result = result; } }, @@ -2455,10 +2636,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (latency) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(latency, regex.scorm2004.CMITimespan)) { + if (check2004ValidFormat(latency, regex/* default */.A.scorm2004.CMITimespan)) { this._latency = latency; } } @@ -2472,10 +2653,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (description) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(description, regex.scorm2004.CMILangString250, true)) { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { this._description = description; } } @@ -2501,10 +2682,10 @@ var CMIInteractionsObject = (function (_super) { return result; }; return CMIInteractionsObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); var CMIInteractionsObjectivesObject = (function (_super) { - __extends(CMIInteractionsObjectivesObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObjectivesObject, _super); function CMIInteractionsObjectivesObject() { var _this = _super.call(this) || this; _this._id = ""; @@ -2515,7 +2696,7 @@ var CMIInteractionsObjectivesObject = (function (_super) { return this._id; }, set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { this._id = id; } }, @@ -2531,10 +2712,10 @@ var CMIInteractionsObjectivesObject = (function (_super) { return result; }; return CMIInteractionsObjectivesObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); var CMIInteractionsCorrectResponsesObject = (function (_super) { - __extends(CMIInteractionsCorrectResponsesObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractionsCorrectResponsesObject, _super); function CMIInteractionsCorrectResponsesObject() { var _this = _super.call(this) || this; _this._pattern = ""; @@ -2545,7 +2726,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) { return this._pattern; }, set: function (pattern) { - if (check2004ValidFormat(pattern, regex.scorm2004.CMIFeedback)) { + if (check2004ValidFormat(pattern, regex/* default */.A.scorm2004.CMIFeedback)) { this._pattern = pattern; } }, @@ -2561,106 +2742,11 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) { return result; }; return CMIInteractionsCorrectResponsesObject; -}(BaseCMI)); - - -;// ./src/cmi/common/score.ts - - - - - - -var scorm12_constants = api_constants.scorm12; -var scorm12_regex = regex.scorm12; -var score_scorm12_error_codes = error_codes.scorm12; -var CMIScore = (function (_super) { - __extends(CMIScore, _super); - function CMIScore(params) { - var _this = _super.call(this) || this; - _this._raw = ""; - _this._min = ""; - _this.__children = params.score_children || scorm12_constants.score_children; - _this.__score_range = !params.score_range - ? false - : scorm12_regex.score_range; - _this._max = params.max || params.max === "" ? params.max : "100"; - _this.__invalid_error_code = - params.invalidErrorCode || score_scorm12_error_codes.INVALID_SET_VALUE; - _this.__invalid_type_code = - params.invalidTypeCode || score_scorm12_error_codes.TYPE_MISMATCH; - _this.__invalid_range_code = - params.invalidRangeCode || score_scorm12_error_codes.VALUE_OUT_OF_RANGE; - _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; - _this.__error_class = params.errorClass; - return _this; - } - Object.defineProperty(CMIScore.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new this.__error_class(this.__invalid_error_code); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "raw", { - get: function () { - return this._raw; - }, - set: function (raw) { - if (checkValidFormat(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._raw = raw; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "min", { - get: function () { - return this._min; - }, - set: function (min) { - if (checkValidFormat(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._min = min; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "max", { - get: function () { - return this._max; - }, - set: function (max) { - if (checkValidFormat(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._max = max; - } - }, - enumerable: false, - configurable: true - }); - CMIScore.prototype.toJSON = function () { - this.jsonString = true; - var result = { - raw: this.raw, - min: this.min, - max: this.max, - }; - delete this.jsonString; - return result; - }; - return CMIScore; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); ;// ./src/cmi/scorm2004/score.ts @@ -2670,16 +2756,16 @@ var CMIScore = (function (_super) { var Scorm2004CMIScore = (function (_super) { - __extends(Scorm2004CMIScore, _super); + (0,tslib_es6/* __extends */.C6)(Scorm2004CMIScore, _super); function Scorm2004CMIScore() { var _this = _super.call(this, { - score_children: api_constants.scorm2004.score_children, + score_children: api_constants/* default */.A.scorm2004.score_children, max: "", - invalidErrorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - invalidTypeCode: error_codes.scorm2004.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm2004.VALUE_OUT_OF_RANGE, - decimalRegex: regex.scorm2004.CMIDecimal, - errorClass: Scorm2004ValidationError, + invalidErrorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + invalidTypeCode: error_codes/* default */.A.scorm2004.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, + decimalRegex: regex/* default */.A.scorm2004.CMIDecimal, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; _this._scaled = ""; return _this; @@ -2689,8 +2775,8 @@ var Scorm2004CMIScore = (function (_super) { return this._scaled; }, set: function (scaled) { - if (check2004ValidFormat(scaled, regex.scorm2004.CMIDecimal) && - check2004ValidRange(scaled, regex.scorm2004.scaled_range)) { + if (check2004ValidFormat(scaled, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(scaled, regex/* default */.A.scorm2004.scaled_range)) { this._scaled = scaled; } }, @@ -2709,7 +2795,7 @@ var Scorm2004CMIScore = (function (_super) { return result; }; return Scorm2004CMIScore; -}(CMIScore)); +}(score/* CMIScore */._)); ;// ./src/cmi/scorm2004/comments.ts @@ -2722,31 +2808,31 @@ var Scorm2004CMIScore = (function (_super) { var CMICommentsFromLMS = (function (_super) { - __extends(CMICommentsFromLMS, _super); + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLMS, _super); function CMICommentsFromLMS() { return _super.call(this, { - children: api_constants.scorm2004.comments_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMICommentsFromLMS; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMICommentsFromLearner = (function (_super) { - __extends(CMICommentsFromLearner, _super); + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLearner, _super); function CMICommentsFromLearner() { return _super.call(this, { - children: api_constants.scorm2004.comments_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMICommentsFromLearner; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMICommentsObject = (function (_super) { - __extends(CMICommentsObject, _super); + (0,tslib_es6/* __extends */.C6)(CMICommentsObject, _super); function CMICommentsObject(readOnlyAfterInit) { if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; } var _this = _super.call(this) || this; @@ -2765,10 +2851,10 @@ var CMICommentsObject = (function (_super) { }, set: function (comment) { if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { - if (check2004ValidFormat(comment, regex.scorm2004.CMILangString4000, true)) { + if (check2004ValidFormat(comment, regex/* default */.A.scorm2004.CMILangString4000, true)) { this._comment = comment; } } @@ -2782,10 +2868,10 @@ var CMICommentsObject = (function (_super) { }, set: function (location) { if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { - if (check2004ValidFormat(location, regex.scorm2004.CMIString250)) { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString250)) { this._location = location; } } @@ -2799,10 +2885,10 @@ var CMICommentsObject = (function (_super) { }, set: function (timestamp) { if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { - if (check2004ValidFormat(timestamp, regex.scorm2004.CMITime)) { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { this._timestamp = timestamp; } } @@ -2821,7 +2907,7 @@ var CMICommentsObject = (function (_super) { return result; }; return CMICommentsObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); ;// ./src/cmi/scorm2004/objectives.ts @@ -2835,19 +2921,19 @@ var CMICommentsObject = (function (_super) { var CMIObjectives = (function (_super) { - __extends(CMIObjectives, _super); + (0,tslib_es6/* __extends */.C6)(CMIObjectives, _super); function CMIObjectives() { return _super.call(this, { - children: api_constants.scorm2004.objectives_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.objectives_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMIObjectives; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMIObjectivesObject = (function (_super) { - __extends(CMIObjectivesObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIObjectivesObject, _super); function CMIObjectivesObject() { var _this = _super.call(this) || this; _this._id = ""; @@ -2868,7 +2954,7 @@ var CMIObjectivesObject = (function (_super) { return this._id; }, set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { this._id = id; } }, @@ -2881,10 +2967,10 @@ var CMIObjectivesObject = (function (_super) { }, set: function (success_status) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(success_status, regex.scorm2004.CMISStatus)) { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { this._success_status = success_status; } } @@ -2898,10 +2984,10 @@ var CMIObjectivesObject = (function (_super) { }, set: function (completion_status) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(completion_status, regex.scorm2004.CMICStatus)) { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { this._completion_status = completion_status; } } @@ -2915,11 +3001,11 @@ var CMIObjectivesObject = (function (_super) { }, set: function (progress_measure) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(progress_measure, regex.scorm2004.CMIDecimal) && - check2004ValidRange(progress_measure, regex.scorm2004.progress_range)) { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { this._progress_measure = progress_measure; } } @@ -2933,10 +3019,10 @@ var CMIObjectivesObject = (function (_super) { }, set: function (description) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(description, regex.scorm2004.CMILangString250, true)) { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { this._description = description; } } @@ -2958,7 +3044,7 @@ var CMIObjectivesObject = (function (_super) { return result; }; return CMIObjectivesObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); ;// ./src/cmi/scorm2004/cmi.ts @@ -2976,12 +3062,12 @@ var CMIObjectivesObject = (function (_super) { var CMI = (function (_super) { - __extends(CMI, _super); + (0,tslib_es6/* __extends */.C6)(CMI, _super); function CMI(initialized) { if (initialized === void 0) { initialized = false; } var _this = _super.call(this) || this; _this.__version = "1.0"; - _this.__children = api_constants.scorm2004.cmi_children; + _this.__children = api_constants/* default */.A.scorm2004.cmi_children; _this._completion_status = "unknown"; _this._completion_threshold = ""; _this._credit = "credit"; @@ -3025,7 +3111,7 @@ var CMI = (function (_super) { return this.__version; }, set: function (_version) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); }, enumerable: false, configurable: true @@ -3035,7 +3121,7 @@ var CMI = (function (_super) { return this.__children; }, set: function (_children) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); }, enumerable: false, configurable: true @@ -3045,7 +3131,7 @@ var CMI = (function (_super) { return this._completion_status; }, set: function (completion_status) { - if (check2004ValidFormat(completion_status, regex.scorm2004.CMICStatus)) { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { this._completion_status = completion_status; } }, @@ -3058,7 +3144,7 @@ var CMI = (function (_super) { }, set: function (completion_threshold) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._completion_threshold = completion_threshold; @@ -3073,7 +3159,7 @@ var CMI = (function (_super) { }, set: function (credit) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._credit = credit; @@ -3088,7 +3174,7 @@ var CMI = (function (_super) { }, set: function (entry) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._entry = entry; @@ -3100,12 +3186,12 @@ var CMI = (function (_super) { Object.defineProperty(CMI.prototype, "exit", { get: function () { if (!this.jsonString) { - throw new Scorm2004ValidationError(error_codes.scorm2004.WRITE_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); } return this._exit; }, set: function (exit) { - if (check2004ValidFormat(exit, regex.scorm2004.CMIExit, true)) { + if (check2004ValidFormat(exit, regex/* default */.A.scorm2004.CMIExit, true)) { this._exit = exit; } }, @@ -3118,7 +3204,7 @@ var CMI = (function (_super) { }, set: function (launch_data) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._launch_data = launch_data; @@ -3133,7 +3219,7 @@ var CMI = (function (_super) { }, set: function (learner_id) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._learner_id = learner_id; @@ -3148,7 +3234,7 @@ var CMI = (function (_super) { }, set: function (learner_name) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._learner_name = learner_name; @@ -3162,7 +3248,7 @@ var CMI = (function (_super) { return this._location; }, set: function (location) { - if (check2004ValidFormat(location, regex.scorm2004.CMIString1000)) { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString1000)) { this._location = location; } }, @@ -3175,7 +3261,7 @@ var CMI = (function (_super) { }, set: function (max_time_allowed) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._max_time_allowed = max_time_allowed; @@ -3190,7 +3276,7 @@ var CMI = (function (_super) { }, set: function (mode) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._mode = mode; @@ -3204,8 +3290,8 @@ var CMI = (function (_super) { return this._progress_measure; }, set: function (progress_measure) { - if (check2004ValidFormat(progress_measure, regex.scorm2004.CMIDecimal) && - check2004ValidRange(progress_measure, regex.scorm2004.progress_range)) { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { this._progress_measure = progress_measure; } }, @@ -3218,7 +3304,7 @@ var CMI = (function (_super) { }, set: function (scaled_passing_score) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._scaled_passing_score = scaled_passing_score; @@ -3230,12 +3316,12 @@ var CMI = (function (_super) { Object.defineProperty(CMI.prototype, "session_time", { get: function () { if (!this.jsonString) { - throw new Scorm2004ValidationError(error_codes.scorm2004.WRITE_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); } return this._session_time; }, set: function (session_time) { - if (check2004ValidFormat(session_time, regex.scorm2004.CMITimespan)) { + if (check2004ValidFormat(session_time, regex/* default */.A.scorm2004.CMITimespan)) { this._session_time = session_time; } }, @@ -3247,7 +3333,7 @@ var CMI = (function (_super) { return this._success_status; }, set: function (success_status) { - if (check2004ValidFormat(success_status, regex.scorm2004.CMISStatus)) { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { this._success_status = success_status; } }, @@ -3259,7 +3345,7 @@ var CMI = (function (_super) { return this._suspend_data; }, set: function (suspend_data) { - if (check2004ValidFormat(suspend_data, regex.scorm2004.CMIString64000, true)) { + if (check2004ValidFormat(suspend_data, regex/* default */.A.scorm2004.CMIString64000, true)) { this._suspend_data = suspend_data; } }, @@ -3272,7 +3358,7 @@ var CMI = (function (_super) { }, set: function (time_limit_action) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._time_limit_action = time_limit_action; @@ -3287,7 +3373,7 @@ var CMI = (function (_super) { }, set: function (total_time) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._total_time = total_time; @@ -3301,9 +3387,9 @@ var CMI = (function (_super) { var startTime = this.start_time; if (typeof startTime !== "undefined" && startTime !== null) { var seconds = new Date().getTime() - startTime; - sessionTime = getSecondsAsISODuration(seconds / 1000); + sessionTime = utilities/* getSecondsAsISODuration */.xE(seconds / 1000); } - return addTwoDurations(this._total_time, sessionTime, regex.scorm2004.CMITimespan); + return utilities/* addTwoDurations */.$o(this._total_time, sessionTime, regex/* default */.A.scorm2004.CMITimespan); }; CMI.prototype.toJSON = function () { this.jsonString = true; @@ -3336,7 +3422,7 @@ var CMI = (function (_super) { return result; }; return CMI; -}(BaseRootCMI)); +}(base_cmi/* BaseRootCMI */.r)); ;// ./src/constants/language_constants.ts @@ -3506,957 +3592,238 @@ var ValidLanguages = [ "tk", "tl", "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yo", - "za", - "zh", - "zu", - "aar", - "abk", - "ave", - "afr", - "aka", - "amh", - "arg", - "ara", - "asm", - "ava", - "aym", - "aze", - "bak", - "bel", - "bul", - "bih", - "bis", - "bam", - "ben", - "tib", - "bod", - "bre", - "bos", - "cat", - "che", - "cha", - "cos", - "cre", - "cze", - "ces", - "chu", - "chv", - "wel", - "cym", - "dan", - "ger", - "deu", - "div", - "dzo", - "ewe", - "gre", - "ell", - "eng", - "epo", - "spa", - "est", - "baq", - "eus", - "per", - "fas", - "ful", - "fin", - "fij", - "fao", - "fre", - "fra", - "fry", - "gle", - "gla", - "glg", - "grn", - "guj", - "glv", - "hau", - "heb", - "hin", - "hmo", - "hrv", - "hat", - "hun", - "arm", - "hye", - "her", - "ina", - "ind", - "ile", - "ibo", - "iii", - "ipk", - "ido", - "ice", - "isl", - "ita", - "iku", - "jpn", - "jav", - "geo", - "kat", - "kon", - "kik", - "kua", - "kaz", - "kal", - "khm", - "kan", - "kor", - "kau", - "kas", - "kur", - "kom", - "cor", - "kir", - "lat", - "ltz", - "lug", - "lim", - "lin", - "lao", - "lit", - "lub", - "lav", - "mlg", - "mah", - "mao", - "mri", - "mac", - "mkd", - "mal", - "mon", - "mol", - "mar", - "may", - "msa", - "mlt", - "bur", - "mya", - "nau", - "nob", - "nde", - "nep", - "ndo", - "dut", - "nld", - "nno", - "nor", - "nbl", - "nav", - "nya", - "oci", - "oji", - "orm", - "ori", - "oss", - "pan", - "pli", - "pol", - "pus", - "por", - "que", - "roh", - "run", - "rum", - "ron", - "rus", - "kin", - "san", - "srd", - "snd", - "sme", - "sag", - "slo", - "sin", - "slk", - "slv", - "smo", - "sna", - "som", - "alb", - "sqi", - "srp", - "ssw", - "sot", - "sun", - "swe", - "swa", - "tam", - "tel", - "tgk", - "tha", - "tir", - "tuk", - "tgl", - "tsn", - "ton", - "tur", - "tso", - "tat", - "twi", - "tah", - "uig", - "ukr", - "urd", - "uzb", - "ven", - "vie", - "vol", - "wln", - "wol", - "xho", - "yid", - "yor", - "zha", - "chi", - "zho", - "zul", -]; -/* harmony default export */ var language_constants = (ValidLanguages); - -;// ./src/constants/enums.ts -var NAVBoolean; -(function (NAVBoolean) { - NAVBoolean["unknown"] = "unknown"; - NAVBoolean["true"] = "true"; - NAVBoolean["false"] = "false"; -})(NAVBoolean || (NAVBoolean = {})); -var SuccessStatus; -(function (SuccessStatus) { - SuccessStatus["passed"] = "passed"; - SuccessStatus["failed"] = "failed"; - SuccessStatus["unknown"] = "unknown"; -})(SuccessStatus || (SuccessStatus = {})); -var CompletionStatus; -(function (CompletionStatus) { - CompletionStatus["completed"] = "completed"; - CompletionStatus["incomplete"] = "incomplete"; - CompletionStatus["unknown"] = "unknown"; -})(CompletionStatus || (CompletionStatus = {})); - -;// ./src/cmi/scorm2004/adl.ts - - - - - - - -var ADL = (function (_super) { - __extends(ADL, _super); - function ADL() { - var _this = _super.call(this) || this; - _this.nav = new ADLNav(); - return _this; - } - ADL.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - ADL.prototype.toJSON = function () { - this.jsonString = true; - var result = { - nav: this.nav, - }; - delete this.jsonString; - return result; - }; - return ADL; -}(BaseCMI)); - -var ADLNav = (function (_super) { - __extends(ADLNav, _super); - function ADLNav() { - var _this = _super.call(this) || this; - _this._request = "_none_"; - _this.request_valid = new ADLNavRequestValid(); - return _this; - } - ADLNav.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(ADLNav.prototype, "request", { - get: function () { - return this._request; - }, - set: function (request) { - if (check2004ValidFormat(request, regex.scorm2004.NAVEvent)) { - this._request = request; - } - }, - enumerable: false, - configurable: true - }); - ADLNav.prototype.toJSON = function () { - this.jsonString = true; - var result = { - request: this.request, - }; - delete this.jsonString; - return result; - }; - return ADLNav; -}(BaseCMI)); - -var ADLNavRequestValid = (function (_super) { - __extends(ADLNavRequestValid, _super); - function ADLNavRequestValid() { - var _this = _super.call(this) || this; - _this._continue = "unknown"; - _this._previous = "unknown"; - _this._choice = {}; - _this._jump = {}; - return _this; - } - Object.defineProperty(ADLNavRequestValid.prototype, "continue", { - get: function () { - return this._continue; - }, - set: function (_continue) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (check2004ValidFormat(_continue, regex.scorm2004.NAVBoolean)) { - this._continue = _continue; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ADLNavRequestValid.prototype, "previous", { - get: function () { - return this._previous; - }, - set: function (_previous) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (check2004ValidFormat(_previous, regex.scorm2004.NAVBoolean)) { - this._previous = _previous; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ADLNavRequestValid.prototype, "choice", { - get: function () { - return this._choice; - }, - set: function (choice) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (typeof choice !== "object") { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - for (var key in choice) { - if ({}.hasOwnProperty.call(choice, key)) { - if (check2004ValidFormat(choice[key], regex.scorm2004.NAVBoolean) && - check2004ValidFormat(key, regex.scorm2004.NAVTarget)) { - this._choice[key] = - NAVBoolean[choice[key]]; - } - } - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ADLNavRequestValid.prototype, "jump", { - get: function () { - return this._jump; - }, - set: function (jump) { - if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); - } - if (typeof jump !== "object") { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); - } - for (var key in jump) { - if ({}.hasOwnProperty.call(jump, key)) { - if (check2004ValidFormat(jump[key], regex.scorm2004.NAVBoolean) && - check2004ValidFormat(key, regex.scorm2004.NAVTarget)) { - this._jump[key] = NAVBoolean[jump[key]]; - } - } - } - }, - enumerable: false, - configurable: true - }); - ADLNavRequestValid.prototype.toJSON = function () { - this.jsonString = true; - var result = { - previous: this._previous, - continue: this._continue, - choice: this._choice, - jump: this._jump, - }; - delete this.jsonString; - return result; - }; - return ADLNavRequestValid; -}(BaseCMI)); - - -;// ./src/Scorm2004API.ts - - - - - - - - - - - - - - - - -var Scorm2004API = (function (_super) { - __extends(Scorm2004API, _super); - function Scorm2004API(settings) { - var _this = this; - if (settings) { - if (settings.mastery_override === undefined) { - settings.mastery_override = false; - } - } - _this = _super.call(this, error_codes.scorm2004, settings) || this; - _this._version = "1.0"; - _this.cmi = new CMI(); - _this.adl = new ADL(); - _this.Initialize = _this.lmsInitialize; - _this.Terminate = _this.lmsFinish; - _this.GetValue = _this.lmsGetValue; - _this.SetValue = _this.lmsSetValue; - _this.Commit = _this.lmsCommit; - _this.GetLastError = _this.lmsGetLastError; - _this.GetErrorString = _this.lmsGetErrorString; - _this.GetDiagnostic = _this.lmsGetDiagnostic; - return _this; - } - Scorm2004API.prototype.reset = function (settings) { - this.commonReset(settings); - this.cmi = new CMI(); - this.adl = new ADL(); - }; - Object.defineProperty(Scorm2004API.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: false, - configurable: true - }); - Scorm2004API.prototype.lmsInitialize = function () { - this.cmi.initialize(); - return this.initialize("Initialize"); - }; - Scorm2004API.prototype.lmsFinish = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.internalFinish()]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm2004API.prototype.internalFinish = function () { - return __awaiter(this, void 0, void 0, function () { - var result, navActions, request, choiceJumpRegex, matches, target, action; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.terminate("Terminate", true)]; - case 1: - result = _a.sent(); - if (result === api_constants.global.SCORM_TRUE) { - if (this.adl.nav.request !== "_none_") { - navActions = { - continue: "SequenceNext", - previous: "SequencePrevious", - choice: "SequenceChoice", - jump: "SequenceJump", - exit: "SequenceExit", - exitAll: "SequenceExitAll", - abandon: "SequenceAbandon", - abandonAll: "SequenceAbandonAll", - }; - request = this.adl.nav.request; - choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent); - matches = request.match(choiceJumpRegex); - target = ""; - if (matches && matches.length > 2) { - target = matches[2]; - request = matches[1].replace(target, ""); - } - action = navActions[request]; - if (action) { - this.processListeners(action, "adl.nav.request", target); - } - } - else if (this.settings.autoProgress) { - this.processListeners("SequenceNext"); - } - } - return [2, result]; - } - }); - }); - }; - Scorm2004API.prototype.lmsGetValue = function (CMIElement) { - var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$"; - if (stringMatches(CMIElement, adlNavRequestRegex)) { - var matches = CMIElement.match(adlNavRequestRegex); - var request = matches[1]; - var target = matches[2].replace("{target=", "").replace("}", ""); - if (request === "choice" || request === "jump") { - if (this.settings.scoItemIdValidator) { - return String(this.settings.scoItemIdValidator(target)); - } - return String(this.settings.scoItemIds.includes(target)); - } - } - return this.getValue("GetValue", true, CMIElement); - }; - Scorm2004API.prototype.lmsSetValue = function (CMIElement, value) { - return this.setValue("SetValue", "Commit", true, CMIElement, value); - }; - Scorm2004API.prototype.lmsCommit = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.commit("Commit")]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm2004API.prototype.lmsGetLastError = function () { - return this.getLastError("GetLastError"); - }; - Scorm2004API.prototype.lmsGetErrorString = function (CMIErrorCode) { - return this.getErrorString("GetErrorString", CMIErrorCode); - }; - Scorm2004API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { - return this.getDiagnostic("GetDiagnostic", CMIErrorCode); - }; - Scorm2004API.prototype.setCMIValue = function (CMIElement, value) { - return this._commonSetCMIValue("SetValue", true, CMIElement, value); - }; - Scorm2004API.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.objectives\\.\\d+")) { - return new CMIObjectivesObject(); - } - if (foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { - return this.createCorrectResponsesObject(CMIElement, value); - } - else if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { - return new CMIInteractionsObjectivesObject(); - } - } - else if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+")) { - return new CMIInteractionsObject(); - } - if (stringMatches(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) { - return new CMICommentsObject(); - } - else if (stringMatches(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) { - return new CMICommentsObject(true); - } - return null; - }; - Scorm2004API.prototype.createCorrectResponsesObject = function (CMIElement, value) { - var parts = CMIElement.split("."); - var index = Number(parts[2]); - var interaction = this.cmi.interactions.childArray[index]; - if (this.isInitialized()) { - if (!interaction.type) { - this.throwSCORMError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); - } - else { - this.checkDuplicateChoiceResponse(interaction, value); - var response_type = CorrectResponses[interaction.type]; - if (response_type) { - this.checkValidResponseType(response_type, value, interaction.type); - } - else { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type); - } - } - } - if (this.lastErrorCode === "0") { - return new CMIInteractionsCorrectResponsesObject(); - } - return null; - }; - Scorm2004API.prototype.checkValidResponseType = function (response_type, value, interaction_type) { - var nodes = []; - if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { - nodes = String(value).split(response_type.delimiter); - } - else { - nodes[0] = value; - } - if (nodes.length > 0 && nodes.length <= response_type.max) { - this.checkCorrectResponseValue(interaction_type, nodes, value); - } - else if (nodes.length > response_type.max) { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long"); - } - }; - Scorm2004API.prototype.checkDuplicateChoiceResponse = function (interaction, value) { - var interaction_count = interaction.correct_responses._count; - if (interaction.type === "choice") { - for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) { - var response = interaction.correct_responses.childArray[i]; - if (response.pattern === value) { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE); - } - } - } - }; - Scorm2004API.prototype.validateCorrectResponse = function (CMIElement, value) { - var parts = CMIElement.split("."); - var index = Number(parts[2]); - var pattern_index = Number(parts[4]); - var interaction = this.cmi.interactions.childArray[index]; - var interaction_count = interaction.correct_responses._count; - this.checkDuplicateChoiceResponse(interaction, value); - var response_type = CorrectResponses[interaction.type]; - if (typeof response_type.limit === "undefined" || - interaction_count <= response_type.limit) { - this.checkValidResponseType(response_type, value, interaction.type); - if ((this.lastErrorCode === "0" && - (!response_type.duplicate || - !this.checkDuplicatedPattern(interaction.correct_responses, pattern_index, value))) || - (this.lastErrorCode === "0" && value === "")) { - } - else { - if (this.lastErrorCode === "0") { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists"); - } - } - } - else { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached"); - } - }; - Scorm2004API.prototype.getCMIValue = function (CMIElement) { - return this._commonGetCMIValue("GetValue", true, CMIElement); - }; - Scorm2004API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { - var basicMessage = ""; - var detailMessage = ""; - errorNumber = String(errorNumber); - if (api_constants.scorm2004.error_descriptions[errorNumber]) { - basicMessage = - api_constants.scorm2004.error_descriptions[errorNumber].basicMessage; - detailMessage = - api_constants.scorm2004.error_descriptions[errorNumber].detailMessage; - } - return detail ? detailMessage : basicMessage; - }; - Scorm2004API.prototype.checkDuplicatedPattern = function (correct_response, current_index, value) { - var found = false; - var count = correct_response._count; - for (var i = 0; i < count && !found; i++) { - if (i !== current_index && correct_response.childArray[i] === value) { - found = true; - } - } - return found; - }; - Scorm2004API.prototype.checkCorrectResponseValue = function (interaction_type, nodes, value) { - var response = CorrectResponses[interaction_type]; - var formatRegex = new RegExp(response.format); - for (var i = 0; i < nodes.length && this.lastErrorCode === "0"; i++) { - if (interaction_type.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")) { - nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]); - } - if (response === null || response === void 0 ? void 0 : response.delimiter2) { - var values = nodes[i].split(response.delimiter2); - if (values.length === 2) { - var matches = values[0].match(formatRegex); - if (!matches) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - else { - if (!response.format2 || - !values[1].match(new RegExp(response.format2))) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - else { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - else { - var matches = nodes[i].match(formatRegex); - if ((!matches && value !== "") || - (!matches && interaction_type === "true-false")) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - else { - if (interaction_type === "numeric" && nodes.length > 1) { - if (Number(nodes[0]) > Number(nodes[1])) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - else { - if (nodes[i] !== "" && response.unique) { - for (var j = 0; j < i && this.lastErrorCode === "0"; j++) { - if (nodes[i] === nodes[j]) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - } - } - } - } - }; - Scorm2004API.prototype.removeCorrectResponsePrefixes = function (node) { - var seenOrder = false; - var seenCase = false; - var seenLang = false; - var prefixRegex = new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"); - var matches = node.match(prefixRegex); - var langMatches = null; - while (matches) { - switch (matches[2]) { - case "lang": - langMatches = node.match(regex.scorm2004.CMILangcr); - if (langMatches) { - var lang = langMatches[3]; - if (lang !== undefined && lang.length > 0) { - if (!language_constants.includes(lang.toLowerCase())) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - } - seenLang = true; - break; - case "case_matters": - if (!seenLang && !seenOrder && !seenCase) { - if (matches[3] !== "true" && matches[3] !== "false") { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - seenCase = true; - break; - case "order_matters": - if (!seenCase && !seenLang && !seenOrder) { - if (matches[3] !== "true" && matches[3] !== "false") { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); - } - } - seenOrder = true; - break; - } - node = node.substring(matches[1].length); - matches = node.match(prefixRegex); - } - return node; - }; - Scorm2004API.prototype.replaceWithAnotherScormAPI = function (newAPI) { - this.cmi = newAPI.cmi; - this.adl = newAPI.adl; - }; - Scorm2004API.prototype.renderCommitCMI = function (terminateCommit) { - var cmiExport = this.renderCMIToJSONObject(); - if (terminateCommit) { - cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime(); - } - var result = []; - var flattened = flatten(cmiExport); - switch (this.settings.dataCommitFormat) { - case "flattened": - return flatten(cmiExport); - case "params": - for (var item in flattened) { - if ({}.hasOwnProperty.call(flattened, item)) { - result.push("".concat(item, "=").concat(flattened[item])); - } - } - return result; - case "json": - default: - return cmiExport; - } - }; - Scorm2004API.prototype.renderCommitObject = function (terminateCommit) { - var cmiExport = this.renderCommitCMI(terminateCommit); - var totalTimeDuration = this.cmi.getCurrentTotalTime(); - var totalTimeSeconds = getDurationAsSeconds(totalTimeDuration, regex.scorm2004.CMITimespan); - var completionStatus = CompletionStatus.unknown; - var successStatus = SuccessStatus.unknown; - if (this.cmi.completion_status) { - if (this.cmi.completion_status === "completed") { - completionStatus = CompletionStatus.completed; - } - else if (this.cmi.completion_status === "incomplete") { - completionStatus = CompletionStatus.incomplete; - } - } - if (this.cmi.success_status) { - if (this.cmi.success_status === "passed") { - successStatus = SuccessStatus.passed; - } - else if (this.cmi.success_status === "failed") { - successStatus = SuccessStatus.failed; - } - } - var score = this.cmi.score; - var scoreObject = null; - if (score) { - scoreObject = {}; - if (!Number.isNaN(Number.parseFloat(score.raw))) { - scoreObject.raw = Number.parseFloat(score.raw); - } - if (!Number.isNaN(Number.parseFloat(score.min))) { - scoreObject.min = Number.parseFloat(score.min); - } - if (!Number.isNaN(Number.parseFloat(score.max))) { - scoreObject.max = Number.parseFloat(score.max); - } - if (!Number.isNaN(Number.parseFloat(score.scaled))) { - scoreObject.scaled = Number.parseFloat(score.scaled); - } - } - var commitObject = { - completionStatus: completionStatus, - successStatus: successStatus, - totalTimeSeconds: totalTimeSeconds, - runtimeData: cmiExport, - }; - if (scoreObject) { - commitObject.score = scoreObject; - } - return commitObject; - }; - Scorm2004API.prototype.storeData = function (terminateCommit) { - return __awaiter(this, void 0, void 0, function () { - var navRequest, shouldTerminateCommit, commitObject, result; - var _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - if (terminateCommit) { - if (this.cmi.mode === "normal") { - if (this.cmi.credit === "credit") { - if (this.cmi.completion_threshold && this.cmi.progress_measure) { - if (this.cmi.progress_measure >= this.cmi.completion_threshold) { - this.cmi.completion_status = "completed"; - } - else { - this.cmi.completion_status = "incomplete"; - } - } - if (this.cmi.scaled_passing_score && this.cmi.score.scaled) { - if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) { - this.cmi.success_status = "passed"; - } - else { - this.cmi.success_status = "failed"; - } - } - } - } - } - navRequest = false; - if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) && - this.adl.nav.request !== "_none_") { - this.adl.nav.request = encodeURIComponent(this.adl.nav.request); - navRequest = true; - } - shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; - commitObject = this.settings.renderCommonCommitFields - ? this.renderCommitObject(shouldTerminateCommit) - : this.renderCommitCMI(shouldTerminateCommit); - if (this.apiLogLevel === api_constants.global.LOG_LEVEL_DEBUG) { - console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); - console.debug(commitObject); - } - if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; - return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; - case 1: - result = _d.sent(); - { - if (navRequest && - result.navRequest !== undefined && - result.navRequest !== "") { - Function("\"use strict\";(() => { ".concat(result.navRequest, " })()"))(); - } - } - return [2, result]; - case 2: return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - }); - }); - }; - return Scorm2004API; -}(src_BaseAPI)); -/* harmony default export */ var src_Scorm2004API = (Scorm2004API); - -;// ./src/cmi/scorm12/validation.ts - - - -function check12ValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, error_codes.scorm12.TYPE_MISMATCH, Scorm12ValidationError, allowEmptyString); -} -function check12ValidRange(value, rangePattern, allowEmptyString) { - if (!allowEmptyString && value === "") { - throw new Scorm12ValidationError(error_codes.scorm12.VALUE_OUT_OF_RANGE); - } - return checkValidRange(value, rangePattern, error_codes.scorm12.VALUE_OUT_OF_RANGE, Scorm12ValidationError); -} - -;// ./src/cmi/aicc/core.ts - + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yo", + "za", + "zh", + "zu", + "aar", + "abk", + "ave", + "afr", + "aka", + "amh", + "arg", + "ara", + "asm", + "ava", + "aym", + "aze", + "bak", + "bel", + "bul", + "bih", + "bis", + "bam", + "ben", + "tib", + "bod", + "bre", + "bos", + "cat", + "che", + "cha", + "cos", + "cre", + "cze", + "ces", + "chu", + "chv", + "wel", + "cym", + "dan", + "ger", + "deu", + "div", + "dzo", + "ewe", + "gre", + "ell", + "eng", + "epo", + "spa", + "est", + "baq", + "eus", + "per", + "fas", + "ful", + "fin", + "fij", + "fao", + "fre", + "fra", + "fry", + "gle", + "gla", + "glg", + "grn", + "guj", + "glv", + "hau", + "heb", + "hin", + "hmo", + "hrv", + "hat", + "hun", + "arm", + "hye", + "her", + "ina", + "ind", + "ile", + "ibo", + "iii", + "ipk", + "ido", + "ice", + "isl", + "ita", + "iku", + "jpn", + "jav", + "geo", + "kat", + "kon", + "kik", + "kua", + "kaz", + "kal", + "khm", + "kan", + "kor", + "kau", + "kas", + "kur", + "kom", + "cor", + "kir", + "lat", + "ltz", + "lug", + "lim", + "lin", + "lao", + "lit", + "lub", + "lav", + "mlg", + "mah", + "mao", + "mri", + "mac", + "mkd", + "mal", + "mon", + "mol", + "mar", + "may", + "msa", + "mlt", + "bur", + "mya", + "nau", + "nob", + "nde", + "nep", + "ndo", + "dut", + "nld", + "nno", + "nor", + "nbl", + "nav", + "nya", + "oci", + "oji", + "orm", + "ori", + "oss", + "pan", + "pli", + "pol", + "pus", + "por", + "que", + "roh", + "run", + "rum", + "ron", + "rus", + "kin", + "san", + "srd", + "snd", + "sme", + "sag", + "slo", + "sin", + "slk", + "slv", + "smo", + "sna", + "som", + "alb", + "sqi", + "srp", + "ssw", + "sot", + "sun", + "swe", + "swa", + "tam", + "tel", + "tgk", + "tha", + "tir", + "tuk", + "tgl", + "tsn", + "ton", + "tur", + "tso", + "tat", + "twi", + "tah", + "uig", + "ukr", + "urd", + "uzb", + "ven", + "vie", + "vol", + "wln", + "wol", + "xho", + "yid", + "yor", + "zha", + "chi", + "zho", + "zul", +]; +/* harmony default export */ var language_constants = (ValidLanguages); +// EXTERNAL MODULE: ./src/constants/enums.ts +var enums = __webpack_require__(56); +;// ./src/cmi/scorm2004/adl.ts @@ -4464,739 +3831,1228 @@ function check12ValidRange(value, rangePattern, allowEmptyString) { -var CMICore = (function (_super) { - __extends(CMICore, _super); - function CMICore() { +var ADL = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADL, _super); + function ADL() { var _this = _super.call(this) || this; - _this.__children = api_constants.scorm12.core_children; - _this._student_id = ""; - _this._student_name = ""; - _this._lesson_location = ""; - _this._credit = ""; - _this._lesson_status = "not attempted"; - _this._entry = ""; - _this._total_time = ""; - _this._lesson_mode = "normal"; - _this._exit = ""; - _this._session_time = "00:00:00"; - _this._suspend_data = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, - }); + _this.nav = new ADLNav(); + return _this; + } + ADL.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.nav) === null || _a === void 0 ? void 0 : _a.initialize(); + }; + ADL.prototype.toJSON = function () { + this.jsonString = true; + var result = { + nav: this.nav, + }; + delete this.jsonString; + return result; + }; + return ADL; +}(base_cmi/* BaseCMI */.J)); + +var ADLNav = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADLNav, _super); + function ADLNav() { + var _this = _super.call(this) || this; + _this._request = "_none_"; + _this.request_valid = new ADLNavRequestValid(); return _this; } - CMICore.prototype.initialize = function () { + ADLNav.prototype.initialize = function () { var _a; _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); + (_a = this.request_valid) === null || _a === void 0 ? void 0 : _a.initialize(); }; - Object.defineProperty(CMICore.prototype, "_children", { + Object.defineProperty(ADLNav.prototype, "request", { get: function () { - return this.__children; + return this._request; }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); + set: function (request) { + if (check2004ValidFormat(request, regex/* default */.A.scorm2004.NAVEvent)) { + this._request = request; + } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "student_id", { + ADLNav.prototype.toJSON = function () { + this.jsonString = true; + var result = { + request: this.request, + }; + delete this.jsonString; + return result; + }; + return ADLNav; +}(base_cmi/* BaseCMI */.J)); + +var ADLNavRequestValid = (function (_super) { + (0,tslib_es6/* __extends */.C6)(ADLNavRequestValid, _super); + function ADLNavRequestValid() { + var _this = _super.call(this) || this; + _this._continue = "unknown"; + _this._previous = "unknown"; + _this._choice = {}; + _this._jump = {}; + return _this; + } + Object.defineProperty(ADLNavRequestValid.prototype, "continue", { get: function () { - return this._student_id; + return this._continue; }, - set: function (student_id) { + set: function (_continue) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } - else { - this._student_id = student_id; + if (check2004ValidFormat(_continue, regex/* default */.A.scorm2004.NAVBoolean)) { + this._continue = _continue; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "student_name", { + Object.defineProperty(ADLNavRequestValid.prototype, "previous", { get: function () { - return this._student_name; + return this._previous; }, - set: function (student_name) { + set: function (_previous) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } - else { - this._student_name = student_name; + if (check2004ValidFormat(_previous, regex/* default */.A.scorm2004.NAVBoolean)) { + this._previous = _previous; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "lesson_location", { + Object.defineProperty(ADLNavRequestValid.prototype, "choice", { get: function () { - return this._lesson_location; + return this._choice; }, - set: function (lesson_location) { - if (check12ValidFormat(lesson_location, regex.scorm12.CMIString256, true)) { - this._lesson_location = lesson_location; + set: function (choice) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (typeof choice !== "object") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + for (var key in choice) { + if ({}.hasOwnProperty.call(choice, key)) { + if (check2004ValidFormat(choice[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { + this._choice[key] = + enums/* NAVBoolean */.K$[choice[key]]; + } + } + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ADLNavRequestValid.prototype, "jump", { + get: function () { + return this._jump; + }, + set: function (jump) { + if (this.initialized) { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); + } + if (typeof jump !== "object") { + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + for (var key in jump) { + if ({}.hasOwnProperty.call(jump, key)) { + if (check2004ValidFormat(jump[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { + this._jump[key] = enums/* NAVBoolean */.K$[jump[key]]; + } + } + } + }, + enumerable: false, + configurable: true + }); + ADLNavRequestValid.prototype.toJSON = function () { + this.jsonString = true; + var result = { + previous: this._previous, + continue: this._continue, + choice: this._choice, + jump: this._jump, + }; + delete this.jsonString; + return result; + }; + return ADLNavRequestValid; +}(base_cmi/* BaseCMI */.J)); + + +;// ./src/Scorm2004API.ts + + + + + + + + + + + + + + + + +var Scorm2004API = (function (_super) { + (0,tslib_es6/* __extends */.C6)(Scorm2004API, _super); + function Scorm2004API(settings) { + var _this = this; + if (settings) { + if (settings.mastery_override === undefined) { + settings.mastery_override = false; + } + } + _this = _super.call(this, error_codes/* default */.A.scorm2004, settings) || this; + _this._version = "1.0"; + _this.cmi = new CMI(); + _this.adl = new ADL(); + _this.Initialize = _this.lmsInitialize; + _this.Terminate = _this.lmsFinish; + _this.GetValue = _this.lmsGetValue; + _this.SetValue = _this.lmsSetValue; + _this.Commit = _this.lmsCommit; + _this.GetLastError = _this.lmsGetLastError; + _this.GetErrorString = _this.lmsGetErrorString; + _this.GetDiagnostic = _this.lmsGetDiagnostic; + return _this; + } + Scorm2004API.prototype.reset = function (settings) { + this.commonReset(settings); + this.cmi = new CMI(); + this.adl = new ADL(); + }; + Object.defineProperty(Scorm2004API.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: false, + configurable: true + }); + Scorm2004API.prototype.lmsInitialize = function () { + this.cmi.initialize(); + return this.initialize("Initialize"); + }; + Scorm2004API.prototype.lmsFinish = function () { + var _this = this; + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.internalFinish()]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return api_constants/* default */.A.global.SCORM_TRUE; + }; + Scorm2004API.prototype.internalFinish = function () { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, navActions, request, choiceJumpRegex, matches, target, action; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.terminate("Terminate", true)]; + case 1: + result = _a.sent(); + if (result === api_constants/* default */.A.global.SCORM_TRUE) { + if (this.adl.nav.request !== "_none_") { + navActions = { + continue: "SequenceNext", + previous: "SequencePrevious", + choice: "SequenceChoice", + jump: "SequenceJump", + exit: "SequenceExit", + exitAll: "SequenceExitAll", + abandon: "SequenceAbandon", + abandonAll: "SequenceAbandonAll", + }; + request = this.adl.nav.request; + choiceJumpRegex = new RegExp(regex/* default */.A.scorm2004.NAVEvent); + matches = request.match(choiceJumpRegex); + target = ""; + if (matches && matches.length > 2) { + target = matches[2]; + request = matches[1].replace(target, ""); + } + action = navActions[request]; + if (action) { + this.processListeners(action, "adl.nav.request", target); + } + } + else if (this.settings.autoProgress) { + this.processListeners("SequenceNext"); + } + } + return [2, result]; + } + }); + }); + }; + Scorm2004API.prototype.lmsGetValue = function (CMIElement) { + var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$"; + if ((0,utilities/* stringMatches */.J6)(CMIElement, adlNavRequestRegex)) { + var matches = CMIElement.match(adlNavRequestRegex); + var request = matches[1]; + var target = matches[2].replace("{target=", "").replace("}", ""); + if (request === "choice" || request === "jump") { + if (this.settings.scoItemIdValidator) { + return String(this.settings.scoItemIdValidator(target)); + } + return String(this.settings.scoItemIds.includes(target)); + } + } + return this.getValue("GetValue", true, CMIElement); + }; + Scorm2004API.prototype.lmsSetValue = function (CMIElement, value) { + return this.setValue("SetValue", "Commit", true, CMIElement, value); + }; + Scorm2004API.prototype.lmsCommit = function () { + var _this = this; + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.commit("Commit")]; + case 1: + _a.sent(); + return [2]; + } + }); + }); })(); + return api_constants/* default */.A.global.SCORM_TRUE; + }; + Scorm2004API.prototype.lmsGetLastError = function () { + return this.getLastError("GetLastError"); + }; + Scorm2004API.prototype.lmsGetErrorString = function (CMIErrorCode) { + return this.getErrorString("GetErrorString", CMIErrorCode); + }; + Scorm2004API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { + return this.getDiagnostic("GetDiagnostic", CMIErrorCode); + }; + Scorm2004API.prototype.setCMIValue = function (CMIElement, value) { + return this._commonSetCMIValue("SetValue", true, CMIElement, value); + }; + Scorm2004API.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new CMIObjectivesObject(); + } + if (foundFirstIndex) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return this.createCorrectResponsesObject(CMIElement, value); } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "credit", { - get: function () { - return this._credit; - }, - set: function (credit) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new CMIInteractionsObjectivesObject(); + } + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new CMIInteractionsObject(); + } + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) { + return new CMICommentsObject(); + } + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) { + return new CMICommentsObject(true); + } + return null; + }; + Scorm2004API.prototype.createCorrectResponsesObject = function (CMIElement, value) { + var parts = CMIElement.split("."); + var index = Number(parts[2]); + var interaction = this.cmi.interactions.childArray[index]; + if (this.isInitialized()) { + if (!interaction.type) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - this._credit = credit; + this.checkDuplicateChoiceResponse(interaction, value); + var response_type = CorrectResponses[interaction.type]; + if (response_type) { + this.checkValidResponseType(response_type, value, interaction.type); + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type); + } } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "lesson_status", { - get: function () { - return this._lesson_status; - }, - set: function (lesson_status) { - if (this.initialized) { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus)) { - this._lesson_status = lesson_status; + } + if (this.lastErrorCode === "0") { + return new CMIInteractionsCorrectResponsesObject(); + } + return null; + }; + Scorm2004API.prototype.checkValidResponseType = function (response_type, value, interaction_type) { + var nodes = []; + if (response_type === null || response_type === void 0 ? void 0 : response_type.delimiter) { + nodes = String(value).split(response_type.delimiter); + } + else { + nodes[0] = value; + } + if (nodes.length > 0 && nodes.length <= response_type.max) { + this.checkCorrectResponseValue(interaction_type, nodes, value); + } + else if (nodes.length > response_type.max) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long"); + } + }; + Scorm2004API.prototype.checkDuplicateChoiceResponse = function (interaction, value) { + var interaction_count = interaction.correct_responses._count; + if (interaction.type === "choice") { + for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) { + var response = interaction.correct_responses.childArray[i]; + if (response.pattern === value) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); } } + } + }; + Scorm2004API.prototype.validateCorrectResponse = function (CMIElement, value) { + var parts = CMIElement.split("."); + var index = Number(parts[2]); + var pattern_index = Number(parts[4]); + var interaction = this.cmi.interactions.childArray[index]; + var interaction_count = interaction.correct_responses._count; + this.checkDuplicateChoiceResponse(interaction, value); + var response_type = CorrectResponses[interaction.type]; + if (typeof response_type.limit === "undefined" || + interaction_count <= response_type.limit) { + this.checkValidResponseType(response_type, value, interaction.type); + if ((this.lastErrorCode === "0" && + (!response_type.duplicate || + !this.checkDuplicatedPattern(interaction.correct_responses, pattern_index, value))) || + (this.lastErrorCode === "0" && value === "")) { + } else { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus2)) { - this._lesson_status = lesson_status; + if (this.lastErrorCode === "0") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists"); } } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "entry", { - get: function () { - return this._entry; - }, - set: function (entry) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached"); + } + }; + Scorm2004API.prototype.getCMIValue = function (CMIElement) { + return this._commonGetCMIValue("GetValue", true, CMIElement); + }; + Scorm2004API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { + var basicMessage = ""; + var detailMessage = ""; + errorNumber = String(errorNumber); + if (api_constants/* default */.A.scorm2004.error_descriptions[errorNumber]) { + basicMessage = + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].basicMessage; + detailMessage = + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].detailMessage; + } + return detail ? detailMessage : basicMessage; + }; + Scorm2004API.prototype.checkDuplicatedPattern = function (correct_response, current_index, value) { + var found = false; + var count = correct_response._count; + for (var i = 0; i < count && !found; i++) { + if (i !== current_index && correct_response.childArray[i] === value) { + found = true; } - else { - this._entry = entry; + } + return found; + }; + Scorm2004API.prototype.checkCorrectResponseValue = function (interaction_type, nodes, value) { + var response = CorrectResponses[interaction_type]; + var formatRegex = new RegExp(response.format); + for (var i = 0; i < nodes.length && this.lastErrorCode === "0"; i++) { + if (interaction_type.match("^(fill-in|long-fill-in|matching|performance|sequencing)$")) { + nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]); } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "total_time", { - get: function () { - return this._total_time; - }, - set: function (total_time) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + if (response === null || response === void 0 ? void 0 : response.delimiter2) { + var values = nodes[i].split(response.delimiter2); + if (values.length === 2) { + var matches = values[0].match(formatRegex); + if (!matches) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (!response.format2 || + !values[1].match(new RegExp(response.format2))) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + else { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } } else { - this._total_time = total_time; + var matches = nodes[i].match(formatRegex); + if ((!matches && value !== "") || + (!matches && interaction_type === "true-false")) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + else { + if (interaction_type === "numeric" && nodes.length > 1) { + if (Number(nodes[0]) > Number(nodes[1])) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + else { + if (nodes[i] !== "" && response.unique) { + for (var j = 0; j < i && this.lastErrorCode === "0"; j++) { + if (nodes[i] === nodes[j]) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + } + } } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "lesson_mode", { - get: function () { - return this._lesson_mode; - }, - set: function (lesson_mode) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + } + }; + Scorm2004API.prototype.removeCorrectResponsePrefixes = function (node) { + var seenOrder = false; + var seenCase = false; + var seenLang = false; + var prefixRegex = new RegExp("^({(lang|case_matters|order_matters)=([^}]+)})"); + var matches = node.match(prefixRegex); + var langMatches = null; + while (matches) { + switch (matches[2]) { + case "lang": + langMatches = node.match(regex/* default */.A.scorm2004.CMILangcr); + if (langMatches) { + var lang = langMatches[3]; + if (lang !== undefined && lang.length > 0) { + if (!language_constants.includes(lang.toLowerCase())) { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + } + seenLang = true; + break; + case "case_matters": + if (!seenLang && !seenOrder && !seenCase) { + if (matches[3] !== "true" && matches[3] !== "false") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + seenCase = true; + break; + case "order_matters": + if (!seenCase && !seenLang && !seenOrder) { + if (matches[3] !== "true" && matches[3] !== "false") { + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); + } + } + seenOrder = true; + break; + } + node = node.substring(matches[1].length); + matches = node.match(prefixRegex); + } + return node; + }; + Scorm2004API.prototype.replaceWithAnotherScormAPI = function (newAPI) { + this.cmi = newAPI.cmi; + this.adl = newAPI.adl; + }; + Scorm2004API.prototype.renderCommitCMI = function (terminateCommit) { + var cmiExport = this.renderCMIToJSONObject(); + if (terminateCommit) { + cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime(); + } + var result = []; + var flattened = utilities/* flatten */.Bq(cmiExport); + switch (this.settings.dataCommitFormat) { + case "flattened": + return utilities/* flatten */.Bq(cmiExport); + case "params": + for (var item in flattened) { + if ({}.hasOwnProperty.call(flattened, item)) { + result.push("".concat(item, "=").concat(flattened[item])); + } + } + return result; + case "json": + default: + return cmiExport; + } + }; + Scorm2004API.prototype.renderCommitObject = function (terminateCommit) { + var cmiExport = this.renderCommitCMI(terminateCommit); + var totalTimeDuration = this.cmi.getCurrentTotalTime(); + var totalTimeSeconds = utilities/* getDurationAsSeconds */.OI(totalTimeDuration, regex/* default */.A.scorm2004.CMITimespan); + var completionStatus = enums/* CompletionStatus */.lC.unknown; + var successStatus = enums/* SuccessStatus */.YE.unknown; + if (this.cmi.completion_status) { + if (this.cmi.completion_status === "completed") { + completionStatus = enums/* CompletionStatus */.lC.completed; } - else { - this._lesson_mode = lesson_mode; + else if (this.cmi.completion_status === "incomplete") { + completionStatus = enums/* CompletionStatus */.lC.incomplete; } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "exit", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + } + if (this.cmi.success_status) { + if (this.cmi.success_status === "passed") { + successStatus = enums/* SuccessStatus */.YE.passed; } - return this._exit; - }, - set: function (exit) { - if (check12ValidFormat(exit, regex.scorm12.CMIExit, true)) { - this._exit = exit; + else if (this.cmi.success_status === "failed") { + successStatus = enums/* SuccessStatus */.YE.failed; } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "session_time", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + } + var score = this.cmi.score; + var scoreObject = null; + if (score) { + scoreObject = {}; + if (!Number.isNaN(Number.parseFloat(score.raw))) { + scoreObject.raw = Number.parseFloat(score.raw); } - return this._session_time; - }, - set: function (session_time) { - if (check12ValidFormat(session_time, regex.scorm12.CMITimespan)) { - this._session_time = session_time; + if (!Number.isNaN(Number.parseFloat(score.min))) { + scoreObject.min = Number.parseFloat(score.min); } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "suspend_data", { - get: function () { - return this._suspend_data; - }, - set: function (suspend_data) { - if (check12ValidFormat(suspend_data, regex.scorm12.CMIString4096, true)) { - this._suspend_data = suspend_data; + if (!Number.isNaN(Number.parseFloat(score.max))) { + scoreObject.max = Number.parseFloat(score.max); + } + if (!Number.isNaN(Number.parseFloat(score.scaled))) { + scoreObject.scaled = Number.parseFloat(score.scaled); } - }, - enumerable: false, - configurable: true - }); - CMICore.prototype.getCurrentTotalTime = function (start_time) { - var sessionTime = this._session_time; - var startTime = start_time; - if (typeof startTime !== "undefined" && startTime !== null) { - var seconds = new Date().getTime() - startTime; - sessionTime = getSecondsAsHHMMSS(seconds / 1000); } - return addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12.CMITimespan)); - }; - CMICore.prototype.toJSON = function () { - this.jsonString = true; - var result = { - student_id: this.student_id, - student_name: this.student_name, - lesson_location: this.lesson_location, - credit: this.credit, - lesson_status: this.lesson_status, - entry: this.entry, - lesson_mode: this.lesson_mode, - exit: this.exit, - session_time: this.session_time, - score: this.score, + var commitObject = { + completionStatus: completionStatus, + successStatus: successStatus, + totalTimeSeconds: totalTimeSeconds, + runtimeData: cmiExport, }; - delete this.jsonString; - return result; + if (scoreObject) { + commitObject.score = scoreObject; + } + return commitObject; }; - return CMICore; -}(BaseCMI)); - - -;// ./src/cmi/scorm12/objectives.ts - - + Scorm2004API.prototype.storeData = function (terminateCommit) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var navRequest, shouldTerminateCommit, commitObject, result; + var _a, _b, _c; + return (0,tslib_es6/* __generator */.YH)(this, function (_d) { + switch (_d.label) { + case 0: + if (terminateCommit) { + if (this.cmi.mode === "normal") { + if (this.cmi.credit === "credit") { + if (this.cmi.completion_threshold && this.cmi.progress_measure) { + if (this.cmi.progress_measure >= this.cmi.completion_threshold) { + this.cmi.completion_status = "completed"; + } + else { + this.cmi.completion_status = "incomplete"; + } + } + if (this.cmi.scaled_passing_score && this.cmi.score.scaled) { + if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) { + this.cmi.success_status = "passed"; + } + else { + this.cmi.success_status = "failed"; + } + } + } + } + } + navRequest = false; + if (this.adl.nav.request !== ((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.adl) === null || _b === void 0 ? void 0 : _b.nav) === null || _c === void 0 ? void 0 : _c.request) && + this.adl.nav.request !== "_none_") { + this.adl.nav.request = encodeURIComponent(this.adl.nav.request); + navRequest = true; + } + shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; + commitObject = this.settings.renderCommonCommitFields + ? this.renderCommitObject(shouldTerminateCommit) + : this.renderCommitCMI(shouldTerminateCommit); + if (this.apiLogLevel === api_constants/* default */.A.global.LOG_LEVEL_DEBUG) { + console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); + console.debug(commitObject); + } + if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; + return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; + case 1: + result = _d.sent(); + { + if (navRequest && + result.navRequest !== undefined && + result.navRequest !== "") { + Function("\"use strict\";(() => { ".concat(result.navRequest, " })()"))(); + } + } + return [2, result]; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + }); + }); + }; + return Scorm2004API; +}(BaseAPI/* default */.A)); +/* harmony default export */ var src_Scorm2004API = (Scorm2004API); +/***/ }), +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); -var objectives_CMIObjectives = (function (_super) { - __extends(CMIObjectives, _super); - function CMIObjectives() { - return _super.call(this, { - children: api_constants.scorm12.objectives_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - }) || this; - } - return CMIObjectives; -}(CMIArray)); -var objectives_CMIObjectivesObject = (function (_super) { - __extends(CMIObjectivesObject, _super); - function CMIObjectivesObject() { +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { var _this = _super.call(this) || this; - _this._id = ""; - _this._status = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, - }); + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; return _this; } - Object.defineProperty(CMIObjectivesObject.prototype, "id", { + Object.defineProperty(CMIArray.prototype, "_children", { get: function () { - return this._id; + return this.__children; }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } + set: function (_children) { + throw new this._errorClass(this._errorCode); }, enumerable: false, configurable: true }); - Object.defineProperty(CMIObjectivesObject.prototype, "status", { + Object.defineProperty(CMIArray.prototype, "_count", { get: function () { - return this._status; + return this.childArray.length; }, - set: function (status) { - if (check12ValidFormat(status, regex.scorm12.CMIStatus2)) { - this._status = status; - } + set: function (_count) { + throw new this._errorClass(this._errorCode); }, enumerable: false, configurable: true }); - CMIObjectivesObject.prototype.toJSON = function () { + CMIArray.prototype.toJSON = function () { this.jsonString = true; - var result = { - id: this.id, - status: this.status, - score: this.score, - }; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; + } delete this.jsonString; return result; }; - return CMIObjectivesObject; -}(BaseCMI)); - + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); -;// ./src/cmi/scorm12/student_data.ts +/***/ }), +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); -var CMIStudentData = (function (_super) { - __extends(CMIStudentData, _super); - function CMIStudentData(student_data_children) { - var _this = _super.call(this) || this; - _this._mastery_score = ""; - _this._max_time_allowed = ""; - _this._time_limit_action = ""; - _this.__children = student_data_children - ? student_data_children - : api_constants.scorm12.student_data_children; - return _this; +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; } - Object.defineProperty(CMIStudentData.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "mastery_score", { - get: function () { - return this._mastery_score; - }, - set: function (mastery_score) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._mastery_score = mastery_score; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { - get: function () { - return this._max_time_allowed; - }, - set: function (max_time_allowed) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._max_time_allowed = max_time_allowed; - } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { + Object.defineProperty(BaseCMI.prototype, "start_time", { get: function () { - return this._time_limit_action; - }, - set: function (time_limit_action) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._time_limit_action = time_limit_action; - } + return this._start_time; }, enumerable: false, configurable: true }); - CMIStudentData.prototype.toJSON = function () { - this.jsonString = true; - var result = { - mastery_score: this.mastery_score, - max_time_allowed: this.max_time_allowed, - time_limit_action: this.time_limit_action, - }; - delete this.jsonString; - return result; + BaseCMI.prototype.initialize = function () { + this._initialized = true; }; - return CMIStudentData; + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); + }; + return BaseCMI; +}()); + +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; }(BaseCMI)); -;// ./src/cmi/scorm12/student_preference.ts +/***/ }), +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); -var CMIStudentPreference = (function (_super) { - __extends(CMIStudentPreference, _super); - function CMIStudentPreference(student_preference_children) { + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { var _this = _super.call(this) || this; - _this._audio = ""; - _this._language = ""; - _this._speed = ""; - _this._text = ""; - _this.__children = student_preference_children - ? student_preference_children - : api_constants.scorm12.student_preference_children; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; return _this; } - Object.defineProperty(CMIStudentPreference.prototype, "_children", { + Object.defineProperty(CMIScore.prototype, "_children", { get: function () { return this.__children; }, set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "audio", { - get: function () { - return this._audio; - }, - set: function (audio) { - if (check12ValidFormat(audio, regex.scorm12.CMISInteger) && - check12ValidRange(audio, regex.scorm12.audio_range)) { - this._audio = audio; - } + throw new this.__error_class(this.__invalid_error_code); }, enumerable: false, configurable: true }); - Object.defineProperty(CMIStudentPreference.prototype, "language", { + Object.defineProperty(CMIScore.prototype, "raw", { get: function () { - return this._language; + return this._raw; }, - set: function (language) { - if (check12ValidFormat(language, regex.scorm12.CMIString256)) { - this._language = language; + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIStudentPreference.prototype, "speed", { + Object.defineProperty(CMIScore.prototype, "min", { get: function () { - return this._speed; + return this._min; }, - set: function (speed) { - if (check12ValidFormat(speed, regex.scorm12.CMISInteger) && - check12ValidRange(speed, regex.scorm12.speed_range)) { - this._speed = speed; + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIStudentPreference.prototype, "text", { + Object.defineProperty(CMIScore.prototype, "max", { get: function () { - return this._text; + return this._max; }, - set: function (text) { - if (check12ValidFormat(text, regex.scorm12.CMISInteger) && - check12ValidRange(text, regex.scorm12.text_range)) { - this._text = text; + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; } }, enumerable: false, configurable: true }); - CMIStudentPreference.prototype.toJSON = function () { + CMIScore.prototype.toJSON = function () { this.jsonString = true; var result = { - audio: this.audio, - language: this.language, - speed: this.speed, - text: this.text, + raw: this.raw, + min: this.min, + max: this.max, }; delete this.jsonString; return result; }; - return CMIStudentPreference; -}(BaseCMI)); + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); +function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { + if (typeof value !== "string") { + return false; + } + var formatRegex = new RegExp(regexPattern); + var matches = value.match(formatRegex); + if (allowEmptyString && value === "") { + return true; + } + if (value === undefined || !matches || matches[0] === "") { + throw new errorClass(errorCode); + } + return true; +} +function checkValidRange(value, rangePattern, errorCode, errorClass) { + var ranges = rangePattern.split("#"); + value = value * 1.0; + if (value >= ranges[0]) { + if (ranges[1] === "*" || value <= ranges[1]) { + return true; + } + else { + throw new errorClass(errorCode); + } + } + else { + throw new errorClass(errorCode); + } +} -;// ./src/cmi/scorm12/interactions.ts +/***/ }), +/***/ 989: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Y: function() { return /* binding */ CMI; } +}); +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts +var validation = __webpack_require__(915); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/cmi/aicc/core.ts -var interactions_CMIInteractions = (function (_super) { - __extends(CMIInteractions, _super); - function CMIInteractions() { - return _super.call(this, { - children: api_constants.scorm12.interactions_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - }) || this; - } - return CMIInteractions; -}(CMIArray)); -var interactions_CMIInteractionsObject = (function (_super) { - __extends(CMIInteractionsObject, _super); - function CMIInteractionsObject() { + + + + +var CMICore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICore, _super); + function CMICore() { var _this = _super.call(this) || this; - _this._id = ""; - _this._time = ""; - _this._type = ""; - _this._weighting = ""; - _this._student_response = ""; - _this._result = ""; - _this._latency = ""; - _this.objectives = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.objectives_children, - }); - _this.correct_responses = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.correct_responses_children, + _this.__children = api_constants/* default */.A.scorm12.core_children; + _this._student_id = ""; + _this._student_name = ""; + _this._lesson_location = ""; + _this._credit = ""; + _this._lesson_status = "not attempted"; + _this._entry = ""; + _this._total_time = ""; + _this._lesson_mode = "normal"; + _this._exit = ""; + _this._session_time = "00:00:00"; + _this._suspend_data = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.scorm12.score_children, + score_range: regex/* default */.A.scorm12.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* Scorm12ValidationError */.tQ, }); return _this; } - CMIInteractionsObject.prototype.initialize = function () { - var _a, _b; + CMICore.prototype.initialize = function () { + var _a; _super.prototype.initialize.call(this); - (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); }; - Object.defineProperty(CMIInteractionsObject.prototype, "id", { + Object.defineProperty(CMICore.prototype, "_children", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._id; + return this.__children; }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_id", { + get: function () { + return this._student_id; + }, + set: function (student_id) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_id = student_id; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "time", { + Object.defineProperty(CMICore.prototype, "student_name", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + return this._student_name; + }, + set: function (student_name) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._student_name = student_name; } - return this._time; }, - set: function (time) { - if (check12ValidFormat(time, regex.scorm12.CMITime)) { - this._time = time; + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_location", { + get: function () { + return this._lesson_location; + }, + set: function (lesson_location) { + if ((0,validation/* check12ValidFormat */.p)(lesson_location, regex/* default */.A.scorm12.CMIString256, true)) { + this._lesson_location = lesson_location; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "type", { + Object.defineProperty(CMICore.prototype, "credit", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + return this._credit; + }, + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._credit = credit; } - return this._type; }, - set: function (type) { - if (check12ValidFormat(type, regex.scorm12.CMIType)) { - this._type = type; + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (this.initialized) { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus)) { + this._lesson_status = lesson_status; + } + } + else { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus2)) { + this._lesson_status = lesson_status; + } } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + Object.defineProperty(CMICore.prototype, "entry", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._weighting; + return this._entry; }, - set: function (weighting) { - if (check12ValidFormat(weighting, regex.scorm12.CMIDecimal) && - check12ValidRange(weighting, regex.scorm12.weighting_range)) { - this._weighting = weighting; + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._entry = entry; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { + Object.defineProperty(CMICore.prototype, "total_time", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._student_response; + return this._total_time; }, - set: function (student_response) { - if (check12ValidFormat(student_response, regex.scorm12.CMIFeedback, true)) { - this._student_response = student_response; + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._total_time = total_time; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "result", { + Object.defineProperty(CMICore.prototype, "lesson_mode", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._result; + return this._lesson_mode; }, - set: function (result) { - if (check12ValidFormat(result, regex.scorm12.CMIResult)) { - this._result = result; + set: function (lesson_mode) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._lesson_mode = lesson_mode; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + Object.defineProperty(CMICore.prototype, "exit", { get: function () { if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); } - return this._latency; + return this._exit; }, - set: function (latency) { - if (check12ValidFormat(latency, regex.scorm12.CMITimespan)) { - this._latency = latency; + set: function (exit) { + if ((0,validation/* check12ValidFormat */.p)(exit, regex/* default */.A.scorm12.CMIExit, true)) { + this._exit = exit; } }, enumerable: false, configurable: true }); - CMIInteractionsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - time: this.time, - type: this.type, - weighting: this.weighting, - student_response: this.student_response, - result: this.result, - latency: this.latency, - objectives: this.objectives, - correct_responses: this.correct_responses, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObject; -}(BaseCMI)); - -var interactions_CMIInteractionsObjectivesObject = (function (_super) { - __extends(CMIInteractionsObjectivesObject, _super); - function CMIInteractionsObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; - return _this; - } - Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + Object.defineProperty(CMICore.prototype, "session_time", { get: function () { - return this._id; + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._session_time; }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; + set: function (session_time) { + if ((0,validation/* check12ValidFormat */.p)(session_time, regex/* default */.A.scorm12.CMITimespan)) { + this._session_time = session_time; } }, enumerable: false, configurable: true }); - CMIInteractionsObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObjectivesObject; -}(BaseCMI)); - -var interactions_CMIInteractionsCorrectResponsesObject = (function (_super) { - __extends(CMIInteractionsCorrectResponsesObject, _super); - function CMIInteractionsCorrectResponsesObject() { - var _this = _super.call(this) || this; - _this._pattern = ""; - return _this; - } - Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { + Object.defineProperty(CMICore.prototype, "suspend_data", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._pattern; + return this._suspend_data; }, - set: function (pattern) { - if (check12ValidFormat(pattern, regex.scorm12.CMIFeedback, true)) { - this._pattern = pattern; + set: function (suspend_data) { + if ((0,validation/* check12ValidFormat */.p)(suspend_data, regex/* default */.A.scorm12.CMIString4096, true)) { + this._suspend_data = suspend_data; } }, enumerable: false, configurable: true }); - CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + CMICore.prototype.getCurrentTotalTime = function (start_time) { + var sessionTime = this._session_time; + var startTime = start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsHHMMSS */.UZ(seconds / 1000); + } + return utilities/* addHHMMSSTimeStrings */.HT(this._total_time, sessionTime, new RegExp(regex/* default */.A.scorm12.CMITimespan)); + }; + CMICore.prototype.toJSON = function () { this.jsonString = true; var result = { - pattern: this._pattern, + student_id: this.student_id, + student_name: this.student_name, + lesson_location: this.lesson_location, + credit: this.credit, + lesson_status: this.lesson_status, + entry: this.entry, + lesson_mode: this.lesson_mode, + exit: this.exit, + session_time: this.session_time, + score: this.score, }; delete this.jsonString; return result; }; - return CMIInteractionsCorrectResponsesObject; -}(BaseCMI)); + return CMICore; +}(base_cmi/* BaseCMI */.J)); +// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts +var objectives = __webpack_require__(176); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var scorm12_student_data = __webpack_require__(532); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +// EXTERNAL MODULE: ./src/cmi/scorm12/interactions.ts +var interactions = __webpack_require__(833); ;// ./src/cmi/scorm12/cmi.ts @@ -5210,8 +5066,8 @@ var interactions_CMIInteractionsCorrectResponsesObject = (function (_super) { -var cmi_CMI = (function (_super) { - __extends(CMI, _super); +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); function CMI(cmi_children, student_data, initialized) { var _this = _super.call(this) || this; _this.__children = ""; @@ -5223,12 +5079,12 @@ var cmi_CMI = (function (_super) { _this.initialize(); _this.__children = cmi_children ? cmi_children - : api_constants.scorm12.cmi_children; + : api_constants/* default */.A.scorm12.cmi_children; _this.core = new CMICore(); - _this.objectives = new objectives_CMIObjectives(); - _this.student_data = student_data ? student_data : new CMIStudentData(); - _this.student_preference = new CMIStudentPreference(); - _this.interactions = new interactions_CMIInteractions(); + _this.objectives = new objectives/* CMIObjectives */.C(); + _this.student_data = student_data ? student_data : new scorm12_student_data/* CMIStudentData */.X(); + _this.student_preference = new student_preference/* CMIStudentPreference */.G(); + _this.interactions = new interactions/* CMIInteractions */.Xb(); return _this; } CMI.prototype.initialize = function () { @@ -5261,7 +5117,7 @@ var cmi_CMI = (function (_super) { return this.__version; }, set: function (_version) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true @@ -5271,7 +5127,7 @@ var cmi_CMI = (function (_super) { return this.__children; }, set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true @@ -5291,386 +5147,378 @@ var cmi_CMI = (function (_super) { }); Object.defineProperty(CMI.prototype, "launch_data", { get: function () { - return this._launch_data; - }, - set: function (launch_data) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + return this._launch_data; + }, + set: function (launch_data) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments", { + get: function () { + return this._comments; + }, + set: function (comments) { + if ((0,validation/* check12ValidFormat */.p)(comments, regex/* default */.A.scorm12.CMIString4096, true)) { + this._comments = comments; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments_from_lms", { + get: function () { + return this._comments_from_lms; + }, + set: function (comments_from_lms) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._comments_from_lms = comments_from_lms; + } + }, + enumerable: false, + configurable: true + }); + CMI.prototype.getCurrentTotalTime = function () { + return this.core.getCurrentTotalTime(this.start_time); + }; + return CMI; +}(base_cmi/* BaseRootCMI */.r)); + + + +/***/ }), + +/***/ 833: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Oh: function() { return /* binding */ CMIInteractionsObjectivesObject; }, +/* harmony export */ WP: function() { return /* binding */ CMIInteractionsObject; }, +/* harmony export */ Xb: function() { return /* binding */ CMIInteractions; }, +/* harmony export */ cb: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(784); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417); + + + + + + + + +var CMIInteractions = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.interactions_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIInteractions; +}(_common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B)); + +var CMIInteractionsObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { + var _this = _super.call(this) || this; + _this._id = ""; + _this._time = ""; + _this._type = ""; + _this._weighting = ""; + _this._student_response = ""; + _this._result = ""; + _this._latency = ""; + _this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.objectives_children, + }); + _this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.correct_responses_children, + }); + return _this; + } + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "time", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._time; + }, + set: function (time) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "type", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._type; + }, + set: function (type) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIType)) { + this._type = type; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - else { - this._launch_data = launch_data; + return this._weighting; + }, + set: function (weighting) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIDecimal) && + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidRange */ .h)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.weighting_range)) { + this._weighting = weighting; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMI.prototype, "comments", { + Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { get: function () { - return this._comments; + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._student_response; }, - set: function (comments) { - if (check12ValidFormat(comments, regex.scorm12.CMIString4096, true)) { - this._comments = comments; + set: function (student_response) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._student_response = student_response; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMI.prototype, "comments_from_lms", { + Object.defineProperty(CMIInteractionsObject.prototype, "result", { get: function () { - return this._comments_from_lms; - }, - set: function (comments_from_lms) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - else { - this._comments_from_lms = comments_from_lms; + return this._result; + }, + set: function (result) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIResult)) { + this._result = result; } }, enumerable: false, configurable: true }); - CMI.prototype.getCurrentTotalTime = function () { - return this.core.getCurrentTotalTime(this.start_time); - }; - return CMI; -}(BaseRootCMI)); - - -;// ./src/cmi/scorm12/nav.ts - - - - -var NAV = (function (_super) { - __extends(NAV, _super); - function NAV() { - var _this = _super.call(this) || this; - _this._event = ""; - return _this; - } - Object.defineProperty(NAV.prototype, "event", { + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { get: function () { - return this._event; + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._latency; }, - set: function (event) { - if (check12ValidFormat(event, regex.scorm12.NAVEvent)) { - this._event = event; + set: function (latency) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITimespan)) { + this._latency = latency; } }, enumerable: false, configurable: true }); - NAV.prototype.toJSON = function () { + CMIInteractionsObject.prototype.toJSON = function () { this.jsonString = true; var result = { - event: this.event, + id: this.id, + time: this.time, + type: this.type, + weighting: this.weighting, + student_response: this.student_response, + result: this.result, + latency: this.latency, + objectives: this.objectives, + correct_responses: this.correct_responses, }; delete this.jsonString; return result; }; - return NAV; -}(BaseCMI)); - - -;// ./src/Scorm12API.ts - - - - - - - - - - - + return CMIInteractionsObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); -var Scorm12API = (function (_super) { - __extends(Scorm12API, _super); - function Scorm12API(settings) { - var _this = this; - if (settings) { - if (settings.mastery_override === undefined) { - settings.mastery_override = false; - } - } - _this = _super.call(this, error_codes.scorm12, settings) || this; - _this.statusSetByModule = false; - _this.cmi = new cmi_CMI(); - _this.nav = new NAV(); - _this.LMSInitialize = _this.lmsInitialize; - _this.LMSFinish = _this.lmsFinish; - _this.LMSGetValue = _this.lmsGetValue; - _this.LMSSetValue = _this.lmsSetValue; - _this.LMSCommit = _this.lmsCommit; - _this.LMSGetLastError = _this.lmsGetLastError; - _this.LMSGetErrorString = _this.lmsGetErrorString; - _this.LMSGetDiagnostic = _this.lmsGetDiagnostic; +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; return _this; } - Scorm12API.prototype.reset = function (settings) { - this.commonReset(settings); - this.cmi = new cmi_CMI(); - this.nav = new NAV(); - }; - Scorm12API.prototype.lmsInitialize = function () { - this.cmi.initialize(); - if (this.cmi.core.lesson_status) { - this.statusSetByModule = true; - } - else { - this.cmi.core.lesson_status = "not attempted"; - } - return this.initialize("LMSInitialize", "LMS was already initialized!", "LMS is already finished!"); - }; - Scorm12API.prototype.lmsFinish = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.internalFinish()]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm12API.prototype.internalFinish = function () { - return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.terminate("LMSFinish", true)]; - case 1: - result = _a.sent(); - if (result === api_constants.global.SCORM_TRUE) { - if (this.nav.event !== "") { - if (this.nav.event === "continue") { - this.processListeners("SequenceNext"); - } - else { - this.processListeners("SequencePrevious"); - } - } - else if (this.settings.autoProgress) { - this.processListeners("SequenceNext"); - } - } - return [2, result]; - } - }); - }); - }; - Scorm12API.prototype.lmsGetValue = function (CMIElement) { - return this.getValue("LMSGetValue", false, CMIElement); - }; - Scorm12API.prototype.lmsSetValue = function (CMIElement, value) { - if (CMIElement === "cmi.core.lesson_status") { - this.statusSetByModule = true; - } - return this.setValue("LMSSetValue", "LMSCommit", false, CMIElement, value); - }; - Scorm12API.prototype.lmsCommit = function () { - var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.commit("LMSCommit", false)]; - case 1: - _a.sent(); - return [2]; - } - }); - }); })(); - return api_constants.global.SCORM_TRUE; - }; - Scorm12API.prototype.lmsGetLastError = function () { - return this.getLastError("LMSGetLastError"); - }; - Scorm12API.prototype.lmsGetErrorString = function (CMIErrorCode) { - return this.getErrorString("LMSGetErrorString", CMIErrorCode); - }; - Scorm12API.prototype.lmsGetDiagnostic = function (CMIErrorCode) { - return this.getDiagnostic("LMSGetDiagnostic", CMIErrorCode); - }; - Scorm12API.prototype.setCMIValue = function (CMIElement, value) { - return this._commonSetCMIValue("LMSSetValue", false, CMIElement, value); - }; - Scorm12API.prototype.getCMIValue = function (CMIElement) { - return this._commonGetCMIValue("getCMIValue", false, CMIElement); - }; - Scorm12API.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.objectives\\.\\d+")) { - return new objectives_CMIObjectivesObject(); - } - else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { - return new interactions_CMIInteractionsCorrectResponsesObject(); - } - else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { - return new interactions_CMIInteractionsObjectivesObject(); - } - else if (!foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+")) { - return new interactions_CMIInteractionsObject(); - } - return null; - }; - Scorm12API.prototype.validateCorrectResponse = function (_CMIElement, _value) { - }; - Scorm12API.prototype.getLmsErrorMessageDetails = function (errorNumber, detail) { - var basicMessage = "No Error"; - var detailMessage = "No Error"; - errorNumber = String(errorNumber); - if (api_constants.scorm12.error_descriptions[errorNumber]) { - basicMessage = - api_constants.scorm12.error_descriptions[errorNumber].basicMessage; - detailMessage = - api_constants.scorm12.error_descriptions[errorNumber].detailMessage; - } - return detail ? detailMessage : basicMessage; - }; - Scorm12API.prototype.replaceWithAnotherScormAPI = function (newAPI) { - this.cmi = newAPI.cmi; - }; - Scorm12API.prototype.renderCommitCMI = function (terminateCommit) { - var cmiExport = this.renderCMIToJSONObject(); - if (terminateCommit) { - cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); - } - var result = []; - var flattened = flatten(cmiExport); - switch (this.settings.dataCommitFormat) { - case "flattened": - return flatten(cmiExport); - case "params": - for (var item in flattened) { - if ({}.hasOwnProperty.call(flattened, item)) { - result.push("".concat(item, "=").concat(flattened[item])); - } - } - return result; - case "json": - default: - return cmiExport; - } - }; - Scorm12API.prototype.renderCommitObject = function (terminateCommit) { - var cmiExport = this.renderCommitCMI(terminateCommit); - var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); - var totalTimeSeconds = getTimeAsSeconds(totalTimeHHMMSS, regex.scorm12.CMITimespan); - var lessonStatus = this.cmi.core.lesson_status; - var completionStatus = CompletionStatus.unknown; - var successStatus = SuccessStatus.unknown; - if (lessonStatus) { - completionStatus = - lessonStatus === "completed" || lessonStatus === "passed" - ? CompletionStatus.completed - : CompletionStatus.incomplete; - if (lessonStatus === "passed") { - successStatus = SuccessStatus.passed; - } - else if (lessonStatus === "failed") { - successStatus = SuccessStatus.failed; - } - } - var score = this.cmi.core.score; - var scoreObject = null; - if (score) { - scoreObject = {}; - if (!Number.isNaN(Number.parseFloat(score.raw))) { - scoreObject.raw = Number.parseFloat(score.raw); + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; } - if (!Number.isNaN(Number.parseFloat(score.min))) { - scoreObject.min = Number.parseFloat(score.min); + }, + enumerable: false, + configurable: true + }); + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); } - if (!Number.isNaN(Number.parseFloat(score.max))) { - scoreObject.max = Number.parseFloat(score.max); + return this._pattern; + }, + set: function (pattern) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._pattern = pattern; } - } - var commitObject = { - successStatus: successStatus, - completionStatus: completionStatus, - runtimeData: cmiExport, - totalTimeSeconds: totalTimeSeconds, + }, + enumerable: false, + configurable: true + }); + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this._pattern, }; - if (scoreObject) { - commitObject.score = scoreObject; - } - return commitObject; + delete this.jsonString; + return result; }; - Scorm12API.prototype.storeData = function (terminateCommit) { - return __awaiter(this, void 0, void 0, function () { - var originalStatus, shouldTerminateCommit, commitObject; - var _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - if (terminateCommit) { - originalStatus = this.cmi.core.lesson_status; - if (!this.cmi.core.lesson_status || - (!this.statusSetByModule && - this.cmi.core.lesson_status === "not attempted")) { - this.cmi.core.lesson_status = "completed"; - } - if (this.cmi.core.lesson_mode === "normal") { - if (this.cmi.core.credit === "credit") { - if (this.settings.mastery_override && - this.cmi.student_data.mastery_score !== "" && - this.cmi.core.score.raw !== "") { - this.cmi.core.lesson_status = - parseFloat(this.cmi.core.score.raw) >= - parseFloat(this.cmi.student_data.mastery_score) - ? "passed" - : "failed"; - } - } - } - else if (this.cmi.core.lesson_mode === "browse") { - if ((((_c = (_b = (_a = this.startingData) === null || _a === void 0 ? void 0 : _a.cmi) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.lesson_status) || "") === "" && - originalStatus === "not attempted") { - this.cmi.core.lesson_status = "browsed"; - } - } - } - shouldTerminateCommit = terminateCommit || this.settings.alwaysSendTotalTime; - commitObject = this.settings.renderCommonCommitFields - ? this.renderCommitObject(shouldTerminateCommit) - : this.renderCommitCMI(shouldTerminateCommit); - if (this.apiLogLevel === api_constants.global.LOG_LEVEL_DEBUG) { - console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); - console.debug(commitObject); - } - if (!(typeof this.settings.lmsCommitUrl === "string")) return [3, 2]; - return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; - case 1: return [2, _d.sent()]; - case 2: return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - }); - }); + return CMIInteractionsCorrectResponsesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 331: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: function() { return /* binding */ NAV; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417); + + + + +var NAV = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(NAV, _super); + function NAV() { + var _this = _super.call(this) || this; + _this._event = ""; + return _this; + } + Object.defineProperty(NAV.prototype, "event", { + get: function () { + return this._event; + }, + set: function (event) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__/* .check12ValidFormat */ .p)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.NAVEvent)) { + this._event = event; + } + }, + enumerable: false, + configurable: true + }); + NAV.prototype.toJSON = function () { + this.jsonString = true; + var result = { + event: this.event, + }; + delete this.jsonString; + return result; }; - return Scorm12API; -}(src_BaseAPI)); -/* harmony default export */ var src_Scorm12API = (Scorm12API); + return NAV; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); -;// ./src/cmi/aicc/validation.ts +/***/ }), -var aicc_error_codes = error_codes.scorm12; -function checkAICCValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, aicc_error_codes.TYPE_MISMATCH, AICCValidationError, allowEmptyString); -} +/***/ 176: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -;// ./src/cmi/aicc/evaluation.ts +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ CMIObjectives; }, +/* harmony export */ N: function() { return /* binding */ CMIObjectivesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _common_score__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(434); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(784); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589); @@ -5679,885 +5527,1463 @@ function checkAICCValidFormat(value, regexPattern, allowEmptyString) { -var CMIEvaluation = (function (_super) { - __extends(CMIEvaluation, _super); - function CMIEvaluation() { + +var CMIObjectives = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectives, _super); + function CMIObjectives() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.objectives_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIObjectives; +}(_common_array__WEBPACK_IMPORTED_MODULE_7__/* .CMIArray */ .B)); + +var CMIObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectivesObject, _super); + function CMIObjectivesObject() { var _this = _super.call(this) || this; - _this.comments = new CMIEvaluationComments(); + _this._id = ""; + _this._status = ""; + _this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__/* .CMIScore */ ._({ + score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.score_children, + score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.score_range, + invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, + invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }); return _this; } - CMIEvaluation.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.comments) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - CMIEvaluation.prototype.toJSON = function () { + Object.defineProperty(CMIObjectivesObject.prototype, "id", { + get: function () { + return this._id; + }, + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIObjectivesObject.prototype, "status", { + get: function () { + return this._status; + }, + set: function (status) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIStatus2)) { + this._status = status; + } + }, + enumerable: false, + configurable: true + }); + CMIObjectivesObject.prototype.toJSON = function () { this.jsonString = true; var result = { - comments: this.comments, + id: this.id, + status: this.status, + score: this.score, }; delete this.jsonString; return result; }; - return CMIEvaluation; -}(BaseCMI)); + return CMIObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); -var CMIEvaluationComments = (function (_super) { - __extends(CMIEvaluationComments, _super); - function CMIEvaluationComments() { - return _super.call(this, { - children: api_constants.aicc.comments_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: AICCValidationError, - }) || this; - } - return CMIEvaluationComments; -}(CMIArray)); -var CMIEvaluationCommentsObject = (function (_super) { - __extends(CMIEvaluationCommentsObject, _super); - function CMIEvaluationCommentsObject() { + + +/***/ }), + +/***/ 532: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ X: function() { return /* binding */ CMIStudentData; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + +var CMIStudentData = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIStudentData, _super); + function CMIStudentData(student_data_children) { var _this = _super.call(this) || this; - _this._content = ""; - _this._location = ""; - _this._time = ""; + _this._mastery_score = ""; + _this._max_time_allowed = ""; + _this._time_limit_action = ""; + _this.__children = student_data_children + ? student_data_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_data_children; return _this; } - Object.defineProperty(CMIEvaluationCommentsObject.prototype, "content", { + Object.defineProperty(CMIStudentData.prototype, "_children", { get: function () { - return this._content; + return this.__children; }, - set: function (content) { - if (checkAICCValidFormat(content, regex.aicc.CMIString256)) { - this._content = content; + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIStudentData.prototype, "mastery_score", { + get: function () { + return this._mastery_score; + }, + set: function (mastery_score) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._mastery_score = mastery_score; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIEvaluationCommentsObject.prototype, "location", { + Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { get: function () { - return this._location; + return this._max_time_allowed; }, - set: function (location) { - if (checkAICCValidFormat(location, regex.aicc.CMIString256)) { - this._location = location; + set: function (max_time_allowed) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._max_time_allowed = max_time_allowed; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIEvaluationCommentsObject.prototype, "time", { + Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { get: function () { - return this._time; + return this._time_limit_action; }, - set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { - this._time = time; + set: function (time_limit_action) { + if (this.initialized) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._time_limit_action = time_limit_action; } }, enumerable: false, configurable: true }); - CMIEvaluationCommentsObject.prototype.toJSON = function () { + CMIStudentData.prototype.toJSON = function () { this.jsonString = true; var result = { - content: this.content, - location: this.location, - time: this.time, + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, }; delete this.jsonString; return result; }; - return CMIEvaluationCommentsObject; -}(BaseCMI)); + return CMIStudentData; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); -;// ./src/cmi/aicc/student_preferences.ts +/***/ }), +/***/ 181: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ G: function() { return /* binding */ CMIStudentPreference; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(417); -var AICCStudentPreferences = (function (_super) { - __extends(AICCStudentPreferences, _super); - function AICCStudentPreferences() { - var _this = _super.call(this, api_constants.aicc.student_preference_children) || this; - _this._lesson_type = ""; - _this._text_color = ""; - _this._text_location = ""; - _this._text_size = ""; - _this._video = ""; - _this.windows = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: AICCValidationError, - children: "", - }); + + +var CMIStudentPreference = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(CMIStudentPreference, _super); + function CMIStudentPreference(student_preference_children) { + var _this = _super.call(this) || this; + _this._audio = ""; + _this._language = ""; + _this._speed = ""; + _this._text = ""; + _this.__children = student_preference_children + ? student_preference_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_preference_children; return _this; } - AICCStudentPreferences.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.windows) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(AICCStudentPreferences.prototype, "lesson_type", { + Object.defineProperty(CMIStudentPreference.prototype, "_children", { get: function () { - return this._lesson_type; + return this.__children; }, - set: function (lesson_type) { - if (checkAICCValidFormat(lesson_type, regex.aicc.CMIString256)) { - this._lesson_type = lesson_type; - } + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true }); - Object.defineProperty(AICCStudentPreferences.prototype, "text_color", { + Object.defineProperty(CMIStudentPreference.prototype, "audio", { get: function () { - return this._text_color; + return this._audio; }, - set: function (text_color) { - if (checkAICCValidFormat(text_color, regex.aicc.CMIString256)) { - this._text_color = text_color; + set: function (audio) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.audio_range)) { + this._audio = audio; } }, enumerable: false, configurable: true }); - Object.defineProperty(AICCStudentPreferences.prototype, "text_location", { + Object.defineProperty(CMIStudentPreference.prototype, "language", { get: function () { - return this._text_location; + return this._language; }, - set: function (text_location) { - if (checkAICCValidFormat(text_location, regex.aicc.CMIString256)) { - this._text_location = text_location; + set: function (language) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMIString256)) { + this._language = language; } }, enumerable: false, configurable: true }); - Object.defineProperty(AICCStudentPreferences.prototype, "text_size", { + Object.defineProperty(CMIStudentPreference.prototype, "speed", { get: function () { - return this._text_size; + return this._speed; }, - set: function (text_size) { - if (checkAICCValidFormat(text_size, regex.aicc.CMIString256)) { - this._text_size = text_size; + set: function (speed) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.speed_range)) { + this._speed = speed; } }, enumerable: false, configurable: true }); - Object.defineProperty(AICCStudentPreferences.prototype, "video", { + Object.defineProperty(CMIStudentPreference.prototype, "text", { get: function () { - return this._video; + return this._text; }, - set: function (video) { - if (checkAICCValidFormat(video, regex.aicc.CMIString256)) { - this._video = video; + set: function (text) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.text_range)) { + this._text = text; } }, enumerable: false, configurable: true }); - AICCStudentPreferences.prototype.toJSON = function () { + CMIStudentPreference.prototype.toJSON = function () { this.jsonString = true; var result = { audio: this.audio, language: this.language, - lesson_type: this.lesson_type, speed: this.speed, text: this.text, - text_color: this.text_color, - text_location: this.text_location, - text_size: this.text_size, - video: this.video, - windows: this.windows, }; delete this.jsonString; return result; }; - return AICCStudentPreferences; -}(CMIStudentPreference)); + return CMIStudentPreference; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); -;// ./src/cmi/aicc/student_demographics.ts +/***/ }), +/***/ 915: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ h: function() { return /* binding */ check12ValidRange; }, +/* harmony export */ p: function() { return /* binding */ check12ValidFormat; } +/* harmony export */ }); +/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784); -var CMIStudentDemographics = (function (_super) { - __extends(CMIStudentDemographics, _super); - function CMIStudentDemographics() { - var _this = _super.call(this) || this; - _this.__children = api_constants.aicc.student_demographics_children; - _this._city = ""; - _this._class = ""; - _this._company = ""; - _this._country = ""; - _this._experience = ""; - _this._familiar_name = ""; - _this._instructor_name = ""; - _this._title = ""; - _this._native_language = ""; - _this._state = ""; - _this._street_address = ""; - _this._telephone = ""; - _this._years_experience = ""; - return _this; + +function check12ValidFormat(value, regexPattern, allowEmptyString) { + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidFormat */ .q)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ, allowEmptyString); +} +function check12ValidRange(value, rangePattern, allowEmptyString) { + if (!allowEmptyString && value === "") { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE); } - Object.defineProperty(CMIStudentDemographics.prototype, "_children", { - get: function () { - return this.__children; + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidRange */ .W)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ); +} + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "city", { - get: function () { - return this._city; + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", }, - set: function (city) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._city = city; - } + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "class", { - get: function () { - return this._class; + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", }, - set: function (clazz) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._class = clazz; - } + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "company", { - get: function () { - return this._company; + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", }, - set: function (company) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._company = company; - } + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "country", { - get: function () { - return this._country; + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", }, - set: function (country) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._country = country; - } + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "experience", { - get: function () { - return this._experience; + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", }, - set: function (experience) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._experience = experience; - } + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "familiar_name", { - get: function () { - return this._familiar_name; + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", }, - set: function (familiar_name) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._familiar_name = familiar_name; - } + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "instructor_name", { - get: function () { - return this._instructor_name; + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", }, - set: function (instructor_name) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._instructor_name = instructor_name; - } + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "title", { - get: function () { - return this._title; + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", }, - set: function (title) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._title = title; - } + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "native_language", { + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); + + +/***/ }), + +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ K$: function() { return /* binding */ NAVBoolean; }, +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); + + +/***/ }), + +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); + + +/***/ }), + +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); + + +/***/ }), + +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ gv: function() { return /* binding */ AICCValidationError; }, +/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; }, +/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); + + +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; + return _this; + } + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { get: function () { - return this._native_language; - }, - set: function (native_language) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._native_language = native_language; - } + return this._errorCode; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIStudentDemographics.prototype, "state", { + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; + }; + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; + } + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { get: function () { - return this._state; - }, - set: function (state) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._state = state; - } + return this._errorMessage; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIStudentDemographics.prototype, "street_address", { + Object.defineProperty(ValidationError.prototype, "detailedMessage", { get: function () { - return this._street_address; - }, - set: function (street_address) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._street_address = street_address; - } + return this._detailedMessage; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIStudentDemographics.prototype, "telephone", { - get: function () { - return this._telephone; - }, - set: function (telephone) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + return ValidationError; +}(BaseScormValidationError)); + +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + } + return _this; + } + return AICCValidationError; +}(ValidationError)); + +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $o: function() { return /* binding */ addTwoDurations; }, +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ HT: function() { return /* binding */ addHHMMSSTimeStrings; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ OI: function() { return /* binding */ getDurationAsSeconds; }, +/* harmony export */ UZ: function() { return /* binding */ getSecondsAsHHMMSS; }, +/* harmony export */ f4: function() { return /* binding */ getTimeAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; }, +/* harmony export */ xE: function() { return /* binding */ getSecondsAsISODuration; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); + } + else { + msStr = String(ms); + } + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); + } + if (designationsKey === "S" && remainder > 0) { + value += remainder; + } + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; } - else { - this._telephone = telephone; + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentDemographics.prototype, "years_experience", { - get: function () { - return this._years_experience; - }, - set: function (years_experience) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + } + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); + } } - else { - this._years_experience = years_experience; + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); } - }, - enumerable: false, - configurable: true - }); - CMIStudentDemographics.prototype.toJSON = function () { - this.jsonString = true; - var result = { - city: this.city, - class: this.class, - company: this.company, - country: this.country, - experience: this.experience, - familiar_name: this.familiar_name, - instructor_name: this.instructor_name, - title: this.title, - native_language: this.native_language, - state: this.state, - street_address: this.street_address, - telephone: this.telephone, - years_experience: this.years_experience, - }; - delete this.jsonString; - return result; - }; - return CMIStudentDemographics; -}(BaseCMI)); - - -;// ./src/cmi/aicc/tries.ts - - - - - - - - - -var CMITries = (function (_super) { - __extends(CMITries, _super); - function CMITries() { - return _super.call(this, { - children: api_constants.aicc.tries_children, - }) || this; + cur[prop] = data[p]; + } } - return CMITries; -}(CMIArray)); - -var CMITriesObject = (function (_super) { - __extends(CMITriesObject, _super); - function CMITriesObject() { - var _this = _super.call(this) || this; - _this._status = ""; - _this._time = ""; - _this.score = new CMIScore({ - score_children: api_constants.aicc.score_children, - score_range: regex.aicc.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: AICCValidationError, - }); - return _this; + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; } - CMITriesObject.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(CMITriesObject.prototype, "status", { - get: function () { - return this._status; - }, - set: function (status) { - if (checkAICCValidFormat(status, regex.aicc.CMIStatus2)) { - this._status = status; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMITriesObject.prototype, "time", { - get: function () { - return this._time; - }, - set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - CMITriesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - status: this.status, - time: this.time, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMITriesObject; -}(BaseCMI)); - - -;// ./src/cmi/aicc/attempts.ts - - - - - - - + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} -var CMIAttemptRecords = (function (_super) { - __extends(CMIAttemptRecords, _super); - function CMIAttemptRecords() { - return _super.call(this, { - children: api_constants.aicc.attempt_records_children, - }) || this; - } - return CMIAttemptRecords; -}(CMIArray)); +/***/ }), -var CMIAttemptRecordsObject = (function (_super) { - __extends(CMIAttemptRecordsObject, _super); - function CMIAttemptRecordsObject() { - var _this = _super.call(this) || this; - _this._lesson_status = ""; - _this.score = new CMIScore({ - score_children: api_constants.aicc.score_children, - score_range: regex.aicc.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: AICCValidationError, - }); - return _this; - } - CMIAttemptRecordsObject.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(CMIAttemptRecordsObject.prototype, "lesson_status", { - get: function () { - return this._lesson_status; - }, - set: function (lesson_status) { - if (checkAICCValidFormat(lesson_status, regex.aicc.CMIStatus2)) { - this._lesson_status = lesson_status; - } - }, - enumerable: false, - configurable: true - }); - CMIAttemptRecordsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - lesson_status: this.lesson_status, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMIAttemptRecordsObject; -}(BaseCMI)); +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. -;// ./src/cmi/aicc/student_data.ts +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} -var AICCCMIStudentData = (function (_super) { - __extends(AICCCMIStudentData, _super); - function AICCCMIStudentData() { - var _this = _super.call(this, api_constants.aicc.student_data_children) || this; - _this._tries_during_lesson = ""; - _this.tries = new CMITries(); - _this.attempt_records = new CMIAttemptRecords(); - return _this; - } - AICCCMIStudentData.prototype.initialize = function () { - var _a, _b; - _super.prototype.initialize.call(this); - (_a = this.tries) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.attempt_records) === null || _b === void 0 ? void 0 : _b.initialize(); - }; - Object.defineProperty(AICCCMIStudentData.prototype, "tries_during_lesson", { - get: function () { - return this._tries_during_lesson; - }, - set: function (tries_during_lesson) { - if (this.initialized) { - throw new AICCValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._tries_during_lesson = tries_during_lesson; - } - }, - enumerable: false, - configurable: true - }); - AICCCMIStudentData.prototype.toJSON = function () { - this.jsonString = true; - var result = { - mastery_score: this.mastery_score, - max_time_allowed: this.max_time_allowed, - time_limit_action: this.time_limit_action, - tries: this.tries, - attempt_records: this.attempt_records, - }; - delete this.jsonString; - return result; - }; - return AICCCMIStudentData; -}(CMIStudentData)); +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; -;// ./src/cmi/aicc/paths.ts +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} -var CMIPaths = (function (_super) { - __extends(CMIPaths, _super); - function CMIPaths() { - return _super.call(this, { - children: api_constants.aicc.paths_children, - }) || this; - } - return CMIPaths; -}(CMIArray)); +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); -var CMIPathsObject = (function (_super) { - __extends(CMIPathsObject, _super); - function CMIPathsObject() { - var _this = _super.call(this) || this; - _this._location_id = ""; - _this._date = ""; - _this._time = ""; - _this._status = ""; - _this._why_left = ""; - _this._time_in_element = ""; - return _this; - } - Object.defineProperty(CMIPathsObject.prototype, "location_id", { - get: function () { - return this._location_id; - }, - set: function (location_id) { - if (checkAICCValidFormat(location_id, regex.aicc.CMIString256)) { - this._location_id = location_id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "date", { - get: function () { - return this._date; - }, - set: function (date) { - if (checkAICCValidFormat(date, regex.aicc.CMIString256)) { - this._date = date; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "time", { - get: function () { - return this._time; - }, - set: function (time) { - if (checkAICCValidFormat(time, regex.aicc.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "status", { - get: function () { - return this._status; - }, - set: function (status) { - if (checkAICCValidFormat(status, regex.aicc.CMIStatus2)) { - this._status = status; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "why_left", { - get: function () { - return this._why_left; - }, - set: function (why_left) { - if (checkAICCValidFormat(why_left, regex.aicc.CMIString256)) { - this._why_left = why_left; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIPathsObject.prototype, "time_in_element", { - get: function () { - return this._time_in_element; - }, - set: function (time_in_element) { - if (checkAICCValidFormat(time_in_element, regex.aicc.CMITime)) { - this._time_in_element = time_in_element; - } - }, - enumerable: false, - configurable: true - }); - CMIPathsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - location_id: this.location_id, - date: this.date, - time: this.time, - status: this.status, - why_left: this.why_left, - time_in_element: this.time_in_element, - }; - delete this.jsonString; - return result; - }; - return CMIPathsObject; -}(BaseCMI)); +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} -;// ./src/cmi/aicc/cmi.ts +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} -var aicc_cmi_CMI = (function (_super) { - __extends(CMI, _super); - function CMI(initialized) { - if (initialized === void 0) { initialized = false; } - var _this = _super.call(this, api_constants.aicc.cmi_children) || this; - if (initialized) - _this.initialize(); - _this.student_preference = new AICCStudentPreferences(); - _this.student_data = new AICCCMIStudentData(); - _this.student_demographics = new CMIStudentDemographics(); - _this.evaluation = new CMIEvaluation(); - _this.paths = new CMIPaths(); - return _this; - } - CMI.prototype.initialize = function () { - var _a, _b, _c, _d, _e; - _super.prototype.initialize.call(this); - (_a = this.student_preference) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.student_data) === null || _b === void 0 ? void 0 : _b.initialize(); - (_c = this.student_demographics) === null || _c === void 0 ? void 0 : _c.initialize(); - (_d = this.evaluation) === null || _d === void 0 ? void 0 : _d.initialize(); - (_e = this.paths) === null || _e === void 0 ? void 0 : _e.initialize(); - }; - CMI.prototype.toJSON = function () { - this.jsonString = true; - var result = { - suspend_data: this.suspend_data, - launch_data: this.launch_data, - comments: this.comments, - comments_from_lms: this.comments_from_lms, - core: this.core, - objectives: this.objectives, - student_data: this.student_data, - student_preference: this.student_preference, - student_demographics: this.student_demographics, - interactions: this.interactions, - evaluation: this.evaluation, - paths: this.paths, - }; - delete this.jsonString; - return result; - }; - return CMI; -}(cmi_CMI)); +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; -;// ./src/AICC.ts +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); -var AICC = (function (_super) { - __extends(AICC, _super); - function AICC(settings) { - var _this = _super.call(this, settings) || this; - _this.cmi = new aicc_cmi_CMI(); - _this.nav = new NAV(); - return _this; - } - AICC.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { - var newChild = _super.prototype.getChildElement.call(this, CMIElement, value, foundFirstIndex); - if (!newChild) { - if (stringMatches(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) { - newChild = new CMIEvaluationCommentsObject(); - } - else if (stringMatches(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")) { - newChild = new CMITriesObject(); - } - else if (stringMatches(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")) { - newChild = new CMIAttemptRecordsObject(); - } - else if (stringMatches(CMIElement, "cmi\\.paths\\.\\d+")) { - newChild = new CMIPathsObject(); - } - } - return newChild; - }; - AICC.prototype.replaceWithAnotherScormAPI = function (newAPI) { - this.cmi = newAPI.cmi; - this.nav = newAPI.nav; - }; - return AICC; -}(src_Scorm12API)); -/* harmony default export */ var src_AICC = (AICC); -;// ./src/exports/scorm-again.js +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AICC: function() { return /* reexport safe */ _AICC__WEBPACK_IMPORTED_MODULE_0__["default"]; }, +/* harmony export */ Scorm12API: function() { return /* reexport safe */ _Scorm12API__WEBPACK_IMPORTED_MODULE_1__["default"]; }, +/* harmony export */ Scorm2004API: function() { return /* reexport safe */ _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__["default"]; } +/* harmony export */ }); +/* harmony import */ var _AICC__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(531); +/* harmony import */ var _Scorm12API__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(941); +/* harmony import */ var _Scorm2004API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(180); -window.Scorm12API = src_Scorm12API; -window.Scorm2004API = src_Scorm2004API; -window.AICC = src_AICC; /******/ return __webpack_exports__; /******/ })() diff --git a/dist/scorm-again.js.map b/dist/scorm-again.js.map index df36e2e..ba77c2d 100644 --- a/dist/scorm-again.js.map +++ b/dist/scorm-again.js.map @@ -1 +1 @@ -{"version":3,"file":"scorm-again.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,gBAAgB,sCAAsC,kBAAkB;AACjF,wBAAwB;AACxB;AACA;;AAEO;AACP;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEO;AACP;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;;AAEO;AACP,kCAAkC;AAClC;;AAEO;AACP,uBAAuB,uFAAuF;AAC9G;AACA;AACA,yGAAyG;AACzG;AACA,sCAAsC,QAAQ;AAC9C;AACA,gEAAgE;AAChE;AACA,8CAA8C,yFAAyF;AACvI,8DAA8D,2CAA2C;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,4CAA4C,yEAAyE;AACrH;;AAEO;AACP;AACA;;AAEO;AACP,0BAA0B,+DAA+D,iBAAiB;AAC1G;AACA,kCAAkC,MAAM,+BAA+B,YAAY;AACnF,iCAAiC,MAAM,mCAAmC,YAAY;AACtF,8BAA8B;AAC9B;AACA,GAAG;AACH;;AAEO;AACP,YAAY,6BAA6B,0BAA0B,cAA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AAc;AAC9M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;ACtXF;IAAA;QACE,eAAU,GAAI,KAAK,CAAC;QACZ,iBAAY,GAAG,KAAK,CAAC;IAiC/B,CAAC;IA1BC,sBAAI,gCAAW;aAAf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAMD,sBAAI,+BAAU;aAAd;YACE,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;;;OAAA;IAKD,4BAAU,GAAV;QACE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAMD,8BAAY,GAAZ;QACE,IAAI,CAAC,WAAW,GAAG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,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;I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uBAAuB,EAAE,CAAC;YAC3C,CAAC;iBAAM,IAAI,aAAa,CAAC,UAAU,EAAE,oBAAoB,CAAC,EAAE,CAAC;gBAC3D,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAOD,yCAA0B,GAA1B,UAA2B,MAAY;QAErC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACxB,CAAC;IACH,WAAC;AAAD,CAAC,CAxDiC,cAAU,GAwD3C;;;;ACvE6C;AACJ;AACZ;;AAE9B,oBAAoB,cAAU;AAC9B,sBAAsB,gBAAY;AAClC,cAAc,QAAI","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts","webpack://scorm-again/./src/exports/scorm-again.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n","import Scorm2004API from \"../Scorm2004API.ts\";\nimport Scorm12API from \"../Scorm12API.ts\";\nimport AICC from \"../AICC.ts\";\n\nwindow.Scorm12API = Scorm12API;\nwindow.Scorm2004API = Scorm2004API;\nwindow.AICC = AICC;\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"scorm-again.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVwD;AACD;AACF;AACrD,IAAM,gBAAgB,GAAG,0BAAU,CAAC,OAAO,CAAC;AASrC,SAAS,oBAAoB,CAClC,KAAa,EACb,YAAoB,EACpB,gBAA0B;IAE1B,OAAO,sCAAgB,CACrB,KAAK,EACL,YAAY,EACZ,gBAAgB,CAAC,aAAa,EAC9B,sCAAmB,EACnB,gBAAgB,CACjB,CAAC;AACJ,CAAC;;;;;;ACxB0C;AACY;AACV;AACY;AACJ;AACD;AACV;AAK1C;IAAmC,uDAAO;IAIxC;QACE,kBAAK,WAAE,SAAC;QACR,KAAI,CAAC,QAAQ,GAAG,IAAI,qBAAqB,EAAE,CAAC;;IAC9C,CAAC;IAOD,kCAAU,GAAV;;QACE,gBAAK,CAAC,UAAU,WAAE,CAAC;QACnB,UAAI,CAAC,QAAQ,0CAAE,UAAU,EAAE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,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;I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AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;UCzXF;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;ACN0B;AACY;AACI;AAEA","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./src/ScormAgain.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import AICC from \"./AICC\";\nimport Scorm12API from \"./Scorm12API\";\nimport Scorm2004API from \"./Scorm2004API\";\n\nexport { AICC, Scorm12API, Scorm2004API };\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/scorm-again.min.js b/dist/scorm-again.min.js index 1fd02c8..5199e4d 100644 --- a/dist/scorm-again.min.js +++ b/dist/scorm-again.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},e(t,i)};function t(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,i=1,r=arguments.length;i0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&(s="."+(s=T(o)>2?o.toFixed(2):String(o)).split(".")[1]),(t+":"+r+":"+n).replace(/\b\d\b/g,"0$&")+s}function v(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in I){var n=I[r],o=Math.floor(i/n);T(i%=n)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(o+=i),o&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(o).concat(r))}return t}function O(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function C(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function w(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=i(i({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return r(this,void 0,void 0,(function(){var i,r;return n(this,(function(n){switch(n.label){case 0:return i=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=u.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:u.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=u.global.SCORM_TRUE,this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,u.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=u.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=u.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,u.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return r(this,arguments,void 0,(function(e,t){var i,r;return void 0===t&&(t=!1),n(this,(function(n){switch(n.label){case 0:return this.clearScheduledCommit(),i=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(r=n.sent()).errorCode&&r.errorCode>0&&this.throwSCORMError(r.errorCode),i=void 0!==r&&r.result?r.result:u.global.SCORM_FALSE,this.apiLog(e," Result: "+i,u.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,u.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,u.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,n){if(!r||""===r)return u.global.SCORM_FALSE;for(var o=r.split("."),s=this,a=u.global.SCORM_FALSE,c=!1,l="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,_=0;_1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),u.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),u.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,i={};for(var r in e)if({}.hasOwnProperty.call(e,r)){for(var n=i,o="",s=t.exec(r);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(r);n[o]=e[r]}return i[""]||i}(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===u.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),j=A,D={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},P={aicc:i(i({},D),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:D,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};function x(e,t,i,r,n){if("string"!=typeof e)return!1;var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new r(i);return!0}function z(e,t,i,r){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}function V(e,t,i){return x(e,t,c.scorm2004.TYPE_MISMATCH,E,i)}function F(e,t){return z(e,t,c.scorm2004.VALUE_OUT_OF_RANGE,E)}var G,k,U,Y=function(e){function i(){var t=e.call(this)||this;return t.__children=u.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new E(c.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){V(e,P.scorm2004.CMIDecimal)&&F(e,P.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){V(e,P.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){V(e,P.scorm2004.CMIDecimal)&&F(e,P.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){V(e,P.scorm2004.CMISInteger)&&F(e,P.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},i}(o),q=P.scorm2004,H={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:q.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:q.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:q.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:q.CMIShortIdentifier,format2:q.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+q.CMIShortIdentifier,format2:q.CMIDecimal+"|^$|"+q.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:q.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:q.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:q.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:q.CMIString4000,max:1,delimiter:"",unique:!1}},$={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:q.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:q.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:q.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:q.CMIShortIdentifier,format2:q.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+q.CMIShortIdentifier,format2:q.CMIDecimal+"|^$|"+q.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:q.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:q.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:q.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:q.CMIString4000,limit:1}},B=function(e){function i(){return e.call(this,{children:u.scorm2004.interactions_children,errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E})||this}return t(i,e),i}(y),J=function(e){function i(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new y({errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E,children:u.scorm2004.objectives_children}),t.correct_responses=new y({errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:E,children:u.scorm2004.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){V(e,P.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);V(e,P.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new E(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=H[this.type];if(!i)throw new E(c.scorm2004.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new E(c.scorm2004.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n2&&(s=o[2],i=o[1].replace(s,"")),(a=t[i])&&this.processListeners(a,"adl.nav.request",s)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},i.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if(L(e,t)){var i=e.match(t),r=i[1],n=i[2].replace("{target=","").replace("}","");if("choice"===r||"jump"===r)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},i.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},i.prototype.lmsCommit=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},i.prototype.getChildElement=function(e,t,i){if(L(e,"cmi\\.objectives\\.\\d+"))return new se;if(i){if(L(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if(L(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new Z}else if(L(e,"cmi\\.interactions\\.\\d+"))return new J;return L(e,"cmi\\.comments_from_learner\\.\\d+")?new ne:L(e,"cmi\\.comments_from_lms\\.\\d+")?new ne(!0):null},i.prototype.createCorrectResponsesObject=function(e,t){var i=e.split("."),r=Number(i[2]),n=this.cmi.interactions.childArray[r];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=$[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new W:null},i.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},i.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r1)Number(t[0])>Number(t[1])&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var l=0;l0&&(ce.includes(a.toLowerCase())||this.throwSCORMError(c.scorm2004.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=w(t);switch(this.settings.dataCommitFormat){case"flattened":return w(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=C(this.cmi.getCurrentTotalTime(),P.scorm2004.CMITimespan),r=U.unknown,n=k.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?r=U.completed:"incomplete"===this.cmi.completion_status&&(r=U.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?n=k.passed:"failed"===this.cmi.success_status&&(n=k.failed));var o=this.cmi.score,s=null;o&&(s={},Number.isNaN(Number.parseFloat(o.raw))||(s.raw=Number.parseFloat(o.raw)),Number.isNaN(Number.parseFloat(o.min))||(s.min=Number.parseFloat(o.min)),Number.isNaN(Number.parseFloat(o.max))||(s.max=Number.parseFloat(o.max)),Number.isNaN(Number.parseFloat(o.scaled))||(s.scaled=Number.parseFloat(o.scaled)));var a={completionStatus:r,successStatus:n,totalTimeSeconds:i,runtimeData:t};return s&&(a.score=s),a},i.prototype.storeData=function(e){return r(this,void 0,void 0,(function(){var t,i,r,o,s,a,c;return n(this,(function(n){switch(n.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(c=null===(a=null===(s=this.startingData)||void 0===s?void 0:s.adl)||void 0===a?void 0:a.nav)||void 0===c?void 0:c.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),i=e||this.settings.alwaysSendTotalTime,r=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===u.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(r)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,r,e)];case 1:return o=n.sent(),t&&void 0!==o.navRequest&&""!==o.navRequest&&Function('"use strict";(() => { '.concat(o.navRequest," })()"))(),[2,o];case 2:return[2,{result:u.global.SCORM_TRUE,errorCode:0}]}}))}))},i}(j);function me(e,t,i){return x(e,t,c.scorm12.TYPE_MISMATCH,f,i)}function de(e,t,i){if(!i&&""===e)throw new f(c.scorm12.VALUE_OUT_OF_RANGE);return z(e,t,c.scorm12.VALUE_OUT_OF_RANGE,f)}var pe=function(e){function i(){var t=e.call(this)||this;return t.__children=u.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new ee({score_children:u.scorm12.score_children,score_range:P.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){me(e,P.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?me(e,P.scorm12.CMIStatus)&&(this._lesson_status=e):me(e,P.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"exit",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){me(e,P.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"session_time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){me(e,P.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){me(e,P.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(e){var t,i,r,n=this._session_time,o=e;null!=o&&(n=S(((new Date).getTime()-o)/1e3));return t=this._total_time,i=n,"string"==typeof(r=new RegExp(P.scorm12.CMITimespan))&&(r=new RegExp(r)),S(O(t,r)+O(i,r))},i.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},i}(o),fe=function(e){function i(){return e.call(this,{children:u.scorm12.objectives_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(i,e),i}(y),ge=function(e){function i(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new ee({score_children:u.scorm12.score_children,score_range:P.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){me(e,P.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){me(e,P.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},i}(o),Ee=function(e){function i(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||u.scorm12.student_data_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},i}(o),be=function(e){function i(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||u.scorm12.student_preference_children,i}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"audio",{get:function(){return this._audio},set:function(e){me(e,P.scorm12.CMISInteger)&&de(e,P.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"language",{get:function(){return this._language},set:function(e){me(e,P.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"speed",{get:function(){return this._speed},set:function(e){me(e,P.scorm12.CMISInteger)&&de(e,P.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this._text},set:function(e){me(e,P.scorm12.CMISInteger)&&de(e,P.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},i}(o),ye=function(e){function i(){return e.call(this,{children:u.scorm12.interactions_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(i,e),i}(y),Me=function(e){function i(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new y({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.objectives_children}),t.correct_responses=new y({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.correct_responses_children}),t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"id",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){me(e,P.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){me(e,P.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"type",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){me(e,P.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"weighting",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){me(e,P.scorm12.CMIDecimal)&&de(e,P.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"student_response",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){me(e,P.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"result",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){me(e,P.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"latency",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){me(e,P.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},i}(o),Ie=function(e){function i(){var t=e.call(this)||this;return t._id="",t}return t(i,e),Object.defineProperty(i.prototype,"id",{get:function(){return this._id},set:function(e){me(e,P.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},i}(o),Se=function(e){function i(){var t=e.call(this)||this;return t._pattern="",t}return t(i,e),Object.defineProperty(i.prototype,"pattern",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){me(e,P.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},i}(o),ve=function(e){function i(t,i,r){var n=e.call(this)||this;return n.__children="",n.__version="3.4",n._launch_data="",n._comments="",n._comments_from_lms="",r&&n.initialize(),n.__children=t||u.scorm12.cmi_children,n.core=new pe,n.objectives=new fe,n.student_data=i||new Ee,n.student_preference=new be,n.interactions=new ye,n}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(i.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments",{get:function(){return this._comments},set:function(e){me(e,P.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),i.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},i}(s),Oe=function(e){function i(){var t=e.call(this)||this;return t._event="",t}return t(i,e),Object.defineProperty(i.prototype,"event",{get:function(){return this._event},set:function(e){me(e,P.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},i}(o),Ce=function(e){function i(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,c.scorm12,t)||this).statusSetByModule=!1,i.cmi=new ve,i.nav=new Oe,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return t(i,e),i.prototype.reset=function(e){this.commonReset(e),this.cmi=new ve,this.nav=new Oe},i.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},i.prototype.lmsFinish=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.internalFinish=function(){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===u.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},i.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},i.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},i.prototype.lmsCommit=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},i.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},i.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},i.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},i.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},i.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},i.prototype.getChildElement=function(e,t,i){return L(e,"cmi\\.objectives\\.\\d+")?new ge:i&&L(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new Se:i&&L(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new Ie:!i&&L(e,"cmi\\.interactions\\.\\d+")?new Me:null},i.prototype.validateCorrectResponse=function(e,t){},i.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),u.scorm12.error_descriptions[e]&&(i=u.scorm12.error_descriptions[e].basicMessage,r=u.scorm12.error_descriptions[e].detailMessage),t?r:i},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},i.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=w(t);switch(this.settings.dataCommitFormat){case"flattened":return w(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},i.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=O(this.cmi.getCurrentTotalTime(),P.scorm12.CMITimespan),r=this.cmi.core.lesson_status,n=U.unknown,o=k.unknown;r&&(n="completed"===r||"passed"===r?U.completed:U.incomplete,"passed"===r?o=k.passed:"failed"===r&&(o=k.failed));var s=this.cmi.core.score,a=null;s&&(a={},Number.isNaN(Number.parseFloat(s.raw))||(a.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(a.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(a.max=Number.parseFloat(s.max)));var c={successStatus:o,completionStatus:n,runtimeData:t,totalTimeSeconds:i};return a&&(c.score=a),c},i.prototype.storeData=function(e){return r(this,void 0,void 0,(function(){var t,i,r,o,s,a;return n(this,(function(n){switch(n.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(a=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===a?void 0:a.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,r=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===u.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(r)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,r,e)];case 1:return[2,n.sent()];case 2:return[2,{result:u.global.SCORM_TRUE,errorCode:0}]}}))}))},i}(j),we=c.scorm12;function Te(e,t,i){return x(e,t,we.TYPE_MISMATCH,g,i)}var Le=function(e){function i(){var t=e.call(this)||this;return t.comments=new Ne,t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},i}(o),Ne=function(e){function i(){return e.call(this,{children:u.aicc.comments_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:g})||this}return t(i,e),i}(y),Re=function(e){function i(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return t(i,e),Object.defineProperty(i.prototype,"content",{get:function(){return this._content},set:function(e){Te(e,P.aicc.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return this._location},set:function(e){Te(e,P.aicc.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Te(e,P.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},i}(o),Ae=function(e){function i(){var t=e.call(this,u.aicc.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new y({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:g,children:""}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){Te(e,P.aicc.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_color",{get:function(){return this._text_color},set:function(e){Te(e,P.aicc.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_location",{get:function(){return this._text_location},set:function(e){Te(e,P.aicc.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"text_size",{get:function(){return this._text_size},set:function(e){Te(e,P.aicc.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"video",{get:function(){return this._video},set:function(e){Te(e,P.aicc.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},i}(be),je=function(e){function i(){var t=e.call(this)||this;return t.__children=u.aicc.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return t(i,e),Object.defineProperty(i.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},i}(o),De=function(e){function i(){return e.call(this,{children:u.aicc.tries_children})||this}return t(i,e),i}(y),Pe=function(e){function i(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new ee({score_children:u.aicc.score_children,score_range:P.aicc.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:g}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Te(e,P.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Te(e,P.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},i}(o),xe=function(e){function i(){return e.call(this,{children:u.aicc.attempt_records_children})||this}return t(i,e),i}(y),ze=function(e){function i(){var t=e.call(this)||this;return t._lesson_status="",t.score=new ee({score_children:u.aicc.score_children,score_range:P.aicc.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:g}),t}return t(i,e),i.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(i.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){Te(e,P.aicc.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},i}(o),Ve=function(e){function i(){var t=e.call(this,u.aicc.student_data_children)||this;return t._tries_during_lesson="",t.tries=new De,t.attempt_records=new xe,t}return t(i,e),i.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize(),null===(i=this.attempt_records)||void 0===i||i.initialize()},Object.defineProperty(i.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new g(c.scorm12.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries,attempt_records:this.attempt_records};return delete this.jsonString,e},i}(Ee),Fe=function(e){function i(){return e.call(this,{children:u.aicc.paths_children})||this}return t(i,e),i}(y),Ge=function(e){function i(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}return t(i,e),Object.defineProperty(i.prototype,"location_id",{get:function(){return this._location_id},set:function(e){Te(e,P.aicc.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"date",{get:function(){return this._date},set:function(e){Te(e,P.aicc.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time",{get:function(){return this._time},set:function(e){Te(e,P.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},set:function(e){Te(e,P.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"why_left",{get:function(){return this._why_left},set:function(e){Te(e,P.aicc.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){Te(e,P.aicc.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),i.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e},i}(o),ke=function(e){function i(t){void 0===t&&(t=!1);var i=e.call(this,u.aicc.cmi_children)||this;return t&&i.initialize(),i.student_preference=new Ae,i.student_data=new Ve,i.student_demographics=new je,i.evaluation=new Le,i.paths=new Fe,i}return t(i,e),i.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},i.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},i}(ve),Ue=function(e){function i(t){var i=e.call(this,t)||this;return i.cmi=new ke,i.nav=new Oe,i}return t(i,e),i.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||(L(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new Re:L(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new Pe:L(t,"cmi\\.student_data\\.attempt_records\\.\\d+")?n=new ze:L(t,"cmi\\.paths\\.\\d+")&&(n=new Ge)),n},i.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},i}(Ce);return window.Scorm12API=Ce,window.Scorm2004API=_e,window.AICC=Ue,{}}()})); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e={531:function(e,t,i){i.d(t,{default:function(){return R}});var r=i(635),n=i(941),o=i(989),s=i(340),a=i(589),c=i(784),l=i(319),u=i(797),h=i(449),_=u.A.scorm12;function m(e,t,i){return(0,h.q)(e,t,_.TYPE_MISMATCH,c.gv,i)}var d=i(417),p=function(e){function t(){var t=e.call(this)||this;return t.comments=new f,t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.comments)||void 0===t||t.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={comments:this.comments};return delete this.jsonString,e},t}(l.J),f=function(e){function t(){return e.call(this,{children:s.A.aicc.comments_children,errorCode:u.A.scorm12.INVALID_SET_VALUE,errorClass:c.gv})||this}return(0,r.C6)(t,e),t}(a.B),g=function(e){function t(){var t=e.call(this)||this;return t._content="",t._location="",t._time="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._content=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"location",{get:function(){return this._location},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={content:this.content,location:this.location,time:this.time};return delete this.jsonString,e},t}(l.J),E=function(e){function t(){var t=e.call(this,s.A.aicc.student_preference_children)||this;return t._lesson_type="",t._text_color="",t._text_location="",t._text_size="",t._video="",t.windows=new a.B({errorCode:u.A.scorm12.INVALID_SET_VALUE,errorClass:c.gv,children:""}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.windows)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_type",{get:function(){return this._lesson_type},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._lesson_type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_color",{get:function(){return this._text_color},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_color=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_location",{get:function(){return this._text_location},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text_size",{get:function(){return this._text_size},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._text_size=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"video",{get:function(){return this._video},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._video=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,lesson_type:this.lesson_type,speed:this.speed,text:this.text,text_color:this.text_color,text_location:this.text_location,text_size:this.text_size,video:this.video,windows:this.windows};return delete this.jsonString,e},t}(i(181).G),b=function(e){function t(){var t=e.call(this)||this;return t.__children=s.A.aicc.student_demographics_children,t._city="",t._class="",t._company="",t._country="",t._experience="",t._familiar_name="",t._instructor_name="",t._title="",t._native_language="",t._state="",t._street_address="",t._telephone="",t._years_experience="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"city",{get:function(){return this._city},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._city=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"class",{get:function(){return this._class},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._class=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"company",{get:function(){return this._company},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._company=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"country",{get:function(){return this._country},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._country=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"experience",{get:function(){return this._experience},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._experience=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"familiar_name",{get:function(){return this._familiar_name},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._familiar_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instructor_name",{get:function(){return this._instructor_name},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._instructor_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._title},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"native_language",{get:function(){return this._native_language},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._native_language=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._state=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"street_address",{get:function(){return this._street_address},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._street_address=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"telephone",{get:function(){return this._telephone},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._telephone=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"years_experience",{get:function(){return this._years_experience},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._years_experience=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={city:this.city,class:this.class,company:this.company,country:this.country,experience:this.experience,familiar_name:this.familiar_name,instructor_name:this.instructor_name,title:this.title,native_language:this.native_language,state:this.state,street_address:this.street_address,telephone:this.telephone,years_experience:this.years_experience};return delete this.jsonString,e},t}(l.J),y=i(434),A=function(e){function t(){return e.call(this,{children:s.A.aicc.tries_children})||this}return(0,r.C6)(t,e),t}(a.B),M=function(e){function t(){var t=e.call(this)||this;return t._status="",t._time="",t.score=new y._({score_children:s.A.aicc.score_children,score_range:d.A.aicc.score_range,invalidErrorCode:u.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.A.scorm12.TYPE_MISMATCH,invalidRangeCode:u.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:c.gv}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={status:this.status,time:this.time,score:this.score};return delete this.jsonString,e},t}(l.J),v=i(532),C=function(e){function t(){return e.call(this,{children:s.A.aicc.attempt_records_children})||this}return(0,r.C6)(t,e),t}(a.B),S=function(e){function t(){var t=e.call(this)||this;return t._lesson_status="",t.score=new y._({score_children:s.A.aicc.score_children,score_range:d.A.aicc.score_range,invalidErrorCode:u.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:u.A.scorm12.TYPE_MISMATCH,invalidRangeCode:u.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:c.gv}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={lesson_status:this.lesson_status,score:this.score};return delete this.jsonString,e},t}(l.J),I=function(e){function t(){var t=e.call(this,s.A.aicc.student_data_children)||this;return t._tries_during_lesson="",t.tries=new A,t.attempt_records=new C,t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.tries)||void 0===t||t.initialize(),null===(i=this.attempt_records)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"tries_during_lesson",{get:function(){return this._tries_during_lesson},set:function(e){if(this.initialized)throw new c.gv(u.A.scorm12.READ_ONLY_ELEMENT);this._tries_during_lesson=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action,tries:this.tries,attempt_records:this.attempt_records};return delete this.jsonString,e},t}(v.X),w=function(e){function t(){return e.call(this,{children:s.A.aicc.paths_children})||this}return(0,r.C6)(t,e),t}(a.B),O=function(e){function t(){var t=e.call(this)||this;return t._location_id="",t._date="",t._time="",t._status="",t._why_left="",t._time_in_element="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"location_id",{get:function(){return this._location_id},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._location_id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"date",{get:function(){return this._date},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._date=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this._time},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){m(e,d.A.aicc.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"why_left",{get:function(){return this._why_left},set:function(e){m(e,d.A.aicc.CMIString256)&&(this._why_left=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_in_element",{get:function(){return this._time_in_element},set:function(e){m(e,d.A.aicc.CMITime)&&(this._time_in_element=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={location_id:this.location_id,date:this.date,time:this.time,status:this.status,why_left:this.why_left,time_in_element:this.time_in_element};return delete this.jsonString,e},t}(l.J),T=function(e){function t(t){void 0===t&&(t=!1);var i=e.call(this,s.A.aicc.cmi_children)||this;return t&&i.initialize(),i.student_preference=new E,i.student_data=new I,i.student_demographics=new b,i.evaluation=new p,i.paths=new w,i}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.student_preference)||void 0===t||t.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(r=this.student_demographics)||void 0===r||r.initialize(),null===(n=this.evaluation)||void 0===n||n.initialize(),null===(o=this.paths)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,student_demographics:this.student_demographics,interactions:this.interactions,evaluation:this.evaluation,paths:this.paths};return delete this.jsonString,e},t}(o.Y),L=i(331),N=i(864),R=function(e){function t(t){var i=e.call(this,t)||this;return i.cmi=new T,i.nav=new L.A,i}return(0,r.C6)(t,e),t.prototype.getChildElement=function(t,i,r){var n=e.prototype.getChildElement.call(this,t,i,r);return n||((0,N.J6)(t,"cmi\\.evaluation\\.comments\\.\\d+")?n=new g:(0,N.J6)(t,"cmi\\.student_data\\.tries\\.\\d+")?n=new M:(0,N.J6)(t,"cmi\\.student_data\\.attempt_records\\.\\d+")?n=new S:(0,N.J6)(t,"cmi\\.paths\\.\\d+")&&(n=new O)),n},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.nav=e.nav},t}(n.default)},900:function(e,t,i){i.d(t,{A:function(){return _}});var r=i(635),n=i(589),o=i(784),s=i(797),a=i(340),c=i(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return void 0===e?[3,2]:(n=(i=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(i,[r.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,i){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=i}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),h=function(){function e(t,i){var r=this.constructor;if(this._settings=l,r===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,i&&(this.settings=i),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,r.Cl)((0,r.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,i){var r=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,i):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",r=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),r},e.prototype.apiLog=function(e,t,i,r){t=(0,c.hw)(e,t,r),i>=this.apiLogLevel&&this.settings.onLogMessage(i,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,r.Cl)((0,r.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,r.sH)(this,void 0,void 0,(function(){var i,n;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),i=a.A.global.SCORM_TRUE,this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getValue=function(e,t,i){var r="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{r=this.getCMIValue(i)}catch(e){r=this.handleValueAccessException(e,r)}this.processListeners(e,i)}return this.apiLog(e,": returned: "+r,a.A.global.LOG_LEVEL_INFO,i),void 0===r?"":(this.clearSCORMError(r),r)},e.prototype.setValue=function(e,t,i,r,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(i,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){i&&(this.lastErrorCode="0");try{o=this.setCMIValue(r,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,r,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,r),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,r.sH)(this,arguments,void 0,(function(e,t){var i,n;return void 0===t&&(t=!1),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this.clearScheduledCommit(),i=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=r.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),i=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+i,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),r.label=2;case 2:return this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),[2,i]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.getDiagnostic=function(e,t){var i="";return null!==t&&""!==t&&(i=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),i},e.prototype.checkState=function(e,t,i){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(i),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,o){if(!i||""===i)return a.A.global.SCORM_FALSE;for(var s=i.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,_="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,d=0;d1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var i=e.split(" "),r=function(r){var o=i[r].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),r.listenerArray=r.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},r=this,n=0;ns?1:0})),s.forEach((function(e){(r={})[e[0]]=e[1],i.loadFromJSON((0,c.sB)(r),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,i){var r,n=e.match(i);if(null!==n&&null!==(r=t.match(i))){var o=Number(n[2]),s=Number(r[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===r[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var i in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,i)&&e[i]){var r=(t?t+".":"")+i,n=e[i];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=h},941:function(e,t,i){var r=i(635),n=i(900),o=i(989),s=i(864),a=i(340),c=i(797),l=i(176),u=i(833),h=i(331),_=i(417),m=i(56),d=function(e){function t(t){var i=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(i=e.call(this,c.A.scorm12,t)||this).statusSetByModule=!1,i.cmi=new o.Y,i.nav=new h.A,i.LMSInitialize=i.lmsInitialize,i.LMSFinish=i.lmsFinish,i.LMSGetValue=i.lmsGetValue,i.LMSSetValue=i.lmsSetValue,i.LMSCommit=i.lmsCommit,i.LMSGetLastError=i.lmsGetLastError,i.LMSGetErrorString=i.lmsGetErrorString,i.LMSGetDiagnostic=i.lmsGetDiagnostic,i}return(0,r.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new o.Y,this.nav=new h.A},t.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},t.prototype.lmsFinish=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),a.A.global.SCORM_TRUE},t.prototype.internalFinish=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===a.A.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},t.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),a.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},t.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},t.prototype.getChildElement=function(e,t,i){return(0,s.J6)(e,"cmi\\.objectives\\.\\d+")?new l.N:i&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new u.cb:i&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new u.Oh:!i&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+")?new u.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var i="No Error",r="No Error";return e=String(e),a.A.scorm12.error_descriptions[e]&&(i=a.A.scorm12.error_descriptions[e].basicMessage,r=a.A.scorm12.error_descriptions[e].detailMessage),t?r:i},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var i=[],r=s.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return s.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=s.f4(i,_.A.scorm12.CMITimespan),n=this.cmi.core.lesson_status,o=m.lC.unknown,a=m.YE.unknown;n&&(o="completed"===n||"passed"===n?m.lC.completed:m.lC.incomplete,"passed"===n?a=m.YE.passed:"failed"===n&&(a=m.YE.failed));var c=this.cmi.core.score,l=null;c&&(l={},Number.isNaN(Number.parseFloat(c.raw))||(l.raw=Number.parseFloat(c.raw)),Number.isNaN(Number.parseFloat(c.min))||(l.min=Number.parseFloat(c.min)),Number.isNaN(Number.parseFloat(c.max))||(l.max=Number.parseFloat(c.max)));var u={successStatus:a,completionStatus:o,runtimeData:t,totalTimeSeconds:r};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,o,s,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(c=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===c?void 0:c.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===a.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return[2,r.sent()];case 2:return[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(n.A);t.default=d},180:function(e,t,i){i.d(t,{default:function(){return x}});var r=i(635),n=i(900),o=i(340),s=i(417),a=i(797),c=i(784),l=i(864),u=i(319),h=i(449);function _(e,t,i){return(0,h.q)(e,t,a.A.scorm2004.TYPE_MISMATCH,c.wq,i)}function m(e,t){return(0,h.W)(e,t,a.A.scorm2004.VALUE_OUT_OF_RANGE,c.wq)}var d=function(e){function t(){var t=e.call(this)||this;return t.__children=o.A.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new c.wq(a.A.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){_(e,s.A.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){_(e,s.A.scorm2004.CMIDecimal)&&m(e,s.A.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){_(e,s.A.scorm2004.CMISInteger)&&m(e,s.A.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},t}(u.J),p=i(589),f=s.A.scorm2004,g={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:f.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:f.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:f.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:f.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:f.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:f.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:f.CMIString4000,max:1,delimiter:"",unique:!1}},E={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:f.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:f.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,format2:f.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+f.CMIShortIdentifier,format2:f.CMIDecimal+"|^$|"+f.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:f.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:f.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:f.CMIString4000,limit:1}},b=function(e){function t(){return e.call(this,{children:o.A.scorm2004.interactions_children,errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq})||this}return(0,r.C6)(t,e),t}(p.B),y=function(e){function t(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.objectives_children}),t.correct_responses=new p.B({errorCode:a.A.scorm2004.READ_ONLY_ELEMENT,errorClass:c.wq,children:o.A.scorm2004.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){_(e,s.A.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);_(e,s.A.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new c.wq(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],i=g[this.type];if(!i)throw new c.wq(a.A.scorm2004.TYPE_MISMATCH);if((null==i?void 0:i.delimiter)?t=e.split(i.delimiter):t[0]=e,!(t.length>0&&t.length<=i.max))throw new c.wq(a.A.scorm2004.GENERAL_SET_FAILURE);for(var r=new RegExp(i.format),n=0;n2&&(c=a[2],i=a[1].replace(c,"")),(l=t[i])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,l.J6)(e,t)){var i=e.match(t),r=i[1],n=i[2].replace("{target=","").replace("}","");if("choice"===r||"jump"===r)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,r.sH)(e,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),o.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,i){if((0,l.J6)(e,"cmi\\.objectives\\.\\d+"))return new O;if(i){if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,l.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new A}else if((0,l.J6)(e,"cmi\\.interactions\\.\\d+"))return new y;return(0,l.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new I:(0,l.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new I(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var i=e.split("."),r=Number(i[2]),n=this.cmi.interactions.childArray[r];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=E[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(a.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new M:null},t.prototype.checkValidResponseType=function(e,t,i){var r=[];(null==e?void 0:e.delimiter)?r=String(t).split(e.delimiter):r[0]=t,r.length>0&&r.length<=e.max?this.checkCorrectResponseValue(i,r,t):r.length>e.max&&this.throwSCORMError(a.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var i=e.correct_responses._count;if("choice"===e.type)for(var r=0;r1)Number(t[0])>Number(t[1])&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&r.unique)for(var l=0;l0&&(L.includes(l.toLowerCase())||this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH))}r=!0;break;case"case_matters":r||t||i||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),i=!0;break;case"order_matters":i||r||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(a.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var i=[],r=l.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return l.Bq(t);case"params":for(var n in r)({}).hasOwnProperty.call(r,n)&&i.push("".concat(n,"=").concat(r[n]));return i;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),i=this.cmi.getCurrentTotalTime(),r=l.OI(i,s.A.scorm2004.CMITimespan),n=N.lC.unknown,o=N.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=N.lC.completed:"incomplete"===this.cmi.completion_status&&(n=N.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=N.YE.passed:"failed"===this.cmi.success_status&&(o=N.YE.failed));var a=this.cmi.score,c=null;a&&(c={},Number.isNaN(Number.parseFloat(a.raw))||(c.raw=Number.parseFloat(a.raw)),Number.isNaN(Number.parseFloat(a.min))||(c.min=Number.parseFloat(a.min)),Number.isNaN(Number.parseFloat(a.max))||(c.max=Number.parseFloat(a.max)),Number.isNaN(Number.parseFloat(a.scaled))||(c.scaled=Number.parseFloat(a.scaled)));var u={completionStatus:n,successStatus:o,totalTimeSeconds:r,runtimeData:t};return c&&(u.score=c),u},t.prototype.storeData=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,i,n,s,a,c,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),i=e||this.settings.alwaysSendTotalTime,n=this.settings.renderCommonCommitFields?this.renderCommitObject(i):this.renderCommitCMI(i),this.apiLogLevel===o.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(n)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,n,e)];case 1:return s=r.sent(),t&&void 0!==s.navRequest&&""!==s.navRequest&&Function('"use strict";(() => { '.concat(s.navRequest," })()"))(),[2,s];case 2:return[2,{result:o.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(n.A),x=P},589:function(e,t,i){i.d(t,{B:function(){return c}});var r=i(635),n=i(319),o=i(797),s=i(784),a=o.A.scorm12,c=function(e){function t(t){var i=e.call(this)||this;return i.__children=t.children,i._errorCode=t.errorCode||a.GENERAL,i._errorClass=t.errorClass||s.$h,i.childArray=[],i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new r(i)}throw new r(i)}i.d(t,{W:function(){return n},q:function(){return r}})},989:function(e,t,i){i.d(t,{Y:function(){return g}});var r=i(635),n=i(340),o=i(797),s=i(417),a=i(784),c=i(319),l=i(915),u=i(434),h=i(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,i=e;if(null!=i){var r=(new Date).getTime()-i;t=h.UZ(r/1e3)}return h.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),m=i(176),d=i(532),p=i(181),f=i(833),g=function(e){function t(t,i,r){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",r&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new m.C,o.student_data=i||new d.X,o.student_preference=new p.G,o.interactions=new f.Xb,o}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i,r,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(i=this.objectives)||void 0===i||i.initialize(),null===(r=this.student_data)||void 0===r||r.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,i){i.d(t,{Oh:function(){return m},WP:function(){return _},Xb:function(){return h},cb:function(){return d}});var r=i(635),n=i(589),o=i(340),s=i(797),a=i(784),c=i(319),l=i(915),u=i(417),h=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,r.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,r.C6)(t,e),t.prototype.initialize=function(){var t,i;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(i=this.correct_responses)||void 0===i||i.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),d=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,i){i.d(t,{A:function(){return a}});var r=i(635),n=i(319),o=i(915),s=i(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,i){i.d(t,{C:function(){return h},N:function(){return _}});var r=i(635),n=i(319),o=i(434),s=i(340),a=i(417),c=i(797),l=i(784),u=i(915),h=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,r.C6)(t,e),t}(i(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,i){i.d(t,{X:function(){return c}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=function(e){function t(t){var i=e.call(this)||this;return i._mastery_score="",i._max_time_allowed="",i._time_limit_action="",i.__children=t||o.A.scorm12.student_data_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,i){i.d(t,{G:function(){return u}});var r=i(635),n=i(319),o=i(340),s=i(784),a=i(797),c=i(915),l=i(417),u=function(e){function t(t){var i=e.call(this)||this;return i._audio="",i._language="",i._speed="",i._text="",i.__children=t||o.A.scorm12.student_preference_children,i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,i){i.d(t,{h:function(){return a},p:function(){return s}});var r=i(449),n=i(797),o=i(784);function s(e,t,i){return(0,r.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,i)}function a(e,t,i){if(!i&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,r.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,i){var r=i(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,r.Cl)((0,r.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,i){var r,n,o;i.d(t,{K$:function(){return r},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(r||(r={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,i){var r=i(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,r.Cl)((0,r.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,r.Cl)((0,r.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,i){var r=i(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,r.Cl)((0,r.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,i){i.d(t,{$h:function(){return c},gv:function(){return h},tQ:function(){return u},wq:function(){return _},yI:function(){return l}});var r=i(635),n=i(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var i=e.call(this,t.toString())||this;return i._errorCode=t,i.name="ScormValidationError",i}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,i,r){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(i),n._errorMessage=i,r&&(n._detailedMessage=r),n}return(0,r.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),h=function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l),_=function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,r.C6)(t,e),t}(l)},864:function(e,t,i){i.d(t,{$o:function(){return l},Bq:function(){return h},HT:function(){return u},J6:function(){return p},OI:function(){return c},UZ:function(){return o},f4:function(){return a},hw:function(){return d},sB:function(){return _},xE:function(){return s}});var r=3600,n={D:24*r,H:r,M:60,S:1};function o(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/r),i=new Date(1e3*e),n=i.getUTCMinutes(),o=i.getSeconds(),s=e%1,a="";return m(s)>0&&(a="."+(a=m(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function s(e){if(!e||e<=0)return"PT0S";var t="P",i=e;for(var r in n){var o=n[r],s=Math.floor(i/o);m(i%=o)>2&&(i=Number(Number(i).toFixed(2))),"S"===r&&i>0&&(s+=i),s&&((t.indexOf("D")>0||"H"===r||"M"===r||"S"===r)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(r))}return t}function a(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=e.split(":");return 3600*Number(i[0])+60*Number(i[1])+Number(i[2])}function c(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var i=new RegExp(t).exec(e)||[],r=i[1],n=(i[2],i[4]),o=i[5],s=i[6],a=i[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(r)||0}function l(e,t,i){var r="string"==typeof i?new RegExp(i):i;return s(c(e,r)+c(t,r))}function u(e,t,i){return"string"==typeof i&&(i=new RegExp(i)),o(a(e,i)+a(t,i))}function h(e){var t={};return function e(i,r){if(Object(i)!==i)t[r]=i;else if(Array.isArray(i))for(var n=0,o=i.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n","import Scorm2004API from \"../Scorm2004API.ts\";\nimport Scorm12API from \"../Scorm12API.ts\";\nimport AICC from \"../AICC.ts\";\n\nwindow.Scorm12API = Scorm12API;\nwindow.Scorm2004API = Scorm2004API;\nwindow.AICC = AICC;\n"],"names":["root","factory","exports","module","define","amd","self","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","v","op","pop","push","SuppressedError","jsonString","_initialized","_start_time","initialize","setStartTime","Date","getTime","BaseCMI","global","GENERAL","INITIALIZATION_FAILED","INITIALIZED","TERMINATED","TERMINATION_FAILURE","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","STORE_BEFORE_INIT","STORE_AFTER_TERM","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","ARGUMENT_ERROR","CHILDREN_ERROR","COUNT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNDEFINED_DATA_MODEL","UNIMPLEMENTED_ELEMENT","VALUE_NOT_INITIALIZED","INVALID_SET_VALUE","READ_ONLY_ELEMENT","WRITE_ONLY_ELEMENT","TYPE_MISMATCH","VALUE_OUT_OF_RANGE","DEPENDENCY_NOT_ESTABLISHED","scorm12","scorm2004","MULTIPLE_TERMINATIONS","cmi_children","core_children","score_children","comments_children","objectives_children","correct_responses_children","student_data_children","student_preference_children","interactions_children","error_descriptions","basicMessage","detailMessage","SCORM_TRUE","SCORM_FALSE","STATE_NOT_INITIALIZED","STATE_INITIALIZED","STATE_TERMINATED","LOG_LEVEL_DEBUG","LOG_LEVEL_INFO","LOG_LEVEL_WARNING","LOG_LEVEL_ERROR","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","scorm12_errors","aicc_errors","scorm2004_errors","errorCode","toString","_errorCode","name","setMessage","message","Error","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","scorm12_error_codes","params","__children","children","_errorClass","errorClass","childArray","_children","_count","toJSON","SECONDS_PER_HOUR","designations","D","H","M","S","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","seconds","getSeconds","ms","msStr","countDecimals","toFixed","split","replace","getSecondsAsISODuration","duration","remainder","designationsKey","current_seconds","Number","indexOf","getTimeAsSeconds","timeString","timeRegex","RegExp","match","parts","getDurationAsSeconds","durationRegex","exec","years","days","flatten","data","recurse","cur","prop","isArray","l","isEmpty","num","stringMatches","str","tester","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","status","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","warn","info","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","currentState","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","isTerminated","cmi","processListeners","apiLog","clearSCORMError","functionName","CMIElement","messageString","fillChars","j","formatMessage","terminate","checkTerminated","checkState","storeData","getValue","getCMIValue","handleValueAccessException","undefined","setValue","commitCallback","setCMIValue","scheduleCommit","clearScheduledCommit","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","_CMIElement","_value","_commonSetCMIValue","methodName","structure","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","idx","attribute","substring","_checkObjectHasProperty","validateCorrectResponse","CMIArray","index","parseInt","isNaN","item","newChild","getChildElement","initialized","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","on","listenerName","listenerFunctions","listenerSplit","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","errorNumber","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","regex","m","unflatten","a_pattern","c_match","a_match","a_num","c_num","startingData","currentCMIElement","renderCMIToJSONString","stringify","k","renderCMIToJSONObject","processHttpRequest","url","immediate","api","genericError","performFetch","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","join","headers","credentials","keepalive","CMIString256","CMIString4096","CMITime","CMITimespan","CMIInteger","CMISInteger","CMIDecimal","CMIIdentifier","CMIFeedback","CMIIndex","CMIStatus","CMIStatus2","CMIExit","CMIType","CMIResult","NAVEvent","score_range","audio_range","speed_range","weighting_range","text_range","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVBoolean","NAVTarget","scaled_range","progress_range","checkValidFormat","regexPattern","allowEmptyString","formatRegex","matches","checkValidRange","rangePattern","ranges","check2004ValidFormat","Scorm2004ValidationError","check2004ValidRange","SuccessStatus","CompletionStatus","_audio_level","_language","_delivery_speed","_audio_captioning","audio_level","language","delivery_speed","audio_captioning","scorm2004_regex","LearnerResponses","format","max","delimiter","unique","choice","matching","format2","delimiter2","performance","sequencing","likert","numeric","other","CorrectResponses","duplicate","limit","delimiter3","_id","_type","_timestamp","_weighting","_learner_response","_result","_latency","_description","objectives","correct_responses","id","type","timestamp","weighting","learner_response","nodes","response_type","values","latency","description","_pattern","pattern","scorm12_constants","scorm12_regex","_raw","_min","__score_range","_max","__invalid_error_code","__invalid_type_code","invalidTypeCode","__invalid_range_code","invalidRangeCode","__decimal_regex","decimalRegex","__error_class","raw","min","_scaled","scaled","CMIScore","readOnlyAfterInit","_comment","_location","_readOnlyAfterInit","comment","location","_success_status","_completion_status","_progress_measure","score","Scorm2004CMIScore","success_status","completion_status","progress_measure","__version","_completion_threshold","_credit","_entry","_exit","_launch_data","_learner_id","_learner_name","_max_time_allowed","_mode","_scaled_passing_score","_session_time","_suspend_data","_time_limit_action","_total_time","learner_preference","CMILearnerPreference","comments_from_learner","CMICommentsFromLearner","comments_from_lms","CMICommentsFromLMS","interactions","CMIInteractions","CMIObjectives","_version","completion_threshold","credit","entry","exit","launch_data","learner_id","learner_name","max_time_allowed","mode","scaled_passing_score","session_time","suspend_data","time_limit_action","total_time","getCurrentTotalTime","sessionTime","startTime","start_time","first","second","BaseRootCMI","nav","ADLNav","_request","request_valid","ADLNavRequestValid","request","_continue","_previous","_choice","_jump","jump","previous","continue","mastery_override","CMI","adl","ADL","Initialize","lmsInitialize","Terminate","lmsFinish","GetValue","lmsGetValue","SetValue","lmsSetValue","Commit","lmsCommit","GetLastError","lmsGetLastError","GetErrorString","lmsGetErrorString","GetDiagnostic","lmsGetDiagnostic","reset","internalFinish","navActions","exitAll","abandon","abandonAll","choiceJumpRegex","action","adlNavRequestRegex","includes","CMIObjectivesObject","createCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","CMICommentsObject","interaction","checkDuplicateChoiceResponse","checkValidResponseType","CMIInteractionsCorrectResponsesObject","interaction_type","checkCorrectResponseValue","interaction_count","pattern_index","checkDuplicatedPattern","detail","correct_response","current_index","found","count","removeCorrectResponsePrefixes","node","seenOrder","seenCase","seenLang","prefixRegex","langMatches","lang","toLowerCase","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeSeconds","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","navRequest","encodeURIComponent","shouldTerminateCommit","Function","check12ValidFormat","Scorm12ValidationError","check12ValidRange","_student_id","_student_name","_lesson_location","_lesson_status","_lesson_mode","student_id","student_name","lesson_location","lesson_status","lesson_mode","_status","_mastery_score","mastery_score","_audio","_speed","_text","audio","speed","_time","_student_response","time","student_response","student_data","_comments","_comments_from_lms","core","CMICore","CMIStudentData","student_preference","CMIStudentPreference","comments","_event","event","statusSetByModule","NAV","LMSInitialize","LMSFinish","LMSGetValue","LMSSetValue","LMSCommit","LMSGetLastError","LMSGetErrorString","LMSGetDiagnostic","lessonStatus","originalStatus","aicc_error_codes","checkAICCValidFormat","AICCValidationError","CMIEvaluationComments","_content","content","_lesson_type","_text_color","_text_location","_text_size","_video","windows","lesson_type","text_color","text_location","text_size","video","_city","_class","_company","_country","_experience","_familiar_name","_instructor_name","_title","_native_language","_state","_street_address","_telephone","_years_experience","city","clazz","company","country","experience","familiar_name","instructor_name","title","native_language","state","street_address","telephone","years_experience","class","_tries_during_lesson","tries","CMITries","attempt_records","CMIAttemptRecords","tries_during_lesson","_location_id","_date","_why_left","_time_in_element","location_id","date","why_left","time_in_element","AICCStudentPreferences","AICCCMIStudentData","student_demographics","CMIStudentDemographics","evaluation","CMIEvaluation","paths","CMIPaths","CMIEvaluationCommentsObject","CMITriesObject","CMIAttemptRecordsObject","CMIPathsObject","window","Scorm12API","Scorm2004API","AICC"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"scorm-again.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,eAAiBD,IAEzBD,EAAK,eAAiBC,GACvB,CATD,CASGK,MAAM,WACT,O,8KCPMC,EAAmB,IAAWC,QAS7B,SAASC,EACdC,EACAC,EACAC,GAEA,OAAO,OACLF,EACAC,EACAJ,EAAiBM,cACjB,KACAD,EAEJ,C,aCbA,cAIE,aACE,QAAK,YAAE,K,OACP,EAAKE,SAAW,IAAIC,E,CACtB,CA0BF,OAjCmC,aAcjC,YAAAC,WAAA,W,MACE,YAAMA,WAAU,WACH,QAAb,EAAAC,KAAKH,gBAAQ,SAAEE,YACjB,EAMA,YAAAE,OAAA,WAGED,KAAKE,YAAa,EAClB,IAAMC,EAAS,CACbN,SAAUG,KAAKH,UAGjB,cADOG,KAAKE,WACLC,CACT,EACF,EAjCA,CAAmC,KAuCnC,cAIE,aACE,SAAK,UAAC,CACJC,SAAU,EAAAC,EAAaC,KAAKC,kBAC5BC,UAAW,IAAWjB,QAAQkB,kBAC9BC,WAAY,QACZ,IACJ,CACF,OAXoC,aAWpC,EAXA,CAAoC,KAgBpC,cAIE,aACE,QAAK,YAAE,K,OAGD,EAAAC,SAAW,GACX,EAAAC,UAAY,GACZ,EAAAC,MAAQ,G,CAJhB,CAoFF,OA1FiD,aAgB/C,sBAAI,sBAAO,C,IAAX,WACE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AAMnhB,KAAKmhB,KACXha,aAAcnH,KAAKmH,aACnBJ,YAAa/G,KAAK+G,YAClBsa,WAAYrhB,KAAKqhB,WACjBC,aAActhB,KAAKshB,aACnBd,mBAAoBxgB,KAAKwgB,mBACzBxf,SAAUhB,KAAKgB,SACfwE,iBAAkBxF,KAAKwF,iBACvBgc,KAAMxhB,KAAKwhB,KACXta,WAAYlH,KAAKkH,WACjBqY,iBAAkBvf,KAAKuf,iBACvBkC,qBAAsBzhB,KAAKyhB,qBAC3Brd,MAAOpE,KAAKoE,MACZsd,aAAc1hB,KAAK0hB,aACnBvC,eAAgBnf,KAAKmf,eACrBrY,aAAc9G,KAAK8G,aACnBrB,kBAAmBzF,KAAKyF,mBAG1B,cADOzF,KAAKE,WACLC,CACT,EACF,EAtkBA,CAAyB,KCyXzB,EAzYiC,CAC/B,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,O,QC7XF,cAIE,aACE,QAAK,YAAE,K,OACP,EAAKoH,IAAM,IAAI2a,E,C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OAAO,GACvD,E","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./src/cmi/aicc/validation.ts","webpack://scorm-again/./src/cmi/aicc/evaluation.ts","webpack://scorm-again/./src/cmi/aicc/student_preferences.ts","webpack://scorm-again/./src/cmi/aicc/student_demographics.ts","webpack://scorm-again/./src/cmi/aicc/tries.ts","webpack://scorm-again/./src/cmi/aicc/attempts.ts","webpack://scorm-again/./src/cmi/aicc/student_data.ts","webpack://scorm-again/./src/cmi/aicc/paths.ts","webpack://scorm-again/./src/cmi/aicc/cmi.ts","webpack://scorm-again/./src/AICC.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","import { checkValidFormat } from \"../common/validation\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nconst aicc_error_codes = ErrorCodes.scorm12;\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function checkAICCValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n aicc_error_codes.TYPE_MISMATCH,\n AICCValidationError,\n allowEmptyString,\n );\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * AICC Evaluation object\n */\nexport class CMIEvaluation extends BaseCMI {\n /**\n * Constructor for AICC Evaluation object\n */\n constructor() {\n super();\n this.comments = new CMIEvaluationComments();\n }\n\n public comments: CMIEvaluationComments;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.comments?.initialize();\n }\n\n /**\n * toJSON for cmi.evaluation object\n * @return {{comments: CMIEvaluationComments}}\n */\n toJSON(): {\n comments: CMIEvaluationComments;\n } {\n this.jsonString = true;\n const result = {\n comments: this.comments,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing AICC's cmi.evaluation.comments object\n */\n\nclass CMIEvaluationComments extends CMIArray {\n /**\n * Constructor for AICC Evaluation Comments object\n */\n constructor() {\n super({\n children: APIConstants.aicc.comments_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n });\n }\n}\n\n/**\n * Class for AICC Evaluation Comments\n */\nexport class CMIEvaluationCommentsObject extends BaseCMI {\n /**\n * Constructor for Evaluation Comments\n */\n constructor() {\n super();\n }\n\n private _content = \"\";\n private _location = \"\";\n private _time = \"\";\n\n /**\n * Getter for _content\n * @return {string}\n */\n get content(): string {\n return this._content;\n }\n\n /**\n * Setter for _content\n * @param {string} content\n */\n set content(content: string) {\n if (checkAICCValidFormat(content, Regex.aicc.CMIString256)) {\n this._content = content;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (checkAICCValidFormat(location, Regex.aicc.CMIString256)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setting for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.evaluation.comments.n object\n * @return {\n * {\n * content: string,\n * location: string,\n * time: string\n * }\n * }\n */\n toJSON(): {\n content: string;\n location: string;\n time: string;\n } {\n this.jsonString = true;\n const result = {\n content: this.content,\n location: this.location,\n time: this.time,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\n\n/**\n * StudentPreferences class for AICC\n */\nexport class AICCStudentPreferences extends CMIStudentPreference {\n /**\n * Constructor for AICC Student Preferences object\n */\n constructor() {\n super(APIConstants.aicc.student_preference_children);\n this.windows = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: AICCValidationError,\n children: \"\",\n });\n }\n\n public windows: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.windows?.initialize();\n }\n\n private _lesson_type = \"\";\n private _text_color = \"\";\n private _text_location = \"\";\n private _text_size = \"\";\n private _video = \"\";\n\n /**\n * Getter for _lesson_type\n * @return {string}\n */\n get lesson_type(): string {\n return this._lesson_type;\n }\n\n /**\n * Setter for _lesson_type\n * @param {string} lesson_type\n */\n set lesson_type(lesson_type: string) {\n if (checkAICCValidFormat(lesson_type, Regex.aicc.CMIString256)) {\n this._lesson_type = lesson_type;\n }\n }\n\n /**\n * Getter for _text_color\n * @return {string}\n */\n get text_color(): string {\n return this._text_color;\n }\n\n /**\n * Setter for _text_color\n * @param {string} text_color\n */\n set text_color(text_color: string) {\n if (checkAICCValidFormat(text_color, Regex.aicc.CMIString256)) {\n this._text_color = text_color;\n }\n }\n\n /**\n * Getter for _text_location\n * @return {string}\n */\n get text_location(): string {\n return this._text_location;\n }\n\n /**\n * Setter for _text_location\n * @param {string} text_location\n */\n set text_location(text_location: string) {\n if (checkAICCValidFormat(text_location, Regex.aicc.CMIString256)) {\n this._text_location = text_location;\n }\n }\n\n /**\n * Getter for _text_size\n * @return {string}\n */\n get text_size(): string {\n return this._text_size;\n }\n\n /**\n * Setter for _text_size\n * @param {string} text_size\n */\n set text_size(text_size: string) {\n if (checkAICCValidFormat(text_size, Regex.aicc.CMIString256)) {\n this._text_size = text_size;\n }\n }\n\n /**\n * Getter for _video\n * @return {string}\n */\n get video(): string {\n return this._video;\n }\n\n /**\n * Setter for _video\n * @param {string} video\n */\n set video(video: string) {\n if (checkAICCValidFormat(video, Regex.aicc.CMIString256)) {\n this._video = video;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string,\n * text_color: string,\n * text_location: string,\n * text_size: string,\n * video: string,\n * windows: CMIArray\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n lesson_type: string;\n speed: string;\n text: string;\n text_color: string;\n text_location: string;\n text_size: string;\n video: string;\n windows: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n lesson_type: this.lesson_type,\n speed: this.speed,\n text: this.text,\n text_color: this.text_color,\n text_location: this.text_location,\n text_size: this.text_size,\n video: this.video,\n windows: this.windows,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { AICCValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the AICC cmi.student_demographics object\n */\nexport class CMIStudentDemographics extends BaseCMI {\n /**\n * Constructor for AICC StudentDemographics object\n */\n constructor() {\n super();\n }\n\n private __children = APIConstants.aicc.student_demographics_children;\n private _city = \"\";\n private _class = \"\";\n private _company = \"\";\n private _country = \"\";\n private _experience = \"\";\n private _familiar_name = \"\";\n private _instructor_name = \"\";\n private _title = \"\";\n private _native_language = \"\";\n private _state = \"\";\n private _street_address = \"\";\n private _telephone = \"\";\n private _years_experience = \"\";\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Getter for city\n * @return {string}\n */\n get city(): string {\n return this._city;\n }\n\n /**\n * Setter for _city. Sets an error if trying to set after\n * initialization.\n * @param {string} city\n */\n set city(city: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._city = city;\n }\n }\n\n /**\n * Getter for class\n * @return {string}\n */\n get class(): string {\n return this._class;\n }\n\n /**\n * Setter for _class. Sets an error if trying to set after\n * initialization.\n * @param {string} clazz\n */\n set class(clazz: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._class = clazz;\n }\n }\n\n /**\n * Getter for company\n * @return {string}\n */\n get company(): string {\n return this._company;\n }\n\n /**\n * Setter for _company. Sets an error if trying to set after\n * initialization.\n * @param {string} company\n */\n set company(company: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._company = company;\n }\n }\n\n /**\n * Getter for country\n * @return {string}\n */\n get country(): string {\n return this._country;\n }\n\n /**\n * Setter for _country. Sets an error if trying to set after\n * initialization.\n * @param {string} country\n */\n set country(country: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._country = country;\n }\n }\n\n /**\n * Getter for experience\n * @return {string}\n */\n get experience(): string {\n return this._experience;\n }\n\n /**\n * Setter for _experience. Sets an error if trying to set after\n * initialization.\n * @param {string} experience\n */\n set experience(experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._experience = experience;\n }\n }\n\n /**\n * Getter for familiar_name\n * @return {string}\n */\n get familiar_name(): string {\n return this._familiar_name;\n }\n\n /**\n * Setter for _familiar_name. Sets an error if trying to set after\n * initialization.\n * @param {string} familiar_name\n */\n set familiar_name(familiar_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._familiar_name = familiar_name;\n }\n }\n\n /**\n * Getter for instructor_name\n * @return {string}\n */\n get instructor_name(): string {\n return this._instructor_name;\n }\n\n /**\n * Setter for _instructor_name. Sets an error if trying to set after\n * initialization.\n * @param {string} instructor_name\n */\n set instructor_name(instructor_name: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._instructor_name = instructor_name;\n }\n }\n\n /**\n * Getter for title\n * @return {string}\n */\n get title(): string {\n return this._title;\n }\n\n /**\n * Setter for _title. Sets an error if trying to set after\n * initialization.\n * @param {string} title\n */\n set title(title: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._title = title;\n }\n }\n\n /**\n * Getter for native_language\n * @return {string}\n */\n get native_language(): string {\n return this._native_language;\n }\n\n /**\n * Setter for _native_language. Sets an error if trying to set after\n * initialization.\n * @param {string} native_language\n */\n set native_language(native_language: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._native_language = native_language;\n }\n }\n\n /**\n * Getter for state\n * @return {string}\n */\n get state(): string {\n return this._state;\n }\n\n /**\n * Setter for _state. Sets an error if trying to set after\n * initialization.\n * @param {string} state\n */\n set state(state: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._state = state;\n }\n }\n\n /**\n * Getter for street_address\n * @return {string}\n */\n get street_address(): string {\n return this._street_address;\n }\n\n /**\n * Setter for _street_address. Sets an error if trying to set after\n * initialization.\n * @param {string} street_address\n */\n set street_address(street_address: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._street_address = street_address;\n }\n }\n\n /**\n * Getter for telephone\n * @return {string}\n */\n get telephone(): string {\n return this._telephone;\n }\n\n /**\n * Setter for _telephone. Sets an error if trying to set after\n * initialization.\n * @param {string} telephone\n */\n set telephone(telephone: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._telephone = telephone;\n }\n }\n\n /**\n * Getter for years_experience\n * @return {string}\n */\n get years_experience(): string {\n return this._years_experience;\n }\n\n /**\n * Setter for _years_experience. Sets an error if trying to set after\n * initialization.\n * @param {string} years_experience\n */\n set years_experience(years_experience: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._years_experience = years_experience;\n }\n }\n\n /**\n * toJSON for cmi.student_demographics object\n * @return {\n * {\n * city: string,\n * class: string,\n * company: string,\n * country: string,\n * experience: string,\n * familiar_name: string,\n * instructor_name: string,\n * title: string,\n * native_language: string,\n * state: string,\n * street_address: string,\n * telephone: string,\n * years_experience: string\n * }\n * }\n */\n toJSON(): {\n city: string;\n class: string;\n company: string;\n country: string;\n experience: string;\n familiar_name: string;\n instructor_name: string;\n title: string;\n native_language: string;\n state: string;\n street_address: string;\n telephone: string;\n years_experience: string;\n } {\n this.jsonString = true;\n const result = {\n city: this.city,\n class: this.class,\n company: this.company,\n country: this.country,\n experience: this.experience,\n familiar_name: this.familiar_name,\n instructor_name: this.instructor_name,\n title: this.title,\n native_language: this.native_language,\n state: this.state,\n street_address: this.street_address,\n telephone: this.telephone,\n years_experience: this.years_experience,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {CMIArray} from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\n\n/**\n * Class representing the AICC cmi.student_data.tries object\n */\nexport class CMITries extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.tries_children,\n });\n }\n}\n\n/**\n * Class for AICC Tries\n */\nexport class CMITriesObject extends BaseCMI {\n /**\n * Constructor for AICC Tries object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _status = \"\";\n private _time = \"\";\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * toJSON for cmi.student_data.tries.n object\n * @return {\n * {\n * status: string,\n * time: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n status: string;\n time: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n status: this.status,\n time: this.time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {AICCValidationError} from \"../../exceptions\";\nimport {checkAICCValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class for cmi.student_data.attempt_records array\n */\nexport class CMIAttemptRecords extends CMIArray {\n /**\n * Constructor for inline Tries Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.attempt_records_children,\n });\n }\n}\n\n/**\n * Class for AICC Attempt Records\n */\nexport class CMIAttemptRecordsObject extends BaseCMI {\n /**\n * Constructor for AICC Attempt Records object\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.aicc.score_children,\n score_range: Regex.aicc.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: AICCValidationError,\n });\n }\n\n public score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private _lesson_status = \"\";\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (checkAICCValidFormat(lesson_status, Regex.aicc.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n\n /**\n * toJSON for cmi.student_data.attempt_records.n object\n * @return {\n * {\n * lesson_status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n lesson_status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n lesson_status: this.lesson_status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { AICCValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMITries } from \"./tries\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIAttemptRecords } from \"./attempts\";\n\n/**\n * StudentData class for AICC\n */\nexport class AICCCMIStudentData extends CMIStudentData {\n /**\n * Constructor for AICC StudentData object\n */\n constructor() {\n super(APIConstants.aicc.student_data_children);\n this.tries = new CMITries();\n this.attempt_records = new CMIAttemptRecords();\n }\n\n public tries: CMITries;\n public attempt_records: CMIAttemptRecords;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.tries?.initialize();\n this.attempt_records?.initialize();\n }\n\n private _tries_during_lesson = \"\";\n\n /**\n * Getter for tries_during_lesson\n * @return {string}\n */\n get tries_during_lesson(): string {\n return this._tries_during_lesson;\n }\n\n /**\n * Setter for _tries_during_lesson. Sets an error if trying to set after\n * initialization.\n * @param {string} tries_during_lesson\n */\n set tries_during_lesson(tries_during_lesson: string) {\n if (this.initialized) {\n throw new AICCValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._tries_during_lesson = tries_during_lesson;\n }\n }\n\n /**\n * toJSON for cmi.student_data object\n * @return {\n * {\n * mastery_score: string,\n * max_time_allowed: string,\n * time_limit_action: string,\n * tries: CMITries,\n * attempt_records: CMIAttemptRecords\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n tries: CMITries;\n attempt_records: CMIAttemptRecords;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n tries: this.tries,\n attempt_records: this.attempt_records,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { checkAICCValidFormat } from \"./validation\";\nimport { CMIArray } from \"../common/array\";\nimport Regex from \"../../constants/regex\";\nimport APIConstants from \"../../constants/api_constants\";\n\n/**\n * Class representing the AICC `cmi.paths` object\n */\nexport class CMIPaths extends CMIArray {\n /**\n * Constructor for inline Paths Array class\n */\n constructor() {\n super({\n children: APIConstants.aicc.paths_children,\n });\n }\n}\n\n/**\n * Class for AICC Paths\n */\nexport class CMIPathsObject extends BaseCMI {\n /**\n * Constructor for AICC Paths objects\n */\n constructor() {\n super();\n }\n\n private _location_id = \"\";\n private _date = \"\";\n private _time = \"\";\n private _status = \"\";\n private _why_left = \"\";\n private _time_in_element = \"\";\n\n /**\n * Getter for _location_id\n * @return {string}\n */\n get location_id(): string {\n return this._location_id;\n }\n\n /**\n * Setter for _location_id\n * @param {string} location_id\n */\n set location_id(location_id: string) {\n if (checkAICCValidFormat(location_id, Regex.aicc.CMIString256)) {\n this._location_id = location_id;\n }\n }\n\n /**\n * Getter for _date\n * @return {string}\n */\n get date(): string {\n return this._date;\n }\n\n /**\n * Setter for _date\n * @param {string} date\n */\n set date(date: string) {\n if (checkAICCValidFormat(date, Regex.aicc.CMIString256)) {\n this._date = date;\n }\n }\n\n /**\n * Getter for _time\n * @return {string}\n */\n get time(): string {\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (checkAICCValidFormat(time, Regex.aicc.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (checkAICCValidFormat(status, Regex.aicc.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * Getter for _why_left\n * @return {string}\n */\n get why_left(): string {\n return this._why_left;\n }\n\n /**\n * Setter for _why_left\n * @param {string} why_left\n */\n set why_left(why_left: string) {\n if (checkAICCValidFormat(why_left, Regex.aicc.CMIString256)) {\n this._why_left = why_left;\n }\n }\n\n /**\n * Getter for _time_in_element\n * @return {string}\n */\n get time_in_element(): string {\n return this._time_in_element;\n }\n\n /**\n * Setter for _time_in_element\n * @param {string} time_in_element\n */\n set time_in_element(time_in_element: string) {\n if (checkAICCValidFormat(time_in_element, Regex.aicc.CMITime)) {\n this._time_in_element = time_in_element;\n }\n }\n\n /**\n * toJSON for cmi.paths.n object\n * @return {\n * {\n * location_id: string,\n * date: string,\n * time: string,\n * status: string,\n * why_left: string,\n * time_in_element: string\n * }\n * }\n */\n toJSON(): {\n location_id: string;\n date: string;\n time: string;\n status: string;\n why_left: string;\n time_in_element: string;\n } {\n this.jsonString = true;\n const result = {\n location_id: this.location_id,\n date: this.date,\n time: this.time,\n status: this.status,\n why_left: this.why_left,\n time_in_element: this.time_in_element,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import * as Scorm12CMI from \"../scorm12/cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { CMIEvaluation } from \"./evaluation\";\nimport { AICCStudentPreferences } from \"./student_preferences\";\nimport { CMIStudentDemographics } from \"./student_demographics\";\nimport { AICCCMIStudentData } from \"./student_data\";\nimport { CMIPaths } from \"./paths\";\nimport { CMICore } from \"./core\";\nimport { CMIObjectives } from \"../scorm12/objectives\";\nimport { CMIStudentData } from \"../scorm12/student_data\";\nimport { CMIStudentPreference } from \"../scorm12/student_preference\";\nimport { CMIInteractions } from \"../scorm12/interactions\";\n\n/**\n * CMI Class for AICC\n */\nexport class CMI extends Scorm12CMI.CMI {\n /**\n * Constructor for AICC CMI object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super(APIConstants.aicc.cmi_children);\n if (initialized) this.initialize();\n this.student_preference = new AICCStudentPreferences();\n this.student_data = new AICCCMIStudentData();\n this.student_demographics = new CMIStudentDemographics();\n this.evaluation = new CMIEvaluation();\n this.paths = new CMIPaths();\n }\n\n public student_data: AICCCMIStudentData;\n public student_preference: AICCStudentPreferences;\n public student_demographics: CMIStudentDemographics;\n public evaluation: CMIEvaluation;\n public paths: CMIPaths;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.student_preference?.initialize();\n this.student_data?.initialize();\n this.student_demographics?.initialize();\n this.evaluation?.initialize();\n this.paths?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions,\n * paths: CMIPaths\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n student_demographics: CMIStudentDemographics;\n interactions: CMIInteractions;\n evaluation: CMIEvaluation;\n paths: CMIPaths;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n student_demographics: this.student_demographics,\n interactions: this.interactions,\n evaluation: this.evaluation,\n paths: this.paths,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Scorm12API from \"./Scorm12API\";\nimport { CMI } from \"./cmi/aicc/cmi\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMITriesObject } from \"./cmi/aicc/tries\";\nimport { CMIAttemptRecordsObject } from \"./cmi/aicc/attempts\";\nimport { CMIEvaluationCommentsObject } from \"./cmi/aicc/evaluation\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport { CMIPathsObject } from \"./cmi/aicc/paths\";\nimport { Settings } from \"./types/api_types\";\nimport { stringMatches } from \"./utilities\";\n\n/**\n * The AICC API class\n */\nexport default class AICC extends Scorm12API {\n /**\n * Constructor to create AICC API object\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n super(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI | null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);\n\n if (!newChild) {\n if (stringMatches(CMIElement, \"cmi\\\\.evaluation\\\\.comments\\\\.\\\\d+\")) {\n newChild = new CMIEvaluationCommentsObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.tries\\\\.\\\\d+\")\n ) {\n newChild = new CMITriesObject();\n } else if (\n stringMatches(CMIElement, \"cmi\\\\.student_data\\\\.attempt_records\\\\.\\\\d+\")\n ) {\n newChild = new CMIAttemptRecordsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.paths\\\\.\\\\d+\")) {\n newChild = new CMIPathsObject();\n }\n }\n\n return newChild;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {AICC} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: AICC) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.nav = newAPI.nav;\n }\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["root","factory","exports","module","define","amd","self","aicc_error_codes","scorm12","checkAICCValidFormat","value","regexPattern","allowEmptyString","TYPE_MISMATCH","comments","CMIEvaluationComments","initialize","this","toJSON","jsonString","result","children","A","aicc","comments_children","errorCode","INVALID_SET_VALUE","errorClass","_content","_location","_time","content","CMIString256","location","time","CMITime","student_preference_children","_lesson_type","_text_color","_text_location","_text_size","_video","windows","lesson_type","text_color","text_location","text_size","video","audio","language","speed","text","__children","student_demographics_children","_city","_class","_company","_country","_experience","_familiar_name","_instructor_name","_title","_native_language","_state","_street_address","_telephone","_years_experience","city","initialized","READ_ONLY_ELEMENT","clazz","company","country","experience","familiar_name","instructor_name","title","native_language","state","street_address","telephone","years_experience","class","tries_children","_status","score","score_children","score_range","invalidErrorCode","invalidTypeCode","invalidRangeCode","VALUE_OUT_OF_RANGE","status","CMIStatus2","attempt_records_children","_lesson_status","lesson_status","student_data_children","_tries_during_lesson","tries","CMITries","attempt_records","CMIAttemptRecords","tries_during_lesson","mastery_score","max_time_allowed","time_limit_action","paths_children","_location_id","_date","_why_left","_time_in_element","location_id","date","why_left","time_in_element","cmi_children","student_preference","AICCStudentPreferences","student_data","AICCCMIStudentData","student_demographics","CMIStudentDemographics","evaluation","CMIEvaluation","paths","CMIPaths","suspend_data","launch_data","comments_from_lms","core","objectives","interactions","settings","cmi","CMI","nav","getChildElement","CMIElement","foundFirstIndex","newChild","CMIEvaluationCommentsObject","CMITriesObject","CMIAttemptRecordsObject","CMIPathsObject","replaceWithAnotherScormAPI","newAPI","Scorm12API","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","httpResult","hasOwnProperty","call","SCORM_TRUE","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","invalidErrorMessage","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","mastery_override","statusSetByModule","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","internalFinish","event","detail","basicMessage","detailMessage","error_descriptions","renderCommitCMI","terminateCommit","cmiExport","total_time","getCurrentTotalTime","flattened","renderCommitObject","totalTimeHHMMSS","totalTimeSeconds","CMITimespan","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","raw","min","max","runtimeData","originalStatus","lesson_mode","credit","shouldTerminateCommit","check2004ValidFormat","check2004ValidRange","rangePattern","_audio_level","_language","_delivery_speed","_audio_captioning","_children","audio_level","CMIDecimal","audio_range","CMILang","delivery_speed","speed_range","audio_captioning","CMISInteger","text_range","scorm2004_regex","LearnerResponses","format","delimiter","unique","choice","CMILongIdentifier","CMILangString250","CMILangString4000","matching","CMIShortIdentifier","format2","delimiter2","performance","sequencing","likert","numeric","other","CMIString4000","CorrectResponses","duplicate","limit","CMILangString250cr","delimiter3","interactions_children","_id","_type","_timestamp","_weighting","_learner_response","_result","_latency","_description","objectives_children","correct_responses","correct_responses_children","id","type","DEPENDENCY_NOT_ESTABLISHED","CMIType","timestamp","weighting","learner_response","nodes","response_type","GENERAL_SET_FAILURE","formatRegex","RegExp","values","j","CMIResult","latency","description","_pattern","pattern","CMIFeedback","decimalRegex","_scaled","scaled","scaled_range","readOnlyAfterInit","_comment","_readOnlyAfterInit","comment","CMIString250","_success_status","_completion_status","_progress_measure","Scorm2004CMIScore","success_status","CMISStatus","completion_status","CMICStatus","progress_measure","progress_range","__version","_completion_threshold","_credit","_entry","_exit","_launch_data","_learner_id","_learner_name","_max_time_allowed","_mode","_scaled_passing_score","_session_time","_suspend_data","_time_limit_action","_total_time","learner_preference","CMILearnerPreference","comments_from_learner","CMICommentsFromLearner","CMICommentsFromLMS","CMIInteractions","CMIObjectives","_version","completion_threshold","entry","WRITE_ONLY_ELEMENT","exit","CMIExit","learner_id","learner_name","CMIString1000","mode","scaled_passing_score","session_time","CMIString64000","sessionTime","startTime","start_time","seconds","Date","getTime","ADLNav","_request","request_valid","ADLNavRequestValid","request","NAVEvent","_continue","_previous","_choice","_jump","NAVBoolean","NAVTarget","jump","previous","continue","adl","ADL","Initialize","Terminate","GetValue","SetValue","Commit","GetLastError","GetErrorString","GetDiagnostic","navActions","exitAll","abandon","abandonAll","choiceJumpRegex","regex","matches","action","adlNavRequestRegex","includes","CMIObjectivesObject","createCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","CMICommentsObject","parts","interaction","checkDuplicateChoiceResponse","checkValidResponseType","CMIInteractionsCorrectResponsesObject","interaction_type","checkCorrectResponseValue","interaction_count","_count","pattern_index","checkDuplicatedPattern","correct_response","current_index","found","count","removeCorrectResponsePrefixes","node","seenOrder","seenCase","seenLang","prefixRegex","langMatches","CMILangcr","lang","toLowerCase","totalTimeDuration","navRequest","encodeURIComponent","Function","scorm12_error_codes","_errorCode","_errorClass","_initialized","_start_time","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","__score_range","_max","__invalid_error_code","__invalid_type_code","__invalid_range_code","__decimal_regex","__error_class","checkValidFormat","checkValidRange","ranges","core_children","_student_id","_student_name","_lesson_location","_lesson_mode","student_id","student_name","lesson_location","CMIStatus","CMIString4096","_comments","_comments_from_lms","CMICore","C","_student_response","CMIIdentifier","weighting_range","student_response","_event","_mastery_score","_audio","_speed","_text","check12ValidFormat","check12ValidRange","APIConstants","LOG_LEVEL_NONE","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","ErrorCodes","MULTIPLE_TERMINATIONS","CMIInteger","CMIIndex","Regex","CMIString200","CMIIndexStore","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","designations","D","H","M","S","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","getSeconds","ms","msStr","countDecimals","toFixed","getSecondsAsISODuration","duration","remainder","designationsKey","current_seconds","getTimeAsSeconds","timeString","timeRegex","getDurationAsSeconds","durationRegex","exec","years","days","addTwoDurations","first","second","addHHMMSSTimeStrings","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","m","num","formatMessage","messageString","fillChars","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","o","defineProperty","enumerable","get","r","toStringTag"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/scorm12.js b/dist/scorm12.js index 36d3e14..6b7b534 100644 --- a/dist/scorm12.js +++ b/dist/scorm12.js @@ -10,3046 +10,3380 @@ })(self, function() { return /******/ (function() { // webpackBootstrap /******/ "use strict"; -var __webpack_exports__ = {}; +/******/ var __webpack_modules__ = ({ -;// ./node_modules/tslib/tslib.es6.mjs -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 900: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + A: function() { return /* binding */ src_BaseAPI; } +}); -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/utilities/debounce.ts +function debounce(func, wait, immediate) { + if (immediate === void 0) { immediate = false; } + var timeout; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = this; + var later = function () { + timeout = null; + if (!immediate) + func.apply(context, args); + }; + var callNow = immediate && !timeout; + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) + func.apply(context, args); + }; +} + +;// ./src/constants/default_settings.ts + + +var DefaultSettings = { + autocommit: false, + autocommitSeconds: 10, + asyncCommit: false, + sendFullCommit: true, + lmsCommitUrl: false, + dataCommitFormat: "json", + commitRequestDataType: "application/json;charset=UTF-8", + autoProgress: false, + logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR, + selfReportSessionTime: false, + alwaysSendTotalTime: false, + renderCommonCommitFields: false, + strict_errors: true, + xhrHeaders: {}, + xhrWithCredentials: false, + responseHandler: function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var httpResult, _a, _b; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof response !== "undefined")) return [3, 2]; + _b = (_a = JSON).parse; + return [4, response.text()]; + case 1: + httpResult = _b.apply(_a, [_c.sent()]); + if (httpResult === null || + !{}.hasOwnProperty.call(httpResult, "result")) { + if (response.status === 200) { + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + else { + return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + } + else { + return [2, { + result: httpResult.result, + errorCode: httpResult.errorCode + ? httpResult.errorCode + : httpResult.result === api_constants/* default */.A.global.SCORM_TRUE + ? 0 + : 101, + }]; + } + _c.label = 2; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + }); + }); + }, + requestHandler: function (commitObject) { + return commitObject; + }, + onLogMessage: function (messageLevel, logMessage) { + switch (messageLevel) { + case api_constants/* default */.A.global.LOG_LEVEL_ERROR: + console.error(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_WARNING: + console.warn(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_INFO: + console.info(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_DEBUG: + if (console.debug) { + console.debug(logMessage); + } + else { + console.log(logMessage); + } + break; + } + }, + scoItemIds: [], + scoItemIdValidator: false, }; -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} +;// ./src/helpers/scheduled_commit.ts -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} +var ScheduledCommit = (function () { + function ScheduledCommit(API, when, callback) { + this._cancelled = false; + this._API = API; + this._timeout = setTimeout(this.wrapper.bind(this), when); + this._callback = callback; + } + ScheduledCommit.prototype.cancel = function () { + this._cancelled = true; + if (this._timeout) { + clearTimeout(this._timeout); + } + }; + ScheduledCommit.prototype.wrapper = function () { + var _this = this; + if (!this._cancelled) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this._API.commit(this._callback)]; + case 1: return [2, _a.sent()]; + } + }); }); })(); + } + }; + return ScheduledCommit; +}()); -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} +;// ./src/BaseAPI.ts -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; - -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); - } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -/* harmony default export */ var tslib_es6 = ({ - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}); - -;// ./src/cmi/common/base_cmi.ts - -var BaseCMI = (function () { - function BaseCMI() { - this.jsonString = false; - this._initialized = false; - } - Object.defineProperty(BaseCMI.prototype, "initialized", { - get: function () { - return this._initialized; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(BaseCMI.prototype, "start_time", { - get: function () { - return this._start_time; - }, - enumerable: false, - configurable: true - }); - BaseCMI.prototype.initialize = function () { - this._initialized = true; - }; - BaseCMI.prototype.setStartTime = function () { - this._start_time = new Date().getTime(); - }; - return BaseCMI; -}()); - -var BaseRootCMI = (function (_super) { - __extends(BaseRootCMI, _super); - function BaseRootCMI() { - return _super !== null && _super.apply(this, arguments) || this; - } - return BaseRootCMI; -}(BaseCMI)); - - -;// ./src/constants/error_codes.ts - -var global = { - GENERAL: 101, - INITIALIZATION_FAILED: 101, - INITIALIZED: 101, - TERMINATED: 101, - TERMINATION_FAILURE: 101, - TERMINATION_BEFORE_INIT: 101, - MULTIPLE_TERMINATION: 101, - RETRIEVE_BEFORE_INIT: 101, - RETRIEVE_AFTER_TERM: 101, - STORE_BEFORE_INIT: 101, - STORE_AFTER_TERM: 101, - COMMIT_BEFORE_INIT: 101, - COMMIT_AFTER_TERM: 101, - ARGUMENT_ERROR: 101, - CHILDREN_ERROR: 101, - COUNT_ERROR: 101, - GENERAL_GET_FAILURE: 101, - GENERAL_SET_FAILURE: 101, - GENERAL_COMMIT_FAILURE: 101, - UNDEFINED_DATA_MODEL: 101, - UNIMPLEMENTED_ELEMENT: 101, - VALUE_NOT_INITIALIZED: 101, - INVALID_SET_VALUE: 101, - READ_ONLY_ELEMENT: 101, - WRITE_ONLY_ELEMENT: 101, - TYPE_MISMATCH: 101, - VALUE_OUT_OF_RANGE: 101, - DEPENDENCY_NOT_ESTABLISHED: 101, -}; -var scorm12 = __assign(__assign({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var scorm2004 = __assign(__assign({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var ErrorCodes = { - scorm12: scorm12, - scorm2004: scorm2004, -}; -/* harmony default export */ var error_codes = (ErrorCodes); - -;// ./src/constants/api_constants.ts - -var api_constants_global = { - SCORM_TRUE: "true", - SCORM_FALSE: "false", - STATE_NOT_INITIALIZED: 0, - STATE_INITIALIZED: 1, - STATE_TERMINATED: 2, - LOG_LEVEL_DEBUG: 1, - LOG_LEVEL_INFO: 2, - LOG_LEVEL_WARNING: 3, - LOG_LEVEL_ERROR: 4, - LOG_LEVEL_NONE: 5, -}; -var api_constants_scorm12 = { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", - core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", - score_children: "raw,min,max", - comments_children: "content,location,time", - objectives_children: "id,score,status", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio,language,speed,text", - interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", - error_descriptions: { - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", - }, - "201": { - basicMessage: "Invalid argument error", - detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", - }, - "202": { - basicMessage: "Element cannot have children", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', - }, - "203": { - basicMessage: "Element not an array - cannot have count", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', - }, - "301": { - basicMessage: "Not initialized", - detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", - }, - "401": { - basicMessage: "Not implemented error", - detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", - }, - "402": { - basicMessage: "Invalid set value, element is a keyword", - detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', - }, - "403": { - basicMessage: "Element is read only", - detailMessage: "LMSSetValue was called with a data model element that can only be read.", - }, - "404": { - basicMessage: "Element is write only", - detailMessage: "LMSGetValue was called on a data model element that can only be written to.", - }, - "405": { - basicMessage: "Incorrect Data Type", - detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Element Value Out Of Range", - detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var aicc = __assign(__assign({}, api_constants_scorm12), { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", - student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", - student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", - student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", - tries_children: "time,status,score", - attempt_records_children: "score,lesson_status", - paths_children: "location_id,date,time,status,why_left,time_in_element", -}); -var api_constants_scorm2004 = { - cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", - comments_children: "comment,timestamp,location", - score_children: "max,raw,scaled,min", - objectives_children: "progress_measure,completion_status,success_status,description,score,id", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio_level,audio_captioning,delivery_speed,language", - interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", - error_descriptions: { - "0": { - basicMessage: "No Error", - detailMessage: "No error occurred, the previous API call was successful.", - }, - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", - }, - "102": { - basicMessage: "General Initialization Failure", - detailMessage: "Call to Initialize failed for an unknown reason.", - }, - "103": { - basicMessage: "Already Initialized", - detailMessage: "Call to Initialize failed because Initialize was already called.", - }, - "104": { - basicMessage: "Content Instance Terminated", - detailMessage: "Call to Initialize failed because Terminate was already called.", - }, - "111": { - basicMessage: "General Termination Failure", - detailMessage: "Call to Terminate failed for an unknown reason.", - }, - "112": { - basicMessage: "Termination Before Initialization", - detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", - }, - "113": { - basicMessage: "Termination After Termination", - detailMessage: "Call to Terminate failed because Terminate was already called.", - }, - "122": { - basicMessage: "Retrieve Data Before Initialization", - detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", - }, - "123": { - basicMessage: "Retrieve Data After Termination", - detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", - }, - "132": { - basicMessage: "Store Data Before Initialization", - detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", - }, - "133": { - basicMessage: "Store Data After Termination", - detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", - }, - "142": { - basicMessage: "Commit Before Initialization", - detailMessage: "Call to Commit failed because it was made before the call to Initialize.", - }, - "143": { - basicMessage: "Commit After Termination", - detailMessage: "Call to Commit failed because it was made after the call to Terminate.", - }, - "201": { - basicMessage: "General Argument Error", - detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", - }, - "301": { - basicMessage: "General Get Failure", - detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "351": { - basicMessage: "General Set Failure", - detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "391": { - basicMessage: "General Commit Failure", - detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "401": { - basicMessage: "Undefined Data Model Element", - detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", - }, - "402": { - basicMessage: "Unimplemented Data Model Element", - detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", - }, - "403": { - basicMessage: "Data Model Element Value Not Initialized", - detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", - }, - "404": { - basicMessage: "Data Model Element Is Read Only", - detailMessage: "SetValue was called with a data model element that can only be read.", - }, - "405": { - basicMessage: "Data Model Element Is Write Only", - detailMessage: "GetValue was called on a data model element that can only be written to.", - }, - "406": { - basicMessage: "Data Model Element Type Mismatch", - detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Data Model Element Value Out Of Range", - detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var APIConstants = { - global: api_constants_global, - scorm12: api_constants_scorm12, - aicc: aicc, - scorm2004: api_constants_scorm2004, -}; -/* harmony default export */ var api_constants = (APIConstants); - -;// ./src/exceptions.ts - - -var scorm12_errors = api_constants.scorm12.error_descriptions; -var aicc_errors = api_constants.aicc.error_descriptions; -var scorm2004_errors = api_constants.scorm2004.error_descriptions; -var BaseScormValidationError = (function (_super) { - __extends(BaseScormValidationError, _super); - function BaseScormValidationError(errorCode) { - var _this = _super.call(this, errorCode.toString()) || this; - _this._errorCode = errorCode; - _this.name = "ScormValidationError"; - return _this; - } - Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { - get: function () { - return this._errorCode; - }, - enumerable: false, - configurable: true - }); - BaseScormValidationError.prototype.setMessage = function (message) { - this.message = message; - }; - return BaseScormValidationError; -}(Error)); - -var ValidationError = (function (_super) { - __extends(ValidationError, _super); - function ValidationError(errorCode, errorMessage, detailedMessage) { - var _this = _super.call(this, errorCode) || this; - _this._detailedMessage = ""; - _this.setMessage(errorMessage); - _this._errorMessage = errorMessage; - if (detailedMessage) { - _this._detailedMessage = detailedMessage; - } - return _this; - } - Object.defineProperty(ValidationError.prototype, "errorMessage", { - get: function () { - return this._errorMessage; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ValidationError.prototype, "detailedMessage", { - get: function () { - return this._detailedMessage; - }, - enumerable: false, - configurable: true - }); - return ValidationError; -}(BaseScormValidationError)); -var Scorm12ValidationError = (function (_super) { - __extends(Scorm12ValidationError, _super); - function Scorm12ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; +var BaseAPI = (function () { + function BaseAPI(error_codes, settings) { + var _newTarget = this.constructor; + this._settings = DefaultSettings; + if (_newTarget === BaseAPI) { + throw new TypeError("Cannot construct BaseAPI instances directly"); } - else { - _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + this._error_codes = error_codes; + if (settings) { + this.settings = settings; } - return _this; + this.apiLogLevel = this.settings.logLevel; + this.selfReportSessionTime = this.settings.selfReportSessionTime; } - return Scorm12ValidationError; -}(ValidationError)); - -var AICCValidationError = (function (_super) { - __extends(AICCValidationError, _super); - function AICCValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { - _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; - } - else { - _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + BaseAPI.prototype.commonReset = function (settings) { + this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings); + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + }; + BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); } - return _this; - } - return AICCValidationError; -}(ValidationError)); - -var Scorm2004ValidationError = (function (_super) { - __extends(Scorm2004ValidationError, _super); - function Scorm2004ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + else if (this.isTerminated()) { + this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); } else { - _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + if (this.selfReportSessionTime) { + this.cmi.setStartTime(); + } + this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED; + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); } - return _this; - } - return Scorm2004ValidationError; -}(ValidationError)); - - -;// ./src/cmi/common/array.ts - - - - -var scorm12_error_codes = error_codes.scorm12; -var CMIArray = (function (_super) { - __extends(CMIArray, _super); - function CMIArray(params) { - var _this = _super.call(this) || this; - _this.__children = params.children; - _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; - _this._errorClass = params.errorClass || BaseScormValidationError; - _this.childArray = []; - return _this; - } - Object.defineProperty(CMIArray.prototype, "_children", { + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { + logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement); + if (messageLevel >= this.apiLogLevel) { + this.settings.onLogMessage(messageLevel, logMessage); + } + }; + Object.defineProperty(BaseAPI.prototype, "error_codes", { get: function () { - return this.__children; - }, - set: function (_children) { - throw new this._errorClass(this._errorCode); + return this._error_codes; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIArray.prototype, "_count", { + Object.defineProperty(BaseAPI.prototype, "settings", { get: function () { - return this.childArray.length; + return this._settings; }, - set: function (_count) { - throw new this._errorClass(this._errorCode); + set: function (settings) { + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); }, - enumerable: false, - configurable: true - }); - CMIArray.prototype.toJSON = function () { - this.jsonString = true; - var result = {}; - for (var i = 0; i < this.childArray.length; i++) { - result[i + ""] = this.childArray[i]; - } - delete this.jsonString; - return result; - }; - return CMIArray; -}(BaseCMI)); - - -;// ./src/utilities.ts -var SECONDS_PER_SECOND = 1.0; -var SECONDS_PER_MINUTE = 60; -var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; -var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; -var designations = { - D: SECONDS_PER_DAY, - H: SECONDS_PER_HOUR, - M: SECONDS_PER_MINUTE, - S: SECONDS_PER_SECOND, -}; -function getSecondsAsHHMMSS(totalSeconds) { - if (!totalSeconds || totalSeconds <= 0) { - return "00:00:00"; - } - var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); - var dateObj = new Date(totalSeconds * 1000); - var minutes = dateObj.getUTCMinutes(); - var seconds = dateObj.getSeconds(); - var ms = totalSeconds % 1.0; - var msStr = ""; - if (countDecimals(ms) > 0) { - if (countDecimals(ms) > 2) { - msStr = ms.toFixed(2); - } - else { - msStr = String(ms); - } - msStr = "." + msStr.split(".")[1]; - } - return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); -} -function getSecondsAsISODuration(seconds) { - if (!seconds || seconds <= 0) { - return "PT0S"; - } - var duration = "P"; - var remainder = seconds; - for (var designationsKey in designations) { - var current_seconds = designations[designationsKey]; - var value = Math.floor(remainder / current_seconds); - remainder = remainder % current_seconds; - if (countDecimals(remainder) > 2) { - remainder = Number(Number(remainder).toFixed(2)); - } - if (designationsKey === "S" && remainder > 0) { - value += remainder; - } - if (value) { - if ((duration.indexOf("D") > 0 || - designationsKey === "H" || - designationsKey === "M" || - designationsKey === "S") && - duration.indexOf("T") === -1) { - duration += "T"; - } - duration += "".concat(value).concat(designationsKey); - } - } - return duration; -} -function getTimeAsSeconds(timeString, timeRegex) { - if (typeof timeString === "number" || typeof timeString === "boolean") { - timeString = String(timeString); - } - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - if (!timeString || !timeString.match(timeRegex)) { - return 0; - } - var parts = timeString.split(":"); - var hours = Number(parts[0]); - var minutes = Number(parts[1]); - var seconds = Number(parts[2]); - return hours * 3600 + minutes * 60 + seconds; -} -function getDurationAsSeconds(duration, durationRegex) { - if (typeof durationRegex === "string") { - durationRegex = new RegExp(durationRegex); - } - if (!duration || !duration.match(durationRegex)) { - return 0; - } - var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; - var result = 0.0; - result += Number(seconds) || 0.0; - result += Number(minutes) * 60.0 || 0.0; - result += Number(hours) * 3600.0 || 0.0; - result += Number(days) * (60 * 60 * 24.0) || 0.0; - result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; - return result; -} -function addTwoDurations(first, second, durationRegex) { - var regex = typeof durationRegex === "string" - ? new RegExp(durationRegex) - : durationRegex; - return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); -} -function addHHMMSSTimeStrings(first, second, timeRegex) { - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); -} -function flatten(data) { - var result = {}; - function recurse(cur, prop) { - if (Object(cur) !== cur) { - result[prop] = cur; - } - else if (Array.isArray(cur)) { - for (var i = 0, l = cur.length; i < l; i++) { - recurse(cur[i], prop + "[" + i + "]"); - if (l === 0) - result[prop] = []; - } - } - else { - var isEmpty = true; - for (var p in cur) { - if ({}.hasOwnProperty.call(cur, p)) { - isEmpty = false; - recurse(cur[p], prop ? prop + "." + p : p); + enumerable: false, + configurable: true + }); + BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var returnValue, result; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; + return [4, this.storeData(true)]; + case 1: + result = _a.sent(); + if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + if (checkTerminated) + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; } + }); + }); + }; + BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { + var returnValue = ""; + if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.getCMIValue(CMIElement); } - if (isEmpty && prop) - result[prop] = {}; + catch (e) { + returnValue = this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement); } - } - recurse(data, ""); - return result; -} -function unflatten(data) { - "use strict"; - if (Object(data) !== data || Array.isArray(data)) - return data; - var regex = /\.?([^.[\]]+)|\[(\d+)]/g; - var result = {}; - for (var p in data) { - if ({}.hasOwnProperty.call(data, p)) { - var cur = result; - var prop = ""; - var m = regex.exec(p); - while (m) { - cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); - prop = m[2] || m[1]; - m = regex.exec(p); + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + if (returnValue === undefined) { + return ""; + } + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { + if (value !== undefined) { + value = String(value); + } + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.setCMIValue(CMIElement, value); } - cur[prop] = data[p]; + catch (e) { + this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement, value); } - } - return result[""] || result; -} -function countDecimals(num) { - if (Math.floor(num) === num || String(num).indexOf(".") < 0) - return 0; - var parts = num.toString().split(".")[1]; - return parts.length || 0; -} -function formatMessage(functionName, message, CMIElement) { - var baseLength = 20; - var messageString = ""; - messageString += functionName; - var fillChars = baseLength - messageString.length; - for (var i = 0; i < fillChars; i++) { - messageString += " "; - } - messageString += ": "; - if (CMIElement) { - var CMIElementBaseLength = 70; - messageString += CMIElement; - fillChars = CMIElementBaseLength - messageString.length; - for (var j = 0; j < fillChars; j++) { - messageString += " "; + if (returnValue === undefined) { + returnValue = api_constants/* default */.A.global.SCORM_FALSE; } - } - if (message) { - messageString += message; - } - return messageString; -} -function stringMatches(str, tester) { - return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; -} - -;// ./src/utilities/debounce.ts -function debounce(func, wait, immediate) { - if (immediate === void 0) { immediate = false; } - var timeout; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; + if (String(this.lastErrorCode) === "0") { + if (this.settings.autocommit && !this._timeout) { + this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + } } - var context = this; - var later = function () { - timeout = null; - if (!immediate) - func.apply(context, args); - }; - var callNow = immediate && !timeout; - if (timeout) - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) - func.apply(context, args); + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + this.clearSCORMError(returnValue); + return returnValue; }; -} - -;// ./src/constants/default_settings.ts - - -var DefaultSettings = { - autocommit: false, - autocommitSeconds: 10, - asyncCommit: false, - sendFullCommit: true, - lmsCommitUrl: false, - dataCommitFormat: "json", - commitRequestDataType: "application/json;charset=UTF-8", - autoProgress: false, - logLevel: api_constants.global.LOG_LEVEL_ERROR, - selfReportSessionTime: false, - alwaysSendTotalTime: false, - renderCommonCommitFields: false, - strict_errors: true, - xhrHeaders: {}, - xhrWithCredentials: false, - responseHandler: function (response) { - return __awaiter(this, void 0, void 0, function () { - var httpResult, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { + BaseAPI.prototype.commit = function (callbackName_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { + var returnValue, result; + if (checkTerminated === void 0) { checkTerminated = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { case 0: - if (!(typeof response !== "undefined")) return [3, 2]; - _b = (_a = JSON).parse; - return [4, response.text()]; + this.clearScheduledCommit(); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; + return [4, this.storeData(false)]; case 1: - httpResult = _b.apply(_a, [_c.sent()]); - if (httpResult === null || - !{}.hasOwnProperty.call(httpResult, "result")) { - if (response.status === 200) { - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; + result = _a.sent(); + if (result.errorCode && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); + if (checkTerminated) + this.lastErrorCode = "0"; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getLastError = function (callbackName) { + var returnValue = String(this.lastErrorCode); + this.processListeners(callbackName); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { + if (this.isNotInitialized()) { + this.throwSCORMError(beforeInitError); + return false; + } + else if (checkTerminated && this.isTerminated()) { + this.throwSCORMError(afterTermError); + return false; + } + return true; + }; + BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { + if (_detail === void 0) { _detail = false; } + throw new Error("The getLmsErrorMessageDetails method has not been implemented"); + }; + BaseAPI.prototype.getCMIValue = function (_CMIElement) { + throw new Error("The getCMIValue method has not been implemented"); + }; + BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { + throw new Error("The setCMIValue method has not been implemented"); + }; + BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { + if (!CMIElement || CMIElement === "") { + return api_constants/* default */.A.global.SCORM_FALSE; + } + var structure = CMIElement.split("."); + var refObject = this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + var foundFirstIndex = false; + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + var attribute = structure[idx]; + if (idx === structure.length - 1) { + if (scorm2004 && attribute.substring(0, 8) === "{target=") { + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); + } + else { + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); + } + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && + this.isInitialized()) { + this.validateCorrectResponse(CMIElement, value); + } + if (!scorm2004 || this.lastErrorCode === "0") { + refObject[attribute] = value; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + } + } + } + else { + refObject = refObject[attribute]; + if (!refObject) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + foundFirstIndex = true; + } + else { + var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); + foundFirstIndex = true; + if (!newChild) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); } else { - return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; + if (refObject.initialized) + newChild.initialize(); + refObject.childArray.push(newChild); + refObject = newChild; } } - else { - return [2, { - result: httpResult.result, - errorCode: httpResult.errorCode - ? httpResult.errorCode - : httpResult.result === api_constants.global.SCORM_TRUE - ? 0 - : 101, - }]; - } - _c.label = 2; - case 2: return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; + idx++; + } } - }); - }); - }, - requestHandler: function (commitObject) { - return commitObject; - }, - onLogMessage: function (messageLevel, logMessage) { - switch (messageLevel) { - case api_constants.global.LOG_LEVEL_ERROR: - console.error(logMessage); - break; - case api_constants.global.LOG_LEVEL_WARNING: - console.warn(logMessage); - break; - case api_constants.global.LOG_LEVEL_INFO: - console.info(logMessage); - break; - case api_constants.global.LOG_LEVEL_DEBUG: - if (console.debug) { - console.debug(logMessage); + } + } + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); + } + return returnValue; + }; + BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { + if (!CMIElement || CMIElement === "") { + return ""; + } + var structure = CMIElement.split("."); + var refObject = this; + var attribute = null; + var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + attribute = structure[idx]; + if (!scorm2004) { + if (idx === structure.length - 1) { + if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } } - else { - console.log(logMessage); + } + else { + if (String(attribute).substring(0, 8) === "{target=" && + typeof refObject._isTargetValid == "function") { + var target = String(attribute).substring(8, String(attribute).length - 9); + return refObject._isTargetValid(target); + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; } + } + refObject = refObject[attribute]; + if (refObject === undefined) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + } + else { + this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); + break; + } + idx++; + } + } } - }, - scoItemIds: [], - scoItemIdValidator: false, -}; - -;// ./src/helpers/scheduled_commit.ts - -var ScheduledCommit = (function () { - function ScheduledCommit(API, when, callback) { - this._cancelled = false; - this._API = API; - this._timeout = setTimeout(this.wrapper.bind(this), when); - this._callback = callback; - } - ScheduledCommit.prototype.cancel = function () { - this._cancelled = true; - if (this._timeout) { - clearTimeout(this._timeout); + if (refObject === null || refObject === undefined) { + if (!scorm2004) { + if (attribute === "_children") { + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); + } + else if (attribute === "_count") { + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); + } + } + } + else { + return refObject; } }; - ScheduledCommit.prototype.wrapper = function () { - var _this = this; - if (!this._cancelled) { - (function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this._API.commit(this._callback)]; - case 1: return [2, _a.sent()]; - } - }); }); })(); + BaseAPI.prototype.isInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; + }; + BaseAPI.prototype.isNotInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + }; + BaseAPI.prototype.isTerminated = function () { + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; + }; + BaseAPI.prototype.on = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + for (var i = 0; i < listenerFunctions.length; i++) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this.listenerArray.push({ + functionName: functionName, + CMIElement: CMIElement, + callback: callback, + }); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); } }; - return ScheduledCommit; -}()); - - -;// ./src/BaseAPI.ts - - - - - - - - - -var BaseAPI = (function () { - function BaseAPI(error_codes, settings) { - var _newTarget = this.constructor; - this._settings = DefaultSettings; - if (_newTarget === BaseAPI) { - throw new TypeError("Cannot construct BaseAPI instances directly"); + BaseAPI.prototype.off = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + var _loop_1 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + var removeIndex = this_1.listenerArray.findIndex(function (obj) { + return obj.functionName === functionName && + obj.CMIElement === CMIElement && + obj.callback === callback; + }); + if (removeIndex !== -1) { + this_1.listenerArray.splice(removeIndex, 1); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + var this_1 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; } - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; - this._error_codes = error_codes; - if (settings) { - this.settings = settings; + }; + BaseAPI.prototype.clear = function (listenerName) { + var listenerFunctions = listenerName.split(" "); + var _loop_2 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this_2.listenerArray = this_2.listenerArray.filter(function (obj) { + return obj.functionName !== functionName && obj.CMIElement !== CMIElement; + }); + }; + var this_2 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_2 = _loop_2(i); + if (typeof state_2 === "object") + return state_2.value; } - this.apiLogLevel = this.settings.logLevel; - this.selfReportSessionTime = this.settings.selfReportSessionTime; - } - BaseAPI.prototype.commonReset = function (settings) { - this.settings = __assign(__assign({}, this.settings), settings); - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; }; - BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { - var returnValue = api_constants.global.SCORM_FALSE; - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); + BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + for (var i = 0; i < this.listenerArray.length; i++) { + var listener = this.listenerArray[i]; + var functionsMatch = listener.functionName === functionName; + var listenerHasCMIElement = !!listener.CMIElement; + var CMIElementsMatch = false; + if (CMIElement && + listener.CMIElement && + listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { + CMIElementsMatch = + CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + } + else { + CMIElementsMatch = listener.CMIElement === CMIElement; + } + if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + listener.callback(CMIElement, value); + } } - else if (this.isTerminated()) { - this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); + }; + BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { + if (!message) { + message = this.getLmsErrorMessageDetails(errorNumber); } - else { - if (this.selfReportSessionTime) { - this.cmi.setStartTime(); - } - this.currentState = api_constants.global.STATE_INITIALIZED; + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + this.lastErrorCode = String(errorNumber); + }; + BaseAPI.prototype.clearSCORMError = function (success) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return returnValue; }; - BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { - logMessage = formatMessage(functionName, logMessage, CMIElement); - if (messageLevel >= this.apiLogLevel) { - this.settings.onLogMessage(messageLevel, logMessage); + BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + var _this = this; + if (!CMIElement) { + CMIElement = ""; } - }; - Object.defineProperty(BaseAPI.prototype, "error_codes", { - get: function () { - return this._error_codes; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(BaseAPI.prototype, "settings", { - get: function () { - return this._settings; - }, - set: function (settings) { - this._settings = __assign(__assign({}, this._settings), settings); - }, - enumerable: false, - configurable: true - }); - BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { - return __awaiter(this, void 0, void 0, function () { - var returnValue, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; - this.currentState = api_constants.global.STATE_TERMINATED; - return [4, this.storeData(true)]; - case 1: - result = _a.sent(); - if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); + if (!this.isNotInitialized()) { + console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); + return; + } + function testPattern(a, c, a_pattern) { + var a_match = a.match(a_pattern); + var c_match; + if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { + var a_num = Number(a_match[2]); + var c_num = Number(c_match[2]); + if (a_num === c_num) { + if (a_match[3] === "id") { + return -1; + } + else if (a_match[3] === "type") { + if (c_match[3] === "id") { + return 1; } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - if (checkTerminated) - this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; + else { + return -1; + } + } + else { + return 1; + } } - }); + return a_num - c_num; + } + return null; + } + var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; + var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; + var result = Object.keys(json).map(function (key) { + return [String(key), json[key]]; }); - }; - BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { - var returnValue = ""; - if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.getCMIValue(CMIElement); + result.sort(function (_a, _c) { + var a = _a[0], _b = _a[1]; + var c = _c[0], _d = _c[1]; + var test; + if ((test = testPattern(a, c, int_pattern)) !== null) { + return test; } - catch (e) { - returnValue = this.handleValueAccessException(e, returnValue); + if ((test = testPattern(a, c, obj_pattern)) !== null) { + return test; } - this.processListeners(callbackName, CMIElement); - } - this.apiLog(callbackName, ": returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - if (returnValue === undefined) { - return ""; - } - this.clearSCORMError(returnValue); - return returnValue; - }; - BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { - if (value !== undefined) { - value = String(value); - } - var returnValue = api_constants.global.SCORM_FALSE; - if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.setCMIValue(CMIElement, value); + if (a < c) { + return -1; } - catch (e) { - this.handleValueAccessException(e, returnValue); + if (a > c) { + return 1; } - this.processListeners(callbackName, CMIElement, value); - } - if (returnValue === undefined) { - returnValue = api_constants.global.SCORM_FALSE; + return 0; + }); + var obj; + result.forEach(function (element) { + obj = {}; + obj[element[0]] = element[1]; + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); + }); + }; + BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { + if (!this.isNotInitialized()) { + console.error("loadFromJSON can only be called before the call to lmsInitialize."); + return; } - if (String(this.lastErrorCode) === "0") { - if (this.settings.autocommit && !this._timeout) { - this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; + this.startingData = json; + for (var key in json) { + if ({}.hasOwnProperty.call(json, key) && json[key]) { + var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; + var value = json[key]; + if (value["childArray"]) { + for (var i = 0; i < value["childArray"].length; i++) { + this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); + } + } + else if (value.constructor === Object) { + this.loadFromJSON(value, currentCMIElement); + } + else { + this.setCMIValue(currentCMIElement, value); + } } } - this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - this.clearSCORMError(returnValue); - return returnValue; }; - BaseAPI.prototype.commit = function (callbackName_1) { - return __awaiter(this, arguments, void 0, function (callbackName, checkTerminated) { - var returnValue, result; - if (checkTerminated === void 0) { checkTerminated = false; } - return __generator(this, function (_a) { + BaseAPI.prototype.renderCMIToJSONString = function () { + var cmi = this.cmi; + if (this.settings.sendFullCommit) { + return JSON.stringify({ cmi: cmi }); + } + return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); + }; + BaseAPI.prototype.renderCMIToJSONObject = function () { + return JSON.parse(this.renderCMIToJSONString()); + }; + BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { + var api, genericError, process, debouncedProcess; + var _this = this; + if (immediate === void 0) { immediate = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: - this.clearScheduledCommit(); - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; - return [4, this.storeData(false)]; - case 1: - result = _a.sent(); - if (result.errorCode && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); + api = this; + genericError = { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: this.error_codes.GENERAL, + }; + if (immediate) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.transformResponse(response)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); }); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - this.apiLog(callbackName, " Result: " + returnValue, api_constants.global.LOG_LEVEL_DEBUG, "HttpRequest"); - if (checkTerminated) - this.lastErrorCode = "0"; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + var response, e_1; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + params = settings.requestHandler(params); + return [4, this.performFetch(url, params)]; + case 1: + response = _a.sent(); + return [2, this.transformResponse(response)]; + case 2: + e_1 = _a.sent(); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + api.processListeners("CommitError"); + return [2, genericError]; + case 3: return [2]; + } + }); + }); }; + if (!this.settings.asyncCommit) return [3, 1]; + debouncedProcess = debounce(process, 500, immediate); + debouncedProcess(url, params, this.settings); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + case 1: return [4, process(url, params, this.settings)]; + case 2: return [2, _a.sent()]; } }); }); }; - BaseAPI.prototype.getLastError = function (callbackName) { - var returnValue = String(this.lastErrorCode); - this.processListeners(callbackName); - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; + BaseAPI.prototype.scheduleCommit = function (when, callback) { + this._timeout = new ScheduledCommit(this, when, callback); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); }; - BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); - this.processListeners(callbackName); + BaseAPI.prototype.clearScheduledCommit = function () { + if (this._timeout) { + this._timeout.cancel(); + this._timeout = undefined; + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; }; - BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); - this.processListeners(callbackName); - } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; + BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { + return (Object.hasOwnProperty.call(refObject, attribute) || + Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || + attribute in refObject); }; - BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { - if (this.isNotInitialized()) { - this.throwSCORMError(beforeInitError); - return false; + BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { + if (e instanceof exceptions/* ValidationError */.yI) { + this.lastErrorCode = String(e.errorCode); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; } - else if (checkTerminated && this.isTerminated()) { - this.throwSCORMError(afterTermError); - return false; + else { + if (e instanceof Error && e.message) { + console.error(e.message); + } + else { + console.error(e); + } + this.throwSCORMError(this._error_codes.GENERAL); } - return true; - }; - BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { - if (_detail === void 0) { _detail = false; } - throw new Error("The getLmsErrorMessageDetails method has not been implemented"); - }; - BaseAPI.prototype.getCMIValue = function (_CMIElement) { - throw new Error("The getCMIValue method has not been implemented"); + return returnValue; }; - BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { - throw new Error("The setCMIValue method has not been implemented"); + BaseAPI.prototype.performFetch = function (url, params) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + return [2, fetch(url, { + method: "POST", + body: params instanceof Array ? params.join("&") : JSON.stringify(params), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + credentials: this.settings.xhrWithCredentials ? "include" : undefined, + keepalive: true, + })]; + }); + }); }; - BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { - if (!CMIElement || CMIElement === "") { - return api_constants.global.SCORM_FALSE; - } - var structure = CMIElement.split("."); - var refObject = this; - var returnValue = api_constants.global.SCORM_FALSE; - var foundFirstIndex = false; - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - var attribute = structure[idx]; - if (idx === structure.length - 1) { - if (scorm2004 && attribute.substring(0, 8) === "{target=") { - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); - } - else { - refObject = __assign(__assign({}, refObject), { attribute: value }); - } - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (stringMatches(CMIElement, "\\.correct_responses\\.\\d+") && - this.isInitialized()) { - this.validateCorrectResponse(CMIElement, value); - } - if (!scorm2004 || this.lastErrorCode === "0") { - refObject[attribute] = value; - returnValue = api_constants.global.SCORM_TRUE; - } - } - } - else { - refObject = refObject[attribute]; - if (!refObject) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - foundFirstIndex = true; + BaseAPI.prototype.transformResponse = function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, _a; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; + return [4, this.settings.responseHandler(response)]; + case 1: + _a = _c.sent(); + return [3, 4]; + case 2: return [4, response.json()]; + case 3: + _a = _c.sent(); + _c.label = 4; + case 4: + result = _a; + if (response.status >= 200 && + response.status <= 299 && + (result.result === true || + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { + this.processListeners("CommitSuccess"); } else { - var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); - foundFirstIndex = true; - if (!newChild) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (refObject.initialized) - newChild.initialize(); - refObject.childArray.push(newChild); - refObject = newChild; - } + this.processListeners("CommitError"); } - idx++; - } + return [2, result]; } - } - } - if (returnValue === api_constants.global.SCORM_FALSE) { - this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants.global.LOG_LEVEL_WARNING); - } - return returnValue; + }); + }); }; - BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { - if (!CMIElement || CMIElement === "") { - return ""; - } - var structure = CMIElement.split("."); - var refObject = this; - var attribute = null; - var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - attribute = structure[idx]; - if (!scorm2004) { - if (idx === structure.length - 1) { - if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - } - else { - if (String(attribute).substring(0, 8) === "{target=" && - typeof refObject._isTargetValid == "function") { - var target = String(attribute).substring(8, String(attribute).length - 9); - return refObject._isTargetValid(target); - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - refObject = refObject[attribute]; - if (refObject === undefined) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - } - else { - this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); - break; - } - idx++; - } - } - } - if (refObject === null || refObject === undefined) { - if (!scorm2004) { - if (attribute === "_children") { - this.throwSCORMError(error_codes.scorm12.CHILDREN_ERROR); - } - else if (attribute === "_count") { - this.throwSCORMError(error_codes.scorm12.COUNT_ERROR); - } - } - } - else { - return refObject; + return BaseAPI; +}()); +/* harmony default export */ var src_BaseAPI = (BaseAPI); + + +/***/ }), + +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); + + + + +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { + var _this = _super.call(this) || this; + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; + return _this; + } + Object.defineProperty(CMIArray.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIArray.prototype, "_count", { + get: function () { + return this.childArray.length; + }, + set: function (_count) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + CMIArray.prototype.toJSON = function () { + this.jsonString = true; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; } + delete this.jsonString; + return result; }; - BaseAPI.prototype.isInitialized = function () { - return this.currentState === api_constants.global.STATE_INITIALIZED; - }; - BaseAPI.prototype.isNotInitialized = function () { - return this.currentState === api_constants.global.STATE_NOT_INITIALIZED; + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; + } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseCMI.prototype, "start_time", { + get: function () { + return this._start_time; + }, + enumerable: false, + configurable: true + }); + BaseCMI.prototype.initialize = function () { + this._initialized = true; }; - BaseAPI.prototype.isTerminated = function () { - return this.currentState === api_constants.global.STATE_TERMINATED; + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); }; - BaseAPI.prototype.on = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - for (var i = 0; i < listenerFunctions.length; i++) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); + return BaseCMI; +}()); + +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; +}(BaseCMI)); + + + +/***/ }), + +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { + var _this = _super.call(this) || this; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; + return _this; + } + Object.defineProperty(CMIScore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this.__error_class(this.__invalid_error_code); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "raw", { + get: function () { + return this._raw; + }, + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; } - this.listenerArray.push({ - functionName: functionName, - CMIElement: CMIElement, - callback: callback, - }); - this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "min", { + get: function () { + return this._min; + }, + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "max", { + get: function () { + return this._max; + }, + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; + } + }, + enumerable: false, + configurable: true + }); + CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; + }; + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); +function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { + if (typeof value !== "string") { + return false; + } + var formatRegex = new RegExp(regexPattern); + var matches = value.match(formatRegex); + if (allowEmptyString && value === "") { + return true; + } + if (value === undefined || !matches || matches[0] === "") { + throw new errorClass(errorCode); + } + return true; +} +function checkValidRange(value, rangePattern, errorCode, errorClass) { + var ranges = rangePattern.split("#"); + value = value * 1.0; + if (value >= ranges[0]) { + if (ranges[1] === "*" || value <= ranges[1]) { + return true; + } + else { + throw new errorClass(errorCode); } + } + else { + throw new errorClass(errorCode); + } +} + + +/***/ }), + +/***/ 989: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Y: function() { return /* binding */ CMI; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/scorm12/validation.ts +var validation = __webpack_require__(915); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/cmi/aicc/core.ts + + + + + + + + + +var CMICore = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMICore, _super); + function CMICore() { + var _this = _super.call(this) || this; + _this.__children = api_constants/* default */.A.scorm12.core_children; + _this._student_id = ""; + _this._student_name = ""; + _this._lesson_location = ""; + _this._credit = ""; + _this._lesson_status = "not attempted"; + _this._entry = ""; + _this._total_time = ""; + _this._lesson_mode = "normal"; + _this._exit = ""; + _this._session_time = "00:00:00"; + _this._suspend_data = ""; + _this.score = new score/* CMIScore */._({ + score_children: api_constants/* default */.A.scorm12.score_children, + score_range: regex/* default */.A.scorm12.score_range, + invalidErrorCode: error_codes/* default */.A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: error_codes/* default */.A.scorm12.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: exceptions/* Scorm12ValidationError */.tQ, + }); + return _this; + } + CMICore.prototype.initialize = function () { + var _a; + _super.prototype.initialize.call(this); + (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); }; - BaseAPI.prototype.off = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - var _loop_1 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); + Object.defineProperty(CMICore.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_id", { + get: function () { + return this._student_id; + }, + set: function (student_id) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } - var removeIndex = this_1.listenerArray.findIndex(function (obj) { - return obj.functionName === functionName && - obj.CMIElement === CMIElement && - obj.callback === callback; - }); - if (removeIndex !== -1) { - this_1.listenerArray.splice(removeIndex, 1); - this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); + else { + this._student_id = student_id; } - }; - var this_1 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_1 = _loop_1(i); - if (typeof state_1 === "object") - return state_1.value; - } - }; - BaseAPI.prototype.clear = function (listenerName) { - var listenerFunctions = listenerName.split(" "); - var _loop_2 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "student_name", { + get: function () { + return this._student_name; + }, + set: function (student_name) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } - this_2.listenerArray = this_2.listenerArray.filter(function (obj) { - return obj.functionName !== functionName && obj.CMIElement !== CMIElement; - }); - }; - var this_2 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; - } - }; - BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { - this.apiLog(functionName, value, api_constants.global.LOG_LEVEL_INFO, CMIElement); - for (var i = 0; i < this.listenerArray.length; i++) { - var listener = this.listenerArray[i]; - var functionsMatch = listener.functionName === functionName; - var listenerHasCMIElement = !!listener.CMIElement; - var CMIElementsMatch = false; - if (CMIElement && - listener.CMIElement && - listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { - CMIElementsMatch = - CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + else { + this._student_name = student_name; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_location", { + get: function () { + return this._lesson_location; + }, + set: function (lesson_location) { + if ((0,validation/* check12ValidFormat */.p)(lesson_location, regex/* default */.A.scorm12.CMIString256, true)) { + this._lesson_location = lesson_location; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "credit", { + get: function () { + return this._credit; + }, + set: function (credit) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } else { - CMIElementsMatch = listener.CMIElement === CMIElement; + this._credit = credit; } - if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { - this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants.global.LOG_LEVEL_INFO, CMIElement); - listener.callback(CMIElement, value); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_status", { + get: function () { + return this._lesson_status; + }, + set: function (lesson_status) { + if (this.initialized) { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus)) { + this._lesson_status = lesson_status; + } } - } - }; - BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { - if (!message) { - message = this.getLmsErrorMessageDetails(errorNumber); - } - this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants.global.LOG_LEVEL_ERROR); - this.lastErrorCode = String(errorNumber); - }; - BaseAPI.prototype.clearSCORMError = function (success) { - if (success !== undefined && success !== api_constants.global.SCORM_FALSE) { - this.lastErrorCode = "0"; - } - }; - BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { - var _this = this; - if (!CMIElement) { - CMIElement = ""; - } - if (!this.isNotInitialized()) { - console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); - return; - } - function testPattern(a, c, a_pattern) { - var a_match = a.match(a_pattern); - var c_match; - if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { - var a_num = Number(a_match[2]); - var c_num = Number(c_match[2]); - if (a_num === c_num) { - if (a_match[3] === "id") { - return -1; - } - else if (a_match[3] === "type") { - if (c_match[3] === "id") { - return 1; - } - else { - return -1; - } - } - else { - return 1; - } + else { + if ((0,validation/* check12ValidFormat */.p)(lesson_status, regex/* default */.A.scorm12.CMIStatus2)) { + this._lesson_status = lesson_status; } - return a_num - c_num; } - return null; - } - var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; - var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; - var result = Object.keys(json).map(function (key) { - return [String(key), json[key]]; - }); - result.sort(function (_a, _c) { - var a = _a[0], _b = _a[1]; - var c = _c[0], _d = _c[1]; - var test; - if ((test = testPattern(a, c, int_pattern)) !== null) { - return test; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "entry", { + get: function () { + return this._entry; + }, + set: function (entry) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } - if ((test = testPattern(a, c, obj_pattern)) !== null) { - return test; + else { + this._entry = entry; } - if (a < c) { - return -1; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "total_time", { + get: function () { + return this._total_time; + }, + set: function (total_time) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } - if (a > c) { - return 1; + else { + this._total_time = total_time; } - return 0; - }); - var obj; - result.forEach(function (element) { - obj = {}; - obj[element[0]] = element[1]; - _this.loadFromJSON(unflatten(obj), CMIElement); - }); - }; - BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { - if (!this.isNotInitialized()) { - console.error("loadFromJSON can only be called before the call to lmsInitialize."); - return; - } - CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; - this.startingData = json; - for (var key in json) { - if ({}.hasOwnProperty.call(json, key) && json[key]) { - var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; - var value = json[key]; - if (value["childArray"]) { - for (var i = 0; i < value["childArray"].length; i++) { - this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); - } - } - else if (value.constructor === Object) { - this.loadFromJSON(value, currentCMIElement); - } - else { - this.setCMIValue(currentCMIElement, value); - } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "lesson_mode", { + get: function () { + return this._lesson_mode; + }, + set: function (lesson_mode) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._lesson_mode = lesson_mode; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "exit", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._exit; + }, + set: function (exit) { + if ((0,validation/* check12ValidFormat */.p)(exit, regex/* default */.A.scorm12.CMIExit, true)) { + this._exit = exit; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "session_time", { + get: function () { + if (!this.jsonString) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.WRITE_ONLY_ELEMENT); } + return this._session_time; + }, + set: function (session_time) { + if ((0,validation/* check12ValidFormat */.p)(session_time, regex/* default */.A.scorm12.CMITimespan)) { + this._session_time = session_time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMICore.prototype, "suspend_data", { + get: function () { + return this._suspend_data; + }, + set: function (suspend_data) { + if ((0,validation/* check12ValidFormat */.p)(suspend_data, regex/* default */.A.scorm12.CMIString4096, true)) { + this._suspend_data = suspend_data; + } + }, + enumerable: false, + configurable: true + }); + CMICore.prototype.getCurrentTotalTime = function (start_time) { + var sessionTime = this._session_time; + var startTime = start_time; + if (typeof startTime !== "undefined" && startTime !== null) { + var seconds = new Date().getTime() - startTime; + sessionTime = utilities/* getSecondsAsHHMMSS */.UZ(seconds / 1000); } + return utilities/* addHHMMSSTimeStrings */.HT(this._total_time, sessionTime, new RegExp(regex/* default */.A.scorm12.CMITimespan)); }; - BaseAPI.prototype.renderCMIToJSONString = function () { - var cmi = this.cmi; - if (this.settings.sendFullCommit) { - return JSON.stringify({ cmi: cmi }); - } - return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); - }; - BaseAPI.prototype.renderCMIToJSONObject = function () { - return JSON.parse(this.renderCMIToJSONString()); - }; - BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { - return __awaiter(this, arguments, void 0, function (url, params, immediate) { - var api, genericError, process, debouncedProcess; - var _this = this; - if (immediate === void 0) { immediate = false; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - api = this; - genericError = { - result: api_constants.global.SCORM_FALSE, - errorCode: this.error_codes.GENERAL, - }; - if (immediate) { - this.performFetch(url, params).then(function (response) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.transformResponse(response)]; - case 1: - _a.sent(); - return [2]; - } - }); - }); }); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - process = function (url, params, settings) { return __awaiter(_this, void 0, void 0, function () { - var response, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - params = settings.requestHandler(params); - return [4, this.performFetch(url, params)]; - case 1: - response = _a.sent(); - return [2, this.transformResponse(response)]; - case 2: - e_1 = _a.sent(); - this.apiLog("processHttpRequest", e_1, api_constants.global.LOG_LEVEL_ERROR); - api.processListeners("CommitError"); - return [2, genericError]; - case 3: return [2]; - } - }); - }); }; - if (!this.settings.asyncCommit) return [3, 1]; - debouncedProcess = debounce(process, 500, immediate); - debouncedProcess(url, params, this.settings); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - case 1: return [4, process(url, params, this.settings)]; - case 2: return [2, _a.sent()]; - } - }); - }); - }; - BaseAPI.prototype.scheduleCommit = function (when, callback) { - this._timeout = new ScheduledCommit(this, when, callback); - this.apiLog("scheduleCommit", "scheduled", api_constants.global.LOG_LEVEL_DEBUG, ""); + CMICore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + student_id: this.student_id, + student_name: this.student_name, + lesson_location: this.lesson_location, + credit: this.credit, + lesson_status: this.lesson_status, + entry: this.entry, + lesson_mode: this.lesson_mode, + exit: this.exit, + session_time: this.session_time, + score: this.score, + }; + delete this.jsonString; + return result; }; - BaseAPI.prototype.clearScheduledCommit = function () { - if (this._timeout) { - this._timeout.cancel(); - this._timeout = undefined; - this.apiLog("clearScheduledCommit", "cleared", api_constants.global.LOG_LEVEL_DEBUG, ""); - } + return CMICore; +}(base_cmi/* BaseCMI */.J)); + + +// EXTERNAL MODULE: ./src/cmi/scorm12/objectives.ts +var objectives = __webpack_require__(176); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_data.ts +var scorm12_student_data = __webpack_require__(532); +// EXTERNAL MODULE: ./src/cmi/scorm12/student_preference.ts +var student_preference = __webpack_require__(181); +// EXTERNAL MODULE: ./src/cmi/scorm12/interactions.ts +var interactions = __webpack_require__(833); +;// ./src/cmi/scorm12/cmi.ts + + + + + + + + + + + + +var CMI = (function (_super) { + (0,tslib_es6/* __extends */.C6)(CMI, _super); + function CMI(cmi_children, student_data, initialized) { + var _this = _super.call(this) || this; + _this.__children = ""; + _this.__version = "3.4"; + _this._launch_data = ""; + _this._comments = ""; + _this._comments_from_lms = ""; + if (initialized) + _this.initialize(); + _this.__children = cmi_children + ? cmi_children + : api_constants/* default */.A.scorm12.cmi_children; + _this.core = new CMICore(); + _this.objectives = new objectives/* CMIObjectives */.C(); + _this.student_data = student_data ? student_data : new scorm12_student_data/* CMIStudentData */.X(); + _this.student_preference = new student_preference/* CMIStudentPreference */.G(); + _this.interactions = new interactions/* CMIInteractions */.Xb(); + return _this; + } + CMI.prototype.initialize = function () { + var _a, _b, _c, _d, _e; + _super.prototype.initialize.call(this); + (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); + (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); + (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); + (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); }; - BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { - return (Object.hasOwnProperty.call(refObject, attribute) || - Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || - attribute in refObject); + CMI.prototype.toJSON = function () { + this.jsonString = true; + var result = { + suspend_data: this.suspend_data, + launch_data: this.launch_data, + comments: this.comments, + comments_from_lms: this.comments_from_lms, + core: this.core, + objectives: this.objectives, + student_data: this.student_data, + student_preference: this.student_preference, + interactions: this.interactions, + }; + delete this.jsonString; + return result; }; - BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { - if (e instanceof ValidationError) { - this.lastErrorCode = String(e.errorCode); - returnValue = api_constants.global.SCORM_FALSE; - } - else { - if (e instanceof Error && e.message) { - console.error(e.message); + Object.defineProperty(CMI.prototype, "_version", { + get: function () { + return this.__version; + }, + set: function (_version) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.INVALID_SET_VALUE); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "suspend_data", { + get: function () { + var _a; + return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; + }, + set: function (suspend_data) { + if (this.core) { + this.core.suspend_data = suspend_data; } - else { - console.error(e); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "launch_data", { + get: function () { + return this._launch_data; + }, + set: function (launch_data) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); } - this.throwSCORMError(this._error_codes.GENERAL); - } - return returnValue; - }; - BaseAPI.prototype.performFetch = function (url, params) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, fetch(url, { - method: "POST", - body: params instanceof Array ? params.join("&") : JSON.stringify(params), - headers: __assign(__assign({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), - credentials: this.settings.xhrWithCredentials ? "include" : undefined, - keepalive: true, - })]; - }); - }); - }; - BaseAPI.prototype.transformResponse = function (response) { - return __awaiter(this, void 0, void 0, function () { - var result, _a; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; - return [4, this.settings.responseHandler(response)]; - case 1: - _a = _c.sent(); - return [3, 4]; - case 2: return [4, response.json()]; - case 3: - _a = _c.sent(); - _c.label = 4; - case 4: - result = _a; - if (response.status >= 200 && - response.status <= 299 && - (result.result === true || - result.result === api_constants.global.SCORM_TRUE)) { - this.processListeners("CommitSuccess"); - } - else { - this.processListeners("CommitError"); - } - return [2, result]; - } - }); - }); + else { + this._launch_data = launch_data; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments", { + get: function () { + return this._comments; + }, + set: function (comments) { + if ((0,validation/* check12ValidFormat */.p)(comments, regex/* default */.A.scorm12.CMIString4096, true)) { + this._comments = comments; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMI.prototype, "comments_from_lms", { + get: function () { + return this._comments_from_lms; + }, + set: function (comments_from_lms) { + if (this.initialized) { + throw new exceptions/* Scorm12ValidationError */.tQ(error_codes/* default */.A.scorm12.READ_ONLY_ELEMENT); + } + else { + this._comments_from_lms = comments_from_lms; + } + }, + enumerable: false, + configurable: true + }); + CMI.prototype.getCurrentTotalTime = function () { + return this.core.getCurrentTotalTime(this.start_time); }; - return BaseAPI; -}()); -/* harmony default export */ var src_BaseAPI = (BaseAPI); + return CMI; +}(base_cmi/* BaseRootCMI */.r)); -;// ./src/constants/regex.ts -var regex_scorm12 = { - CMIString256: "^.{0,255}$", - CMIString4096: "^.{0,4096}$", - CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", - CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", - CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", - CMIFeedback: "^.{0,255}$", - CMIIndex: "[._](\\d+).", - CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", - CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", - CMIExit: "^(time-out|suspend|logout|)$", - CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", - CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", - NAVEvent: "^(previous|continue)$", - score_range: "0#100", - audio_range: "-1#100", - speed_range: "-100#100", - weighting_range: "-100#100", - text_range: "-1#1", -}; -var regex_aicc = __assign(__assign({}, regex_scorm12), { - CMIIdentifier: "^\\w{1,255}$", -}); -var regex_scorm2004 = { - CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", - CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", - CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", - CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", - CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", - CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", - CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", - CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", - CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", - CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", - CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", - CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", - CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", - CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", - CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", - CMIFeedback: "^.*$", - CMIIndex: "[._](\\d+).", - CMIIndexStore: ".N(\\d+).", - CMICStatus: "^(completed|incomplete|not attempted|unknown)$", - CMISStatus: "^(passed|failed|unknown)$", - CMIExit: "^(time-out|suspend|logout|normal)$", - CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", - CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", - NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", - NAVBoolean: "^(unknown|true|false$)", - NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", - scaled_range: "-1#1", - audio_range: "0#*", - speed_range: "0#*", - text_range: "-1#1", - progress_range: "0#1", -}; -var Regex = { - aicc: regex_aicc, - scorm12: regex_scorm12, - scorm2004: regex_scorm2004, -}; -/* harmony default export */ var regex = (Regex); -;// ./src/cmi/common/validation.ts -function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { - if (typeof value !== "string") { - return false; - } - var formatRegex = new RegExp(regexPattern); - var matches = value.match(formatRegex); - if (allowEmptyString && value === "") { - return true; - } - if (value === undefined || !matches || matches[0] === "") { - throw new errorClass(errorCode); - } - return true; -} -function checkValidRange(value, rangePattern, errorCode, errorClass) { - var ranges = rangePattern.split("#"); - value = value * 1.0; - if (value >= ranges[0]) { - if (ranges[1] === "*" || value <= ranges[1]) { - return true; - } - else { - throw new errorClass(errorCode); - } - } - else { - throw new errorClass(errorCode); - } -} +/***/ }), -;// ./src/cmi/scorm12/validation.ts +/***/ 833: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Oh: function() { return /* binding */ CMIInteractionsObjectivesObject; }, +/* harmony export */ WP: function() { return /* binding */ CMIInteractionsObject; }, +/* harmony export */ Xb: function() { return /* binding */ CMIInteractions; }, +/* harmony export */ cb: function() { return /* binding */ CMIInteractionsCorrectResponsesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(635); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(589); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(784); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(417); -function check12ValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, error_codes.scorm12.TYPE_MISMATCH, Scorm12ValidationError, allowEmptyString); -} -function check12ValidRange(value, rangePattern, allowEmptyString) { - if (!allowEmptyString && value === "") { - throw new Scorm12ValidationError(error_codes.scorm12.VALUE_OUT_OF_RANGE); - } - return checkValidRange(value, rangePattern, error_codes.scorm12.VALUE_OUT_OF_RANGE, Scorm12ValidationError); -} -;// ./src/cmi/common/score.ts +var CMIInteractions = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractions, _super); + function CMIInteractions() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.interactions_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIInteractions; +}(_common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B)); -var scorm12_constants = api_constants.scorm12; -var scorm12_regex = regex.scorm12; -var score_scorm12_error_codes = error_codes.scorm12; -var CMIScore = (function (_super) { - __extends(CMIScore, _super); - function CMIScore(params) { +var CMIInteractionsObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObject, _super); + function CMIInteractionsObject() { var _this = _super.call(this) || this; - _this._raw = ""; - _this._min = ""; - _this.__children = params.score_children || scorm12_constants.score_children; - _this.__score_range = !params.score_range - ? false - : scorm12_regex.score_range; - _this._max = params.max || params.max === "" ? params.max : "100"; - _this.__invalid_error_code = - params.invalidErrorCode || score_scorm12_error_codes.INVALID_SET_VALUE; - _this.__invalid_type_code = - params.invalidTypeCode || score_scorm12_error_codes.TYPE_MISMATCH; - _this.__invalid_range_code = - params.invalidRangeCode || score_scorm12_error_codes.VALUE_OUT_OF_RANGE; - _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; - _this.__error_class = params.errorClass; + _this._id = ""; + _this._time = ""; + _this._type = ""; + _this._weighting = ""; + _this._student_response = ""; + _this._result = ""; + _this._latency = ""; + _this.objectives = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.objectives_children, + }); + _this.correct_responses = new _common_array__WEBPACK_IMPORTED_MODULE_0__/* .CMIArray */ .B({ + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ, + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.correct_responses_children, + }); return _this; } - Object.defineProperty(CMIScore.prototype, "_children", { + CMIInteractionsObject.prototype.initialize = function () { + var _a, _b; + _super.prototype.initialize.call(this); + (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); + (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); + }; + Object.defineProperty(CMIInteractionsObject.prototype, "id", { get: function () { - return this.__children; + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._id; }, - set: function (_children) { - throw new this.__error_class(this.__invalid_error_code); + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "time", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._time; + }, + set: function (time) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(time, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITime)) { + this._time = time; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "type", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._type; + }, + set: function (type) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(type, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIType)) { + this._type = type; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._weighting; + }, + set: function (weighting) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIDecimal) && + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidRange */ .h)(weighting, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.weighting_range)) { + this._weighting = weighting; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._student_response; + }, + set: function (student_response) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(student_response, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._student_response = student_response; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "result", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._result; + }, + set: function (result) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(result, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIResult)) { + this._result = result; + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + get: function () { + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._latency; + }, + set: function (latency) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(latency, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMITimespan)) { + this._latency = latency; + } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIScore.prototype, "raw", { + CMIInteractionsObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + time: this.time, + type: this.type, + weighting: this.weighting, + student_response: this.student_response, + result: this.result, + latency: this.latency, + objectives: this.objectives, + correct_responses: this.correct_responses, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsObjectivesObject, _super); + function CMIInteractionsObjectivesObject() { + var _this = _super.call(this) || this; + _this._id = ""; + return _this; + } + Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { get: function () { - return this._raw; + return this._id; }, - set: function (raw) { - if (checkValidFormat(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._raw = raw; + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIScore.prototype, "min", { + CMIInteractionsObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + +var CMIInteractionsCorrectResponsesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(CMIInteractionsCorrectResponsesObject, _super); + function CMIInteractionsCorrectResponsesObject() { + var _this = _super.call(this) || this; + _this._pattern = ""; + return _this; + } + Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { get: function () { - return this._min; + if (!this.jsonString) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_3__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.WRITE_ONLY_ELEMENT); + } + return this._pattern; }, - set: function (min) { - if (checkValidFormat(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._min = min; + set: function (pattern) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .check12ValidFormat */ .p)(pattern, _constants_regex__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.scorm12.CMIFeedback, true)) { + this._pattern = pattern; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMIScore.prototype, "max", { + CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + pattern: this._pattern, + }; + delete this.jsonString; + return result; + }; + return CMIInteractionsCorrectResponsesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_4__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 331: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ A: function() { return /* binding */ NAV; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(417); + + + + +var NAV = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(NAV, _super); + function NAV() { + var _this = _super.call(this) || this; + _this._event = ""; + return _this; + } + Object.defineProperty(NAV.prototype, "event", { get: function () { - return this._max; + return this._event; }, - set: function (max) { - if (checkValidFormat(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._max = max; + set: function (event) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_1__/* .check12ValidFormat */ .p)(event, _constants_regex__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.NAVEvent)) { + this._event = event; } }, enumerable: false, configurable: true }); - CMIScore.prototype.toJSON = function () { + NAV.prototype.toJSON = function () { this.jsonString = true; var result = { - raw: this.raw, - min: this.min, - max: this.max, + event: this.event, }; delete this.jsonString; return result; }; - return CMIScore; -}(BaseCMI)); + return NAV; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); -;// ./src/cmi/aicc/core.ts +/***/ }), +/***/ 176: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C: function() { return /* binding */ CMIObjectives; }, +/* harmony export */ N: function() { return /* binding */ CMIObjectivesObject; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _common_score__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(434); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(417); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(784); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(915); +/* harmony import */ var _common_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(589); -var CMICore = (function (_super) { - __extends(CMICore, _super); - function CMICore() { + + + +var CMIObjectives = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectives, _super); + function CMIObjectives() { + return _super.call(this, { + children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.objectives_children, + errorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, + }) || this; + } + return CMIObjectives; +}(_common_array__WEBPACK_IMPORTED_MODULE_7__/* .CMIArray */ .B)); + +var CMIObjectivesObject = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__extends */ .C6)(CMIObjectivesObject, _super); + function CMIObjectivesObject() { var _this = _super.call(this) || this; - _this.__children = api_constants.scorm12.core_children; - _this._student_id = ""; - _this._student_name = ""; - _this._lesson_location = ""; - _this._credit = ""; - _this._lesson_status = "not attempted"; - _this._entry = ""; - _this._total_time = ""; - _this._lesson_mode = "normal"; - _this._exit = ""; - _this._session_time = "00:00:00"; - _this._suspend_data = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, + _this._id = ""; + _this._status = ""; + _this.score = new _common_score__WEBPACK_IMPORTED_MODULE_1__/* .CMIScore */ ._({ + score_children: _constants_api_constants__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.scorm12.score_children, + score_range: _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.score_range, + invalidErrorCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE, + invalidTypeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, + invalidRangeCode: _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, + errorClass: _exceptions__WEBPACK_IMPORTED_MODULE_5__/* .Scorm12ValidationError */ .tQ, }); return _this; } - CMICore.prototype.initialize = function () { - var _a; - _super.prototype.initialize.call(this); - (_a = this.score) === null || _a === void 0 ? void 0 : _a.initialize(); - }; - Object.defineProperty(CMICore.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMICore.prototype, "student_id", { + Object.defineProperty(CMIObjectivesObject.prototype, "id", { get: function () { - return this._student_id; + return this._id; }, - set: function (student_id) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._student_id = student_id; + set: function (id) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(id, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIIdentifier)) { + this._id = id; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "student_name", { + Object.defineProperty(CMIObjectivesObject.prototype, "status", { get: function () { - return this._student_name; + return this._status; }, - set: function (student_name) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._student_name = student_name; + set: function (status) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_6__/* .check12ValidFormat */ .p)(status, _constants_regex__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.CMIStatus2)) { + this._status = status; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "lesson_location", { + CMIObjectivesObject.prototype.toJSON = function () { + this.jsonString = true; + var result = { + id: this.id, + status: this.status, + score: this.score, + }; + delete this.jsonString; + return result; + }; + return CMIObjectivesObject; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 532: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ X: function() { return /* binding */ CMIStudentData; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + +var CMIStudentData = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIStudentData, _super); + function CMIStudentData(student_data_children) { + var _this = _super.call(this) || this; + _this._mastery_score = ""; + _this._max_time_allowed = ""; + _this._time_limit_action = ""; + _this.__children = student_data_children + ? student_data_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_data_children; + return _this; + } + Object.defineProperty(CMIStudentData.prototype, "_children", { get: function () { - return this._lesson_location; + return this.__children; }, - set: function (lesson_location) { - if (check12ValidFormat(lesson_location, regex.scorm12.CMIString256, true)) { - this._lesson_location = lesson_location; - } + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "credit", { + Object.defineProperty(CMIStudentData.prototype, "mastery_score", { get: function () { - return this._credit; + return this._mastery_score; }, - set: function (credit) { + set: function (mastery_score) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); } else { - this._credit = credit; + this._mastery_score = mastery_score; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "lesson_status", { + Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { get: function () { - return this._lesson_status; + return this._max_time_allowed; }, - set: function (lesson_status) { + set: function (max_time_allowed) { if (this.initialized) { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus)) { - this._lesson_status = lesson_status; - } + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); } else { - if (check12ValidFormat(lesson_status, regex.scorm12.CMIStatus2)) { - this._lesson_status = lesson_status; - } + this._max_time_allowed = max_time_allowed; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "entry", { + Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { get: function () { - return this._entry; + return this._time_limit_action; }, - set: function (entry) { + set: function (time_limit_action) { if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.READ_ONLY_ELEMENT); } else { - this._entry = entry; + this._time_limit_action = time_limit_action; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "total_time", { + CMIStudentData.prototype.toJSON = function () { + this.jsonString = true; + var result = { + mastery_score: this.mastery_score, + max_time_allowed: this.max_time_allowed, + time_limit_action: this.time_limit_action, + }; + delete this.jsonString; + return result; + }; + return CMIStudentData; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 181: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ G: function() { return /* binding */ CMIStudentPreference; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(635); +/* harmony import */ var _common_base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(340); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(915); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(417); + + + + + + + +var CMIStudentPreference = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__extends */ .C6)(CMIStudentPreference, _super); + function CMIStudentPreference(student_preference_children) { + var _this = _super.call(this) || this; + _this._audio = ""; + _this._language = ""; + _this._speed = ""; + _this._text = ""; + _this.__children = student_preference_children + ? student_preference_children + : _constants_api_constants__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12.student_preference_children; + return _this; + } + Object.defineProperty(CMIStudentPreference.prototype, "_children", { get: function () { - return this._total_time; + return this.__children; }, - set: function (total_time) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._total_time = total_time; - } + set: function (_children) { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.INVALID_SET_VALUE); }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "lesson_mode", { + Object.defineProperty(CMIStudentPreference.prototype, "audio", { get: function () { - return this._lesson_mode; + return this._audio; }, - set: function (lesson_mode) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._lesson_mode = lesson_mode; + set: function (audio) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(audio, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.audio_range)) { + this._audio = audio; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "exit", { + Object.defineProperty(CMIStudentPreference.prototype, "language", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._exit; + return this._language; }, - set: function (exit) { - if (check12ValidFormat(exit, regex.scorm12.CMIExit, true)) { - this._exit = exit; + set: function (language) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(language, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMIString256)) { + this._language = language; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "session_time", { + Object.defineProperty(CMIStudentPreference.prototype, "speed", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._session_time; + return this._speed; }, - set: function (session_time) { - if (check12ValidFormat(session_time, regex.scorm12.CMITimespan)) { - this._session_time = session_time; + set: function (speed) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(speed, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.speed_range)) { + this._speed = speed; } }, enumerable: false, configurable: true }); - Object.defineProperty(CMICore.prototype, "suspend_data", { + Object.defineProperty(CMIStudentPreference.prototype, "text", { get: function () { - return this._suspend_data; + return this._text; }, - set: function (suspend_data) { - if (check12ValidFormat(suspend_data, regex.scorm12.CMIString4096, true)) { - this._suspend_data = suspend_data; + set: function (text) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidFormat */ .p)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.CMISInteger) && + (0,_validation__WEBPACK_IMPORTED_MODULE_4__/* .check12ValidRange */ .h)(text, _constants_regex__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A.scorm12.text_range)) { + this._text = text; } }, enumerable: false, configurable: true }); - CMICore.prototype.getCurrentTotalTime = function (start_time) { - var sessionTime = this._session_time; - var startTime = start_time; - if (typeof startTime !== "undefined" && startTime !== null) { - var seconds = new Date().getTime() - startTime; - sessionTime = getSecondsAsHHMMSS(seconds / 1000); - } - return addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(regex.scorm12.CMITimespan)); - }; - CMICore.prototype.toJSON = function () { + CMIStudentPreference.prototype.toJSON = function () { this.jsonString = true; var result = { - student_id: this.student_id, - student_name: this.student_name, - lesson_location: this.lesson_location, - credit: this.credit, - lesson_status: this.lesson_status, - entry: this.entry, - lesson_mode: this.lesson_mode, - exit: this.exit, - session_time: this.session_time, - score: this.score, + audio: this.audio, + language: this.language, + speed: this.speed, + text: this.text, }; delete this.jsonString; return result; }; - return CMICore; -}(BaseCMI)); + return CMIStudentPreference; +}(_common_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); -;// ./src/cmi/scorm12/objectives.ts +/***/ }), +/***/ 915: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ h: function() { return /* binding */ check12ValidRange; }, +/* harmony export */ p: function() { return /* binding */ check12ValidFormat; } +/* harmony export */ }); +/* harmony import */ var _common_validation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(784); +function check12ValidFormat(value, regexPattern, allowEmptyString) { + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidFormat */ .q)(value, regexPattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.TYPE_MISMATCH, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ, allowEmptyString); +} +function check12ValidRange(value, rangePattern, allowEmptyString) { + if (!allowEmptyString && value === "") { + throw new _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ(_constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE); + } + return (0,_common_validation__WEBPACK_IMPORTED_MODULE_2__/* .checkValidRange */ .W)(value, rangePattern, _constants_error_codes__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.VALUE_OUT_OF_RANGE, _exceptions__WEBPACK_IMPORTED_MODULE_1__/* .Scorm12ValidationError */ .tQ); +} +/***/ }), -var CMIObjectives = (function (_super) { - __extends(CMIObjectives, _super); - function CMIObjectives() { - return _super.call(this, { - children: api_constants.scorm12.objectives_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - }) || this; - } - return CMIObjectives; -}(CMIArray)); +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -var CMIObjectivesObject = (function (_super) { - __extends(CMIObjectivesObject, _super); - function CMIObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; - _this._status = ""; - _this.score = new CMIScore({ - score_children: api_constants.scorm12.score_children, - score_range: regex.scorm12.score_range, - invalidErrorCode: error_codes.scorm12.INVALID_SET_VALUE, - invalidTypeCode: error_codes.scorm12.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm12.VALUE_OUT_OF_RANGE, - errorClass: Scorm12ValidationError, - }); - return _this; - } - Object.defineProperty(CMIObjectivesObject.prototype, "id", { - get: function () { - return this._id; +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + }, + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", + }, + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", + }, + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", + }, + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", + }, + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIObjectivesObject.prototype, "status", { - get: function () { - return this._status; + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", }, - set: function (status) { - if (check12ValidFormat(status, regex.scorm12.CMIStatus2)) { - this._status = status; - } + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", }, - enumerable: false, - configurable: true - }); - CMIObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - status: this.status, - score: this.score, - }; - delete this.jsonString; - return result; - }; - return CMIObjectivesObject; -}(BaseCMI)); - - -;// ./src/cmi/scorm12/student_data.ts - - - - - -var CMIStudentData = (function (_super) { - __extends(CMIStudentData, _super); - function CMIStudentData(student_data_children) { - var _this = _super.call(this) || this; - _this._mastery_score = ""; - _this._max_time_allowed = ""; - _this._time_limit_action = ""; - _this.__children = student_data_children - ? student_data_children - : api_constants.scorm12.student_data_children; - return _this; - } - Object.defineProperty(CMIStudentData.prototype, "_children", { - get: function () { - return this.__children; + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "mastery_score", { - get: function () { - return this._mastery_score; + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", }, - set: function (mastery_score) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._mastery_score = mastery_score; - } + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "max_time_allowed", { - get: function () { - return this._max_time_allowed; + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", }, - set: function (max_time_allowed) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._max_time_allowed = max_time_allowed; - } + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentData.prototype, "time_limit_action", { - get: function () { - return this._time_limit_action; + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", }, - set: function (time_limit_action) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._time_limit_action = time_limit_action; - } + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", }, - enumerable: false, - configurable: true - }); - CMIStudentData.prototype.toJSON = function () { - this.jsonString = true; - var result = { - mastery_score: this.mastery_score, - max_time_allowed: this.max_time_allowed, - time_limit_action: this.time_limit_action, - }; - delete this.jsonString; - return result; - }; - return CMIStudentData; -}(BaseCMI)); + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); -;// ./src/cmi/scorm12/student_preference.ts +/***/ }), +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +/* unused harmony export NAVBoolean */ +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); +/***/ }), +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); -var CMIStudentPreference = (function (_super) { - __extends(CMIStudentPreference, _super); - function CMIStudentPreference(student_preference_children) { - var _this = _super.call(this) || this; - _this._audio = ""; - _this._language = ""; - _this._speed = ""; - _this._text = ""; - _this.__children = student_preference_children - ? student_preference_children - : api_constants.scorm12.student_preference_children; - return _this; - } - Object.defineProperty(CMIStudentPreference.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "audio", { - get: function () { - return this._audio; - }, - set: function (audio) { - if (check12ValidFormat(audio, regex.scorm12.CMISInteger) && - check12ValidRange(audio, regex.scorm12.audio_range)) { - this._audio = audio; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "language", { - get: function () { - return this._language; - }, - set: function (language) { - if (check12ValidFormat(language, regex.scorm12.CMIString256)) { - this._language = language; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "speed", { - get: function () { - return this._speed; - }, - set: function (speed) { - if (check12ValidFormat(speed, regex.scorm12.CMISInteger) && - check12ValidRange(speed, regex.scorm12.speed_range)) { - this._speed = speed; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIStudentPreference.prototype, "text", { - get: function () { - return this._text; - }, - set: function (text) { - if (check12ValidFormat(text, regex.scorm12.CMISInteger) && - check12ValidRange(text, regex.scorm12.text_range)) { - this._text = text; - } - }, - enumerable: false, - configurable: true - }); - CMIStudentPreference.prototype.toJSON = function () { - this.jsonString = true; - var result = { - audio: this.audio, - language: this.language, - speed: this.speed, - text: this.text, - }; - delete this.jsonString; - return result; - }; - return CMIStudentPreference; -}(BaseCMI)); +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); -;// ./src/cmi/scorm12/interactions.ts +/***/ }), +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); +/***/ }), +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ tQ: function() { return /* binding */ Scorm12ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* unused harmony exports AICCValidationError, Scorm2004ValidationError */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); -var CMIInteractions = (function (_super) { - __extends(CMIInteractions, _super); - function CMIInteractions() { - return _super.call(this, { - children: api_constants.scorm12.interactions_children, - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - }) || this; - } - return CMIInteractions; -}(CMIArray)); -var CMIInteractionsObject = (function (_super) { - __extends(CMIInteractionsObject, _super); - function CMIInteractionsObject() { - var _this = _super.call(this) || this; - _this._id = ""; - _this._time = ""; - _this._type = ""; - _this._weighting = ""; - _this._student_response = ""; - _this._result = ""; - _this._latency = ""; - _this.objectives = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.objectives_children, - }); - _this.correct_responses = new CMIArray({ - errorCode: error_codes.scorm12.INVALID_SET_VALUE, - errorClass: Scorm12ValidationError, - children: api_constants.scorm12.correct_responses_children, - }); +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; return _this; } - CMIInteractionsObject.prototype.initialize = function () { - var _a, _b; - _super.prototype.initialize.call(this); - (_a = this.objectives) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.correct_responses) === null || _b === void 0 ? void 0 : _b.initialize(); - }; - Object.defineProperty(CMIInteractionsObject.prototype, "id", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._id; - }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "time", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._time; - }, - set: function (time) { - if (check12ValidFormat(time, regex.scorm12.CMITime)) { - this._time = time; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "type", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._type; - }, - set: function (type) { - if (check12ValidFormat(type, regex.scorm12.CMIType)) { - this._type = type; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "weighting", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._weighting; - }, - set: function (weighting) { - if (check12ValidFormat(weighting, regex.scorm12.CMIDecimal) && - check12ValidRange(weighting, regex.scorm12.weighting_range)) { - this._weighting = weighting; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIInteractionsObject.prototype, "student_response", { + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._student_response; - }, - set: function (student_response) { - if (check12ValidFormat(student_response, regex.scorm12.CMIFeedback, true)) { - this._student_response = student_response; - } + return this._errorCode; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "result", { + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; + }; + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; + } + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._result; - }, - set: function (result) { - if (check12ValidFormat(result, regex.scorm12.CMIResult)) { - this._result = result; - } + return this._errorMessage; }, enumerable: false, configurable: true }); - Object.defineProperty(CMIInteractionsObject.prototype, "latency", { + Object.defineProperty(ValidationError.prototype, "detailedMessage", { get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); - } - return this._latency; - }, - set: function (latency) { - if (check12ValidFormat(latency, regex.scorm12.CMITimespan)) { - this._latency = latency; - } + return this._detailedMessage; }, enumerable: false, configurable: true }); - CMIInteractionsObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - time: this.time, - type: this.type, - weighting: this.weighting, - student_response: this.student_response, - result: this.result, - latency: this.latency, - objectives: this.objectives, - correct_responses: this.correct_responses, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObject; -}(BaseCMI)); + return ValidationError; +}(BaseScormValidationError)); -var CMIInteractionsObjectivesObject = (function (_super) { - __extends(CMIInteractionsObjectivesObject, _super); - function CMIInteractionsObjectivesObject() { - var _this = _super.call(this) || this; - _this._id = ""; +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + } + return _this; + } + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + } return _this; } - Object.defineProperty(CMIInteractionsObjectivesObject.prototype, "id", { - get: function () { - return this._id; - }, - set: function (id) { - if (check12ValidFormat(id, regex.scorm12.CMIIdentifier)) { - this._id = id; - } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsObjectivesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - id: this.id, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsObjectivesObject; -}(BaseCMI)); + return AICCValidationError; +}(ValidationError)); -var CMIInteractionsCorrectResponsesObject = (function (_super) { - __extends(CMIInteractionsCorrectResponsesObject, _super); - function CMIInteractionsCorrectResponsesObject() { - var _this = _super.call(this) || this; - _this._pattern = ""; +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + } + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + } return _this; } - Object.defineProperty(CMIInteractionsCorrectResponsesObject.prototype, "pattern", { - get: function () { - if (!this.jsonString) { - throw new Scorm12ValidationError(error_codes.scorm12.WRITE_ONLY_ELEMENT); + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ HT: function() { return /* binding */ addHHMMSSTimeStrings; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ UZ: function() { return /* binding */ getSecondsAsHHMMSS; }, +/* harmony export */ f4: function() { return /* binding */ getTimeAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsISODuration, getDurationAsSeconds, addTwoDurations, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); + } + else { + msStr = String(ms); + } + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); + } + if (designationsKey === "S" && remainder > 0) { + value += remainder; + } + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; } - return this._pattern; - }, - set: function (pattern) { - if (check12ValidFormat(pattern, regex.scorm12.CMIFeedback, true)) { - this._pattern = pattern; + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; } - }, - enumerable: false, - configurable: true - }); - CMIInteractionsCorrectResponsesObject.prototype.toJSON = function () { - this.jsonString = true; - var result = { - pattern: this._pattern, - }; - delete this.jsonString; - return result; - }; - return CMIInteractionsCorrectResponsesObject; -}(BaseCMI)); + } + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); + } + } + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); + } + cur[prop] = data[p]; + } + } + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; + } + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} + + +/***/ }), + +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; -;// ./src/cmi/scorm12/cmi.ts +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +}; +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} -var CMI = (function (_super) { - __extends(CMI, _super); - function CMI(cmi_children, student_data, initialized) { - var _this = _super.call(this) || this; - _this.__children = ""; - _this.__version = "3.4"; - _this._launch_data = ""; - _this._comments = ""; - _this._comments_from_lms = ""; - if (initialized) - _this.initialize(); - _this.__children = cmi_children - ? cmi_children - : api_constants.scorm12.cmi_children; - _this.core = new CMICore(); - _this.objectives = new CMIObjectives(); - _this.student_data = student_data ? student_data : new CMIStudentData(); - _this.student_preference = new CMIStudentPreference(); - _this.interactions = new CMIInteractions(); - return _this; - } - CMI.prototype.initialize = function () { - var _a, _b, _c, _d, _e; - _super.prototype.initialize.call(this); - (_a = this.core) === null || _a === void 0 ? void 0 : _a.initialize(); - (_b = this.objectives) === null || _b === void 0 ? void 0 : _b.initialize(); - (_c = this.student_data) === null || _c === void 0 ? void 0 : _c.initialize(); - (_d = this.student_preference) === null || _d === void 0 ? void 0 : _d.initialize(); - (_e = this.interactions) === null || _e === void 0 ? void 0 : _e.initialize(); - }; - CMI.prototype.toJSON = function () { - this.jsonString = true; - var result = { - suspend_data: this.suspend_data, - launch_data: this.launch_data, - comments: this.comments, - comments_from_lms: this.comments_from_lms, - core: this.core, - objectives: this.objectives, - student_data: this.student_data, - student_preference: this.student_preference, - interactions: this.interactions, - }; - delete this.jsonString; - return result; - }; - Object.defineProperty(CMI.prototype, "_version", { - get: function () { - return this.__version; - }, - set: function (_version) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new Scorm12ValidationError(error_codes.scorm12.INVALID_SET_VALUE); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "suspend_data", { - get: function () { - var _a; - return (_a = this.core) === null || _a === void 0 ? void 0 : _a.suspend_data; - }, - set: function (suspend_data) { - if (this.core) { - this.core.suspend_data = suspend_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "launch_data", { - get: function () { - return this._launch_data; - }, - set: function (launch_data) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._launch_data = launch_data; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "comments", { - get: function () { - return this._comments; - }, - set: function (comments) { - if (check12ValidFormat(comments, regex.scorm12.CMIString4096, true)) { - this._comments = comments; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMI.prototype, "comments_from_lms", { - get: function () { - return this._comments_from_lms; - }, - set: function (comments_from_lms) { - if (this.initialized) { - throw new Scorm12ValidationError(error_codes.scorm12.READ_ONLY_ELEMENT); - } - else { - this._comments_from_lms = comments_from_lms; - } - }, - enumerable: false, - configurable: true - }); - CMI.prototype.getCurrentTotalTime = function () { - return this.core.getCurrentTotalTime(this.start_time); - }; - return CMI; -}(BaseRootCMI)); +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} -;// ./src/cmi/scorm12/nav.ts +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} -var NAV = (function (_super) { - __extends(NAV, _super); - function NAV() { - var _this = _super.call(this) || this; - _this._event = ""; - return _this; +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; } - Object.defineProperty(NAV.prototype, "event", { - get: function () { - return this._event; - }, - set: function (event) { - if (check12ValidFormat(event, regex.scorm12.NAVEvent)) { - this._event = event; - } - }, - enumerable: false, - configurable: true - }); - NAV.prototype.toJSON = function () { - this.jsonString = true; - var result = { - event: this.event, - }; - delete this.jsonString; - return result; - }; - return NAV; -}(BaseCMI)); + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; +} +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + else s |= 1; + } + catch (e) { + fail(e); + } + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} + +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); -;// ./src/constants/enums.ts -var NAVBoolean; -(function (NAVBoolean) { - NAVBoolean["unknown"] = "unknown"; - NAVBoolean["true"] = "true"; - NAVBoolean["false"] = "false"; -})(NAVBoolean || (NAVBoolean = {})); -var SuccessStatus; -(function (SuccessStatus) { - SuccessStatus["passed"] = "passed"; - SuccessStatus["failed"] = "failed"; - SuccessStatus["unknown"] = "unknown"; -})(SuccessStatus || (SuccessStatus = {})); -var CompletionStatus; -(function (CompletionStatus) { - CompletionStatus["completed"] = "completed"; - CompletionStatus["incomplete"] = "incomplete"; - CompletionStatus["unknown"] = "unknown"; -})(CompletionStatus || (CompletionStatus = {})); -;// ./src/Scorm12API.ts +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(635); +/* harmony import */ var _BaseAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(900); +/* harmony import */ var _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(989); +/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(864); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(340); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(797); +/* harmony import */ var _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(176); +/* harmony import */ var _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(833); +/* harmony import */ var _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(331); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(417); +/* harmony import */ var _constants_enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(56); @@ -3063,7 +3397,7 @@ var CompletionStatus; var Scorm12API = (function (_super) { - __extends(Scorm12API, _super); + (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__extends */ .C6)(Scorm12API, _super); function Scorm12API(settings) { var _this = this; if (settings) { @@ -3071,10 +3405,10 @@ var Scorm12API = (function (_super) { settings.mastery_override = false; } } - _this = _super.call(this, error_codes.scorm12, settings) || this; + _this = _super.call(this, _constants_error_codes__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A.scorm12, settings) || this; _this.statusSetByModule = false; - _this.cmi = new CMI(); - _this.nav = new NAV(); + _this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__/* .CMI */ .Y(); + _this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__/* .NAV */ .A(); _this.LMSInitialize = _this.lmsInitialize; _this.LMSFinish = _this.lmsFinish; _this.LMSGetValue = _this.lmsGetValue; @@ -3087,8 +3421,8 @@ var Scorm12API = (function (_super) { } Scorm12API.prototype.reset = function (settings) { this.commonReset(settings); - this.cmi = new CMI(); - this.nav = new NAV(); + this.cmi = new _cmi_scorm12_cmi__WEBPACK_IMPORTED_MODULE_1__/* .CMI */ .Y(); + this.nav = new _cmi_scorm12_nav__WEBPACK_IMPORTED_MODULE_7__/* .NAV */ .A(); }; Scorm12API.prototype.lmsInitialize = function () { this.cmi.initialize(); @@ -3102,8 +3436,8 @@ var Scorm12API = (function (_super) { }; Scorm12API.prototype.lmsFinish = function () { var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this.internalFinish()]; case 1: @@ -3112,17 +3446,17 @@ var Scorm12API = (function (_super) { } }); }); })(); - return api_constants.global.SCORM_TRUE; + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE; }; Scorm12API.prototype.internalFinish = function () { - return __awaiter(this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { var result; - return __generator(this, function (_a) { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this.terminate("LMSFinish", true)]; case 1: result = _a.sent(); - if (result === api_constants.global.SCORM_TRUE) { + if (result === _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE) { if (this.nav.event !== "") { if (this.nav.event === "continue") { this.processListeners("SequenceNext"); @@ -3151,8 +3485,8 @@ var Scorm12API = (function (_super) { }; Scorm12API.prototype.lmsCommit = function () { var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { + (function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(_this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this.commit("LMSCommit", false)]; case 1: @@ -3161,7 +3495,7 @@ var Scorm12API = (function (_super) { } }); }); })(); - return api_constants.global.SCORM_TRUE; + return _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE; }; Scorm12API.prototype.lmsGetLastError = function () { return this.getLastError("LMSGetLastError"); @@ -3179,20 +3513,20 @@ var Scorm12API = (function (_super) { return this._commonGetCMIValue("getCMIValue", false, CMIElement); }; Scorm12API.prototype.getChildElement = function (CMIElement, _value, foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.objectives\\.\\d+")) { - return new CMIObjectivesObject(); + if ((0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { + return new _cmi_scorm12_objectives__WEBPACK_IMPORTED_MODULE_5__/* .CMIObjectivesObject */ .N(); } else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { - return new CMIInteractionsCorrectResponsesObject(); + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsCorrectResponsesObject */ .cb(); } else if (foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { - return new CMIInteractionsObjectivesObject(); + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsObjectivesObject */ .Oh(); } else if (!foundFirstIndex && - stringMatches(CMIElement, "cmi\\.interactions\\.\\d+")) { - return new CMIInteractionsObject(); + (0,_utilities__WEBPACK_IMPORTED_MODULE_2__/* .stringMatches */ .J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { + return new _cmi_scorm12_interactions__WEBPACK_IMPORTED_MODULE_6__/* .CMIInteractionsObject */ .WP(); } return null; }; @@ -3202,11 +3536,11 @@ var Scorm12API = (function (_super) { var basicMessage = "No Error"; var detailMessage = "No Error"; errorNumber = String(errorNumber); - if (api_constants.scorm12.error_descriptions[errorNumber]) { + if (_constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber]) { basicMessage = - api_constants.scorm12.error_descriptions[errorNumber].basicMessage; + _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].basicMessage; detailMessage = - api_constants.scorm12.error_descriptions[errorNumber].detailMessage; + _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12.error_descriptions[errorNumber].detailMessage; } return detail ? detailMessage : basicMessage; }; @@ -3219,10 +3553,10 @@ var Scorm12API = (function (_super) { cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime(); } var result = []; - var flattened = flatten(cmiExport); + var flattened = _utilities__WEBPACK_IMPORTED_MODULE_2__/* .flatten */ .Bq(cmiExport); switch (this.settings.dataCommitFormat) { case "flattened": - return flatten(cmiExport); + return _utilities__WEBPACK_IMPORTED_MODULE_2__/* .flatten */ .Bq(cmiExport); case "params": for (var item in flattened) { if ({}.hasOwnProperty.call(flattened, item)) { @@ -3238,20 +3572,20 @@ var Scorm12API = (function (_super) { Scorm12API.prototype.renderCommitObject = function (terminateCommit) { var cmiExport = this.renderCommitCMI(terminateCommit); var totalTimeHHMMSS = this.cmi.getCurrentTotalTime(); - var totalTimeSeconds = getTimeAsSeconds(totalTimeHHMMSS, regex.scorm12.CMITimespan); + var totalTimeSeconds = _utilities__WEBPACK_IMPORTED_MODULE_2__/* .getTimeAsSeconds */ .f4(totalTimeHHMMSS, _constants_regex__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A.scorm12.CMITimespan); var lessonStatus = this.cmi.core.lesson_status; - var completionStatus = CompletionStatus.unknown; - var successStatus = SuccessStatus.unknown; + var completionStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.unknown; + var successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.unknown; if (lessonStatus) { completionStatus = lessonStatus === "completed" || lessonStatus === "passed" - ? CompletionStatus.completed - : CompletionStatus.incomplete; + ? _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.completed + : _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .CompletionStatus */ .lC.incomplete; if (lessonStatus === "passed") { - successStatus = SuccessStatus.passed; + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.passed; } else if (lessonStatus === "failed") { - successStatus = SuccessStatus.failed; + successStatus = _constants_enums__WEBPACK_IMPORTED_MODULE_9__/* .SuccessStatus */ .YE.failed; } } var score = this.cmi.core.score; @@ -3280,10 +3614,10 @@ var Scorm12API = (function (_super) { return commitObject; }; Scorm12API.prototype.storeData = function (terminateCommit) { - return __awaiter(this, void 0, void 0, function () { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__awaiter */ .sH)(this, void 0, void 0, function () { var originalStatus, shouldTerminateCommit, commitObject; var _a, _b, _c; - return __generator(this, function (_d) { + return (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__generator */ .YH)(this, function (_d) { switch (_d.label) { case 0: if (terminateCommit) { @@ -3317,7 +3651,7 @@ var Scorm12API = (function (_super) { commitObject = this.settings.renderCommonCommitFields ? this.renderCommitObject(shouldTerminateCommit) : this.renderCommitCMI(shouldTerminateCommit); - if (this.apiLogLevel === api_constants.global.LOG_LEVEL_DEBUG) { + if (this.apiLogLevel === _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.LOG_LEVEL_DEBUG) { console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); console.debug(commitObject); } @@ -3325,7 +3659,7 @@ var Scorm12API = (function (_super) { return [4, this.processHttpRequest(this.settings.lmsCommitUrl, commitObject, terminateCommit)]; case 1: return [2, _d.sent()]; case 2: return [2, { - result: api_constants.global.SCORM_TRUE, + result: _constants_api_constants__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.global.SCORM_TRUE, errorCode: 0, }]; } @@ -3333,13 +3667,8 @@ var Scorm12API = (function (_super) { }); }; return Scorm12API; -}(src_BaseAPI)); -/* harmony default export */ var src_Scorm12API = (Scorm12API); - -;// ./src/exports/scorm12.js - - -window.Scorm12API = src_Scorm12API; +}(_BaseAPI__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)); +/* harmony default export */ __webpack_exports__["default"] = (Scorm12API); /******/ return __webpack_exports__; /******/ })() diff --git a/dist/scorm12.js.map b/dist/scorm12.js.map index 9600024..ac351ac 100644 --- a/dist/scorm12.js.map +++ b/dist/scorm12.js.map @@ -1 +1 @@ -{"version":3,"file":"scorm12.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,gBAAgB,sCAAsC,kBAAkB;AACjF,wBAAwB;AACxB;AACA;;AAEO;AACP;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEO;AACP;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;;AAEO;AACP,kCAAkC;AAClC;;AAEO;AACP,uBAAuB,uFAAuF;AAC9G;AACA;AACA,yGAAyG;AACzG;AACA,sCAAsC,QAAQ;AAC9C;AACA,gEAAgE;AAChE;AACA,8CAA8C,yFAAyF;AACvI,8DAA8D,2CAA2C;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,4CAA4C,yEAAyE;AACrH;;AAEO;AACP;AACA;;AAEO;AACP,0BAA0B,+DAA+D,iBAAiB;AAC1G;AACA,kCAAkC,MAAM,+BAA+B,YAAY;AACnF,iCAAiC,MAAM,mCAAmC,YAAY;AACtF,8BAA8B;AAC9B;AACA,GAAG;AACH;;AAEO;AACP,YAAY,6BAA6B,0BAA0B,cAAc,qBAAqB;AACtG,2IAA2I,cAAc;AACzJ,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;A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I;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;ACtXF;IAAA;QACE,eAAU,GAAI,KAAK,CAAC;QACZ,iBAAY,GAAG,KAAK,CAAC;IAiC/B,CAAC;IA1BC,sBAAI,gCAAW;aAAf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAMD,sBAAI,+BAAU;aAAd;YACE,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;;;OAAA;IAKD,4BAAU,GAAV;QACE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAMD,8BAAY,GAAZ;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IACH,cAAC;AAAD,CAAC;;AAKD;I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AEF,WAAO;4BACL,MAAM,EAAE,aAAY,CAAC,MAAM,CAAC,UAAU;4BACtC,SAAS,EAAE,CAAC;yBACb,EAAC;;;;KAEL;IACH,iBAAC;AAAD,CAAC,CAvauC,WAAO,GAua9C;;;;ACncyC;;AAE1C,oBAAoB,cAAU","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/exports/scorm12.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import Scorm12API from \"../Scorm12API.ts\";\n\nwindow.Scorm12API = Scorm12API;\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"scorm12.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;ACFO,SAAS,QAAQ,CACtB,IAAO,EACP,IAAY,EACZ,SAAiB;IAAjB,6CAAiB;IAEjB,IAAI,OAA6C,CAAC;IAElD,OAAO;QAAqB,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC;QAErB,IAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEF,IAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QAEtC,IAAI,OAAO;YAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,GAAG,UAAU,CAAC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AEO;AACP;AACA;;AAEO;AACP;AACA;AACA,wMAAwM,cAAc;AACtN,4BAA4B,sBAAsB;AAClD,wBAAwB,YAAY,sBAAsB,qCAAqC,2CAA2C,MAAM;AAChJ,0BAA0B,MAAM,iBAAiB,YAAY;AAC7D,qBAAqB;AACrB,4BAA4B;AAC5B,2BAA2B;AAC3B,0BAA0B;AAC1B;;AAEO;AACP;AACA,eAAe,6CAA6C,UAAU,sDAAsD,cAAc;AAC1I,wBAAwB,6BAA6B,oBAAoB,uCAAuC,kBAAkB;AAClI;;AAEO;AACP;AACA;AACA,yGAAyG,uFAAuF,cAAc;AAC9M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;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C,QAAQ,CAAC,YAAY,EAC1B,YAAY,EACZ,eAAe,CAChB;4BAJD,WAAO,SAIN,EAAC;4BAEF,WAAO;4BACL,MAAM,EAAE,yEAAY,CAAC,MAAM,CAAC,UAAU;4BACtC,SAAS,EAAE,CAAC;yBACb,EAAC;;;;KAEL;IACH,iBAAC;AAAD,CAAC,CAvauC,yDAAO,GAua9C","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./src/Scorm12API.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/scorm12.min.js b/dist/scorm12.min.js index 68e875d..698a678 100644 --- a/dist/scorm12.min.js +++ b/dist/scorm12.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var r=function(){return r=Object.assign||function(e){for(var t,r=1,i=arguments.length;r0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&(s="."+(s=S(o)>2?o.toFixed(2):String(o)).split(".")[1]),(t+":"+i+":"+n).replace(/\b\d\b/g,"0$&")+s}function I(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=e.split(":");return 3600*Number(r[0])+60*Number(r[1])+Number(r[2])}function y(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=r(r({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return i(this,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=u.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(i=n.sent()).errorCode&&i.errorCode>0&&this.throwSCORMError(i.errorCode),r=void 0!==i&&i.result?i.result:u.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=u.global.SCORM_TRUE,this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,u.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=u.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=u.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,u.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return i(this,arguments,void 0,(function(e,t){var r,i;return void 0===t&&(t=!1),n(this,(function(n){switch(n.label){case 0:return this.clearScheduledCommit(),r=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(i=n.sent()).errorCode&&i.errorCode>0&&this.throwSCORMError(i.errorCode),r=void 0!==i&&i.result?i.result:u.global.SCORM_FALSE,this.apiLog(e," Result: "+r,u.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,u.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,n){if(!i||""===i)return u.global.SCORM_FALSE;for(var o=i.split("."),s=this,a=u.global.SCORM_FALSE,c=!1,l="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),d=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,_=0;_1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),u.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),u.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){for(var n=r,o="",s=t.exec(i);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(i);n[o]=e[i]}return r[""]||r}(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===u.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),N=C,v={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},R={aicc:r(r({},v),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:v,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};function w(e,t,r,i,n){if("string"!=typeof e)return!1;var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new i(r);return!0}function A(e,t,r,i){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}function D(e,t,r){return w(e,t,c.scorm12.TYPE_MISMATCH,f,r)}function V(e,t,r){if(!r&&""===e)throw new f(c.scorm12.VALUE_OUT_OF_RANGE);return A(e,t,c.scorm12.VALUE_OUT_OF_RANGE,f)}var F,j,G,x=u.scorm12,P=R.scorm12,U=c.scorm12,z=function(e){function r(t){var r=e.call(this)||this;return r._raw="",r._min="",r.__children=t.score_children||x.score_children,r.__score_range=!!t.score_range&&P.score_range,r._max=t.max||""===t.max?t.max:"100",r.__invalid_error_code=t.invalidErrorCode||U.INVALID_SET_VALUE,r.__invalid_type_code=t.invalidTypeCode||U.TYPE_MISMATCH,r.__invalid_range_code=t.invalidRangeCode||U.VALUE_OUT_OF_RANGE,r.__decimal_regex=t.decimalRegex||P.CMIDecimal,r.__error_class=t.errorClass,r}return t(r,e),Object.defineProperty(r.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this.__error_class(this.__invalid_error_code)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"raw",{get:function(){return this._raw},set:function(e){!w(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!A(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._raw=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"min",{get:function(){return this._min},set:function(e){!w(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!A(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._min=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"max",{get:function(){return this._max},set:function(e){!w(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!A(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._max=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},r}(o),$=function(e){function r(){var t=e.call(this)||this;return t.__children=u.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new z({score_children:u.scorm12.score_children,score_range:R.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(r,e),r.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(r.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){D(e,R.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?D(e,R.scorm12.CMIStatus)&&(this._lesson_status=e):D(e,R.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"exit",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){D(e,R.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"session_time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){D(e,R.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){D(e,R.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),r.prototype.getCurrentTotalTime=function(e){var t,r,i,n=this._session_time,o=e;null!=o&&(n=M(((new Date).getTime()-o)/1e3));return t=this._total_time,r=n,"string"==typeof(i=new RegExp(R.scorm12.CMITimespan))&&(i=new RegExp(i)),M(I(t,i)+I(r,i))},r.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},r}(o),k=function(e){function r(){return e.call(this,{children:u.scorm12.objectives_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(r,e),r}(E),Y=function(e){function r(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new z({score_children:u.scorm12.score_children,score_range:R.scorm12.score_range,invalidErrorCode:c.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.scorm12.TYPE_MISMATCH,invalidRangeCode:c.scorm12.VALUE_OUT_OF_RANGE,errorClass:f}),t}return t(r,e),Object.defineProperty(r.prototype,"id",{get:function(){return this._id},set:function(e){D(e,R.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"status",{get:function(){return this._status},set:function(e){D(e,R.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},r}(o),B=function(e){function r(t){var r=e.call(this)||this;return r._mastery_score="",r._max_time_allowed="",r._time_limit_action="",r.__children=t||u.scorm12.student_data_children,r}return t(r,e),Object.defineProperty(r.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},r}(o),Z=function(e){function r(t){var r=e.call(this)||this;return r._audio="",r._language="",r._speed="",r._text="",r.__children=t||u.scorm12.student_preference_children,r}return t(r,e),Object.defineProperty(r.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"audio",{get:function(){return this._audio},set:function(e){D(e,R.scorm12.CMISInteger)&&V(e,R.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"language",{get:function(){return this._language},set:function(e){D(e,R.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"speed",{get:function(){return this._speed},set:function(e){D(e,R.scorm12.CMISInteger)&&V(e,R.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"text",{get:function(){return this._text},set:function(e){D(e,R.scorm12.CMISInteger)&&V(e,R.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},r}(o),H=function(e){function r(){return e.call(this,{children:u.scorm12.interactions_children,errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f})||this}return t(r,e),r}(E),J=function(e){function r(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new E({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.objectives_children}),t.correct_responses=new E({errorCode:c.scorm12.INVALID_SET_VALUE,errorClass:f,children:u.scorm12.correct_responses_children}),t}return t(r,e),r.prototype.initialize=function(){var t,r;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(r=this.correct_responses)||void 0===r||r.initialize()},Object.defineProperty(r.prototype,"id",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){D(e,R.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"time",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){D(e,R.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"type",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){D(e,R.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"weighting",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){D(e,R.scorm12.CMIDecimal)&&V(e,R.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"student_response",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){D(e,R.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"result",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){D(e,R.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"latency",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){D(e,R.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},r}(o),W=function(e){function r(){var t=e.call(this)||this;return t._id="",t}return t(r,e),Object.defineProperty(r.prototype,"id",{get:function(){return this._id},set:function(e){D(e,R.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},r}(o),q=function(e){function r(){var t=e.call(this)||this;return t._pattern="",t}return t(r,e),Object.defineProperty(r.prototype,"pattern",{get:function(){if(!this.jsonString)throw new f(c.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){D(e,R.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},r}(o),K=function(e){function r(t,r,i){var n=e.call(this)||this;return n.__children="",n.__version="3.4",n._launch_data="",n._comments="",n._comments_from_lms="",i&&n.initialize(),n.__children=t||u.scorm12.cmi_children,n.core=new $,n.objectives=new k,n.student_data=r||new B,n.student_preference=new Z,n.interactions=new H,n}return t(r,e),r.prototype.initialize=function(){var t,r,i,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(r=this.objectives)||void 0===r||r.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},r.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(r.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"comments",{get:function(){return this._comments},set:function(e){D(e,R.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new f(c.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),r.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},r}(s),Q=function(e){function r(){var t=e.call(this)||this;return t._event="",t}return t(r,e),Object.defineProperty(r.prototype,"event",{get:function(){return this._event},set:function(e){D(e,R.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},r}(o);!function(e){e.unknown="unknown",e.true="true",e.false="false"}(F||(F={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(j||(j={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(G||(G={}));var X=function(e){function r(t){var r=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(r=e.call(this,c.scorm12,t)||this).statusSetByModule=!1,r.cmi=new K,r.nav=new Q,r.LMSInitialize=r.lmsInitialize,r.LMSFinish=r.lmsFinish,r.LMSGetValue=r.lmsGetValue,r.LMSSetValue=r.lmsSetValue,r.LMSCommit=r.lmsCommit,r.LMSGetLastError=r.lmsGetLastError,r.LMSGetErrorString=r.lmsGetErrorString,r.LMSGetDiagnostic=r.lmsGetDiagnostic,r}return t(r,e),r.prototype.reset=function(e){this.commonReset(e),this.cmi=new K,this.nav=new Q},r.prototype.lmsInitialize=function(){return this.cmi.initialize(),this.cmi.core.lesson_status?this.statusSetByModule=!0:this.cmi.core.lesson_status="not attempted",this.initialize("LMSInitialize","LMS was already initialized!","LMS is already finished!")},r.prototype.lmsFinish=function(){return i(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.internalFinish()];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},r.prototype.internalFinish=function(){return i(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return[4,this.terminate("LMSFinish",!0)];case 1:return(e=t.sent())===u.global.SCORM_TRUE&&(""!==this.nav.event?"continue"===this.nav.event?this.processListeners("SequenceNext"):this.processListeners("SequencePrevious"):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},r.prototype.lmsGetValue=function(e){return this.getValue("LMSGetValue",!1,e)},r.prototype.lmsSetValue=function(e,t){return"cmi.core.lesson_status"===e&&(this.statusSetByModule=!0),this.setValue("LMSSetValue","LMSCommit",!1,e,t)},r.prototype.lmsCommit=function(){return i(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.commit("LMSCommit",!1)];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},r.prototype.lmsGetLastError=function(){return this.getLastError("LMSGetLastError")},r.prototype.lmsGetErrorString=function(e){return this.getErrorString("LMSGetErrorString",e)},r.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("LMSGetDiagnostic",e)},r.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("LMSSetValue",!1,e,t)},r.prototype.getCMIValue=function(e){return this._commonGetCMIValue("getCMIValue",!1,e)},r.prototype.getChildElement=function(e,t,r){return L(e,"cmi\\.objectives\\.\\d+")?new Y:r&&L(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new q:r&&L(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new W:!r&&L(e,"cmi\\.interactions\\.\\d+")?new J:null},r.prototype.validateCorrectResponse=function(e,t){},r.prototype.getLmsErrorMessageDetails=function(e,t){var r="No Error",i="No Error";return e=String(e),u.scorm12.error_descriptions[e]&&(r=u.scorm12.error_descriptions[e].basicMessage,i=u.scorm12.error_descriptions[e].detailMessage),t?i:r},r.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi},r.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.core.total_time=this.cmi.getCurrentTotalTime());var r=[],i=y(t);switch(this.settings.dataCommitFormat){case"flattened":return y(t);case"params":for(var n in i)({}).hasOwnProperty.call(i,n)&&r.push("".concat(n,"=").concat(i[n]));return r;default:return t}},r.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),r=I(this.cmi.getCurrentTotalTime(),R.scorm12.CMITimespan),i=this.cmi.core.lesson_status,n=G.unknown,o=j.unknown;i&&(n="completed"===i||"passed"===i?G.completed:G.incomplete,"passed"===i?o=j.passed:"failed"===i&&(o=j.failed));var s=this.cmi.core.score,a=null;s&&(a={},Number.isNaN(Number.parseFloat(s.raw))||(a.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(a.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(a.max=Number.parseFloat(s.max)));var c={successStatus:o,completionStatus:n,runtimeData:t,totalTimeSeconds:r};return a&&(c.score=a),c},r.prototype.storeData=function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,a;return n(this,(function(n){switch(n.label){case 0:return e&&(t=this.cmi.core.lesson_status,this.cmi.core.lesson_status&&(this.statusSetByModule||"not attempted"!==this.cmi.core.lesson_status)||(this.cmi.core.lesson_status="completed"),"normal"===this.cmi.core.lesson_mode?"credit"===this.cmi.core.credit&&this.settings.mastery_override&&""!==this.cmi.student_data.mastery_score&&""!==this.cmi.core.score.raw&&(this.cmi.core.lesson_status=parseFloat(this.cmi.core.score.raw)>=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(a=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===a?void 0:a.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===u.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return[2,n.sent()];case 2:return[2,{result:u.global.SCORM_TRUE,errorCode:0}]}}))}))},r}(N);return window.Scorm12API=X,{}}()})); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e={900:function(e,t,r){r.d(t,{A:function(){return _}});var i=r(635),n=r(589),o=r(784),s=r(797),a=r(340),c=r(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:(n=(r=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(r,[i.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,i.sH)(e,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),d=function(){function e(t,r){var i=this.constructor;if(this._settings=l,i===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=r),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,i.Cl)((0,i.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,r){var i=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",i=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,c.hw)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,d=!1,_="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,m=0;m1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),_=d},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},989:function(e,t,r){r.d(t,{Y:function(){return g}});var i=r(635),n=r(340),o=r(797),s=r(417),a=r(784),c=r(319),l=r(915),u=r(434),d=r(864),_=function(e){function t(){var t=e.call(this)||this;return t.__children=n.A.scorm12.core_children,t._student_id="",t._student_name="",t._lesson_location="",t._credit="",t._lesson_status="not attempted",t._entry="",t._total_time="",t._lesson_mode="normal",t._exit="",t._session_time="00:00:00",t._suspend_data="",t.score=new u._({score_children:n.A.scorm12.score_children,score_range:s.A.scorm12.score_range,invalidErrorCode:o.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:o.A.scorm12.TYPE_MISMATCH,invalidRangeCode:o.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:a.tQ}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t;e.prototype.initialize.call(this),null===(t=this.score)||void 0===t||t.initialize()},Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_id",{get:function(){return this._student_id},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_id=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_name",{get:function(){return this._student_name},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._student_name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_location",{get:function(){return this._lesson_location},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString256,!0)&&(this._lesson_location=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"credit",{get:function(){return this._credit},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._credit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_status",{get:function(){return this._lesson_status},set:function(e){this.initialized?(0,l.p)(e,s.A.scorm12.CMIStatus)&&(this._lesson_status=e):(0,l.p)(e,s.A.scorm12.CMIStatus2)&&(this._lesson_status=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entry",{get:function(){return this._entry},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._entry=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"total_time",{get:function(){return this._total_time},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._total_time=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lesson_mode",{get:function(){return this._lesson_mode},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._lesson_mode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exit",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._exit},set:function(e){(0,l.p)(e,s.A.scorm12.CMIExit,!0)&&(this._exit=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session_time",{get:function(){if(!this.jsonString)throw new a.tQ(o.A.scorm12.WRITE_ONLY_ELEMENT);return this._session_time},set:function(e){(0,l.p)(e,s.A.scorm12.CMITimespan)&&(this._session_time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){return this._suspend_data},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._suspend_data=e)},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(e){var t=this._session_time,r=e;if(null!=r){var i=(new Date).getTime()-r;t=d.UZ(i/1e3)}return d.HT(this._total_time,t,new RegExp(s.A.scorm12.CMITimespan))},t.prototype.toJSON=function(){this.jsonString=!0;var e={student_id:this.student_id,student_name:this.student_name,lesson_location:this.lesson_location,credit:this.credit,lesson_status:this.lesson_status,entry:this.entry,lesson_mode:this.lesson_mode,exit:this.exit,session_time:this.session_time,score:this.score};return delete this.jsonString,e},t}(c.J),h=r(176),m=r(532),f=r(181),p=r(833),g=function(e){function t(t,r,i){var o=e.call(this)||this;return o.__children="",o.__version="3.4",o._launch_data="",o._comments="",o._comments_from_lms="",i&&o.initialize(),o.__children=t||n.A.scorm12.cmi_children,o.core=new _,o.objectives=new h.C,o.student_data=r||new m.X,o.student_preference=new f.G,o.interactions=new p.Xb,o}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r,i,n,o;e.prototype.initialize.call(this),null===(t=this.core)||void 0===t||t.initialize(),null===(r=this.objectives)||void 0===r||r.initialize(),null===(i=this.student_data)||void 0===i||i.initialize(),null===(n=this.student_preference)||void 0===n||n.initialize(),null===(o=this.interactions)||void 0===o||o.initialize()},t.prototype.toJSON=function(){this.jsonString=!0;var e={suspend_data:this.suspend_data,launch_data:this.launch_data,comments:this.comments,comments_from_lms:this.comments_from_lms,core:this.core,objectives:this.objectives,student_data:this.student_data,student_preference:this.student_preference,interactions:this.interactions};return delete this.jsonString,e},Object.defineProperty(t.prototype,"_version",{get:function(){return this.__version},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new a.tQ(o.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"suspend_data",{get:function(){var e;return null===(e=this.core)||void 0===e?void 0:e.suspend_data},set:function(e){this.core&&(this.core.suspend_data=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"launch_data",{get:function(){return this._launch_data},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._launch_data=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments",{get:function(){return this._comments},set:function(e){(0,l.p)(e,s.A.scorm12.CMIString4096,!0)&&(this._comments=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"comments_from_lms",{get:function(){return this._comments_from_lms},set:function(e){if(this.initialized)throw new a.tQ(o.A.scorm12.READ_ONLY_ELEMENT);this._comments_from_lms=e},enumerable:!1,configurable:!0}),t.prototype.getCurrentTotalTime=function(){return this.core.getCurrentTotalTime(this.start_time)},t}(c.r)},833:function(e,t,r){r.d(t,{Oh:function(){return h},WP:function(){return _},Xb:function(){return d},cb:function(){return m}});var i=r(635),n=r(589),o=r(340),s=r(797),a=r(784),c=r(319),l=r(915),u=r(417),d=function(e){function t(){return e.call(this,{children:o.A.scorm12.interactions_children,errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ})||this}return(0,i.C6)(t,e),t}(n.B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._time="",t._type="",t._weighting="",t._student_response="",t._result="",t._latency="",t.objectives=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.objectives_children}),t.correct_responses=new n.B({errorCode:s.A.scorm12.INVALID_SET_VALUE,errorClass:a.tQ,children:o.A.scorm12.correct_responses_children}),t}return(0,i.C6)(t,e),t.prototype.initialize=function(){var t,r;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(r=this.correct_responses)||void 0===r||r.initialize()},Object.defineProperty(t.prototype,"id",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._time},set:function(e){(0,l.p)(e,u.A.scorm12.CMITime)&&(this._time=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._type},set:function(e){(0,l.p)(e,u.A.scorm12.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weighting",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._weighting},set:function(e){(0,l.p)(e,u.A.scorm12.CMIDecimal)&&(0,l.h)(e,u.A.scorm12.weighting_range)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"student_response",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._student_response},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._student_response=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"result",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._result},set:function(e){(0,l.p)(e,u.A.scorm12.CMIResult)&&(this._result=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"latency",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._latency},set:function(e){(0,l.p)(e,u.A.scorm12.CMITimespan)&&(this._latency=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,time:this.time,type:this.type,weighting:this.weighting,student_response:this.student_response,result:this.result,latency:this.latency,objectives:this.objectives,correct_responses:this.correct_responses};return delete this.jsonString,e},t}(c.J),h=function(e){function t(){var t=e.call(this)||this;return t._id="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,l.p)(e,u.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id};return delete this.jsonString,e},t}(c.J),m=function(e){function t(){var t=e.call(this)||this;return t._pattern="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"pattern",{get:function(){if(!this.jsonString)throw new a.tQ(s.A.scorm12.WRITE_ONLY_ELEMENT);return this._pattern},set:function(e){(0,l.p)(e,u.A.scorm12.CMIFeedback,!0)&&(this._pattern=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={pattern:this._pattern};return delete this.jsonString,e},t}(c.J)},331:function(e,t,r){r.d(t,{A:function(){return a}});var i=r(635),n=r(319),o=r(915),s=r(417),a=function(e){function t(){var t=e.call(this)||this;return t._event="",t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"event",{get:function(){return this._event},set:function(e){(0,o.p)(e,s.A.scorm12.NAVEvent)&&(this._event=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={event:this.event};return delete this.jsonString,e},t}(n.J)},176:function(e,t,r){r.d(t,{C:function(){return d},N:function(){return _}});var i=r(635),n=r(319),o=r(434),s=r(340),a=r(417),c=r(797),l=r(784),u=r(915),d=function(e){function t(){return e.call(this,{children:s.A.scorm12.objectives_children,errorCode:c.A.scorm12.INVALID_SET_VALUE,errorClass:l.tQ})||this}return(0,i.C6)(t,e),t}(r(589).B),_=function(e){function t(){var t=e.call(this)||this;return t._id="",t._status="",t.score=new o._({score_children:s.A.scorm12.score_children,score_range:a.A.scorm12.score_range,invalidErrorCode:c.A.scorm12.INVALID_SET_VALUE,invalidTypeCode:c.A.scorm12.TYPE_MISMATCH,invalidRangeCode:c.A.scorm12.VALUE_OUT_OF_RANGE,errorClass:l.tQ}),t}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(e){(0,u.p)(e,a.A.scorm12.CMIIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},set:function(e){(0,u.p)(e,a.A.scorm12.CMIStatus2)&&(this._status=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={id:this.id,status:this.status,score:this.score};return delete this.jsonString,e},t}(n.J)},532:function(e,t,r){r.d(t,{X:function(){return c}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=function(e){function t(t){var r=e.call(this)||this;return r._mastery_score="",r._max_time_allowed="",r._time_limit_action="",r.__children=t||o.A.scorm12.student_data_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mastery_score",{get:function(){return this._mastery_score},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._mastery_score=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max_time_allowed",{get:function(){return this._max_time_allowed},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._max_time_allowed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time_limit_action",{get:function(){return this._time_limit_action},set:function(e){if(this.initialized)throw new s.tQ(a.A.scorm12.READ_ONLY_ELEMENT);this._time_limit_action=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={mastery_score:this.mastery_score,max_time_allowed:this.max_time_allowed,time_limit_action:this.time_limit_action};return delete this.jsonString,e},t}(n.J)},181:function(e,t,r){r.d(t,{G:function(){return u}});var i=r(635),n=r(319),o=r(340),s=r(784),a=r(797),c=r(915),l=r(417),u=function(e){function t(t){var r=e.call(this)||this;return r._audio="",r._language="",r._speed="",r._text="",r.__children=t||o.A.scorm12.student_preference_children,r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new s.tQ(a.A.scorm12.INVALID_SET_VALUE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this._audio},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.audio_range)&&(this._audio=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},set:function(e){(0,c.p)(e,l.A.scorm12.CMIString256)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.speed_range)&&(this._speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._text},set:function(e){(0,c.p)(e,l.A.scorm12.CMISInteger)&&(0,c.h)(e,l.A.scorm12.text_range)&&(this._text=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={audio:this.audio,language:this.language,speed:this.speed,text:this.text};return delete this.jsonString,e},t}(n.J)},915:function(e,t,r){r.d(t,{h:function(){return a},p:function(){return s}});var i=r(449),n=r(797),o=r(784);function s(e,t,r){return(0,i.q)(e,t,n.A.scorm12.TYPE_MISMATCH,o.tQ,r)}function a(e,t,r){if(!r&&""===e)throw new o.tQ(n.A.scorm12.VALUE_OUT_OF_RANGE);return(0,i.W)(e,t,n.A.scorm12.VALUE_OUT_OF_RANGE,o.tQ)}},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},tQ:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l);(function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)})(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}(0,i.C6)(t,e)}(l)},864:function(e,t,r){r.d(t,{Bq:function(){return a},HT:function(){return s},J6:function(){return d},UZ:function(){return n},f4:function(){return o},hw:function(){return u},sB:function(){return c}});var i=3600;function n(e){if(!e||e<=0)return"00:00:00";var t=Math.floor(e/i),r=new Date(1e3*e),n=r.getUTCMinutes(),o=r.getSeconds(),s=e%1,a="";return l(s)>0&&(a="."+(a=l(s)>2?s.toFixed(2):String(s)).split(".")[1]),(t+":"+n+":"+o).replace(/\b\d\b/g,"0$&")+a}function o(e,t){if("number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),"string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=e.split(":");return 3600*Number(r[0])+60*Number(r[1])+Number(r[2])}function s(e,t,r){return"string"==typeof r&&(r=new RegExp(r)),n(o(e,r)+o(t,r))}function a(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]=parseFloat(this.cmi.student_data.mastery_score)?"passed":"failed"):"browse"===this.cmi.core.lesson_mode&&""===((null===(a=null===(s=null===(o=this.startingData)||void 0===o?void 0:o.cmi)||void 0===s?void 0:s.core)||void 0===a?void 0:a.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===c.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return[2,n.sent()];case 2:return[2,{result:c.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(o.A);return i.default=f,i}()})); //# sourceMappingURL=scorm12.min.js.map \ No newline at end of file diff --git a/dist/scorm12.min.js.map b/dist/scorm12.min.js.map index 1d1de2f..54f28f0 100644 --- a/dist/scorm12.min.js.map +++ b/dist/scorm12.min.js.map @@ -1 +1 @@ -{"version":3,"file":"scorm12.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,eAAiBD,IAEzBD,EAAK,eAAiBC,GACvB,CATD,CASGK,MAAM,WACT,O,4BCMIC,EAAgB,SAASC,EAAGC,GAI9B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAG,GAC1E,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,GAAI,EAC7FP,EAAcC,EAAGC,EAC1B,EAEO,SAASS,EAAUV,EAAGC,GAC3B,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,CAAG,CADtCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,EACjF,CAEO,IAAII,EAAW,WAQpB,OAPAA,EAAWf,OAAOgB,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIf,KADTc,EAAIG,UAAUF,GACOnB,OAAOK,UAAUC,eAAeC,KA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WAA9Bje,KAAKoP,IAAI2Q,KAAK9C,aAEmC,OAA3B,QAA5B,EAAsB,QAAtB,EAAiB,QAAjB,EAAAjd,KAAKwV,oBAAY,eAAEpG,WAAG,eAAE2Q,YAAI,eAAEjD,gBAAiB,KAC7B,kBAAnB+G,IAEA7jB,KAAKoP,IAAI2Q,KAAKjD,cAAgB,YAK9BgH,EACJjB,GAAmB7iB,KAAKoO,SAASvC,oBAC7Ba,EAAe1M,KAAKoO,SAAStC,yBAC/B9L,KAAKgjB,mBAAmBc,GACxB9jB,KAAK4iB,gBAAgBkB,GAErB9jB,KAAK2O,cAAgB,EAAanL,OAAOiD,kBAC3CqG,QAAQI,MACN,wBAA0B2V,EAAkB,MAAQ,MAAQ,OAE9D/V,QAAQI,MAAMR,IAE0B,iBAA/B1M,KAAKoO,SAAS7C,aAArB,MACK,GAAMvL,KAAK8V,mBAChB9V,KAAKoO,SAAS7C,aACdmB,EACAmW,I,OAHF,MAAO,CAAP,EAAO,U,OAMP,MAAO,CAAP,EAAO,CACLnhB,OAAQ,EAAa8B,OAAO4C,WAC5BkB,UAAW,I,QAInB,EAvaA,CAAwC,G,OC1BxCyc,OAAOC,WAAa,E","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/Scorm12API.ts","webpack://scorm-again/./src/exports/scorm12.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import Scorm12API from \"../Scorm12API.ts\";\n\nwindow.Scorm12API = Scorm12API;\n"],"names":["root","factory","exports","module","define","amd","self","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","v","op","pop","push","SuppressedError","jsonString","_initialized","_start_time","initialize","setStartTime","Date","getTime","BaseCMI","global","GENERAL","INITIALIZATION_FAILED","INITIALIZED","TERMINATED","TERMINATION_FAILURE","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","STORE_BEFORE_INIT","STORE_AFTER_TERM","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","ARGUMENT_ERROR","CHILDREN_ERROR","COUNT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNDEFINED_DATA_MODEL","UNIMPLEMENTED_ELEMENT","VALUE_NOT_INITIALIZED","INVALID_SET_VALUE","READ_ONLY_ELEMENT","WRITE_ONLY_ELEMENT","TYPE_MISMATCH","VALUE_OUT_OF_RANGE","DEPENDENCY_NOT_ESTABLISHED","scorm12","scorm2004","MULTIPLE_TERMINATIONS","cmi_children","core_children","score_children","comments_children","objectives_children","correct_responses_children","student_data_children","student_preference_children","interactions_children","error_descriptions","basicMessage","detailMessage","SCORM_TRUE","SCORM_FALSE","STATE_NOT_INITIALIZED","STATE_INITIALIZED","STATE_TERMINATED","LOG_LEVEL_DEBUG","LOG_LEVEL_INFO","LOG_LEVEL_WARNING","LOG_LEVEL_ERROR","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","scorm12_errors","aicc_errors","scorm2004_errors","errorCode","toString","_errorCode","name","setMessage","message","Error","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","scorm12_error_codes","params","__children","children","_errorClass","errorClass","childArray","_children","_count","toJSON","SECONDS_PER_HOUR","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","seconds","getSeconds","ms","msStr","countDecimals","toFixed","split","replace","getTimeAsSeconds","timeString","timeRegex","RegExp","match","parts","Number","flatten","data","recurse","cur","prop","isArray","l","isEmpty","num","indexOf","stringMatches","str","tester","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","status","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","warn","info","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","currentState","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","isTerminated","cmi","processListeners","apiLog","clearSCORMError","functionName","CMIElement","messageString","fillChars","j","formatMessage","terminate","checkTerminated","checkState","storeData","getValue","getCMIValue","handleValueAccessException","undefined","setValue","commitCallback","setCMIValue","scheduleCommit","clearScheduledCommit","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","_CMIElement","_value","_commonSetCMIValue","methodName","structure","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","idx","attribute","substring","_checkObjectHasProperty","validateCorrectResponse","CMIArray","index","parseInt","isNaN","item","newChild","getChildElement","initialized","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","on","listenerName","listenerFunctions","listenerSplit","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","errorNumber","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","regex","m","exec","unflatten","a_pattern","c_match","a_match","a_num","c_num","startingData","currentCMIElement","renderCMIToJSONString","stringify","k","renderCMIToJSONObject","processHttpRequest","url","immediate","api","genericError","performFetch","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","join","headers","credentials","keepalive","CMIString256","CMIString4096","CMITime","CMITimespan","CMIInteger","CMISInteger","CMIDecimal","CMIIdentifier","CMIFeedback","CMIIndex","CMIStatus","CMIStatus2","CMIExit","CMIType","CMIResult","NAVEvent","score_range","audio_range","speed_range","weighting_range","text_range","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVBoolean","NAVTarget","scaled_range","progress_range","checkValidFormat","regexPattern","allowEmptyString","formatRegex","matches","checkValidRange","rangePattern","ranges","check12ValidFormat","Scorm12ValidationError","check12ValidRange","SuccessStatus","CompletionStatus","scorm12_constants","scorm12_regex","_raw","_min","__score_range","_max","max","__invalid_error_code","__invalid_type_code","invalidTypeCode","__invalid_range_code","invalidRangeCode","__decimal_regex","decimalRegex","__error_class","raw","min","_student_id","_student_name","_lesson_location","_credit","_lesson_status","_entry","_total_time","_lesson_mode","_exit","_session_time","_suspend_data","score","CMIScore","student_id","student_name","lesson_location","credit","lesson_status","entry","total_time","lesson_mode","exit","session_time","suspend_data","getCurrentTotalTime","start_time","first","second","sessionTime","startTime","_id","_status","id","_mastery_score","_max_time_allowed","_time_limit_action","mastery_score","max_time_allowed","time_limit_action","_audio","_language","_speed","_text","audio","language","speed","_time","_type","_weighting","_student_response","_result","_latency","objectives","correct_responses","time","type","weighting","student_response","latency","_pattern","pattern","student_data","__version","_launch_data","_comments","_comments_from_lms","core","CMICore","CMIObjectives","CMIStudentData","student_preference","CMIStudentPreference","interactions","CMIInteractions","launch_data","comments","comments_from_lms","_version","BaseRootCMI","_event","event","mastery_override","statusSetByModule","CMI","nav","NAV","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","internalFinish","CMIObjectivesObject","CMIInteractionsCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","detail","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeSeconds","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","originalStatus","shouldTerminateCommit","window","Scorm12API"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"scorm12.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,eAAiBD,IAEzBD,EAAK,eAAiBC,GACvB,CATD,CASGK,MAAM,WACT,O,6ICJO,IAAMC,EAA4B,CACvCC,YAAY,EACZC,kBAAmB,GACnBC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,EACdC,iBAAkB,OAClBC,sBAAuB,iCACvBC,cAAc,EACdC,SAAU,EAAAC,EAAaC,OAAOC,gBAC9BC,uBAAuB,EACvBC,qBAAqB,EACrBC,0BAA0B,EAC1BC,eAAe,EACfC,WAAY,CAAC,EACbC,oBAAoB,EACpBC,gBAAiB,SAAgBC,G,4HACP,IAAbA,EAAP,OACiB,KAAAC,MAAKC,MAAM,GAAMF,EAASG,S,OAC7C,OACiB,QAFXC,EAAa,WAAW,aAG3B,CAAC,EAAEC,eAAeC,KAAKF,EAAY,UAc7B,CAAP,EAAO,CACLG,OAAQH,EAAWG,OACnBC,UAAWJ,EAAWI,UAClBJ,EAAWI,UAC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gC,IAAI4P,KAAKnB,YACa,WAAzBzQ,KAAKgC,IAAI4P,KAAKzB,QAEdnQ,KAAKW,SAASwe,kBAC0B,KAAxCnf,KAAKgC,IAAIuP,aAAagD,eACM,KAA5BvU,KAAKgC,IAAI4P,KAAK9B,MAAMvB,MAEpBvO,KAAKgC,IAAI4P,KAAKxB,cACZuR,WAAW3hB,KAAKgC,IAAI4P,KAAK9B,MAAMvB,MAC/BoT,WAAW3hB,KAAKgC,IAAIuP,aAAagD,eAC7B,SACA,UAG6B,WAA9BvU,KAAKgC,IAAI4P,KAAKnB,aAEmC,OAA3B,QAA5B,EAAsB,QAAtB,EAAiB,QAAjB,EAAAzQ,KAAK6J,oBAAY,eAAE7H,WAAG,eAAE4P,YAAI,eAAExB,gBAAiB,KAC7B,kBAAnByR,IAEA7hB,KAAKgC,IAAI4P,KAAKxB,cAAgB,YAK9B0R,EACJlB,GAAmB5gB,KAAKW,SAASjD,oBAC7BmB,EAAemB,KAAKW,SAAShD,yBAC/BqC,KAAK+gB,mBAAmBe,GACxB9hB,KAAK2gB,gBAAgBmB,GAErB9hB,KAAKoB,cAAgB,EAAA9D,EAAaC,OAAOgC,kBAC3CN,QAAQO,MACN,wBAA0BohB,EAAkB,MAAQ,MAAQ,OAE9D3hB,QAAQO,MAAMX,IAE0B,iBAA/BmB,KAAKW,SAAS1D,aAArB,MACK,GAAM+C,KAAKqK,mBAChBrK,KAAKW,SAAS1D,aACd4B,EACA+hB,I,OAHF,MAAO,CAAP,EAAO,U,OAMP,MAAO,CAAP,EAAO,CACLriB,OAAQ,EAAAjB,EAAaC,OAAOkB,WAC5BD,UAAW,I,QAInB,EAvaA,CAAwC,K","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/aicc/core.ts","webpack://scorm-again/./src/cmi/scorm12/cmi.ts","webpack://scorm-again/./src/cmi/scorm12/interactions.ts","webpack://scorm-again/./src/cmi/scorm12/nav.ts","webpack://scorm-again/./src/cmi/scorm12/objectives.ts","webpack://scorm-again/./src/cmi/scorm12/student_data.ts","webpack://scorm-again/./src/cmi/scorm12/student_preference.ts","webpack://scorm-again/./src/cmi/scorm12/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./src/Scorm12API.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { check12ValidFormat } from \"../scorm12/validation\";\nimport * as Util from \"../../utilities\";\n\n/**\n * Class representing the `cmi.core` object\n * @extends BaseCMI\n */\nexport class CMICore extends BaseCMI {\n /**\n * Constructor for `cmi.core`\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n private __children = APIConstants.scorm12.core_children;\n private _student_id = \"\";\n private _student_name = \"\";\n private _lesson_location = \"\";\n private _credit = \"\";\n private _lesson_status = \"not attempted\";\n private _entry = \"\";\n private _total_time = \"\";\n private _lesson_mode = \"normal\";\n private _exit = \"\";\n private _session_time = \"00:00:00\";\n private _suspend_data = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _student_id\n * @return {string}\n */\n get student_id(): string {\n return this._student_id;\n }\n\n /**\n * Setter for _student_id. Can only be called before initialization.\n * @param {string} student_id\n */\n set student_id(student_id: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_id = student_id;\n }\n }\n\n /**\n * Getter for _student_name\n * @return {string}\n */\n get student_name(): string {\n return this._student_name;\n }\n\n /**\n * Setter for _student_name. Can only be called before initialization.\n * @param {string} student_name\n */\n set student_name(student_name: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._student_name = student_name;\n }\n }\n\n /**\n * Getter for _lesson_location\n * @return {string}\n */\n get lesson_location(): string {\n return this._lesson_location;\n }\n\n /**\n * Setter for _lesson_location\n * @param {string} lesson_location\n */\n set lesson_location(lesson_location: string) {\n if (check12ValidFormat(lesson_location, Regex.scorm12.CMIString256, true)) {\n this._lesson_location = lesson_location;\n }\n }\n\n /**\n * Getter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _lesson_status\n * @return {string}\n */\n get lesson_status(): string {\n return this._lesson_status;\n }\n\n /**\n * Setter for _lesson_status\n * @param {string} lesson_status\n */\n set lesson_status(lesson_status: string) {\n if (this.initialized) {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus)) {\n this._lesson_status = lesson_status;\n }\n } else {\n if (check12ValidFormat(lesson_status, Regex.scorm12.CMIStatus2)) {\n this._lesson_status = lesson_status;\n }\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Getter for _lesson_mode\n * @return {string}\n */\n get lesson_mode(): string {\n return this._lesson_mode;\n }\n\n /**\n * Setter for _lesson_mode. Can only be called before initialization.\n * @param {string} lesson_mode\n */\n set lesson_mode(lesson_mode: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._lesson_mode = lesson_mode;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._exit;\n }\n\n /**\n * Setter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check12ValidFormat(exit, Regex.scorm12.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check12ValidFormat(session_time, Regex.scorm12.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (check12ValidFormat(suspend_data, Regex.scorm12.CMIString4096, true)) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n * @param {number} start_time\n * @return {string}\n */\n getCurrentTotalTime(start_time: number | undefined): string {\n let sessionTime = this._session_time;\n const startTime = start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsHHMMSS(seconds / 1000);\n }\n\n return Util.addHHMMSSTimeStrings(\n this._total_time,\n sessionTime,\n new RegExp(Regex.scorm12.CMITimespan),\n );\n }\n\n /**\n * toJSON for cmi.core\n *\n * @return {\n * {\n * student_name: string,\n * entry: string,\n * exit: string,\n * score: CMIScore,\n * student_id: string,\n * lesson_mode: string,\n * lesson_location: string,\n * lesson_status: string,\n * credit: string,\n * session_time: string\n * }\n * }\n */\n toJSON(): {\n student_name: string;\n entry: string;\n exit: string;\n score: CMIScore;\n student_id: string;\n lesson_mode: string;\n lesson_location: string;\n lesson_status: string;\n credit: string;\n session_time: string;\n } {\n this.jsonString = true;\n const result = {\n student_id: this.student_id,\n student_name: this.student_name,\n lesson_location: this.lesson_location,\n credit: this.credit,\n lesson_status: this.lesson_status,\n entry: this.entry,\n lesson_mode: this.lesson_mode,\n exit: this.exit,\n session_time: this.session_time,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat } from \"./validation\";\nimport { CMICore } from \"../aicc/core\";\nimport { CMIObjectives } from \"./objectives\";\nimport { CMIStudentData } from \"./student_data\";\nimport { CMIStudentPreference } from \"./student_preference\";\nimport { CMIInteractions } from \"./interactions\";\n\n/**\n * Class representing the cmi object for SCORM 1.2\n */\nexport class CMI extends BaseRootCMI {\n private readonly __children: string = \"\";\n private __version: string = \"3.4\";\n private _launch_data: string = \"\";\n private _comments: string = \"\";\n private _comments_from_lms: string = \"\";\n\n /**\n * Constructor for the SCORM 1.2 cmi object\n * @param {string} cmi_children\n * @param {(CMIStudentData|AICCCMIStudentData)} student_data\n * @param {boolean} initialized\n */\n constructor(\n cmi_children?: string,\n student_data?: CMIStudentData,\n initialized?: boolean,\n ) {\n super();\n if (initialized) this.initialize();\n this.__children = cmi_children\n ? cmi_children\n : APIConstants.scorm12.cmi_children;\n this.core = new CMICore();\n this.objectives = new CMIObjectives();\n this.student_data = student_data ? student_data : new CMIStudentData();\n this.student_preference = new CMIStudentPreference();\n this.interactions = new CMIInteractions();\n }\n\n public core: CMICore;\n public objectives: CMIObjectives;\n public student_data: CMIStudentData;\n public student_preference: CMIStudentPreference;\n public interactions: CMIInteractions;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.core?.initialize();\n this.objectives?.initialize();\n this.student_data?.initialize();\n this.student_preference?.initialize();\n this.interactions?.initialize();\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * suspend_data: string,\n * launch_data: string,\n * comments: string,\n * comments_from_lms: string,\n * core: CMICore,\n * objectives: CMIObjectives,\n * student_data: CMIStudentData,\n * student_preference: CMIStudentPreference,\n * interactions: CMIInteractions\n * }\n * }\n */\n toJSON(): {\n suspend_data: string;\n launch_data: string;\n comments: string;\n comments_from_lms: string;\n core: CMICore;\n objectives: CMIObjectives;\n student_data: CMIStudentData;\n student_preference: CMIStudentPreference;\n interactions: CMIInteractions;\n } {\n this.jsonString = true;\n const result = {\n suspend_data: this.suspend_data,\n launch_data: this.launch_data,\n comments: this.comments,\n comments_from_lms: this.comments_from_lms,\n core: this.core,\n objectives: this.objectives,\n student_data: this.student_data,\n student_preference: this.student_preference,\n interactions: this.interactions,\n };\n delete this.jsonString;\n return result;\n }\n\n /**\n * Getter for __version\n * @return {string}\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n */\n set _version(_version: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for __children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this.core?.suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (this.core) {\n this.core.suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _comments\n * @return {string}\n */\n get comments(): string {\n return this._comments;\n }\n\n /**\n * Setter for _comments\n * @param {string} comments\n */\n set comments(comments: string) {\n if (check12ValidFormat(comments, Regex.scorm12.CMIString4096, true)) {\n this._comments = comments;\n }\n }\n\n /**\n * Getter for _comments_from_lms\n * @return {string}\n */\n get comments_from_lms(): string {\n return this._comments_from_lms;\n }\n\n /**\n * Setter for _comments_from_lms. Can only be called before initialization.\n * @param {string} comments_from_lms\n */\n set comments_from_lms(comments_from_lms: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._comments_from_lms = comments_from_lms;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string}\n */\n getCurrentTotalTime(): string {\n return this.core.getCurrentTotalTime(this.start_time);\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 `cmi.interactions`\n * @extends CMIArray\n */\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.interactions`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.interactions_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n object\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n children: APIConstants.scorm12.correct_responses_children,\n });\n }\n\n public readonly objectives: CMIArray;\n public readonly correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n private _id = \"\";\n private _time = \"\";\n private _type = \"\";\n private _weighting = \"\";\n private _student_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n\n /**\n * Getter for _id. Should only be called during JSON export.\n * @return {string}\n */\n get id(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _time. Should only be called during JSON export.\n * @return {string}\n */\n get time(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._time;\n }\n\n /**\n * Setter for _time\n * @param {string} time\n */\n set time(time: string) {\n if (check12ValidFormat(time, Regex.scorm12.CMITime)) {\n this._time = time;\n }\n }\n\n /**\n * Getter for _type. Should only be called during JSON export.\n * @return {string}\n */\n get type(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (check12ValidFormat(type, Regex.scorm12.CMIType)) {\n this._type = type;\n }\n }\n\n /**\n * Getter for _weighting. Should only be called during JSON export.\n * @return {string}\n */\n get weighting(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (\n check12ValidFormat(weighting, Regex.scorm12.CMIDecimal) &&\n check12ValidRange(weighting, Regex.scorm12.weighting_range)\n ) {\n this._weighting = weighting;\n }\n }\n\n /**\n * Getter for _student_response. Should only be called during JSON export.\n * @return {string}\n */\n get student_response(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._student_response;\n }\n\n /**\n * Setter for _student_response\n * @param {string} student_response\n */\n set student_response(student_response: string) {\n if (check12ValidFormat(student_response, Regex.scorm12.CMIFeedback, true)) {\n this._student_response = student_response;\n }\n }\n\n /**\n * Getter for _result. Should only be called during JSON export.\n * @return {string}\n */\n get result(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check12ValidFormat(result, Regex.scorm12.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency. Should only be called during JSON export.\n * @return {string}\n */\n get latency(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (check12ValidFormat(latency, Regex.scorm12.CMITimespan)) {\n this._latency = latency;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * time: string,\n * type: string,\n * weighting: string,\n * student_response: string,\n * result: string,\n * latency: string,\n * objectives: CMIArray,\n * correct_responses: CMIArray\n * }\n * }\n */\n toJSON(): {\n id: string;\n time: string;\n type: string;\n weighting: string;\n student_response: string;\n result: string;\n latency: string;\n objectives: CMIArray;\n correct_responses: CMIArray;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n time: this.time,\n type: this.type,\n weighting: this.weighting,\n student_response: this.student_response,\n result: this.result,\n latency: this.latency,\n objectives: this.objectives,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.n.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n private _id = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.interactions.correct_responses.n object\n * @extends BaseCMI\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n /**\n * Constructor for cmi.interactions.correct_responses.n\n */\n constructor() {\n super();\n }\n\n private _pattern = \"\";\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n if (!this.jsonString) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.WRITE_ONLY_ELEMENT);\n }\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check12ValidFormat(pattern, Regex.scorm12.CMIFeedback, true)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON for cmi.interactions.correct_responses.n\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this._pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {BaseCMI} from \"../common/base_cmi\";\nimport {check12ValidFormat} from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class for AICC Navigation object\n */\nexport class NAV extends BaseCMI {\n /**\n * Constructor for NAV object\n */\n constructor() {\n super();\n }\n\n private _event = \"\";\n\n /**\n * Getter for _event\n * @return {string}\n */\n get event(): string {\n return this._event;\n }\n\n /**\n * Setter for _event\n * @param {string} event\n */\n set event(event: string) {\n if (check12ValidFormat(event, Regex.scorm12.NAVEvent)) {\n this._event = event;\n }\n }\n\n /**\n * toJSON for nav object\n * @return {\n * {\n * event: string\n * }\n * }\n */\n toJSON(): {\n event: string;\n } {\n this.jsonString = true;\n const result = {\n event: this.event,\n };\n delete this.jsonString;\n return result;\n }\n}","import {BaseCMI} from \"../common/base_cmi\";\nimport {CMIScore} from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\nimport {check12ValidFormat} from \"./validation\";\nimport {CMIArray} from \"../common/array\";\n\n/**\n * Class representing SCORM 1.2's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives`\n */\n constructor() {\n super({\n children: APIConstants.scorm12.objectives_children,\n errorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n errorClass: Scorm12ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 1.2's cmi.objectives.n object\n * @extends BaseCMI\n */\nexport class CMIObjectivesObject extends BaseCMI {\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new CMIScore({\n score_children: APIConstants.scorm12.score_children,\n score_range: Regex.scorm12.score_range,\n invalidErrorCode: ErrorCodes.scorm12.INVALID_SET_VALUE,\n invalidTypeCode: ErrorCodes.scorm12.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n errorClass: Scorm12ValidationError,\n });\n }\n\n public readonly score: CMIScore;\n\n private _id = \"\";\n private _status = \"\";\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check12ValidFormat(id, Regex.scorm12.CMIIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _status\n * @return {string}\n */\n get status(): string {\n return this._status;\n }\n\n /**\n * Setter for _status\n * @param {string} status\n */\n set status(status: string) {\n if (check12ValidFormat(status, Regex.scorm12.CMIStatus2)) {\n this._status = status;\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n * @return {\n * {\n * id: string,\n * status: string,\n * score: CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n status: string;\n score: CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n status: this.status,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_data object\n * @extends BaseCMI\n */\nexport class CMIStudentData extends BaseCMI {\n private readonly __children;\n private _mastery_score = \"\";\n private _max_time_allowed = \"\";\n private _time_limit_action = \"\";\n\n /**\n * Constructor for cmi.student_data\n * @param {string} student_data_children\n */\n constructor(student_data_children?: string) {\n super();\n this.__children = student_data_children\n ? student_data_children\n : APIConstants.scorm12.student_data_children;\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _master_score\n * @return {string}\n */\n get mastery_score(): string {\n return this._mastery_score;\n }\n\n /**\n * Setter for _master_score. Can only be called before initialization.\n * @param {string} mastery_score\n */\n set mastery_score(mastery_score: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._mastery_score = mastery_score;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.READ_ONLY_ELEMENT);\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * toJSON for cmi.student_data\n *\n * @return {\n * {\n * max_time_allowed: string,\n * time_limit_action: string,\n * mastery_score: string\n * }\n * }\n */\n toJSON(): {\n mastery_score: string;\n max_time_allowed: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n mastery_score: this.mastery_score,\n max_time_allowed: this.max_time_allowed,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm12ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check12ValidFormat, check12ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing the SCORM 1.2 cmi.student_preference object\n * @extends BaseCMI\n */\nexport class CMIStudentPreference extends BaseCMI {\n private readonly __children;\n\n /**\n * Constructor for cmi.student_preference\n * @param {string} student_preference_children\n */\n constructor(student_preference_children?: string) {\n super();\n this.__children = student_preference_children\n ? student_preference_children\n : APIConstants.scorm12.student_preference_children;\n }\n\n private _audio = \"\";\n private _language = \"\";\n private _speed = \"\";\n private _text = \"\";\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.INVALID_SET_VALUE);\n }\n\n /**\n * Getter for _audio\n * @return {string}\n */\n get audio(): string {\n return this._audio;\n }\n\n /**\n * Setter for _audio\n * @param {string} audio\n */\n set audio(audio: string) {\n if (\n check12ValidFormat(audio, Regex.scorm12.CMISInteger) &&\n check12ValidRange(audio, Regex.scorm12.audio_range)\n ) {\n this._audio = audio;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check12ValidFormat(language, Regex.scorm12.CMIString256)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _speed\n * @return {string}\n */\n get speed(): string {\n return this._speed;\n }\n\n /**\n * Setter for _speed\n * @param {string} speed\n */\n set speed(speed: string) {\n if (\n check12ValidFormat(speed, Regex.scorm12.CMISInteger) &&\n check12ValidRange(speed, Regex.scorm12.speed_range)\n ) {\n this._speed = speed;\n }\n }\n\n /**\n * Getter for _text\n * @return {string}\n */\n get text(): string {\n return this._text;\n }\n\n /**\n * Setter for _text\n * @param {string} text\n */\n set text(text: string) {\n if (\n check12ValidFormat(text, Regex.scorm12.CMISInteger) &&\n check12ValidRange(text, Regex.scorm12.text_range)\n ) {\n this._text = text;\n }\n }\n\n /**\n * toJSON for cmi.student_preference\n *\n * @return {\n * {\n * audio: string,\n * language: string,\n * speed: string,\n * text: string\n * }\n * }\n */\n toJSON(): {\n audio: string;\n language: string;\n speed: string;\n text: string;\n } {\n this.jsonString = true;\n const result = {\n audio: this.audio,\n language: this.language,\n speed: this.speed,\n text: this.text,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import {checkValidFormat, checkValidRange} from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport {Scorm12ValidationError} from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm12.TYPE_MISMATCH,\n Scorm12ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check12ValidRange(\n value: any,\n rangePattern: string,\n allowEmptyString?: boolean,\n): boolean {\n if (!allowEmptyString && value === \"\") {\n throw new Scorm12ValidationError(ErrorCodes.scorm12.VALUE_OUT_OF_RANGE);\n }\n\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm12.VALUE_OUT_OF_RANGE,\n Scorm12ValidationError,\n );\n}","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm12/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\n\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { CMIObjectivesObject } from \"./cmi/scorm12/objectives\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm12/interactions\";\nimport { NAV } from \"./cmi/scorm12/nav\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport Regex from \"./constants/regex\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 1.2\n */\nexport default class Scorm12API extends BaseAPI {\n /**\n * Constructor for SCORM 1.2 API\n * @param {object} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm12, settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n\n // Rename functions to match 1.2 Spec and expose to modules\n this.LMSInitialize = this.lmsInitialize;\n this.LMSFinish = this.lmsFinish;\n this.LMSGetValue = this.lmsGetValue;\n this.LMSSetValue = this.lmsSetValue;\n this.LMSCommit = this.lmsCommit;\n this.LMSGetLastError = this.lmsGetLastError;\n this.LMSGetErrorString = this.lmsGetErrorString;\n this.LMSGetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public statusSetByModule = false;\n\n public cmi: CMI;\n public nav: NAV;\n\n public LMSInitialize: () => string;\n public LMSFinish: () => string;\n public LMSGetValue: (CMIElement: string) => string;\n public LMSSetValue: (CMIElement: string, value: any) => string;\n public LMSCommit: () => string;\n public LMSGetLastError: () => string;\n public LMSGetErrorString: (CMIErrorCode: string) => string;\n public LMSGetDiagnostic: (CMIErrorCode: string) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.nav = new NAV();\n }\n\n /**\n * lmsInitialize function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n if (this.cmi.core.lesson_status) {\n this.statusSetByModule = true;\n } else {\n this.cmi.core.lesson_status = \"not attempted\";\n }\n return this.initialize(\n \"LMSInitialize\",\n \"LMS was already initialized!\",\n \"LMS is already finished!\",\n );\n }\n\n /**\n * LMSFinish function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"LMSFinish\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.nav.event !== \"\") {\n if (this.nav.event === \"continue\") {\n this.processListeners(\"SequenceNext\");\n } else {\n this.processListeners(\"SequencePrevious\");\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * LMSGetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n return this.getValue(\"LMSGetValue\", false, CMIElement);\n }\n\n /**\n * LMSSetValue function from SCORM 1.2 Spec\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n if (CMIElement === \"cmi.core.lesson_status\") {\n this.statusSetByModule = true;\n }\n return this.setValue(\"LMSSetValue\", \"LMSCommit\", false, CMIElement, value);\n }\n\n /**\n * LMSCommit function from SCORM 1.2 Spec\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"LMSCommit\", false);\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * LMSGetLastError function from SCORM 1.2 Spec\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"LMSGetLastError\");\n }\n\n /**\n * LMSGetErrorString function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string): string {\n return this.getErrorString(\"LMSGetErrorString\", CMIErrorCode);\n }\n\n /**\n * LMSGetDiagnostic function from SCORM 1.2 Spec\n *\n * @param {string} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string): string {\n return this.getDiagnostic(\"LMSGetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"LMSSetValue\", false, CMIElement, value);\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"getCMIValue\", false, CMIElement);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {*} _value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n _value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsCorrectResponsesObject();\n } else if (\n foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObjectivesObject();\n } else if (\n !foundFirstIndex &&\n stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")\n ) {\n return new CMIInteractionsObject();\n }\n\n return null;\n }\n\n /**\n * Validates Correct Response values\n *\n * @param {string} _CMIElement\n * @param {*} _value\n */\n validateCorrectResponse(_CMIElement: string, _value: any) {\n // do nothing\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {number|string} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: number | string,\n detail: boolean,\n ): string {\n let basicMessage = \"No Error\";\n let detailMessage = \"No Error\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm12.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm12.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Replace the whole API with another\n *\n * @param {Scorm12API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm12API) {\n // Data Model\n this.cmi = newAPI.cmi;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.core.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeHHMMSS = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getTimeAsSeconds(\n totalTimeHHMMSS,\n Regex.scorm12.CMITimespan,\n );\n const lessonStatus = this.cmi.core.lesson_status;\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (lessonStatus) {\n completionStatus =\n lessonStatus === \"completed\" || lessonStatus === \"passed\"\n ? CompletionStatus.completed\n : CompletionStatus.incomplete;\n if (lessonStatus === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (lessonStatus === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.core.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n }\n\n const commitObject: CommitObject = {\n successStatus: successStatus,\n completionStatus: completionStatus,\n runtimeData: cmiExport,\n totalTimeSeconds: totalTimeSeconds,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n const originalStatus = this.cmi.core.lesson_status;\n if (\n !this.cmi.core.lesson_status ||\n (!this.statusSetByModule &&\n this.cmi.core.lesson_status === \"not attempted\")\n ) {\n this.cmi.core.lesson_status = \"completed\";\n }\n\n if (this.cmi.core.lesson_mode === \"normal\") {\n if (this.cmi.core.credit === \"credit\") {\n if (\n this.settings.mastery_override &&\n this.cmi.student_data.mastery_score !== \"\" &&\n this.cmi.core.score.raw !== \"\"\n ) {\n this.cmi.core.lesson_status =\n parseFloat(this.cmi.core.score.raw) >=\n parseFloat(this.cmi.student_data.mastery_score)\n ? \"passed\"\n : \"failed\";\n }\n }\n } else if (this.cmi.core.lesson_mode === \"browse\") {\n if (\n (this.startingData?.cmi?.core?.lesson_status || \"\") === \"\" &&\n originalStatus === \"not attempted\"\n ) {\n this.cmi.core.lesson_status = \"browsed\";\n }\n }\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n return await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","A","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","hasOwnProperty","call","result","errorCode","SCORM_TRUE","status","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","this","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","initialize","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","cmi","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","CMIElement","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","value","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","READ_ONLY_ELEMENT","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","newChild","getChildElement","initialized","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","scorm12","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","scorm12_error_codes","__children","children","_errorCode","_errorClass","errorClass","_children","_count","toJSON","jsonString","_initialized","_start_time","Date","getTime","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","score_children","__score_range","score_range","_max","max","__invalid_error_code","INVALID_SET_VALUE","__invalid_type_code","invalidTypeCode","TYPE_MISMATCH","__invalid_range_code","invalidRangeCode","VALUE_OUT_OF_RANGE","__decimal_regex","decimalRegex","CMIDecimal","__error_class","raw","min","checkValidFormat","regexPattern","allowEmptyString","formatRegex","RegExp","matches","checkValidRange","rangePattern","ranges","core_children","_student_id","_student_name","_lesson_location","_credit","_lesson_status","_entry","_total_time","_lesson_mode","_exit","_session_time","_suspend_data","score","student_id","student_name","lesson_location","CMIString256","credit","lesson_status","CMIStatus","CMIStatus2","entry","total_time","lesson_mode","WRITE_ONLY_ELEMENT","exit","CMIExit","session_time","CMITimespan","suspend_data","CMIString4096","getCurrentTotalTime","start_time","sessionTime","startTime","seconds","cmi_children","student_data","__version","_launch_data","_comments","_comments_from_lms","core","CMICore","objectives","C","student_preference","interactions","launch_data","comments","comments_from_lms","_version","interactions_children","_id","_time","_type","_weighting","_student_response","_result","_latency","objectives_children","correct_responses","correct_responses_children","id","CMIIdentifier","time","CMITime","type","CMIType","weighting","weighting_range","student_response","CMIFeedback","CMIResult","latency","_pattern","pattern","_event","event","NAVEvent","_status","student_data_children","_mastery_score","_max_time_allowed","_time_limit_action","mastery_score","max_time_allowed","time_limit_action","student_preference_children","_audio","_language","_speed","_text","audio","CMISInteger","audio_range","language","speed","speed_range","text_range","check12ValidFormat","check12ValidRange","comments_children","error_descriptions","basicMessage","detailMessage","APIConstants","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","NAVBoolean","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","DEPENDENCY_NOT_ESTABLISHED","ErrorCodes","MULTIPLE_TERMINATIONS","CMIInteger","CMIIndex","Regex","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVTarget","scaled_range","progress_range","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","getSecondsAsHHMMSS","totalSeconds","hours","Math","floor","dateObj","minutes","getUTCMinutes","getSeconds","ms","msStr","countDecimals","toFixed","getTimeAsSeconds","timeString","timeRegex","parts","addHHMMSSTimeStrings","first","second","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","regex","m","exec","num","formatMessage","messageString","fillChars","j","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","o","defineProperty","enumerable","get","r","toStringTag","mastery_override","statusSetByModule","nav","LMSInitialize","lmsInitialize","LMSFinish","lmsFinish","LMSGetValue","lmsGetValue","LMSSetValue","lmsSetValue","LMSCommit","lmsCommit","LMSGetLastError","lmsGetLastError","LMSGetErrorString","lmsGetErrorString","LMSGetDiagnostic","lmsGetDiagnostic","reset","internalFinish","detail","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeHHMMSS","totalTimeSeconds","lessonStatus","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","originalStatus","shouldTerminateCommit"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/scorm2004.js b/dist/scorm2004.js index bcb9383..07b2d8c 100644 --- a/dist/scorm2004.js +++ b/dist/scorm2004.js @@ -10,2003 +10,2342 @@ })(self, function() { return /******/ (function() { // webpackBootstrap /******/ "use strict"; -var __webpack_exports__ = {}; +/******/ var __webpack_modules__ = ({ -;// ./node_modules/tslib/tslib.es6.mjs -/****************************************************************************** -Copyright (c) Microsoft Corporation. +/***/ 900: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + A: function() { return /* binding */ src_BaseAPI; } +}); -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +;// ./src/utilities/debounce.ts +function debounce(func, wait, immediate) { + if (immediate === void 0) { immediate = false; } + var timeout; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var context = this; + var later = function () { + timeout = null; + if (!immediate) + func.apply(context, args); + }; + var callNow = immediate && !timeout; + if (timeout) + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) + func.apply(context, args); + }; +} + +;// ./src/constants/default_settings.ts + + +var DefaultSettings = { + autocommit: false, + autocommitSeconds: 10, + asyncCommit: false, + sendFullCommit: true, + lmsCommitUrl: false, + dataCommitFormat: "json", + commitRequestDataType: "application/json;charset=UTF-8", + autoProgress: false, + logLevel: api_constants/* default */.A.global.LOG_LEVEL_ERROR, + selfReportSessionTime: false, + alwaysSendTotalTime: false, + renderCommonCommitFields: false, + strict_errors: true, + xhrHeaders: {}, + xhrWithCredentials: false, + responseHandler: function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var httpResult, _a, _b; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof response !== "undefined")) return [3, 2]; + _b = (_a = JSON).parse; + return [4, response.text()]; + case 1: + httpResult = _b.apply(_a, [_c.sent()]); + if (httpResult === null || + !{}.hasOwnProperty.call(httpResult, "result")) { + if (response.status === 200) { + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + else { + return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + } + else { + return [2, { + result: httpResult.result, + errorCode: httpResult.errorCode + ? httpResult.errorCode + : httpResult.result === api_constants/* default */.A.global.SCORM_TRUE + ? 0 + : 101, + }]; + } + _c.label = 2; + case 2: return [2, { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: 101, + }]; + } + }); + }); + }, + requestHandler: function (commitObject) { + return commitObject; + }, + onLogMessage: function (messageLevel, logMessage) { + switch (messageLevel) { + case api_constants/* default */.A.global.LOG_LEVEL_ERROR: + console.error(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_WARNING: + console.warn(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_INFO: + console.info(logMessage); + break; + case api_constants/* default */.A.global.LOG_LEVEL_DEBUG: + if (console.debug) { + console.debug(logMessage); + } + else { + console.log(logMessage); + } + break; + } + }, + scoItemIds: [], + scoItemIdValidator: false, }; -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} +;// ./src/helpers/scheduled_commit.ts -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} +var ScheduledCommit = (function () { + function ScheduledCommit(API, when, callback) { + this._cancelled = false; + this._API = API; + this._timeout = setTimeout(this.wrapper.bind(this), when); + this._callback = callback; + } + ScheduledCommit.prototype.cancel = function () { + this._cancelled = true; + if (this._timeout) { + clearTimeout(this._timeout); + } + }; + ScheduledCommit.prototype.wrapper = function () { + var _this = this; + if (!this._cancelled) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this._API.commit(this._callback)]; + case 1: return [2, _a.sent()]; + } + }); }); })(); + } + }; + return ScheduledCommit; +}()); -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} +;// ./src/BaseAPI.ts -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } - var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } - else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -}; -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -}; -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -}; -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); -}; -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); - return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; - function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } - function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} - -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} - -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; - env.stack.push({ value: value, dispose: dispose, async: async }); - } - else if (async) { - env.stack.push({ async: true }); - } - return value; -} - -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { - try { - if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); - if (r.dispose) { - var result = r.dispose.call(r.value); - if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); +var BaseAPI = (function () { + function BaseAPI(error_codes, settings) { + var _newTarget = this.constructor; + this._settings = DefaultSettings; + if (_newTarget === BaseAPI) { + throw new TypeError("Cannot construct BaseAPI instances directly"); } - else s |= 1; - } - catch (e) { - fail(e); - } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} - -/* harmony default export */ var tslib_es6 = ({ - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources, -}); - -;// ./src/cmi/common/base_cmi.ts - -var BaseCMI = (function () { - function BaseCMI() { - this.jsonString = false; - this._initialized = false; + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + this._error_codes = error_codes; + if (settings) { + this.settings = settings; + } + this.apiLogLevel = this.settings.logLevel; + this.selfReportSessionTime = this.settings.selfReportSessionTime; } - Object.defineProperty(BaseCMI.prototype, "initialized", { + BaseAPI.prototype.commonReset = function (settings) { + this.settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings), settings); + this.currentState = api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + this.lastErrorCode = "0"; + this.listenerArray = []; + }; + BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); + } + else if (this.isTerminated()) { + this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); + } + else { + if (this.selfReportSessionTime) { + this.cmi.setStartTime(); + } + this.currentState = api_constants/* default */.A.global.STATE_INITIALIZED; + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + } + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { + logMessage = (0,utilities/* formatMessage */.hw)(functionName, logMessage, CMIElement); + if (messageLevel >= this.apiLogLevel) { + this.settings.onLogMessage(messageLevel, logMessage); + } + }; + Object.defineProperty(BaseAPI.prototype, "error_codes", { get: function () { - return this._initialized; + return this._error_codes; }, enumerable: false, configurable: true }); - Object.defineProperty(BaseCMI.prototype, "start_time", { + Object.defineProperty(BaseAPI.prototype, "settings", { get: function () { - return this._start_time; + return this._settings; + }, + set: function (settings) { + this._settings = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this._settings), settings); }, enumerable: false, configurable: true }); - BaseCMI.prototype.initialize = function () { - this._initialized = true; + BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var returnValue, result; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; + this.currentState = api_constants/* default */.A.global.STATE_TERMINATED; + return [4, this.storeData(true)]; + case 1: + result = _a.sent(); + if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + if (checkTerminated) + this.lastErrorCode = "0"; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); }; - BaseCMI.prototype.setStartTime = function () { - this._start_time = new Date().getTime(); + BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { + var returnValue = ""; + if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.getCMIValue(CMIElement); + } + catch (e) { + returnValue = this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement); + } + this.apiLog(callbackName, ": returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + if (returnValue === undefined) { + return ""; + } + this.clearSCORMError(returnValue); + return returnValue; }; - return BaseCMI; -}()); - -var BaseRootCMI = (function (_super) { - __extends(BaseRootCMI, _super); - function BaseRootCMI() { - return _super !== null && _super.apply(this, arguments) || this; - } - return BaseRootCMI; -}(BaseCMI)); - - -;// ./src/constants/error_codes.ts - -var global = { - GENERAL: 101, - INITIALIZATION_FAILED: 101, - INITIALIZED: 101, - TERMINATED: 101, - TERMINATION_FAILURE: 101, - TERMINATION_BEFORE_INIT: 101, - MULTIPLE_TERMINATION: 101, - RETRIEVE_BEFORE_INIT: 101, - RETRIEVE_AFTER_TERM: 101, - STORE_BEFORE_INIT: 101, - STORE_AFTER_TERM: 101, - COMMIT_BEFORE_INIT: 101, - COMMIT_AFTER_TERM: 101, - ARGUMENT_ERROR: 101, - CHILDREN_ERROR: 101, - COUNT_ERROR: 101, - GENERAL_GET_FAILURE: 101, - GENERAL_SET_FAILURE: 101, - GENERAL_COMMIT_FAILURE: 101, - UNDEFINED_DATA_MODEL: 101, - UNIMPLEMENTED_ELEMENT: 101, - VALUE_NOT_INITIALIZED: 101, - INVALID_SET_VALUE: 101, - READ_ONLY_ELEMENT: 101, - WRITE_ONLY_ELEMENT: 101, - TYPE_MISMATCH: 101, - VALUE_OUT_OF_RANGE: 101, - DEPENDENCY_NOT_ESTABLISHED: 101, -}; -var scorm12 = __assign(__assign({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var scorm2004 = __assign(__assign({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); -var ErrorCodes = { - scorm12: scorm12, - scorm2004: scorm2004, -}; -/* harmony default export */ var error_codes = (ErrorCodes); - -;// ./src/constants/api_constants.ts - -var api_constants_global = { - SCORM_TRUE: "true", - SCORM_FALSE: "false", - STATE_NOT_INITIALIZED: 0, - STATE_INITIALIZED: 1, - STATE_TERMINATED: 2, - LOG_LEVEL_DEBUG: 1, - LOG_LEVEL_INFO: 2, - LOG_LEVEL_WARNING: 3, - LOG_LEVEL_ERROR: 4, - LOG_LEVEL_NONE: 5, -}; -var api_constants_scorm12 = { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", - core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", - score_children: "raw,min,max", - comments_children: "content,location,time", - objectives_children: "id,score,status", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio,language,speed,text", - interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", - error_descriptions: { - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", - }, - "201": { - basicMessage: "Invalid argument error", - detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", - }, - "202": { - basicMessage: "Element cannot have children", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', - }, - "203": { - basicMessage: "Element not an array - cannot have count", - detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', - }, - "301": { - basicMessage: "Not initialized", - detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", - }, - "401": { - basicMessage: "Not implemented error", - detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", - }, - "402": { - basicMessage: "Invalid set value, element is a keyword", - detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', - }, - "403": { - basicMessage: "Element is read only", - detailMessage: "LMSSetValue was called with a data model element that can only be read.", - }, - "404": { - basicMessage: "Element is write only", - detailMessage: "LMSGetValue was called on a data model element that can only be written to.", - }, - "405": { - basicMessage: "Incorrect Data Type", - detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Element Value Out Of Range", - detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var aicc = __assign(__assign({}, api_constants_scorm12), { - cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", - student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", - student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", - student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", - tries_children: "time,status,score", - attempt_records_children: "score,lesson_status", - paths_children: "location_id,date,time,status,why_left,time_in_element", -}); -var api_constants_scorm2004 = { - cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", - comments_children: "comment,timestamp,location", - score_children: "max,raw,scaled,min", - objectives_children: "progress_measure,completion_status,success_status,description,score,id", - correct_responses_children: "pattern", - student_data_children: "mastery_score,max_time_allowed,time_limit_action", - student_preference_children: "audio_level,audio_captioning,delivery_speed,language", - interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", - error_descriptions: { - "0": { - basicMessage: "No Error", - detailMessage: "No error occurred, the previous API call was successful.", - }, - "101": { - basicMessage: "General Exception", - detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", - }, - "102": { - basicMessage: "General Initialization Failure", - detailMessage: "Call to Initialize failed for an unknown reason.", - }, - "103": { - basicMessage: "Already Initialized", - detailMessage: "Call to Initialize failed because Initialize was already called.", - }, - "104": { - basicMessage: "Content Instance Terminated", - detailMessage: "Call to Initialize failed because Terminate was already called.", - }, - "111": { - basicMessage: "General Termination Failure", - detailMessage: "Call to Terminate failed for an unknown reason.", - }, - "112": { - basicMessage: "Termination Before Initialization", - detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", - }, - "113": { - basicMessage: "Termination After Termination", - detailMessage: "Call to Terminate failed because Terminate was already called.", - }, - "122": { - basicMessage: "Retrieve Data Before Initialization", - detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", - }, - "123": { - basicMessage: "Retrieve Data After Termination", - detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", - }, - "132": { - basicMessage: "Store Data Before Initialization", - detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", - }, - "133": { - basicMessage: "Store Data After Termination", - detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", - }, - "142": { - basicMessage: "Commit Before Initialization", - detailMessage: "Call to Commit failed because it was made before the call to Initialize.", - }, - "143": { - basicMessage: "Commit After Termination", - detailMessage: "Call to Commit failed because it was made after the call to Terminate.", - }, - "201": { - basicMessage: "General Argument Error", - detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", - }, - "301": { - basicMessage: "General Get Failure", - detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "351": { - basicMessage: "General Set Failure", - detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "391": { - basicMessage: "General Commit Failure", - detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", - }, - "401": { - basicMessage: "Undefined Data Model Element", - detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", - }, - "402": { - basicMessage: "Unimplemented Data Model Element", - detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", - }, - "403": { - basicMessage: "Data Model Element Value Not Initialized", - detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", - }, - "404": { - basicMessage: "Data Model Element Is Read Only", - detailMessage: "SetValue was called with a data model element that can only be read.", - }, - "405": { - basicMessage: "Data Model Element Is Write Only", - detailMessage: "GetValue was called on a data model element that can only be written to.", - }, - "406": { - basicMessage: "Data Model Element Type Mismatch", - detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", - }, - "407": { - basicMessage: "Data Model Element Value Out Of Range", - detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", - }, - "408": { - basicMessage: "Data Model Dependency Not Established", - detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", - }, - }, -}; -var APIConstants = { - global: api_constants_global, - scorm12: api_constants_scorm12, - aicc: aicc, - scorm2004: api_constants_scorm2004, -}; -/* harmony default export */ var api_constants = (APIConstants); - -;// ./src/exceptions.ts - - -var scorm12_errors = api_constants.scorm12.error_descriptions; -var aicc_errors = api_constants.aicc.error_descriptions; -var scorm2004_errors = api_constants.scorm2004.error_descriptions; -var BaseScormValidationError = (function (_super) { - __extends(BaseScormValidationError, _super); - function BaseScormValidationError(errorCode) { - var _this = _super.call(this, errorCode.toString()) || this; - _this._errorCode = errorCode; - _this.name = "ScormValidationError"; - return _this; - } - Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { - get: function () { - return this._errorCode; - }, - enumerable: false, - configurable: true - }); - BaseScormValidationError.prototype.setMessage = function (message) { - this.message = message; - }; - return BaseScormValidationError; -}(Error)); - -var ValidationError = (function (_super) { - __extends(ValidationError, _super); - function ValidationError(errorCode, errorMessage, detailedMessage) { - var _this = _super.call(this, errorCode) || this; - _this._detailedMessage = ""; - _this.setMessage(errorMessage); - _this._errorMessage = errorMessage; - if (detailedMessage) { - _this._detailedMessage = detailedMessage; + BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { + if (value !== undefined) { + value = String(value); } - return _this; - } - Object.defineProperty(ValidationError.prototype, "errorMessage", { - get: function () { - return this._errorMessage; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ValidationError.prototype, "detailedMessage", { - get: function () { - return this._detailedMessage; - }, - enumerable: false, - configurable: true - }); - return ValidationError; -}(BaseScormValidationError)); - -var Scorm12ValidationError = (function (_super) { - __extends(Scorm12ValidationError, _super); - function Scorm12ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { + if (checkTerminated) + this.lastErrorCode = "0"; + try { + returnValue = this.setCMIValue(CMIElement, value); + } + catch (e) { + this.handleValueAccessException(e, returnValue); + } + this.processListeners(callbackName, CMIElement, value); } - else { - _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; + if (returnValue === undefined) { + returnValue = api_constants/* default */.A.global.SCORM_FALSE; } - return _this; - } - return Scorm12ValidationError; -}(ValidationError)); - -var AICCValidationError = (function (_super) { - __extends(AICCValidationError, _super); - function AICCValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { - _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; + if (String(this.lastErrorCode) === "0") { + if (this.settings.autocommit && !this._timeout) { + this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); + } } - else { - _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; + this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + this.clearSCORMError(returnValue); + return returnValue; + }; + BaseAPI.prototype.commit = function (callbackName_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (callbackName, checkTerminated) { + var returnValue, result; + if (checkTerminated === void 0) { checkTerminated = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + this.clearScheduledCommit(); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; + return [4, this.storeData(false)]; + case 1: + result = _a.sent(); + if (result.errorCode && result.errorCode > 0) { + this.throwSCORMError(result.errorCode); + } + returnValue = + typeof result !== "undefined" && result.result + ? result.result + : api_constants/* default */.A.global.SCORM_FALSE; + this.apiLog(callbackName, " Result: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_DEBUG, "HttpRequest"); + if (checkTerminated) + this.lastErrorCode = "0"; + this.processListeners(callbackName); + _a.label = 2; + case 2: + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + this.clearSCORMError(returnValue); + return [2, returnValue]; + } + }); + }); + }; + BaseAPI.prototype.getLastError = function (callbackName) { + var returnValue = String(this.lastErrorCode); + this.processListeners(callbackName); + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); + this.processListeners(callbackName); } - return _this; - } - return AICCValidationError; -}(ValidationError)); - -var Scorm2004ValidationError = (function (_super) { - __extends(Scorm2004ValidationError, _super); - function Scorm2004ValidationError(errorCode) { - var _this = this; - if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { - _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { + var returnValue = ""; + if (CMIErrorCode !== null && CMIErrorCode !== "") { + returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); + this.processListeners(callbackName); } - else { - _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; + this.apiLog(callbackName, "returned: " + returnValue, api_constants/* default */.A.global.LOG_LEVEL_INFO); + return returnValue; + }; + BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { + if (this.isNotInitialized()) { + this.throwSCORMError(beforeInitError); + return false; } - return _this; - } - return Scorm2004ValidationError; -}(ValidationError)); - - -;// ./src/cmi/common/array.ts - - - - -var scorm12_error_codes = error_codes.scorm12; -var CMIArray = (function (_super) { - __extends(CMIArray, _super); - function CMIArray(params) { - var _this = _super.call(this) || this; - _this.__children = params.children; - _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; - _this._errorClass = params.errorClass || BaseScormValidationError; - _this.childArray = []; - return _this; - } - Object.defineProperty(CMIArray.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new this._errorClass(this._errorCode); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIArray.prototype, "_count", { - get: function () { - return this.childArray.length; - }, - set: function (_count) { - throw new this._errorClass(this._errorCode); - }, - enumerable: false, - configurable: true - }); - CMIArray.prototype.toJSON = function () { - this.jsonString = true; - var result = {}; - for (var i = 0; i < this.childArray.length; i++) { - result[i + ""] = this.childArray[i]; + else if (checkTerminated && this.isTerminated()) { + this.throwSCORMError(afterTermError); + return false; } - delete this.jsonString; - return result; + return true; }; - return CMIArray; -}(BaseCMI)); - - -;// ./src/utilities.ts -var SECONDS_PER_SECOND = 1.0; -var SECONDS_PER_MINUTE = 60; -var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; -var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; -var designations = { - D: SECONDS_PER_DAY, - H: SECONDS_PER_HOUR, - M: SECONDS_PER_MINUTE, - S: SECONDS_PER_SECOND, -}; -function getSecondsAsHHMMSS(totalSeconds) { - if (!totalSeconds || totalSeconds <= 0) { - return "00:00:00"; - } - var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); - var dateObj = new Date(totalSeconds * 1000); - var minutes = dateObj.getUTCMinutes(); - var seconds = dateObj.getSeconds(); - var ms = totalSeconds % 1.0; - var msStr = ""; - if (countDecimals(ms) > 0) { - if (countDecimals(ms) > 2) { - msStr = ms.toFixed(2); + BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { + if (_detail === void 0) { _detail = false; } + throw new Error("The getLmsErrorMessageDetails method has not been implemented"); + }; + BaseAPI.prototype.getCMIValue = function (_CMIElement) { + throw new Error("The getCMIValue method has not been implemented"); + }; + BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { + throw new Error("The setCMIValue method has not been implemented"); + }; + BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { + if (!CMIElement || CMIElement === "") { + return api_constants/* default */.A.global.SCORM_FALSE; } - else { - msStr = String(ms); + var structure = CMIElement.split("."); + var refObject = this; + var returnValue = api_constants/* default */.A.global.SCORM_FALSE; + var foundFirstIndex = false; + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + var attribute = structure[idx]; + if (idx === structure.length - 1) { + if (scorm2004 && attribute.substring(0, 8) === "{target=") { + if (this.isInitialized()) { + this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); + } + else { + refObject = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, refObject), { attribute: value }); + } + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "\\.correct_responses\\.\\d+") && + this.isInitialized()) { + this.validateCorrectResponse(CMIElement, value); + } + if (!scorm2004 || this.lastErrorCode === "0") { + refObject[attribute] = value; + returnValue = api_constants/* default */.A.global.SCORM_TRUE; + } + } + } + else { + refObject = refObject[attribute]; + if (!refObject) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + foundFirstIndex = true; + } + else { + var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); + foundFirstIndex = true; + if (!newChild) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + } + else { + if (refObject.initialized) + newChild.initialize(); + refObject.childArray.push(newChild); + refObject = newChild; + } + } + idx++; + } + } + } } - msStr = "." + msStr.split(".")[1]; - } - return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); -} -function getSecondsAsISODuration(seconds) { - if (!seconds || seconds <= 0) { - return "PT0S"; - } - var duration = "P"; - var remainder = seconds; - for (var designationsKey in designations) { - var current_seconds = designations[designationsKey]; - var value = Math.floor(remainder / current_seconds); - remainder = remainder % current_seconds; - if (countDecimals(remainder) > 2) { - remainder = Number(Number(remainder).toFixed(2)); + if (returnValue === api_constants/* default */.A.global.SCORM_FALSE) { + this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants/* default */.A.global.LOG_LEVEL_WARNING); } - if (designationsKey === "S" && remainder > 0) { - value += remainder; + return returnValue; + }; + BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { + if (!CMIElement || CMIElement === "") { + return ""; } - if (value) { - if ((duration.indexOf("D") > 0 || - designationsKey === "H" || - designationsKey === "M" || - designationsKey === "S") && - duration.indexOf("T") === -1) { - duration += "T"; + var structure = CMIElement.split("."); + var refObject = this; + var attribute = null; + var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); + var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); + var invalidErrorCode = scorm2004 + ? this._error_codes.UNDEFINED_DATA_MODEL + : this._error_codes.GENERAL; + for (var idx = 0; idx < structure.length; idx++) { + attribute = structure[idx]; + if (!scorm2004) { + if (idx === structure.length - 1) { + if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + } + else { + if (String(attribute).substring(0, 8) === "{target=" && + typeof refObject._isTargetValid == "function") { + var target = String(attribute).substring(8, String(attribute).length - 9); + return refObject._isTargetValid(target); + } + else if (!this._checkObjectHasProperty(refObject, attribute)) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + return; + } + } + refObject = refObject[attribute]; + if (refObject === undefined) { + this.throwSCORMError(invalidErrorCode, invalidErrorMessage); + break; + } + if (refObject instanceof array/* CMIArray */.B) { + var index = parseInt(structure[idx + 1], 10); + if (!isNaN(index)) { + var item = refObject.childArray[index]; + if (item) { + refObject = item; + } + else { + this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); + break; + } + idx++; + } } - duration += "".concat(value).concat(designationsKey); - } - } - return duration; -} -function getTimeAsSeconds(timeString, timeRegex) { - if (typeof timeString === "number" || typeof timeString === "boolean") { - timeString = String(timeString); - } - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - if (!timeString || !timeString.match(timeRegex)) { - return 0; - } - var parts = timeString.split(":"); - var hours = Number(parts[0]); - var minutes = Number(parts[1]); - var seconds = Number(parts[2]); - return hours * 3600 + minutes * 60 + seconds; -} -function getDurationAsSeconds(duration, durationRegex) { - if (typeof durationRegex === "string") { - durationRegex = new RegExp(durationRegex); - } - if (!duration || !duration.match(durationRegex)) { - return 0; - } - var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; - var result = 0.0; - result += Number(seconds) || 0.0; - result += Number(minutes) * 60.0 || 0.0; - result += Number(hours) * 3600.0 || 0.0; - result += Number(days) * (60 * 60 * 24.0) || 0.0; - result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; - return result; -} -function addTwoDurations(first, second, durationRegex) { - var regex = typeof durationRegex === "string" - ? new RegExp(durationRegex) - : durationRegex; - return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); -} -function addHHMMSSTimeStrings(first, second, timeRegex) { - if (typeof timeRegex === "string") { - timeRegex = new RegExp(timeRegex); - } - return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); -} -function flatten(data) { - var result = {}; - function recurse(cur, prop) { - if (Object(cur) !== cur) { - result[prop] = cur; } - else if (Array.isArray(cur)) { - for (var i = 0, l = cur.length; i < l; i++) { - recurse(cur[i], prop + "[" + i + "]"); - if (l === 0) - result[prop] = []; + if (refObject === null || refObject === undefined) { + if (!scorm2004) { + if (attribute === "_children") { + this.throwSCORMError(error_codes/* default */.A.scorm12.CHILDREN_ERROR); + } + else if (attribute === "_count") { + this.throwSCORMError(error_codes/* default */.A.scorm12.COUNT_ERROR); + } } } else { - var isEmpty = true; - for (var p in cur) { - if ({}.hasOwnProperty.call(cur, p)) { - isEmpty = false; - recurse(cur[p], prop ? prop + "." + p : p); - } + return refObject; + } + }; + BaseAPI.prototype.isInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_INITIALIZED; + }; + BaseAPI.prototype.isNotInitialized = function () { + return this.currentState === api_constants/* default */.A.global.STATE_NOT_INITIALIZED; + }; + BaseAPI.prototype.isTerminated = function () { + return this.currentState === api_constants/* default */.A.global.STATE_TERMINATED; + }; + BaseAPI.prototype.on = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + for (var i = 0; i < listenerFunctions.length; i++) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); } - if (isEmpty && prop) - result[prop] = {}; + this.listenerArray.push({ + functionName: functionName, + CMIElement: CMIElement, + callback: callback, + }); + this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); } - } - recurse(data, ""); - return result; -} -function unflatten(data) { - "use strict"; - if (Object(data) !== data || Array.isArray(data)) - return data; - var regex = /\.?([^.[\]]+)|\[(\d+)]/g; - var result = {}; - for (var p in data) { - if ({}.hasOwnProperty.call(data, p)) { - var cur = result; - var prop = ""; - var m = regex.exec(p); - while (m) { - cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); - prop = m[2] || m[1]; - m = regex.exec(p); + }; + BaseAPI.prototype.off = function (listenerName, callback) { + if (!callback) + return; + var listenerFunctions = listenerName.split(" "); + var _loop_1 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); } - cur[prop] = data[p]; + var removeIndex = this_1.listenerArray.findIndex(function (obj) { + return obj.functionName === functionName && + obj.CMIElement === CMIElement && + obj.callback === callback; + }); + if (removeIndex !== -1) { + this_1.listenerArray.splice(removeIndex, 1); + this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants/* default */.A.global.LOG_LEVEL_INFO, functionName); + } + }; + var this_1 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; } - } - return result[""] || result; -} -function countDecimals(num) { - if (Math.floor(num) === num || String(num).indexOf(".") < 0) - return 0; - var parts = num.toString().split(".")[1]; - return parts.length || 0; -} -function formatMessage(functionName, message, CMIElement) { - var baseLength = 20; - var messageString = ""; - messageString += functionName; - var fillChars = baseLength - messageString.length; - for (var i = 0; i < fillChars; i++) { - messageString += " "; - } - messageString += ": "; - if (CMIElement) { - var CMIElementBaseLength = 70; - messageString += CMIElement; - fillChars = CMIElementBaseLength - messageString.length; - for (var j = 0; j < fillChars; j++) { - messageString += " "; + }; + BaseAPI.prototype.clear = function (listenerName) { + var listenerFunctions = listenerName.split(" "); + var _loop_2 = function (i) { + var listenerSplit = listenerFunctions[i].split("."); + if (listenerSplit.length === 0) + return { value: void 0 }; + var functionName = listenerSplit[0]; + var CMIElement = null; + if (listenerSplit.length > 1) { + CMIElement = listenerName.replace(functionName + ".", ""); + } + this_2.listenerArray = this_2.listenerArray.filter(function (obj) { + return obj.functionName !== functionName && obj.CMIElement !== CMIElement; + }); + }; + var this_2 = this; + for (var i = 0; i < listenerFunctions.length; i++) { + var state_2 = _loop_2(i); + if (typeof state_2 === "object") + return state_2.value; } - } - if (message) { - messageString += message; - } - return messageString; -} -function stringMatches(str, tester) { - return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; -} - -;// ./src/utilities/debounce.ts -function debounce(func, wait, immediate) { - if (immediate === void 0) { immediate = false; } - var timeout; - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; + }; + BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { + this.apiLog(functionName, value, api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + for (var i = 0; i < this.listenerArray.length; i++) { + var listener = this.listenerArray[i]; + var functionsMatch = listener.functionName === functionName; + var listenerHasCMIElement = !!listener.CMIElement; + var CMIElementsMatch = false; + if (CMIElement && + listener.CMIElement && + listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { + CMIElementsMatch = + CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; + } + else { + CMIElementsMatch = listener.CMIElement === CMIElement; + } + if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { + this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants/* default */.A.global.LOG_LEVEL_INFO, CMIElement); + listener.callback(CMIElement, value); + } } - var context = this; - var later = function () { - timeout = null; - if (!immediate) - func.apply(context, args); - }; - var callNow = immediate && !timeout; - if (timeout) - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) - func.apply(context, args); }; -} - -;// ./src/constants/default_settings.ts - - -var DefaultSettings = { - autocommit: false, - autocommitSeconds: 10, - asyncCommit: false, - sendFullCommit: true, - lmsCommitUrl: false, - dataCommitFormat: "json", - commitRequestDataType: "application/json;charset=UTF-8", - autoProgress: false, - logLevel: api_constants.global.LOG_LEVEL_ERROR, - selfReportSessionTime: false, - alwaysSendTotalTime: false, - renderCommonCommitFields: false, - strict_errors: true, - xhrHeaders: {}, - xhrWithCredentials: false, - responseHandler: function (response) { - return __awaiter(this, void 0, void 0, function () { - var httpResult, _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof response !== "undefined")) return [3, 2]; - _b = (_a = JSON).parse; - return [4, response.text()]; - case 1: - httpResult = _b.apply(_a, [_c.sent()]); - if (httpResult === null || - !{}.hasOwnProperty.call(httpResult, "result")) { - if (response.status === 200) { - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - else { - return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; - } + BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { + if (!message) { + message = this.getLmsErrorMessageDetails(errorNumber); + } + this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + this.lastErrorCode = String(errorNumber); + }; + BaseAPI.prototype.clearSCORMError = function (success) { + if (success !== undefined && success !== api_constants/* default */.A.global.SCORM_FALSE) { + this.lastErrorCode = "0"; + } + }; + BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + var _this = this; + if (!CMIElement) { + CMIElement = ""; + } + if (!this.isNotInitialized()) { + console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); + return; + } + function testPattern(a, c, a_pattern) { + var a_match = a.match(a_pattern); + var c_match; + if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { + var a_num = Number(a_match[2]); + var c_num = Number(c_match[2]); + if (a_num === c_num) { + if (a_match[3] === "id") { + return -1; + } + else if (a_match[3] === "type") { + if (c_match[3] === "id") { + return 1; } else { - return [2, { - result: httpResult.result, - errorCode: httpResult.errorCode - ? httpResult.errorCode - : httpResult.result === api_constants.global.SCORM_TRUE - ? 0 - : 101, - }]; + return -1; } - _c.label = 2; - case 2: return [2, { - result: api_constants.global.SCORM_FALSE, - errorCode: 101, - }]; + } + else { + return 1; + } } - }); + return a_num - c_num; + } + return null; + } + var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; + var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; + var result = Object.keys(json).map(function (key) { + return [String(key), json[key]]; }); - }, - requestHandler: function (commitObject) { - return commitObject; - }, - onLogMessage: function (messageLevel, logMessage) { - switch (messageLevel) { - case api_constants.global.LOG_LEVEL_ERROR: - console.error(logMessage); - break; - case api_constants.global.LOG_LEVEL_WARNING: - console.warn(logMessage); - break; - case api_constants.global.LOG_LEVEL_INFO: - console.info(logMessage); - break; - case api_constants.global.LOG_LEVEL_DEBUG: - if (console.debug) { - console.debug(logMessage); + result.sort(function (_a, _c) { + var a = _a[0], _b = _a[1]; + var c = _c[0], _d = _c[1]; + var test; + if ((test = testPattern(a, c, int_pattern)) !== null) { + return test; + } + if ((test = testPattern(a, c, obj_pattern)) !== null) { + return test; + } + if (a < c) { + return -1; + } + if (a > c) { + return 1; + } + return 0; + }); + var obj; + result.forEach(function (element) { + obj = {}; + obj[element[0]] = element[1]; + _this.loadFromJSON((0,utilities/* unflatten */.sB)(obj), CMIElement); + }); + }; + BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { + if (!this.isNotInitialized()) { + console.error("loadFromJSON can only be called before the call to lmsInitialize."); + return; + } + CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; + this.startingData = json; + for (var key in json) { + if ({}.hasOwnProperty.call(json, key) && json[key]) { + var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; + var value = json[key]; + if (value["childArray"]) { + for (var i = 0; i < value["childArray"].length; i++) { + this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); + } + } + else if (value.constructor === Object) { + this.loadFromJSON(value, currentCMIElement); } else { - console.log(logMessage); + this.setCMIValue(currentCMIElement, value); } - break; + } } - }, - scoItemIds: [], - scoItemIdValidator: false, -}; - -;// ./src/helpers/scheduled_commit.ts - -var ScheduledCommit = (function () { - function ScheduledCommit(API, when, callback) { - this._cancelled = false; - this._API = API; - this._timeout = setTimeout(this.wrapper.bind(this), when); - this._callback = callback; - } - ScheduledCommit.prototype.cancel = function () { - this._cancelled = true; - if (this._timeout) { - clearTimeout(this._timeout); + }; + BaseAPI.prototype.renderCMIToJSONString = function () { + var cmi = this.cmi; + if (this.settings.sendFullCommit) { + return JSON.stringify({ cmi: cmi }); } + return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); }; - ScheduledCommit.prototype.wrapper = function () { - var _this = this; - if (!this._cancelled) { - (function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + BaseAPI.prototype.renderCMIToJSONObject = function () { + return JSON.parse(this.renderCMIToJSONString()); + }; + BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { + return (0,tslib_es6/* __awaiter */.sH)(this, arguments, void 0, function (url, params, immediate) { + var api, genericError, process, debouncedProcess; + var _this = this; + if (immediate === void 0) { immediate = false; } + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { - case 0: return [4, this._API.commit(this._callback)]; - case 1: return [2, _a.sent()]; + case 0: + api = this; + genericError = { + result: api_constants/* default */.A.global.SCORM_FALSE, + errorCode: this.error_codes.GENERAL, + }; + if (immediate) { + this.performFetch(url, params).then(function (response) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: return [4, this.transformResponse(response)]; + case 1: + _a.sent(); + return [2]; + } + }); + }); }); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + } + process = function (url, params, settings) { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + var response, e_1; + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + params = settings.requestHandler(params); + return [4, this.performFetch(url, params)]; + case 1: + response = _a.sent(); + return [2, this.transformResponse(response)]; + case 2: + e_1 = _a.sent(); + this.apiLog("processHttpRequest", e_1, api_constants/* default */.A.global.LOG_LEVEL_ERROR); + api.processListeners("CommitError"); + return [2, genericError]; + case 3: return [2]; + } + }); + }); }; + if (!this.settings.asyncCommit) return [3, 1]; + debouncedProcess = debounce(process, 500, immediate); + debouncedProcess(url, params, this.settings); + return [2, { + result: api_constants/* default */.A.global.SCORM_TRUE, + errorCode: 0, + }]; + case 1: return [4, process(url, params, this.settings)]; + case 2: return [2, _a.sent()]; } - }); }); })(); + }); + }); + }; + BaseAPI.prototype.scheduleCommit = function (when, callback) { + this._timeout = new ScheduledCommit(this, when, callback); + this.apiLog("scheduleCommit", "scheduled", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); + }; + BaseAPI.prototype.clearScheduledCommit = function () { + if (this._timeout) { + this._timeout.cancel(); + this._timeout = undefined; + this.apiLog("clearScheduledCommit", "cleared", api_constants/* default */.A.global.LOG_LEVEL_DEBUG, ""); } }; - return ScheduledCommit; + BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { + return (Object.hasOwnProperty.call(refObject, attribute) || + Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || + attribute in refObject); + }; + BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { + if (e instanceof exceptions/* ValidationError */.yI) { + this.lastErrorCode = String(e.errorCode); + returnValue = api_constants/* default */.A.global.SCORM_FALSE; + } + else { + if (e instanceof Error && e.message) { + console.error(e.message); + } + else { + console.error(e); + } + this.throwSCORMError(this._error_codes.GENERAL); + } + return returnValue; + }; + BaseAPI.prototype.performFetch = function (url, params) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { + return [2, fetch(url, { + method: "POST", + body: params instanceof Array ? params.join("&") : JSON.stringify(params), + headers: (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), + credentials: this.settings.xhrWithCredentials ? "include" : undefined, + keepalive: true, + })]; + }); + }); + }; + BaseAPI.prototype.transformResponse = function (response) { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { + var result, _a; + return (0,tslib_es6/* __generator */.YH)(this, function (_c) { + switch (_c.label) { + case 0: + if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; + return [4, this.settings.responseHandler(response)]; + case 1: + _a = _c.sent(); + return [3, 4]; + case 2: return [4, response.json()]; + case 3: + _a = _c.sent(); + _c.label = 4; + case 4: + result = _a; + if (response.status >= 200 && + response.status <= 299 && + (result.result === true || + result.result === api_constants/* default */.A.global.SCORM_TRUE)) { + this.processListeners("CommitSuccess"); + } + else { + this.processListeners("CommitError"); + } + return [2, result]; + } + }); + }); + }; + return BaseAPI; }()); +/* harmony default export */ var src_BaseAPI = (BaseAPI); -;// ./src/BaseAPI.ts - - - +/***/ }), +/***/ 589: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ B: function() { return /* binding */ CMIArray; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(635); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(319); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(797); +/* harmony import */ var _exceptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(784); -var BaseAPI = (function () { - function BaseAPI(error_codes, settings) { - var _newTarget = this.constructor; - this._settings = DefaultSettings; - if (_newTarget === BaseAPI) { - throw new TypeError("Cannot construct BaseAPI instances directly"); - } - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; - this._error_codes = error_codes; - if (settings) { - this.settings = settings; - } - this.apiLogLevel = this.settings.logLevel; - this.selfReportSessionTime = this.settings.selfReportSessionTime; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var CMIArray = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(CMIArray, _super); + function CMIArray(params) { + var _this = _super.call(this) || this; + _this.__children = params.children; + _this._errorCode = params.errorCode || scorm12_error_codes.GENERAL; + _this._errorClass = params.errorClass || _exceptions__WEBPACK_IMPORTED_MODULE_2__/* .BaseScormValidationError */ .$h; + _this.childArray = []; + return _this; } - BaseAPI.prototype.commonReset = function (settings) { - this.settings = __assign(__assign({}, this.settings), settings); - this.currentState = api_constants.global.STATE_NOT_INITIALIZED; - this.lastErrorCode = "0"; - this.listenerArray = []; - }; - BaseAPI.prototype.initialize = function (callbackName, initializeMessage, terminationMessage) { - var returnValue = api_constants.global.SCORM_FALSE; - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage); - } - else if (this.isTerminated()) { - this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage); - } - else { - if (this.selfReportSessionTime) { - this.cmi.setStartTime(); - } - this.currentState = api_constants.global.STATE_INITIALIZED; - this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); + Object.defineProperty(CMIArray.prototype, "_children", { + get: function () { + return this.__children; + }, + set: function (_children) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIArray.prototype, "_count", { + get: function () { + return this.childArray.length; + }, + set: function (_count) { + throw new this._errorClass(this._errorCode); + }, + enumerable: false, + configurable: true + }); + CMIArray.prototype.toJSON = function () { + this.jsonString = true; + var result = {}; + for (var i = 0; i < this.childArray.length; i++) { + result[i + ""] = this.childArray[i]; } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return returnValue; + delete this.jsonString; + return result; }; - BaseAPI.prototype.apiLog = function (functionName, logMessage, messageLevel, CMIElement) { - logMessage = formatMessage(functionName, logMessage, CMIElement); - if (messageLevel >= this.apiLogLevel) { - this.settings.onLogMessage(messageLevel, logMessage); - } + return CMIArray; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_0__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 319: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ J: function() { return /* binding */ BaseCMI; }, +/* harmony export */ r: function() { return /* binding */ BaseRootCMI; } +/* harmony export */ }); +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var BaseCMI = (function () { + function BaseCMI() { + this.jsonString = false; + this._initialized = false; + } + Object.defineProperty(BaseCMI.prototype, "initialized", { + get: function () { + return this._initialized; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(BaseCMI.prototype, "start_time", { + get: function () { + return this._start_time; + }, + enumerable: false, + configurable: true + }); + BaseCMI.prototype.initialize = function () { + this._initialized = true; }; - Object.defineProperty(BaseAPI.prototype, "error_codes", { + BaseCMI.prototype.setStartTime = function () { + this._start_time = new Date().getTime(); + }; + return BaseCMI; +}()); + +var BaseRootCMI = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__extends */ .C6)(BaseRootCMI, _super); + function BaseRootCMI() { + return _super !== null && _super.apply(this, arguments) || this; + } + return BaseRootCMI; +}(BaseCMI)); + + + +/***/ }), + +/***/ 434: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ _: function() { return /* binding */ CMIScore; } +/* harmony export */ }); +/* unused harmony export scorm12_error_codes */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); +/* harmony import */ var _constants_regex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(417); +/* harmony import */ var _base_cmi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(319); +/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(449); +/* harmony import */ var _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(797); + + + + + + +var scorm12_constants = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12; +var scorm12_regex = _constants_regex__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.scorm12; +var scorm12_error_codes = _constants_error_codes__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.scorm12; +var CMIScore = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_4__/* .__extends */ .C6)(CMIScore, _super); + function CMIScore(params) { + var _this = _super.call(this) || this; + _this._raw = ""; + _this._min = ""; + _this.__children = params.score_children || scorm12_constants.score_children; + _this.__score_range = !params.score_range + ? false + : scorm12_regex.score_range; + _this._max = params.max || params.max === "" ? params.max : "100"; + _this.__invalid_error_code = + params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE; + _this.__invalid_type_code = + params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH; + _this.__invalid_range_code = + params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE; + _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; + _this.__error_class = params.errorClass; + return _this; + } + Object.defineProperty(CMIScore.prototype, "_children", { get: function () { - return this._error_codes; + return this.__children; + }, + set: function (_children) { + throw new this.__error_class(this.__invalid_error_code); }, enumerable: false, configurable: true }); - Object.defineProperty(BaseAPI.prototype, "settings", { + Object.defineProperty(CMIScore.prototype, "raw", { get: function () { - return this._settings; + return this._raw; }, - set: function (settings) { - this._settings = __assign(__assign({}, this._settings), settings); + set: function (raw) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._raw = raw; + } }, enumerable: false, configurable: true }); - BaseAPI.prototype.terminate = function (callbackName, checkTerminated) { - return __awaiter(this, void 0, void 0, function () { - var returnValue, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.TERMINATION_BEFORE_INIT, this._error_codes.MULTIPLE_TERMINATION)) return [3, 2]; - this.currentState = api_constants.global.STATE_TERMINATED; - return [4, this.storeData(true)]; - case 1: - result = _a.sent(); - if (typeof result.errorCode !== "undefined" && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); - } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - if (checkTerminated) - this.lastErrorCode = "0"; - returnValue = api_constants.global.SCORM_TRUE; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; - } - }); - }); - }; - BaseAPI.prototype.getValue = function (callbackName, checkTerminated, CMIElement) { - var returnValue = ""; - if (this.checkState(checkTerminated, this._error_codes.RETRIEVE_BEFORE_INIT, this._error_codes.RETRIEVE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.getCMIValue(CMIElement); + Object.defineProperty(CMIScore.prototype, "min", { + get: function () { + return this._min; + }, + set: function (min) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._min = min; } - catch (e) { - returnValue = this.handleValueAccessException(e, returnValue); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(CMIScore.prototype, "max", { + get: function () { + return this._max; + }, + set: function (max) { + if ((0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidFormat */ .q)(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && + (!this.__score_range || + (0,_validation__WEBPACK_IMPORTED_MODULE_5__/* .checkValidRange */ .W)(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { + this._max = max; } - this.processListeners(callbackName, CMIElement); - } - this.apiLog(callbackName, ": returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - if (returnValue === undefined) { - return ""; - } - this.clearSCORMError(returnValue); - return returnValue; + }, + enumerable: false, + configurable: true + }); + CMIScore.prototype.toJSON = function () { + this.jsonString = true; + var result = { + raw: this.raw, + min: this.min, + max: this.max, + }; + delete this.jsonString; + return result; }; - BaseAPI.prototype.setValue = function (callbackName, commitCallback, checkTerminated, CMIElement, value) { - if (value !== undefined) { - value = String(value); - } - var returnValue = api_constants.global.SCORM_FALSE; - if (this.checkState(checkTerminated, this._error_codes.STORE_BEFORE_INIT, this._error_codes.STORE_AFTER_TERM)) { - if (checkTerminated) - this.lastErrorCode = "0"; - try { - returnValue = this.setCMIValue(CMIElement, value); - } - catch (e) { - this.handleValueAccessException(e, returnValue); - } - this.processListeners(callbackName, CMIElement, value); - } - if (returnValue === undefined) { - returnValue = api_constants.global.SCORM_FALSE; + return CMIScore; +}(_base_cmi__WEBPACK_IMPORTED_MODULE_2__/* .BaseCMI */ .J)); + + + +/***/ }), + +/***/ 449: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ W: function() { return /* binding */ checkValidRange; }, +/* harmony export */ q: function() { return /* binding */ checkValidFormat; } +/* harmony export */ }); +function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { + if (typeof value !== "string") { + return false; + } + var formatRegex = new RegExp(regexPattern); + var matches = value.match(formatRegex); + if (allowEmptyString && value === "") { + return true; + } + if (value === undefined || !matches || matches[0] === "") { + throw new errorClass(errorCode); + } + return true; +} +function checkValidRange(value, rangePattern, errorCode, errorClass) { + var ranges = rangePattern.split("#"); + value = value * 1.0; + if (value >= ranges[0]) { + if (ranges[1] === "*" || value <= ranges[1]) { + return true; } - if (String(this.lastErrorCode) === "0") { - if (this.settings.autocommit && !this._timeout) { - this.scheduleCommit(this.settings.autocommitSeconds * 1000, commitCallback); - } - } - this.apiLog(callbackName, ": " + value + ": result: " + returnValue, api_constants.global.LOG_LEVEL_INFO, CMIElement); - this.clearSCORMError(returnValue); - return returnValue; - }; - BaseAPI.prototype.commit = function (callbackName_1) { - return __awaiter(this, arguments, void 0, function (callbackName, checkTerminated) { - var returnValue, result; - if (checkTerminated === void 0) { checkTerminated = false; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.clearScheduledCommit(); - returnValue = api_constants.global.SCORM_FALSE; - if (!this.checkState(checkTerminated, this._error_codes.COMMIT_BEFORE_INIT, this._error_codes.COMMIT_AFTER_TERM)) return [3, 2]; - return [4, this.storeData(false)]; - case 1: - result = _a.sent(); - if (result.errorCode && result.errorCode > 0) { - this.throwSCORMError(result.errorCode); - } - returnValue = - typeof result !== "undefined" && result.result - ? result.result - : api_constants.global.SCORM_FALSE; - this.apiLog(callbackName, " Result: " + returnValue, api_constants.global.LOG_LEVEL_DEBUG, "HttpRequest"); - if (checkTerminated) - this.lastErrorCode = "0"; - this.processListeners(callbackName); - _a.label = 2; - case 2: - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - this.clearSCORMError(returnValue); - return [2, returnValue]; - } - }); - }); - }; - BaseAPI.prototype.getLastError = function (callbackName) { - var returnValue = String(this.lastErrorCode); - this.processListeners(callbackName); - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; - }; - BaseAPI.prototype.getErrorString = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode); - this.processListeners(callbackName); - } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; - }; - BaseAPI.prototype.getDiagnostic = function (callbackName, CMIErrorCode) { - var returnValue = ""; - if (CMIErrorCode !== null && CMIErrorCode !== "") { - returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true); - this.processListeners(callbackName); - } - this.apiLog(callbackName, "returned: " + returnValue, api_constants.global.LOG_LEVEL_INFO); - return returnValue; - }; - BaseAPI.prototype.checkState = function (checkTerminated, beforeInitError, afterTermError) { - if (this.isNotInitialized()) { - this.throwSCORMError(beforeInitError); - return false; - } - else if (checkTerminated && this.isTerminated()) { - this.throwSCORMError(afterTermError); - return false; - } - return true; - }; - BaseAPI.prototype.getLmsErrorMessageDetails = function (_errorNumber, _detail) { - if (_detail === void 0) { _detail = false; } - throw new Error("The getLmsErrorMessageDetails method has not been implemented"); - }; - BaseAPI.prototype.getCMIValue = function (_CMIElement) { - throw new Error("The getCMIValue method has not been implemented"); - }; - BaseAPI.prototype.setCMIValue = function (_CMIElement, _value) { - throw new Error("The setCMIValue method has not been implemented"); - }; - BaseAPI.prototype._commonSetCMIValue = function (methodName, scorm2004, CMIElement, value) { - if (!CMIElement || CMIElement === "") { - return api_constants.global.SCORM_FALSE; - } - var structure = CMIElement.split("."); - var refObject = this; - var returnValue = api_constants.global.SCORM_FALSE; - var foundFirstIndex = false; - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - var attribute = structure[idx]; - if (idx === structure.length - 1) { - if (scorm2004 && attribute.substring(0, 8) === "{target=") { - if (this.isInitialized()) { - this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT); - } - else { - refObject = __assign(__assign({}, refObject), { attribute: value }); - } - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (stringMatches(CMIElement, "\\.correct_responses\\.\\d+") && - this.isInitialized()) { - this.validateCorrectResponse(CMIElement, value); - } - if (!scorm2004 || this.lastErrorCode === "0") { - refObject[attribute] = value; - returnValue = api_constants.global.SCORM_TRUE; - } - } - } - else { - refObject = refObject[attribute]; - if (!refObject) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - foundFirstIndex = true; - } - else { - var newChild = this.getChildElement(CMIElement, value, foundFirstIndex); - foundFirstIndex = true; - if (!newChild) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - } - else { - if (refObject.initialized) - newChild.initialize(); - refObject.childArray.push(newChild); - refObject = newChild; - } - } - idx++; - } - } - } - } - if (returnValue === api_constants.global.SCORM_FALSE) { - this.apiLog(methodName, "There was an error setting the value for: ".concat(CMIElement, ", value of: ").concat(value), api_constants.global.LOG_LEVEL_WARNING); - } - return returnValue; - }; - BaseAPI.prototype._commonGetCMIValue = function (methodName, scorm2004, CMIElement) { - if (!CMIElement || CMIElement === "") { - return ""; - } - var structure = CMIElement.split("."); - var refObject = this; - var attribute = null; - var uninitializedErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") has not been initialized."); - var invalidErrorMessage = "The data model element passed to ".concat(methodName, " (").concat(CMIElement, ") is not a valid SCORM data model element."); - var invalidErrorCode = scorm2004 - ? this._error_codes.UNDEFINED_DATA_MODEL - : this._error_codes.GENERAL; - for (var idx = 0; idx < structure.length; idx++) { - attribute = structure[idx]; - if (!scorm2004) { - if (idx === structure.length - 1) { - if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - } - else { - if (String(attribute).substring(0, 8) === "{target=" && - typeof refObject._isTargetValid == "function") { - var target = String(attribute).substring(8, String(attribute).length - 9); - return refObject._isTargetValid(target); - } - else if (!this._checkObjectHasProperty(refObject, attribute)) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - return; - } - } - refObject = refObject[attribute]; - if (refObject === undefined) { - this.throwSCORMError(invalidErrorCode, invalidErrorMessage); - break; - } - if (refObject instanceof CMIArray) { - var index = parseInt(structure[idx + 1], 10); - if (!isNaN(index)) { - var item = refObject.childArray[index]; - if (item) { - refObject = item; - } - else { - this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED, uninitializedErrorMessage); - break; - } - idx++; - } - } - } - if (refObject === null || refObject === undefined) { - if (!scorm2004) { - if (attribute === "_children") { - this.throwSCORMError(error_codes.scorm12.CHILDREN_ERROR); - } - else if (attribute === "_count") { - this.throwSCORMError(error_codes.scorm12.COUNT_ERROR); - } - } - } - else { - return refObject; - } - }; - BaseAPI.prototype.isInitialized = function () { - return this.currentState === api_constants.global.STATE_INITIALIZED; - }; - BaseAPI.prototype.isNotInitialized = function () { - return this.currentState === api_constants.global.STATE_NOT_INITIALIZED; - }; - BaseAPI.prototype.isTerminated = function () { - return this.currentState === api_constants.global.STATE_TERMINATED; - }; - BaseAPI.prototype.on = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - for (var i = 0; i < listenerFunctions.length; i++) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - this.listenerArray.push({ - functionName: functionName, - CMIElement: CMIElement, - callback: callback, - }); - this.apiLog("on", "Added event listener: ".concat(this.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); - } - }; - BaseAPI.prototype.off = function (listenerName, callback) { - if (!callback) - return; - var listenerFunctions = listenerName.split(" "); - var _loop_1 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - var removeIndex = this_1.listenerArray.findIndex(function (obj) { - return obj.functionName === functionName && - obj.CMIElement === CMIElement && - obj.callback === callback; - }); - if (removeIndex !== -1) { - this_1.listenerArray.splice(removeIndex, 1); - this_1.apiLog("off", "Removed event listener: ".concat(this_1.listenerArray.length), api_constants.global.LOG_LEVEL_INFO, functionName); - } - }; - var this_1 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_1 = _loop_1(i); - if (typeof state_1 === "object") - return state_1.value; - } - }; - BaseAPI.prototype.clear = function (listenerName) { - var listenerFunctions = listenerName.split(" "); - var _loop_2 = function (i) { - var listenerSplit = listenerFunctions[i].split("."); - if (listenerSplit.length === 0) - return { value: void 0 }; - var functionName = listenerSplit[0]; - var CMIElement = null; - if (listenerSplit.length > 1) { - CMIElement = listenerName.replace(functionName + ".", ""); - } - this_2.listenerArray = this_2.listenerArray.filter(function (obj) { - return obj.functionName !== functionName && obj.CMIElement !== CMIElement; - }); - }; - var this_2 = this; - for (var i = 0; i < listenerFunctions.length; i++) { - var state_2 = _loop_2(i); - if (typeof state_2 === "object") - return state_2.value; + else { + throw new errorClass(errorCode); } + } + else { + throw new errorClass(errorCode); + } +} + + +/***/ }), + +/***/ 340: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + SCORM_TRUE: "true", + SCORM_FALSE: "false", + STATE_NOT_INITIALIZED: 0, + STATE_INITIALIZED: 1, + STATE_TERMINATED: 2, + LOG_LEVEL_DEBUG: 1, + LOG_LEVEL_INFO: 2, + LOG_LEVEL_WARNING: 3, + LOG_LEVEL_ERROR: 4, + LOG_LEVEL_NONE: 5, +}; +var scorm12 = { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions", + core_children: "student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time", + score_children: "raw,min,max", + comments_children: "content,location,time", + objectives_children: "id,score,status", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio,language,speed,text", + interactions_children: "id,objectives,time,type,correct_responses,weighting,student_response,result,latency", + error_descriptions: { + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use LMSGetDiagnostic for more information", + }, + "201": { + basicMessage: "Invalid argument error", + detailMessage: "Indicates that an argument represents an invalid data model element or is otherwise incorrect.", + }, + "202": { + basicMessage: "Element cannot have children", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.', + }, + "203": { + basicMessage: "Element not an array - cannot have count", + detailMessage: 'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.', + }, + "301": { + basicMessage: "Not initialized", + detailMessage: "Indicates that an API call was made before the call to lmsInitialize.", + }, + "401": { + basicMessage: "Not implemented error", + detailMessage: "The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.", + }, + "402": { + basicMessage: "Invalid set value, element is a keyword", + detailMessage: 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").', + }, + "403": { + basicMessage: "Element is read only", + detailMessage: "LMSSetValue was called with a data model element that can only be read.", + }, + "404": { + basicMessage: "Element is write only", + detailMessage: "LMSGetValue was called on a data model element that can only be written to.", + }, + "405": { + basicMessage: "Incorrect Data Type", + detailMessage: "LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Element Value Out Of Range", + detailMessage: "The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + cmi_children: "core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation", + student_preference_children: "audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows", + student_data_children: "attempt_number,tries,mastery_score,max_time_allowed,time_limit_action", + student_demographics_children: "city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience", + tries_children: "time,status,score", + attempt_records_children: "score,lesson_status", + paths_children: "location_id,date,time,status,why_left,time_in_element", +}); +var scorm2004 = { + cmi_children: "_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time", + comments_children: "comment,timestamp,location", + score_children: "max,raw,scaled,min", + objectives_children: "progress_measure,completion_status,success_status,description,score,id", + correct_responses_children: "pattern", + student_data_children: "mastery_score,max_time_allowed,time_limit_action", + student_preference_children: "audio_level,audio_captioning,delivery_speed,language", + interactions_children: "id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description", + error_descriptions: { + "0": { + basicMessage: "No Error", + detailMessage: "No error occurred, the previous API call was successful.", + }, + "101": { + basicMessage: "General Exception", + detailMessage: "No specific error code exists to describe the error. Use GetDiagnostic for more information.", + }, + "102": { + basicMessage: "General Initialization Failure", + detailMessage: "Call to Initialize failed for an unknown reason.", + }, + "103": { + basicMessage: "Already Initialized", + detailMessage: "Call to Initialize failed because Initialize was already called.", + }, + "104": { + basicMessage: "Content Instance Terminated", + detailMessage: "Call to Initialize failed because Terminate was already called.", + }, + "111": { + basicMessage: "General Termination Failure", + detailMessage: "Call to Terminate failed for an unknown reason.", + }, + "112": { + basicMessage: "Termination Before Initialization", + detailMessage: "Call to Terminate failed because it was made before the call to Initialize.", + }, + "113": { + basicMessage: "Termination After Termination", + detailMessage: "Call to Terminate failed because Terminate was already called.", + }, + "122": { + basicMessage: "Retrieve Data Before Initialization", + detailMessage: "Call to GetValue failed because it was made before the call to Initialize.", + }, + "123": { + basicMessage: "Retrieve Data After Termination", + detailMessage: "Call to GetValue failed because it was made after the call to Terminate.", + }, + "132": { + basicMessage: "Store Data Before Initialization", + detailMessage: "Call to SetValue failed because it was made before the call to Initialize.", + }, + "133": { + basicMessage: "Store Data After Termination", + detailMessage: "Call to SetValue failed because it was made after the call to Terminate.", + }, + "142": { + basicMessage: "Commit Before Initialization", + detailMessage: "Call to Commit failed because it was made before the call to Initialize.", + }, + "143": { + basicMessage: "Commit After Termination", + detailMessage: "Call to Commit failed because it was made after the call to Terminate.", + }, + "201": { + basicMessage: "General Argument Error", + detailMessage: "An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.", + }, + "301": { + basicMessage: "General Get Failure", + detailMessage: "Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "351": { + basicMessage: "General Set Failure", + detailMessage: "Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "391": { + basicMessage: "General Commit Failure", + detailMessage: "Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.", + }, + "401": { + basicMessage: "Undefined Data Model Element", + detailMessage: "The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.", + }, + "402": { + basicMessage: "Unimplemented Data Model Element", + detailMessage: "The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.", + }, + "403": { + basicMessage: "Data Model Element Value Not Initialized", + detailMessage: "Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.", + }, + "404": { + basicMessage: "Data Model Element Is Read Only", + detailMessage: "SetValue was called with a data model element that can only be read.", + }, + "405": { + basicMessage: "Data Model Element Is Write Only", + detailMessage: "GetValue was called on a data model element that can only be written to.", + }, + "406": { + basicMessage: "Data Model Element Type Mismatch", + detailMessage: "SetValue was called with a value that is not consistent with the data format of the supplied data model element.", + }, + "407": { + basicMessage: "Data Model Element Value Out Of Range", + detailMessage: "The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.", + }, + "408": { + basicMessage: "Data Model Dependency Not Established", + detailMessage: "Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.", + }, + }, +}; +var APIConstants = { + global: global, + scorm12: scorm12, + aicc: aicc, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (APIConstants); + + +/***/ }), + +/***/ 56: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ K$: function() { return /* binding */ NAVBoolean; }, +/* harmony export */ YE: function() { return /* binding */ SuccessStatus; }, +/* harmony export */ lC: function() { return /* binding */ CompletionStatus; } +/* harmony export */ }); +var NAVBoolean; +(function (NAVBoolean) { + NAVBoolean["unknown"] = "unknown"; + NAVBoolean["true"] = "true"; + NAVBoolean["false"] = "false"; +})(NAVBoolean || (NAVBoolean = {})); +var SuccessStatus; +(function (SuccessStatus) { + SuccessStatus["passed"] = "passed"; + SuccessStatus["failed"] = "failed"; + SuccessStatus["unknown"] = "unknown"; +})(SuccessStatus || (SuccessStatus = {})); +var CompletionStatus; +(function (CompletionStatus) { + CompletionStatus["completed"] = "completed"; + CompletionStatus["incomplete"] = "incomplete"; + CompletionStatus["unknown"] = "unknown"; +})(CompletionStatus || (CompletionStatus = {})); + + +/***/ }), + +/***/ 797: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var global = { + GENERAL: 101, + INITIALIZATION_FAILED: 101, + INITIALIZED: 101, + TERMINATED: 101, + TERMINATION_FAILURE: 101, + TERMINATION_BEFORE_INIT: 101, + MULTIPLE_TERMINATION: 101, + RETRIEVE_BEFORE_INIT: 101, + RETRIEVE_AFTER_TERM: 101, + STORE_BEFORE_INIT: 101, + STORE_AFTER_TERM: 101, + COMMIT_BEFORE_INIT: 101, + COMMIT_AFTER_TERM: 101, + ARGUMENT_ERROR: 101, + CHILDREN_ERROR: 101, + COUNT_ERROR: 101, + GENERAL_GET_FAILURE: 101, + GENERAL_SET_FAILURE: 101, + GENERAL_COMMIT_FAILURE: 101, + UNDEFINED_DATA_MODEL: 101, + UNIMPLEMENTED_ELEMENT: 101, + VALUE_NOT_INITIALIZED: 101, + INVALID_SET_VALUE: 101, + READ_ONLY_ELEMENT: 101, + WRITE_ONLY_ELEMENT: 101, + TYPE_MISMATCH: 101, + VALUE_OUT_OF_RANGE: 101, + DEPENDENCY_NOT_ESTABLISHED: 101, +}; +var scorm12 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { RETRIEVE_BEFORE_INIT: 301, STORE_BEFORE_INIT: 301, COMMIT_BEFORE_INIT: 301, ARGUMENT_ERROR: 201, CHILDREN_ERROR: 202, COUNT_ERROR: 203, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 401, VALUE_NOT_INITIALIZED: 301, INVALID_SET_VALUE: 402, READ_ONLY_ELEMENT: 403, WRITE_ONLY_ELEMENT: 404, TYPE_MISMATCH: 405, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var scorm2004 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, global), { INITIALIZATION_FAILED: 102, INITIALIZED: 103, TERMINATED: 104, TERMINATION_FAILURE: 111, TERMINATION_BEFORE_INIT: 112, MULTIPLE_TERMINATIONS: 113, RETRIEVE_BEFORE_INIT: 122, RETRIEVE_AFTER_TERM: 123, STORE_BEFORE_INIT: 132, STORE_AFTER_TERM: 133, COMMIT_BEFORE_INIT: 142, COMMIT_AFTER_TERM: 143, ARGUMENT_ERROR: 201, GENERAL_GET_FAILURE: 301, GENERAL_SET_FAILURE: 351, GENERAL_COMMIT_FAILURE: 391, UNDEFINED_DATA_MODEL: 401, UNIMPLEMENTED_ELEMENT: 402, VALUE_NOT_INITIALIZED: 403, READ_ONLY_ELEMENT: 404, WRITE_ONLY_ELEMENT: 405, TYPE_MISMATCH: 406, VALUE_OUT_OF_RANGE: 407, DEPENDENCY_NOT_ESTABLISHED: 408 }); +var ErrorCodes = { + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (ErrorCodes); + + +/***/ }), + +/***/ 417: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(635); + +var scorm12 = { + CMIString256: "^.{0,255}$", + CMIString4096: "^.{0,4096}$", + CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", + CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", + CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", + CMIFeedback: "^.{0,255}$", + CMIIndex: "[._](\\d+).", + CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", + CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", + CMIExit: "^(time-out|suspend|logout|)$", + CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", + CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", + NAVEvent: "^(previous|continue)$", + score_range: "0#100", + audio_range: "-1#100", + speed_range: "-100#100", + weighting_range: "-100#100", + text_range: "-1#1", +}; +var aicc = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)((0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__assign */ .Cl)({}, scorm12), { + CMIIdentifier: "^\\w{1,255}$", +}); +var scorm2004 = { + CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", + CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", + CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", + CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", + CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", + CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", + CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", + CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", + CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", + CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", + CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", + CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", + CMIInteger: "^\\d+$", + CMISInteger: "^-?([0-9]+)$", + CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", + CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", + CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", + CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", + CMIFeedback: "^.*$", + CMIIndex: "[._](\\d+).", + CMIIndexStore: ".N(\\d+).", + CMICStatus: "^(completed|incomplete|not attempted|unknown)$", + CMISStatus: "^(passed|failed|unknown)$", + CMIExit: "^(time-out|suspend|logout|normal)$", + CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", + CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", + NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", + NAVBoolean: "^(unknown|true|false$)", + NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", + scaled_range: "-1#1", + audio_range: "0#*", + speed_range: "0#*", + text_range: "-1#1", + progress_range: "0#1", +}; +var Regex = { + aicc: aicc, + scorm12: scorm12, + scorm2004: scorm2004, +}; +/* harmony default export */ __webpack_exports__.A = (Regex); + + +/***/ }), + +/***/ 784: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $h: function() { return /* binding */ BaseScormValidationError; }, +/* harmony export */ wq: function() { return /* binding */ Scorm2004ValidationError; }, +/* harmony export */ yI: function() { return /* binding */ ValidationError; } +/* harmony export */ }); +/* unused harmony exports Scorm12ValidationError, AICCValidationError */ +/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(635); +/* harmony import */ var _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); + + +var scorm12_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm12.error_descriptions; +var aicc_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.aicc.error_descriptions; +var scorm2004_errors = _constants_api_constants__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.scorm2004.error_descriptions; +var BaseScormValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(BaseScormValidationError, _super); + function BaseScormValidationError(errorCode) { + var _this = _super.call(this, errorCode.toString()) || this; + _this._errorCode = errorCode; + _this.name = "ScormValidationError"; + return _this; + } + Object.defineProperty(BaseScormValidationError.prototype, "errorCode", { + get: function () { + return this._errorCode; + }, + enumerable: false, + configurable: true + }); + BaseScormValidationError.prototype.setMessage = function (message) { + this.message = message; }; - BaseAPI.prototype.processListeners = function (functionName, CMIElement, value) { - this.apiLog(functionName, value, api_constants.global.LOG_LEVEL_INFO, CMIElement); - for (var i = 0; i < this.listenerArray.length; i++) { - var listener = this.listenerArray[i]; - var functionsMatch = listener.functionName === functionName; - var listenerHasCMIElement = !!listener.CMIElement; - var CMIElementsMatch = false; - if (CMIElement && - listener.CMIElement && - listener.CMIElement.substring(listener.CMIElement.length - 1) === "*") { - CMIElementsMatch = - CMIElement.indexOf(listener.CMIElement.substring(0, listener.CMIElement.length - 1)) === 0; - } - else { - CMIElementsMatch = listener.CMIElement === CMIElement; - } - if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) { - this.apiLog("processListeners", "Processing listener: ".concat(listener.functionName), api_constants.global.LOG_LEVEL_INFO, CMIElement); - listener.callback(CMIElement, value); - } + return BaseScormValidationError; +}(Error)); + +var ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(ValidationError, _super); + function ValidationError(errorCode, errorMessage, detailedMessage) { + var _this = _super.call(this, errorCode) || this; + _this._detailedMessage = ""; + _this.setMessage(errorMessage); + _this._errorMessage = errorMessage; + if (detailedMessage) { + _this._detailedMessage = detailedMessage; } - }; - BaseAPI.prototype.throwSCORMError = function (errorNumber, message) { - if (!message) { - message = this.getLmsErrorMessageDetails(errorNumber); + return _this; + } + Object.defineProperty(ValidationError.prototype, "errorMessage", { + get: function () { + return this._errorMessage; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ValidationError.prototype, "detailedMessage", { + get: function () { + return this._detailedMessage; + }, + enumerable: false, + configurable: true + }); + return ValidationError; +}(BaseScormValidationError)); + +var Scorm12ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm12ValidationError, _super); + function Scorm12ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm12_errors[String(errorCode)].basicMessage, scorm12_errors[String(errorCode)].detailMessage) || this; } - this.apiLog("throwSCORMError", errorNumber + ": " + message, api_constants.global.LOG_LEVEL_ERROR); - this.lastErrorCode = String(errorNumber); - }; - BaseAPI.prototype.clearSCORMError = function (success) { - if (success !== undefined && success !== api_constants.global.SCORM_FALSE) { - this.lastErrorCode = "0"; + else { + _this = _super.call(this, 101, scorm12_errors["101"].basicMessage, scorm12_errors["101"].detailMessage) || this; } - }; - BaseAPI.prototype.loadFromFlattenedJSON = function (json, CMIElement) { + return _this; + } + return Scorm12ValidationError; +}(ValidationError)); + +var AICCValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(AICCValidationError, _super); + function AICCValidationError(errorCode) { var _this = this; - if (!CMIElement) { - CMIElement = ""; + if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { + _this = _super.call(this, errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage) || this; } - if (!this.isNotInitialized()) { - console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize."); - return; + else { + _this = _super.call(this, 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage) || this; } - function testPattern(a, c, a_pattern) { - var a_match = a.match(a_pattern); - var c_match; - if (a_match !== null && (c_match = c.match(a_pattern)) !== null) { - var a_num = Number(a_match[2]); - var c_num = Number(c_match[2]); - if (a_num === c_num) { - if (a_match[3] === "id") { - return -1; - } - else if (a_match[3] === "type") { - if (c_match[3] === "id") { - return 1; - } - else { - return -1; - } - } - else { - return 1; - } - } - return a_num - c_num; - } - return null; + return _this; + } + return AICCValidationError; +}(ValidationError)); + +var Scorm2004ValidationError = (function (_super) { + (0,tslib__WEBPACK_IMPORTED_MODULE_1__/* .__extends */ .C6)(Scorm2004ValidationError, _super); + function Scorm2004ValidationError(errorCode) { + var _this = this; + if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) { + _this = _super.call(this, errorCode, scorm2004_errors[String(errorCode)].basicMessage, scorm2004_errors[String(errorCode)].detailMessage) || this; } - var int_pattern = /^(cmi\.interactions\.)(\d+)\.(.*)$/; - var obj_pattern = /^(cmi\.objectives\.)(\d+)\.(.*)$/; - var result = Object.keys(json).map(function (key) { - return [String(key), json[key]]; - }); - result.sort(function (_a, _c) { - var a = _a[0], _b = _a[1]; - var c = _c[0], _d = _c[1]; - var test; - if ((test = testPattern(a, c, int_pattern)) !== null) { - return test; - } - if ((test = testPattern(a, c, obj_pattern)) !== null) { - return test; - } - if (a < c) { - return -1; - } - if (a > c) { - return 1; - } - return 0; - }); - var obj; - result.forEach(function (element) { - obj = {}; - obj[element[0]] = element[1]; - _this.loadFromJSON(unflatten(obj), CMIElement); - }); - }; - BaseAPI.prototype.loadFromJSON = function (json, CMIElement) { - if (!this.isNotInitialized()) { - console.error("loadFromJSON can only be called before the call to lmsInitialize."); - return; + else { + _this = _super.call(this, 101, scorm2004_errors["101"].basicMessage, scorm2004_errors["101"].detailMessage) || this; } - CMIElement = CMIElement !== undefined ? CMIElement : "cmi"; - this.startingData = json; - for (var key in json) { - if ({}.hasOwnProperty.call(json, key) && json[key]) { - var currentCMIElement = (CMIElement ? CMIElement + "." : "") + key; - var value = json[key]; - if (value["childArray"]) { - for (var i = 0; i < value["childArray"].length; i++) { - this.loadFromJSON(value["childArray"][i], currentCMIElement + "." + i); - } - } - else if (value.constructor === Object) { - this.loadFromJSON(value, currentCMIElement); - } - else { - this.setCMIValue(currentCMIElement, value); - } - } + return _this; + } + return Scorm2004ValidationError; +}(ValidationError)); + + + +/***/ }), + +/***/ 864: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ $o: function() { return /* binding */ addTwoDurations; }, +/* harmony export */ Bq: function() { return /* binding */ flatten; }, +/* harmony export */ J6: function() { return /* binding */ stringMatches; }, +/* harmony export */ OI: function() { return /* binding */ getDurationAsSeconds; }, +/* harmony export */ hw: function() { return /* binding */ formatMessage; }, +/* harmony export */ sB: function() { return /* binding */ unflatten; }, +/* harmony export */ xE: function() { return /* binding */ getSecondsAsISODuration; } +/* harmony export */ }); +/* unused harmony exports SECONDS_PER_SECOND, SECONDS_PER_MINUTE, SECONDS_PER_HOUR, SECONDS_PER_DAY, getSecondsAsHHMMSS, getTimeAsSeconds, addHHMMSSTimeStrings, countDecimals */ +var SECONDS_PER_SECOND = 1.0; +var SECONDS_PER_MINUTE = 60; +var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE; +var SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR; +var designations = { + D: SECONDS_PER_DAY, + H: SECONDS_PER_HOUR, + M: SECONDS_PER_MINUTE, + S: SECONDS_PER_SECOND, +}; +function getSecondsAsHHMMSS(totalSeconds) { + if (!totalSeconds || totalSeconds <= 0) { + return "00:00:00"; + } + var hours = Math.floor(totalSeconds / SECONDS_PER_HOUR); + var dateObj = new Date(totalSeconds * 1000); + var minutes = dateObj.getUTCMinutes(); + var seconds = dateObj.getSeconds(); + var ms = totalSeconds % 1.0; + var msStr = ""; + if (countDecimals(ms) > 0) { + if (countDecimals(ms) > 2) { + msStr = ms.toFixed(2); } - }; - BaseAPI.prototype.renderCMIToJSONString = function () { - var cmi = this.cmi; - if (this.settings.sendFullCommit) { - return JSON.stringify({ cmi: cmi }); + else { + msStr = String(ms); } - return JSON.stringify({ cmi: cmi }, function (k, v) { return (v === undefined ? null : v); }, 2); - }; - BaseAPI.prototype.renderCMIToJSONObject = function () { - return JSON.parse(this.renderCMIToJSONString()); - }; - BaseAPI.prototype.processHttpRequest = function (url_1, params_1) { - return __awaiter(this, arguments, void 0, function (url, params, immediate) { - var api, genericError, process, debouncedProcess; - var _this = this; - if (immediate === void 0) { immediate = false; } - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - api = this; - genericError = { - result: api_constants.global.SCORM_FALSE, - errorCode: this.error_codes.GENERAL, - }; - if (immediate) { - this.performFetch(url, params).then(function (response) { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, this.transformResponse(response)]; - case 1: - _a.sent(); - return [2]; - } - }); - }); }); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - } - process = function (url, params, settings) { return __awaiter(_this, void 0, void 0, function () { - var response, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - params = settings.requestHandler(params); - return [4, this.performFetch(url, params)]; - case 1: - response = _a.sent(); - return [2, this.transformResponse(response)]; - case 2: - e_1 = _a.sent(); - this.apiLog("processHttpRequest", e_1, api_constants.global.LOG_LEVEL_ERROR); - api.processListeners("CommitError"); - return [2, genericError]; - case 3: return [2]; - } - }); - }); }; - if (!this.settings.asyncCommit) return [3, 1]; - debouncedProcess = debounce(process, 500, immediate); - debouncedProcess(url, params, this.settings); - return [2, { - result: api_constants.global.SCORM_TRUE, - errorCode: 0, - }]; - case 1: return [4, process(url, params, this.settings)]; - case 2: return [2, _a.sent()]; - } - }); - }); - }; - BaseAPI.prototype.scheduleCommit = function (when, callback) { - this._timeout = new ScheduledCommit(this, when, callback); - this.apiLog("scheduleCommit", "scheduled", api_constants.global.LOG_LEVEL_DEBUG, ""); - }; - BaseAPI.prototype.clearScheduledCommit = function () { - if (this._timeout) { - this._timeout.cancel(); - this._timeout = undefined; - this.apiLog("clearScheduledCommit", "cleared", api_constants.global.LOG_LEVEL_DEBUG, ""); + msStr = "." + msStr.split(".")[1]; + } + return ((hours + ":" + minutes + ":" + seconds).replace(/\b\d\b/g, "0$&") + msStr); +} +function getSecondsAsISODuration(seconds) { + if (!seconds || seconds <= 0) { + return "PT0S"; + } + var duration = "P"; + var remainder = seconds; + for (var designationsKey in designations) { + var current_seconds = designations[designationsKey]; + var value = Math.floor(remainder / current_seconds); + remainder = remainder % current_seconds; + if (countDecimals(remainder) > 2) { + remainder = Number(Number(remainder).toFixed(2)); } - }; - BaseAPI.prototype._checkObjectHasProperty = function (refObject, attribute) { - return (Object.hasOwnProperty.call(refObject, attribute) || - Object.getOwnPropertyDescriptor(Object.getPrototypeOf(refObject), attribute) != null || - attribute in refObject); - }; - BaseAPI.prototype.handleValueAccessException = function (e, returnValue) { - if (e instanceof ValidationError) { - this.lastErrorCode = String(e.errorCode); - returnValue = api_constants.global.SCORM_FALSE; + if (designationsKey === "S" && remainder > 0) { + value += remainder; } - else { - if (e instanceof Error && e.message) { - console.error(e.message); + if (value) { + if ((duration.indexOf("D") > 0 || + designationsKey === "H" || + designationsKey === "M" || + designationsKey === "S") && + duration.indexOf("T") === -1) { + duration += "T"; } - else { - console.error(e); + duration += "".concat(value).concat(designationsKey); + } + } + return duration; +} +function getTimeAsSeconds(timeString, timeRegex) { + if (typeof timeString === "number" || typeof timeString === "boolean") { + timeString = String(timeString); + } + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + if (!timeString || !timeString.match(timeRegex)) { + return 0; + } + var parts = timeString.split(":"); + var hours = Number(parts[0]); + var minutes = Number(parts[1]); + var seconds = Number(parts[2]); + return hours * 3600 + minutes * 60 + seconds; +} +function getDurationAsSeconds(duration, durationRegex) { + if (typeof durationRegex === "string") { + durationRegex = new RegExp(durationRegex); + } + if (!duration || !duration.match(durationRegex)) { + return 0; + } + var _a = new RegExp(durationRegex).exec(duration) || [], years = _a[1], _ = _a[2], days = _a[4], hours = _a[5], minutes = _a[6], seconds = _a[7]; + var result = 0.0; + result += Number(seconds) || 0.0; + result += Number(minutes) * 60.0 || 0.0; + result += Number(hours) * 3600.0 || 0.0; + result += Number(days) * (60 * 60 * 24.0) || 0.0; + result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0; + return result; +} +function addTwoDurations(first, second, durationRegex) { + var regex = typeof durationRegex === "string" + ? new RegExp(durationRegex) + : durationRegex; + return getSecondsAsISODuration(getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex)); +} +function addHHMMSSTimeStrings(first, second, timeRegex) { + if (typeof timeRegex === "string") { + timeRegex = new RegExp(timeRegex); + } + return getSecondsAsHHMMSS(getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex)); +} +function flatten(data) { + var result = {}; + function recurse(cur, prop) { + if (Object(cur) !== cur) { + result[prop] = cur; + } + else if (Array.isArray(cur)) { + for (var i = 0, l = cur.length; i < l; i++) { + recurse(cur[i], prop + "[" + i + "]"); + if (l === 0) + result[prop] = []; } - this.throwSCORMError(this._error_codes.GENERAL); } - return returnValue; - }; - BaseAPI.prototype.performFetch = function (url, params) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, fetch(url, { - method: "POST", - body: params instanceof Array ? params.join("&") : JSON.stringify(params), - headers: __assign(__assign({}, this.settings.xhrHeaders), { "Content-Type": this.settings.commitRequestDataType }), - credentials: this.settings.xhrWithCredentials ? "include" : undefined, - keepalive: true, - })]; - }); - }); - }; - BaseAPI.prototype.transformResponse = function (response) { - return __awaiter(this, void 0, void 0, function () { - var result, _a; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!(typeof this.settings.responseHandler === "function")) return [3, 2]; - return [4, this.settings.responseHandler(response)]; - case 1: - _a = _c.sent(); - return [3, 4]; - case 2: return [4, response.json()]; - case 3: - _a = _c.sent(); - _c.label = 4; - case 4: - result = _a; - if (response.status >= 200 && - response.status <= 299 && - (result.result === true || - result.result === api_constants.global.SCORM_TRUE)) { - this.processListeners("CommitSuccess"); - } - else { - this.processListeners("CommitError"); - } - return [2, result]; + else { + var isEmpty = true; + for (var p in cur) { + if ({}.hasOwnProperty.call(cur, p)) { + isEmpty = false; + recurse(cur[p], prop ? prop + "." + p : p); } - }); - }); - }; - return BaseAPI; -}()); -/* harmony default export */ var src_BaseAPI = (BaseAPI); + } + if (isEmpty && prop) + result[prop] = {}; + } + } + recurse(data, ""); + return result; +} +function unflatten(data) { + "use strict"; + if (Object(data) !== data || Array.isArray(data)) + return data; + var regex = /\.?([^.[\]]+)|\[(\d+)]/g; + var result = {}; + for (var p in data) { + if ({}.hasOwnProperty.call(data, p)) { + var cur = result; + var prop = ""; + var m = regex.exec(p); + while (m) { + cur = cur[prop] || (cur[prop] = m[2] ? [] : {}); + prop = m[2] || m[1]; + m = regex.exec(p); + } + cur[prop] = data[p]; + } + } + return result[""] || result; +} +function countDecimals(num) { + if (Math.floor(num) === num || String(num).indexOf(".") < 0) + return 0; + var parts = num.toString().split(".")[1]; + return parts.length || 0; +} +function formatMessage(functionName, message, CMIElement) { + var baseLength = 20; + var messageString = ""; + messageString += functionName; + var fillChars = baseLength - messageString.length; + for (var i = 0; i < fillChars; i++) { + messageString += " "; + } + messageString += ": "; + if (CMIElement) { + var CMIElementBaseLength = 70; + messageString += CMIElement; + fillChars = CMIElementBaseLength - messageString.length; + for (var j = 0; j < fillChars; j++) { + messageString += " "; + } + } + if (message) { + messageString += message; + } + return messageString; +} +function stringMatches(str, tester) { + return (str === null || str === void 0 ? void 0 : str.match(tester)) !== null; +} + + +/***/ }), + +/***/ 635: +/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ C6: function() { return /* binding */ __extends; }, +/* harmony export */ Cl: function() { return /* binding */ __assign; }, +/* harmony export */ YH: function() { return /* binding */ __generator; }, +/* harmony export */ sH: function() { return /* binding */ __awaiter; } +/* harmony export */ }); +/* unused harmony exports __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ +/****************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise, SuppressedError, Symbol, Iterator */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} -;// ./src/constants/regex.ts +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} -var regex_scorm12 = { - CMIString256: "^.{0,255}$", - CMIString4096: "^.{0,4096}$", - CMITime: "^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$", - CMITimespan: "^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{0,3})(.[0-9]*)?$", - CMIIdentifier: "^[\\u0021-\\u007E\\s]{0,255}$", - CMIFeedback: "^.{0,255}$", - CMIIndex: "[._](\\d+).", - CMIStatus: "^(passed|completed|failed|incomplete|browsed)$", - CMIStatus2: "^(passed|completed|failed|incomplete|browsed|not attempted)$", - CMIExit: "^(time-out|suspend|logout|)$", - CMIType: "^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$", - CMIResult: "^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$", - NAVEvent: "^(previous|continue)$", - score_range: "0#100", - audio_range: "-1#100", - speed_range: "-100#100", - weighting_range: "-100#100", - text_range: "-1#1", +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; }; -var regex_aicc = __assign(__assign({}, regex_scorm12), { - CMIIdentifier: "^\\w{1,255}$", + +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; +}; + +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +}; + +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); +}; + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; }); -var regex_scorm2004 = { - CMIString200: "^[\\u0000-\\uFFFF]{0,200}$", - CMIString250: "^[\\u0000-\\uFFFF]{0,250}$", - CMIString1000: "^[\\u0000-\\uFFFF]{0,1000}$", - CMIString4000: "^[\\u0000-\\uFFFF]{0,4000}$", - CMIString64000: "^[\\u0000-\\uFFFF]{0,64000}$", - CMILang: "^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$", - CMILangString250: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$", - CMILangcr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$", - CMILangString250cr: "^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$", - CMILangString4000: "^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$", - CMITime: "^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$", - CMITimespan: "^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$", - CMIInteger: "^\\d+$", - CMISInteger: "^-?([0-9]+)$", - CMIDecimal: "^-?([0-9]{1,5})(\\.[0-9]{1,18})?$", - CMIIdentifier: "^\\S{1,250}[a-zA-Z0-9]$", - CMIShortIdentifier: "^[\\w\\.\\-\\_]{1,250}$", - CMILongIdentifier: "^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$", - CMIFeedback: "^.*$", - CMIIndex: "[._](\\d+).", - CMIIndexStore: ".N(\\d+).", - CMICStatus: "^(completed|incomplete|not attempted|unknown)$", - CMISStatus: "^(passed|failed|unknown)$", - CMIExit: "^(time-out|suspend|logout|normal)$", - CMIType: "^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$", - CMIResult: "^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$", - NAVEvent: "^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$", - NAVBoolean: "^(unknown|true|false$)", - NAVTarget: "^{target=\\S{0,}[a-zA-Z0-9-_]+}$", - scaled_range: "-1#1", - audio_range: "0#*", - speed_range: "0#*", - text_range: "-1#1", - progress_range: "0#1", + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; }; -var Regex = { - aicc: regex_aicc, - scorm12: regex_scorm12, - scorm2004: regex_scorm2004, + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; }; -/* harmony default export */ var regex = (Regex); -;// ./src/cmi/common/validation.ts -function checkValidFormat(value, regexPattern, errorCode, errorClass, allowEmptyString) { - if (typeof value !== "string") { - return false; - } - var formatRegex = new RegExp(regexPattern); - var matches = value.match(formatRegex); - if (allowEmptyString && value === "") { - return true; +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} + +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} + +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; } - if (value === undefined || !matches || matches[0] === "") { - throw new errorClass(errorCode); + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - return true; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; } -function checkValidRange(value, rangePattern, errorCode, errorClass) { - var ranges = rangePattern.split("#"); - value = value * 1.0; - if (value >= ranges[0]) { - if (ranges[1] === "*" || value <= ranges[1]) { - return true; - } - else { - throw new errorClass(errorCode); + +var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; +}; + +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) { + try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } + else s |= 1; + } + catch (e) { + fail(e); + } } - else { - throw new errorClass(errorCode); - } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); } +/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ + __extends, + __assign, + __rest, + __decorate, + __param, + __metadata, + __awaiter, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, +}); + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* binding */ src_Scorm2004API; } +}); + +// EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.mjs +var tslib_es6 = __webpack_require__(635); +// EXTERNAL MODULE: ./src/BaseAPI.ts + 3 modules +var BaseAPI = __webpack_require__(900); +// EXTERNAL MODULE: ./src/constants/api_constants.ts +var api_constants = __webpack_require__(340); +// EXTERNAL MODULE: ./src/constants/regex.ts +var regex = __webpack_require__(417); +// EXTERNAL MODULE: ./src/constants/error_codes.ts +var error_codes = __webpack_require__(797); +// EXTERNAL MODULE: ./src/exceptions.ts +var exceptions = __webpack_require__(784); +// EXTERNAL MODULE: ./src/utilities.ts +var utilities = __webpack_require__(864); +// EXTERNAL MODULE: ./src/cmi/common/base_cmi.ts +var base_cmi = __webpack_require__(319); +// EXTERNAL MODULE: ./src/cmi/common/validation.ts +var validation = __webpack_require__(449); ;// ./src/cmi/scorm2004/validation.ts function check2004ValidFormat(value, regexPattern, allowEmptyString) { - return checkValidFormat(value, regexPattern, error_codes.scorm2004.TYPE_MISMATCH, Scorm2004ValidationError, allowEmptyString); + return (0,validation/* checkValidFormat */.q)(value, regexPattern, error_codes/* default */.A.scorm2004.TYPE_MISMATCH, exceptions/* Scorm2004ValidationError */.wq, allowEmptyString); } function check2004ValidRange(value, rangePattern) { - return checkValidRange(value, rangePattern, error_codes.scorm2004.VALUE_OUT_OF_RANGE, Scorm2004ValidationError); + return (0,validation/* checkValidRange */.W)(value, rangePattern, error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, exceptions/* Scorm2004ValidationError */.wq); } ;// ./src/cmi/scorm2004/learner_preference.ts @@ -2018,10 +2357,10 @@ function check2004ValidRange(value, rangePattern) { var CMILearnerPreference = (function (_super) { - __extends(CMILearnerPreference, _super); + (0,tslib_es6/* __extends */.C6)(CMILearnerPreference, _super); function CMILearnerPreference() { var _this = _super.call(this) || this; - _this.__children = api_constants.scorm2004.student_preference_children; + _this.__children = api_constants/* default */.A.scorm2004.student_preference_children; _this._audio_level = "1"; _this._language = ""; _this._delivery_speed = "1"; @@ -2033,7 +2372,7 @@ var CMILearnerPreference = (function (_super) { return this.__children; }, set: function (_children) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); }, enumerable: false, configurable: true @@ -2043,8 +2382,8 @@ var CMILearnerPreference = (function (_super) { return this._audio_level; }, set: function (audio_level) { - if (check2004ValidFormat(audio_level, regex.scorm2004.CMIDecimal) && - check2004ValidRange(audio_level, regex.scorm2004.audio_range)) { + if (check2004ValidFormat(audio_level, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(audio_level, regex/* default */.A.scorm2004.audio_range)) { this._audio_level = audio_level; } }, @@ -2056,7 +2395,7 @@ var CMILearnerPreference = (function (_super) { return this._language; }, set: function (language) { - if (check2004ValidFormat(language, regex.scorm2004.CMILang)) { + if (check2004ValidFormat(language, regex/* default */.A.scorm2004.CMILang)) { this._language = language; } }, @@ -2068,8 +2407,8 @@ var CMILearnerPreference = (function (_super) { return this._delivery_speed; }, set: function (delivery_speed) { - if (check2004ValidFormat(delivery_speed, regex.scorm2004.CMIDecimal) && - check2004ValidRange(delivery_speed, regex.scorm2004.speed_range)) { + if (check2004ValidFormat(delivery_speed, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(delivery_speed, regex/* default */.A.scorm2004.speed_range)) { this._delivery_speed = delivery_speed; } }, @@ -2081,8 +2420,8 @@ var CMILearnerPreference = (function (_super) { return this._audio_captioning; }, set: function (audio_captioning) { - if (check2004ValidFormat(audio_captioning, regex.scorm2004.CMISInteger) && - check2004ValidRange(audio_captioning, regex.scorm2004.text_range)) { + if (check2004ValidFormat(audio_captioning, regex/* default */.A.scorm2004.CMISInteger) && + check2004ValidRange(audio_captioning, regex/* default */.A.scorm2004.text_range)) { this._audio_captioning = audio_captioning; } }, @@ -2101,12 +2440,14 @@ var CMILearnerPreference = (function (_super) { return result; }; return CMILearnerPreference; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); +// EXTERNAL MODULE: ./src/cmi/common/array.ts +var array = __webpack_require__(589); ;// ./src/constants/response_constants.ts -var scorm2004_regex = regex.scorm2004; +var scorm2004_regex = regex/* default */.A.scorm2004; var LearnerResponses = { "true-false": { format: "^true$|^false$", @@ -2266,19 +2607,19 @@ var CorrectResponses = { var CMIInteractions = (function (_super) { - __extends(CMIInteractions, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractions, _super); function CMIInteractions() { return _super.call(this, { - children: api_constants.scorm2004.interactions_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.interactions_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMIInteractions; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMIInteractionsObject = (function (_super) { - __extends(CMIInteractionsObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObject, _super); function CMIInteractionsObject() { var _this = _super.call(this) || this; _this._id = ""; @@ -2289,15 +2630,15 @@ var CMIInteractionsObject = (function (_super) { _this._result = ""; _this._latency = ""; _this._description = ""; - _this.objectives = new CMIArray({ - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - children: api_constants.scorm2004.objectives_children, + _this.objectives = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.objectives_children, }); - _this.correct_responses = new CMIArray({ - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, - children: api_constants.scorm2004.correct_responses_children, + _this.correct_responses = new array/* CMIArray */.B({ + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, + children: api_constants/* default */.A.scorm2004.correct_responses_children, }); return _this; } @@ -2312,7 +2653,7 @@ var CMIInteractionsObject = (function (_super) { return this._id; }, set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { this._id = id; } }, @@ -2325,10 +2666,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (type) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(type, regex.scorm2004.CMIType)) { + if (check2004ValidFormat(type, regex/* default */.A.scorm2004.CMIType)) { this._type = type; } } @@ -2342,10 +2683,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (timestamp) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(timestamp, regex.scorm2004.CMITime)) { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { this._timestamp = timestamp; } } @@ -2359,10 +2700,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (weighting) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(weighting, regex.scorm2004.CMIDecimal)) { + if (check2004ValidFormat(weighting, regex/* default */.A.scorm2004.CMIDecimal)) { this._weighting = weighting; } } @@ -2376,7 +2717,7 @@ var CMIInteractionsObject = (function (_super) { }, set: function (learner_response) { if (this.initialized && (this._type === "" || this._id === "")) { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { var nodes = []; @@ -2395,28 +2736,28 @@ var CMIInteractionsObject = (function (_super) { var values = nodes[i].split(response_type.delimiter2); if (values.length === 2) { if (!values[0].match(formatRegex)) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } else { if (!response_type.format2 || !values[1].match(new RegExp(response_type.format2))) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } } else { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } else { if (!nodes[i].match(formatRegex)) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } else { if (nodes[i] !== "" && response_type.unique) { for (var j = 0; j < i; j++) { if (nodes[i] === nodes[j]) { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } } @@ -2425,12 +2766,12 @@ var CMIInteractionsObject = (function (_super) { } } else { - throw new Scorm2004ValidationError(error_codes.scorm2004.GENERAL_SET_FAILURE); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); } this._learner_response = learner_response; } else { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } }, @@ -2442,7 +2783,7 @@ var CMIInteractionsObject = (function (_super) { return this._result; }, set: function (result) { - if (check2004ValidFormat(result, regex.scorm2004.CMIResult)) { + if (check2004ValidFormat(result, regex/* default */.A.scorm2004.CMIResult)) { this._result = result; } }, @@ -2455,10 +2796,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (latency) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(latency, regex.scorm2004.CMITimespan)) { + if (check2004ValidFormat(latency, regex/* default */.A.scorm2004.CMITimespan)) { this._latency = latency; } } @@ -2472,10 +2813,10 @@ var CMIInteractionsObject = (function (_super) { }, set: function (description) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(description, regex.scorm2004.CMILangString250, true)) { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { this._description = description; } } @@ -2501,10 +2842,10 @@ var CMIInteractionsObject = (function (_super) { return result; }; return CMIInteractionsObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); var CMIInteractionsObjectivesObject = (function (_super) { - __extends(CMIInteractionsObjectivesObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractionsObjectivesObject, _super); function CMIInteractionsObjectivesObject() { var _this = _super.call(this) || this; _this._id = ""; @@ -2515,7 +2856,7 @@ var CMIInteractionsObjectivesObject = (function (_super) { return this._id; }, set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { this._id = id; } }, @@ -2531,10 +2872,10 @@ var CMIInteractionsObjectivesObject = (function (_super) { return result; }; return CMIInteractionsObjectivesObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); var CMIInteractionsCorrectResponsesObject = (function (_super) { - __extends(CMIInteractionsCorrectResponsesObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIInteractionsCorrectResponsesObject, _super); function CMIInteractionsCorrectResponsesObject() { var _this = _super.call(this) || this; _this._pattern = ""; @@ -2545,7 +2886,7 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) { return this._pattern; }, set: function (pattern) { - if (check2004ValidFormat(pattern, regex.scorm2004.CMIFeedback)) { + if (check2004ValidFormat(pattern, regex/* default */.A.scorm2004.CMIFeedback)) { this._pattern = pattern; } }, @@ -2561,106 +2902,11 @@ var CMIInteractionsCorrectResponsesObject = (function (_super) { return result; }; return CMIInteractionsCorrectResponsesObject; -}(BaseCMI)); - - -;// ./src/cmi/common/score.ts - - - - - - -var scorm12_constants = api_constants.scorm12; -var scorm12_regex = regex.scorm12; -var score_scorm12_error_codes = error_codes.scorm12; -var CMIScore = (function (_super) { - __extends(CMIScore, _super); - function CMIScore(params) { - var _this = _super.call(this) || this; - _this._raw = ""; - _this._min = ""; - _this.__children = params.score_children || scorm12_constants.score_children; - _this.__score_range = !params.score_range - ? false - : scorm12_regex.score_range; - _this._max = params.max || params.max === "" ? params.max : "100"; - _this.__invalid_error_code = - params.invalidErrorCode || score_scorm12_error_codes.INVALID_SET_VALUE; - _this.__invalid_type_code = - params.invalidTypeCode || score_scorm12_error_codes.TYPE_MISMATCH; - _this.__invalid_range_code = - params.invalidRangeCode || score_scorm12_error_codes.VALUE_OUT_OF_RANGE; - _this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal; - _this.__error_class = params.errorClass; - return _this; - } - Object.defineProperty(CMIScore.prototype, "_children", { - get: function () { - return this.__children; - }, - set: function (_children) { - throw new this.__error_class(this.__invalid_error_code); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "raw", { - get: function () { - return this._raw; - }, - set: function (raw) { - if (checkValidFormat(raw, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(raw, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._raw = raw; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "min", { - get: function () { - return this._min; - }, - set: function (min) { - if (checkValidFormat(min, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(min, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._min = min; - } - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CMIScore.prototype, "max", { - get: function () { - return this._max; - }, - set: function (max) { - if (checkValidFormat(max, this.__decimal_regex, this.__invalid_type_code, this.__error_class) && - (!this.__score_range || - checkValidRange(max, this.__score_range, this.__invalid_range_code, this.__error_class))) { - this._max = max; - } - }, - enumerable: false, - configurable: true - }); - CMIScore.prototype.toJSON = function () { - this.jsonString = true; - var result = { - raw: this.raw, - min: this.min, - max: this.max, - }; - delete this.jsonString; - return result; - }; - return CMIScore; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); +// EXTERNAL MODULE: ./src/cmi/common/score.ts +var score = __webpack_require__(434); ;// ./src/cmi/scorm2004/score.ts @@ -2670,16 +2916,16 @@ var CMIScore = (function (_super) { var Scorm2004CMIScore = (function (_super) { - __extends(Scorm2004CMIScore, _super); + (0,tslib_es6/* __extends */.C6)(Scorm2004CMIScore, _super); function Scorm2004CMIScore() { var _this = _super.call(this, { - score_children: api_constants.scorm2004.score_children, + score_children: api_constants/* default */.A.scorm2004.score_children, max: "", - invalidErrorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - invalidTypeCode: error_codes.scorm2004.TYPE_MISMATCH, - invalidRangeCode: error_codes.scorm2004.VALUE_OUT_OF_RANGE, - decimalRegex: regex.scorm2004.CMIDecimal, - errorClass: Scorm2004ValidationError, + invalidErrorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + invalidTypeCode: error_codes/* default */.A.scorm2004.TYPE_MISMATCH, + invalidRangeCode: error_codes/* default */.A.scorm2004.VALUE_OUT_OF_RANGE, + decimalRegex: regex/* default */.A.scorm2004.CMIDecimal, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; _this._scaled = ""; return _this; @@ -2689,8 +2935,8 @@ var Scorm2004CMIScore = (function (_super) { return this._scaled; }, set: function (scaled) { - if (check2004ValidFormat(scaled, regex.scorm2004.CMIDecimal) && - check2004ValidRange(scaled, regex.scorm2004.scaled_range)) { + if (check2004ValidFormat(scaled, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(scaled, regex/* default */.A.scorm2004.scaled_range)) { this._scaled = scaled; } }, @@ -2709,7 +2955,7 @@ var Scorm2004CMIScore = (function (_super) { return result; }; return Scorm2004CMIScore; -}(CMIScore)); +}(score/* CMIScore */._)); ;// ./src/cmi/scorm2004/comments.ts @@ -2722,31 +2968,31 @@ var Scorm2004CMIScore = (function (_super) { var CMICommentsFromLMS = (function (_super) { - __extends(CMICommentsFromLMS, _super); + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLMS, _super); function CMICommentsFromLMS() { return _super.call(this, { - children: api_constants.scorm2004.comments_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMICommentsFromLMS; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMICommentsFromLearner = (function (_super) { - __extends(CMICommentsFromLearner, _super); + (0,tslib_es6/* __extends */.C6)(CMICommentsFromLearner, _super); function CMICommentsFromLearner() { return _super.call(this, { - children: api_constants.scorm2004.comments_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.comments_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMICommentsFromLearner; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMICommentsObject = (function (_super) { - __extends(CMICommentsObject, _super); + (0,tslib_es6/* __extends */.C6)(CMICommentsObject, _super); function CMICommentsObject(readOnlyAfterInit) { if (readOnlyAfterInit === void 0) { readOnlyAfterInit = false; } var _this = _super.call(this) || this; @@ -2765,10 +3011,10 @@ var CMICommentsObject = (function (_super) { }, set: function (comment) { if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { - if (check2004ValidFormat(comment, regex.scorm2004.CMILangString4000, true)) { + if (check2004ValidFormat(comment, regex/* default */.A.scorm2004.CMILangString4000, true)) { this._comment = comment; } } @@ -2782,10 +3028,10 @@ var CMICommentsObject = (function (_super) { }, set: function (location) { if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { - if (check2004ValidFormat(location, regex.scorm2004.CMIString250)) { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString250)) { this._location = location; } } @@ -2799,10 +3045,10 @@ var CMICommentsObject = (function (_super) { }, set: function (timestamp) { if (this.initialized && this._readOnlyAfterInit) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { - if (check2004ValidFormat(timestamp, regex.scorm2004.CMITime)) { + if (check2004ValidFormat(timestamp, regex/* default */.A.scorm2004.CMITime)) { this._timestamp = timestamp; } } @@ -2821,7 +3067,7 @@ var CMICommentsObject = (function (_super) { return result; }; return CMICommentsObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); ;// ./src/cmi/scorm2004/objectives.ts @@ -2835,19 +3081,19 @@ var CMICommentsObject = (function (_super) { var CMIObjectives = (function (_super) { - __extends(CMIObjectives, _super); + (0,tslib_es6/* __extends */.C6)(CMIObjectives, _super); function CMIObjectives() { return _super.call(this, { - children: api_constants.scorm2004.objectives_children, - errorCode: error_codes.scorm2004.READ_ONLY_ELEMENT, - errorClass: Scorm2004ValidationError, + children: api_constants/* default */.A.scorm2004.objectives_children, + errorCode: error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT, + errorClass: exceptions/* Scorm2004ValidationError */.wq, }) || this; } return CMIObjectives; -}(CMIArray)); +}(array/* CMIArray */.B)); var CMIObjectivesObject = (function (_super) { - __extends(CMIObjectivesObject, _super); + (0,tslib_es6/* __extends */.C6)(CMIObjectivesObject, _super); function CMIObjectivesObject() { var _this = _super.call(this) || this; _this._id = ""; @@ -2868,7 +3114,7 @@ var CMIObjectivesObject = (function (_super) { return this._id; }, set: function (id) { - if (check2004ValidFormat(id, regex.scorm2004.CMILongIdentifier)) { + if (check2004ValidFormat(id, regex/* default */.A.scorm2004.CMILongIdentifier)) { this._id = id; } }, @@ -2881,10 +3127,10 @@ var CMIObjectivesObject = (function (_super) { }, set: function (success_status) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(success_status, regex.scorm2004.CMISStatus)) { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { this._success_status = success_status; } } @@ -2898,10 +3144,10 @@ var CMIObjectivesObject = (function (_super) { }, set: function (completion_status) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(completion_status, regex.scorm2004.CMICStatus)) { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { this._completion_status = completion_status; } } @@ -2915,11 +3161,11 @@ var CMIObjectivesObject = (function (_super) { }, set: function (progress_measure) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(progress_measure, regex.scorm2004.CMIDecimal) && - check2004ValidRange(progress_measure, regex.scorm2004.progress_range)) { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { this._progress_measure = progress_measure; } } @@ -2933,10 +3179,10 @@ var CMIObjectivesObject = (function (_super) { }, set: function (description) { if (this.initialized && this._id === "") { - throw new Scorm2004ValidationError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { - if (check2004ValidFormat(description, regex.scorm2004.CMILangString250, true)) { + if (check2004ValidFormat(description, regex/* default */.A.scorm2004.CMILangString250, true)) { this._description = description; } } @@ -2958,7 +3204,7 @@ var CMIObjectivesObject = (function (_super) { return result; }; return CMIObjectivesObject; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); ;// ./src/cmi/scorm2004/cmi.ts @@ -2976,12 +3222,12 @@ var CMIObjectivesObject = (function (_super) { var CMI = (function (_super) { - __extends(CMI, _super); + (0,tslib_es6/* __extends */.C6)(CMI, _super); function CMI(initialized) { if (initialized === void 0) { initialized = false; } var _this = _super.call(this) || this; _this.__version = "1.0"; - _this.__children = api_constants.scorm2004.cmi_children; + _this.__children = api_constants/* default */.A.scorm2004.cmi_children; _this._completion_status = "unknown"; _this._completion_threshold = ""; _this._credit = "credit"; @@ -3025,7 +3271,7 @@ var CMI = (function (_super) { return this.__version; }, set: function (_version) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); }, enumerable: false, configurable: true @@ -3035,7 +3281,7 @@ var CMI = (function (_super) { return this.__children; }, set: function (_children) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); }, enumerable: false, configurable: true @@ -3045,7 +3291,7 @@ var CMI = (function (_super) { return this._completion_status; }, set: function (completion_status) { - if (check2004ValidFormat(completion_status, regex.scorm2004.CMICStatus)) { + if (check2004ValidFormat(completion_status, regex/* default */.A.scorm2004.CMICStatus)) { this._completion_status = completion_status; } }, @@ -3058,7 +3304,7 @@ var CMI = (function (_super) { }, set: function (completion_threshold) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._completion_threshold = completion_threshold; @@ -3073,7 +3319,7 @@ var CMI = (function (_super) { }, set: function (credit) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._credit = credit; @@ -3088,7 +3334,7 @@ var CMI = (function (_super) { }, set: function (entry) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._entry = entry; @@ -3100,12 +3346,12 @@ var CMI = (function (_super) { Object.defineProperty(CMI.prototype, "exit", { get: function () { if (!this.jsonString) { - throw new Scorm2004ValidationError(error_codes.scorm2004.WRITE_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); } return this._exit; }, set: function (exit) { - if (check2004ValidFormat(exit, regex.scorm2004.CMIExit, true)) { + if (check2004ValidFormat(exit, regex/* default */.A.scorm2004.CMIExit, true)) { this._exit = exit; } }, @@ -3118,7 +3364,7 @@ var CMI = (function (_super) { }, set: function (launch_data) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._launch_data = launch_data; @@ -3133,7 +3379,7 @@ var CMI = (function (_super) { }, set: function (learner_id) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._learner_id = learner_id; @@ -3148,7 +3394,7 @@ var CMI = (function (_super) { }, set: function (learner_name) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._learner_name = learner_name; @@ -3162,7 +3408,7 @@ var CMI = (function (_super) { return this._location; }, set: function (location) { - if (check2004ValidFormat(location, regex.scorm2004.CMIString1000)) { + if (check2004ValidFormat(location, regex/* default */.A.scorm2004.CMIString1000)) { this._location = location; } }, @@ -3175,7 +3421,7 @@ var CMI = (function (_super) { }, set: function (max_time_allowed) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._max_time_allowed = max_time_allowed; @@ -3190,7 +3436,7 @@ var CMI = (function (_super) { }, set: function (mode) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._mode = mode; @@ -3204,8 +3450,8 @@ var CMI = (function (_super) { return this._progress_measure; }, set: function (progress_measure) { - if (check2004ValidFormat(progress_measure, regex.scorm2004.CMIDecimal) && - check2004ValidRange(progress_measure, regex.scorm2004.progress_range)) { + if (check2004ValidFormat(progress_measure, regex/* default */.A.scorm2004.CMIDecimal) && + check2004ValidRange(progress_measure, regex/* default */.A.scorm2004.progress_range)) { this._progress_measure = progress_measure; } }, @@ -3218,7 +3464,7 @@ var CMI = (function (_super) { }, set: function (scaled_passing_score) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._scaled_passing_score = scaled_passing_score; @@ -3230,12 +3476,12 @@ var CMI = (function (_super) { Object.defineProperty(CMI.prototype, "session_time", { get: function () { if (!this.jsonString) { - throw new Scorm2004ValidationError(error_codes.scorm2004.WRITE_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.WRITE_ONLY_ELEMENT); } return this._session_time; }, set: function (session_time) { - if (check2004ValidFormat(session_time, regex.scorm2004.CMITimespan)) { + if (check2004ValidFormat(session_time, regex/* default */.A.scorm2004.CMITimespan)) { this._session_time = session_time; } }, @@ -3247,7 +3493,7 @@ var CMI = (function (_super) { return this._success_status; }, set: function (success_status) { - if (check2004ValidFormat(success_status, regex.scorm2004.CMISStatus)) { + if (check2004ValidFormat(success_status, regex/* default */.A.scorm2004.CMISStatus)) { this._success_status = success_status; } }, @@ -3259,7 +3505,7 @@ var CMI = (function (_super) { return this._suspend_data; }, set: function (suspend_data) { - if (check2004ValidFormat(suspend_data, regex.scorm2004.CMIString64000, true)) { + if (check2004ValidFormat(suspend_data, regex/* default */.A.scorm2004.CMIString64000, true)) { this._suspend_data = suspend_data; } }, @@ -3272,7 +3518,7 @@ var CMI = (function (_super) { }, set: function (time_limit_action) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._time_limit_action = time_limit_action; @@ -3287,7 +3533,7 @@ var CMI = (function (_super) { }, set: function (total_time) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } else { this._total_time = total_time; @@ -3301,9 +3547,9 @@ var CMI = (function (_super) { var startTime = this.start_time; if (typeof startTime !== "undefined" && startTime !== null) { var seconds = new Date().getTime() - startTime; - sessionTime = getSecondsAsISODuration(seconds / 1000); + sessionTime = utilities/* getSecondsAsISODuration */.xE(seconds / 1000); } - return addTwoDurations(this._total_time, sessionTime, regex.scorm2004.CMITimespan); + return utilities/* addTwoDurations */.$o(this._total_time, sessionTime, regex/* default */.A.scorm2004.CMITimespan); }; CMI.prototype.toJSON = function () { this.jsonString = true; @@ -3336,7 +3582,7 @@ var CMI = (function (_super) { return result; }; return CMI; -}(BaseRootCMI)); +}(base_cmi/* BaseRootCMI */.r)); ;// ./src/constants/language_constants.ts @@ -3735,26 +3981,8 @@ var ValidLanguages = [ ]; /* harmony default export */ var language_constants = (ValidLanguages); -;// ./src/constants/enums.ts -var NAVBoolean; -(function (NAVBoolean) { - NAVBoolean["unknown"] = "unknown"; - NAVBoolean["true"] = "true"; - NAVBoolean["false"] = "false"; -})(NAVBoolean || (NAVBoolean = {})); -var SuccessStatus; -(function (SuccessStatus) { - SuccessStatus["passed"] = "passed"; - SuccessStatus["failed"] = "failed"; - SuccessStatus["unknown"] = "unknown"; -})(SuccessStatus || (SuccessStatus = {})); -var CompletionStatus; -(function (CompletionStatus) { - CompletionStatus["completed"] = "completed"; - CompletionStatus["incomplete"] = "incomplete"; - CompletionStatus["unknown"] = "unknown"; -})(CompletionStatus || (CompletionStatus = {})); - +// EXTERNAL MODULE: ./src/constants/enums.ts +var enums = __webpack_require__(56); ;// ./src/cmi/scorm2004/adl.ts @@ -3764,7 +3992,7 @@ var CompletionStatus; var ADL = (function (_super) { - __extends(ADL, _super); + (0,tslib_es6/* __extends */.C6)(ADL, _super); function ADL() { var _this = _super.call(this) || this; _this.nav = new ADLNav(); @@ -3784,10 +4012,10 @@ var ADL = (function (_super) { return result; }; return ADL; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); var ADLNav = (function (_super) { - __extends(ADLNav, _super); + (0,tslib_es6/* __extends */.C6)(ADLNav, _super); function ADLNav() { var _this = _super.call(this) || this; _this._request = "_none_"; @@ -3804,7 +4032,7 @@ var ADLNav = (function (_super) { return this._request; }, set: function (request) { - if (check2004ValidFormat(request, regex.scorm2004.NAVEvent)) { + if (check2004ValidFormat(request, regex/* default */.A.scorm2004.NAVEvent)) { this._request = request; } }, @@ -3820,10 +4048,10 @@ var ADLNav = (function (_super) { return result; }; return ADLNav; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); var ADLNavRequestValid = (function (_super) { - __extends(ADLNavRequestValid, _super); + (0,tslib_es6/* __extends */.C6)(ADLNavRequestValid, _super); function ADLNavRequestValid() { var _this = _super.call(this) || this; _this._continue = "unknown"; @@ -3838,9 +4066,9 @@ var ADLNavRequestValid = (function (_super) { }, set: function (_continue) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } - if (check2004ValidFormat(_continue, regex.scorm2004.NAVBoolean)) { + if (check2004ValidFormat(_continue, regex/* default */.A.scorm2004.NAVBoolean)) { this._continue = _continue; } }, @@ -3853,9 +4081,9 @@ var ADLNavRequestValid = (function (_super) { }, set: function (_previous) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } - if (check2004ValidFormat(_previous, regex.scorm2004.NAVBoolean)) { + if (check2004ValidFormat(_previous, regex/* default */.A.scorm2004.NAVBoolean)) { this._previous = _previous; } }, @@ -3868,17 +4096,17 @@ var ADLNavRequestValid = (function (_super) { }, set: function (choice) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } if (typeof choice !== "object") { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } for (var key in choice) { if ({}.hasOwnProperty.call(choice, key)) { - if (check2004ValidFormat(choice[key], regex.scorm2004.NAVBoolean) && - check2004ValidFormat(key, regex.scorm2004.NAVTarget)) { + if (check2004ValidFormat(choice[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { this._choice[key] = - NAVBoolean[choice[key]]; + enums/* NAVBoolean */.K$[choice[key]]; } } } @@ -3892,16 +4120,16 @@ var ADLNavRequestValid = (function (_super) { }, set: function (jump) { if (this.initialized) { - throw new Scorm2004ValidationError(error_codes.scorm2004.READ_ONLY_ELEMENT); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.READ_ONLY_ELEMENT); } if (typeof jump !== "object") { - throw new Scorm2004ValidationError(error_codes.scorm2004.TYPE_MISMATCH); + throw new exceptions/* Scorm2004ValidationError */.wq(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } for (var key in jump) { if ({}.hasOwnProperty.call(jump, key)) { - if (check2004ValidFormat(jump[key], regex.scorm2004.NAVBoolean) && - check2004ValidFormat(key, regex.scorm2004.NAVTarget)) { - this._jump[key] = NAVBoolean[jump[key]]; + if (check2004ValidFormat(jump[key], regex/* default */.A.scorm2004.NAVBoolean) && + check2004ValidFormat(key, regex/* default */.A.scorm2004.NAVTarget)) { + this._jump[key] = enums/* NAVBoolean */.K$[jump[key]]; } } } @@ -3921,7 +4149,7 @@ var ADLNavRequestValid = (function (_super) { return result; }; return ADLNavRequestValid; -}(BaseCMI)); +}(base_cmi/* BaseCMI */.J)); ;// ./src/Scorm2004API.ts @@ -3942,7 +4170,7 @@ var ADLNavRequestValid = (function (_super) { var Scorm2004API = (function (_super) { - __extends(Scorm2004API, _super); + (0,tslib_es6/* __extends */.C6)(Scorm2004API, _super); function Scorm2004API(settings) { var _this = this; if (settings) { @@ -3950,7 +4178,7 @@ var Scorm2004API = (function (_super) { settings.mastery_override = false; } } - _this = _super.call(this, error_codes.scorm2004, settings) || this; + _this = _super.call(this, error_codes/* default */.A.scorm2004, settings) || this; _this._version = "1.0"; _this.cmi = new CMI(); _this.adl = new ADL(); @@ -3982,8 +4210,8 @@ var Scorm2004API = (function (_super) { }; Scorm2004API.prototype.lmsFinish = function () { var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this.internalFinish()]; case 1: @@ -3992,17 +4220,17 @@ var Scorm2004API = (function (_super) { } }); }); })(); - return api_constants.global.SCORM_TRUE; + return api_constants/* default */.A.global.SCORM_TRUE; }; Scorm2004API.prototype.internalFinish = function () { - return __awaiter(this, void 0, void 0, function () { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { var result, navActions, request, choiceJumpRegex, matches, target, action; - return __generator(this, function (_a) { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this.terminate("Terminate", true)]; case 1: result = _a.sent(); - if (result === api_constants.global.SCORM_TRUE) { + if (result === api_constants/* default */.A.global.SCORM_TRUE) { if (this.adl.nav.request !== "_none_") { navActions = { continue: "SequenceNext", @@ -4015,7 +4243,7 @@ var Scorm2004API = (function (_super) { abandonAll: "SequenceAbandonAll", }; request = this.adl.nav.request; - choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent); + choiceJumpRegex = new RegExp(regex/* default */.A.scorm2004.NAVEvent); matches = request.match(choiceJumpRegex); target = ""; if (matches && matches.length > 2) { @@ -4038,7 +4266,7 @@ var Scorm2004API = (function (_super) { }; Scorm2004API.prototype.lmsGetValue = function (CMIElement) { var adlNavRequestRegex = "^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$"; - if (stringMatches(CMIElement, adlNavRequestRegex)) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, adlNavRequestRegex)) { var matches = CMIElement.match(adlNavRequestRegex); var request = matches[1]; var target = matches[2].replace("{target=", "").replace("}", ""); @@ -4056,8 +4284,8 @@ var Scorm2004API = (function (_super) { }; Scorm2004API.prototype.lmsCommit = function () { var _this = this; - (function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { + (function () { return (0,tslib_es6/* __awaiter */.sH)(_this, void 0, void 0, function () { + return (0,tslib_es6/* __generator */.YH)(this, function (_a) { switch (_a.label) { case 0: return [4, this.commit("Commit")]; case 1: @@ -4066,7 +4294,7 @@ var Scorm2004API = (function (_super) { } }); }); })(); - return api_constants.global.SCORM_TRUE; + return api_constants/* default */.A.global.SCORM_TRUE; }; Scorm2004API.prototype.lmsGetLastError = function () { return this.getLastError("GetLastError"); @@ -4081,24 +4309,24 @@ var Scorm2004API = (function (_super) { return this._commonSetCMIValue("SetValue", true, CMIElement, value); }; Scorm2004API.prototype.getChildElement = function (CMIElement, value, foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.objectives\\.\\d+")) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.objectives\\.\\d+")) { return new CMIObjectivesObject(); } if (foundFirstIndex) { - if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")) { return this.createCorrectResponsesObject(CMIElement, value); } - else if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")) { return new CMIInteractionsObjectivesObject(); } } - else if (stringMatches(CMIElement, "cmi\\.interactions\\.\\d+")) { + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.interactions\\.\\d+")) { return new CMIInteractionsObject(); } - if (stringMatches(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) { + if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_learner\\.\\d+")) { return new CMICommentsObject(); } - else if (stringMatches(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) { + else if ((0,utilities/* stringMatches */.J6)(CMIElement, "cmi\\.comments_from_lms\\.\\d+")) { return new CMICommentsObject(true); } return null; @@ -4109,7 +4337,7 @@ var Scorm2004API = (function (_super) { var interaction = this.cmi.interactions.childArray[index]; if (this.isInitialized()) { if (!interaction.type) { - this.throwSCORMError(error_codes.scorm2004.DEPENDENCY_NOT_ESTABLISHED); + this.throwSCORMError(error_codes/* default */.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED); } else { this.checkDuplicateChoiceResponse(interaction, value); @@ -4118,7 +4346,7 @@ var Scorm2004API = (function (_super) { this.checkValidResponseType(response_type, value, interaction.type); } else { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type); + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Incorrect Response Type: " + interaction.type); } } } @@ -4139,7 +4367,7 @@ var Scorm2004API = (function (_super) { this.checkCorrectResponseValue(interaction_type, nodes, value); } else if (nodes.length > response_type.max) { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long"); + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Too Long"); } }; Scorm2004API.prototype.checkDuplicateChoiceResponse = function (interaction, value) { @@ -4148,7 +4376,7 @@ var Scorm2004API = (function (_super) { for (var i = 0; i < interaction_count && this.lastErrorCode === "0"; i++) { var response = interaction.correct_responses.childArray[i]; if (response.pattern === value) { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE); + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE); } } } @@ -4171,12 +4399,12 @@ var Scorm2004API = (function (_super) { } else { if (this.lastErrorCode === "0") { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists"); + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Pattern Already Exists"); } } } else { - this.throwSCORMError(error_codes.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached"); + this.throwSCORMError(error_codes/* default */.A.scorm2004.GENERAL_SET_FAILURE, "Data Model Element Collection Limit Reached"); } }; Scorm2004API.prototype.getCMIValue = function (CMIElement) { @@ -4186,11 +4414,11 @@ var Scorm2004API = (function (_super) { var basicMessage = ""; var detailMessage = ""; errorNumber = String(errorNumber); - if (api_constants.scorm2004.error_descriptions[errorNumber]) { + if (api_constants/* default */.A.scorm2004.error_descriptions[errorNumber]) { basicMessage = - api_constants.scorm2004.error_descriptions[errorNumber].basicMessage; + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].basicMessage; detailMessage = - api_constants.scorm2004.error_descriptions[errorNumber].detailMessage; + api_constants/* default */.A.scorm2004.error_descriptions[errorNumber].detailMessage; } return detail ? detailMessage : basicMessage; }; @@ -4216,36 +4444,36 @@ var Scorm2004API = (function (_super) { if (values.length === 2) { var matches = values[0].match(formatRegex); if (!matches) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } else { if (!response.format2 || !values[1].match(new RegExp(response.format2))) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } } else { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } else { var matches = nodes[i].match(formatRegex); if ((!matches && value !== "") || (!matches && interaction_type === "true-false")) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } else { if (interaction_type === "numeric" && nodes.length > 1) { if (Number(nodes[0]) > Number(nodes[1])) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } else { if (nodes[i] !== "" && response.unique) { for (var j = 0; j < i && this.lastErrorCode === "0"; j++) { if (nodes[i] === nodes[j]) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } } @@ -4264,12 +4492,12 @@ var Scorm2004API = (function (_super) { while (matches) { switch (matches[2]) { case "lang": - langMatches = node.match(regex.scorm2004.CMILangcr); + langMatches = node.match(regex/* default */.A.scorm2004.CMILangcr); if (langMatches) { var lang = langMatches[3]; if (lang !== undefined && lang.length > 0) { if (!language_constants.includes(lang.toLowerCase())) { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } } @@ -4278,7 +4506,7 @@ var Scorm2004API = (function (_super) { case "case_matters": if (!seenLang && !seenOrder && !seenCase) { if (matches[3] !== "true" && matches[3] !== "false") { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } seenCase = true; @@ -4286,7 +4514,7 @@ var Scorm2004API = (function (_super) { case "order_matters": if (!seenCase && !seenLang && !seenOrder) { if (matches[3] !== "true" && matches[3] !== "false") { - this.throwSCORMError(error_codes.scorm2004.TYPE_MISMATCH); + this.throwSCORMError(error_codes/* default */.A.scorm2004.TYPE_MISMATCH); } } seenOrder = true; @@ -4307,10 +4535,10 @@ var Scorm2004API = (function (_super) { cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime(); } var result = []; - var flattened = flatten(cmiExport); + var flattened = utilities/* flatten */.Bq(cmiExport); switch (this.settings.dataCommitFormat) { case "flattened": - return flatten(cmiExport); + return utilities/* flatten */.Bq(cmiExport); case "params": for (var item in flattened) { if ({}.hasOwnProperty.call(flattened, item)) { @@ -4326,23 +4554,23 @@ var Scorm2004API = (function (_super) { Scorm2004API.prototype.renderCommitObject = function (terminateCommit) { var cmiExport = this.renderCommitCMI(terminateCommit); var totalTimeDuration = this.cmi.getCurrentTotalTime(); - var totalTimeSeconds = getDurationAsSeconds(totalTimeDuration, regex.scorm2004.CMITimespan); - var completionStatus = CompletionStatus.unknown; - var successStatus = SuccessStatus.unknown; + var totalTimeSeconds = utilities/* getDurationAsSeconds */.OI(totalTimeDuration, regex/* default */.A.scorm2004.CMITimespan); + var completionStatus = enums/* CompletionStatus */.lC.unknown; + var successStatus = enums/* SuccessStatus */.YE.unknown; if (this.cmi.completion_status) { if (this.cmi.completion_status === "completed") { - completionStatus = CompletionStatus.completed; + completionStatus = enums/* CompletionStatus */.lC.completed; } else if (this.cmi.completion_status === "incomplete") { - completionStatus = CompletionStatus.incomplete; + completionStatus = enums/* CompletionStatus */.lC.incomplete; } } if (this.cmi.success_status) { if (this.cmi.success_status === "passed") { - successStatus = SuccessStatus.passed; + successStatus = enums/* SuccessStatus */.YE.passed; } else if (this.cmi.success_status === "failed") { - successStatus = SuccessStatus.failed; + successStatus = enums/* SuccessStatus */.YE.failed; } } var score = this.cmi.score; @@ -4374,10 +4602,10 @@ var Scorm2004API = (function (_super) { return commitObject; }; Scorm2004API.prototype.storeData = function (terminateCommit) { - return __awaiter(this, void 0, void 0, function () { + return (0,tslib_es6/* __awaiter */.sH)(this, void 0, void 0, function () { var navRequest, shouldTerminateCommit, commitObject, result; var _a, _b, _c; - return __generator(this, function (_d) { + return (0,tslib_es6/* __generator */.YH)(this, function (_d) { switch (_d.label) { case 0: if (terminateCommit) { @@ -4412,7 +4640,7 @@ var Scorm2004API = (function (_super) { commitObject = this.settings.renderCommonCommitFields ? this.renderCommitObject(shouldTerminateCommit) : this.renderCommitCMI(shouldTerminateCommit); - if (this.apiLogLevel === api_constants.global.LOG_LEVEL_DEBUG) { + if (this.apiLogLevel === api_constants/* default */.A.global.LOG_LEVEL_DEBUG) { console.debug("Commit (terminated: " + (terminateCommit ? "yes" : "no") + "): "); console.debug(commitObject); } @@ -4429,7 +4657,7 @@ var Scorm2004API = (function (_super) { } return [2, result]; case 2: return [2, { - result: api_constants.global.SCORM_TRUE, + result: api_constants/* default */.A.global.SCORM_TRUE, errorCode: 0, }]; } @@ -4437,14 +4665,9 @@ var Scorm2004API = (function (_super) { }); }; return Scorm2004API; -}(src_BaseAPI)); +}(BaseAPI/* default */.A)); /* harmony default export */ var src_Scorm2004API = (Scorm2004API); -;// ./src/exports/scorm2004.js - - -window.Scorm2004API = src_Scorm2004API; - /******/ return __webpack_exports__; /******/ })() ; diff --git a/dist/scorm2004.js.map b/dist/scorm2004.js.map index cd34a9c..194ec79 100644 --- a/dist/scorm2004.js.map +++ b/dist/scorm2004.js.map @@ -1 +1 @@ -{"version":3,"file":"scorm2004.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS,gBAAgB,sCAAsC,kBAAkB;AACjF,wBAAwB;AACxB;AACA;;AAEO;AACP;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEO;AACP;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,2CAA2C,QAAQ;AACnD;AACA;;AAEO;AACP,kCAAkC;AAClC;;AAEO;AACP,uBAAuB,uFAAuF;AAC9G;AACA;AACA,yGAAyG;AACzG;AACA,sCAAsC,QAAQ;AAC9C;AACA,gEAAgE;AAChE;AACA,8CAA8C,yFAAyF;AACvI,8DAA8D,2CAA2C;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;;AAEO;AAC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;AAChJ,0BAA0B,MAAM,iBAAiB,YAAY;AAC7D,qBAAqB;AACrB,4BAA4B;AAC5B,2BAA2B;AAC3B,0BAA0B;AAC1B;;AAEO;AACP;AACA,eAAe,6CAA6C,UAAU,sDAAsD,cAAc;AAC1I,wBAAwB,6BAA6B,oBAAoB,uCAAuC,kBAAkB;AAClI;;AAEO;AACP;AACA;AACA,yGAAyG,uFAAuF,cAAc;AAC9M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;ACtXF;IAAA;QACE,eAAU,GAAI,KAAK,CAAC;QACZ,iBAAY,GAAG,KAAK,CAAC;IAiC/B,CAAC;IA1BC,sBAAI,gCAAW;aAAf;YACE,OAA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IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC;AACF,uDAAe,cAAc,EAAC;;;ACzY9B,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB;IACnB,2BAAa;IACb,6BAAe;AACjB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,k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,gBAAY","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/exports/scorm2004.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import Scorm2004API from \"../Scorm2004API.ts\";\n\nwindow.Scorm2004API = Scorm2004API;\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"scorm2004.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;;;;;;;;;;;;;ACFO,SAAS,QAAQ,CACtB,IAAO,EACP,IAAY,EACZ,SAAiB;IAAjB,6CAAiB;IAEjB,IAAI,OAA6C,CAAC;IAElD,OAAO;QAAqB,cAAsB;aAAtB,UAAsB,EAAtB,qBAAsB,EAAtB,IAAsB;YAAtB,yBAAsB;;QAChD,IAAM,OAAO,GAAG,IAAI,CAAC;QAErB,IAAM,KAAK,GAAG;YACZ,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAC;QAEF,IAAM,OAAO,GAAG,SAAS,IAAI,CAAC,OAAO,CAAC;QAEtC,IAAI,OAAO;YAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAElC,IAAI,OAAO;YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC;;;;AC7B0C;AAKpC,IAAM,eAAe,GAAa;IACvC,UAAU,EAAE,KAAK;IACjB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,IAAI;IACpB,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,MAAM;IACxB,qBAAqB,EAAE,gCAAgC;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M,qBAAqB,8BAA8B,gDAAgD,wDAAwD;AAC3J,2CAA2C,sCAAsC,UAAU,mBAAmB,IAAI;AAClH;;AAEO;AACP,+BAA+B,uCAAuC,YAAY,KAAK,OAAO;AAC9F;AACA;;AAEA;AACA,wCAAwC,4BAA4B;AACpE,CAAC;AACD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,2CAA2C;AAC3C;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,MAAM,oBAAoB,YAAY;AAC5E,qBAAqB,8CAA8C;AACnE;AACA;AACA,qBAAqB,aAAa;AAClC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFAAuF,SAAS,gBAAgB;AAChH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;UCzXF;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNyE;AACpB;AACO;AASrD,SAAS,oBAAoB,CAClC,KAAa,EACb,YAAoB,EACpB,gBAA0B;IAE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,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;I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WAAM,IAAI,CAAC,kBAAkB,CAC1C,IAAI,CAAC,QAAQ,CAAC,YAAY,EAC1B,YAAY,EACZ,eAAe,CAChB;;wBAJK,MAAM,GAAG,SAId;wBAGD,CAAC;4BACC,IACE,UAAU;gCACV,MAAM,CAAC,UAAU,KAAK,SAAS;gCAC/B,MAAM,CAAC,UAAU,KAAK,EAAE,EACxB,CAAC;gCACD,QAAQ,CAAC,kCAAyB,MAAM,CAAC,UAAU,UAAO,CAAC,EAAE,CAAC;4BAChE,CAAC;wBACH,CAAC;wBACD,WAAO,MAAM,EAAC;4BAEd,WAAO;4BACL,MAAM,EAAE,4BAAY,CAAC,MAAM,CAAC,UAAU;4BACtC,SAAS,EAAE,CAAC;yBACb,EAAC;;;;KAEL;IACH,mBAAC;AAAD,CAAC,CArtByC,sBAAO,GAqtBhD","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/scorm2004.min.js b/dist/scorm2004.min.js index db1c88a..6b42c31 100644 --- a/dist/scorm2004.min.js +++ b/dist/scorm2004.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var r=function(){return r=Object.assign||function(e){for(var t,r=1,i=arguments.length;r0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]2&&(r=Number(Number(r).toFixed(2))),"S"===i&&r>0&&(o+=r),o&&((t.indexOf("D")>0||"H"===i||"M"===i||"S"===i)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(o).concat(i))}return t}function y(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=new RegExp(t).exec(e)||[],i=r[1],n=(r[2],r[4]),o=r[5],s=r[6],a=r[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(i)||0}function S(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=r(r({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return i(this,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return r=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=u.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(i=n.sent()).errorCode&&i.errorCode>0&&this.throwSCORMError(i.errorCode),r=void 0!==i&&i.result?i.result:u.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=u.global.SCORM_TRUE,this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,u.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=u.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=u.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,u.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return i(this,arguments,void 0,(function(e,t){var r,i;return void 0===t&&(t=!1),n(this,(function(n){switch(n.label){case 0:return this.clearScheduledCommit(),r=u.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(i=n.sent()).errorCode&&i.errorCode>0&&this.throwSCORMError(i.errorCode),r=void 0!==i&&i.result?i.result:u.global.SCORM_FALSE,this.apiLog(e," Result: "+r,u.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),n.label=2;case 2:return this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,u.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,u.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,i,n){if(!i||""===i)return u.global.SCORM_FALSE;for(var o=i.split("."),s=this,a=u.global.SCORM_FALSE,c=!1,l="The data model element passed to ".concat(e," (").concat(i,") is not a valid SCORM data model element."),h=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,d=0;d1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),u.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],a=null;o.length>1&&(a=e.replace(s+".",""));var c=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===a&&e.callback===t}));-1!==c&&(n.listenerArray.splice(c,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),u.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON(function(e){if(Object(e)!==e||Array.isArray(e))return e;var t=/\.?([^.[\]]+)|\[(\d+)]/g,r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){for(var n=r,o="",s=t.exec(i);s;)n=n[o]||(n[o]=s[2]?[]:{}),o=s[2]||s[1],s=t.exec(i);n[o]=e[i]}return r[""]||r}(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===u.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),N=L,w={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},R={aicc:r(r({},w),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:w,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};function A(e,t,r,i,n){if("string"!=typeof e)return!1;var o=new RegExp(t),s=e.match(o);if(n&&""===e)return!0;if(void 0===e||!s||""===s[0])throw new i(r);return!0}function D(e,t,r,i){var n=t.split("#");if((e*=1)>=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}function j(e,t,r){return A(e,t,c.scorm2004.TYPE_MISMATCH,f,r)}function P(e,t){return D(e,t,c.scorm2004.VALUE_OUT_OF_RANGE,f)}var x,F,V,z=function(e){function r(){var t=e.call(this)||this;return t.__children=u.scorm2004.student_preference_children,t._audio_level="1",t._language="",t._delivery_speed="1",t._audio_captioning="0",t}return t(r,e),Object.defineProperty(r.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new f(c.scorm2004.READ_ONLY_ELEMENT)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"audio_level",{get:function(){return this._audio_level},set:function(e){j(e,R.scorm2004.CMIDecimal)&&P(e,R.scorm2004.audio_range)&&(this._audio_level=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"language",{get:function(){return this._language},set:function(e){j(e,R.scorm2004.CMILang)&&(this._language=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"delivery_speed",{get:function(){return this._delivery_speed},set:function(e){j(e,R.scorm2004.CMIDecimal)&&P(e,R.scorm2004.speed_range)&&(this._delivery_speed=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"audio_captioning",{get:function(){return this._audio_captioning},set:function(e){j(e,R.scorm2004.CMISInteger)&&P(e,R.scorm2004.text_range)&&(this._audio_captioning=e)},enumerable:!1,configurable:!0}),r.prototype.toJSON=function(){this.jsonString=!0;var e={audio_level:this.audio_level,language:this.language,delivery_speed:this.delivery_speed,audio_captioning:this.audio_captioning};return delete this.jsonString,e},r}(o),k=R.scorm2004,G={"true-false":{format:"^true$|^false$",max:1,delimiter:"",unique:!1},choice:{format:k.CMILongIdentifier,max:36,delimiter:"[,]",unique:!0},"fill-in":{format:k.CMILangString250,max:10,delimiter:"[,]",unique:!1},"long-fill-in":{format:k.CMILangString4000,max:1,delimiter:"",unique:!1},matching:{format:k.CMIShortIdentifier,format2:k.CMIShortIdentifier,max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1},performance:{format:"^$|"+k.CMIShortIdentifier,format2:k.CMIDecimal+"|^$|"+k.CMIShortIdentifier,max:250,delimiter:"[,]",delimiter2:"[.]",unique:!1},sequencing:{format:k.CMIShortIdentifier,max:36,delimiter:"[,]",unique:!1},likert:{format:k.CMIShortIdentifier,max:1,delimiter:"",unique:!1},numeric:{format:k.CMIDecimal,max:1,delimiter:"",unique:!1},other:{format:k.CMIString4000,max:1,delimiter:"",unique:!1}},U={"true-false":{max:1,delimiter:"",unique:!1,duplicate:!1,format:"^true$|^false$",limit:1},choice:{max:36,delimiter:"[,]",unique:!0,duplicate:!1,format:k.CMILongIdentifier},"fill-in":{max:10,delimiter:"[,]",unique:!1,duplicate:!1,format:k.CMILangString250cr},"long-fill-in":{max:1,delimiter:"",unique:!1,duplicate:!0,format:k.CMILangString4000},matching:{max:36,delimiter:"[,]",delimiter2:"[.]",unique:!1,duplicate:!1,format:k.CMIShortIdentifier,format2:k.CMIShortIdentifier},performance:{max:250,delimiter:"[,]",delimiter2:"[.]",delimiter3:"[:]",unique:!1,duplicate:!1,format:"^$|"+k.CMIShortIdentifier,format2:k.CMIDecimal+"|^$|"+k.CMIShortIdentifier},sequencing:{max:36,delimiter:"[,]",unique:!1,duplicate:!1,format:k.CMIShortIdentifier},likert:{max:1,delimiter:"",unique:!1,duplicate:!1,format:k.CMIShortIdentifier,limit:1},numeric:{max:2,delimiter:"[:]",unique:!1,duplicate:!1,format:k.CMIDecimal,limit:1},other:{max:1,delimiter:"",unique:!1,duplicate:!1,format:k.CMIString4000,limit:1}},Y=function(e){function r(){return e.call(this,{children:u.scorm2004.interactions_children,errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:f})||this}return t(r,e),r}(E),q=function(e){function r(){var t=e.call(this)||this;return t._id="",t._type="",t._timestamp="",t._weighting="",t._learner_response="",t._result="",t._latency="",t._description="",t.objectives=new E({errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:f,children:u.scorm2004.objectives_children}),t.correct_responses=new E({errorCode:c.scorm2004.READ_ONLY_ELEMENT,errorClass:f,children:u.scorm2004.correct_responses_children}),t}return t(r,e),r.prototype.initialize=function(){var t,r;e.prototype.initialize.call(this),null===(t=this.objectives)||void 0===t||t.initialize(),null===(r=this.correct_responses)||void 0===r||r.initialize()},Object.defineProperty(r.prototype,"id",{get:function(){return this._id},set:function(e){j(e,R.scorm2004.CMILongIdentifier)&&(this._id=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"type",{get:function(){return this._type},set:function(e){if(this.initialized&&""===this._id)throw new f(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);j(e,R.scorm2004.CMIType)&&(this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timestamp",{get:function(){return this._timestamp},set:function(e){if(this.initialized&&""===this._id)throw new f(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);j(e,R.scorm2004.CMITime)&&(this._timestamp=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"weighting",{get:function(){return this._weighting},set:function(e){if(this.initialized&&""===this._id)throw new f(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);j(e,R.scorm2004.CMIDecimal)&&(this._weighting=e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"learner_response",{get:function(){return this._learner_response},set:function(e){if(this.initialized&&(""===this._type||""===this._id))throw new f(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);var t=[],r=G[this.type];if(!r)throw new f(c.scorm2004.TYPE_MISMATCH);if((null==r?void 0:r.delimiter)?t=e.split(r.delimiter):t[0]=e,!(t.length>0&&t.length<=r.max))throw new f(c.scorm2004.GENERAL_SET_FAILURE);for(var i=new RegExp(r.format),n=0;n2&&(s=o[2],r=o[1].replace(s,"")),(a=t[r])&&this.processListeners(a,"adl.nav.request",s)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},r.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if(O(e,t)){var r=e.match(t),i=r[1],n=r[2].replace("{target=","").replace("}","");if("choice"===i||"jump"===i)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},r.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},r.prototype.lmsCommit=function(){return i(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),u.global.SCORM_TRUE},r.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},r.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},r.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},r.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},r.prototype.getChildElement=function(e,t,r){if(O(e,"cmi\\.objectives\\.\\d+"))return new te;if(r){if(O(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if(O(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new $}else if(O(e,"cmi\\.interactions\\.\\d+"))return new q;return O(e,"cmi\\.comments_from_learner\\.\\d+")?new X:O(e,"cmi\\.comments_from_lms\\.\\d+")?new X(!0):null},r.prototype.createCorrectResponsesObject=function(e,t){var r=e.split("."),i=Number(r[2]),n=this.cmi.interactions.childArray[i];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=U[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(c.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new H:null},r.prototype.checkValidResponseType=function(e,t,r){var i=[];(null==e?void 0:e.delimiter)?i=String(t).split(e.delimiter):i[0]=t,i.length>0&&i.length<=e.max?this.checkCorrectResponseValue(r,i,t):i.length>e.max&&this.throwSCORMError(c.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},r.prototype.checkDuplicateChoiceResponse=function(e,t){var r=e.correct_responses._count;if("choice"===e.type)for(var i=0;i1)Number(t[0])>Number(t[1])&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&i.unique)for(var l=0;l0&&(ie.includes(a.toLowerCase())||this.throwSCORMError(c.scorm2004.TYPE_MISMATCH))}i=!0;break;case"case_matters":i||t||r||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH),r=!0;break;case"order_matters":r||i||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},r.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},r.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var r=[],i=S(t);switch(this.settings.dataCommitFormat){case"flattened":return S(t);case"params":for(var n in i)({}).hasOwnProperty.call(i,n)&&r.push("".concat(n,"=").concat(i[n]));return r;default:return t}},r.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),r=y(this.cmi.getCurrentTotalTime(),R.scorm2004.CMITimespan),i=V.unknown,n=F.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?i=V.completed:"incomplete"===this.cmi.completion_status&&(i=V.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?n=F.passed:"failed"===this.cmi.success_status&&(n=F.failed));var o=this.cmi.score,s=null;o&&(s={},Number.isNaN(Number.parseFloat(o.raw))||(s.raw=Number.parseFloat(o.raw)),Number.isNaN(Number.parseFloat(o.min))||(s.min=Number.parseFloat(o.min)),Number.isNaN(Number.parseFloat(o.max))||(s.max=Number.parseFloat(o.max)),Number.isNaN(Number.parseFloat(o.scaled))||(s.scaled=Number.parseFloat(o.scaled)));var a={completionStatus:i,successStatus:n,totalTimeSeconds:r,runtimeData:t};return s&&(a.score=s),a},r.prototype.storeData=function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,a,c;return n(this,(function(n){switch(n.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(c=null===(a=null===(s=this.startingData)||void 0===s?void 0:s.adl)||void 0===a?void 0:a.nav)||void 0===c?void 0:c.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===u.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return o=n.sent(),t&&void 0!==o.navRequest&&""!==o.navRequest&&Function('"use strict";(() => { '.concat(o.navRequest," })()"))(),[2,o];case 2:return[2,{result:u.global.SCORM_TRUE,errorCode:0}]}}))}))},r}(N);return window.Scorm2004API=ae,{}}()})); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["scorm-again"]=t():e["scorm-again"]=t()}(self,(function(){return function(){"use strict";var e={900:function(e,t,r){r.d(t,{A:function(){return d}});var i=r(635),n=r(589),o=r(784),s=r(797),a=r(340),c=r(864);var l={autocommit:!1,autocommitSeconds:10,asyncCommit:!1,sendFullCommit:!0,lmsCommitUrl:!1,dataCommitFormat:"json",commitRequestDataType:"application/json;charset=UTF-8",autoProgress:!1,logLevel:a.A.global.LOG_LEVEL_ERROR,selfReportSessionTime:!1,alwaysSendTotalTime:!1,renderCommonCommitFields:!1,strict_errors:!0,xhrHeaders:{},xhrWithCredentials:!1,responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:(n=(r=JSON).parse,[4,e.text()]);case 1:return null!==(t=n.apply(r,[i.sent()]))&&{}.hasOwnProperty.call(t,"result")?[2,{result:t.result,errorCode:t.errorCode?t.errorCode:t.result===a.A.global.SCORM_TRUE?0:101}]:200===e.status?[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]:[2,{result:a.A.global.SCORM_FALSE,errorCode:101}];case 2:return[2,{result:a.A.global.SCORM_FALSE,errorCode:101}]}}))}))},requestHandler:function(e){return e},onLogMessage:function(e,t){switch(e){case a.A.global.LOG_LEVEL_ERROR:console.error(t);break;case a.A.global.LOG_LEVEL_WARNING:console.warn(t);break;case a.A.global.LOG_LEVEL_INFO:console.info(t);break;case a.A.global.LOG_LEVEL_DEBUG:console.debug?console.debug(t):console.log(t)}},scoItemIds:[],scoItemIdValidator:!1},u=function(){function e(e,t,r){this._cancelled=!1,this._API=e,this._timeout=setTimeout(this.wrapper.bind(this),t),this._callback=r}return e.prototype.cancel=function(){this._cancelled=!0,this._timeout&&clearTimeout(this._timeout)},e.prototype.wrapper=function(){var e=this;this._cancelled||(0,i.sH)(e,void 0,void 0,(function(){return(0,i.YH)(this,(function(e){switch(e.label){case 0:return[4,this._API.commit(this._callback)];case 1:return[2,e.sent()]}}))}))},e}(),h=function(){function e(t,r){var i=this.constructor;if(this._settings=l,i===e)throw new TypeError("Cannot construct BaseAPI instances directly");this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[],this._error_codes=t,r&&(this.settings=r),this.apiLogLevel=this.settings.logLevel,this.selfReportSessionTime=this.settings.selfReportSessionTime}return e.prototype.commonReset=function(e){this.settings=(0,i.Cl)((0,i.Cl)({},this.settings),e),this.currentState=a.A.global.STATE_NOT_INITIALIZED,this.lastErrorCode="0",this.listenerArray=[]},e.prototype.initialize=function(e,t,r){var i=a.A.global.SCORM_FALSE;return this.isInitialized()?this.throwSCORMError(this._error_codes.INITIALIZED,t):this.isTerminated()?this.throwSCORMError(this._error_codes.TERMINATED,r):(this.selfReportSessionTime&&this.cmi.setStartTime(),this.currentState=a.A.global.STATE_INITIALIZED,this.lastErrorCode="0",i=a.A.global.SCORM_TRUE,this.processListeners(e)),this.apiLog(e,"returned: "+i,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(i),i},e.prototype.apiLog=function(e,t,r,i){t=(0,c.hw)(e,t,i),r>=this.apiLogLevel&&this.settings.onLogMessage(r,t)},Object.defineProperty(e.prototype,"error_codes",{get:function(){return this._error_codes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"settings",{get:function(){return this._settings},set:function(e){this._settings=(0,i.Cl)((0,i.Cl)({},this._settings),e)},enumerable:!1,configurable:!0}),e.prototype.terminate=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){var r,n;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.TERMINATION_BEFORE_INIT,this._error_codes.MULTIPLE_TERMINATION)?(this.currentState=a.A.global.STATE_TERMINATED,[4,this.storeData(!0)]):[3,2];case 1:void 0!==(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,t&&(this.lastErrorCode="0"),r=a.A.global.SCORM_TRUE,this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getValue=function(e,t,r){var i="";if(this.checkState(t,this._error_codes.RETRIEVE_BEFORE_INIT,this._error_codes.RETRIEVE_AFTER_TERM)){t&&(this.lastErrorCode="0");try{i=this.getCMIValue(r)}catch(e){i=this.handleValueAccessException(e,i)}this.processListeners(e,r)}return this.apiLog(e,": returned: "+i,a.A.global.LOG_LEVEL_INFO,r),void 0===i?"":(this.clearSCORMError(i),i)},e.prototype.setValue=function(e,t,r,i,n){void 0!==n&&(n=String(n));var o=a.A.global.SCORM_FALSE;if(this.checkState(r,this._error_codes.STORE_BEFORE_INIT,this._error_codes.STORE_AFTER_TERM)){r&&(this.lastErrorCode="0");try{o=this.setCMIValue(i,n)}catch(e){this.handleValueAccessException(e,o)}this.processListeners(e,i,n)}return void 0===o&&(o=a.A.global.SCORM_FALSE),"0"===String(this.lastErrorCode)&&this.settings.autocommit&&!this._timeout&&this.scheduleCommit(1e3*this.settings.autocommitSeconds,t),this.apiLog(e,": "+n+": result: "+o,a.A.global.LOG_LEVEL_INFO,i),this.clearSCORMError(o),o},e.prototype.commit=function(e){return(0,i.sH)(this,arguments,void 0,(function(e,t){var r,n;return void 0===t&&(t=!1),(0,i.YH)(this,(function(i){switch(i.label){case 0:return this.clearScheduledCommit(),r=a.A.global.SCORM_FALSE,this.checkState(t,this._error_codes.COMMIT_BEFORE_INIT,this._error_codes.COMMIT_AFTER_TERM)?[4,this.storeData(!1)]:[3,2];case 1:(n=i.sent()).errorCode&&n.errorCode>0&&this.throwSCORMError(n.errorCode),r=void 0!==n&&n.result?n.result:a.A.global.SCORM_FALSE,this.apiLog(e," Result: "+r,a.A.global.LOG_LEVEL_DEBUG,"HttpRequest"),t&&(this.lastErrorCode="0"),this.processListeners(e),i.label=2;case 2:return this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),this.clearSCORMError(r),[2,r]}}))}))},e.prototype.getLastError=function(e){var t=String(this.lastErrorCode);return this.processListeners(e),this.apiLog(e,"returned: "+t,a.A.global.LOG_LEVEL_INFO),t},e.prototype.getErrorString=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.getDiagnostic=function(e,t){var r="";return null!==t&&""!==t&&(r=this.getLmsErrorMessageDetails(t,!0),this.processListeners(e)),this.apiLog(e,"returned: "+r,a.A.global.LOG_LEVEL_INFO),r},e.prototype.checkState=function(e,t,r){return this.isNotInitialized()?(this.throwSCORMError(t),!1):!e||!this.isTerminated()||(this.throwSCORMError(r),!1)},e.prototype.getLmsErrorMessageDetails=function(e,t){throw void 0===t&&(t=!1),new Error("The getLmsErrorMessageDetails method has not been implemented")},e.prototype.getCMIValue=function(e){throw new Error("The getCMIValue method has not been implemented")},e.prototype.setCMIValue=function(e,t){throw new Error("The setCMIValue method has not been implemented")},e.prototype._commonSetCMIValue=function(e,t,r,o){if(!r||""===r)return a.A.global.SCORM_FALSE;for(var s=r.split("."),l=this,u=a.A.global.SCORM_FALSE,h=!1,d="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),m=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,_=0;_1&&(s=e.replace(o+".","")),this.listenerArray.push({functionName:o,CMIElement:s,callback:t}),this.apiLog("on","Added event listener: ".concat(this.listenerArray.length),a.A.global.LOG_LEVEL_INFO,o)}},e.prototype.off=function(e,t){if(t)for(var r=e.split(" "),i=function(i){var o=r[i].split(".");if(0===o.length)return{value:void 0};var s=o[0],c=null;o.length>1&&(c=e.replace(s+".",""));var l=n.listenerArray.findIndex((function(e){return e.functionName===s&&e.CMIElement===c&&e.callback===t}));-1!==l&&(n.listenerArray.splice(l,1),n.apiLog("off","Removed event listener: ".concat(n.listenerArray.length),a.A.global.LOG_LEVEL_INFO,s))},n=this,o=0;o1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;ns?1:0})),s.forEach((function(e){(i={})[e[0]]=e[1],r.loadFromJSON((0,c.sB)(i),t)}))}else console.error("loadFromFlattenedJSON can only be called before the call to lmsInitialize.");function a(e,t,r){var i,n=e.match(r);if(null!==n&&null!==(i=t.match(r))){var o=Number(n[2]),s=Number(i[2]);return o===s?"id"===n[3]?-1:"type"===n[3]?"id"===i[3]?1:-1:1:o-s}return null}},e.prototype.loadFromJSON=function(e,t){if(this.isNotInitialized()){for(var r in t=void 0!==t?t:"cmi",this.startingData=e,e)if({}.hasOwnProperty.call(e,r)&&e[r]){var i=(t?t+".":"")+r,n=e[r];if(n.childArray)for(var o=0;o=200&&e.status<=299&&(!0===t.result||t.result===a.A.global.SCORM_TRUE)?this.processListeners("CommitSuccess"):this.processListeners("CommitError"),[2,t]}}))}))},e}(),d=h},589:function(e,t,r){r.d(t,{B:function(){return c}});var i=r(635),n=r(319),o=r(797),s=r(784),a=o.A.scorm12,c=function(e){function t(t){var r=e.call(this)||this;return r.__children=t.children,r._errorCode=t.errorCode||a.GENERAL,r._errorClass=t.errorClass||s.$h,r.childArray=[],r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"_children",{get:function(){return this.__children},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_count",{get:function(){return this.childArray.length},set:function(e){throw new this._errorClass(this._errorCode)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;for(var e={},t=0;t=n[0]){if("*"===n[1]||e<=n[1])return!0;throw new i(r)}throw new i(r)}r.d(t,{W:function(){return n},q:function(){return i}})},340:function(e,t,r){var i=r(635),n={cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions",core_children:"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time",score_children:"raw,min,max",comments_children:"content,location,time",objectives_children:"id,score,status",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio,language,speed,text",interactions_children:"id,objectives,time,type,correct_responses,weighting,student_response,result,latency",error_descriptions:{101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information"},201:{basicMessage:"Invalid argument error",detailMessage:"Indicates that an argument represents an invalid data model element or is otherwise incorrect."},202:{basicMessage:"Element cannot have children",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_children" for a data model element that does not support the "_children" suffix.'},203:{basicMessage:"Element not an array - cannot have count",detailMessage:'Indicates that LMSGetValue was called with a data model element name that ends in "_count" for a data model element that does not support the "_count" suffix.'},301:{basicMessage:"Not initialized",detailMessage:"Indicates that an API call was made before the call to lmsInitialize."},401:{basicMessage:"Not implemented error",detailMessage:"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement."},402:{basicMessage:"Invalid set value, element is a keyword",detailMessage:'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in "_children" and "_count").'},403:{basicMessage:"Element is read only",detailMessage:"LMSSetValue was called with a data model element that can only be read."},404:{basicMessage:"Element is write only",detailMessage:"LMSGetValue was called on a data model element that can only be written to."},405:{basicMessage:"Incorrect Data Type",detailMessage:"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Element Value Out Of Range",detailMessage:"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}},o={global:{SCORM_TRUE:"true",SCORM_FALSE:"false",STATE_NOT_INITIALIZED:0,STATE_INITIALIZED:1,STATE_TERMINATED:2,LOG_LEVEL_DEBUG:1,LOG_LEVEL_INFO:2,LOG_LEVEL_WARNING:3,LOG_LEVEL_ERROR:4,LOG_LEVEL_NONE:5},scorm12:n,aicc:(0,i.Cl)((0,i.Cl)({},n),{cmi_children:"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation",student_preference_children:"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows",student_data_children:"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action",student_demographics_children:"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience",tries_children:"time,status,score",attempt_records_children:"score,lesson_status",paths_children:"location_id,date,time,status,why_left,time_in_element"}),scorm2004:{cmi_children:"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time",comments_children:"comment,timestamp,location",score_children:"max,raw,scaled,min",objectives_children:"progress_measure,completion_status,success_status,description,score,id",correct_responses_children:"pattern",student_data_children:"mastery_score,max_time_allowed,time_limit_action",student_preference_children:"audio_level,audio_captioning,delivery_speed,language",interactions_children:"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",error_descriptions:{0:{basicMessage:"No Error",detailMessage:"No error occurred, the previous API call was successful."},101:{basicMessage:"General Exception",detailMessage:"No specific error code exists to describe the error. Use GetDiagnostic for more information."},102:{basicMessage:"General Initialization Failure",detailMessage:"Call to Initialize failed for an unknown reason."},103:{basicMessage:"Already Initialized",detailMessage:"Call to Initialize failed because Initialize was already called."},104:{basicMessage:"Content Instance Terminated",detailMessage:"Call to Initialize failed because Terminate was already called."},111:{basicMessage:"General Termination Failure",detailMessage:"Call to Terminate failed for an unknown reason."},112:{basicMessage:"Termination Before Initialization",detailMessage:"Call to Terminate failed because it was made before the call to Initialize."},113:{basicMessage:"Termination After Termination",detailMessage:"Call to Terminate failed because Terminate was already called."},122:{basicMessage:"Retrieve Data Before Initialization",detailMessage:"Call to GetValue failed because it was made before the call to Initialize."},123:{basicMessage:"Retrieve Data After Termination",detailMessage:"Call to GetValue failed because it was made after the call to Terminate."},132:{basicMessage:"Store Data Before Initialization",detailMessage:"Call to SetValue failed because it was made before the call to Initialize."},133:{basicMessage:"Store Data After Termination",detailMessage:"Call to SetValue failed because it was made after the call to Terminate."},142:{basicMessage:"Commit Before Initialization",detailMessage:"Call to Commit failed because it was made before the call to Initialize."},143:{basicMessage:"Commit After Termination",detailMessage:"Call to Commit failed because it was made after the call to Terminate."},201:{basicMessage:"General Argument Error",detailMessage:"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument."},301:{basicMessage:"General Get Failure",detailMessage:"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},351:{basicMessage:"General Set Failure",detailMessage:"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information."},391:{basicMessage:"General Commit Failure",detailMessage:"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information."},401:{basicMessage:"Undefined Data Model Element",detailMessage:"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element."},402:{basicMessage:"Unimplemented Data Model Element",detailMessage:"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant."},403:{basicMessage:"Data Model Element Value Not Initialized",detailMessage:"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO."},404:{basicMessage:"Data Model Element Is Read Only",detailMessage:"SetValue was called with a data model element that can only be read."},405:{basicMessage:"Data Model Element Is Write Only",detailMessage:"GetValue was called on a data model element that can only be written to."},406:{basicMessage:"Data Model Element Type Mismatch",detailMessage:"SetValue was called with a value that is not consistent with the data format of the supplied data model element."},407:{basicMessage:"Data Model Element Value Out Of Range",detailMessage:"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element."},408:{basicMessage:"Data Model Dependency Not Established",detailMessage:"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element."}}}};t.A=o},56:function(e,t,r){var i,n,o;r.d(t,{K$:function(){return i},YE:function(){return n},lC:function(){return o}}),function(e){e.unknown="unknown",e.true="true",e.false="false"}(i||(i={})),function(e){e.passed="passed",e.failed="failed",e.unknown="unknown"}(n||(n={})),function(e){e.completed="completed",e.incomplete="incomplete",e.unknown="unknown"}(o||(o={}))},797:function(e,t,r){var i=r(635),n={GENERAL:101,INITIALIZATION_FAILED:101,INITIALIZED:101,TERMINATED:101,TERMINATION_FAILURE:101,TERMINATION_BEFORE_INIT:101,MULTIPLE_TERMINATION:101,RETRIEVE_BEFORE_INIT:101,RETRIEVE_AFTER_TERM:101,STORE_BEFORE_INIT:101,STORE_AFTER_TERM:101,COMMIT_BEFORE_INIT:101,COMMIT_AFTER_TERM:101,ARGUMENT_ERROR:101,CHILDREN_ERROR:101,COUNT_ERROR:101,GENERAL_GET_FAILURE:101,GENERAL_SET_FAILURE:101,GENERAL_COMMIT_FAILURE:101,UNDEFINED_DATA_MODEL:101,UNIMPLEMENTED_ELEMENT:101,VALUE_NOT_INITIALIZED:101,INVALID_SET_VALUE:101,READ_ONLY_ELEMENT:101,WRITE_ONLY_ELEMENT:101,TYPE_MISMATCH:101,VALUE_OUT_OF_RANGE:101,DEPENDENCY_NOT_ESTABLISHED:101},o={scorm12:(0,i.Cl)((0,i.Cl)({},n),{RETRIEVE_BEFORE_INIT:301,STORE_BEFORE_INIT:301,COMMIT_BEFORE_INIT:301,ARGUMENT_ERROR:201,CHILDREN_ERROR:202,COUNT_ERROR:203,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:401,VALUE_NOT_INITIALIZED:301,INVALID_SET_VALUE:402,READ_ONLY_ELEMENT:403,WRITE_ONLY_ELEMENT:404,TYPE_MISMATCH:405,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408}),scorm2004:(0,i.Cl)((0,i.Cl)({},n),{INITIALIZATION_FAILED:102,INITIALIZED:103,TERMINATED:104,TERMINATION_FAILURE:111,TERMINATION_BEFORE_INIT:112,MULTIPLE_TERMINATIONS:113,RETRIEVE_BEFORE_INIT:122,RETRIEVE_AFTER_TERM:123,STORE_BEFORE_INIT:132,STORE_AFTER_TERM:133,COMMIT_BEFORE_INIT:142,COMMIT_AFTER_TERM:143,ARGUMENT_ERROR:201,GENERAL_GET_FAILURE:301,GENERAL_SET_FAILURE:351,GENERAL_COMMIT_FAILURE:391,UNDEFINED_DATA_MODEL:401,UNIMPLEMENTED_ELEMENT:402,VALUE_NOT_INITIALIZED:403,READ_ONLY_ELEMENT:404,WRITE_ONLY_ELEMENT:405,TYPE_MISMATCH:406,VALUE_OUT_OF_RANGE:407,DEPENDENCY_NOT_ESTABLISHED:408})};t.A=o},417:function(e,t,r){var i=r(635),n={CMIString256:"^.{0,255}$",CMIString4096:"^.{0,4096}$",CMITime:"^(?:[01]\\d|2[0123]):(?:[012345]\\d):(?:[012345]\\d)$",CMITimespan:"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{0,3})(.[0-9]*)?$",CMIIdentifier:"^[\\u0021-\\u007E\\s]{0,255}$",CMIFeedback:"^.{0,255}$",CMIIndex:"[._](\\d+).",CMIStatus:"^(passed|completed|failed|incomplete|browsed)$",CMIStatus2:"^(passed|completed|failed|incomplete|browsed|not attempted)$",CMIExit:"^(time-out|suspend|logout|)$",CMIType:"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$",CMIResult:"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\.[0-9]*)?)$",NAVEvent:"^(previous|continue)$",score_range:"0#100",audio_range:"-1#100",speed_range:"-100#100",weighting_range:"-100#100",text_range:"-1#1"},o={aicc:(0,i.Cl)((0,i.Cl)({},n),{CMIIdentifier:"^\\w{1,255}$"}),scorm12:n,scorm2004:{CMIString200:"^[\\u0000-\\uFFFF]{0,200}$",CMIString250:"^[\\u0000-\\uFFFF]{0,250}$",CMIString1000:"^[\\u0000-\\uFFFF]{0,1000}$",CMIString4000:"^[\\u0000-\\uFFFF]{0,4000}$",CMIString64000:"^[\\u0000-\\uFFFF]{0,64000}$",CMILang:"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",CMILangString250:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",CMILangcr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",CMILangString250cr:"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",CMILangString4000:"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",CMITime:"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$",CMITimespan:"^P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?(?:T?(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?)?$",CMIInteger:"^\\d+$",CMISInteger:"^-?([0-9]+)$",CMIDecimal:"^-?([0-9]{1,5})(\\.[0-9]{1,18})?$",CMIIdentifier:"^\\S{1,250}[a-zA-Z0-9]$",CMIShortIdentifier:"^[\\w\\.\\-\\_]{1,250}$",CMILongIdentifier:"^(?:(?!urn:)\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\S{1,4000}|.{1,4000})$",CMIFeedback:"^.*$",CMIIndex:"[._](\\d+).",CMIIndexStore:".N(\\d+).",CMICStatus:"^(completed|incomplete|not attempted|unknown)$",CMISStatus:"^(passed|failed|unknown)$",CMIExit:"^(time-out|suspend|logout|normal)$",CMIType:"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$",CMIResult:"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\.[0-9]{1,18})?)$",NAVEvent:"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\{target=\\S{0,}[a-zA-Z0-9-_]+})?jump)$",NAVBoolean:"^(unknown|true|false$)",NAVTarget:"^{target=\\S{0,}[a-zA-Z0-9-_]+}$",scaled_range:"-1#1",audio_range:"0#*",speed_range:"0#*",text_range:"-1#1",progress_range:"0#1"}};t.A=o},784:function(e,t,r){r.d(t,{$h:function(){return c},wq:function(){return u},yI:function(){return l}});var i=r(635),n=r(340),o=n.A.scorm12.error_descriptions,s=n.A.aicc.error_descriptions,a=n.A.scorm2004.error_descriptions,c=function(e){function t(t){var r=e.call(this,t.toString())||this;return r._errorCode=t,r.name="ScormValidationError",r}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorCode",{get:function(){return this._errorCode},enumerable:!1,configurable:!0}),t.prototype.setMessage=function(e){this.message=e},t}(Error),l=function(e){function t(t,r,i){var n=e.call(this,t)||this;return n._detailedMessage="",n.setMessage(r),n._errorMessage=r,i&&(n._detailedMessage=i),n}return(0,i.C6)(t,e),Object.defineProperty(t.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"detailedMessage",{get:function(){return this._detailedMessage},enumerable:!1,configurable:!0}),t}(c),u=(function(e){function t(t){return{}.hasOwnProperty.call(o,String(t))?e.call(this,t,o[String(t)].basicMessage,o[String(t)].detailMessage)||this:e.call(this,101,o[101].basicMessage,o[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(s,String(t))?e.call(this,t,s[String(t)].basicMessage,s[String(t)].detailMessage)||this:e.call(this,101,s[101].basicMessage,s[101].detailMessage)||this}(0,i.C6)(t,e)}(l),function(e){function t(t){return{}.hasOwnProperty.call(a,String(t))?e.call(this,t,a[String(t)].basicMessage,a[String(t)].detailMessage)||this:e.call(this,101,a[101].basicMessage,a[101].detailMessage)||this}return(0,i.C6)(t,e),t}(l))},864:function(e,t,r){r.d(t,{$o:function(){return a},Bq:function(){return c},J6:function(){return d},OI:function(){return s},hw:function(){return h},sB:function(){return l},xE:function(){return o}});var i=3600,n={D:24*i,H:i,M:60,S:1};function o(e){if(!e||e<=0)return"PT0S";var t="P",r=e;for(var i in n){var o=n[i],s=Math.floor(r/o);u(r%=o)>2&&(r=Number(Number(r).toFixed(2))),"S"===i&&r>0&&(s+=r),s&&((t.indexOf("D")>0||"H"===i||"M"===i||"S"===i)&&-1===t.indexOf("T")&&(t+="T"),t+="".concat(s).concat(i))}return t}function s(e,t){if("string"==typeof t&&(t=new RegExp(t)),!e||!e.match(t))return 0;var r=new RegExp(t).exec(e)||[],i=r[1],n=(r[2],r[4]),o=r[5],s=r[6],a=r[7],c=0;return c+=Number(a)||0,c+=60*Number(s)||0,c+=3600*Number(o)||0,c+=86400*Number(n)||0,c+=31536e3*Number(i)||0}function a(e,t,r){var i="string"==typeof r?new RegExp(r):r;return o(s(e,i)+s(t,i))}function c(e){var t={};return function e(r,i){if(Object(r)!==r)t[i]=r;else if(Array.isArray(r))for(var n=0,o=r.length;n0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0&&t.length<=r.max))throw new l.wq(c.A.scorm2004.GENERAL_SET_FAILURE);for(var i=new RegExp(r.format),n=0;n2&&(c=o[2],r=o[1].replace(c,"")),(l=t[r])&&this.processListeners(l,"adl.nav.request",c)):this.settings.autoProgress&&this.processListeners("SequenceNext")),[2,e]}}))}))},t.prototype.lmsGetValue=function(e){var t="^adl\\.nav\\.request_valid\\.(choice|jump)\\.{target=\\S{0,}([a-zA-Z0-9-_]+)}$";if((0,u.J6)(e,t)){var r=e.match(t),i=r[1],n=r[2].replace("{target=","").replace("}","");if("choice"===i||"jump"===i)return this.settings.scoItemIdValidator?String(this.settings.scoItemIdValidator(n)):String(this.settings.scoItemIds.includes(n))}return this.getValue("GetValue",!0,e)},t.prototype.lmsSetValue=function(e,t){return this.setValue("SetValue","Commit",!0,e,t)},t.prototype.lmsCommit=function(){var e=this;return(0,n.sH)(e,void 0,void 0,(function(){return(0,n.YH)(this,(function(e){switch(e.label){case 0:return[4,this.commit("Commit")];case 1:return e.sent(),[2]}}))})),s.A.global.SCORM_TRUE},t.prototype.lmsGetLastError=function(){return this.getLastError("GetLastError")},t.prototype.lmsGetErrorString=function(e){return this.getErrorString("GetErrorString",e)},t.prototype.lmsGetDiagnostic=function(e){return this.getDiagnostic("GetDiagnostic",e)},t.prototype.setCMIValue=function(e,t){return this._commonSetCMIValue("SetValue",!0,e,t)},t.prototype.getChildElement=function(e,t,r){if((0,u.J6)(e,"cmi\\.objectives\\.\\d+"))return new w;if(r){if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+"))return this.createCorrectResponsesObject(e,t);if((0,u.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+"))return new I}else if((0,u.J6)(e,"cmi\\.interactions\\.\\d+"))return new M;return(0,u.J6)(e,"cmi\\.comments_from_learner\\.\\d+")?new T:(0,u.J6)(e,"cmi\\.comments_from_lms\\.\\d+")?new T(!0):null},t.prototype.createCorrectResponsesObject=function(e,t){var r=e.split("."),i=Number(r[2]),n=this.cmi.interactions.childArray[i];if(this.isInitialized())if(n.type){this.checkDuplicateChoiceResponse(n,t);var o=b[n.type];o?this.checkValidResponseType(o,t,n.type):this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Incorrect Response Type: "+n.type)}else this.throwSCORMError(c.A.scorm2004.DEPENDENCY_NOT_ESTABLISHED);return"0"===this.lastErrorCode?new y:null},t.prototype.checkValidResponseType=function(e,t,r){var i=[];(null==e?void 0:e.delimiter)?i=String(t).split(e.delimiter):i[0]=t,i.length>0&&i.length<=e.max?this.checkCorrectResponseValue(r,i,t):i.length>e.max&&this.throwSCORMError(c.A.scorm2004.GENERAL_SET_FAILURE,"Data Model Element Pattern Too Long")},t.prototype.checkDuplicateChoiceResponse=function(e,t){var r=e.correct_responses._count;if("choice"===e.type)for(var i=0;i1)Number(t[0])>Number(t[1])&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH);else if(""!==t[o]&&i.unique)for(var l=0;l0&&(N.includes(l.toLowerCase())||this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH))}i=!0;break;case"case_matters":i||t||r||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),r=!0;break;case"order_matters":r||i||t||"true"!==o[3]&&"false"!==o[3]&&this.throwSCORMError(c.A.scorm2004.TYPE_MISMATCH),t=!0}o=(e=e.substring(o[1].length)).match(n)}return e},t.prototype.replaceWithAnotherScormAPI=function(e){this.cmi=e.cmi,this.adl=e.adl},t.prototype.renderCommitCMI=function(e){var t=this.renderCMIToJSONObject();e&&(t.cmi.total_time=this.cmi.getCurrentTotalTime());var r=[],i=u.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return u.Bq(t);case"params":for(var n in i)({}).hasOwnProperty.call(i,n)&&r.push("".concat(n,"=").concat(i[n]));return r;default:return t}},t.prototype.renderCommitObject=function(e){var t=this.renderCommitCMI(e),r=this.cmi.getCurrentTotalTime(),i=u.OI(r,a.A.scorm2004.CMITimespan),n=R.lC.unknown,o=R.YE.unknown;this.cmi.completion_status&&("completed"===this.cmi.completion_status?n=R.lC.completed:"incomplete"===this.cmi.completion_status&&(n=R.lC.incomplete)),this.cmi.success_status&&("passed"===this.cmi.success_status?o=R.YE.passed:"failed"===this.cmi.success_status&&(o=R.YE.failed));var s=this.cmi.score,c=null;s&&(c={},Number.isNaN(Number.parseFloat(s.raw))||(c.raw=Number.parseFloat(s.raw)),Number.isNaN(Number.parseFloat(s.min))||(c.min=Number.parseFloat(s.min)),Number.isNaN(Number.parseFloat(s.max))||(c.max=Number.parseFloat(s.max)),Number.isNaN(Number.parseFloat(s.scaled))||(c.scaled=Number.parseFloat(s.scaled)));var l={completionStatus:n,successStatus:o,totalTimeSeconds:i,runtimeData:t};return c&&(l.score=c),l},t.prototype.storeData=function(e){return(0,n.sH)(this,void 0,void 0,(function(){var t,r,i,o,a,c,l;return(0,n.YH)(this,(function(n){switch(n.label){case 0:return e&&"normal"===this.cmi.mode&&"credit"===this.cmi.credit&&(this.cmi.completion_threshold&&this.cmi.progress_measure&&(this.cmi.progress_measure>=this.cmi.completion_threshold?this.cmi.completion_status="completed":this.cmi.completion_status="incomplete"),this.cmi.scaled_passing_score&&this.cmi.score.scaled&&(this.cmi.score.scaled>=this.cmi.scaled_passing_score?this.cmi.success_status="passed":this.cmi.success_status="failed")),t=!1,this.adl.nav.request!==(null===(l=null===(c=null===(a=this.startingData)||void 0===a?void 0:a.adl)||void 0===c?void 0:c.nav)||void 0===l?void 0:l.request)&&"_none_"!==this.adl.nav.request&&(this.adl.nav.request=encodeURIComponent(this.adl.nav.request),t=!0),r=e||this.settings.alwaysSendTotalTime,i=this.settings.renderCommonCommitFields?this.renderCommitObject(r):this.renderCommitCMI(r),this.apiLogLevel===s.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(i)),"string"!=typeof this.settings.lmsCommitUrl?[3,2]:[4,this.processHttpRequest(this.settings.lmsCommitUrl,i,e)];case 1:return o=n.sent(),t&&void 0!==o.navRequest&&""!==o.navRequest&&Function('"use strict";(() => { '.concat(o.navRequest," })()"))(),[2,o];case 2:return[2,{result:s.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(o.A),F=x;return i}()})); //# sourceMappingURL=scorm2004.min.js.map \ No newline at end of file diff --git a/dist/scorm2004.min.js.map b/dist/scorm2004.min.js.map index 3e86f6f..2377021 100644 --- a/dist/scorm2004.min.js.map +++ b/dist/scorm2004.min.js.map @@ -1 +1 @@ -{"version":3,"file":"scorm2004.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,eAAiBD,IAEzBD,EAAK,eAAiBC,GACvB,CATD,CASGK,MAAM,WACT,O,4BCMIC,EAAgB,SAASC,EAAGC,GAI9B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAG,GAC1E,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,GAAI,EAC7FP,EAAcC,EAAGC,EAC1B,EAEO,SAASS,EAAUV,EAAGC,GAC3B,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,CAAG,CADtC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AK8gB,YACL0B,EACA,EAAMld,UAAUuS,YAEpB,EAiCA,YAAAjP,OAAA,WAyBE5I,KAAKgD,YAAa,EAClB,IAAMtB,EAAS,CACbuf,sBAAuBjhB,KAAKihB,sBAC5BE,kBAAmBnhB,KAAKmhB,kBACxBrB,kBAAmB9f,KAAK8f,kBACxB2B,qBAAsBzhB,KAAKyhB,qBAC3BC,OAAQ1hB,KAAK0hB,OACbC,MAAO3hB,KAAK2hB,MACZC,KAAM5hB,KAAK4hB,KACXP,aAAcrhB,KAAKqhB,aACnBQ,YAAa7hB,KAAK6hB,YAClBC,WAAY9hB,KAAK8hB,WACjBC,aAAc/hB,KAAK+hB,aACnBhB,mBAAoB/gB,KAAK+gB,mBACzBxB,SAAUvf,KAAKuf,SACfyC,iBAAkBhiB,KAAKgiB,iBACvBC,KAAMjiB,KAAKiiB,KACX/E,WAAYld,KAAKkd,WACjB6C,iBAAkB/f,KAAK+f,iBACvBmC,qBAAsBliB,KAAKkiB,qBAC3BvC,MAAO3f,KAAK2f,MACZwC,aAAcniB,KAAKmiB,aACnBtC,eAAgB7f,KAAK6f,eACrBuC,aAAcpiB,KAAKoiB,aACnBC,kBAAmBriB,KAAKqiB,mBAG1B,cADOriB,KAAKgD,WACLtB,CACT,EACF,EAtkBA,CAAyBmhB,GCyXzB,GAzYiC,CAC/B,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,M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V,oBAAY,eAAEkO,WAAG,eAAEf,WAAG,eAAEK,UAC7B,WAAzBnjB,KAAK6jB,IAAIf,IAAIK,UAEbnjB,KAAK6jB,IAAIf,IAAIK,QAAUsF,mBAAmBzoB,KAAK6jB,IAAIf,IAAIK,SACvDqF,GAAa,GAGTE,EACJjB,GAAmBznB,KAAKuO,SAASvC,oBAC7Ba,EAAe7M,KAAKuO,SAAStC,yBAC/BjM,KAAK4nB,mBAAmBc,GACxB1oB,KAAKwnB,gBAAgBkB,GAErB1oB,KAAK8O,cAAgB,EAAatL,OAAOiD,kBAC3CwG,QAAQI,MACN,wBAA0Boa,EAAkB,MAAQ,MAAQ,OAE9Dxa,QAAQI,MAAMR,IAE0B,iBAA/B7M,KAAKuO,SAAS7C,aAArB,MACa,GAAM1L,KAAKiW,mBACxBjW,KAAKuO,SAAS7C,aACdmB,EACA4a,I,OAaF,OAhBM/lB,EAAS,SASX8mB,QACsBhY,IAAtB9O,EAAO8mB,YACe,KAAtB9mB,EAAO8mB,YAEPG,SAAS,gCAAyBjnB,EAAO8mB,WAAU,SAAnDG,GAGG,CAAP,EAAOjnB,G,OAEP,MAAO,CAAP,EAAO,CACLA,OAAQ,EAAa8B,OAAO4C,WAC5BkB,UAAW,I,QAInB,EArtBA,CAA0C,G,OC9B1CshB,OAAOC,aAAe,G","sources":["webpack://scorm-again/webpack/universalModuleDefinition","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./src/constants/default_settings.ts","webpack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts","webpack://scorm-again/./src/exports/scorm2004.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n","import Scorm2004API from \"../Scorm2004API.ts\";\n\nwindow.Scorm2004API = Scorm2004API;\n"],"names":["root","factory","exports","module","define","amd","self","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","v","op","pop","push","SuppressedError","jsonString","_initialized","_start_time","initialize","setStartTime","Date","getTime","BaseCMI","global","GENERAL","INITIALIZATION_FAILED","INITIALIZED","TERMINATED","TERMINATION_FAILURE","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","STORE_BEFORE_INIT","STORE_AFTER_TERM","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","ARGUMENT_ERROR","CHILDREN_ERROR","COUNT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNDEFINED_DATA_MODEL","UNIMPLEMENTED_ELEMENT","VALUE_NOT_INITIALIZED","INVALID_SET_VALUE","READ_ONLY_ELEMENT","WRITE_ONLY_ELEMENT","TYPE_MISMATCH","VALUE_OUT_OF_RANGE","DEPENDENCY_NOT_ESTABLISHED","scorm12","scorm2004","MULTIPLE_TERMINATIONS","cmi_children","core_children","score_children","comments_children","objectives_children","correct_responses_children","student_data_children","student_preference_children","interactions_children","error_descriptions","basicMessage","detailMessage","SCORM_TRUE","SCORM_FALSE","STATE_NOT_INITIALIZED","STATE_INITIALIZED","STATE_TERMINATED","LOG_LEVEL_DEBUG","LOG_LEVEL_INFO","LOG_LEVEL_WARNING","LOG_LEVEL_ERROR","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","scorm12_errors","aicc_errors","scorm2004_errors","errorCode","toString","_errorCode","name","setMessage","message","Error","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","scorm12_error_codes","params","__children","children","_errorClass","errorClass","childArray","_children","_count","toJSON","SECONDS_PER_HOUR","designations","D","H","M","S","getSecondsAsISODuration","seconds","duration","remainder","designationsKey","current_seconds","Math","floor","countDecimals","Number","toFixed","indexOf","getDurationAsSeconds","durationRegex","RegExp","match","exec","years","days","hours","minutes","flatten","data","recurse","cur","prop","isArray","l","isEmpty","num","split","stringMatches","str","tester","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","status","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","warn","info","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","currentState","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","isTerminated","cmi","processListeners","apiLog","clearSCORMError","functionName","CMIElement","messageString","fillChars","j","formatMessage","terminate","checkTerminated","checkState","storeData","getValue","getCMIValue","handleValueAccessException","undefined","setValue","commitCallback","setCMIValue","scheduleCommit","clearScheduledCommit","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","_CMIElement","_value","_commonSetCMIValue","methodName","structure","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","idx","attribute","substring","_checkObjectHasProperty","validateCorrectResponse","CMIArray","index","parseInt","isNaN","item","newChild","getChildElement","initialized","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","on","listenerName","listenerFunctions","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","errorNumber","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","regex","m","unflatten","a_pattern","c_match","a_match","a_num","c_num","startingData","currentCMIElement","renderCMIToJSONString","stringify","k","renderCMIToJSONObject","processHttpRequest","url","immediate","api","genericError","performFetch","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","join","headers","credentials","keepalive","CMIString256","CMIString4096","CMITime","CMITimespan","CMIInteger","CMISInteger","CMIDecimal","CMIIdentifier","CMIFeedback","CMIIndex","CMIStatus","CMIStatus2","CMIExit","CMIType","CMIResult","NAVEvent","score_range","audio_range","speed_range","weighting_range","text_range","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVBoolean","NAVTarget","scaled_range","progress_range","checkValidFormat","regexPattern","allowEmptyString","formatRegex","matches","checkValidRange","rangePattern","ranges","check2004ValidFormat","Scorm2004ValidationError","check2004ValidRange","SuccessStatus","CompletionStatus","_audio_level","_language","_delivery_speed","_audio_captioning","audio_level","language","delivery_speed","audio_captioning","scorm2004_regex","LearnerResponses","format","max","delimiter","unique","choice","matching","format2","delimiter2","performance","sequencing","likert","numeric","other","CorrectResponses","duplicate","limit","delimiter3","_id","_type","_timestamp","_weighting","_learner_response","_result","_latency","_description","objectives","correct_responses","id","type","timestamp","weighting","learner_response","nodes","response_type","values","latency","description","_pattern","pattern","scorm12_constants","scorm12_regex","invalidTypeCode","invalidRangeCode","decimalRegex","_scaled","scaled","raw","min","_raw","_min","__score_range","_max","__invalid_error_code","__invalid_type_code","__invalid_range_code","__decimal_regex","__error_class","readOnlyAfterInit","_comment","_location","_readOnlyAfterInit","comment","location","_success_status","_completion_status","_progress_measure","score","Scorm2004CMIScore","success_status","completion_status","progress_measure","__version","_completion_threshold","_credit","_entry","_exit","_launch_data","_learner_id","_learner_name","_max_time_allowed","_mode","_scaled_passing_score","_session_time","_suspend_data","_time_limit_action","_total_time","learner_preference","CMILearnerPreference","comments_from_learner","CMICommentsFromLearner","comments_from_lms","CMICommentsFromLMS","interactions","CMIInteractions","CMIObjectives","_version","completion_threshold","credit","entry","exit","launch_data","learner_id","learner_name","max_time_allowed","mode","scaled_passing_score","session_time","suspend_data","time_limit_action","total_time","getCurrentTotalTime","sessionTime","startTime","start_time","first","second","BaseRootCMI","nav","ADLNav","_request","request_valid","ADLNavRequestValid","request","_continue","_previous","_choice","_jump","jump","previous","continue","mastery_override","CMI","adl","ADL","Initialize","lmsInitialize","Terminate","lmsFinish","GetValue","lmsGetValue","SetValue","lmsSetValue","Commit","lmsCommit","GetLastError","lmsGetLastError","GetErrorString","lmsGetErrorString","GetDiagnostic","lmsGetDiagnostic","reset","internalFinish","navActions","exitAll","abandon","abandonAll","choiceJumpRegex","action","adlNavRequestRegex","includes","CMIObjectivesObject","createCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","CMICommentsObject","parts","interaction","checkDuplicateChoiceResponse","checkValidResponseType","CMIInteractionsCorrectResponsesObject","interaction_type","checkCorrectResponseValue","interaction_count","pattern_index","checkDuplicatedPattern","detail","correct_response","current_index","found","count","removeCorrectResponsePrefixes","node","seenOrder","seenCase","seenLang","prefixRegex","langMatches","lang","toLowerCase","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeSeconds","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","navRequest","encodeURIComponent","shouldTerminateCommit","Function","window","Scorm2004API"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"scorm2004.min.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,eAAiBD,IAEzBD,EAAK,eAAiBC,GACvB,CATD,CASGK,MAAM,WACT,O,6ICJO,IAAMC,EAA4B,CACvCC,YAAY,EACZC,kBAAmB,GACnBC,aAAa,EACbC,gBAAgB,EAChBC,cAAc,E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AAKghB,aACnBC,kBAAmBjhB,KAAKihB,mBAG1B,cADOjhB,KAAK4M,WACLrO,CACT,EACF,EAtkBA,CAAyB,KCyXzB,EAzYiC,CAC/B,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,O,QC7XF,cAIE,aACE,QAAK,YAAE,K,OACP,EAAKgjB,IAAM,IAAIC,E,CACjB,CA8BF,OArCyB,aAcvB,YAAAlgB,WAAA,W,MACE,YAAMA,WAAU,WACR,QAAR,EAAAtB,KAAKuhB,WAAG,SAAEjgB,YACZ,EAUA,YAAAqL,OAAA,WAGE3M,KAAK4M,YAAa,EAClB,IAAMrO,EAAS,CACbgjB,IAAKvhB,KAAKuhB,KAGZ,cADOvhB,KAAK4M,WACLrO,CACT,EACF,EArCA,CAAyB,KA2CzB,cAME,aACE,QAAK,YAAE,K,OAND,EAAAkjB,SAAW,SAOjB,EAAKC,cAAgB,IAAIC,E,CAC3B,CAiDF,OA1D4B,aAgB1B,YAAArgB,WAAA,W,MACE,YAAMA,W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ack://scorm-again/./src/helpers/scheduled_commit.ts","webpack://scorm-again/./src/BaseAPI.ts","webpack://scorm-again/./src/utilities/debounce.ts","webpack://scorm-again/./src/cmi/common/array.ts","webpack://scorm-again/./src/cmi/common/base_cmi.ts","webpack://scorm-again/./src/cmi/common/score.ts","webpack://scorm-again/./src/cmi/common/validation.ts","webpack://scorm-again/./src/constants/api_constants.ts","webpack://scorm-again/./src/constants/enums.ts","webpack://scorm-again/./src/constants/error_codes.ts","webpack://scorm-again/./src/constants/regex.ts","webpack://scorm-again/./src/exceptions.ts","webpack://scorm-again/./src/utilities.ts","webpack://scorm-again/./node_modules/tslib/tslib.es6.mjs","webpack://scorm-again/webpack/bootstrap","webpack://scorm-again/webpack/runtime/define property getters","webpack://scorm-again/webpack/runtime/hasOwnProperty shorthand","webpack://scorm-again/webpack/runtime/make namespace object","webpack://scorm-again/./src/cmi/scorm2004/validation.ts","webpack://scorm-again/./src/cmi/scorm2004/learner_preference.ts","webpack://scorm-again/./src/constants/response_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/interactions.ts","webpack://scorm-again/./src/cmi/scorm2004/score.ts","webpack://scorm-again/./src/cmi/scorm2004/comments.ts","webpack://scorm-again/./src/cmi/scorm2004/objectives.ts","webpack://scorm-again/./src/cmi/scorm2004/cmi.ts","webpack://scorm-again/./src/constants/language_constants.ts","webpack://scorm-again/./src/cmi/scorm2004/adl.ts","webpack://scorm-again/./src/Scorm2004API.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"scorm-again\"] = factory();\n\telse\n\t\troot[\"scorm-again\"] = factory();\n})(self, function() {\nreturn ","import { ResultObject, Settings } from \"../types/api_types\";\nimport APIConstants from \"./api_constants\";\n\n/**\n * Default settings for the SCORM API\n */\nexport const DefaultSettings: Settings = {\n autocommit: false,\n autocommitSeconds: 10,\n asyncCommit: false,\n sendFullCommit: true,\n lmsCommitUrl: false,\n dataCommitFormat: \"json\",\n commitRequestDataType: \"application/json;charset=UTF-8\",\n autoProgress: false,\n logLevel: APIConstants.global.LOG_LEVEL_ERROR,\n selfReportSessionTime: false,\n alwaysSendTotalTime: false,\n renderCommonCommitFields: false,\n strict_errors: true,\n xhrHeaders: {},\n xhrWithCredentials: false,\n responseHandler: async function (response: Response): Promise {\n if (typeof response !== \"undefined\") {\n const httpResult = JSON.parse(await response.text());\n if (\n httpResult === null ||\n !{}.hasOwnProperty.call(httpResult, \"result\")\n ) {\n if (response.status === 200) {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n }\n } else {\n return {\n result: httpResult.result,\n errorCode: httpResult.errorCode\n ? httpResult.errorCode\n : httpResult.result === APIConstants.global.SCORM_TRUE\n ? 0\n : 101,\n };\n }\n }\n return {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: 101,\n };\n },\n requestHandler: function (commitObject) {\n return commitObject;\n },\n onLogMessage: function (messageLevel, logMessage) {\n switch (messageLevel) {\n case APIConstants.global.LOG_LEVEL_ERROR:\n console.error(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_WARNING:\n console.warn(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_INFO:\n console.info(logMessage);\n break;\n case APIConstants.global.LOG_LEVEL_DEBUG:\n if (console.debug) {\n console.debug(logMessage);\n } else {\n console.log(logMessage);\n }\n break;\n }\n },\n scoItemIds: [],\n scoItemIdValidator: false,\n};\n","import BaseAPI from \"../BaseAPI\";\n\n/**\n * Private class that wraps a timeout call to the commit() function\n */\nexport class ScheduledCommit {\n private _API;\n private _cancelled = false;\n private readonly _timeout;\n private readonly _callback;\n\n /**\n * Constructor for ScheduledCommit\n * @param {BaseAPI} API\n * @param {number} when\n * @param {string} callback\n */\n constructor(API: BaseAPI, when: number, callback: string) {\n this._API = API;\n this._timeout = setTimeout(this.wrapper.bind(this), when);\n this._callback = callback;\n }\n\n /**\n * Cancel any currently scheduled commit\n */\n cancel() {\n this._cancelled = true;\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n }\n\n /**\n * Wrap the API commit call to check if the call has already been cancelled\n */\n wrapper() {\n if (!this._cancelled) {\n (async () => await this._API.commit(this._callback))();\n }\n }\n}\n","import { CMIArray } from \"./cmi/common/array\";\nimport { ValidationError } from \"./exceptions\";\nimport ErrorCodes, { ErrorCode } from \"./constants/error_codes\";\nimport APIConstants from \"./constants/api_constants\";\nimport { formatMessage, stringMatches, unflatten } from \"./utilities\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport { debounce } from \"./utilities/debounce\";\nimport {\n RefObject,\n CommitObject,\n ResultObject,\n Settings,\n} from \"./types/api_types\";\nimport { DefaultSettings } from \"./constants/default_settings\";\nimport { IBaseAPI } from \"./interfaces/IBaseAPI\";\nimport { ScheduledCommit } from \"./helpers/scheduled_commit\";\n\n/**\n * Base API class for AICC, SCORM 1.2, and SCORM 2004. Should be considered\n * abstract, and never initialized on its own.\n */\nexport default abstract class BaseAPI implements IBaseAPI {\n private _timeout?: ScheduledCommit;\n private readonly _error_codes: ErrorCode;\n private _settings: Settings = DefaultSettings;\n\n /**\n * Constructor for Base API class. Sets some shared API fields, as well as\n * sets up options for the API.\n * @param {ErrorCode} error_codes\n * @param {Settings} settings\n */\n protected constructor(error_codes: ErrorCode, settings?: Settings) {\n if (new.target === BaseAPI) {\n throw new TypeError(\"Cannot construct BaseAPI instances directly\");\n }\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n\n this._error_codes = error_codes;\n\n if (settings) {\n this.settings = settings;\n }\n this.apiLogLevel = this.settings.logLevel;\n this.selfReportSessionTime = this.settings.selfReportSessionTime;\n }\n\n public abstract cmi: BaseCMI;\n public startingData?: RefObject;\n\n public currentState: number;\n public lastErrorCode: string;\n public listenerArray: any[];\n public apiLogLevel: number;\n public selfReportSessionTime: boolean;\n\n abstract reset(settings?: Settings): void;\n\n /**\n * Common reset method for all APIs. New settings are merged with the existing settings.\n * @param {Settings} settings\n * @protected\n */\n commonReset(settings?: Settings): void {\n this.settings = { ...this.settings, ...settings };\n\n this.currentState = APIConstants.global.STATE_NOT_INITIALIZED;\n this.lastErrorCode = \"0\";\n this.listenerArray = [];\n }\n\n /**\n * Initialize the API\n * @param {string} callbackName\n * @param {string} initializeMessage\n * @param {string} terminationMessage\n * @return {string}\n */\n initialize(\n callbackName: string,\n initializeMessage?: string,\n terminationMessage?: string,\n ): string {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.INITIALIZED, initializeMessage);\n } else if (this.isTerminated()) {\n this.throwSCORMError(this._error_codes.TERMINATED, terminationMessage);\n } else {\n if (this.selfReportSessionTime) {\n this.cmi.setStartTime();\n }\n\n this.currentState = APIConstants.global.STATE_INITIALIZED;\n this.lastErrorCode = \"0\";\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n abstract lmsInitialize(): string;\n\n abstract lmsFinish(): string;\n\n abstract lmsGetValue(CMIElement: string): string;\n\n abstract lmsSetValue(CMIElement: string, value: any): string;\n\n abstract lmsCommit(): string;\n\n abstract lmsGetLastError(): string;\n\n abstract lmsGetErrorString(CMIErrorCode: string | number): string;\n\n abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;\n\n /**\n * Abstract method for validating that a response is correct.\n *\n * @param {string} _CMIElement\n * @param {any} _value\n */\n abstract validateCorrectResponse(_CMIElement: string, _value: any): void;\n\n /**\n * Gets or builds a new child element to add to the array.\n * APIs that inherit BaseAPI should override this method.\n *\n * @param {string} _CMIElement - unused\n * @param {*} _value - unused\n * @param {boolean} _foundFirstIndex - unused\n * @return {BaseCMI|null}\n * @abstract\n */\n abstract getChildElement(\n _CMIElement: string,\n _value: any,\n _foundFirstIndex: boolean,\n ): BaseCMI | null;\n\n /**\n * Attempts to store the data to the LMS, logs data if no LMS configured\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _calculateTotalTime\n * @return {ResultObject}\n * @abstract\n */\n abstract storeData(_calculateTotalTime: boolean): Promise;\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * APIs that inherit BaseAPI should override this function\n *\n * @param {boolean} _terminateCommit\n * @return {RefObject|Array}\n * @abstract\n */\n abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array;\n\n /**\n * Render the commit object to the shortened format for LMS commit\n * @param {boolean} _terminateCommit\n * @return {CommitObject}\n */\n abstract renderCommitObject(_terminateCommit: boolean): CommitObject;\n\n /**\n * Logging for all SCORM actions\n *\n * @param {string} functionName\n * @param {string} logMessage\n * @param {number} messageLevel\n * @param {string} CMIElement\n */\n apiLog(\n functionName: string,\n logMessage: string,\n messageLevel: number,\n CMIElement?: string,\n ) {\n logMessage = formatMessage(functionName, logMessage, CMIElement);\n\n if (messageLevel >= this.apiLogLevel) {\n this.settings.onLogMessage(messageLevel, logMessage);\n }\n }\n\n /**\n * Getter for _error_codes\n * @return {ErrorCode}\n */\n get error_codes(): ErrorCode {\n return this._error_codes;\n }\n\n /**\n * Getter for _settings\n * @return {Settings}\n */\n get settings(): Settings {\n return this._settings;\n }\n\n /**\n * Setter for _settings\n * @param {Settings} settings\n */\n set settings(settings: Settings) {\n this._settings = { ...this._settings, ...settings };\n }\n\n /**\n * Terminates the current run of the API\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async terminate(\n callbackName: string,\n checkTerminated: boolean,\n ): Promise {\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.TERMINATION_BEFORE_INIT,\n this._error_codes.MULTIPLE_TERMINATION,\n )\n ) {\n this.currentState = APIConstants.global.STATE_TERMINATED;\n\n const result: ResultObject = await this.storeData(true);\n if (typeof result.errorCode !== \"undefined\" && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n returnValue = APIConstants.global.SCORM_TRUE;\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Get the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @return {string}\n */\n getValue(\n callbackName: string,\n checkTerminated: boolean,\n CMIElement: string,\n ): string {\n let returnValue: string = \"\";\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.RETRIEVE_BEFORE_INIT,\n this._error_codes.RETRIEVE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.getCMIValue(CMIElement);\n } catch (e) {\n returnValue = this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement);\n }\n\n this.apiLog(\n callbackName,\n \": returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n\n if (returnValue === undefined) {\n return \"\";\n }\n\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Sets the value of the CMIElement.\n *\n * @param {string} callbackName\n * @param {string} commitCallback\n * @param {boolean} checkTerminated\n * @param {string} CMIElement\n * @param {*} value\n * @return {string}\n */\n setValue(\n callbackName: string,\n commitCallback: string,\n checkTerminated: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (value !== undefined) {\n value = String(value);\n }\n let returnValue: string = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.STORE_BEFORE_INIT,\n this._error_codes.STORE_AFTER_TERM,\n )\n ) {\n if (checkTerminated) this.lastErrorCode = \"0\";\n try {\n returnValue = this.setCMIValue(CMIElement, value);\n } catch (e) {\n this.handleValueAccessException(e, returnValue);\n }\n this.processListeners(callbackName, CMIElement, value);\n }\n\n if (returnValue === undefined) {\n returnValue = APIConstants.global.SCORM_FALSE;\n }\n\n // If we didn't have any errors while setting the data, go ahead and\n // schedule a commit, if autocommit is turned on\n if (String(this.lastErrorCode) === \"0\") {\n if (this.settings.autocommit && !this._timeout) {\n this.scheduleCommit(\n this.settings.autocommitSeconds * 1000,\n commitCallback,\n );\n }\n }\n\n this.apiLog(\n callbackName,\n \": \" + value + \": result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Orders LMS to store all content parameters\n * @param {string} callbackName\n * @param {boolean} checkTerminated\n * @return {string}\n */\n async commit(\n callbackName: string,\n checkTerminated: boolean = false,\n ): Promise {\n this.clearScheduledCommit();\n\n let returnValue = APIConstants.global.SCORM_FALSE;\n\n if (\n this.checkState(\n checkTerminated,\n this._error_codes.COMMIT_BEFORE_INIT,\n this._error_codes.COMMIT_AFTER_TERM,\n )\n ) {\n const result = await this.storeData(false);\n if (result.errorCode && result.errorCode > 0) {\n this.throwSCORMError(result.errorCode);\n }\n returnValue =\n typeof result !== \"undefined\" && result.result\n ? result.result\n : APIConstants.global.SCORM_FALSE;\n\n this.apiLog(\n callbackName,\n \" Result: \" + returnValue,\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"HttpRequest\",\n );\n\n if (checkTerminated) this.lastErrorCode = \"0\";\n\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n this.clearSCORMError(returnValue);\n\n return returnValue;\n }\n\n /**\n * Returns last error code\n * @param {string} callbackName\n * @return {string}\n */\n getLastError(callbackName: string): string {\n const returnValue = String(this.lastErrorCode);\n\n this.processListeners(callbackName);\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getErrorString(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {string} callbackName\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n getDiagnostic(callbackName: string, CMIErrorCode: string | number): string {\n let returnValue = \"\";\n\n if (CMIErrorCode !== null && CMIErrorCode !== \"\") {\n returnValue = this.getLmsErrorMessageDetails(CMIErrorCode, true);\n this.processListeners(callbackName);\n }\n\n this.apiLog(\n callbackName,\n \"returned: \" + returnValue,\n APIConstants.global.LOG_LEVEL_INFO,\n );\n\n return returnValue;\n }\n\n /**\n * Checks the LMS state and ensures it has been initialized.\n *\n * @param {boolean} checkTerminated\n * @param {number} beforeInitError\n * @param {number} afterTermError\n * @return {boolean}\n */\n checkState(\n checkTerminated: boolean,\n beforeInitError: number,\n afterTermError: number,\n ): boolean {\n if (this.isNotInitialized()) {\n this.throwSCORMError(beforeInitError);\n return false;\n } else if (checkTerminated && this.isTerminated()) {\n this.throwSCORMError(afterTermError);\n return false;\n }\n\n return true;\n }\n\n /**\n * Returns the message that corresponds to errorNumber\n * APIs that inherit BaseAPI should override this function\n *\n * @param {(string|number)} _errorNumber\n * @param {boolean} _detail\n * @return {string}\n * @abstract\n */\n getLmsErrorMessageDetails(\n _errorNumber: string | number,\n _detail: boolean = false,\n ): string {\n throw new Error(\n \"The getLmsErrorMessageDetails method has not been implemented\",\n );\n }\n\n /**\n * Gets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @return {string}\n * @abstract\n */\n getCMIValue(_CMIElement: string): string {\n throw new Error(\"The getCMIValue method has not been implemented\");\n }\n\n /**\n * Sets the value for the specific element.\n * APIs that inherit BaseAPI should override this function\n *\n * @param {string} _CMIElement\n * @param {any} _value\n * @return {string}\n * @abstract\n */\n setCMIValue(_CMIElement: string, _value: any): string {\n throw new Error(\"The setCMIValue method has not been implemented\");\n }\n\n /**\n * Shared API method to set a valid for a given element.\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n _commonSetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n value: any,\n ): string {\n if (!CMIElement || CMIElement === \"\") {\n return APIConstants.global.SCORM_FALSE;\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let returnValue = APIConstants.global.SCORM_FALSE;\n let foundFirstIndex = false;\n\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n const attribute = structure[idx];\n\n if (idx === structure.length - 1) {\n if (scorm2004 && attribute.substring(0, 8) === \"{target=\") {\n if (this.isInitialized()) {\n this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT);\n } else {\n refObject = {\n ...refObject,\n attribute: value,\n };\n }\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (\n stringMatches(CMIElement, \"\\\\.correct_responses\\\\.\\\\d+\") &&\n this.isInitialized()\n ) {\n this.validateCorrectResponse(CMIElement, value);\n }\n\n if (!scorm2004 || this.lastErrorCode === \"0\") {\n refObject[attribute] = value;\n returnValue = APIConstants.global.SCORM_TRUE;\n }\n }\n } else {\n refObject = refObject[attribute];\n if (!refObject) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n foundFirstIndex = true;\n } else {\n const newChild = this.getChildElement(\n CMIElement,\n value,\n foundFirstIndex,\n );\n foundFirstIndex = true;\n\n if (!newChild) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n } else {\n if (refObject.initialized) newChild.initialize();\n\n refObject.childArray.push(newChild);\n refObject = newChild;\n }\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n }\n\n if (returnValue === APIConstants.global.SCORM_FALSE) {\n this.apiLog(\n methodName,\n `There was an error setting the value for: ${CMIElement}, value of: ${value}`,\n APIConstants.global.LOG_LEVEL_WARNING,\n );\n }\n\n return returnValue;\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} methodName\n * @param {boolean} scorm2004\n * @param {string} CMIElement\n * @return {any}\n */\n _commonGetCMIValue(\n methodName: string,\n scorm2004: boolean,\n CMIElement: string,\n ): any {\n if (!CMIElement || CMIElement === \"\") {\n return \"\";\n }\n\n const structure = CMIElement.split(\".\");\n let refObject: RefObject = this;\n let attribute = null;\n\n const uninitializedErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) has not been initialized.`;\n const invalidErrorMessage = `The data model element passed to ${methodName} (${CMIElement}) is not a valid SCORM data model element.`;\n const invalidErrorCode = scorm2004\n ? this._error_codes.UNDEFINED_DATA_MODEL\n : this._error_codes.GENERAL;\n\n for (let idx = 0; idx < structure.length; idx++) {\n attribute = structure[idx];\n\n if (!scorm2004) {\n if (idx === structure.length - 1) {\n if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n } else {\n if (\n String(attribute).substring(0, 8) === \"{target=\" &&\n typeof refObject._isTargetValid == \"function\"\n ) {\n const target = String(attribute).substring(\n 8,\n String(attribute).length - 9,\n );\n return refObject._isTargetValid(target);\n } else if (!this._checkObjectHasProperty(refObject, attribute)) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n return;\n }\n }\n\n refObject = refObject[attribute];\n if (refObject === undefined) {\n this.throwSCORMError(invalidErrorCode, invalidErrorMessage);\n break;\n }\n\n if (refObject instanceof CMIArray) {\n const index = parseInt(structure[idx + 1], 10);\n\n // SCO is trying to set an item on an array\n if (!isNaN(index)) {\n const item = refObject.childArray[index];\n\n if (item) {\n refObject = item;\n } else {\n this.throwSCORMError(\n this._error_codes.VALUE_NOT_INITIALIZED,\n uninitializedErrorMessage,\n );\n break;\n }\n\n // Have to update idx value to skip the array position\n idx++;\n }\n }\n }\n\n if (refObject === null || refObject === undefined) {\n if (!scorm2004) {\n if (attribute === \"_children\") {\n this.throwSCORMError(ErrorCodes.scorm12.CHILDREN_ERROR);\n } else if (attribute === \"_count\") {\n this.throwSCORMError(ErrorCodes.scorm12.COUNT_ERROR);\n }\n }\n } else {\n return refObject;\n }\n }\n\n /**\n * Returns true if the API's current state is STATE_INITIALIZED\n *\n * @return {boolean}\n */\n isInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_NOT_INITIALIZED\n *\n * @return {boolean}\n */\n isNotInitialized(): boolean {\n return this.currentState === APIConstants.global.STATE_NOT_INITIALIZED;\n }\n\n /**\n * Returns true if the API's current state is STATE_TERMINATED\n *\n * @return {boolean}\n */\n isTerminated(): boolean {\n return this.currentState === APIConstants.global.STATE_TERMINATED;\n }\n\n /**\n * Provides a mechanism for attaching to a specific SCORM event\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n on(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback,\n });\n\n this.apiLog(\n \"on\",\n `Added event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n\n /**\n * Provides a mechanism for detaching a specific SCORM event listener\n *\n * @param {string} listenerName\n * @param {function} callback\n */\n off(listenerName: string, callback: Function) {\n if (!callback) return;\n\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n const removeIndex = this.listenerArray.findIndex(\n (obj) =>\n obj.functionName === functionName &&\n obj.CMIElement === CMIElement &&\n obj.callback === callback,\n );\n if (removeIndex !== -1) {\n this.listenerArray.splice(removeIndex, 1);\n this.apiLog(\n \"off\",\n `Removed event listener: ${this.listenerArray.length}`,\n APIConstants.global.LOG_LEVEL_INFO,\n functionName,\n );\n }\n }\n }\n\n /**\n * Provides a mechanism for clearing all listeners from a specific SCORM event\n *\n * @param {string} listenerName\n */\n clear(listenerName: string) {\n const listenerFunctions = listenerName.split(\" \");\n for (let i = 0; i < listenerFunctions.length; i++) {\n const listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n const functionName = listenerSplit[0];\n\n let CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerName.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray = this.listenerArray.filter(\n (obj) =>\n obj.functionName !== functionName && obj.CMIElement !== CMIElement,\n );\n }\n }\n\n /**\n * Processes any 'on' listeners that have been created\n *\n * @param {string} functionName\n * @param {string} CMIElement\n * @param {any} value\n */\n processListeners(functionName: string, CMIElement?: string, value?: any) {\n this.apiLog(\n functionName,\n value,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n for (let i = 0; i < this.listenerArray.length; i++) {\n const listener = this.listenerArray[i];\n const functionsMatch = listener.functionName === functionName;\n const listenerHasCMIElement = !!listener.CMIElement;\n let CMIElementsMatch = false;\n if (\n CMIElement &&\n listener.CMIElement &&\n listener.CMIElement.substring(listener.CMIElement.length - 1) === \"*\"\n ) {\n CMIElementsMatch =\n CMIElement.indexOf(\n listener.CMIElement.substring(0, listener.CMIElement.length - 1),\n ) === 0;\n } else {\n CMIElementsMatch = listener.CMIElement === CMIElement;\n }\n\n if (functionsMatch && (!listenerHasCMIElement || CMIElementsMatch)) {\n this.apiLog(\n \"processListeners\",\n `Processing listener: ${listener.functionName}`,\n APIConstants.global.LOG_LEVEL_INFO,\n CMIElement,\n );\n listener.callback(CMIElement, value);\n }\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} errorNumber\n * @param {string} message\n */\n throwSCORMError(errorNumber: number, message?: string) {\n if (!message) {\n message = this.getLmsErrorMessageDetails(errorNumber);\n }\n\n this.apiLog(\n \"throwSCORMError\",\n errorNumber + \": \" + message,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n\n this.lastErrorCode = String(errorNumber);\n }\n\n /**\n * Clears the last SCORM error code on success.\n *\n * @param {string} success\n */\n clearSCORMError(success: string) {\n if (success !== undefined && success !== APIConstants.global.SCORM_FALSE) {\n this.lastErrorCode = \"0\";\n }\n }\n\n /**\n * Load the CMI from a flattened JSON object\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromFlattenedJSON(json: RefObject, CMIElement?: string) {\n if (!CMIElement) {\n // by default, we start from a blank string because we're expecting each element to start with `cmi`\n CMIElement = \"\";\n }\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromFlattenedJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n /**\n * Tests two strings against a given regular expression pattern and determines a numeric or null result based on the matching criterion.\n *\n * @param {string} a - The first string to be tested against the pattern.\n * @param {string} c - The second string to be tested against the pattern.\n * @param {RegExp} a_pattern - The regular expression pattern to test the strings against.\n * @return {number | null} A numeric result based on the matching criterion, or null if the strings do not match the pattern.\n */\n function testPattern(\n a: string,\n c: string,\n a_pattern: RegExp,\n ): number | null {\n const a_match = a.match(a_pattern);\n\n let c_match;\n if (a_match !== null && (c_match = c.match(a_pattern)) !== null) {\n const a_num = Number(a_match[2]);\n const c_num = Number(c_match[2]);\n if (a_num === c_num) {\n if (a_match[3] === \"id\") {\n return -1;\n } else if (a_match[3] === \"type\") {\n if (c_match[3] === \"id\") {\n return 1;\n } else {\n return -1;\n }\n } else {\n return 1;\n }\n }\n return a_num - c_num;\n }\n\n return null;\n }\n\n const int_pattern = /^(cmi\\.interactions\\.)(\\d+)\\.(.*)$/;\n const obj_pattern = /^(cmi\\.objectives\\.)(\\d+)\\.(.*)$/;\n\n const result = Object.keys(json).map(function (key) {\n return [String(key), json[key]];\n });\n\n // CMI interactions need to have id and type loaded before any other fields\n result.sort(function ([a, _b], [c, _d]) {\n let test;\n if ((test = testPattern(a, c, int_pattern)) !== null) {\n return test;\n }\n if ((test = testPattern(a, c, obj_pattern)) !== null) {\n return test;\n }\n\n if (a < c) {\n return -1;\n }\n if (a > c) {\n return 1;\n }\n return 0;\n });\n\n let obj: RefObject;\n result.forEach((element) => {\n obj = {};\n obj[element[0]] = element[1];\n this.loadFromJSON(unflatten(obj), CMIElement);\n });\n }\n\n /**\n * Loads CMI data from a JSON object.\n *\n * @param {RefObject} json\n * @param {string} CMIElement\n */\n loadFromJSON(json: RefObject, CMIElement: string) {\n if (!this.isNotInitialized()) {\n console.error(\n \"loadFromJSON can only be called before the call to lmsInitialize.\",\n );\n return;\n }\n\n CMIElement = CMIElement !== undefined ? CMIElement : \"cmi\";\n\n this.startingData = json;\n\n // could this be refactored down to flatten(json) then setCMIValue on each?\n for (const key in json) {\n if ({}.hasOwnProperty.call(json, key) && json[key]) {\n const currentCMIElement = (CMIElement ? CMIElement + \".\" : \"\") + key;\n const value = json[key];\n\n if (value[\"childArray\"]) {\n for (let i = 0; i < value[\"childArray\"].length; i++) {\n this.loadFromJSON(\n value[\"childArray\"][i],\n currentCMIElement + \".\" + i,\n );\n }\n } else if (value.constructor === Object) {\n this.loadFromJSON(value, currentCMIElement);\n } else {\n this.setCMIValue(currentCMIElement, value);\n }\n }\n }\n }\n\n /**\n * Render the CMI object to JSON for sending to an LMS.\n *\n * @return {string}\n */\n renderCMIToJSONString(): string {\n const cmi = this.cmi;\n // Do we want/need to return fields that have no set value?\n if (this.settings.sendFullCommit) {\n return JSON.stringify({ cmi });\n }\n return JSON.stringify({ cmi }, (k, v) => (v === undefined ? null : v), 2);\n }\n\n /**\n * Returns a JS object representing the current cmi\n * @return {object}\n */\n renderCMIToJSONObject(): object {\n return JSON.parse(this.renderCMIToJSONString());\n }\n\n /**\n * Send the request to the LMS\n * @param {string} url\n * @param {CommitObject|RefObject|Array} params\n * @param {boolean} immediate\n * @return {ResultObject}\n */\n async processHttpRequest(\n url: string,\n params: CommitObject | RefObject | Array,\n immediate: boolean = false,\n ): Promise {\n const api = this;\n const genericError: ResultObject = {\n result: APIConstants.global.SCORM_FALSE,\n errorCode: this.error_codes.GENERAL,\n };\n\n // if we are terminating the module or closing the browser window/tab, we need to make this fetch ASAP.\n // Some browsers, especially Chrome, do not like synchronous requests to be made when the window is closing.\n if (immediate) {\n this.performFetch(url, params).then(async (response) => {\n await this.transformResponse(response);\n });\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n\n const process = async (\n url: string,\n params: CommitObject | RefObject | Array,\n settings: Settings,\n ): Promise => {\n try {\n params = settings.requestHandler(params);\n const response = await this.performFetch(url, params);\n\n return this.transformResponse(response);\n } catch (e) {\n this.apiLog(\n \"processHttpRequest\",\n e,\n APIConstants.global.LOG_LEVEL_ERROR,\n );\n api.processListeners(\"CommitError\");\n return genericError;\n }\n };\n\n if (this.settings.asyncCommit) {\n const debouncedProcess = debounce(process, 500, immediate);\n debouncedProcess(url, params, this.settings);\n\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n } else {\n return await process(url, params, this.settings);\n }\n }\n\n /**\n * Throws a SCORM error\n *\n * @param {number} when - the number of milliseconds to wait before committing\n * @param {string} callback - the name of the commit event callback\n */\n scheduleCommit(when: number, callback: string) {\n this._timeout = new ScheduledCommit(this, when, callback);\n this.apiLog(\n \"scheduleCommit\",\n \"scheduled\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n\n /**\n * Clears and cancels any currently scheduled commits\n */\n clearScheduledCommit() {\n if (this._timeout) {\n this._timeout.cancel();\n this._timeout = undefined;\n this.apiLog(\n \"clearScheduledCommit\",\n \"cleared\",\n APIConstants.global.LOG_LEVEL_DEBUG,\n \"\",\n );\n }\n }\n\n /**\n * Check to see if the specific object has the given property\n * @param {RefObject} refObject\n * @param {string} attribute\n * @return {boolean}\n * @private\n */\n private _checkObjectHasProperty(\n refObject: RefObject,\n attribute: string,\n ): boolean {\n return (\n Object.hasOwnProperty.call(refObject, attribute) ||\n Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(refObject),\n attribute,\n ) != null ||\n attribute in refObject\n );\n }\n\n /**\n * Handles the error that occurs when trying to access a value\n * @param {any} e\n * @param {string} returnValue\n * @return {string}\n * @private\n */\n private handleValueAccessException(e: any, returnValue: string): string {\n if (e instanceof ValidationError) {\n this.lastErrorCode = String(e.errorCode);\n returnValue = APIConstants.global.SCORM_FALSE;\n } else {\n if (e instanceof Error && e.message) {\n console.error(e.message);\n } else {\n console.error(e);\n }\n this.throwSCORMError(this._error_codes.GENERAL);\n }\n return returnValue;\n }\n\n /**\n * Perform the fetch request to the LMS\n * @param {string} url\n * @param {RefObject|Array} params\n * @return {Promise}\n * @private\n */\n private async performFetch(\n url: string,\n params: RefObject | Array,\n ): Promise {\n return fetch(url, {\n method: \"POST\",\n body: params instanceof Array ? params.join(\"&\") : JSON.stringify(params),\n headers: {\n ...this.settings.xhrHeaders,\n \"Content-Type\": this.settings.commitRequestDataType,\n },\n credentials: this.settings.xhrWithCredentials ? \"include\" : undefined,\n keepalive: true,\n });\n }\n\n /**\n * Transforms the response from the LMS to a ResultObject\n * @param {Response} response\n * @return {Promise}\n * @private\n */\n private async transformResponse(response: Response): Promise {\n const result =\n typeof this.settings.responseHandler === \"function\"\n ? await this.settings.responseHandler(response)\n : await response.json();\n\n if (\n response.status >= 200 &&\n response.status <= 299 &&\n (result.result === true ||\n result.result === APIConstants.global.SCORM_TRUE)\n ) {\n this.processListeners(\"CommitSuccess\");\n } else {\n this.processListeners(\"CommitError\");\n }\n return result;\n }\n}\n","/**\n * Debounce function to delay the execution of a given function.\n *\n * @param func - The function to debounce.\n * @param wait - The number of milliseconds to delay.\n * @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.\n * @returns A debounced version of the provided function.\n */\nexport function debounce void>(\n func: T,\n wait: number,\n immediate = false,\n): (...args: Parameters) => void {\n let timeout: ReturnType | null;\n\n return function (this: any, ...args: Parameters) {\n const context = this;\n\n const later = () => {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n const callNow = immediate && !timeout;\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) func.apply(context, args);\n };\n}\n","import { BaseCMI } from \"./base_cmi\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.n objects\n */\nexport class CMIArray extends BaseCMI {\n private readonly _errorCode: number;\n private readonly _errorClass: typeof BaseScormValidationError;\n private readonly __children: string;\n childArray: any[];\n\n /**\n * Constructor cmi *.n arrays\n * @param {object} params\n */\n constructor(params: {\n children: string;\n errorCode?: number;\n errorClass?: typeof BaseScormValidationError;\n }) {\n super();\n this.__children = params.children;\n this._errorCode = params.errorCode || scorm12_error_codes.GENERAL;\n this._errorClass = params.errorClass || BaseScormValidationError;\n this.childArray = [];\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * Getter for _count\n * @return {number}\n */\n get _count(): number {\n return this.childArray.length;\n }\n\n /**\n * Setter for _count. Just throws an error.\n * @param {number} _count\n */\n set _count(_count: number) {\n throw new this._errorClass(this._errorCode);\n }\n\n /**\n * toJSON for *.n arrays\n * @return {object}\n */\n toJSON(): object {\n this.jsonString = true;\n const result: { [key: string]: any } = {};\n for (let i = 0; i < this.childArray.length; i++) {\n result[i + \"\"] = this.childArray[i];\n }\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Base class for API cmi objects\n */\nexport abstract class BaseCMI {\n jsonString? = false;\n private _initialized = false;\n private _start_time: number | undefined;\n\n /**\n * Getter for _initialized\n * @return {boolean}\n */\n get initialized(): boolean {\n return this._initialized;\n }\n\n /**\n * Getter for _start_time\n * @return {number | undefined}\n */\n get start_time(): number | undefined {\n return this._start_time;\n }\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize(): void {\n this._initialized = true;\n }\n\n /**\n * Called when the player should override the 'session_time' provided by\n * the module\n */\n setStartTime(): void {\n this._start_time = new Date().getTime();\n }\n}\n\n/**\n * Base class for cmi root objects\n */\nexport abstract class BaseRootCMI extends BaseCMI {\n abstract getCurrentTotalTime(): string;\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport { BaseCMI } from \"./base_cmi\";\nimport { checkValidFormat, checkValidRange } from \"./validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { BaseScormValidationError } from \"../../exceptions\";\n\nconst scorm12_constants = APIConstants.scorm12;\nconst scorm12_regex = Regex.scorm12;\nexport const scorm12_error_codes = ErrorCodes.scorm12;\n\n/**\n * Base class for cmi *.score objects\n */\nexport class CMIScore extends BaseCMI {\n private readonly __children: string;\n private readonly __score_range: string | false;\n private readonly __invalid_error_code: number;\n private readonly __invalid_type_code: number;\n private readonly __invalid_range_code: number;\n private readonly __decimal_regex: string;\n private readonly __error_class: typeof BaseScormValidationError;\n private _raw = \"\";\n private _min = \"\";\n private _max: string;\n\n /**\n * Constructor for *.score\n * @param {\n * score_children: string,\n * score_range: string,\n * max: string,\n * invalidErrorCode: number,\n * invalidTypeCode: number,\n * invalidRangeCode: number,\n * decimalRegex: string,\n * errorClass: typeof BaseScormValidationError\n * } params\n */\n constructor(params: {\n score_children?: string;\n score_range?: string;\n max?: string;\n invalidErrorCode?: number;\n invalidTypeCode?: number;\n invalidRangeCode?: number;\n decimalRegex?: string;\n errorClass: typeof BaseScormValidationError;\n }) {\n super();\n\n this.__children = params.score_children || scorm12_constants.score_children;\n this.__score_range = !params.score_range\n ? false\n : scorm12_regex.score_range;\n this._max = params.max || params.max === \"\" ? params.max : \"100\";\n this.__invalid_error_code =\n params.invalidErrorCode || scorm12_error_codes.INVALID_SET_VALUE;\n this.__invalid_type_code =\n params.invalidTypeCode || scorm12_error_codes.TYPE_MISMATCH;\n this.__invalid_range_code =\n params.invalidRangeCode || scorm12_error_codes.VALUE_OUT_OF_RANGE;\n this.__decimal_regex = params.decimalRegex || scorm12_regex.CMIDecimal;\n this.__error_class = params.errorClass;\n }\n\n /**\n * Getter for _children\n * @return {string}\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for _children. Just throws an error.\n * @param {string} _children\n */\n set _children(_children: string) {\n throw new this.__error_class(this.__invalid_error_code);\n }\n\n /**\n * Getter for _raw\n * @return {string}\n */\n get raw(): string {\n return this._raw;\n }\n\n /**\n * Setter for _raw\n * @param {string} raw\n */\n set raw(raw: string) {\n if (\n checkValidFormat(\n raw,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n raw,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._raw = raw;\n }\n }\n\n /**\n * Getter for _min\n * @return {string}\n */\n get min(): string {\n return this._min;\n }\n\n /**\n * Setter for _min\n * @param {string} min\n */\n set min(min: string) {\n if (\n checkValidFormat(\n min,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n min,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._min = min;\n }\n }\n\n /**\n * Getter for _max\n * @return {string}\n */\n get max(): string {\n return this._max;\n }\n\n /**\n * Setter for _max\n * @param {string} max\n */\n set max(max: string) {\n if (\n checkValidFormat(\n max,\n this.__decimal_regex,\n this.__invalid_type_code,\n this.__error_class,\n ) &&\n (!this.__score_range ||\n checkValidRange(\n max,\n this.__score_range,\n this.__invalid_range_code,\n this.__error_class,\n ))\n ) {\n this._max = max;\n }\n }\n\n /**\n * toJSON for *.score\n * @return {\n * {\n * min: string,\n * max: string,\n * raw: string\n * }\n * }\n */\n toJSON(): {\n min: string;\n max: string;\n raw: string;\n } {\n this.jsonString = true;\n const result = {\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { BaseScormValidationError } from \"../../exceptions\";\n\n/**\n * Check if the value matches the proper format. If not, throw proper error code.\n *\n * @param {string} value\n * @param {string} regexPattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @param {boolean} [allowEmptyString]\n * @return {boolean}\n */\nexport function checkValidFormat(\n value: string,\n regexPattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n allowEmptyString?: boolean,\n): boolean {\n if (typeof value !== \"string\") {\n return false;\n }\n const formatRegex = new RegExp(regexPattern);\n const matches = value.match(formatRegex);\n if (allowEmptyString && value === \"\") {\n return true;\n }\n if (value === undefined || !matches || matches[0] === \"\") {\n throw new errorClass(errorCode);\n }\n return true;\n}\n\n/**\n * Check if the value matches the proper range. If not, throw proper error code.\n *\n * @param {any} value\n * @param {string} rangePattern\n * @param {number} errorCode\n * @param {typeof BaseScormValidationError} errorClass\n * @return {boolean}\n */\nexport function checkValidRange(\n value: any,\n rangePattern: string,\n errorCode: number,\n errorClass: typeof BaseScormValidationError,\n): boolean {\n const ranges = rangePattern.split(\"#\");\n value = value * 1.0;\n if (value >= ranges[0]) {\n if (ranges[1] === \"*\" || value <= ranges[1]) {\n return true;\n } else {\n throw new errorClass(errorCode);\n }\n } else {\n throw new errorClass(errorCode);\n }\n}\n","interface ErrorDescription {\n basicMessage: string;\n detailMessage: string;\n}\n\ninterface ErrorDescriptions {\n [key: string]: ErrorDescription;\n}\n\ninterface ScormConstants {\n cmi_children: string;\n core_children: string;\n score_children: string;\n comments_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface AiccConstants extends ScormConstants {\n student_demographics_children: string;\n tries_children: string;\n attempt_records_children: string;\n paths_children: string;\n}\n\ninterface Scorm2004Constants {\n cmi_children: string;\n comments_children: string;\n score_children: string;\n objectives_children: string;\n correct_responses_children: string;\n student_data_children: string;\n student_preference_children: string;\n interactions_children: string;\n error_descriptions: ErrorDescriptions;\n}\n\ninterface GlobalConstants {\n SCORM_TRUE: string;\n SCORM_FALSE: string;\n STATE_NOT_INITIALIZED: number;\n STATE_INITIALIZED: number;\n STATE_TERMINATED: number;\n LOG_LEVEL_DEBUG: number;\n LOG_LEVEL_INFO: number;\n LOG_LEVEL_WARNING: number;\n LOG_LEVEL_ERROR: number;\n LOG_LEVEL_NONE: number;\n}\n\ninterface APIConstants {\n global: GlobalConstants;\n scorm12: ScormConstants;\n aicc: AiccConstants;\n scorm2004: Scorm2004Constants;\n}\n\nconst global: GlobalConstants = {\n SCORM_TRUE: \"true\",\n SCORM_FALSE: \"false\",\n STATE_NOT_INITIALIZED: 0,\n STATE_INITIALIZED: 1,\n STATE_TERMINATED: 2,\n LOG_LEVEL_DEBUG: 1,\n LOG_LEVEL_INFO: 2,\n LOG_LEVEL_WARNING: 3,\n LOG_LEVEL_ERROR: 4,\n LOG_LEVEL_NONE: 5,\n};\n\nconst scorm12: ScormConstants = {\n // Children lists\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions\",\n core_children:\n \"student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,lesson_mode,exit,session_time\",\n score_children: \"raw,min,max\",\n comments_children: \"content,location,time\",\n objectives_children: \"id,score,status\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children: \"audio,language,speed,text\",\n interactions_children:\n \"id,objectives,time,type,correct_responses,weighting,student_response,result,latency\",\n error_descriptions: {\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use LMSGetDiagnostic for more information\",\n },\n \"201\": {\n basicMessage: \"Invalid argument error\",\n detailMessage:\n \"Indicates that an argument represents an invalid data model element or is otherwise incorrect.\",\n },\n \"202\": {\n basicMessage: \"Element cannot have children\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_children\" for a data model element that does not support the \"_children\" suffix.',\n },\n \"203\": {\n basicMessage: \"Element not an array - cannot have count\",\n detailMessage:\n 'Indicates that LMSGetValue was called with a data model element name that ends in \"_count\" for a data model element that does not support the \"_count\" suffix.',\n },\n \"301\": {\n basicMessage: \"Not initialized\",\n detailMessage:\n \"Indicates that an API call was made before the call to lmsInitialize.\",\n },\n \"401\": {\n basicMessage: \"Not implemented error\",\n detailMessage:\n \"The data model element indicated in a call to LMSGetValue or LMSSetValue is valid, but was not implemented by this LMS. SCORM 1.2 defines a set of data model elements as being optional for an LMS to implement.\",\n },\n \"402\": {\n basicMessage: \"Invalid set value, element is a keyword\",\n detailMessage:\n 'Indicates that LMSSetValue was called on a data model element that represents a keyword (elements that end in \"_children\" and \"_count\").',\n },\n \"403\": {\n basicMessage: \"Element is read only\",\n detailMessage:\n \"LMSSetValue was called with a data model element that can only be read.\",\n },\n \"404\": {\n basicMessage: \"Element is write only\",\n detailMessage:\n \"LMSGetValue was called on a data model element that can only be written to.\",\n },\n \"405\": {\n basicMessage: \"Incorrect Data Type\",\n detailMessage:\n \"LMSSetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a LMSSetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst aicc: AiccConstants = {\n ...scorm12,\n ...{\n cmi_children:\n \"core,suspend_data,launch_data,comments,objectives,student_data,student_preference,interactions,evaluation\",\n student_preference_children:\n \"audio,language,lesson_type,speed,text,text_color,text_location,text_size,video,windows\",\n student_data_children:\n \"attempt_number,tries,mastery_score,max_time_allowed,time_limit_action\",\n student_demographics_children:\n \"city,class,company,country,experience,familiar_name,instructor_name,title,native_language,state,street_address,telephone,years_experience\",\n tries_children: \"time,status,score\",\n attempt_records_children: \"score,lesson_status\",\n paths_children: \"location_id,date,time,status,why_left,time_in_element\",\n },\n};\nconst scorm2004: Scorm2004Constants = {\n // Children lists\n cmi_children:\n \"_version,comments_from_learner,comments_from_lms,completion_status,credit,entry,exit,interactions,launch_data,learner_id,learner_name,learner_preference,location,max_time_allowed,mode,objectives,progress_measure,scaled_passing_score,score,session_time,success_status,suspend_data,time_limit_action,total_time\",\n comments_children: \"comment,timestamp,location\",\n score_children: \"max,raw,scaled,min\",\n objectives_children:\n \"progress_measure,completion_status,success_status,description,score,id\",\n correct_responses_children: \"pattern\",\n student_data_children: \"mastery_score,max_time_allowed,time_limit_action\",\n student_preference_children:\n \"audio_level,audio_captioning,delivery_speed,language\",\n interactions_children:\n \"id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description\",\n error_descriptions: {\n \"0\": {\n basicMessage: \"No Error\",\n detailMessage: \"No error occurred, the previous API call was successful.\",\n },\n \"101\": {\n basicMessage: \"General Exception\",\n detailMessage:\n \"No specific error code exists to describe the error. Use GetDiagnostic for more information.\",\n },\n \"102\": {\n basicMessage: \"General Initialization Failure\",\n detailMessage: \"Call to Initialize failed for an unknown reason.\",\n },\n \"103\": {\n basicMessage: \"Already Initialized\",\n detailMessage:\n \"Call to Initialize failed because Initialize was already called.\",\n },\n \"104\": {\n basicMessage: \"Content Instance Terminated\",\n detailMessage:\n \"Call to Initialize failed because Terminate was already called.\",\n },\n \"111\": {\n basicMessage: \"General Termination Failure\",\n detailMessage: \"Call to Terminate failed for an unknown reason.\",\n },\n \"112\": {\n basicMessage: \"Termination Before Initialization\",\n detailMessage:\n \"Call to Terminate failed because it was made before the call to Initialize.\",\n },\n \"113\": {\n basicMessage: \"Termination After Termination\",\n detailMessage:\n \"Call to Terminate failed because Terminate was already called.\",\n },\n \"122\": {\n basicMessage: \"Retrieve Data Before Initialization\",\n detailMessage:\n \"Call to GetValue failed because it was made before the call to Initialize.\",\n },\n \"123\": {\n basicMessage: \"Retrieve Data After Termination\",\n detailMessage:\n \"Call to GetValue failed because it was made after the call to Terminate.\",\n },\n \"132\": {\n basicMessage: \"Store Data Before Initialization\",\n detailMessage:\n \"Call to SetValue failed because it was made before the call to Initialize.\",\n },\n \"133\": {\n basicMessage: \"Store Data After Termination\",\n detailMessage:\n \"Call to SetValue failed because it was made after the call to Terminate.\",\n },\n \"142\": {\n basicMessage: \"Commit Before Initialization\",\n detailMessage:\n \"Call to Commit failed because it was made before the call to Initialize.\",\n },\n \"143\": {\n basicMessage: \"Commit After Termination\",\n detailMessage:\n \"Call to Commit failed because it was made after the call to Terminate.\",\n },\n \"201\": {\n basicMessage: \"General Argument Error\",\n detailMessage:\n \"An invalid argument was passed to an API method (usually indicates that Initialize, Commit or Terminate did not receive the expected empty string argument.\",\n },\n \"301\": {\n basicMessage: \"General Get Failure\",\n detailMessage:\n \"Indicates a failed GetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"351\": {\n basicMessage: \"General Set Failure\",\n detailMessage:\n \"Indicates a failed SetValue call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"391\": {\n basicMessage: \"General Commit Failure\",\n detailMessage:\n \"Indicates a failed Commit call where no other specific error code is applicable. Use GetDiagnostic for more information.\",\n },\n \"401\": {\n basicMessage: \"Undefined Data Model Element\",\n detailMessage:\n \"The data model element name passed to GetValue or SetValue is not a valid SCORM data model element.\",\n },\n \"402\": {\n basicMessage: \"Unimplemented Data Model Element\",\n detailMessage:\n \"The data model element indicated in a call to GetValue or SetValue is valid, but was not implemented by this LMS. In SCORM 2004, this error would indicate an LMS that is not fully SCORM conformant.\",\n },\n \"403\": {\n basicMessage: \"Data Model Element Value Not Initialized\",\n detailMessage:\n \"Attempt to read a data model element that has not been initialized by the LMS or through a SetValue call. This error condition is often reached during normal execution of a SCO.\",\n },\n \"404\": {\n basicMessage: \"Data Model Element Is Read Only\",\n detailMessage:\n \"SetValue was called with a data model element that can only be read.\",\n },\n \"405\": {\n basicMessage: \"Data Model Element Is Write Only\",\n detailMessage:\n \"GetValue was called on a data model element that can only be written to.\",\n },\n \"406\": {\n basicMessage: \"Data Model Element Type Mismatch\",\n detailMessage:\n \"SetValue was called with a value that is not consistent with the data format of the supplied data model element.\",\n },\n \"407\": {\n basicMessage: \"Data Model Element Value Out Of Range\",\n detailMessage:\n \"The numeric value supplied to a SetValue call is outside of the numeric range allowed for the supplied data model element.\",\n },\n \"408\": {\n basicMessage: \"Data Model Dependency Not Established\",\n detailMessage:\n \"Some data model elements cannot be set until another data model element was set. This error condition indicates that the prerequisite element was not set before the dependent element.\",\n },\n },\n};\nconst APIConstants: APIConstants = {\n global: global,\n scorm12: scorm12,\n aicc: aicc,\n scorm2004: scorm2004,\n};\nexport default APIConstants;\n","export enum NAVBoolean {\n unknown = \"unknown\",\n true = \"true\",\n false = \"false\",\n}\n\nexport enum SuccessStatus {\n passed = \"passed\",\n failed = \"failed\",\n unknown = \"unknown\",\n}\n\nexport enum CompletionStatus {\n completed = \"completed\",\n incomplete = \"incomplete\",\n unknown = \"unknown\",\n}\n","export type ErrorCode = {\n [key: string]: number;\n};\n\nconst global: ErrorCode = {\n GENERAL: 101,\n INITIALIZATION_FAILED: 101,\n INITIALIZED: 101,\n TERMINATED: 101,\n TERMINATION_FAILURE: 101,\n TERMINATION_BEFORE_INIT: 101,\n MULTIPLE_TERMINATION: 101,\n RETRIEVE_BEFORE_INIT: 101,\n RETRIEVE_AFTER_TERM: 101,\n STORE_BEFORE_INIT: 101,\n STORE_AFTER_TERM: 101,\n COMMIT_BEFORE_INIT: 101,\n COMMIT_AFTER_TERM: 101,\n ARGUMENT_ERROR: 101,\n CHILDREN_ERROR: 101,\n COUNT_ERROR: 101,\n GENERAL_GET_FAILURE: 101,\n GENERAL_SET_FAILURE: 101,\n GENERAL_COMMIT_FAILURE: 101,\n UNDEFINED_DATA_MODEL: 101,\n UNIMPLEMENTED_ELEMENT: 101,\n VALUE_NOT_INITIALIZED: 101,\n INVALID_SET_VALUE: 101,\n READ_ONLY_ELEMENT: 101,\n WRITE_ONLY_ELEMENT: 101,\n TYPE_MISMATCH: 101,\n VALUE_OUT_OF_RANGE: 101,\n DEPENDENCY_NOT_ESTABLISHED: 101,\n};\n\nconst scorm12: ErrorCode = {\n ...global,\n RETRIEVE_BEFORE_INIT: 301,\n STORE_BEFORE_INIT: 301,\n COMMIT_BEFORE_INIT: 301,\n ARGUMENT_ERROR: 201,\n CHILDREN_ERROR: 202,\n COUNT_ERROR: 203,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 401,\n VALUE_NOT_INITIALIZED: 301,\n INVALID_SET_VALUE: 402,\n READ_ONLY_ELEMENT: 403,\n WRITE_ONLY_ELEMENT: 404,\n TYPE_MISMATCH: 405,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst scorm2004: ErrorCode = {\n ...global,\n INITIALIZATION_FAILED: 102,\n INITIALIZED: 103,\n TERMINATED: 104,\n TERMINATION_FAILURE: 111,\n TERMINATION_BEFORE_INIT: 112,\n MULTIPLE_TERMINATIONS: 113,\n RETRIEVE_BEFORE_INIT: 122,\n RETRIEVE_AFTER_TERM: 123,\n STORE_BEFORE_INIT: 132,\n STORE_AFTER_TERM: 133,\n COMMIT_BEFORE_INIT: 142,\n COMMIT_AFTER_TERM: 143,\n ARGUMENT_ERROR: 201,\n GENERAL_GET_FAILURE: 301,\n GENERAL_SET_FAILURE: 351,\n GENERAL_COMMIT_FAILURE: 391,\n UNDEFINED_DATA_MODEL: 401,\n UNIMPLEMENTED_ELEMENT: 402,\n VALUE_NOT_INITIALIZED: 403,\n READ_ONLY_ELEMENT: 404,\n WRITE_ONLY_ELEMENT: 405,\n TYPE_MISMATCH: 406,\n VALUE_OUT_OF_RANGE: 407,\n DEPENDENCY_NOT_ESTABLISHED: 408,\n};\n\nconst ErrorCodes = {\n scorm12,\n scorm2004,\n};\n\nexport default ErrorCodes;\n","const scorm12 = {\n CMIString256: \"^.{0,255}$\",\n CMIString4096: \"^.{0,4096}$\",\n CMITime: \"^(?:[01]\\\\d|2[0123]):(?:[012345]\\\\d):(?:[012345]\\\\d)$\",\n CMITimespan: \"^([0-9]{2,}):([0-9]{2}):([0-9]{2})(.[0-9]{1,2})?$\",\n\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{0,3})(.[0-9]*)?$\",\n\n CMIIdentifier: \"^[\\\\u0021-\\\\u007E\\\\s]{0,255}$\",\n CMIFeedback: \"^.{0,255}$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n // Vocabulary Data Type Definition\n CMIStatus: \"^(passed|completed|failed|incomplete|browsed)$\",\n CMIStatus2: \"^(passed|completed|failed|incomplete|browsed|not attempted)$\",\n CMIExit: \"^(time-out|suspend|logout|)$\",\n CMIType:\n \"^(true-false|choice|fill-in|matching|performance|sequencing|likert|numeric)$\",\n CMIResult:\n \"^(correct|wrong|unanticipated|neutral|([0-9]{0,3})?(\\\\.[0-9]*)?)$\",\n NAVEvent: \"^(previous|continue)$\",\n // Data ranges\n score_range: \"0#100\",\n audio_range: \"-1#100\",\n speed_range: \"-100#100\",\n weighting_range: \"-100#100\",\n text_range: \"-1#1\",\n};\nconst aicc = {\n ...scorm12,\n ...{\n CMIIdentifier: \"^\\\\w{1,255}$\",\n },\n};\nconst scorm2004 = {\n CMIString200: \"^[\\\\u0000-\\\\uFFFF]{0,200}$\",\n CMIString250: \"^[\\\\u0000-\\\\uFFFF]{0,250}$\",\n CMIString1000: \"^[\\\\u0000-\\\\uFFFF]{0,1000}$\",\n CMIString4000: \"^[\\\\u0000-\\\\uFFFF]{0,4000}$\",\n CMIString64000: \"^[\\\\u0000-\\\\uFFFF]{0,64000}$\",\n CMILang: \"^([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$\",\n\n CMILangString250:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$\",\n\n CMILangcr: \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$\",\n\n CMILangString250cr:\n \"^(({lang=([a-zA-Z]{2,3}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$\",\n\n CMILangString4000:\n \"^({lang=([a-zA-Z]{2,3}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$\",\n\n CMITime:\n \"^(19[7-9]{1}[0-9]{1}|20[0-2]{1}[0-9]{1}|203[0-8]{1})((-(0[1-9]{1}|1[0-2]{1}))((-(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))(T([0-1]{1}[0-9]{1}|2[0-3]{1})((:[0-5]{1}[0-9]{1})((:[0-5]{1}[0-9]{1})((\\\\.[0-9]{1,2})((Z|([+|-]([0-1]{1}[0-9]{1}|2[0-3]{1})))(:[0-5]{1}[0-9]{1})?)?)?)?)?)?)?)?$\",\n CMITimespan:\n \"^P(?:([.,\\\\d]+)Y)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)W)?(?:([.,\\\\d]+)D)?(?:T?(?:([.,\\\\d]+)H)?(?:([.,\\\\d]+)M)?(?:([.,\\\\d]+)S)?)?$\",\n CMIInteger: \"^\\\\d+$\",\n CMISInteger: \"^-?([0-9]+)$\",\n CMIDecimal: \"^-?([0-9]{1,5})(\\\\.[0-9]{1,18})?$\",\n CMIIdentifier: \"^\\\\S{1,250}[a-zA-Z0-9]$\",\n CMIShortIdentifier: \"^[\\\\w\\\\.\\\\-\\\\_]{1,250}$\",\n CMILongIdentifier:\n \"^(?:(?!urn:)\\\\S{1,4000}|urn:[A-Za-z0-9-]{1,31}:\\\\S{1,4000}|.{1,4000})$\",\n // need to re-examine this\n CMIFeedback: \"^.*$\",\n // This must be redefined\n CMIIndex: \"[._](\\\\d+).\",\n CMIIndexStore: \".N(\\\\d+).\",\n // Vocabulary Data Type Definition\n CMICStatus: \"^(completed|incomplete|not attempted|unknown)$\",\n CMISStatus: \"^(passed|failed|unknown)$\",\n CMIExit: \"^(time-out|suspend|logout|normal)$\",\n CMIType:\n \"^(true-false|choice|fill-in|long-fill-in|matching|performance|sequencing|likert|numeric|other)$\",\n CMIResult:\n \"^(correct|incorrect|unanticipated|neutral|-?([0-9]{1,4})(\\\\.[0-9]{1,18})?)$\",\n NAVEvent:\n \"^(previous|continue|exit|exitAll|abandon|abandonAll|suspendAll|_none_|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?choice|(\\\\{target=\\\\S{0,}[a-zA-Z0-9-_]+})?jump)$\",\n\n NAVBoolean: \"^(unknown|true|false$)\",\n NAVTarget: \"^{target=\\\\S{0,}[a-zA-Z0-9-_]+}$\",\n // Data ranges\n scaled_range: \"-1#1\",\n audio_range: \"0#*\",\n speed_range: \"0#*\",\n text_range: \"-1#1\",\n progress_range: \"0#1\",\n};\nconst Regex = {\n aicc: aicc,\n scorm12: scorm12,\n scorm2004: scorm2004,\n};\nexport default Regex;\n","import APIConstants from \"./constants/api_constants\";\n\nconst scorm12_errors = APIConstants.scorm12.error_descriptions;\nconst aicc_errors = APIConstants.aicc.error_descriptions;\nconst scorm2004_errors = APIConstants.scorm2004.error_descriptions;\n\ntype APIError = {\n errorCode: number;\n errorMessage: string;\n detailedMessage: string;\n};\n\nexport class BaseScormValidationError extends Error {\n constructor(errorCode: number) {\n super(errorCode.toString());\n this._errorCode = errorCode;\n this.name = \"ScormValidationError\";\n }\n\n private readonly _errorCode: number;\n\n /**\n * Getter for _errorCode\n * @return {number}\n */\n get errorCode(): number {\n return this._errorCode;\n }\n\n setMessage(message: string) {\n this.message = message;\n }\n}\n\n/**\n * Base Validation Exception\n */\nexport class ValidationError\n extends BaseScormValidationError\n implements APIError\n{\n /**\n * Constructor to take in an error message and code\n * @param {number} errorCode\n * @param {string} errorMessage\n * @param {string} detailedMessage\n */\n constructor(\n errorCode: number,\n errorMessage: string,\n detailedMessage?: string,\n ) {\n super(errorCode);\n this.setMessage(errorMessage);\n this._errorMessage = errorMessage;\n if (detailedMessage) {\n this._detailedMessage = detailedMessage;\n }\n }\n\n private readonly _errorMessage: string;\n private readonly _detailedMessage: string = \"\";\n\n /**\n * Getter for _errorMessage\n * @return {string}\n */\n get errorMessage(): string {\n return this._errorMessage;\n }\n\n /**\n * Getter for _detailedMessage\n * @return {string}\n */\n get detailedMessage(): string {\n return this._detailedMessage;\n }\n}\n\n/**\n * SCORM 1.2 Validation Error\n */\nexport class Scorm12ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm12_errors, String(errorCode))) {\n super(\n errorCode,\n scorm12_errors[String(errorCode)].basicMessage,\n scorm12_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm12_errors[\"101\"].basicMessage,\n scorm12_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * AICC Validation Error\n */\nexport class AICCValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) {\n super(\n errorCode,\n aicc_errors[String(errorCode)].basicMessage,\n aicc_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n aicc_errors[\"101\"].basicMessage,\n aicc_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n\n/**\n * SCORM 2004 Validation Error\n */\nexport class Scorm2004ValidationError extends ValidationError {\n /**\n * Constructor to take in an error code\n * @param {number} errorCode\n */\n constructor(errorCode: number) {\n if ({}.hasOwnProperty.call(scorm2004_errors, String(errorCode))) {\n super(\n errorCode,\n scorm2004_errors[String(errorCode)].basicMessage,\n scorm2004_errors[String(errorCode)].detailMessage,\n );\n } else {\n super(\n 101,\n scorm2004_errors[\"101\"].basicMessage,\n scorm2004_errors[\"101\"].detailMessage,\n );\n }\n }\n}\n","export const SECONDS_PER_SECOND = 1.0;\nexport const SECONDS_PER_MINUTE = 60;\nexport const SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;\nexport const SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR;\n\ntype Designation = {\n [key: string]: number;\n};\n\ntype StringKeyMap = {\n [key: string]: any;\n};\n\nconst designations: Designation = {\n D: SECONDS_PER_DAY,\n H: SECONDS_PER_HOUR,\n M: SECONDS_PER_MINUTE,\n S: SECONDS_PER_SECOND,\n};\n\n/**\n * Converts a Number to a String of HH:MM:SS\n *\n * @param {number} totalSeconds\n * @return {string}\n */\nexport function getSecondsAsHHMMSS(totalSeconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!totalSeconds || totalSeconds <= 0) {\n return \"00:00:00\";\n }\n\n const hours = Math.floor(totalSeconds / SECONDS_PER_HOUR);\n const dateObj = new Date(totalSeconds * 1000);\n const minutes = dateObj.getUTCMinutes();\n // make sure we add any possible decimal value\n const seconds = dateObj.getSeconds();\n const ms = totalSeconds % 1.0;\n let msStr = \"\";\n\n if (countDecimals(ms) > 0) {\n if (countDecimals(ms) > 2) {\n msStr = ms.toFixed(2);\n } else {\n msStr = String(ms);\n }\n\n msStr = \".\" + msStr.split(\".\")[1];\n }\n\n return (\n (hours + \":\" + minutes + \":\" + seconds).replace(/\\b\\d\\b/g, \"0$&\") + msStr\n );\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {number} seconds\n * @return {string}\n */\nexport function getSecondsAsISODuration(seconds: number | null): string {\n // SCORM spec does not deal with negative durations, give zero back\n if (!seconds || seconds <= 0) {\n return \"PT0S\";\n }\n\n let duration = \"P\";\n let remainder = seconds;\n for (const designationsKey in designations) {\n const current_seconds = designations[designationsKey];\n let value = Math.floor(remainder / current_seconds);\n remainder = remainder % current_seconds;\n\n if (countDecimals(remainder) > 2) {\n remainder = Number(Number(remainder).toFixed(2));\n }\n\n // If we have anything left in the remainder, and we're currently adding\n // seconds to the duration, go ahead and add the decimal to the seconds\n if (designationsKey === \"S\" && remainder > 0) {\n value += remainder;\n }\n\n if (value) {\n if (\n (duration.indexOf(\"D\") > 0 ||\n designationsKey === \"H\" ||\n designationsKey === \"M\" ||\n designationsKey === \"S\") &&\n duration.indexOf(\"T\") === -1\n ) {\n duration += \"T\";\n }\n\n duration += `${value}${designationsKey}`;\n }\n }\n return duration;\n}\n\n/**\n * Calculate the number of seconds from HH:MM:SS.DDDDDD\n *\n * @param {string} timeString\n * @param {RegExp} timeRegex\n * @return {number}\n */\nexport function getTimeAsSeconds(\n timeString: string | number | boolean | null,\n timeRegex: RegExp | string,\n): number {\n if (typeof timeString === \"number\" || typeof timeString === \"boolean\") {\n timeString = String(timeString);\n }\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n if (!timeString || !timeString.match(timeRegex)) {\n return 0;\n }\n\n const parts = timeString.split(\":\");\n const hours = Number(parts[0]);\n const minutes = Number(parts[1]);\n const seconds = Number(parts[2]);\n return hours * 3600 + minutes * 60 + seconds;\n}\n\n/**\n * Calculate the number of seconds from ISO 8601 Duration\n *\n * @param {string} duration\n * @param {RegExp} durationRegex\n * @return {number}\n */\nexport function getDurationAsSeconds(\n duration: string | null,\n durationRegex: RegExp | string,\n): number {\n if (typeof durationRegex === \"string\") {\n durationRegex = new RegExp(durationRegex);\n }\n\n if (!duration || !duration.match(durationRegex)) {\n return 0;\n }\n\n const [, years, _, , days, hours, minutes, seconds] =\n new RegExp(durationRegex).exec(duration) || [];\n let result = 0.0;\n result += Number(seconds) || 0.0;\n result += Number(minutes) * 60.0 || 0.0;\n result += Number(hours) * 3600.0 || 0.0;\n result += Number(days) * (60 * 60 * 24.0) || 0.0;\n result += Number(years) * (60 * 60 * 24 * 365.0) || 0.0;\n return result;\n}\n\n/**\n * Adds together two ISO8601 Duration strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp|string} durationRegex\n * @return {string}\n */\nexport function addTwoDurations(\n first: string,\n second: string,\n durationRegex: RegExp | string,\n): string {\n const regex: RegExp =\n typeof durationRegex === \"string\"\n ? new RegExp(durationRegex)\n : durationRegex;\n return getSecondsAsISODuration(\n getDurationAsSeconds(first, regex) + getDurationAsSeconds(second, regex),\n );\n}\n\n/**\n * Add together two HH:MM:SS.DD strings\n *\n * @param {string} first\n * @param {string} second\n * @param {RegExp} timeRegex\n * @return {string}\n */\nexport function addHHMMSSTimeStrings(\n first: string,\n second: string,\n timeRegex: RegExp | string,\n): string {\n if (typeof timeRegex === \"string\") {\n timeRegex = new RegExp(timeRegex);\n }\n return getSecondsAsHHMMSS(\n getTimeAsSeconds(first, timeRegex) + getTimeAsSeconds(second, timeRegex),\n );\n}\n\n/**\n * Flatten a JSON object down to string paths for each values\n * @param {object} data\n * @return {object}\n */\nexport function flatten(data: StringKeyMap): object {\n const result: StringKeyMap = {};\n\n /**\n * Recurse through the object\n * @param {*} cur\n * @param {*} prop\n */\n function recurse(cur: any, prop: any) {\n if (Object(cur) !== cur) {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (let i = 0, l = cur.length; i < l; i++) {\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l === 0) result[prop] = [];\n }\n } else {\n let isEmpty = true;\n\n for (const p in cur) {\n if ({}.hasOwnProperty.call(cur, p)) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n }\n\n if (isEmpty && prop) result[prop] = {};\n }\n }\n\n recurse(data, \"\");\n return result;\n}\n\n/**\n * Un-flatten a flat JSON object\n * @param {object} data\n * @return {object}\n */\nexport function unflatten(data: StringKeyMap): object {\n \"use strict\";\n\n if (Object(data) !== data || Array.isArray(data)) return data;\n const regex = /\\.?([^.[\\]]+)|\\[(\\d+)]/g;\n const result: StringKeyMap = {};\n\n for (const p in data) {\n if ({}.hasOwnProperty.call(data, p)) {\n let cur = result;\n let prop = \"\";\n let m = regex.exec(p);\n\n while (m) {\n cur = cur[prop] || (cur[prop] = m[2] ? [] : {});\n prop = m[2] || m[1];\n m = regex.exec(p);\n }\n\n cur[prop] = data[p];\n }\n }\n\n return result[\"\"] || result;\n}\n\n/**\n * Counts the number of decimal places\n * @param {number} num\n * @return {number}\n */\nexport function countDecimals(num: number): number {\n if (Math.floor(num) === num || String(num).indexOf(\".\") < 0) return 0;\n const parts = num.toString().split(\".\")[1];\n return parts.length || 0;\n}\n\n/**\n * Formats the SCORM messages for easy reading\n *\n * @param {string} functionName\n * @param {string} message\n * @param {string} CMIElement\n * @return {string}\n */\nexport function formatMessage(\n functionName: string,\n message: string,\n CMIElement?: string,\n): string {\n const baseLength = 20;\n let messageString = \"\";\n\n messageString += functionName;\n\n let fillChars = baseLength - messageString.length;\n\n for (let i = 0; i < fillChars; i++) {\n messageString += \" \";\n }\n\n messageString += \": \";\n\n if (CMIElement) {\n const CMIElementBaseLength = 70;\n\n messageString += CMIElement;\n\n fillChars = CMIElementBaseLength - messageString.length;\n\n for (let j = 0; j < fillChars; j++) {\n messageString += \" \";\n }\n }\n\n if (message) {\n messageString += message;\n }\n\n return messageString;\n}\n\n/**\n * Checks to see if {str} contains {tester}\n *\n * @param {string} str String to check against\n * @param {string} tester String to check for\n * @return {boolean}\n */\nexport function stringMatches(str: string, tester: string): boolean {\n return str?.match(tester) !== null;\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { checkValidFormat, checkValidRange } from \"../common/validation\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} regexPattern\n * @param {boolean} allowEmptyString\n * @return {boolean}\n */\nexport function check2004ValidFormat(\n value: string,\n regexPattern: string,\n allowEmptyString?: boolean,\n): boolean {\n return checkValidFormat(\n value,\n regexPattern,\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n Scorm2004ValidationError,\n allowEmptyString,\n );\n}\n\n/**\n * Helper method, no reason to have to pass the same error codes every time\n * @param {string} value\n * @param {string} rangePattern\n * @return {boolean}\n */\nexport function check2004ValidRange(\n value: string,\n rangePattern: string,\n): boolean {\n return checkValidRange(\n value,\n rangePattern,\n ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n Scorm2004ValidationError,\n );\n}\n","/**\n * Class for SCORM 2004's cmi.learner_preference object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\nexport class CMILearnerPreference extends BaseCMI {\n private __children = APIConstants.scorm2004.student_preference_children;\n private _audio_level = \"1\";\n private _language = \"\";\n private _delivery_speed = \"1\";\n private _audio_captioning = \"0\";\n\n /**\n * Constructor for cmi.learner_preference\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {string} _children\n * @private\n */\n set _children(_children: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _audio_level\n * @return {string}\n */\n get audio_level(): string {\n return this._audio_level;\n }\n\n /**\n * Setter for _audio_level\n * @param {string} audio_level\n */\n set audio_level(audio_level: string) {\n if (\n check2004ValidFormat(audio_level, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(audio_level, Regex.scorm2004.audio_range)\n ) {\n this._audio_level = audio_level;\n }\n }\n\n /**\n * Getter for _language\n * @return {string}\n */\n get language(): string {\n return this._language;\n }\n\n /**\n * Setter for _language\n * @param {string} language\n */\n set language(language: string) {\n if (check2004ValidFormat(language, Regex.scorm2004.CMILang)) {\n this._language = language;\n }\n }\n\n /**\n * Getter for _delivery_speed\n * @return {string}\n */\n get delivery_speed(): string {\n return this._delivery_speed;\n }\n\n /**\n * Setter for _delivery_speed\n * @param {string} delivery_speed\n */\n set delivery_speed(delivery_speed: string) {\n if (\n check2004ValidFormat(delivery_speed, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(delivery_speed, Regex.scorm2004.speed_range)\n ) {\n this._delivery_speed = delivery_speed;\n }\n }\n\n /**\n * Getter for _audio_captioning\n * @return {string}\n */\n get audio_captioning(): string {\n return this._audio_captioning;\n }\n\n /**\n * Setter for _audio_captioning\n * @param {string} audio_captioning\n */\n set audio_captioning(audio_captioning: string) {\n if (\n check2004ValidFormat(audio_captioning, Regex.scorm2004.CMISInteger) &&\n check2004ValidRange(audio_captioning, Regex.scorm2004.text_range)\n ) {\n this._audio_captioning = audio_captioning;\n }\n }\n\n /**\n * toJSON for cmi.learner_preference\n *\n * @return {\n * {\n * audio_level: string,\n * language: string,\n * delivery_speed: string,\n * audio_captioning: string\n * }\n * }\n */\n toJSON(): {\n audio_level: string;\n language: string;\n delivery_speed: string;\n audio_captioning: string;\n } {\n this.jsonString = true;\n const result = {\n audio_level: this.audio_level,\n language: this.language,\n delivery_speed: this.delivery_speed,\n audio_captioning: this.audio_captioning,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import Regex from \"./regex\";\n\nconst scorm2004_regex = Regex.scorm2004;\nexport const LearnerResponses: Responses = {\n \"true-false\": {\n format: \"^true$|^false$\",\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n choice: {\n format: scorm2004_regex.CMILongIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n },\n \"fill-in\": {\n format: scorm2004_regex.CMILangString250,\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n },\n \"long-fill-in\": {\n format: scorm2004_regex.CMILangString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n matching: {\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n performance: {\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n },\n sequencing: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n },\n likert: {\n format: scorm2004_regex.CMIShortIdentifier,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n numeric: {\n format: scorm2004_regex.CMIDecimal,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n other: {\n format: scorm2004_regex.CMIString4000,\n max: 1,\n delimiter: \"\",\n unique: false,\n },\n};\nexport const CorrectResponses: Responses = {\n \"true-false\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: \"^true$|^false$\",\n limit: 1,\n },\n choice: {\n max: 36,\n delimiter: \"[,]\",\n unique: true,\n duplicate: false,\n format: scorm2004_regex.CMILongIdentifier,\n },\n \"fill-in\": {\n max: 10,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMILangString250cr,\n },\n \"long-fill-in\": {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: true,\n format: scorm2004_regex.CMILangString4000,\n },\n matching: {\n max: 36,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n format2: scorm2004_regex.CMIShortIdentifier,\n },\n performance: {\n max: 250,\n delimiter: \"[,]\",\n delimiter2: \"[.]\",\n delimiter3: \"[:]\",\n unique: false,\n duplicate: false,\n format: \"^$|\" + scorm2004_regex.CMIShortIdentifier,\n format2:\n scorm2004_regex.CMIDecimal + \"|^$|\" + scorm2004_regex.CMIShortIdentifier,\n },\n sequencing: {\n max: 36,\n delimiter: \"[,]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n },\n likert: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIShortIdentifier,\n limit: 1,\n },\n numeric: {\n max: 2,\n delimiter: \"[:]\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIDecimal,\n limit: 1,\n },\n other: {\n max: 1,\n delimiter: \"\",\n unique: false,\n duplicate: false,\n format: scorm2004_regex.CMIString4000,\n limit: 1,\n },\n};\n\nexport type ResponseType = {\n format: string;\n max: number;\n delimiter: string;\n unique: boolean;\n duplicate?: boolean;\n format2?: string;\n delimiter2?: string;\n limit?: number;\n delimiter3?: string;\n};\n\nexport type Responses = {\n [key: string]: ResponseType;\n};\n","/**\n * Class representing SCORM 2004's `cmi.interactions` object\n */\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { CMIArray } from \"../common/array\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport APIConstants from \"../../constants/api_constants\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { LearnerResponses } from \"../../constants/response_constants\";\n\nexport class CMIInteractions extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.interactions_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.interaction.n object\n */\n\nexport class CMIInteractionsObject extends BaseCMI {\n private _id = \"\";\n private _type = \"\";\n private _timestamp = \"\";\n private _weighting = \"\";\n private _learner_response = \"\";\n private _result = \"\";\n private _latency = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.interaction.n\n */\n constructor() {\n super();\n this.objectives = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.objectives_children,\n });\n this.correct_responses = new CMIArray({\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n children: APIConstants.scorm2004.correct_responses_children,\n });\n }\n\n public objectives: CMIArray;\n public correct_responses: CMIArray;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.objectives?.initialize();\n this.correct_responses?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _type\n * @return {string}\n */\n get type(): string {\n return this._type;\n }\n\n /**\n * Setter for _type\n * @param {string} type\n */\n set type(type: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(type, Regex.scorm2004.CMIType)) {\n this._type = type;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * Getter for _weighting\n * @return {string}\n */\n get weighting(): string {\n return this._weighting;\n }\n\n /**\n * Setter for _weighting\n * @param {string} weighting\n */\n set weighting(weighting: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(weighting, Regex.scorm2004.CMIDecimal)) {\n this._weighting = weighting;\n }\n }\n }\n\n /**\n * Getter for _learner_response\n * @return {string}\n */\n get learner_response(): string {\n return this._learner_response;\n }\n\n /**\n * Setter for _learner_response. Does type validation to make sure response\n * matches SCORM 2004's spec\n * @param {string} learner_response\n */\n set learner_response(learner_response: string) {\n if (this.initialized && (this._type === \"\" || this._id === \"\")) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n let nodes = [];\n const response_type = LearnerResponses[this.type];\n\n if (response_type) {\n if (response_type?.delimiter) {\n nodes = learner_response.split(response_type.delimiter);\n } else {\n nodes[0] = learner_response;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n const formatRegex = new RegExp(response_type.format);\n\n for (let i = 0; i < nodes.length; i++) {\n if (response_type?.delimiter2) {\n const values = nodes[i].split(response_type.delimiter2);\n\n if (values.length === 2) {\n if (!values[0].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (\n !response_type.format2 ||\n !values[1].match(new RegExp(response_type.format2))\n ) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n } else {\n if (!nodes[i].match(formatRegex)) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n } else {\n if (nodes[i] !== \"\" && response_type.unique) {\n for (let j = 0; j < i; j++) {\n if (nodes[i] === nodes[j]) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.TYPE_MISMATCH,\n );\n }\n }\n }\n }\n }\n }\n } else {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n );\n }\n\n this._learner_response = learner_response;\n } else {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n\n /**\n * Getter for _result\n * @return {string}\n */\n get result(): string {\n return this._result;\n }\n\n /**\n * Setter for _result\n * @param {string} result\n */\n set result(result: string) {\n if (check2004ValidFormat(result, Regex.scorm2004.CMIResult)) {\n this._result = result;\n }\n }\n\n /**\n * Getter for _latency\n * @return {string}\n */\n get latency(): string {\n return this._latency;\n }\n\n /**\n * Setter for _latency\n * @param {string} latency\n */\n set latency(latency: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(latency, Regex.scorm2004.CMITimespan)) {\n this._latency = latency;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.interactions.n\n *\n * @return {\n * {\n * id: string,\n * type: string,\n * objectives: CMIArray,\n * timestamp: string,\n * correct_responses: CMIArray,\n * weighting: string,\n * learner_response: string,\n * result: string,\n * latency: string,\n * description: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n type: string;\n objectives: CMIArray;\n timestamp: string;\n correct_responses: CMIArray;\n weighting: string;\n learner_response: string;\n result: string;\n latency: string;\n description: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n type: this.type,\n objectives: this.objectives,\n timestamp: this.timestamp,\n weighting: this.weighting,\n learner_response: this.learner_response,\n result: this.result,\n latency: this.latency,\n description: this.description,\n correct_responses: this.correct_responses,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.objectives.n object\n */\nexport class CMIInteractionsObjectivesObject extends BaseCMI {\n private _id = \"\";\n\n /**\n * Constructor for cmi.interactions.n.objectives.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * toJSON for cmi.interactions.n.objectives.n\n * @return {\n * {\n * id: string\n * }\n * }\n */\n toJSON(): {\n id: string;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.interactions.n.correct_responses.n object\n */\nexport class CMIInteractionsCorrectResponsesObject extends BaseCMI {\n private _pattern = \"\";\n\n /**\n * Constructor for cmi.interactions.n.correct_responses.n\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _pattern\n * @return {string}\n */\n get pattern(): string {\n return this._pattern;\n }\n\n /**\n * Setter for _pattern\n * @param {string} pattern\n */\n set pattern(pattern: string) {\n if (check2004ValidFormat(pattern, Regex.scorm2004.CMIFeedback)) {\n this._pattern = pattern;\n }\n }\n\n /**\n * toJSON cmi.interactions.n.correct_responses.n object\n * @return {\n * {\n * pattern: string\n * }\n * }\n */\n toJSON(): {\n pattern: string;\n } {\n this.jsonString = true;\n const result = {\n pattern: this.pattern,\n };\n delete this.jsonString;\n return result;\n }\n}\n","/**\n * Class for SCORM 2004's cmi *.score object\n */\nimport { CMIScore } from \"../common/score\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport Regex from \"../../constants/regex\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\n\nexport class Scorm2004CMIScore extends CMIScore {\n private _scaled = \"\";\n\n /**\n * Constructor for cmi *.score\n */\n constructor() {\n super({\n score_children: APIConstants.scorm2004.score_children,\n max: \"\",\n invalidErrorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n invalidTypeCode: ErrorCodes.scorm2004.TYPE_MISMATCH,\n invalidRangeCode: ErrorCodes.scorm2004.VALUE_OUT_OF_RANGE,\n decimalRegex: Regex.scorm2004.CMIDecimal,\n errorClass: Scorm2004ValidationError,\n });\n }\n\n /**\n * Getter for _scaled\n * @return {string}\n */\n get scaled(): string {\n return this._scaled;\n }\n\n /**\n * Setter for _scaled\n * @param {string} scaled\n */\n set scaled(scaled: string) {\n if (\n check2004ValidFormat(scaled, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(scaled, Regex.scorm2004.scaled_range)\n ) {\n this._scaled = scaled;\n }\n }\n\n /**\n * toJSON for cmi *.score\n *\n * @return {\n * {\n * scaled: string,\n * raw: string,\n * min: string,\n * max: string\n * }\n * }\n */\n toJSON(): {\n scaled: string;\n raw: string;\n min: string;\n max: string;\n } {\n this.jsonString = true;\n const result = {\n scaled: this.scaled,\n raw: this.raw,\n min: this.min,\n max: this.max,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_lms object\n * @extends CMIArray\n */\nexport class CMICommentsFromLMS extends CMIArray {\n /**\n * Constructor for cmi.comments_from_lms Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner object\n */\n\nexport class CMICommentsFromLearner extends CMIArray {\n /**\n * Constructor for cmi.comments_from_learner Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.comments_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class representing SCORM 2004's cmi.comments_from_learner.n and cmi.comments_from_lms.n object\n */\n\nexport class CMICommentsObject extends BaseCMI {\n private _comment = \"\";\n private _location = \"\";\n private _timestamp = \"\";\n private readonly _readOnlyAfterInit: boolean;\n\n /**\n * Constructor for cmi.comments_from_learner.n and cmi.comments_from_lms.n\n * @param {boolean} readOnlyAfterInit\n */\n constructor(readOnlyAfterInit: boolean = false) {\n super();\n this._comment = \"\";\n this._location = \"\";\n this._timestamp = \"\";\n this._readOnlyAfterInit = readOnlyAfterInit;\n }\n\n /**\n * Getter for _comment\n * @return {string}\n */\n get comment(): string {\n return this._comment;\n }\n\n /**\n * Setter for _comment\n * @param {string} comment\n */\n set comment(comment: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (\n check2004ValidFormat(comment, Regex.scorm2004.CMILangString4000, true)\n ) {\n this._comment = comment;\n }\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString250)) {\n this._location = location;\n }\n }\n }\n\n /**\n * Getter for _timestamp\n * @return {string}\n */\n get timestamp(): string {\n return this._timestamp;\n }\n\n /**\n * Setter for _timestamp\n * @param {string} timestamp\n */\n set timestamp(timestamp: string) {\n if (this.initialized && this._readOnlyAfterInit) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n if (check2004ValidFormat(timestamp, Regex.scorm2004.CMITime)) {\n this._timestamp = timestamp;\n }\n }\n }\n\n /**\n * toJSON for cmi.comments_from_learner.n object\n * @return {\n * {\n * comment: string,\n * location: string,\n * timestamp: string\n * }\n * }\n */\n toJSON(): {\n comment: string;\n location: string;\n timestamp: string;\n } {\n this.jsonString = true;\n const result = {\n comment: this.comment,\n location: this.location,\n timestamp: this.timestamp,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import { CMIArray } from \"../common/array\";\nimport APIConstants from \"../../constants/api_constants\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport Regex from \"../../constants/regex\";\n\n/**\n * Class representing SCORM 2004's `cmi.objectives` object\n * @extends CMIArray\n */\nexport class CMIObjectives extends CMIArray {\n /**\n * Constructor for `cmi.objectives` Array\n */\n constructor() {\n super({\n children: APIConstants.scorm2004.objectives_children,\n errorCode: ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n errorClass: Scorm2004ValidationError,\n });\n }\n}\n\n/**\n * Class for SCORM 2004's cmi.objectives.n object\n */\nexport class CMIObjectivesObject extends BaseCMI {\n private _id = \"\";\n private _success_status = \"unknown\";\n private _completion_status = \"unknown\";\n private _progress_measure = \"\";\n private _description = \"\";\n\n /**\n * Constructor for cmi.objectives.n\n */\n constructor() {\n super();\n this.score = new Scorm2004CMIScore();\n }\n\n public score: Scorm2004CMIScore;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.score?.initialize();\n }\n\n /**\n * Getter for _id\n * @return {string}\n */\n get id(): string {\n return this._id;\n }\n\n /**\n * Setter for _id\n * @param {string} id\n */\n set id(id: string) {\n if (check2004ValidFormat(id, Regex.scorm2004.CMILongIdentifier)) {\n this._id = id;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n }\n\n /**\n * Getter for _description\n * @return {string}\n */\n get description(): string {\n return this._description;\n }\n\n /**\n * Setter for _description\n * @param {string} description\n */\n set description(description: string) {\n if (this.initialized && this._id === \"\") {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED,\n );\n } else {\n if (\n check2004ValidFormat(\n description,\n Regex.scorm2004.CMILangString250,\n true,\n )\n ) {\n this._description = description;\n }\n }\n }\n\n /**\n * toJSON for cmi.objectives.n\n *\n * @return {\n * {\n * id: string,\n * success_status: string,\n * completion_status: string,\n * progress_measure: string,\n * description: string,\n * score: Scorm2004CMIScore\n * }\n * }\n */\n toJSON(): {\n id: string;\n success_status: string;\n completion_status: string;\n progress_measure: string;\n description: string;\n score: Scorm2004CMIScore;\n } {\n this.jsonString = true;\n const result = {\n id: this.id,\n success_status: this.success_status,\n completion_status: this.completion_status,\n progress_measure: this.progress_measure,\n description: this.description,\n score: this.score,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import APIConstants from \"../../constants/api_constants\";\nimport Regex from \"../../constants/regex\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport * as Util from \"../../utilities\";\nimport { BaseRootCMI } from \"../common/base_cmi\";\nimport { check2004ValidFormat, check2004ValidRange } from \"./validation\";\nimport { CMILearnerPreference } from \"./learner_preference\";\nimport { CMIInteractions } from \"./interactions\";\nimport { Scorm2004CMIScore } from \"./score\";\nimport { CMICommentsFromLearner, CMICommentsFromLMS } from \"./comments\";\nimport { CMIObjectives } from \"./objectives\";\n\n/**\n * Class representing cmi object for SCORM 2004\n */\nexport class CMI extends BaseRootCMI {\n /**\n * Constructor for the SCORM 2004 cmi object\n * @param {boolean} initialized\n */\n constructor(initialized: boolean = false) {\n super();\n this.learner_preference = new CMILearnerPreference();\n this.score = new Scorm2004CMIScore();\n this.comments_from_learner = new CMICommentsFromLearner();\n this.comments_from_lms = new CMICommentsFromLMS();\n this.interactions = new CMIInteractions();\n this.objectives = new CMIObjectives();\n if (initialized) this.initialize();\n }\n\n public learner_preference: CMILearnerPreference;\n public score: Scorm2004CMIScore;\n public comments_from_learner: CMICommentsFromLearner;\n public comments_from_lms: CMICommentsFromLMS;\n public interactions: CMIInteractions;\n public objectives: CMIObjectives;\n\n private __version = \"1.0\";\n private __children = APIConstants.scorm2004.cmi_children;\n private _completion_status = \"unknown\";\n private _completion_threshold = \"\";\n private _credit = \"credit\";\n private _entry = \"\";\n private _exit = \"\";\n private _launch_data = \"\";\n private _learner_id = \"\";\n private _learner_name = \"\";\n private _location = \"\";\n private _max_time_allowed = \"\";\n private _mode = \"normal\";\n private _progress_measure = \"\";\n private _scaled_passing_score = \"\";\n private _session_time = \"PT0H0M0S\";\n private _success_status = \"unknown\";\n private _suspend_data = \"\";\n private _time_limit_action = \"continue,no message\";\n private _total_time = \"\";\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.learner_preference?.initialize();\n this.score?.initialize();\n this.comments_from_learner?.initialize();\n this.comments_from_lms?.initialize();\n this.interactions?.initialize();\n this.objectives?.initialize();\n }\n\n /**\n * Getter for __version\n * @return {string}\n * @private\n */\n get _version(): string {\n return this.__version;\n }\n\n /**\n * Setter for __version. Just throws an error.\n * @param {string} _version\n * @private\n */\n set _version(_version: string) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for __children\n * @return {string}\n * @private\n */\n get _children(): string {\n return this.__children;\n }\n\n /**\n * Setter for __children. Just throws an error.\n * @param {number} _children\n * @private\n */\n set _children(_children: number) {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.READ_ONLY_ELEMENT);\n }\n\n /**\n * Getter for _completion_status\n * @return {string}\n */\n get completion_status(): string {\n return this._completion_status;\n }\n\n /**\n * Setter for _completion_status\n * @param {string} completion_status\n */\n set completion_status(completion_status: string) {\n if (check2004ValidFormat(completion_status, Regex.scorm2004.CMICStatus)) {\n this._completion_status = completion_status;\n }\n }\n\n /**\n * Getter for _completion_threshold\n * @return {string}\n */\n get completion_threshold(): string {\n return this._completion_threshold;\n }\n\n /**\n * Setter for _completion_threshold. Can only be called before initialization.\n * @param {string} completion_threshold\n */\n set completion_threshold(completion_threshold: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._completion_threshold = completion_threshold;\n }\n }\n\n /**\n * Setter for _credit\n * @return {string}\n */\n get credit(): string {\n return this._credit;\n }\n\n /**\n * Setter for _credit. Can only be called before initialization.\n * @param {string} credit\n */\n set credit(credit: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._credit = credit;\n }\n }\n\n /**\n * Getter for _entry\n * @return {string}\n */\n get entry(): string {\n return this._entry;\n }\n\n /**\n * Setter for _entry. Can only be called before initialization.\n * @param {string} entry\n */\n set entry(entry: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._entry = entry;\n }\n }\n\n /**\n * Getter for _exit. Should only be called during JSON export.\n * @return {string}\n */\n get exit(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._exit;\n }\n\n /**\n * Getter for _exit\n * @param {string} exit\n */\n set exit(exit: string) {\n if (check2004ValidFormat(exit, Regex.scorm2004.CMIExit, true)) {\n this._exit = exit;\n }\n }\n\n /**\n * Getter for _launch_data\n * @return {string}\n */\n get launch_data(): string {\n return this._launch_data;\n }\n\n /**\n * Setter for _launch_data. Can only be called before initialization.\n * @param {string} launch_data\n */\n set launch_data(launch_data: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._launch_data = launch_data;\n }\n }\n\n /**\n * Getter for _learner_id\n * @return {string}\n */\n get learner_id(): string {\n return this._learner_id;\n }\n\n /**\n * Setter for _learner_id. Can only be called before initialization.\n * @param {string} learner_id\n */\n set learner_id(learner_id: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_id = learner_id;\n }\n }\n\n /**\n * Getter for _learner_name\n * @return {string}\n */\n get learner_name(): string {\n return this._learner_name;\n }\n\n /**\n * Setter for _learner_name. Can only be called before initialization.\n * @param {string} learner_name\n */\n set learner_name(learner_name: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._learner_name = learner_name;\n }\n }\n\n /**\n * Getter for _location\n * @return {string}\n */\n get location(): string {\n return this._location;\n }\n\n /**\n * Setter for _location\n * @param {string} location\n */\n set location(location: string) {\n if (check2004ValidFormat(location, Regex.scorm2004.CMIString1000)) {\n this._location = location;\n }\n }\n\n /**\n * Getter for _max_time_allowed\n * @return {string}\n */\n get max_time_allowed(): string {\n return this._max_time_allowed;\n }\n\n /**\n * Setter for _max_time_allowed. Can only be called before initialization.\n * @param {string} max_time_allowed\n */\n set max_time_allowed(max_time_allowed: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._max_time_allowed = max_time_allowed;\n }\n }\n\n /**\n * Getter for _mode\n * @return {string}\n */\n get mode(): string {\n return this._mode;\n }\n\n /**\n * Setter for _mode. Can only be called before initialization.\n * @param {string} mode\n */\n set mode(mode: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._mode = mode;\n }\n }\n\n /**\n * Getter for _progress_measure\n * @return {string}\n */\n get progress_measure(): string {\n return this._progress_measure;\n }\n\n /**\n * Setter for _progress_measure\n * @param {string} progress_measure\n */\n set progress_measure(progress_measure: string) {\n if (\n check2004ValidFormat(progress_measure, Regex.scorm2004.CMIDecimal) &&\n check2004ValidRange(progress_measure, Regex.scorm2004.progress_range)\n ) {\n this._progress_measure = progress_measure;\n }\n }\n\n /**\n * Getter for _scaled_passing_score\n * @return {string}\n */\n get scaled_passing_score(): string {\n return this._scaled_passing_score;\n }\n\n /**\n * Setter for _scaled_passing_score. Can only be called before initialization.\n * @param {string} scaled_passing_score\n */\n set scaled_passing_score(scaled_passing_score: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._scaled_passing_score = scaled_passing_score;\n }\n }\n\n /**\n * Getter for _session_time. Should only be called during JSON export.\n * @return {string}\n */\n get session_time(): string {\n if (!this.jsonString) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.WRITE_ONLY_ELEMENT,\n );\n }\n return this._session_time;\n }\n\n /**\n * Setter for _session_time\n * @param {string} session_time\n */\n set session_time(session_time: string) {\n if (check2004ValidFormat(session_time, Regex.scorm2004.CMITimespan)) {\n this._session_time = session_time;\n }\n }\n\n /**\n * Getter for _success_status\n * @return {string}\n */\n get success_status(): string {\n return this._success_status;\n }\n\n /**\n * Setter for _success_status\n * @param {string} success_status\n */\n set success_status(success_status: string) {\n if (check2004ValidFormat(success_status, Regex.scorm2004.CMISStatus)) {\n this._success_status = success_status;\n }\n }\n\n /**\n * Getter for _suspend_data\n * @return {string}\n */\n get suspend_data(): string {\n return this._suspend_data;\n }\n\n /**\n * Setter for _suspend_data\n * @param {string} suspend_data\n */\n set suspend_data(suspend_data: string) {\n if (\n check2004ValidFormat(suspend_data, Regex.scorm2004.CMIString64000, true)\n ) {\n this._suspend_data = suspend_data;\n }\n }\n\n /**\n * Getter for _time_limit_action\n * @return {string}\n */\n get time_limit_action(): string {\n return this._time_limit_action;\n }\n\n /**\n * Setter for _time_limit_action. Can only be called before initialization.\n * @param {string} time_limit_action\n */\n set time_limit_action(time_limit_action: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._time_limit_action = time_limit_action;\n }\n }\n\n /**\n * Getter for _total_time\n * @return {string}\n */\n get total_time(): string {\n return this._total_time;\n }\n\n /**\n * Setter for _total_time. Can only be called before initialization.\n * @param {string} total_time\n */\n set total_time(total_time: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n } else {\n this._total_time = total_time;\n }\n }\n\n /**\n * Adds the current session time to the existing total time.\n *\n * @return {string} ISO8601 Duration\n */\n getCurrentTotalTime(): string {\n let sessionTime = this._session_time;\n const startTime = this.start_time;\n\n if (typeof startTime !== \"undefined\" && startTime !== null) {\n const seconds = new Date().getTime() - startTime;\n sessionTime = Util.getSecondsAsISODuration(seconds / 1000);\n }\n\n return Util.addTwoDurations(\n this._total_time,\n sessionTime,\n Regex.scorm2004.CMITimespan,\n );\n }\n\n /**\n * toJSON for cmi\n *\n * @return {\n * {\n * comments_from_learner: CMICommentsFromLearner,\n * comments_from_lms: CMICommentsFromLMS,\n * completion_status: string,\n * completion_threshold: string,\n * credit: string,\n * entry: string,\n * exit: string,\n * interactions: CMIInteractions,\n * launch_data: string,\n * learner_id: string,\n * learner_name: string,\n * learner_preference: CMILearnerPreference,\n * location: string,\n * max_time_allowed: string,\n * mode: string,\n * objectives: CMIObjectives,\n * progress_measure: string,\n * scaled_passing_score: string,\n * score: Scorm2004CMIScore,\n * session_time: string,\n * success_status: string,\n * suspend_data: string,\n * time_limit_action: string\n * }\n * }\n */\n toJSON(): {\n comments_from_learner: CMICommentsFromLearner;\n comments_from_lms: CMICommentsFromLMS;\n completion_status: string;\n completion_threshold: string;\n credit: string;\n entry: string;\n exit: string;\n interactions: CMIInteractions;\n launch_data: string;\n learner_id: string;\n learner_name: string;\n learner_preference: CMILearnerPreference;\n location: string;\n max_time_allowed: string;\n mode: string;\n objectives: CMIObjectives;\n progress_measure: string;\n scaled_passing_score: string;\n score: Scorm2004CMIScore;\n session_time: string;\n success_status: string;\n suspend_data: string;\n time_limit_action: string;\n } {\n this.jsonString = true;\n const result = {\n comments_from_learner: this.comments_from_learner,\n comments_from_lms: this.comments_from_lms,\n completion_status: this.completion_status,\n completion_threshold: this.completion_threshold,\n credit: this.credit,\n entry: this.entry,\n exit: this.exit,\n interactions: this.interactions,\n launch_data: this.launch_data,\n learner_id: this.learner_id,\n learner_name: this.learner_name,\n learner_preference: this.learner_preference,\n location: this.location,\n max_time_allowed: this.max_time_allowed,\n mode: this.mode,\n objectives: this.objectives,\n progress_measure: this.progress_measure,\n scaled_passing_score: this.scaled_passing_score,\n score: this.score,\n session_time: this.session_time,\n success_status: this.success_status,\n suspend_data: this.suspend_data,\n time_limit_action: this.time_limit_action,\n };\n delete this.jsonString;\n return result;\n }\n}\n","const ValidLanguages: string[] = [\n \"aa\",\n \"ab\",\n \"ae\",\n \"af\",\n \"ak\",\n \"am\",\n \"an\",\n \"ar\",\n \"as\",\n \"av\",\n \"ay\",\n \"az\",\n \"ba\",\n \"be\",\n \"bg\",\n \"bh\",\n \"bi\",\n \"bm\",\n \"bn\",\n \"bo\",\n \"br\",\n \"bs\",\n \"ca\",\n \"ce\",\n \"ch\",\n \"co\",\n \"cr\",\n \"cs\",\n \"cu\",\n \"cv\",\n \"cy\",\n \"da\",\n \"de\",\n \"dv\",\n \"dz\",\n \"ee\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fa\",\n \"ff\",\n \"fi\",\n \"fj\",\n \"fo\",\n \"fr\",\n \"fy\",\n \"ga\",\n \"gd\",\n \"gl\",\n \"gn\",\n \"gu\",\n \"gv\",\n \"ha\",\n \"he\",\n \"hi\",\n \"ho\",\n \"hr\",\n \"ht\",\n \"hu\",\n \"hy\",\n \"hz\",\n \"ia\",\n \"id\",\n \"ie\",\n \"ig\",\n \"ii\",\n \"ik\",\n \"io\",\n \"is\",\n \"it\",\n \"iu\",\n \"ja\",\n \"jv\",\n \"ka\",\n \"kg\",\n \"ki\",\n \"kj\",\n \"kk\",\n \"kl\",\n \"km\",\n \"kn\",\n \"ko\",\n \"kr\",\n \"ks\",\n \"ku\",\n \"kv\",\n \"kw\",\n \"ky\",\n \"la\",\n \"lb\",\n \"lg\",\n \"li\",\n \"ln\",\n \"lo\",\n \"lt\",\n \"lu\",\n \"lv\",\n \"mg\",\n \"mh\",\n \"mi\",\n \"mk\",\n \"ml\",\n \"mn\",\n \"mo\",\n \"mr\",\n \"ms\",\n \"mt\",\n \"my\",\n \"na\",\n \"nb\",\n \"nd\",\n \"ne\",\n \"ng\",\n \"nl\",\n \"nn\",\n \"no\",\n \"nr\",\n \"nv\",\n \"ny\",\n \"oc\",\n \"oj\",\n \"om\",\n \"or\",\n \"os\",\n \"pa\",\n \"pi\",\n \"pl\",\n \"ps\",\n \"pt\",\n \"qu\",\n \"rm\",\n \"rn\",\n \"ro\",\n \"ru\",\n \"rw\",\n \"sa\",\n \"sc\",\n \"sd\",\n \"se\",\n \"sg\",\n \"sh\",\n \"si\",\n \"sk\",\n \"sl\",\n \"sm\",\n \"sn\",\n \"so\",\n \"sq\",\n \"sr\",\n \"ss\",\n \"st\",\n \"su\",\n \"sv\",\n \"sw\",\n \"ta\",\n \"te\",\n \"tg\",\n \"th\",\n \"ti\",\n \"tk\",\n \"tl\",\n \"tn\",\n \"to\",\n \"tr\",\n \"ts\",\n \"tt\",\n \"tw\",\n \"ty\",\n \"ug\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"ve\",\n \"vi\",\n \"vo\",\n \"wa\",\n \"wo\",\n \"xh\",\n \"yi\",\n \"yo\",\n \"za\",\n \"zh\",\n \"zu\",\n \"aar\",\n \"abk\",\n \"ave\",\n \"afr\",\n \"aka\",\n \"amh\",\n \"arg\",\n \"ara\",\n \"asm\",\n \"ava\",\n \"aym\",\n \"aze\",\n \"bak\",\n \"bel\",\n \"bul\",\n \"bih\",\n \"bis\",\n \"bam\",\n \"ben\",\n \"tib\",\n \"bod\",\n \"bre\",\n \"bos\",\n \"cat\",\n \"che\",\n \"cha\",\n \"cos\",\n \"cre\",\n \"cze\",\n \"ces\",\n \"chu\",\n \"chv\",\n \"wel\",\n \"cym\",\n \"dan\",\n \"ger\",\n \"deu\",\n \"div\",\n \"dzo\",\n \"ewe\",\n \"gre\",\n \"ell\",\n \"eng\",\n \"epo\",\n \"spa\",\n \"est\",\n \"baq\",\n \"eus\",\n \"per\",\n \"fas\",\n \"ful\",\n \"fin\",\n \"fij\",\n \"fao\",\n \"fre\",\n \"fra\",\n \"fry\",\n \"gle\",\n \"gla\",\n \"glg\",\n \"grn\",\n \"guj\",\n \"glv\",\n \"hau\",\n \"heb\",\n \"hin\",\n \"hmo\",\n \"hrv\",\n \"hat\",\n \"hun\",\n \"arm\",\n \"hye\",\n \"her\",\n \"ina\",\n \"ind\",\n \"ile\",\n \"ibo\",\n \"iii\",\n \"ipk\",\n \"ido\",\n \"ice\",\n \"isl\",\n \"ita\",\n \"iku\",\n \"jpn\",\n \"jav\",\n \"geo\",\n \"kat\",\n \"kon\",\n \"kik\",\n \"kua\",\n \"kaz\",\n \"kal\",\n \"khm\",\n \"kan\",\n \"kor\",\n \"kau\",\n \"kas\",\n \"kur\",\n \"kom\",\n \"cor\",\n \"kir\",\n \"lat\",\n \"ltz\",\n \"lug\",\n \"lim\",\n \"lin\",\n \"lao\",\n \"lit\",\n \"lub\",\n \"lav\",\n \"mlg\",\n \"mah\",\n \"mao\",\n \"mri\",\n \"mac\",\n \"mkd\",\n \"mal\",\n \"mon\",\n \"mol\",\n \"mar\",\n \"may\",\n \"msa\",\n \"mlt\",\n \"bur\",\n \"mya\",\n \"nau\",\n \"nob\",\n \"nde\",\n \"nep\",\n \"ndo\",\n \"dut\",\n \"nld\",\n \"nno\",\n \"nor\",\n \"nbl\",\n \"nav\",\n \"nya\",\n \"oci\",\n \"oji\",\n \"orm\",\n \"ori\",\n \"oss\",\n \"pan\",\n \"pli\",\n \"pol\",\n \"pus\",\n \"por\",\n \"que\",\n \"roh\",\n \"run\",\n \"rum\",\n \"ron\",\n \"rus\",\n \"kin\",\n \"san\",\n \"srd\",\n \"snd\",\n \"sme\",\n \"sag\",\n \"slo\",\n \"sin\",\n \"slk\",\n \"slv\",\n \"smo\",\n \"sna\",\n \"som\",\n \"alb\",\n \"sqi\",\n \"srp\",\n \"ssw\",\n \"sot\",\n \"sun\",\n \"swe\",\n \"swa\",\n \"tam\",\n \"tel\",\n \"tgk\",\n \"tha\",\n \"tir\",\n \"tuk\",\n \"tgl\",\n \"tsn\",\n \"ton\",\n \"tur\",\n \"tso\",\n \"tat\",\n \"twi\",\n \"tah\",\n \"uig\",\n \"ukr\",\n \"urd\",\n \"uzb\",\n \"ven\",\n \"vie\",\n \"vol\",\n \"wln\",\n \"wol\",\n \"xho\",\n \"yid\",\n \"yor\",\n \"zha\",\n \"chi\",\n \"zho\",\n \"zul\",\n];\nexport default ValidLanguages;\n","import { BaseCMI } from \"../common/base_cmi\";\nimport { Scorm2004ValidationError } from \"../../exceptions\";\nimport ErrorCodes from \"../../constants/error_codes\";\nimport { check2004ValidFormat } from \"./validation\";\nimport Regex from \"../../constants/regex\";\nimport { NAVBoolean } from \"../../constants/enums\";\n\n/**\n * Class representing SCORM 2004's adl object\n */\nexport class ADL extends BaseCMI {\n /**\n * Constructor for adl\n */\n constructor() {\n super();\n this.nav = new ADLNav();\n }\n\n public nav: ADLNav;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.nav?.initialize();\n }\n\n /**\n * toJSON for adl\n * @return {\n * {\n * nav: ADLNav\n * }\n * }\n */\n toJSON(): {\n nav: ADLNav;\n } {\n this.jsonString = true;\n const result = {\n nav: this.nav,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's `adl.nav` object\n */\n\nexport class ADLNav extends BaseCMI {\n private _request = \"_none_\";\n\n /**\n * Constructor for `adl.nav`\n */\n constructor() {\n super();\n this.request_valid = new ADLNavRequestValid();\n }\n\n public request_valid: ADLNavRequestValid;\n\n /**\n * Called when the API has been initialized after the CMI has been created\n */\n initialize() {\n super.initialize();\n this.request_valid?.initialize();\n }\n\n /**\n * Getter for _request\n * @return {string}\n */\n get request(): string {\n return this._request;\n }\n\n /**\n * Setter for _request\n * @param {string} request\n */\n set request(request: string) {\n if (check2004ValidFormat(request, Regex.scorm2004.NAVEvent)) {\n this._request = request;\n }\n }\n\n /**\n * toJSON for adl.nav\n *\n * @return {\n * {\n * request: string\n * }\n * }\n */\n toJSON(): {\n request: string;\n } {\n this.jsonString = true;\n const result = {\n request: this.request,\n };\n delete this.jsonString;\n return result;\n }\n}\n\n/**\n * Class representing SCORM 2004's adl.nav.request_valid object\n */\n\nexport class ADLNavRequestValid extends BaseCMI {\n private _continue = \"unknown\";\n private _previous = \"unknown\";\n private _choice: {\n [key: string]: NAVBoolean;\n } = {};\n private _jump: {\n [key: string]: NAVBoolean;\n } = {};\n\n /**\n * Constructor for adl.nav.request_valid\n */\n constructor() {\n super();\n }\n\n /**\n * Getter for _continue\n * @return {string}\n */\n get continue(): string {\n return this._continue;\n }\n\n /**\n * Setter for _continue. Just throws an error.\n * @param {string} _continue\n */\n set continue(_continue: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_continue, Regex.scorm2004.NAVBoolean)) {\n this._continue = _continue;\n }\n }\n\n /**\n * Getter for _previous\n * @return {string}\n */\n get previous(): string {\n return this._previous;\n }\n\n /**\n * Setter for _previous. Just throws an error.\n * @param {string} _previous\n */\n set previous(_previous: string) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (check2004ValidFormat(_previous, Regex.scorm2004.NAVBoolean)) {\n this._previous = _previous;\n }\n }\n\n /**\n * Getter for _choice\n * @return {{ [key: string]: NAVBoolean }}\n */\n get choice(): { [key: string]: NAVBoolean } {\n return this._choice;\n }\n\n /**\n * Setter for _choice\n * @param {{ [key: string]: string }} choice\n */\n set choice(choice: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof choice !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in choice) {\n if ({}.hasOwnProperty.call(choice, key)) {\n if (\n check2004ValidFormat(choice[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._choice[key] =\n NAVBoolean[choice[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * Getter for _jump\n * @return {{ [key: string]: NAVBoolean }}\n */\n get jump(): { [key: string]: NAVBoolean } {\n return this._jump;\n }\n\n /**\n * Setter for _jump\n * @param {{ [key: string]: string }} jump\n */\n set jump(jump: { [key: string]: string }) {\n if (this.initialized) {\n throw new Scorm2004ValidationError(\n ErrorCodes.scorm2004.READ_ONLY_ELEMENT,\n );\n }\n if (typeof jump !== \"object\") {\n throw new Scorm2004ValidationError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n for (const key in jump) {\n if ({}.hasOwnProperty.call(jump, key)) {\n if (\n check2004ValidFormat(jump[key], Regex.scorm2004.NAVBoolean) &&\n check2004ValidFormat(key, Regex.scorm2004.NAVTarget)\n ) {\n this._jump[key] = NAVBoolean[jump[key] as keyof typeof NAVBoolean];\n }\n }\n }\n }\n\n /**\n * toJSON for adl.nav.request_valid\n *\n * @return {\n * {\n * previous: string,\n * continue: string\n * }\n * }\n */\n toJSON(): {\n previous: string;\n continue: string;\n } {\n this.jsonString = true;\n const result = {\n previous: this._previous,\n continue: this._continue,\n choice: this._choice,\n jump: this._jump,\n };\n delete this.jsonString;\n return result;\n }\n}\n","import BaseAPI from \"./BaseAPI\";\nimport { CMI } from \"./cmi/scorm2004/cmi\";\nimport * as Utilities from \"./utilities\";\nimport { stringMatches } from \"./utilities\";\nimport APIConstants from \"./constants/api_constants\";\nimport ErrorCodes from \"./constants/error_codes\";\nimport { CorrectResponses, ResponseType } from \"./constants/response_constants\";\nimport ValidLanguages from \"./constants/language_constants\";\nimport Regex from \"./constants/regex\";\nimport regex from \"./constants/regex\";\nimport { CMIArray } from \"./cmi/common/array\";\nimport { BaseCMI } from \"./cmi/common/base_cmi\";\nimport {\n CMIInteractionsCorrectResponsesObject,\n CMIInteractionsObject,\n CMIInteractionsObjectivesObject,\n} from \"./cmi/scorm2004/interactions\";\nimport { CMICommentsObject } from \"./cmi/scorm2004/comments\";\nimport { CMIObjectivesObject } from \"./cmi/scorm2004/objectives\";\nimport { ADL } from \"./cmi/scorm2004/adl\";\nimport {\n CommitObject,\n RefObject,\n ResultObject,\n ScoreObject,\n Settings,\n} from \"./types/api_types\";\nimport { CompletionStatus, SuccessStatus } from \"./constants/enums\";\n\n/**\n * API class for SCORM 2004\n */\nexport default class Scorm2004API extends BaseAPI {\n private _version: string = \"1.0\";\n\n /**\n * Constructor for SCORM 2004 API\n * @param {Settings} settings\n */\n constructor(settings?: Settings) {\n if (settings) {\n if (settings.mastery_override === undefined) {\n settings.mastery_override = false;\n }\n }\n\n super(ErrorCodes.scorm2004, settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n\n // Rename functions to match 2004 Spec and expose to modules\n this.Initialize = this.lmsInitialize;\n this.Terminate = this.lmsFinish;\n this.GetValue = this.lmsGetValue;\n this.SetValue = this.lmsSetValue;\n this.Commit = this.lmsCommit;\n this.GetLastError = this.lmsGetLastError;\n this.GetErrorString = this.lmsGetErrorString;\n this.GetDiagnostic = this.lmsGetDiagnostic;\n }\n\n public cmi: CMI;\n public adl: ADL;\n\n public Initialize: () => string;\n public Terminate: () => string;\n public GetValue: (CMIElement: string) => string;\n public SetValue: (CMIElement: string, value: any) => string;\n public Commit: () => string;\n public GetLastError: () => string;\n public GetErrorString: (CMIErrorCode: string | number) => string;\n public GetDiagnostic: (CMIErrorCode: string | number) => string;\n\n /**\n * Called when the API needs to be reset\n */\n reset(settings?: Settings) {\n this.commonReset(settings);\n\n this.cmi = new CMI();\n this.adl = new ADL();\n }\n\n /**\n * Getter for _version\n * @return {string}\n */\n get version(): string {\n return this._version;\n }\n\n /**\n * @return {string} bool\n */\n lmsInitialize(): string {\n this.cmi.initialize();\n return this.initialize(\"Initialize\");\n }\n\n /**\n * @return {string} bool\n */\n lmsFinish(): string {\n (async () => {\n await this.internalFinish();\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n async internalFinish(): Promise {\n const result = await this.terminate(\"Terminate\", true);\n\n if (result === APIConstants.global.SCORM_TRUE) {\n if (this.adl.nav.request !== \"_none_\") {\n const navActions: { [key: string]: string } = {\n continue: \"SequenceNext\",\n previous: \"SequencePrevious\",\n choice: \"SequenceChoice\",\n jump: \"SequenceJump\",\n exit: \"SequenceExit\",\n exitAll: \"SequenceExitAll\",\n abandon: \"SequenceAbandon\",\n abandonAll: \"SequenceAbandonAll\",\n };\n\n let request = this.adl.nav.request;\n const choiceJumpRegex = new RegExp(regex.scorm2004.NAVEvent);\n const matches = request.match(choiceJumpRegex);\n let target = \"\";\n if (matches && matches.length > 2) {\n target = matches[2];\n request = matches[1].replace(target, \"\");\n }\n const action = navActions[request];\n if (action) {\n this.processListeners(action, \"adl.nav.request\", target);\n }\n } else if (this.settings.autoProgress) {\n this.processListeners(\"SequenceNext\");\n }\n }\n\n return result;\n }\n\n /**\n * @param {string} CMIElement\n * @return {string}\n */\n lmsGetValue(CMIElement: string): string {\n const adlNavRequestRegex =\n \"^adl\\\\.nav\\\\.request_valid\\\\.(choice|jump)\\\\.{target=\\\\S{0,}([a-zA-Z0-9-_]+)}$\";\n if (stringMatches(CMIElement, adlNavRequestRegex)) {\n const matches = CMIElement.match(adlNavRequestRegex);\n const request = matches[1];\n const target = matches[2].replace(\"{target=\", \"\").replace(\"}\", \"\");\n if (request === \"choice\" || request === \"jump\") {\n if (this.settings.scoItemIdValidator) {\n return String(this.settings.scoItemIdValidator(target));\n }\n return String(this.settings.scoItemIds.includes(target));\n }\n }\n return this.getValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n lmsSetValue(CMIElement: string, value: any): string {\n return this.setValue(\"SetValue\", \"Commit\", true, CMIElement, value);\n }\n\n /**\n * Orders LMS to store all content parameters\n *\n * @return {string} bool\n */\n lmsCommit(): string {\n (async () => {\n await this.commit(\"Commit\");\n })();\n return APIConstants.global.SCORM_TRUE;\n }\n\n /**\n * Returns last error code\n *\n * @return {string}\n */\n lmsGetLastError(): string {\n return this.getLastError(\"GetLastError\");\n }\n\n /**\n * Returns the errorNumber error description\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetErrorString(CMIErrorCode: string | number): string {\n return this.getErrorString(\"GetErrorString\", CMIErrorCode);\n }\n\n /**\n * Returns a comprehensive description of the errorNumber error.\n *\n * @param {(string|number)} CMIErrorCode\n * @return {string}\n */\n lmsGetDiagnostic(CMIErrorCode: string | number): string {\n return this.getDiagnostic(\"GetDiagnostic\", CMIErrorCode);\n }\n\n /**\n * Sets a value on the CMI Object\n *\n * @param {string} CMIElement\n * @param {any} value\n * @return {string}\n */\n setCMIValue(CMIElement: string, value: any): string {\n return this._commonSetCMIValue(\"SetValue\", true, CMIElement, value);\n }\n\n /**\n * Gets or builds a new child element to add to the array.\n *\n * @param {string} CMIElement\n * @param {any} value\n * @param {boolean} foundFirstIndex\n * @return {BaseCMI|null}\n */\n getChildElement(\n CMIElement: string,\n value: any,\n foundFirstIndex: boolean,\n ): BaseCMI | null {\n if (stringMatches(CMIElement, \"cmi\\\\.objectives\\\\.\\\\d+\")) {\n return new CMIObjectivesObject();\n }\n\n if (foundFirstIndex) {\n if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.correct_responses\\\\.\\\\d+\",\n )\n ) {\n return this.createCorrectResponsesObject(CMIElement, value);\n } else if (\n stringMatches(\n CMIElement,\n \"cmi\\\\.interactions\\\\.\\\\d+\\\\.objectives\\\\.\\\\d+\",\n )\n ) {\n return new CMIInteractionsObjectivesObject();\n }\n } else if (stringMatches(CMIElement, \"cmi\\\\.interactions\\\\.\\\\d+\")) {\n return new CMIInteractionsObject();\n }\n\n if (stringMatches(CMIElement, \"cmi\\\\.comments_from_learner\\\\.\\\\d+\")) {\n return new CMICommentsObject();\n } else if (stringMatches(CMIElement, \"cmi\\\\.comments_from_lms\\\\.\\\\d+\")) {\n return new CMICommentsObject(true);\n }\n\n return null;\n }\n\n private createCorrectResponsesObject(\n CMIElement: string,\n value: any,\n ): BaseCMI | null {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const interaction = this.cmi.interactions.childArray[index];\n\n if (this.isInitialized()) {\n if (!interaction.type) {\n this.throwSCORMError(ErrorCodes.scorm2004.DEPENDENCY_NOT_ESTABLISHED);\n } else {\n this.checkDuplicateChoiceResponse(interaction, value);\n const response_type = CorrectResponses[interaction.type];\n if (response_type) {\n this.checkValidResponseType(response_type, value, interaction.type);\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Incorrect Response Type: \" + interaction.type,\n );\n }\n }\n }\n\n if (this.lastErrorCode === \"0\") {\n return new CMIInteractionsCorrectResponsesObject();\n }\n\n return null;\n }\n\n /**\n * Checks for valid response types\n * @param {object} response_type\n * @param {any} value\n * @param {string} interaction_type\n */\n checkValidResponseType(\n response_type: ResponseType,\n value: any,\n interaction_type: string,\n ) {\n let nodes = [];\n if (response_type?.delimiter) {\n nodes = String(value).split(response_type.delimiter);\n } else {\n nodes[0] = value;\n }\n\n if (nodes.length > 0 && nodes.length <= response_type.max) {\n this.checkCorrectResponseValue(interaction_type, nodes, value);\n } else if (nodes.length > response_type.max) {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Too Long\",\n );\n }\n }\n\n /**\n * Checks for duplicate 'choice' responses.\n * @param {CMIInteractionsObject} interaction\n * @param {any} value\n */\n checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any) {\n const interaction_count = interaction.correct_responses._count;\n if (interaction.type === \"choice\") {\n for (\n let i = 0;\n i < interaction_count && this.lastErrorCode === \"0\";\n i++\n ) {\n const response = interaction.correct_responses.childArray[i];\n if (response.pattern === value) {\n this.throwSCORMError(ErrorCodes.scorm2004.GENERAL_SET_FAILURE);\n }\n }\n }\n }\n\n /**\n * Validate correct response.\n * @param {string} CMIElement\n * @param {*} value\n */\n validateCorrectResponse(CMIElement: string, value: any) {\n const parts = CMIElement.split(\".\");\n const index = Number(parts[2]);\n const pattern_index = Number(parts[4]);\n const interaction = this.cmi.interactions.childArray[index];\n\n const interaction_count = interaction.correct_responses._count;\n this.checkDuplicateChoiceResponse(interaction, value);\n\n const response_type = CorrectResponses[interaction.type];\n if (\n typeof response_type.limit === \"undefined\" ||\n interaction_count <= response_type.limit\n ) {\n this.checkValidResponseType(response_type, value, interaction.type);\n\n if (\n (this.lastErrorCode === \"0\" &&\n (!response_type.duplicate ||\n !this.checkDuplicatedPattern(\n interaction.correct_responses,\n pattern_index,\n value,\n ))) ||\n (this.lastErrorCode === \"0\" && value === \"\")\n ) {\n // do nothing, we want the inverse\n } else {\n if (this.lastErrorCode === \"0\") {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Pattern Already Exists\",\n );\n }\n }\n } else {\n this.throwSCORMError(\n ErrorCodes.scorm2004.GENERAL_SET_FAILURE,\n \"Data Model Element Collection Limit Reached\",\n );\n }\n }\n\n /**\n * Gets a value from the CMI Object\n *\n * @param {string} CMIElement\n * @return {*}\n */\n getCMIValue(CMIElement: string): any {\n return this._commonGetCMIValue(\"GetValue\", true, CMIElement);\n }\n\n /**\n * Returns the message that corresponds to errorNumber.\n *\n * @param {(string|number)} errorNumber\n * @param {boolean} detail\n * @return {string}\n */\n getLmsErrorMessageDetails(\n errorNumber: string | number,\n detail: boolean,\n ): string {\n let basicMessage = \"\";\n let detailMessage = \"\";\n\n // Set error number to string since inconsistent from modules if string or number\n errorNumber = String(errorNumber);\n if (APIConstants.scorm2004.error_descriptions[errorNumber]) {\n basicMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].basicMessage;\n detailMessage =\n APIConstants.scorm2004.error_descriptions[errorNumber].detailMessage;\n }\n\n return detail ? detailMessage : basicMessage;\n }\n\n /**\n * Check to see if a correct_response value has been duplicated\n * @param {CMIArray} correct_response\n * @param {number} current_index\n * @param {*} value\n * @return {boolean}\n */\n checkDuplicatedPattern(\n correct_response: CMIArray,\n current_index: number,\n value: any,\n ): boolean {\n let found = false;\n const count = correct_response._count;\n for (let i = 0; i < count && !found; i++) {\n if (i !== current_index && correct_response.childArray[i] === value) {\n found = true;\n }\n }\n return found;\n }\n\n /**\n * Checks for a valid correct_response value\n * @param {string} interaction_type\n * @param {Array} nodes\n * @param {*} value\n */\n checkCorrectResponseValue(\n interaction_type: string,\n nodes: Array,\n value: any,\n ) {\n const response = CorrectResponses[interaction_type];\n const formatRegex = new RegExp(response.format);\n for (let i = 0; i < nodes.length && this.lastErrorCode === \"0\"; i++) {\n if (\n interaction_type.match(\n \"^(fill-in|long-fill-in|matching|performance|sequencing)$\",\n )\n ) {\n nodes[i] = this.removeCorrectResponsePrefixes(nodes[i]);\n }\n\n if (response?.delimiter2) {\n const values = nodes[i].split(response.delimiter2);\n if (values.length === 2) {\n const matches = values[0].match(formatRegex);\n if (!matches) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (\n !response.format2 ||\n !values[1].match(new RegExp(response.format2))\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n } else {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n const matches = nodes[i].match(formatRegex);\n if (\n (!matches && value !== \"\") ||\n (!matches && interaction_type === \"true-false\")\n ) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n } else {\n if (interaction_type === \"numeric\" && nodes.length > 1) {\n if (Number(nodes[0]) > Number(nodes[1])) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n } else {\n if (nodes[i] !== \"\" && response.unique) {\n for (let j = 0; j < i && this.lastErrorCode === \"0\"; j++) {\n if (nodes[i] === nodes[j]) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Remove prefixes from correct_response\n * @param {string} node\n * @return {*}\n */\n removeCorrectResponsePrefixes(node: string): any {\n let seenOrder = false;\n let seenCase = false;\n let seenLang = false;\n\n const prefixRegex = new RegExp(\n \"^({(lang|case_matters|order_matters)=([^}]+)})\",\n );\n let matches = node.match(prefixRegex);\n let langMatches = null;\n while (matches) {\n switch (matches[2]) {\n case \"lang\":\n langMatches = node.match(Regex.scorm2004.CMILangcr);\n if (langMatches) {\n const lang = langMatches[3];\n if (lang !== undefined && lang.length > 0) {\n if (!ValidLanguages.includes(lang.toLowerCase())) {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n }\n seenLang = true;\n break;\n case \"case_matters\":\n if (!seenLang && !seenOrder && !seenCase) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenCase = true;\n break;\n case \"order_matters\":\n if (!seenCase && !seenLang && !seenOrder) {\n if (matches[3] !== \"true\" && matches[3] !== \"false\") {\n this.throwSCORMError(ErrorCodes.scorm2004.TYPE_MISMATCH);\n }\n }\n\n seenOrder = true;\n break;\n }\n node = node.substring(matches[1].length);\n matches = node.match(prefixRegex);\n }\n\n return node;\n }\n\n /**\n * Replace the whole API with another\n * @param {Scorm2004API} newAPI\n */\n replaceWithAnotherScormAPI(newAPI: Scorm2004API) {\n // Data Model\n this.cmi = newAPI.cmi;\n this.adl = newAPI.adl;\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n *\n * @param {boolean} terminateCommit\n * @return {object|Array}\n */\n renderCommitCMI(terminateCommit: boolean): object | Array {\n const cmiExport: RefObject = this.renderCMIToJSONObject();\n\n if (terminateCommit) {\n cmiExport.cmi.total_time = this.cmi.getCurrentTotalTime();\n }\n\n const result = [];\n const flattened: RefObject = Utilities.flatten(cmiExport);\n switch (this.settings.dataCommitFormat) {\n case \"flattened\":\n return Utilities.flatten(cmiExport);\n case \"params\":\n for (const item in flattened) {\n if ({}.hasOwnProperty.call(flattened, item)) {\n result.push(`${item}=${flattened[item]}`);\n }\n }\n return result;\n case \"json\":\n default:\n return cmiExport;\n }\n }\n\n /**\n * Render the cmi object to the proper format for LMS commit\n * @param {boolean} terminateCommit\n * @return {CommitObject}\n */\n renderCommitObject(terminateCommit: boolean): CommitObject {\n const cmiExport = this.renderCommitCMI(terminateCommit);\n const totalTimeDuration = this.cmi.getCurrentTotalTime();\n const totalTimeSeconds = Utilities.getDurationAsSeconds(\n totalTimeDuration,\n Regex.scorm2004.CMITimespan,\n );\n\n let completionStatus = CompletionStatus.unknown;\n let successStatus = SuccessStatus.unknown;\n if (this.cmi.completion_status) {\n if (this.cmi.completion_status === \"completed\") {\n completionStatus = CompletionStatus.completed;\n } else if (this.cmi.completion_status === \"incomplete\") {\n completionStatus = CompletionStatus.incomplete;\n }\n }\n if (this.cmi.success_status) {\n if (this.cmi.success_status === \"passed\") {\n successStatus = SuccessStatus.passed;\n } else if (this.cmi.success_status === \"failed\") {\n successStatus = SuccessStatus.failed;\n }\n }\n\n const score = this.cmi.score;\n let scoreObject: ScoreObject = null;\n if (score) {\n scoreObject = {};\n\n if (!Number.isNaN(Number.parseFloat(score.raw))) {\n scoreObject.raw = Number.parseFloat(score.raw);\n }\n if (!Number.isNaN(Number.parseFloat(score.min))) {\n scoreObject.min = Number.parseFloat(score.min);\n }\n if (!Number.isNaN(Number.parseFloat(score.max))) {\n scoreObject.max = Number.parseFloat(score.max);\n }\n if (!Number.isNaN(Number.parseFloat(score.scaled))) {\n scoreObject.scaled = Number.parseFloat(score.scaled);\n }\n }\n\n const commitObject: CommitObject = {\n completionStatus: completionStatus,\n successStatus: successStatus,\n totalTimeSeconds: totalTimeSeconds,\n runtimeData: cmiExport,\n };\n if (scoreObject) {\n commitObject.score = scoreObject;\n }\n return commitObject;\n }\n\n /**\n * Attempts to store the data to the LMS\n *\n * @param {boolean} terminateCommit\n * @return {ResultObject}\n */\n async storeData(terminateCommit: boolean): Promise {\n if (terminateCommit) {\n if (this.cmi.mode === \"normal\") {\n if (this.cmi.credit === \"credit\") {\n if (this.cmi.completion_threshold && this.cmi.progress_measure) {\n if (this.cmi.progress_measure >= this.cmi.completion_threshold) {\n this.cmi.completion_status = \"completed\";\n } else {\n this.cmi.completion_status = \"incomplete\";\n }\n }\n if (this.cmi.scaled_passing_score && this.cmi.score.scaled) {\n if (this.cmi.score.scaled >= this.cmi.scaled_passing_score) {\n this.cmi.success_status = \"passed\";\n } else {\n this.cmi.success_status = \"failed\";\n }\n }\n }\n }\n }\n\n let navRequest = false;\n if (\n this.adl.nav.request !== this.startingData?.adl?.nav?.request &&\n this.adl.nav.request !== \"_none_\"\n ) {\n this.adl.nav.request = encodeURIComponent(this.adl.nav.request);\n navRequest = true;\n }\n\n const shouldTerminateCommit =\n terminateCommit || this.settings.alwaysSendTotalTime;\n const commitObject = this.settings.renderCommonCommitFields\n ? this.renderCommitObject(shouldTerminateCommit)\n : this.renderCommitCMI(shouldTerminateCommit);\n\n if (this.apiLogLevel === APIConstants.global.LOG_LEVEL_DEBUG) {\n console.debug(\n \"Commit (terminated: \" + (terminateCommit ? \"yes\" : \"no\") + \"): \",\n );\n console.debug(commitObject);\n }\n if (typeof this.settings.lmsCommitUrl === \"string\") {\n const result = await this.processHttpRequest(\n this.settings.lmsCommitUrl,\n commitObject,\n terminateCommit,\n );\n\n // check if this is a sequencing call, and then call the necessary JS\n {\n if (\n navRequest &&\n result.navRequest !== undefined &&\n result.navRequest !== \"\"\n ) {\n Function(`\"use strict\";(() => { ${result.navRequest} })()`)();\n }\n }\n return result;\n } else {\n return {\n result: APIConstants.global.SCORM_TRUE,\n errorCode: 0,\n };\n }\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","DefaultSettings","autocommit","autocommitSeconds","asyncCommit","sendFullCommit","lmsCommitUrl","dataCommitFormat","commitRequestDataType","autoProgress","logLevel","A","global","LOG_LEVEL_ERROR","selfReportSessionTime","alwaysSendTotalTime","renderCommonCommitFields","strict_errors","xhrHeaders","xhrWithCredentials","responseHandler","response","JSON","parse","text","httpResult","hasOwnProperty","call","result","errorCode","SCORM_TRUE","status","SCORM_FALSE","requestHandler","commitObject","onLogMessage","messageLevel","logMessage","console","error","LOG_LEVEL_WARNING","warn","LOG_LEVEL_INFO","info","LOG_LEVEL_DEBUG","debug","log","scoItemIds","scoItemIdValidator","API","when","callback","_cancelled","this","_API","_timeout","setTimeout","wrapper","bind","_callback","cancel","clearTimeout","commit","error_codes","settings","_settings","BaseAPI","TypeError","currentState","STATE_NOT_INITIALIZED","lastErrorCode","listenerArray","_error_codes","apiLogLevel","commonReset","initialize","callbackName","initializeMessage","terminationMessage","returnValue","isInitialized","throwSCORMError","INITIALIZED","isTerminated","TERMINATED","cmi","setStartTime","STATE_INITIALIZED","processListeners","apiLog","clearSCORMError","functionName","CMIElement","terminate","checkTerminated","checkState","TERMINATION_BEFORE_INIT","MULTIPLE_TERMINATION","STATE_TERMINATED","storeData","getValue","RETRIEVE_BEFORE_INIT","RETRIEVE_AFTER_TERM","getCMIValue","e","handleValueAccessException","undefined","setValue","commitCallback","value","String","STORE_BEFORE_INIT","STORE_AFTER_TERM","setCMIValue","scheduleCommit","clearScheduledCommit","COMMIT_BEFORE_INIT","COMMIT_AFTER_TERM","getLastError","getErrorString","CMIErrorCode","getLmsErrorMessageDetails","getDiagnostic","beforeInitError","afterTermError","isNotInitialized","_errorNumber","_detail","Error","_CMIElement","_value","_commonSetCMIValue","methodName","scorm2004","structure","split","refObject","foundFirstIndex","invalidErrorMessage","invalidErrorCode","UNDEFINED_DATA_MODEL","GENERAL","idx","length","attribute","substring","READ_ONLY_ELEMENT","_checkObjectHasProperty","validateCorrectResponse","index","parseInt","isNaN","item","childArray","newChild","getChildElement","initialized","push","_commonGetCMIValue","uninitializedErrorMessage","_isTargetValid","target","VALUE_NOT_INITIALIZED","scorm12","CHILDREN_ERROR","COUNT_ERROR","on","listenerName","listenerFunctions","i","listenerSplit","replace","off","removeIndex","findIndex","obj","splice","clear","filter","listener","functionsMatch","listenerHasCMIElement","CMIElementsMatch","indexOf","errorNumber","message","success","loadFromFlattenedJSON","json","int_pattern","obj_pattern","Object","keys","map","key","sort","test","a","c","testPattern","forEach","element","loadFromJSON","a_pattern","c_match","a_match","match","a_num","Number","c_num","startingData","currentCMIElement","constructor","renderCMIToJSONString","stringify","k","v","renderCMIToJSONObject","processHttpRequest","url","params","immediate","api","genericError","performFetch","then","transformResponse","process","debouncedProcess","func","wait","timeout","context","callNow","apply","args","debounce","ScheduledCommit","getOwnPropertyDescriptor","getPrototypeOf","fetch","method","body","Array","join","headers","credentials","keepalive","scorm12_error_codes","__children","children","_errorCode","_errorClass","errorClass","_children","_count","toJSON","jsonString","_initialized","_start_time","Date","getTime","BaseCMI","scorm12_constants","scorm12_regex","_raw","_min","score_children","__score_range","score_range","_max","max","__invalid_error_code","INVALID_SET_VALUE","__invalid_type_code","invalidTypeCode","TYPE_MISMATCH","__invalid_range_code","invalidRangeCode","VALUE_OUT_OF_RANGE","__decimal_regex","decimalRegex","CMIDecimal","__error_class","raw","min","checkValidFormat","regexPattern","allowEmptyString","formatRegex","RegExp","matches","checkValidRange","rangePattern","ranges","cmi_children","core_children","comments_children","objectives_children","correct_responses_children","student_data_children","student_preference_children","interactions_children","error_descriptions","basicMessage","detailMessage","APIConstants","LOG_LEVEL_NONE","aicc","student_demographics_children","tries_children","attempt_records_children","paths_children","NAVBoolean","SuccessStatus","CompletionStatus","INITIALIZATION_FAILED","TERMINATION_FAILURE","ARGUMENT_ERROR","GENERAL_GET_FAILURE","GENERAL_SET_FAILURE","GENERAL_COMMIT_FAILURE","UNIMPLEMENTED_ELEMENT","WRITE_ONLY_ELEMENT","DEPENDENCY_NOT_ESTABLISHED","ErrorCodes","MULTIPLE_TERMINATIONS","CMIString256","CMIString4096","CMITime","CMITimespan","CMIInteger","CMISInteger","CMIIdentifier","CMIFeedback","CMIIndex","CMIStatus","CMIStatus2","CMIExit","CMIType","CMIResult","NAVEvent","audio_range","speed_range","weighting_range","text_range","Regex","CMIString200","CMIString250","CMIString1000","CMIString4000","CMIString64000","CMILang","CMILangString250","CMILangcr","CMILangString250cr","CMILangString4000","CMIShortIdentifier","CMILongIdentifier","CMIIndexStore","CMICStatus","CMISStatus","NAVTarget","scaled_range","progress_range","scorm12_errors","aicc_errors","scorm2004_errors","toString","name","setMessage","errorMessage","detailedMessage","_detailedMessage","_errorMessage","BaseScormValidationError","ValidationError","SECONDS_PER_HOUR","designations","D","H","M","S","getSecondsAsISODuration","seconds","duration","remainder","designationsKey","current_seconds","Math","floor","countDecimals","toFixed","getDurationAsSeconds","durationRegex","exec","years","days","hours","minutes","addTwoDurations","first","second","regex","flatten","data","recurse","cur","prop","isArray","l","isEmpty","p","unflatten","m","num","formatMessage","messageString","fillChars","j","stringMatches","str","tester","extendStatics","d","b","setPrototypeOf","__proto__","prototype","__extends","__","create","__assign","assign","t","s","n","arguments","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","done","__generator","f","y","_","label","sent","trys","ops","g","Iterator","verb","Symbol","iterator","op","pop","SuppressedError","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","definition","o","defineProperty","enumerable","get","r","toStringTag","check2004ValidFormat","check2004ValidRange","_audio_level","_language","_delivery_speed","_audio_captioning","audio_level","language","delivery_speed","audio_captioning","scorm2004_regex","LearnerResponses","format","delimiter","unique","choice","matching","format2","delimiter2","performance","sequencing","likert","numeric","other","CorrectResponses","duplicate","limit","delimiter3","_id","_type","_timestamp","_weighting","_learner_response","_result","_latency","_description","objectives","correct_responses","id","type","timestamp","weighting","learner_response","nodes","response_type","values","latency","description","_pattern","pattern","_scaled","scaled","readOnlyAfterInit","_comment","_location","_readOnlyAfterInit","comment","location","_success_status","_completion_status","_progress_measure","score","Scorm2004CMIScore","success_status","completion_status","progress_measure","__version","_completion_threshold","_credit","_entry","_exit","_launch_data","_learner_id","_learner_name","_max_time_allowed","_mode","_scaled_passing_score","_session_time","_suspend_data","_time_limit_action","_total_time","learner_preference","CMILearnerPreference","comments_from_learner","CMICommentsFromLearner","comments_from_lms","CMICommentsFromLMS","interactions","CMIInteractions","CMIObjectives","_version","completion_threshold","credit","entry","exit","launch_data","learner_id","learner_name","max_time_allowed","mode","scaled_passing_score","session_time","suspend_data","time_limit_action","total_time","getCurrentTotalTime","sessionTime","startTime","start_time","nav","ADLNav","_request","request_valid","ADLNavRequestValid","request","_continue","_previous","_choice","_jump","jump","previous","continue","mastery_override","CMI","adl","ADL","Initialize","lmsInitialize","Terminate","lmsFinish","GetValue","lmsGetValue","SetValue","lmsSetValue","Commit","lmsCommit","GetLastError","lmsGetLastError","GetErrorString","lmsGetErrorString","GetDiagnostic","lmsGetDiagnostic","reset","internalFinish","navActions","exitAll","abandon","abandonAll","choiceJumpRegex","action","adlNavRequestRegex","includes","CMIObjectivesObject","createCorrectResponsesObject","CMIInteractionsObjectivesObject","CMIInteractionsObject","CMICommentsObject","parts","interaction","checkDuplicateChoiceResponse","checkValidResponseType","CMIInteractionsCorrectResponsesObject","interaction_type","checkCorrectResponseValue","interaction_count","pattern_index","checkDuplicatedPattern","detail","correct_response","current_index","found","count","removeCorrectResponsePrefixes","node","seenOrder","seenCase","seenLang","prefixRegex","langMatches","lang","toLowerCase","replaceWithAnotherScormAPI","newAPI","renderCommitCMI","terminateCommit","cmiExport","flattened","renderCommitObject","totalTimeDuration","totalTimeSeconds","completionStatus","unknown","successStatus","completed","incomplete","passed","failed","scoreObject","parseFloat","runtimeData","navRequest","encodeURIComponent","shouldTerminateCommit","Function"],"sourceRoot":""} \ No newline at end of file diff --git a/src/ScormAgain.ts b/src/ScormAgain.ts new file mode 100644 index 0000000..8b839c4 --- /dev/null +++ b/src/ScormAgain.ts @@ -0,0 +1,5 @@ +import AICC from "./AICC"; +import Scorm12API from "./Scorm12API"; +import Scorm2004API from "./Scorm2004API"; + +export { AICC, Scorm12API, Scorm2004API }; diff --git a/src/exports/aicc.js b/src/exports/aicc.js deleted file mode 100644 index 48eafe8..0000000 --- a/src/exports/aicc.js +++ /dev/null @@ -1,5 +0,0 @@ -import AICC from "../AICC.ts"; - -window.AICC = AICC; - -export { AICC }; diff --git a/src/exports/scorm-again.js b/src/exports/scorm-again.js deleted file mode 100644 index 28a0255..0000000 --- a/src/exports/scorm-again.js +++ /dev/null @@ -1,9 +0,0 @@ -import Scorm2004API from "../Scorm2004API.ts"; -import Scorm12API from "../Scorm12API.ts"; -import AICC from "../AICC.ts"; - -window.Scorm12API = Scorm12API; -window.Scorm2004API = Scorm2004API; -window.AICC = AICC; - -export { Scorm12API, Scorm2004API, AICC }; diff --git a/src/exports/scorm12.js b/src/exports/scorm12.js deleted file mode 100644 index 095e0b5..0000000 --- a/src/exports/scorm12.js +++ /dev/null @@ -1,5 +0,0 @@ -import Scorm12API from "../Scorm12API.ts"; - -window.Scorm12API = Scorm12API; - -export { Scorm12API }; diff --git a/src/exports/scorm2004.js b/src/exports/scorm2004.js deleted file mode 100644 index 2fb29df..0000000 --- a/src/exports/scorm2004.js +++ /dev/null @@ -1,5 +0,0 @@ -import Scorm2004API from "../Scorm2004API.ts"; - -window.Scorm2004API = Scorm2004API; - -export { Scorm2004API }; diff --git a/webpack.config.js b/webpack.config.js index 7e84061..d46d93a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -18,14 +18,14 @@ export default { mode: "production", devtool: "source-map", entry: { - aicc: "./src/exports/aicc.js", - scorm12: "./src/exports/scorm12.js", - scorm2004: "./src/exports/scorm2004.js", - "scorm-again": "./src/exports/scorm-again.js", - "aicc.min": "./src/exports/aicc.js", - "scorm12.min": "./src/exports/scorm12.js", - "scorm2004.min": "./src/exports/scorm2004.js", - "scorm-again.min": "./src/exports/scorm-again.js", + aicc: "./src/AICC.ts", + scorm12: "./src/Scorm12API.ts", + scorm2004: "./src/Scorm2004API.ts", + "scorm-again": "./src/ScormAgain.ts", + "aicc.min": "./src/AICC.ts", + "scorm12.min": "./src/Scorm12API.ts", + "scorm2004.min": "./src/Scorm2004API.ts", + "scorm-again.min": "./src/ScormAgain.ts", }, target: ["web", "es5"], module: {