scorm-again 3.1.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +3 -1
  2. package/dist/cross-frame-api.js +6 -13
  3. package/dist/cross-frame-api.js.map +1 -1
  4. package/dist/cross-frame-api.min.js +1 -1
  5. package/dist/cross-frame-lms.js +2 -6
  6. package/dist/cross-frame-lms.js.map +1 -1
  7. package/dist/esm/scorm-again.js +1128 -198
  8. package/dist/esm/scorm-again.js.map +1 -1
  9. package/dist/esm/scorm-again.min.js +1 -1
  10. package/dist/esm/scorm-again.min.js.map +1 -1
  11. package/dist/esm/scorm12.js +60 -13
  12. package/dist/esm/scorm12.js.map +1 -1
  13. package/dist/esm/scorm12.min.js +1 -1
  14. package/dist/esm/scorm12.min.js.map +1 -1
  15. package/dist/esm/scorm2004.js +1128 -198
  16. package/dist/esm/scorm2004.js.map +1 -1
  17. package/dist/esm/scorm2004.min.js +1 -1
  18. package/dist/esm/scorm2004.min.js.map +1 -1
  19. package/dist/scorm-again.js +2088 -1465
  20. package/dist/scorm-again.js.map +1 -1
  21. package/dist/scorm-again.min.js +1 -1
  22. package/dist/scorm12.js +347 -420
  23. package/dist/scorm12.js.map +1 -1
  24. package/dist/scorm12.min.js +1 -1
  25. package/dist/scorm2004.js +1983 -1301
  26. package/dist/scorm2004.js.map +1 -1
  27. package/dist/scorm2004.min.js +1 -1
  28. package/dist/types/BaseAPI.d.ts +1 -1
  29. package/dist/types/Scorm2004API.d.ts +11 -0
  30. package/dist/types/cmi/scorm2004/sequencing/activity.d.ts +47 -5
  31. package/dist/types/cmi/scorm2004/sequencing/handlers/rte_data_transfer.d.ts +1 -0
  32. package/dist/types/cmi/scorm2004/sequencing/objectives/global_objective_synchronizer.d.ts +17 -1
  33. package/dist/types/cmi/scorm2004/sequencing/sequencing_rules.d.ts +6 -1
  34. package/dist/types/cmi/scorm2004/sequencing/traversal/flow_traversal_service.d.ts +5 -2
  35. package/dist/types/constants/regex.d.ts +1 -0
  36. package/dist/types/interfaces/services.d.ts +1 -1
  37. package/dist/types/services/AsynchronousHttpService.d.ts +1 -0
  38. package/dist/types/services/ErrorHandlingService.d.ts +4 -4
  39. package/dist/types/services/SynchronousHttpService.d.ts +1 -0
  40. package/dist/types/types/api_types.d.ts +16 -0
  41. package/dist/types/types/sequencing_types.d.ts +7 -0
  42. package/dist/types/utilities/core.d.ts +6 -1
  43. package/package.json +4 -4
package/dist/scorm12.js CHANGED
@@ -13,7 +13,9 @@ this.Scorm12API = (function () {
13
13
  if (Array.isArray(arr)) return _array_like_to_array$5(arr);
14
14
  }
15
15
  function _iterable_to_array$3(iter) {
16
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
16
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
17
+ return Array.from(iter);
18
+ }
17
19
  }
