scorm-again 2.3.0 → 2.4.1

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 (67) hide show
  1. package/README.md +2 -1
  2. package/dist/aicc.js +3165 -2799
  3. package/dist/aicc.js.map +1 -1
  4. package/dist/aicc.min.js +1 -1
  5. package/dist/aicc.min.js.map +1 -1
  6. package/dist/esm/aicc.js +4573 -0
  7. package/dist/esm/aicc.js.map +1 -0
  8. package/dist/esm/aicc.min.js +2 -0
  9. package/dist/esm/aicc.min.js.map +1 -0
  10. package/dist/esm/scorm-again.js +6959 -0
  11. package/dist/esm/scorm-again.js.map +1 -0
  12. package/dist/esm/scorm-again.min.js +2 -0
  13. package/dist/esm/scorm-again.min.js.map +1 -0
  14. package/dist/esm/scorm12.js +3641 -0
  15. package/dist/esm/scorm12.js.map +1 -0
  16. package/dist/esm/scorm12.min.js +2 -0
  17. package/dist/esm/scorm12.min.js.map +1 -0
  18. package/dist/esm/scorm2004.js +4635 -0
  19. package/dist/esm/scorm2004.js.map +1 -0
  20. package/dist/esm/scorm2004.min.js +2 -0
  21. package/dist/esm/scorm2004.min.js.map +1 -0
  22. package/dist/scorm-again.js +4506 -4086
  23. package/dist/scorm-again.js.map +1 -1
  24. package/dist/scorm-again.min.js +1 -1
  25. package/dist/scorm-again.min.js.map +1 -1
  26. package/dist/scorm12.js +3079 -2757
  27. package/dist/scorm12.js.map +1 -1
  28. package/dist/scorm12.min.js +1 -1
  29. package/dist/scorm12.min.js.map +1 -1
  30. package/dist/scorm2004.js +2434 -2221
  31. package/dist/scorm2004.js.map +1 -1
  32. package/dist/scorm2004.min.js +1 -1
  33. package/dist/scorm2004.min.js.map +1 -1
  34. package/index.d.ts +69 -4
  35. package/package.json +11 -8
  36. package/src/AICC.ts +7 -5
  37. package/src/BaseAPI.ts +39 -22
  38. package/src/Scorm12API.ts +27 -32
  39. package/src/Scorm2004API.ts +16 -21
  40. package/src/ScormAgain.ts +9 -0
  41. package/src/cmi/aicc/attempts.ts +7 -7
  42. package/src/cmi/aicc/cmi.ts +4 -4
  43. package/src/cmi/aicc/core.ts +1 -1
  44. package/src/cmi/aicc/evaluation.ts +1 -1
  45. package/src/cmi/aicc/student_data.ts +2 -2
  46. package/src/cmi/aicc/student_preferences.ts +2 -2
  47. package/src/cmi/aicc/tries.ts +7 -7
  48. package/src/cmi/scorm12/cmi.ts +1 -1
  49. package/src/cmi/scorm12/interactions.ts +1 -1
  50. package/src/cmi/scorm2004/adl.ts +2 -2
  51. package/src/cmi/scorm2004/cmi.ts +1 -1
  52. package/src/cmi/scorm2004/interactions.ts +1 -1
  53. package/src/cmi/scorm2004/objectives.ts +1 -1
  54. package/src/cmi/scorm2004/score.ts +1 -1
  55. package/src/constants/default_settings.ts +6 -1
  56. package/src/types/api_types.ts +1 -0
  57. package/test/AICC.spec.ts +2 -2
  58. package/test/Scorm12API.spec.ts +174 -3
  59. package/test/Scorm2004API.spec.ts +18 -18
  60. package/tsconfig.json +1 -0
  61. package/webpack.config.js +38 -15
  62. package/src/exports/aicc.js +0 -3
  63. package/src/exports/scorm-again.js +0 -7
  64. package/src/exports/scorm12.js +0 -3
  65. package/src/exports/scorm2004.js +0 -3
  66. package/src/utilities/debounce.ts +0 -31
  67. package/test/utilities/debounce.spec.ts +0 -56
@@ -0,0 +1,2 @@
1
+ var e={429: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),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,fetchMode:"cors",responseHandler:function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return void 0===e?[3,2]:[4,e.text()];case 1:return t=i.sent(),r=null,t&&(r=JSON.parse(t)),null!==r&&{}.hasOwnProperty.call(r,"result")?[2,{result:r.result,errorCode:r.errorCode?r.errorCode:r.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.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 console.log("commit"),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;m<s.length;m++){var f=s[m];if(m===s.length-1)t&&"{target="===f.substring(0,8)?this.isInitialized()?this.throwSCORMError(this._error_codes.READ_ONLY_ELEMENT):l=(0,i.Cl)((0,i.Cl)({},l),{attribute:o}):this._checkObjectHasProperty(l,f)?((0,c.J6)(r,"\\.correct_responses\\.\\d+")&&this.isInitialized()&&this.validateCorrectResponse(r,o),t&&"0"!==this.lastErrorCode||(l[f]=o,u=a.A.global.SCORM_TRUE)):this.throwSCORMError(h,_);else{if(!(l=l[f])){this.throwSCORMError(h,_);break}if(l instanceof n.B){var p=parseInt(s[m+1],10);if(!isNaN(p)){var g=l.childArray[p];if(g)l=g,d=!0;else{var E=this.getChildElement(r,o,d);d=!0,E?(l.initialized&&E.initialize(),l.childArray.push(E),l=E):this.throwSCORMError(h,_)}m++}}}}return u===a.A.global.SCORM_FALSE&&this.apiLog(e,"There was an error setting the value for: ".concat(r,", value of: ").concat(o),a.A.global.LOG_LEVEL_WARNING),u},e.prototype._commonGetCMIValue=function(e,t,r){if(!r||""===r)return"";for(var i=r.split("."),o=this,a=null,c="The data model element passed to ".concat(e," (").concat(r,") has not been initialized."),l="The data model element passed to ".concat(e," (").concat(r,") is not a valid SCORM data model element."),u=t?this._error_codes.UNDEFINED_DATA_MODEL:this._error_codes.GENERAL,d=0;d<i.length;d++){if(a=i[d],t){if("{target="===String(a).substring(0,8)&&"function"==typeof o._isTargetValid){var _=String(a).substring(8,String(a).length-9);return o._isTargetValid(_)}if(!this._checkObjectHasProperty(o,a))return void this.throwSCORMError(u,l)}else if(d===i.length-1&&!this._checkObjectHasProperty(o,a))return void this.throwSCORMError(u,l);if(void 0===(o=o[a])){this.throwSCORMError(u,l);break}if(o instanceof n.B){var h=parseInt(i[d+1],10);if(!isNaN(h)){var m=o.childArray[h];if(!m){this.throwSCORMError(this._error_codes.VALUE_NOT_INITIALIZED,c);break}o=m,d++}}}if(null!=o)return o;t||("_children"===a?this.throwSCORMError(s.A.scorm12.CHILDREN_ERROR):"_count"===a&&this.throwSCORMError(s.A.scorm12.COUNT_ERROR))},e.prototype.isInitialized=function(){return this.currentState===a.A.global.STATE_INITIALIZED},e.prototype.isNotInitialized=function(){return this.currentState===a.A.global.STATE_NOT_INITIALIZED},e.prototype.isTerminated=function(){return this.currentState===a.A.global.STATE_TERMINATED},e.prototype.on=function(e,t){if(t)for(var r=e.split(" "),i=0;i<r.length;i++){var n=r[i].split(".");if(0===n.length)return;var o=n[0],s=null;n.length>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;o<r.length;o++){var s=i(o);if("object"==typeof s)return s.value}},e.prototype.clear=function(e){for(var t=e.split(" "),r=function(r){var n=t[r].split(".");if(0===n.length)return{value:void 0};var o=n[0],s=null;n.length>1&&(s=e.replace(o+".","")),i.listenerArray=i.listenerArray.filter((function(e){return e.functionName!==o&&e.CMIElement!==s}))},i=this,n=0;n<t.length;n++){var o=r(n);if("object"==typeof o)return o.value}},e.prototype.processListeners=function(e,t,r){this.apiLog(e,r,a.A.global.LOG_LEVEL_INFO,t);for(var i=0;i<this.listenerArray.length;i++){var n=this.listenerArray[i],o=n.functionName===e,s=!!n.CMIElement,c=!1;c=t&&n.CMIElement&&"*"===n.CMIElement.substring(n.CMIElement.length-1)?0===t.indexOf(n.CMIElement.substring(0,n.CMIElement.length-1)):n.CMIElement===t,!o||s&&!c||(this.apiLog("processListeners","Processing listener: ".concat(n.functionName),a.A.global.LOG_LEVEL_INFO,t),n.callback(t,r))}},e.prototype.throwSCORMError=function(e,t){t||(t=this.getLmsErrorMessageDetails(e)),this.apiLog("throwSCORMError",e+": "+t,a.A.global.LOG_LEVEL_ERROR),this.lastErrorCode=String(e)},e.prototype.clearSCORMError=function(e){void 0!==e&&e!==a.A.global.SCORM_FALSE&&(this.lastErrorCode="0")},e.prototype.loadFromFlattenedJSON=function(e,t){var r=this;if(t||(t=""),this.isNotInitialized()){var i,n=/^(cmi\.interactions\.)(\d+)\.(.*)$/,o=/^(cmi\.objectives\.)(\d+)\.(.*)$/,s=Object.keys(e).map((function(t){return[String(t),e[t]]}));s.sort((function(e,t){var r,i=e[0],s=(e[1],t[0]);t[1];return null!==(r=a(i,s,n))||null!==(r=a(i,s,o))?r:i<s?-1:i>s?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(void 0===t&&(t=""),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<n.childArray.length;o++)this.loadFromJSON(n.childArray[o],i+"."+o);else n.constructor===Object?this.loadFromJSON(n,i):this.setCMIValue(i,n)}}else console.error("loadFromJSON can only be called before the call to lmsInitialize.")},e.prototype.renderCMIToJSONString=function(){var e=this.cmi;return this.settings.sendFullCommit?JSON.stringify({cmi:e}):JSON.stringify({cmi:e},(function(e,t){return void 0===t?null:t}),2)},e.prototype.renderCMIToJSONObject=function(){return JSON.parse(this.renderCMIToJSONString())},e.prototype.processHttpRequest=function(e,t){return(0,i.sH)(this,arguments,void 0,(function(e,t,r){var n,o,s,c=this;return void 0===r&&(r=!1),(0,i.YH)(this,(function(l){switch(l.label){case 0:return n=this,o={result:a.A.global.SCORM_FALSE,errorCode:this.error_codes.GENERAL},r?(this.performFetch(e,t).then((function(e){return(0,i.sH)(c,void 0,void 0,(function(){return(0,i.YH)(this,(function(t){switch(t.label){case 0:return[4,this.transformResponse(e)];case 1:return t.sent(),[2]}}))}))})),[2,{result:a.A.global.SCORM_TRUE,errorCode:0}]):(s=function(e,t,r){return(0,i.sH)(c,void 0,void 0,(function(){var s,c;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=r.requestHandler(t),[4,this.performFetch(e,t)];case 1:return s=i.sent(),[2,this.transformResponse(s)];case 2:return c=i.sent(),this.apiLog("processHttpRequest",c,a.A.global.LOG_LEVEL_ERROR),n.processListeners("CommitError"),[2,o];case 3:return[2]}}))}))},[4,s(e,t,this.settings)]);case 1:return[2,l.sent()]}}))}))},e.prototype.scheduleCommit=function(e,t){this._timeout||(this._timeout=new u(this,e,t),this.apiLog("scheduleCommit","scheduled",a.A.global.LOG_LEVEL_DEBUG,""))},e.prototype.clearScheduledCommit=function(){this._timeout&&(this._timeout.cancel(),this._timeout=void 0,this.apiLog("clearScheduledCommit","cleared",a.A.global.LOG_LEVEL_DEBUG,""))},e.prototype._checkObjectHasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)||null!=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||t in e},e.prototype.handleValueAccessException=function(e,t){return e instanceof o.yI?(this.lastErrorCode=String(e.errorCode),t=a.A.global.SCORM_FALSE):(e instanceof Error&&e.message?console.error(e.message):console.error(e),this.throwSCORMError(this._error_codes.GENERAL)),t},e.prototype.getCommitObject=function(e){var t=e||this.settings.alwaysSendTotalTime,r=this.settings.renderCommonCommitFields?this.renderCommitObject(t):this.renderCommitCMI(t);return this.apiLogLevel===a.A.global.LOG_LEVEL_DEBUG&&(console.debug("Commit (terminated: "+(e?"yes":"no")+"): "),console.debug(r)),r},e.prototype.performFetch=function(e,t){return(0,i.sH)(this,void 0,void 0,(function(){return(0,i.YH)(this,(function(r){return[2,fetch(e,{method:"POST",mode:this.settings.fetchMode,body:t instanceof Array?t.join("&"):JSON.stringify(t),headers:(0,i.Cl)((0,i.Cl)({},this.settings.xhrHeaders),{"Content-Type":this.settings.commitRequestDataType}),credentials:this.settings.xhrWithCredentials?"include":void 0,keepalive:!0})]}))}))},e.prototype.transformResponse=function(e){return(0,i.sH)(this,void 0,void 0,(function(){var t,r;return(0,i.YH)(this,(function(i){switch(i.label){case 0:return"function"!=typeof this.settings.responseHandler?[3,2]:[4,this.settings.responseHandler(e)];case 1:return r=i.sent(),[3,4];case 2:return[4,e.json()];case 3:r=i.sent(),i.label=4;case 4:return t=r,e.status>=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<this.childArray.length;t++)e[t+""]=this.childArray[t];return delete this.jsonString,e},t}(n.J)},319:function(e,t,r){r.d(t,{J:function(){return n},r:function(){return o}});var i=r(635),n=function(){function e(){this.jsonString=!1,this._initialized=!1}return Object.defineProperty(e.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"start_time",{get:function(){return this._start_time},enumerable:!1,configurable:!0}),e.prototype.initialize=function(){this._initialized=!0},e.prototype.setStartTime=function(){this._start_time=(new Date).getTime()},e}(),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,i.C6)(t,e),t}(n)},434:function(e,t,r){r.d(t,{_:function(){return _}});var i=r(635),n=r(340),o=r(417),s=r(319),a=r(449),c=r(797),l=n.A.scorm12,u=o.A.scorm12,d=c.A.scorm12,_=function(e){function t(t){var r=e.call(this)||this;return r._raw="",r._min="",r.__children=t.score_children||l.score_children,r.__score_range=!!t.score_range&&u.score_range,r._max=t.max||""===t.max?t.max:"100",r.__invalid_error_code=t.invalidErrorCode||d.INVALID_SET_VALUE,r.__invalid_type_code=t.invalidTypeCode||d.TYPE_MISMATCH,r.__invalid_range_code=t.invalidRangeCode||d.VALUE_OUT_OF_RANGE,r.__decimal_regex=t.decimalRegex||u.CMIDecimal,r.__error_class=t.errorClass,r}return(0,i.C6)(t,e),Object.defineProperty(t.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(t.prototype,"raw",{get:function(){return this._raw},set:function(e){!(0,a.q)(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!(0,a.W)(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._raw=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"min",{get:function(){return this._min},set:function(e){!(0,a.q)(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!(0,a.W)(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._min=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this._max},set:function(e){!(0,a.q)(e,this.__decimal_regex,this.__invalid_type_code,this.__error_class)||this.__score_range&&!(0,a.W)(e,this.__score_range,this.__invalid_range_code,this.__error_class)||(this._max=e)},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){this.jsonString=!0;var e={raw:this.raw,min:this.min,max:this.max};return delete this.jsonString,e},t}(s.J)},449:function(e,t,r){function i(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 n(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)}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;n<o;n++)e(r[n],i+"["+n+"]"),0===o&&(t[i]=[]);else{var s=!0;for(var a in r)({}).hasOwnProperty.call(r,a)&&(s=!1,e(r[a],i?i+"."+a:a));s&&i&&(t[i]={})}}(e,""),t}function c(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}function l(e){return Math.floor(e)===e||String(e).indexOf(".")<0?0:e.toString().split(".")[1].length||0}function u(e,t,r){for(var i="",n=20-(i+=e).length,o=0;o<n;o++)i+=" ";if(i+=": ",r){n=70-(i+=r).length;for(var s=0;s<n;s++)i+=" "}return t&&(i+=t),i}function d(e,t){return null!==(null==e?void 0:e.match(t))}},635:function(e,t,r){r.d(t,{C6:function(){return n},Cl:function(){return o},YH:function(){return a},sH:function(){return s}});var i=function(e,t){return i=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])},i(e,t)};function n(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 o=function(){return o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};function s(e,t,r,i){return new(r||(r=Promise))((function(n,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))}function a(e,t){var r,i,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,r),o.exports}r.d=function(e,t){for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};r.d(i,{C:function(){return m}});var n=r(635),o=r(989),s=r(864),a=r(340),c=r(797),l=r(176),u=r(833),d=r(331),_=r(417),h=r(56),m=function(e){function t(t){var r=this;return t&&void 0===t.mastery_override&&(t.mastery_override=!1),(r=e.call(this,c.A.scorm12,t)||this).statusSetByModule=!1,r.cmi=new o.Y,r.nav=new d.A,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(0,n.C6)(t,e),t.prototype.reset=function(e){this.commonReset(e),this.cmi=new o.Y,this.nav=new d.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,n.sH)(e,void 0,void 0,(function(){return(0,n.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,n.sH)(this,void 0,void 0,(function(){var e;return(0,n.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 this.settings.asyncCommit?this.scheduleCommit(500,"LMSCommit"):(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("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,r){return(0,s.J6)(e,"cmi\\.objectives\\.\\d+")?new l.N:r&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+")?new u.cb:r&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+\\.objectives\\.\\d+")?new u.Oh:!r&&(0,s.J6)(e,"cmi\\.interactions\\.\\d+")?new u.WP:null},t.prototype.validateCorrectResponse=function(e,t){},t.prototype.getLmsErrorMessageDetails=function(e,t){var r="No Error",i="No Error";return e=String(e),a.A.scorm12.error_descriptions[e]&&(r=a.A.scorm12.error_descriptions[e].basicMessage,i=a.A.scorm12.error_descriptions[e].detailMessage),t?i:r},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 r=[],i=s.Bq(t);switch(this.settings.dataCommitFormat){case"flattened":return s.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=s.f4(r,_.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:i};return l&&(u.score=l),u},t.prototype.storeData=function(e){return(0,n.sH)(this,void 0,void 0,(function(){var t,r,i,o,s;return(0,n.YH)(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===(s=null===(o=null===(i=this.startingData)||void 0===i?void 0:i.cmi)||void 0===o?void 0:o.core)||void 0===s?void 0:s.lesson_status)||"")&&"not attempted"===t&&(this.cmi.core.lesson_status="browsed")),r=this.getCommitObject(e),"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:a.A.global.SCORM_TRUE,errorCode:0}]}}))}))},t}(r(429).A),f=i.C;export{f as Scorm12Impl};
2
+ //# sourceMappingURL=scorm12.min.js.map