18
20
  function _iterable_to_array_limit$2(arr, i) {
19
21
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
@@ -40,10 +42,10 @@ this.Scorm12API = (function () {
40
42
  return _arr;
41
43
  }
42
44
  function _non_iterable_rest$2() {
43
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
45
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
44
46
  }
45
47
  function _non_iterable_spread$3() {
46
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
48
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
47
49
  }
48
50
  function _sliced_to_array$2(arr, i) {
49
51
  return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$2();
@@ -61,6 +63,24 @@ this.Scorm12API = (function () {
61
63
  }
62
64
  var SECONDS_PER_MINUTE = 60;
63
65
  var SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE;
66
+ var CORS_SAFELISTED_CONTENT_TYPES = [
67
+ "text/plain",
68
+ "application/x-www-form-urlencoded",
69
+ "multipart/form-data"
70
+ ];
71
+ function isCorsSafelistedContentType(contentType) {
72
+ var _split_;
73
+ var essence = ((_split_ = (contentType || "").split(";")[0]) !== null && _split_ !== void 0 ? _split_ : "").trim().toLowerCase();
74
+ return CORS_SAFELISTED_CONTENT_TYPES.includes(essence);
75
+ }
76
+ function isCrossOriginUrl(url) {
77
+ if (typeof location === "undefined" || !location || !location.origin) return false;
78
+ try {
79
+ return new URL(url, location.href).origin !== location.origin;
80
+ } catch (unused) {
81
+ return false;
82
+ }
83
+ }
64
84
  var getSecondsAsHHMMSS = function getSecondsAsHHMMSS(totalSeconds) {
65
85
  if (!totalSeconds || totalSeconds <= 0) {
66
86
  return "00:00:00";
@@ -217,15 +237,21 @@ this.Scorm12API = (function () {
217
237
  }
218
238
  return new RegExp(tester).test(str);
219
239
  }
220
- function memoize(fn, keyFn) {
240
+ function memoize(fn, keyFn, options) {
221
241
  var cache = /* @__PURE__ */ new Map();
222
242
  return function() {
223
243
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
224
244
  args[_key] = arguments[_key];
225
245
  }
226
246
  var key = keyFn ? keyFn.apply(void 0, _to_consumable_array$3(args)) : JSON.stringify(args);
247
+ if ((options === null || options === void 0 ? void 0 : options.maxKeyLength) !== void 0 && key.length > options.maxKeyLength) {
248
+ return fn.apply(void 0, _to_consumable_array$3(args));
249
+ }
227
250
  return cache.has(key) ? cache.get(key) : function() {
228
251
  var result = fn.apply(void 0, _to_consumable_array$3(args));
252
+ if ((options === null || options === void 0 ? void 0 : options.maxEntries) !== void 0 && cache.size >= options.maxEntries) {
253
+ cache.delete(cache.keys().next().value);
254
+ }
229
255
  cache.set(key, result);
230
256
  return result;
231
257
  }();
@@ -242,9 +268,7 @@ this.Scorm12API = (function () {
242
268
  };
243
269
 
244
270
  function _assert_this_initialized$d(self) {
245
- if (self === void 0) {
246
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
247
- }
271
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
248
272
  return self;
249
273
  }
250
274
  function _call_super$d(_this, derived, args) {
@@ -252,9 +276,7 @@ this.Scorm12API = (function () {
252
276
  return _possible_constructor_return$d(_this, _is_native_reflect_construct$d() ? Reflect.construct(derived, args || [], _get_prototype_of$d(_this).constructor) : derived.apply(_this, args));
253
277
  }
254
278
  function _class_call_check$q(instance, Constructor) {
255
- if (!(instance instanceof Constructor)) {
256
- throw new TypeError("Cannot call a class as a function");
257
- }
279
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
258
280
  }
259
281
  function _defineProperties$p(target, props) {
260
282
  for(var i = 0; i < props.length; i++){
@@ -288,10 +310,16 @@ this.Scorm12API = (function () {
288
310
  });
289
311
  if (superClass) _set_prototype_of$d(subClass, superClass);
290
312
  }
313
+ function _is_native_reflect_construct$d() {
314
+ try {
315
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
316
+ } catch (_) {}
317
+ return (_is_native_reflect_construct$d = function() {
318
+ return !!result;
319
+ })();
320
+ }
291
321
  function _possible_constructor_return$d(self, call) {
292
- if (call && (_type_of$o(call) === "object" || typeof call === "function")) {
293
- return call;
294
- }
322
+ if (call && (_type_of$o(call) === "object" || typeof call === "function")) return call;
295
323
  return _assert_this_initialized$d(self);
296
324
  }
297
325
  function _set_prototype_of$d(o, p) {
@@ -305,14 +333,6 @@ this.Scorm12API = (function () {
305
333
  "@swc/helpers - typeof";
306
334
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
307
335
  }
308
- function _is_native_reflect_construct$d() {
309
- try {
310
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
311
- } catch (_) {}
312
- return (_is_native_reflect_construct$d = function() {
313
- return !!result;
314
- })();
315
- }
316
336
  var __defProp$m = Object.defineProperty;
317
337
  var __defNormalProp$m = function __defNormalProp(obj, key, value) {
318
338
  return key in obj ? __defProp$m(obj, key, {
@@ -384,7 +404,7 @@ this.Scorm12API = (function () {
384
404
  */ key: "setStartTime",
385
405
  value: function setStartTime() {
386
406
  if (this._start_time === void 0) {
387
- this._start_time = /* @__PURE__ */ new Date().getTime();
407
+ this._start_time = (/* @__PURE__ */ new Date()).getTime();
388
408
  } else {
389
409
  throw new Error("Start time has already been set.");
390
410
  }
@@ -395,9 +415,7 @@ this.Scorm12API = (function () {
395
415
  }(BaseCMI);
396
416
 
397
417
  function _assert_this_initialized$c(self) {
398
- if (self === void 0) {
399
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
400
- }
418
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
401
419
  return self;
402
420
  }
403
421
  function _call_super$c(_this, derived, args) {
@@ -405,14 +423,11 @@ this.Scorm12API = (function () {
405
423
  return _possible_constructor_return$c(_this, _is_native_reflect_construct$c() ? Reflect.construct(derived, args || [], _get_prototype_of$c(_this).constructor) : derived.apply(_this, args));
406
424
  }
407
425
  function _class_call_check$p(instance, Constructor) {
408
- if (!(instance instanceof Constructor)) {
409
- throw new TypeError("Cannot call a class as a function");
410
- }
426
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
411
427
  }
412
428
  function _construct(Parent, args, Class) {
413
- if (_is_native_reflect_construct$c()) {
414
- _construct = Reflect.construct;
415
- } else {
429
+ if (_is_native_reflect_construct$c()) _construct = Reflect.construct;
430
+ else {
416
431
  _construct = function construct(Parent, args, Class) {
417
432
  var a = [
418
433
  null
@@ -461,10 +476,16 @@ this.Scorm12API = (function () {
461
476
  function _is_native_function(fn) {
462
477
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
463
478
  }
479
+ function _is_native_reflect_construct$c() {
480
+ try {
481
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
482
+ } catch (_) {}
483
+ return (_is_native_reflect_construct$c = function() {
484
+ return !!result;
485
+ })();
486
+ }
464
487
  function _possible_constructor_return$c(self, call) {
465
- if (call && (_type_of$n(call) === "object" || typeof call === "function")) {
466
- return call;
467
- }
488
+ if (call && (_type_of$n(call) === "object" || typeof call === "function")) return call;
468
489
  return _assert_this_initialized$c(self);
469
490
  }
470
491
  function _set_prototype_of$c(o, p) {
@@ -480,11 +501,9 @@ this.Scorm12API = (function () {
480
501
  }
481
502
  function _wrap_native_super(Class) {
482
503
  var _cache = typeof Map === "function" ? new Map() : undefined;
483
- _wrap_native_super = function wrapNativeSuper(Class) {
504
+ _wrap_native_super = function(Class) {
484
505
  if (Class === null || !_is_native_function(Class)) return Class;
485
- if (typeof Class !== "function") {
486
- throw new TypeError("Super expression must either be null or a function");
487
- }
506
+ if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
488
507
  if (typeof _cache !== "undefined") {
489
508
  if (_cache.has(Class)) return _cache.get(Class);
490
509
  _cache.set(Class, Wrapper);
@@ -504,14 +523,6 @@ this.Scorm12API = (function () {
504
523
  };
505
524
  return _wrap_native_super(Class);
506
525
  }
507
- function _is_native_reflect_construct$c() {
508
- try {
509
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
510
- } catch (_) {}
511
- return (_is_native_reflect_construct$c = function() {
512
- return !!result;
513
- })();
514
- }
515
526
  var __defProp$l = Object.defineProperty;
516
527
  var __defNormalProp$l = function __defNormalProp(obj, key, value) {
517
528
  return key in obj ? __defProp$l(obj, key, {
@@ -666,9 +677,7 @@ this.Scorm12API = (function () {
666
677
  };
667
678
 
668
679
  function _assert_this_initialized$b(self) {
669
- if (self === void 0) {
670
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
671
- }
680
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
672
681
  return self;
673
682
  }
674
683
  function _call_super$b(_this, derived, args) {
@@ -676,9 +685,7 @@ this.Scorm12API = (function () {
676
685
  return _possible_constructor_return$b(_this, _is_native_reflect_construct$b() ? Reflect.construct(derived, args || [], _get_prototype_of$b(_this).constructor) : derived.apply(_this, args));
677
686
  }
678
687
  function _class_call_check$o(instance, Constructor) {
679
- if (!(instance instanceof Constructor)) {
680
- throw new TypeError("Cannot call a class as a function");
681
- }
688
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
682
689
  }
683
690
  function _get_prototype_of$b(o) {
684
691
  _get_prototype_of$b = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
@@ -699,10 +706,16 @@ this.Scorm12API = (function () {
699
706
  });
700
707
  if (superClass) _set_prototype_of$b(subClass, superClass);
701
708
  }
709
+ function _is_native_reflect_construct$b() {
710
+ try {
711
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
712
+ } catch (_) {}
713
+ return (_is_native_reflect_construct$b = function() {
714
+ return !!result;
715
+ })();
716
+ }
702
717
  function _possible_constructor_return$b(self, call) {
703
- if (call && (_type_of$m(call) === "object" || typeof call === "function")) {
704
- return call;
705
- }
718
+ if (call && (_type_of$m(call) === "object" || typeof call === "function")) return call;
706
719
  return _assert_this_initialized$b(self);
707
720
  }
708
721
  function _set_prototype_of$b(o, p) {
@@ -716,14 +729,6 @@ this.Scorm12API = (function () {
716
729
  "@swc/helpers - typeof";
717
730
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
718
731
  }
719
- function _is_native_reflect_construct$b() {
720
- try {
721
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
722
- } catch (_) {}
723
- return (_is_native_reflect_construct$b = function() {
724
- return !!result;
725
- })();
726
- }
727
732
  var scorm12_errors$1 = scorm12_constants.error_descriptions;
728
733
  var Scorm12ValidationError = /*#__PURE__*/ function(ValidationError) {
729
734
  _inherits$b(Scorm12ValidationError, ValidationError);
@@ -762,9 +767,7 @@ this.Scorm12API = (function () {
762
767
  configurable: true,
763
768
  writable: true
764
769
  });
765
- } else {
766
- obj[key] = value;
767
- }
770
+ } else obj[key] = value;
768
771
  return obj;
769
772
  }
770
773
  function _object_spread$6(target) {
@@ -792,9 +795,8 @@ this.Scorm12API = (function () {
792
795
  }
793
796
  function _object_spread_props$3(target, source) {
794
797
  source = source != null ? source : {};
795
- if (Object.getOwnPropertyDescriptors) {
796
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
797
- } else {
798
+ if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
799
+ else {
798
800
  ownKeys$3(Object(source)).forEach(function(key) {
799
801
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
800
802
  });
@@ -880,9 +882,7 @@ this.Scorm12API = (function () {
880
882
  });
881
883
 
882
884
  function _assert_this_initialized$a(self) {
883
- if (self === void 0) {
884
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
885
- }
885
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
886
886
  return self;
887
887
  }
888
888
  function _call_super$a(_this, derived, args) {
@@ -890,9 +890,7 @@ this.Scorm12API = (function () {
890
890
  return _possible_constructor_return$a(_this, _is_native_reflect_construct$a() ? Reflect.construct(derived, args || [], _get_prototype_of$a(_this).constructor) : derived.apply(_this, args));
891
891
  }
892
892
  function _class_call_check$n(instance, Constructor) {
893
- if (!(instance instanceof Constructor)) {
894
- throw new TypeError("Cannot call a class as a function");
895
- }
893
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
896
894
  }
897
895
  function _defineProperties$n(target, props) {
898
896
  for(var i = 0; i < props.length; i++){
@@ -926,10 +924,16 @@ this.Scorm12API = (function () {
926
924
  });
927
925
  if (superClass) _set_prototype_of$a(subClass, superClass);
928
926
  }
927
+ function _is_native_reflect_construct$a() {
928
+ try {
929
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
930
+ } catch (_) {}
931
+ return (_is_native_reflect_construct$a = function() {
932
+ return !!result;
933
+ })();
934
+ }
929
935
  function _possible_constructor_return$a(self, call) {
930
- if (call && (_type_of$l(call) === "object" || typeof call === "function")) {
931
- return call;
932
- }
936
+ if (call && (_type_of$l(call) === "object" || typeof call === "function")) return call;
933
937
  return _assert_this_initialized$a(self);
934
938
  }
935
939
  function _set_prototype_of$a(o, p) {
@@ -943,14 +947,6 @@ this.Scorm12API = (function () {
943
947
  "@swc/helpers - typeof";
944
948
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
945
949
  }
946
- function _is_native_reflect_construct$a() {
947
- try {
948
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
949
- } catch (_) {}
950
- return (_is_native_reflect_construct$a = function() {
951
- return !!result;
952
- })();
953
- }
954
950
  var __defProp$k = Object.defineProperty;
955
951
  var __defNormalProp$k = function __defNormalProp(obj, key, value) {
956
952
  return key in obj ? __defProp$k(obj, key, {
@@ -1076,11 +1072,8 @@ this.Scorm12API = (function () {
1076
1072
  reject(error);
1077
1073
  return;
1078
1074
  }
1079
- if (info.done) {
1080
- resolve(value);
1081
- } else {
1082
- Promise.resolve(value).then(_next, _throw);
1083
- }
1075
+ if (info.done) resolve(value);
1076
+ else Promise.resolve(value).then(_next, _throw);
1084
1077
  }
1085
1078
  function _async_to_generator$3(fn) {
1086
1079
  return function() {
@@ -1205,8 +1198,10 @@ this.Scorm12API = (function () {
1205
1198
  lmsCommitUrl: false,
1206
1199
  dataCommitFormat: "json",
1207
1200
  commitRequestDataType: "application/json;charset=UTF-8",
1201
+ terminationCommitContentType: "text/plain;charset=UTF-8",
1208
1202
  autoProgress: false,
1209
1203
  logLevel: LogLevelEnum.ERROR,
1204
+ uninitializedGetLogLevel: LogLevelEnum.WARN,
1210
1205
  selfReportSessionTime: false,
1211
1206
  alwaysSendTotalTime: false,
1212
1207
  renderCommonCommitFields: false,
@@ -1536,6 +1531,7 @@ this.Scorm12API = (function () {
1536
1531
  * Subtag: 2-8 alphanumeric characters
1537
1532
  */ CMILang: "^([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?$|^$",
1538
1533
  /** CMILangString250 - String with optional language tag, max 250 chars (RTE C.1.3) */ CMILangString250: "^({lang=([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,250}$)?$",
1534
+ /** CMILangString - Optional language tag, no length cap; RTE C.1.3 SPM is a floor and is deliberately not enforced */ CMILangString: "^({lang=([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).*$)?$",
1539
1535
  /** CMILangcr - Language tag pattern with content */ CMILangcr: "^(({lang=([a-zA-Z]{1,8}|i|x)?(-[a-zA-Z0-9-]{2,8})?}))(.*?)$",
1540
1536
  /** CMILangString250cr - String with optional language tag (carriage return variant) */ CMILangString250cr: "^(({lang=([a-zA-Z]{1,8}|i|x)?(-[a-zA-Z0-9-]{2,8})?})?(.{0,250})?)?$",
1541
1537
  /** CMILangString4000 - String with optional language tag, max 4000 chars (RTE C.1.3) */ CMILangString4000: "^({lang=([a-zA-Z]{1,8}|i|x)(-[a-zA-Z0-9-]{2,8})?})?((?!{.*$).{0,4000}$)?$",
@@ -1587,9 +1583,7 @@ this.Scorm12API = (function () {
1587
1583
  configurable: true,
1588
1584
  writable: true
1589
1585
  });
1590
- } else {
1591
- obj[key] = value;
1592
- }
1586
+ } else obj[key] = value;
1593
1587
  return obj;
1594
1588
  }
1595
1589
  function _object_spread$5(target) {
@@ -1709,11 +1703,8 @@ this.Scorm12API = (function () {
1709
1703
  reject(error);
1710
1704
  return;
1711
1705
  }
1712
- if (info.done) {
1713
- resolve(value);
1714
- } else {
1715
- Promise.resolve(value).then(_next, _throw);
1716
- }
1706
+ if (info.done) resolve(value);
1707
+ else Promise.resolve(value).then(_next, _throw);
1717
1708
  }
1718
1709
  function _async_to_generator$2(fn) {
1719
1710
  return function() {
@@ -1731,9 +1722,7 @@ this.Scorm12API = (function () {
1731
1722
  };
1732
1723
  }
1733
1724
  function _class_call_check$m(instance, Constructor) {
1734
- if (!(instance instanceof Constructor)) {
1735
- throw new TypeError("Cannot call a class as a function");
1736
- }
1725
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
1737
1726
  }
1738
1727
  function _defineProperties$m(target, props) {
1739
1728
  for(var i = 0; i < props.length; i++){
@@ -1748,10 +1737,6 @@ this.Scorm12API = (function () {
1748
1737
  if (protoProps) _defineProperties$m(Constructor.prototype, protoProps);
1749
1738
  return Constructor;
1750
1739
  }
1751
- function _type_of$k(obj) {
1752
- "@swc/helpers - typeof";
1753
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1754
- }
1755
1740
  function _ts_generator$2(thisArg, body) {
1756
1741
  var f, y, t, _ = {
1757
1742
  label: 0,
@@ -1851,6 +1836,10 @@ this.Scorm12API = (function () {
1851
1836
  };
1852
1837
  }
1853
1838
  }
1839
+ function _type_of$k(obj) {
1840
+ "@swc/helpers - typeof";
1841
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1842
+ }
1854
1843
  var __defProp$j = Object.defineProperty;
1855
1844
  var __defNormalProp$j = function __defNormalProp(obj, key, value) {
1856
1845
  return key in obj ? __defProp$j(obj, key, {
@@ -1931,9 +1920,7 @@ this.Scorm12API = (function () {
1931
1920
  ];
1932
1921
 
1933
1922
  function _assert_this_initialized$9(self) {
1934
- if (self === void 0) {
1935
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1936
- }
1923
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1937
1924
  return self;
1938
1925
  }
1939
1926
  function _call_super$9(_this, derived, args) {
@@ -1941,9 +1928,7 @@ this.Scorm12API = (function () {
1941
1928
  return _possible_constructor_return$9(_this, _is_native_reflect_construct$9() ? Reflect.construct(derived, args || [], _get_prototype_of$9(_this).constructor) : derived.apply(_this, args));
1942
1929
  }
1943
1930
  function _class_call_check$l(instance, Constructor) {
1944
- if (!(instance instanceof Constructor)) {
1945
- throw new TypeError("Cannot call a class as a function");
1946
- }
1931
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
1947
1932
  }
1948
1933
  function _defineProperties$l(target, props) {
1949
1934
  for(var i = 0; i < props.length; i++){
@@ -1978,10 +1963,16 @@ this.Scorm12API = (function () {
1978
1963
  });
1979
1964
  if (superClass) _set_prototype_of$9(subClass, superClass);
1980
1965
  }
1966
+ function _is_native_reflect_construct$9() {
1967
+ try {
1968
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1969
+ } catch (_) {}
1970
+ return (_is_native_reflect_construct$9 = function() {
1971
+ return !!result;
1972
+ })();
1973
+ }
1981
1974
  function _possible_constructor_return$9(self, call) {
1982
- if (call && (_type_of$j(call) === "object" || typeof call === "function")) {
1983
- return call;
1984
- }
1975
+ if (call && (_type_of$j(call) === "object" || typeof call === "function")) return call;
1985
1976
  return _assert_this_initialized$9(self);
1986
1977
  }
1987
1978
  function _set_prototype_of$9(o, p) {
@@ -1995,14 +1986,6 @@ this.Scorm12API = (function () {
1995
1986
  "@swc/helpers - typeof";
1996
1987
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1997
1988
  }
1998
- function _is_native_reflect_construct$9() {
1999
- try {
2000
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2001
- } catch (_) {}
2002
- return (_is_native_reflect_construct$9 = function() {
2003
- return !!result;
2004
- })();
2005
- }
2006
1989
  var __defProp$i = Object.defineProperty;
2007
1990
  var __defNormalProp$i = function __defNormalProp(obj, key, value) {
2008
1991
  return key in obj ? __defProp$i(obj, key, {
@@ -2015,6 +1998,12 @@ this.Scorm12API = (function () {
2015
1998
  var __publicField$i = function __publicField(obj, key, value) {
2016
1999
  return __defNormalProp$i(obj, (typeof key === "undefined" ? "undefined" : _type_of$j(key)) !== "symbol" ? key + "" : key, value);
2017
2000
  };
2001
+ function kleeneNot(value) {
2002
+ if (value === "unknown") {
2003
+ return "unknown";
2004
+ }
2005
+ return !value;
2006
+ }
2018
2007
  var _RuleCondition = /*#__PURE__*/ function(BaseCMI) {
2019
2008
  _inherits$9(_RuleCondition, BaseCMI);
2020
2009
  function _RuleCondition() {
@@ -2120,53 +2109,74 @@ this.Scorm12API = (function () {
2120
2109
  /**
2121
2110
  * Evaluate the condition for an activity
2122
2111
  * @param {Activity} activity - The activity to evaluate the condition for
2123
- * @return {boolean} - True if the condition is met, false otherwise
2112
+ * @return {RuleConditionEvaluation} - True, false, or unknown per SCORM 2004 4th Ed.
2124
2113
  */ key: "evaluate",
2125
2114
  value: function evaluate(activity) {
2126
2115
  var result;
2116
+ var hasReferencedObjective = this._referencedObjective !== null;
2127
2117
  var referencedObjective = this.resolveReferencedObjective(activity);
2128
2118
  switch(this._condition){
2129
2119
  case "satisfied" /* SATISFIED */ :
2130
2120
  case "objectiveSatisfied" /* OBJECTIVE_SATISFIED */ :
2131
- if (referencedObjective) {
2132
- result = referencedObjective.satisfiedStatus === true;
2121
+ if (hasReferencedObjective && !referencedObjective) {
2122
+ result = false;
2123
+ } else if (referencedObjective) {
2124
+ result = referencedObjective.satisfiedStatusKnown || referencedObjective.progressStatus ? referencedObjective.satisfiedStatus === true : "unknown";
2125
+ } else if (activity.objectiveSatisfiedStatusKnown) {
2126
+ result = activity.objectiveSatisfiedStatus === true;
2127
+ } else if (activity.successStatus !== SuccessStatus.UNKNOWN) {
2128
+ result = activity.successStatus === SuccessStatus.PASSED;
2133
2129
  } else {
2134
- result = activity.successStatus === SuccessStatus.PASSED || activity.objectiveSatisfiedStatus === true;
2130
+ result = "unknown";
2135
2131
  }
2136
2132
  break;
2137
2133
  case "objectiveStatusKnown" /* OBJECTIVE_STATUS_KNOWN */ :
2138
- result = referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
2134
+ result = hasReferencedObjective && !referencedObjective ? false : referencedObjective ? !!referencedObjective.satisfiedStatusKnown : !!activity.objectiveSatisfiedStatusKnown;
2139
2135
  break;
2140
2136
  case "objectiveMeasureKnown" /* OBJECTIVE_MEASURE_KNOWN */ :
2141
- result = referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
2137
+ result = hasReferencedObjective && !referencedObjective ? false : referencedObjective ? !!referencedObjective.measureStatus : !!activity.objectiveMeasureStatus;
2142
2138
  break;
2143
2139
  case "objectiveMeasureGreaterThan" /* OBJECTIVE_MEASURE_GREATER_THAN */ :
2144
2140
  {
2141
+ if (hasReferencedObjective && !referencedObjective) {
2142
+ result = false;
2143
+ break;
2144
+ }
2145
2145
  var greaterThanValue = this._parameters.get("threshold") || 0;
2146
2146
  var measureStatus = referencedObjective ? referencedObjective.measureStatus : activity.objectiveMeasureStatus;
2147
2147
  var measureValue = referencedObjective ? referencedObjective.normalizedMeasure : activity.objectiveNormalizedMeasure;
2148
- result = !!measureStatus && measureValue > greaterThanValue;
2148
+ result = measureStatus ? measureValue > greaterThanValue : "unknown";
2149
2149
  break;
2150
2150
  }
2151
2151
  case "objectiveMeasureLessThan" /* OBJECTIVE_MEASURE_LESS_THAN */ :
2152
2152
  {
2153
+ if (hasReferencedObjective && !referencedObjective) {
2154
+ result = false;
2155
+ break;
2156
+ }
2153
2157
  var lessThanValue = this._parameters.get("threshold") || 0;
2154
2158
  var measureStatus1 = referencedObjective ? referencedObjective.measureStatus : activity.objectiveMeasureStatus;
2155
2159
  var measureValue1 = referencedObjective ? referencedObjective.normalizedMeasure : activity.objectiveNormalizedMeasure;
2156
- result = !!measureStatus1 && measureValue1 < lessThanValue;
2160
+ result = measureStatus1 ? measureValue1 < lessThanValue : "unknown";
2157
2161
  break;
2158
2162
  }
2159
2163
  case "completed" /* COMPLETED */ :
2160
2164
  case "activityCompleted" /* ACTIVITY_COMPLETED */ :
2161
- if (referencedObjective) {
2162
- result = referencedObjective.completionStatus === CompletionStatus.COMPLETED;
2165
+ if (hasReferencedObjective && !referencedObjective) {
2166
+ result = false;
2167
+ } else if (referencedObjective) {
2168
+ result = referencedObjective.completionStatus === CompletionStatus.UNKNOWN ? "unknown" : referencedObjective.completionStatus === CompletionStatus.COMPLETED;
2169
+ } else if (activity.completionStatus === CompletionStatus.UNKNOWN) {
2170
+ result = "unknown";
2163
2171
  } else {
2164
- result = activity.isCompleted;
2172
+ result = activity.completionStatus === CompletionStatus.COMPLETED;
2165
2173
  }
2166
2174
  break;
2167
2175
  case "progressKnown" /* PROGRESS_KNOWN */ :
2168
2176
  case "activityProgressKnown" /* ACTIVITY_PROGRESS_KNOWN */ :
2169
- if (referencedObjective) {
2177
+ if (hasReferencedObjective && !referencedObjective) {
2178
+ result = false;
2179
+ } else if (referencedObjective) {
2170
2180
  result = referencedObjective.completionStatus !== CompletionStatus.UNKNOWN;
2171
2181
  } else {
2172
2182
  result = activity.completionStatus !== "unknown";
@@ -2195,7 +2205,7 @@ this.Scorm12API = (function () {
2195
2205
  break;
2196
2206
  }
2197
2207
  if (this._operator === "not" /* NOT */ ) {
2198
- result = !result;
2208
+ result = kleeneNot(result);
2199
2209
  }
2200
2210
  return result;
2201
2211
  }
@@ -2360,9 +2370,7 @@ this.Scorm12API = (function () {
2360
2370
  if (Array.isArray(arr)) return _array_like_to_array$4(arr);
2361
2371
  }
2362
2372
  function _class_call_check$k(instance, Constructor) {
2363
- if (!(instance instanceof Constructor)) {
2364
- throw new TypeError("Cannot call a class as a function");
2365
- }
2373
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
2366
2374
  }
2367
2375
  function _defineProperties$k(target, props) {
2368
2376
  for(var i = 0; i < props.length; i++){
@@ -2378,10 +2386,12 @@ this.Scorm12API = (function () {
2378
2386
  return Constructor;
2379
2387
  }
2380
2388
  function _iterable_to_array$2(iter) {
2381
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2389
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
2390
+ return Array.from(iter);
2391
+ }
2382
2392
  }
2383
2393
  function _non_iterable_spread$2() {
2384
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2394
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2385
2395
  }
2386
2396
  function _to_consumable_array$2(arr) {
2387
2397
  return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
@@ -2596,11 +2606,8 @@ this.Scorm12API = (function () {
2596
2606
  reject(error);
2597
2607
  return;
2598
2608
  }
2599
- if (info.done) {
2600
- resolve(value);
2601
- } else {
2602
- Promise.resolve(value).then(_next, _throw);
2603
- }
2609
+ if (info.done) resolve(value);
2610
+ else Promise.resolve(value).then(_next, _throw);
2604
2611
  }
2605
2612
  function _async_to_generator$1(fn) {
2606
2613
  return function() {
@@ -2618,9 +2625,7 @@ this.Scorm12API = (function () {
2618
2625
  };
2619
2626
  }
2620
2627
  function _class_call_check$j(instance, Constructor) {
2621
- if (!(instance instanceof Constructor)) {
2622
- throw new TypeError("Cannot call a class as a function");
2623
- }
2628
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
2624
2629
  }
2625
2630
  function _defineProperties$j(target, props) {
2626
2631
  for(var i = 0; i < props.length; i++){
@@ -2643,18 +2648,14 @@ this.Scorm12API = (function () {
2643
2648
  configurable: true,
2644
2649
  writable: true
2645
2650
  });
2646
- } else {
2647
- obj[key] = value;
2648
- }
2651
+ } else obj[key] = value;
2649
2652
  return obj;
2650
2653
  }
2651
2654
  function _instanceof$5(left, right) {
2652
2655
  "@swc/helpers - instanceof";
2653
2656
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
2654
2657
  return !!right[Symbol.hasInstance](left);
2655
- } else {
2656
- return left instanceof right;
2657
- }
2658
+ } else return left instanceof right;
2658
2659
  }
2659
2660
  function _object_spread$4(target) {
2660
2661
  for(var i = 1; i < arguments.length; i++){
@@ -2681,19 +2682,14 @@ this.Scorm12API = (function () {
2681
2682
  }
2682
2683
  function _object_spread_props$2(target, source) {
2683
2684
  source = source != null ? source : {};
2684
- if (Object.getOwnPropertyDescriptors) {
2685
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2686
- } else {
2685
+ if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2686
+ else {
2687
2687
  ownKeys$2(Object(source)).forEach(function(key) {
2688
2688
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2689
2689
  });
2690
2690
  }
2691
2691
  return target;
2692
2692
  }
2693
- function _type_of$i(obj) {
2694
- "@swc/helpers - typeof";
2695
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
2696
- }
2697
2693
  function _ts_generator$1(thisArg, body) {
2698
2694
  var f, y, t, _ = {
2699
2695
  label: 0,
@@ -2793,6 +2789,10 @@ this.Scorm12API = (function () {
2793
2789
  };
2794
2790
  }
2795
2791
  }
2792
+ function _type_of$i(obj) {
2793
+ "@swc/helpers - typeof";
2794
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
2795
+ }
2796
2796
  var __defProp$h = Object.defineProperty;
2797
2797
  var __defNormalProp$h = function __defNormalProp(obj, key, value) {
2798
2798
  return key in obj ? __defProp$h(obj, key, {
@@ -2994,14 +2994,16 @@ this.Scorm12API = (function () {
2994
2994
  * @private
2995
2995
  */ function performBeacon(url, params) {
2996
2996
  return _async_to_generator$1(function() {
2997
- var _this, _this__prepareRequestBody, body, contentType, beaconSuccess;
2997
+ var _this, _this__prepareRequestBody, body, contentType, beaconContentType, beaconSuccess;
2998
2998
  return _ts_generator$1(this, function(_state) {
2999
2999
  _this = this;
3000
3000
  _this__prepareRequestBody = this._prepareRequestBody(params), body = _this__prepareRequestBody.body, contentType = _this__prepareRequestBody.contentType;
3001
+ beaconContentType = Array.isArray(params) ? contentType : this.settings.terminationCommitContentType;
3002
+ this._warnIfBeaconContentTypeUnsafe(url, beaconContentType);
3001
3003
  beaconSuccess = navigator.sendBeacon(url, new Blob([
3002
3004
  body
3003
3005
  ], {
3004
- type: contentType
3006
+ type: beaconContentType
3005
3007
  }));
3006
3008
  return [
3007
3009
  2,
@@ -3040,6 +3042,15 @@ this.Scorm12API = (function () {
3040
3042
  }).call(this);
3041
3043
  }
3042
3044
  },
3045
+ {
3046
+ key: "_warnIfBeaconContentTypeUnsafe",
3047
+ value: function _warnIfBeaconContentTypeUnsafe(url, contentType) {
3048
+ if (isCrossOriginUrl(url) && !isCorsSafelistedContentType(contentType)) {
3049
+ var _this_settings_onLogMessage, _this_settings;
3050
+ (_this_settings_onLogMessage = (_this_settings = this.settings).onLogMessage) === null || _this_settings_onLogMessage === void 0 ? void 0 : _this_settings_onLogMessage.call(_this_settings, LogLevelEnum.WARN, 'sendBeacon to cross-origin URL with non-CORS-safelisted Content-Type "'.concat(contentType, '" may be silently dropped by the browser (Beacon cannot preflight). Use fetch (useAsynchronousCommits + asyncModeBeaconBehavior:"never") for cross-origin JSON/auth on terminate.'));
3051
+ }
3052
+ }
3053
+ },
3043
3054
  {
3044
3055
  key: "transformResponse",
3045
3056
  value: /**
@@ -3161,9 +3172,7 @@ this.Scorm12API = (function () {
3161
3172
  }();
3162
3173
 
3163
3174
  function _class_call_check$i(instance, Constructor) {
3164
- if (!(instance instanceof Constructor)) {
3165
- throw new TypeError("Cannot call a class as a function");
3166
- }
3175
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3167
3176
  }
3168
3177
  function _defineProperties$i(target, props) {
3169
3178
  for(var i = 0; i < props.length; i++){
@@ -3182,9 +3191,7 @@ this.Scorm12API = (function () {
3182
3191
  "@swc/helpers - instanceof";
3183
3192
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
3184
3193
  return !!right[Symbol.hasInstance](left);
3185
- } else {
3186
- return left instanceof right;
3187
- }
3194
+ } else return left instanceof right;
3188
3195
  }
3189
3196
  function _type_of$h(obj) {
3190
3197
  "@swc/helpers - typeof";
@@ -3575,9 +3582,7 @@ this.Scorm12API = (function () {
3575
3582
  }();
3576
3583
 
3577
3584
  function _class_call_check$h(instance, Constructor) {
3578
- if (!(instance instanceof Constructor)) {
3579
- throw new TypeError("Cannot call a class as a function");
3580
- }
3585
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3581
3586
  }
3582
3587
  function _defineProperties$h(target, props) {
3583
3588
  for(var i = 0; i < props.length; i++){
@@ -3796,9 +3801,7 @@ this.Scorm12API = (function () {
3796
3801
  }
3797
3802
 
3798
3803
  function _class_call_check$g(instance, Constructor) {
3799
- if (!(instance instanceof Constructor)) {
3800
- throw new TypeError("Cannot call a class as a function");
3801
- }
3804
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
3802
3805
  }
3803
3806
  function _defineProperties$g(target, props) {
3804
3807
  for(var i = 0; i < props.length; i++){
@@ -3817,9 +3820,7 @@ this.Scorm12API = (function () {
3817
3820
  "@swc/helpers - instanceof";
3818
3821
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
3819
3822
  return !!right[Symbol.hasInstance](left);
3820
- } else {
3821
- return left instanceof right;
3822
- }
3823
+ } else return left instanceof right;
3823
3824
  }
3824
3825
  function _type_of$f(obj) {
3825
3826
  "@swc/helpers - typeof";
@@ -3889,13 +3890,14 @@ this.Scorm12API = (function () {
3889
3890
  * @throws {ValidationError} - If throwException is true, throws a ValidationError
3890
3891
  */ key: "throwSCORMError",
3891
3892
  value: function throwSCORMError(CMIElement, errorNumber, message) {
3893
+ var messageLevel = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : LogLevelEnum.ERROR;
3892
3894
  this._lastDiagnostic = message || "";
3893
3895
  if (!message) {
3894
3896
  message = this._getLmsErrorMessageDetails(errorNumber, true);
3895
3897
  }
3896
3898
  var formattedMessage = "SCORM Error ".concat(errorNumber, ": ").concat(message).concat(CMIElement ? " [Element: ".concat(CMIElement, "]") : "");
3897
- this._apiLog("throwSCORMError", errorNumber + ": " + message, LogLevelEnum.ERROR, CMIElement);
3898
- this._loggingService.error(formattedMessage);
3899
+ this._apiLog("throwSCORMError", errorNumber + ": " + message, messageLevel, CMIElement);
3900
+ this._loggingService.log(messageLevel, formattedMessage);
3899
3901
  this._lastErrorCode = String(errorNumber);
3900
3902
  }
3901
3903
  },
@@ -4001,9 +4003,7 @@ this.Scorm12API = (function () {
4001
4003
  }
4002
4004
 
4003
4005
  function _class_call_check$f(instance, Constructor) {
4004
- if (!(instance instanceof Constructor)) {
4005
- throw new TypeError("Cannot call a class as a function");
4006
- }
4006
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4007
4007
  }
4008
4008
  function _defineProperties$f(target, props) {
4009
4009
  for(var i = 0; i < props.length; i++){
@@ -4294,11 +4294,8 @@ this.Scorm12API = (function () {
4294
4294
  reject(error);
4295
4295
  return;
4296
4296
  }
4297
- if (info.done) {
4298
- resolve(value);
4299
- } else {
4300
- Promise.resolve(value).then(_next, _throw);
4301
- }
4297
+ if (info.done) resolve(value);
4298
+ else Promise.resolve(value).then(_next, _throw);
4302
4299
  }
4303
4300
  function _async_to_generator(fn) {
4304
4301
  return function() {
@@ -4316,9 +4313,7 @@ this.Scorm12API = (function () {
4316
4313
  };
4317
4314
  }
4318
4315
  function _class_call_check$e(instance, Constructor) {
4319
- if (!(instance instanceof Constructor)) {
4320
- throw new TypeError("Cannot call a class as a function");
4321
- }
4316
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
4322
4317
  }
4323
4318
  function _defineProperties$e(target, props) {
4324
4319
  for(var i = 0; i < props.length; i++){
@@ -4341,18 +4336,14 @@ this.Scorm12API = (function () {
4341
4336
  configurable: true,
4342
4337
  writable: true
4343
4338
  });
4344
- } else {
4345
- obj[key] = value;
4346
- }
4339
+ } else obj[key] = value;
4347
4340
  return obj;
4348
4341
  }
4349
4342
  function _instanceof$2(left, right) {
4350
4343
  "@swc/helpers - instanceof";
4351
4344
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
4352
4345
  return !!right[Symbol.hasInstance](left);
4353
- } else {
4354
- return left instanceof right;
4355
- }
4346
+ } else return left instanceof right;
4356
4347
  }
4357
4348
  function _object_spread$3(target) {
4358
4349
  for(var i = 1; i < arguments.length; i++){
@@ -4379,19 +4370,14 @@ this.Scorm12API = (function () {
4379
4370
  }
4380
4371
  function _object_spread_props$1(target, source) {
4381
4372
  source = source != null ? source : {};
4382
- if (Object.getOwnPropertyDescriptors) {
4383
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
4384
- } else {
4373
+ if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
4374
+ else {
4385
4375
  ownKeys$1(Object(source)).forEach(function(key) {
4386
4376
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4387
4377
  });
4388
4378
  }
4389
4379
  return target;
4390
4380
  }
4391
- function _type_of$d(obj) {
4392
- "@swc/helpers - typeof";
4393
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
4394
- }
4395
4381
  function _ts_generator(thisArg, body) {
4396
4382
  var f, y, t, _ = {
4397
4383
  label: 0,
@@ -4491,6 +4477,10 @@ this.Scorm12API = (function () {
4491
4477
  };
4492
4478
  }
4493
4479
  }
4480
+ function _type_of$d(obj) {
4481
+ "@swc/helpers - typeof";
4482
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
4483
+ }
4494
4484
  var __defProp$c = Object.defineProperty;
4495
4485
  var __defNormalProp$c = function __defNormalProp(obj, key, value) {
4496
4486
  return key in obj ? __defProp$c(obj, key, {
@@ -5044,6 +5034,10 @@ this.Scorm12API = (function () {
5044
5034
  function(CMIElement, value, regexPattern, errorCode, _errorClass, allowEmptyString) {
5045
5035
  var valueKey = typeof value === "string" ? value : "[".concat(typeof value === "undefined" ? "undefined" : _type_of$c(value), "]");
5046
5036
  return "".concat(CMIElement, ":").concat(valueKey, ":").concat(regexPattern, ":").concat(errorCode, ":").concat(allowEmptyString || false);
5037
+ }, // Normal capped CMI values and regexes fit within 2000 characters; large uncapped values bypass caching.
5038
+ {
5039
+ maxEntries: 1e3,
5040
+ maxKeyLength: 2e3
5047
5041
  });
5048
5042
  var checkValidRange = memoize(function(CMIElement, value, rangePattern, errorCode, errorClass) {
5049
5043
  var ranges = rangePattern.split("#");
@@ -5066,6 +5060,8 @@ this.Scorm12API = (function () {
5066
5060
  // since it can't be stringified and doesn't affect the validation result
5067
5061
  function(CMIElement, value, rangePattern, errorCode, _errorClass) {
5068
5062
  return "".concat(CMIElement, ":").concat(value, ":").concat(rangePattern, ":").concat(errorCode);
5063
+ }, {
5064
+ maxEntries: 1e3
5069
5065
  });
5070
5066
 
5071
5067
  function _array_like_to_array$3(arr, len) {
@@ -5077,9 +5073,7 @@ this.Scorm12API = (function () {
5077
5073
  if (Array.isArray(arr)) return _array_like_to_array$3(arr);
5078
5074
  }
5079
5075
  function _class_call_check$d(instance, Constructor) {
5080
- if (!(instance instanceof Constructor)) {
5081
- throw new TypeError("Cannot call a class as a function");
5082
- }
5076
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
5083
5077
  }
5084
5078
  function _defineProperties$d(target, props) {
5085
5079
  for(var i = 0; i < props.length; i++){
@@ -5102,16 +5096,16 @@ this.Scorm12API = (function () {
5102
5096
  configurable: true,
5103
5097
  writable: true
5104
5098
  });
5105
- } else {
5106
- obj[key] = value;
5107
- }
5099
+ } else obj[key] = value;
5108
5100
  return obj;
5109
5101
  }
5110
5102
  function _iterable_to_array$1(iter) {
5111
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
5103
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
5104
+ return Array.from(iter);
5105
+ }
5112
5106
  }
5113
5107
  function _non_iterable_spread$1() {
5114
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5108
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5115
5109
  }
5116
5110
  function _object_spread$2(target) {
5117
5111
  for(var i = 1; i < arguments.length; i++){
@@ -5274,7 +5268,7 @@ this.Scorm12API = (function () {
5274
5268
  value: function processDeliveryRequest(activity) {
5275
5269
  this.fireEvent("onDeliveryRequestProcessing", {
5276
5270
  activity: activity.id,
5277
- timestamp: /* @__PURE__ */ new Date().toISOString()
5271
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
5278
5272
  });
5279
5273
  if (activity.children.length > 0) {
5280
5274
  return new DeliveryRequest(false, null, "DB.1.1-1");
@@ -5638,9 +5632,7 @@ this.Scorm12API = (function () {
5638
5632
  __publicField$b(_DeliveryHandler, "HIDE_LMS_UI_ORDER", _to_consumable_array$1(HIDE_LMS_UI_TOKENS));
5639
5633
 
5640
5634
  function _class_call_check$c(instance, Constructor) {
5641
- if (!(instance instanceof Constructor)) {
5642
- throw new TypeError("Cannot call a class as a function");
5643
- }
5635
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
5644
5636
  }
5645
5637
  function _defineProperties$c(target, props) {
5646
5638
  for(var i = 0; i < props.length; i++){
@@ -5920,9 +5912,7 @@ this.Scorm12API = (function () {
5920
5912
  if (Array.isArray(arr)) return arr;
5921
5913
  }
5922
5914
  function _class_call_check$b(instance, Constructor) {
5923
- if (!(instance instanceof Constructor)) {
5924
- throw new TypeError("Cannot call a class as a function");
5925
- }
5915
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
5926
5916
  }
5927
5917
  function _defineProperties$b(target, props) {
5928
5918
  for(var i = 0; i < props.length; i++){
@@ -5941,9 +5931,7 @@ this.Scorm12API = (function () {
5941
5931
  "@swc/helpers - instanceof";
5942
5932
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
5943
5933
  return !!right[Symbol.hasInstance](left);
5944
- } else {
5945
- return left instanceof right;
5946
- }
5934
+ } else return left instanceof right;
5947
5935
  }
5948
5936
  function _iterable_to_array_limit$1(arr, i) {
5949
5937
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
@@ -5970,7 +5958,7 @@ this.Scorm12API = (function () {
5970
5958
  return _arr;
5971
5959
  }
5972
5960
  function _non_iterable_rest$1() {
5973
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5961
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5974
5962
  }
5975
5963
  function _sliced_to_array$1(arr, i) {
5976
5964
  return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$1();
@@ -6048,10 +6036,12 @@ this.Scorm12API = (function () {
6048
6036
  var handledPayload = metadata === void 0 ? this.settings.requestHandler(params) : this.settings.requestHandler(params, metadata);
6049
6037
  var requestPayload = handledPayload !== null && handledPayload !== void 0 ? handledPayload : params;
6050
6038
  var body = this._prepareRequestBody(requestPayload).body;
6039
+ var beaconContentType = this.settings.terminationCommitContentType;
6040
+ this._warnIfBeaconContentTypeUnsafe(url, beaconContentType);
6051
6041
  var beaconSuccess = navigator.sendBeacon(url, new Blob([
6052
6042
  body
6053
6043
  ], {
6054
- type: "text/plain;charset=UTF-8"
6044
+ type: beaconContentType
6055
6045
  }));
6056
6046
  return {
6057
6047
  result: beaconSuccess ? "true" : "false",
@@ -6059,6 +6049,15 @@ this.Scorm12API = (function () {
6059
6049
  };
6060
6050
  }
6061
6051
  },
6052
+ {
6053
+ key: "_warnIfBeaconContentTypeUnsafe",
6054
+ value: function _warnIfBeaconContentTypeUnsafe(url, contentType) {
6055
+ if (isCrossOriginUrl(url) && !isCorsSafelistedContentType(contentType)) {
6056
+ var _this_settings_onLogMessage, _this_settings;
6057
+ (_this_settings_onLogMessage = (_this_settings = this.settings).onLogMessage) === null || _this_settings_onLogMessage === void 0 ? void 0 : _this_settings_onLogMessage.call(_this_settings, LogLevelEnum.WARN, 'sendBeacon to cross-origin URL with non-CORS-safelisted Content-Type "'.concat(contentType, '" may be silently dropped by the browser (Beacon cannot preflight). Use fetch (useAsynchronousCommits + asyncModeBeaconBehavior:"never") for cross-origin JSON/auth on terminate.'));
6058
+ }
6059
+ }
6060
+ },
6062
6061
  {
6063
6062
  /**
6064
6063
  * Performs a synchronous XMLHttpRequest
@@ -6137,9 +6136,7 @@ this.Scorm12API = (function () {
6137
6136
  }
6138
6137
 
6139
6138
  function _class_call_check$a(instance, Constructor) {
6140
- if (!(instance instanceof Constructor)) {
6141
- throw new TypeError("Cannot call a class as a function");
6142
- }
6139
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
6143
6140
  }
6144
6141
  function _defineProperties$a(target, props) {
6145
6142
  for(var i = 0; i < props.length; i++){
@@ -6263,9 +6260,7 @@ this.Scorm12API = (function () {
6263
6260
  if (Array.isArray(arr)) return _array_like_to_array$1(arr);
6264
6261
  }
6265
6262
  function _class_call_check$9(instance, Constructor) {
6266
- if (!(instance instanceof Constructor)) {
6267
- throw new TypeError("Cannot call a class as a function");
6268
- }
6263
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
6269
6264
  }
6270
6265
  function _defineProperties$9(target, props) {
6271
6266
  for(var i = 0; i < props.length; i++){
@@ -6288,24 +6283,22 @@ this.Scorm12API = (function () {
6288
6283
  configurable: true,
6289
6284
  writable: true
6290
6285
  });
6291
- } else {
6292
- obj[key] = value;
6293
- }
6286
+ } else obj[key] = value;
6294
6287
  return obj;
6295
6288
  }
6296
6289
  function _instanceof(left, right) {
6297
6290
  "@swc/helpers - instanceof";
6298
6291
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
6299
6292
  return !!right[Symbol.hasInstance](left);
6300
- } else {
6301
- return left instanceof right;
6302
- }
6293
+ } else return left instanceof right;
6303
6294
  }
6304
6295
  function _iterable_to_array(iter) {
6305
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6296
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
6297
+ return Array.from(iter);
6298
+ }
6306
6299
  }
6307
6300
  function _non_iterable_spread() {
6308
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6301
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6309
6302
  }
6310
6303
  function _object_spread$1(target) {
6311
6304
  for(var i = 1; i < arguments.length; i++){
@@ -6332,9 +6325,8 @@ this.Scorm12API = (function () {
6332
6325
  }
6333
6326
  function _object_spread_props(target, source) {
6334
6327
  source = source != null ? source : {};
6335
- if (Object.getOwnPropertyDescriptors) {
6336
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
6337
- } else {
6328
+ if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
6329
+ else {
6338
6330
  ownKeys(Object(source)).forEach(function(key) {
6339
6331
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
6340
6332
  });
@@ -7282,8 +7274,8 @@ this.Scorm12API = (function () {
7282
7274
  * // Throw a "not initialized" error
7283
7275
  * this.throwSCORMError(301, "The API must be initialized before calling GetValue");
7284
7276
  */ key: "throwSCORMError",
7285
- value: function throwSCORMError(CMIElement, errorNumber, message) {
7286
- this._errorHandlingService.throwSCORMError(CMIElement, errorNumber !== null && errorNumber !== void 0 ? errorNumber : 0, message);
7277
+ value: function throwSCORMError(CMIElement, errorNumber, message, messageLevel) {
7278
+ this._errorHandlingService.throwSCORMError(CMIElement, errorNumber !== null && errorNumber !== void 0 ? errorNumber : 0, message, messageLevel);
7287
7279
  }
7288
7280
  },
7289
7281
  {
@@ -7666,9 +7658,7 @@ this.Scorm12API = (function () {
7666
7658
  }();
7667
7659
 
7668
7660
  function _assert_this_initialized$8(self) {
7669
- if (self === void 0) {
7670
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7671
- }
7661
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7672
7662
  return self;
7673
7663
  }
7674
7664
  function _call_super$8(_this, derived, args) {
@@ -7676,9 +7666,7 @@ this.Scorm12API = (function () {
7676
7666
  return _possible_constructor_return$8(_this, _is_native_reflect_construct$8() ? Reflect.construct(derived, args || [], _get_prototype_of$8(_this).constructor) : derived.apply(_this, args));
7677
7667
  }
7678
7668
  function _class_call_check$8(instance, Constructor) {
7679
- if (!(instance instanceof Constructor)) {
7680
- throw new TypeError("Cannot call a class as a function");
7681
- }
7669
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
7682
7670
  }
7683
7671
  function _defineProperties$8(target, props) {
7684
7672
  for(var i = 0; i < props.length; i++){
@@ -7712,10 +7700,16 @@ this.Scorm12API = (function () {
7712
7700
  });
7713
7701
  if (superClass) _set_prototype_of$8(subClass, superClass);
7714
7702
  }
7703
+ function _is_native_reflect_construct$8() {
7704
+ try {
7705
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
7706
+ } catch (_) {}
7707
+ return (_is_native_reflect_construct$8 = function() {
7708
+ return !!result;
7709
+ })();
7710
+ }
7715
7711
  function _possible_constructor_return$8(self, call) {
7716
- if (call && (_type_of$8(call) === "object" || typeof call === "function")) {
7717
- return call;
7718
- }
7712
+ if (call && (_type_of$8(call) === "object" || typeof call === "function")) return call;
7719
7713
  return _assert_this_initialized$8(self);
7720
7714
  }
7721
7715
  function _set_prototype_of$8(o, p) {
@@ -7729,14 +7723,6 @@ this.Scorm12API = (function () {
7729
7723
  "@swc/helpers - typeof";
7730
7724
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
7731
7725
  }
7732
- function _is_native_reflect_construct$8() {
7733
- try {
7734
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
7735
- } catch (_) {}
7736
- return (_is_native_reflect_construct$8 = function() {
7737
- return !!result;
7738
- })();
7739
- }
7740
7726
  var __defProp$8 = Object.defineProperty;
7741
7727
  var __defNormalProp$8 = function __defNormalProp(obj, key, value) {
7742
7728
  return key in obj ? __defProp$8(obj, key, {
@@ -7914,9 +7900,7 @@ this.Scorm12API = (function () {
7914
7900
  }(BaseCMI);
7915
7901
 
7916
7902
  function _assert_this_initialized$7(self) {
7917
- if (self === void 0) {
7918
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7919
- }
7903
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7920
7904
  return self;
7921
7905
  }
7922
7906
  function _call_super$7(_this, derived, args) {
@@ -7924,9 +7908,7 @@ this.Scorm12API = (function () {
7924
7908
  return _possible_constructor_return$7(_this, _is_native_reflect_construct$7() ? Reflect.construct(derived, args || [], _get_prototype_of$7(_this).constructor) : derived.apply(_this, args));
7925
7909
  }
7926
7910
  function _class_call_check$7(instance, Constructor) {
7927
- if (!(instance instanceof Constructor)) {
7928
- throw new TypeError("Cannot call a class as a function");
7929
- }
7911
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
7930
7912
  }
7931
7913
  function _defineProperties$7(target, props) {
7932
7914
  for(var i = 0; i < props.length; i++){
@@ -7942,16 +7924,13 @@ this.Scorm12API = (function () {
7942
7924
  return Constructor;
7943
7925
  }
7944
7926
  function _get$2(target, property, receiver) {
7945
- if (typeof Reflect !== "undefined" && Reflect.get) {
7946
- _get$2 = Reflect.get;
7947
- } else {
7927
+ if (typeof Reflect !== "undefined" && Reflect.get) _get$2 = Reflect.get;
7928
+ else {
7948
7929
  _get$2 = function get(target, property, receiver) {
7949
7930
  var base = _super_prop_base$2(target, property);
7950
7931
  if (!base) return;
7951
7932
  var desc = Object.getOwnPropertyDescriptor(base, property);
7952
- if (desc.get) {
7953
- return desc.get.call(receiver || target);
7954
- }
7933
+ if (desc.get) return desc.get.call(receiver || target);
7955
7934
  return desc.value;
7956
7935
  };
7957
7936
  }
@@ -7976,10 +7955,16 @@ this.Scorm12API = (function () {
7976
7955
  });
7977
7956
  if (superClass) _set_prototype_of$7(subClass, superClass);
7978
7957
  }
7958
+ function _is_native_reflect_construct$7() {
7959
+ try {
7960
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
7961
+ } catch (_) {}
7962
+ return (_is_native_reflect_construct$7 = function() {
7963
+ return !!result;
7964
+ })();
7965
+ }
7979
7966
  function _possible_constructor_return$7(self, call) {
7980
- if (call && (_type_of$7(call) === "object" || typeof call === "function")) {
7981
- return call;
7982
- }
7967
+ if (call && (_type_of$7(call) === "object" || typeof call === "function")) return call;
7983
7968
  return _assert_this_initialized$7(self);
7984
7969
  }
7985
7970
  function _set_prototype_of$7(o, p) {
@@ -8000,14 +7985,6 @@ this.Scorm12API = (function () {
8000
7985
  "@swc/helpers - typeof";
8001
7986
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
8002
7987
  }
8003
- function _is_native_reflect_construct$7() {
8004
- try {
8005
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
8006
- } catch (_) {}
8007
- return (_is_native_reflect_construct$7 = function() {
8008
- return !!result;
8009
- })();
8010
- }
8011
7988
  var __defProp$7 = Object.defineProperty;
8012
7989
  var __defNormalProp$7 = function __defNormalProp(obj, key, value) {
8013
7990
  return key in obj ? __defProp$7(obj, key, {
@@ -8360,7 +8337,7 @@ this.Scorm12API = (function () {
8360
8337
  value: function getCurrentTotalTime(start_time) {
8361
8338
  var sessionTime = this._session_time;
8362
8339
  if (typeof start_time !== "undefined") {
8363
- var seconds = /* @__PURE__ */ new Date().getTime() - start_time;
8340
+ var seconds = (/* @__PURE__ */ new Date()).getTime() - start_time;
8364
8341
  sessionTime = getSecondsAsHHMMSS(seconds / 1e3);
8365
8342
  }
8366
8343
  return addHHMMSSTimeStrings(this._total_time, sessionTime, new RegExp(scorm12_regex.CMITimespan));
@@ -8408,9 +8385,7 @@ this.Scorm12API = (function () {
8408
8385
  }(BaseCMI);
8409
8386
 
8410
8387
  function _assert_this_initialized$6(self) {
8411
- if (self === void 0) {
8412
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8413
- }
8388
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8414
8389
  return self;
8415
8390
  }
8416
8391
  function _call_super$6(_this, derived, args) {
@@ -8418,9 +8393,7 @@ this.Scorm12API = (function () {
8418
8393
  return _possible_constructor_return$6(_this, _is_native_reflect_construct$6() ? Reflect.construct(derived, args || [], _get_prototype_of$6(_this).constructor) : derived.apply(_this, args));
8419
8394
  }
8420
8395
  function _class_call_check$6(instance, Constructor) {
8421
- if (!(instance instanceof Constructor)) {
8422
- throw new TypeError("Cannot call a class as a function");
8423
- }
8396
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
8424
8397
  }
8425
8398
  function _defineProperties$6(target, props) {
8426
8399
  for(var i = 0; i < props.length; i++){
@@ -8454,10 +8427,16 @@ this.Scorm12API = (function () {
8454
8427
  });
8455
8428
  if (superClass) _set_prototype_of$6(subClass, superClass);
8456
8429
  }
8430
+ function _is_native_reflect_construct$6() {
8431
+ try {
8432
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
8433
+ } catch (_) {}
8434
+ return (_is_native_reflect_construct$6 = function() {
8435
+ return !!result;
8436
+ })();
8437
+ }
8457
8438
  function _possible_constructor_return$6(self, call) {
8458
- if (call && (_type_of$6(call) === "object" || typeof call === "function")) {
8459
- return call;
8460
- }
8439
+ if (call && (_type_of$6(call) === "object" || typeof call === "function")) return call;
8461
8440
  return _assert_this_initialized$6(self);
8462
8441
  }
8463
8442
  function _set_prototype_of$6(o, p) {
@@ -8471,14 +8450,6 @@ this.Scorm12API = (function () {
8471
8450
  "@swc/helpers - typeof";
8472
8451
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
8473
8452
  }
8474
- function _is_native_reflect_construct$6() {
8475
- try {
8476
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
8477
- } catch (_) {}
8478
- return (_is_native_reflect_construct$6 = function() {
8479
- return !!result;
8480
- })();
8481
- }
8482
8453
  var __defProp$6 = Object.defineProperty;
8483
8454
  var __defNormalProp$6 = function __defNormalProp(obj, key, value) {
8484
8455
  return key in obj ? __defProp$6(obj, key, {
@@ -8616,9 +8587,7 @@ this.Scorm12API = (function () {
8616
8587
  }(BaseCMI);
8617
8588
 
8618
8589
  function _assert_this_initialized$5(self) {
8619
- if (self === void 0) {
8620
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8621
- }
8590
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8622
8591
  return self;
8623
8592
  }
8624
8593
  function _call_super$5(_this, derived, args) {
@@ -8626,9 +8595,7 @@ this.Scorm12API = (function () {
8626
8595
  return _possible_constructor_return$5(_this, _is_native_reflect_construct$5() ? Reflect.construct(derived, args || [], _get_prototype_of$5(_this).constructor) : derived.apply(_this, args));
8627
8596
  }
8628
8597
  function _class_call_check$5(instance, Constructor) {
8629
- if (!(instance instanceof Constructor)) {
8630
- throw new TypeError("Cannot call a class as a function");
8631
- }
8598
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
8632
8599
  }
8633
8600
  function _defineProperties$5(target, props) {
8634
8601
  for(var i = 0; i < props.length; i++){
@@ -8662,10 +8629,16 @@ this.Scorm12API = (function () {
8662
8629
  });
8663
8630
  if (superClass) _set_prototype_of$5(subClass, superClass);
8664
8631
  }
8632
+ function _is_native_reflect_construct$5() {
8633
+ try {
8634
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
8635
+ } catch (_) {}
8636
+ return (_is_native_reflect_construct$5 = function() {
8637
+ return !!result;
8638
+ })();
8639
+ }
8665
8640
  function _possible_constructor_return$5(self, call) {
8666
- if (call && (_type_of$5(call) === "object" || typeof call === "function")) {
8667
- return call;
8668
- }
8641
+ if (call && (_type_of$5(call) === "object" || typeof call === "function")) return call;
8669
8642
  return _assert_this_initialized$5(self);
8670
8643
  }
8671
8644
  function _set_prototype_of$5(o, p) {
@@ -8679,14 +8652,6 @@ this.Scorm12API = (function () {
8679
8652
  "@swc/helpers - typeof";
8680
8653
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
8681
8654
  }
8682
- function _is_native_reflect_construct$5() {
8683
- try {
8684
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
8685
- } catch (_) {}
8686
- return (_is_native_reflect_construct$5 = function() {
8687
- return !!result;
8688
- })();
8689
- }
8690
8655
  var __defProp$5 = Object.defineProperty;
8691
8656
  var __defNormalProp$5 = function __defNormalProp(obj, key, value) {
8692
8657
  return key in obj ? __defProp$5(obj, key, {
@@ -8856,9 +8821,7 @@ this.Scorm12API = (function () {
8856
8821
  }(BaseCMI);
8857
8822
 
8858
8823
  function _assert_this_initialized$4(self) {
8859
- if (self === void 0) {
8860
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8861
- }
8824
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8862
8825
  return self;
8863
8826
  }
8864
8827
  function _call_super$4(_this, derived, args) {
@@ -8866,9 +8829,7 @@ this.Scorm12API = (function () {
8866
8829
  return _possible_constructor_return$4(_this, _is_native_reflect_construct$4() ? Reflect.construct(derived, args || [], _get_prototype_of$4(_this).constructor) : derived.apply(_this, args));
8867
8830
  }
8868
8831
  function _class_call_check$4(instance, Constructor) {
8869
- if (!(instance instanceof Constructor)) {
8870
- throw new TypeError("Cannot call a class as a function");
8871
- }
8832
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
8872
8833
  }
8873
8834
  function _defineProperties$4(target, props) {
8874
8835
  for(var i = 0; i < props.length; i++){
@@ -8902,10 +8863,16 @@ this.Scorm12API = (function () {
8902
8863
  });
8903
8864
  if (superClass) _set_prototype_of$4(subClass, superClass);
8904
8865
  }
8866
+ function _is_native_reflect_construct$4() {
8867
+ try {
8868
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
8869
+ } catch (_) {}
8870
+ return (_is_native_reflect_construct$4 = function() {
8871
+ return !!result;
8872
+ })();
8873
+ }
8905
8874
  function _possible_constructor_return$4(self, call) {
8906
- if (call && (_type_of$4(call) === "object" || typeof call === "function")) {
8907
- return call;
8908
- }
8875
+ if (call && (_type_of$4(call) === "object" || typeof call === "function")) return call;
8909
8876
  return _assert_this_initialized$4(self);
8910
8877
  }
8911
8878
  function _set_prototype_of$4(o, p) {
@@ -8919,14 +8886,6 @@ this.Scorm12API = (function () {
8919
8886
  "@swc/helpers - typeof";
8920
8887
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
8921
8888
  }
8922
- function _is_native_reflect_construct$4() {
8923
- try {
8924
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
8925
- } catch (_) {}
8926
- return (_is_native_reflect_construct$4 = function() {
8927
- return !!result;
8928
- })();
8929
- }
8930
8889
  var __defProp$4 = Object.defineProperty;
8931
8890
  var __defNormalProp$4 = function __defNormalProp(obj, key, value) {
8932
8891
  return key in obj ? __defProp$4(obj, key, {
@@ -9087,9 +9046,7 @@ this.Scorm12API = (function () {
9087
9046
  }(BaseCMI);
9088
9047
 
9089
9048
  function _assert_this_initialized$3(self) {
9090
- if (self === void 0) {
9091
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9092
- }
9049
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9093
9050
  return self;
9094
9051
  }
9095
9052
  function _call_super$3(_this, derived, args) {
@@ -9097,9 +9054,7 @@ this.Scorm12API = (function () {
9097
9054
  return _possible_constructor_return$3(_this, _is_native_reflect_construct$3() ? Reflect.construct(derived, args || [], _get_prototype_of$3(_this).constructor) : derived.apply(_this, args));
9098
9055
  }
9099
9056
  function _class_call_check$3(instance, Constructor) {
9100
- if (!(instance instanceof Constructor)) {
9101
- throw new TypeError("Cannot call a class as a function");
9102
- }
9057
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
9103
9058
  }
9104
9059
  function _defineProperties$3(target, props) {
9105
9060
  for(var i = 0; i < props.length; i++){
@@ -9115,16 +9070,13 @@ this.Scorm12API = (function () {
9115
9070
  return Constructor;
9116
9071
  }
9117
9072
  function _get$1(target, property, receiver) {
9118
- if (typeof Reflect !== "undefined" && Reflect.get) {
9119
- _get$1 = Reflect.get;
9120
- } else {
9073
+ if (typeof Reflect !== "undefined" && Reflect.get) _get$1 = Reflect.get;
9074
+ else {
9121
9075
  _get$1 = function get(target, property, receiver) {
9122
9076
  var base = _super_prop_base$1(target, property);
9123
9077
  if (!base) return;
9124
9078
  var desc = Object.getOwnPropertyDescriptor(base, property);
9125
- if (desc.get) {
9126
- return desc.get.call(receiver || target);
9127
- }
9079
+ if (desc.get) return desc.get.call(receiver || target);
9128
9080
  return desc.value;
9129
9081
  };
9130
9082
  }
@@ -9149,10 +9101,16 @@ this.Scorm12API = (function () {
9149
9101
  });
9150
9102
  if (superClass) _set_prototype_of$3(subClass, superClass);
9151
9103
  }
9104
+ function _is_native_reflect_construct$3() {
9105
+ try {
9106
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
9107
+ } catch (_) {}
9108
+ return (_is_native_reflect_construct$3 = function() {
9109
+ return !!result;
9110
+ })();
9111
+ }
9152
9112
  function _possible_constructor_return$3(self, call) {
9153
- if (call && (_type_of$3(call) === "object" || typeof call === "function")) {
9154
- return call;
9155
- }
9113
+ if (call && (_type_of$3(call) === "object" || typeof call === "function")) return call;
9156
9114
  return _assert_this_initialized$3(self);
9157
9115
  }
9158
9116
  function _set_prototype_of$3(o, p) {
@@ -9173,14 +9131,6 @@ this.Scorm12API = (function () {
9173
9131
  "@swc/helpers - typeof";
9174
9132
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
9175
9133
  }
9176
- function _is_native_reflect_construct$3() {
9177
- try {
9178
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
9179
- } catch (_) {}
9180
- return (_is_native_reflect_construct$3 = function() {
9181
- return !!result;
9182
- })();
9183
- }
9184
9134
  var __defProp$3 = Object.defineProperty;
9185
9135
  var __defNormalProp$3 = function __defNormalProp(obj, key, value) {
9186
9136
  return key in obj ? __defProp$3(obj, key, {
@@ -9582,9 +9532,7 @@ this.Scorm12API = (function () {
9582
9532
  }(BaseCMI);
9583
9533
 
9584
9534
  function _assert_this_initialized$2(self) {
9585
- if (self === void 0) {
9586
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9587
- }
9535
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9588
9536
  return self;
9589
9537
  }
9590
9538
  function _call_super$2(_this, derived, args) {
@@ -9592,9 +9540,7 @@ this.Scorm12API = (function () {
9592
9540
  return _possible_constructor_return$2(_this, _is_native_reflect_construct$2() ? Reflect.construct(derived, args || [], _get_prototype_of$2(_this).constructor) : derived.apply(_this, args));
9593
9541
  }
9594
9542
  function _class_call_check$2(instance, Constructor) {
9595
- if (!(instance instanceof Constructor)) {
9596
- throw new TypeError("Cannot call a class as a function");
9597
- }
9543
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
9598
9544
  }
9599
9545
  function _defineProperties$2(target, props) {
9600
9546
  for(var i = 0; i < props.length; i++){
@@ -9610,16 +9556,13 @@ this.Scorm12API = (function () {
9610
9556
  return Constructor;
9611
9557
  }
9612
9558
  function _get(target, property, receiver) {
9613
- if (typeof Reflect !== "undefined" && Reflect.get) {
9614
- _get = Reflect.get;
9615
- } else {
9559
+ if (typeof Reflect !== "undefined" && Reflect.get) _get = Reflect.get;
9560
+ else {
9616
9561
  _get = function get(target, property, receiver) {
9617
9562
  var base = _super_prop_base(target, property);
9618
9563
  if (!base) return;
9619
9564
  var desc = Object.getOwnPropertyDescriptor(base, property);
9620
- if (desc.get) {
9621
- return desc.get.call(receiver || target);
9622
- }
9565
+ if (desc.get) return desc.get.call(receiver || target);
9623
9566
  return desc.value;
9624
9567
  };
9625
9568
  }
@@ -9644,10 +9587,16 @@ this.Scorm12API = (function () {
9644
9587
  });
9645
9588
  if (superClass) _set_prototype_of$2(subClass, superClass);
9646
9589
  }
9590
+ function _is_native_reflect_construct$2() {
9591
+ try {
9592
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
9593
+ } catch (_) {}
9594
+ return (_is_native_reflect_construct$2 = function() {
9595
+ return !!result;
9596
+ })();
9597
+ }
9647
9598
  function _possible_constructor_return$2(self, call) {
9648
- if (call && (_type_of$2(call) === "object" || typeof call === "function")) {
9649
- return call;
9650
- }
9599
+ if (call && (_type_of$2(call) === "object" || typeof call === "function")) return call;
9651
9600
  return _assert_this_initialized$2(self);
9652
9601
  }
9653
9602
  function _set_prototype_of$2(o, p) {
@@ -9668,14 +9617,6 @@ this.Scorm12API = (function () {
9668
9617
  "@swc/helpers - typeof";
9669
9618
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
9670
9619
  }
9671
- function _is_native_reflect_construct$2() {
9672
- try {
9673
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
9674
- } catch (_) {}
9675
- return (_is_native_reflect_construct$2 = function() {
9676
- return !!result;
9677
- })();
9678
- }
9679
9620
  var __defProp$2 = Object.defineProperty;
9680
9621
  var __defNormalProp$2 = function __defNormalProp(obj, key, value) {
9681
9622
  return key in obj ? __defProp$2(obj, key, {
@@ -9918,9 +9859,7 @@ this.Scorm12API = (function () {
9918
9859
  }(BaseRootCMI);
9919
9860
 
9920
9861
  function _assert_this_initialized$1(self) {
9921
- if (self === void 0) {
9922
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9923
- }
9862
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
9924
9863
  return self;
9925
9864
  }
9926
9865
  function _call_super$1(_this, derived, args) {
@@ -9928,9 +9867,7 @@ this.Scorm12API = (function () {
9928
9867
  return _possible_constructor_return$1(_this, _is_native_reflect_construct$1() ? Reflect.construct(derived, args || [], _get_prototype_of$1(_this).constructor) : derived.apply(_this, args));
9929
9868
  }
9930
9869
  function _class_call_check$1(instance, Constructor) {
9931
- if (!(instance instanceof Constructor)) {
9932
- throw new TypeError("Cannot call a class as a function");
9933
- }
9870
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
9934
9871
  }
9935
9872
  function _defineProperties$1(target, props) {
9936
9873
  for(var i = 0; i < props.length; i++){
@@ -9964,10 +9901,16 @@ this.Scorm12API = (function () {
9964
9901
  });
9965
9902
  if (superClass) _set_prototype_of$1(subClass, superClass);
9966
9903
  }
9904
+ function _is_native_reflect_construct$1() {
9905
+ try {
9906
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
9907
+ } catch (_) {}
9908
+ return (_is_native_reflect_construct$1 = function() {
9909
+ return !!result;
9910
+ })();
9911
+ }
9967
9912
  function _possible_constructor_return$1(self, call) {
9968
- if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
9969
- return call;
9970
- }
9913
+ if (call && (_type_of$1(call) === "object" || typeof call === "function")) return call;
9971
9914
  return _assert_this_initialized$1(self);
9972
9915
  }
9973
9916
  function _set_prototype_of$1(o, p) {
@@ -9981,14 +9924,6 @@ this.Scorm12API = (function () {
9981
9924
  "@swc/helpers - typeof";
9982
9925
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
9983
9926
  }
9984
- function _is_native_reflect_construct$1() {
9985
- try {
9986
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
9987
- } catch (_) {}
9988
- return (_is_native_reflect_construct$1 = function() {
9989
- return !!result;
9990
- })();
9991
- }
9992
9927
  var __defProp$1 = Object.defineProperty;
9993
9928
  var __defNormalProp$1 = function __defNormalProp(obj, key, value) {
9994
9929
  return key in obj ? __defProp$1(obj, key, {
@@ -10078,9 +10013,7 @@ this.Scorm12API = (function () {
10078
10013
  if (Array.isArray(arr)) return arr;
10079
10014
  }
10080
10015
  function _assert_this_initialized(self) {
10081
- if (self === void 0) {
10082
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10083
- }
10016
+ if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10084
10017
  return self;
10085
10018
  }
10086
10019
  function _call_super(_this, derived, args) {
@@ -10088,9 +10021,7 @@ this.Scorm12API = (function () {
10088
10021
  return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
10089
10022
  }
10090
10023
  function _class_call_check(instance, Constructor) {
10091
- if (!(instance instanceof Constructor)) {
10092
- throw new TypeError("Cannot call a class as a function");
10093
- }
10024
+ if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
10094
10025
  }
10095
10026
  function _defineProperties(target, props) {
10096
10027
  for(var i = 0; i < props.length; i++){
@@ -10114,9 +10045,7 @@ this.Scorm12API = (function () {
10114
10045
  configurable: true,
10115
10046
  writable: true
10116
10047
  });
10117
- } else {
10118
- obj[key] = value;
10119
- }
10048
+ } else obj[key] = value;
10120
10049
  return obj;
10121
10050
  }
10122
10051
  function _get_prototype_of(o) {
@@ -10138,6 +10067,14 @@ this.Scorm12API = (function () {
10138
10067
  });
10139
10068
  if (superClass) _set_prototype_of(subClass, superClass);
10140
10069
  }
10070
+ function _is_native_reflect_construct() {
10071
+ try {
10072
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
10073
+ } catch (_) {}
10074
+ return (_is_native_reflect_construct = function() {
10075
+ return !!result;
10076
+ })();
10077
+ }
10141
10078
  function _iterable_to_array_limit(arr, i) {
10142
10079
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
10143
10080
  if (_i == null) return;
@@ -10163,7 +10100,7 @@ this.Scorm12API = (function () {
10163
10100
  return _arr;
10164
10101
  }
10165
10102
  function _non_iterable_rest() {
10166
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10103
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10167
10104
  }
10168
10105
  function _object_spread(target) {
10169
10106
  for(var i = 1; i < arguments.length; i++){
@@ -10181,9 +10118,7 @@ this.Scorm12API = (function () {
10181
10118
  return target;
10182
10119
  }
10183
10120
  function _possible_constructor_return(self, call) {
10184
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
10185
- return call;
10186
- }
10121
+ if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
10187
10122
  return _assert_this_initialized(self);
10188
10123
  }
10189
10124
  function _set_prototype_of(o, p) {
@@ -10208,14 +10143,6 @@ this.Scorm12API = (function () {
10208
10143
  if (n === "Map" || n === "Set") return Array.from(n);
10209
10144
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
10210
10145
  }
10211
- function _is_native_reflect_construct() {
10212
- try {
10213
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
10214
- } catch (_) {}
10215
- return (_is_native_reflect_construct = function() {
10216
- return !!result;
10217
- })();
10218
- }
10219
10146
  var __defProp = Object.defineProperty;
10220
10147
  var __defNormalProp = function __defNormalProp(obj, key, value) {
10221
10148
  return key in obj ? __defProp(obj, key, {