qti3-item-player-vue3 0.2.10 → 0.2.11

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.
@@ -1533,12 +1533,15 @@ class re {
1533
1533
  case "float":
1534
1534
  case "duration":
1535
1535
  case "boolean":
1536
- case "point":
1537
- case "directedPair":
1538
- case "pair":
1539
1536
  case "uri":
1540
1537
  case "file":
1541
1538
  return s[i] = t, s;
1539
+ case "point":
1540
+ s[i] = (n) => n.split(" ").map(Number);
1541
+ return;
1542
+ case "directedPair":
1543
+ case "pair":
1544
+ return s[i] = t.split(" "), s;
1542
1545
  case "intOrIdentifier":
1543
1546
  return s[i] = null, s;
1544
1547
  default:
@@ -1628,7 +1631,16 @@ class re {
1628
1631
  throw new k("Invalid value. Must be an Object.");
1629
1632
  if (Array.isArray(t))
1630
1633
  throw new k("Invalid value. Found Array. Must be an Object.");
1631
- if (t[i] !== void 0) return t[i];
1634
+ if (t[i] !== void 0) {
1635
+ if (i === "point" || i === "directedPair" || i === "pair") {
1636
+ if (!Array.isArray(t[i]))
1637
+ throw new k(`Invalid value. For baseType "${i}", must be an Array`);
1638
+ if (t[i].length !== 2)
1639
+ throw new k(`Invalid value. For baseType "${i}", Array must have 2 elements`);
1640
+ return `${t[i][0]} ${t[i][1]}`;
1641
+ }
1642
+ return t[i];
1643
+ }
1632
1644
  throw new k(`Value does not have the required base-type. Expecting ${i}.`);
1633
1645
  } catch ({ name: s, message: n }) {
1634
1646
  return console.log("[PciDecodingException][BaseValueFromJson] ", n, t), this.nullValue();
@@ -1,4 +1,4 @@
1
- (function(l,Xe){typeof exports=="object"&&typeof module<"u"?module.exports=Xe(require("vue")):typeof define=="function"&&define.amd?define(["vue"],Xe):(l=typeof globalThis<"u"?globalThis:l||self,l.Qti3Player=Xe(l.Vue))})(this,function(l){"use strict";var y4=Object.defineProperty;var w4=(l,Xe,Ds)=>Xe in l?y4(l,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ds}):l[Xe]=Ds;var J=(l,Xe,Ds)=>w4(l,typeof Xe!="symbol"?Xe+"":Xe,Ds);class Xe{constructor(t,i,s){this.fieldIdentifier=t,this.value=s,this.baseType=i,this.cardinality="single"}getValue(){return this.value}setValue(t){this.value=t}getBaseType(){return this.baseType}setBaseType(t){this.baseType=t}getCardinality(){return this.cardinality}getFieldIdentifier(){return this.fieldIdentifier}setFieldIdentifier(t){this.fieldIdentifier=t}}class Ds{constructor(){J(this,"constants",{COLOR_DEFAULT:"qti3-player-color-default",COLOR_DEFAULT_REVERSE:"qti3-player-color-defaultreverse",COLOR_BLACK_WHITE:"qti3-player-color-blackwhite",COLOR_WHITE_BLACK:"qti3-player-color-whiteblack",COLOR_BLACK_ROSE:"qti3-player-color-blackrose",COLOR_ROSE_BLACK:"qti3-player-color-roseblack",COLOR_YELLOW_BLUE:"qti3-player-color-yellowblue",COLOR_BLUE_YELLOW:"qti3-player-color-blueyellow",COLOR_MGRAY_DGRAY:"qti3-player-color-mgraydgray",COLOR_DGRAY_MGRAY:"qti3-player-color-dgraymgray",COLOR_BLACK_CYAN:"qti3-player-color-blackcyan",COLOR_CYAN_BLACK:"qti3-player-color-cyanblack",COLOR_BLACK_CREAM:"qti3-player-color-blackcream",COLOR_CREAM_BLACK:"qti3-player-color-creamblack",GLOSSARY_ON:"glossary-on",GLOSSARY_OFF:"glossary-off",KEYWORD_TRANS_OFF:"ktlang-off",KEYWORD_TRANS_AR:"ktlang-ar",KEYWORD_TRANS_CMN:"ktlang-cmn",KEYWORD_TRANS_DE:"ktlang-de",KEYWORD_TRANS_EN:"ktlang-en",KEYWORD_TRANS_ES:"ktlang-es",KEYWORD_TRANS_FR:"ktlang-fr",KEYWORD_TRANS_HMN:"ktlang-hmn",KEYWORD_TRANS_IT:"ktlang-it",KEYWORD_TRANS_JA:"ktlang-ja",KEYWORD_TRANS_KO:"ktlang-ko",KEYWORD_TRANS_MY:"ktlang-my",KEYWORD_TRANS_NL:"ktlang-nl",KEYWORD_TRANS_PA:"ktlang-pa",KEYWORD_TRANS_RU:"ktlang-ru",KEYWORD_TRANS_SO:"ktlang-so",KEYWORD_TRANS_TL:"ktlang-tl",KEYWORD_TRANS_UK:"ktlang-uk",KEYWORD_TRANS_VI:"ktlang-vi",KEYWORD_TRANS_YUE:"ktlang-yue",KEYWORD_TRANS_ZH:"ktlang-zh",EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:"sbacGlossaryIllustration-on",EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:"sbacGlossaryIllustration-off"});return this.pnp=this.defaultPnp(),this}defaultPnp(){return{textAppearance:{colorStyle:this.constants.COLOR_DEFAULT},glossaryOnScreen:!0,keywordTranslationLanguage:"",extSbacGlossaryIllustration:!1,layoutSingleColumn:!1}}setPnp(t){typeof t>"u"||(t===null&&(this.pnp=this.defaultPnp()),"textAppearance"in t&&t.textAppearance!==null&&"colorStyle"in t.textAppearance&&this.setColorStyle(t.textAppearance.colorStyle),"glossaryOnScreen"in t&&t.glossaryOnScreen!==null&&this.setGlossaryOnScreen(t.glossaryOnScreen),"keywordTranslationLanguage"in t&&this.setKeywordTranslationLanguage(t.keywordTranslationLanguage),"extSbacGlossaryIllustration"in t&&t.extSbacGlossaryIllustration!==null&&this.setExtSbacGlossaryIllustration(t.extSbacGlossaryIllustration),"layoutSingleColumn"in t&&t.layoutSingleColumn!==null&&this.setLayoutSingleColumn(t.layoutSingleColumn))}getPnp(){return this.pnp}getColorStyle(){return this.pnp.textAppearance.colorStyle}setColorStyle(t){this.pnp.textAppearance.colorStyle=t}getGlossaryOnScreen(){return this.pnp.glossaryOnScreen}setGlossaryOnScreen(t){this.pnp.glossaryOnScreen=t}getKeywordTranslationLanguage(){return this.pnp.keywordTranslationLanguage}setKeywordTranslationLanguage(t){this.pnp.keywordTranslationLanguage=t}getExtSbacGlossaryIllustration(){return this.pnp.extSbacGlossaryIllustration}setExtSbacGlossaryIllustration(t){this.pnp.extSbacGlossaryIllustration=t}getLayoutSingleColumn(){return this.pnp.layoutSingleColumn}setLayoutSingleColumn(t){this.pnp.layoutSingleColumn=t}evaluatePnpEvent(t){let i=!1;switch(t){case this.constants.GLOSSARY_ON:this.getGlossaryOnScreen()===!1&&(this.setGlossaryOnScreen(!0),i=!0);break;case this.constants.GLOSSARY_OFF:this.getGlossaryOnScreen()===!0&&(this.setGlossaryOnScreen(!1),i=!0);break;case this.constants.KEYWORD_TRANS_OFF:this.getKeywordTranslationLanguage()!==""&&(this.setKeywordTranslationLanguage(""),i=!0);break;case this.constants.KEYWORD_TRANS_AR:this.getKeywordTranslationLanguage()!=="ar"&&(this.setKeywordTranslationLanguage("ar"),i=!0);break;case this.constants.KEYWORD_TRANS_CMN:this.getKeywordTranslationLanguage()!=="cmn"&&(this.setKeywordTranslationLanguage("cmn"),i=!0);break;case this.constants.KEYWORD_TRANS_DE:this.getKeywordTranslationLanguage()!=="de"&&(this.setKeywordTranslationLanguage("de"),i=!0);break;case this.constants.KEYWORD_TRANS_EN:this.getKeywordTranslationLanguage()!=="en"&&(this.setKeywordTranslationLanguage("en"),i=!0);break;case this.constants.KEYWORD_TRANS_ES:this.getKeywordTranslationLanguage()!=="es"&&(this.setKeywordTranslationLanguage("es"),i=!0);break;case this.constants.KEYWORD_TRANS_FR:this.getKeywordTranslationLanguage()!=="fr"&&(this.setKeywordTranslationLanguage("fr"),i=!0);break;case this.constants.KEYWORD_TRANS_HMN:this.getKeywordTranslationLanguage()!=="hmn"&&(this.setKeywordTranslationLanguage("hmn"),i=!0);break;case this.constants.KEYWORD_TRANS_IT:this.getKeywordTranslationLanguage()!=="it"&&(this.setKeywordTranslationLanguage("it"),i=!0);break;case this.constants.KEYWORD_TRANS_JA:this.getKeywordTranslationLanguage()!=="ja"&&(this.setKeywordTranslationLanguage("ja"),i=!0);break;case this.constants.KEYWORD_TRANS_KO:this.getKeywordTranslationLanguage()!=="ko"&&(this.setKeywordTranslationLanguage("ko"),i=!0);break;case this.constants.KEYWORD_TRANS_MY:this.getKeywordTranslationLanguage()!=="my"&&(this.setKeywordTranslationLanguage("my"),i=!0);break;case this.constants.KEYWORD_TRANS_NL:this.getKeywordTranslationLanguage()!=="nl"&&(this.setKeywordTranslationLanguage("nl"),i=!0);break;case this.constants.KEYWORD_TRANS_PA:this.getKeywordTranslationLanguage()!=="pa"&&(this.setKeywordTranslationLanguage("pa"),i=!0);break;case this.constants.KEYWORD_TRANS_RU:this.getKeywordTranslationLanguage()!=="ru"&&(this.setKeywordTranslationLanguage("ru"),i=!0);break;case this.constants.KEYWORD_TRANS_SO:this.getKeywordTranslationLanguage()!=="so"&&(this.setKeywordTranslationLanguage("so"),i=!0);break;case this.constants.KEYWORD_TRANS_TL:this.getKeywordTranslationLanguage()!=="tl"&&(this.setKeywordTranslationLanguage("tl"),i=!0);break;case this.constants.KEYWORD_TRANS_UK:this.getKeywordTranslationLanguage()!=="uk"&&(this.setKeywordTranslationLanguage("uk"),i=!0);break;case this.constants.KEYWORD_TRANS_VI:this.getKeywordTranslationLanguage()!=="vi"&&(this.setKeywordTranslationLanguage("vi"),i=!0);break;case this.constants.KEYWORD_TRANS_YUE:this.getKeywordTranslationLanguage()!=="yue"&&(this.setKeywordTranslationLanguage("yue"),i=!0);break;case this.constants.KEYWORD_TRANS_ZH:this.getKeywordTranslationLanguage()!=="zh"&&(this.setKeywordTranslationLanguage("zh"),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:this.getExtSbacGlossaryIllustration()===!1&&(this.setExtSbacGlossaryIllustration(!0),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:this.getExtSbacGlossaryIllustration()===!0&&(this.setExtSbacGlossaryIllustration(!1),i=!0);break}return i}}class jb{constructor(){J(this,"constants",{TIME_LIMITS_DEFAULT:{min_time:null,max_time:null,allow_late_submission:!1},ATTEMPTS_UNLIMITED:0});return this.sc=this.defaultSessionControl(),this}defaultSessionControl(){return this.sc={allow_comment:!1,allow_review:!0,allow_skipping:!0,max_attempts:this.constants.ATTEMPTS_UNLIMITED,show_feedback:!1,show_solution:!1,time_limits:this.constants.TIME_LIMITS_DEFAULT,validate_responses:!1},this.sc}setSessionControl(t){if(!(typeof t>"u")){if(t===null)return this.sc=this.defaultSessionControl();"allow_comment"in t&&t.allow_comment!==null&&this.setAllowComment(t.allow_comment),"allow_review"in t&&t.allow_review!==null&&this.setAllowReview(t.allow_review),"allow_skipping"in t&&t.allow_skipping!==null&&this.setAllowSkipping(t.allow_skipping),"max_attempts"in t&&t.max_attempts!==null&&this.setMaxAttempts(t.max_attempts),"show_feedback"in t&&t.show_feedback!==null&&this.setShowFeedback(t.show_feedback),"show_solution"in t&&t.show_solution!==null&&this.setShowSolution(t.show_solution),"time_limits"in t&&t.time_limits!==null&&("min_time"in t.time_limits&&this.setTimeLimitsMinTime(t.time_limits.min_time),"max_time"in t.time_limits&&this.setTimeLimitsMaxTime(t.time_limits.max_time),"allow_late_submission"in t.time_limits&&this.setTimeLimitsAllowLateSubmission(t.time_limits.allow_late_submission)),"validate_responses"in t&&t.validate_responses!==null&&this.setValidateResponses(t.validate_responses)}}getSessionControl(){return{allow_comment:this.getAllowComment(),allow_review:this.getAllowReview(),allow_skipping:this.getAllowSkipping(),max_attempts:this.getMaxAttempts(),show_feedback:this.getShowFeedback(),show_solution:this.getShowSolution(),time_limits:this.getTimeLimits(),validate_responses:this.getValidateResponses()}}getAllowComment(){return this.sc.allow_comment}setAllowComment(t){this.sc.allow_comment=t}getAllowReview(){return this.sc.allow_review}setAllowReview(t){this.sc.allow_review=t}getAllowSkipping(){return this.sc.allow_skipping}setAllowSkipping(t){this.sc.allow_skipping=t}getMaxAttempts(){return this.sc.max_attempts}setMaxAttempts(t){this.sc.max_attempts=t}getShowFeedback(){return this.sc.show_feedback}setShowFeedback(t){this.sc.show_feedback=t}getShowSolution(){return this.sc.show_solution}setShowSolution(t){this.sc.show_solution=t}getTimeLimits(){return this.sc.time_limits}setTimeLimits(t=null,i=null,s=!1){this.setTimeLimitsMinTime(t),this.setTimeLimitsMaxTime(i),this.setTimeLimitsAllowLateSubmission(s)}getTimeLimitsMinTime(){return this.sc.time_limits.min_time}setTimeLimitsMinTime(t){this.sc.time_limits.min_time=t}getTimeLimitsMaxTime(){return this.sc.time_limits.max_time}setTimeLimitsMaxTime(t){this.sc.time_limits.max_time=t}getTimeLimitsAllowLateSubmission(){return this.sc.time_limits.allow_late_submission}setTimeLimitsAllowLateSubmission(t){this.sc.time_limits.allow_late_submission=t}getValidateResponses(){return this.sc.validate_responses}setValidateResponses(t){this.sc.validate_responses=t}}class Cc{constructor(t,i){return typeof t>"u"?this:(this.identifier=t,this.guid=i.getItemContextGuid(),this.contextVariables=i.getContextDeclarations(),this.responseVariables=i.getResponseDeclarations(),this.templateVariables=i.getTemplateDeclarations(),this.outcomeVariables=i.getOutcomeDeclarations(),this.validationMessages=i.getItemContextValidationMessages(),this)}createStateFromState(t){return this.identifier=t.identifier,this.guid=t.guid,this.contextVariables=t.contextVariables,this.responseVariables=t.responseVariables,this.templateVariables=t.templateVariables,this.outcomeVariables=t.outcomeVariables,this.validationMessages=t.validationMessages,this.getSerializedState()}getSerializedState(){return{identifier:this.identifier,guid:this.guid,contextVariables:this.serializeVariables(this.contextVariables),responseVariables:this.serializeResponseVariables(this.responseVariables),outcomeVariables:this.serializeOutcomeVariables(this.outcomeVariables),templateVariables:this.serializeVariables(this.templateVariables),validationMessages:this.serializeValidationMessages(this.validationMessages)}}serializeResponseVariables(t){let i=[];return t.forEach(s=>{let n={identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),state:this.serializeVariableState(s.state)};"correctResponse"in s&&(n.correctResponse=this.serializeVariableValue(s.cardinality,s.correctResponse)),i.push(n)}),i}serializeOutcomeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),view:s.view,interpretation:s.interpretation,longInterpretation:s.longInterpretation,normalMaximum:s.normalMaximum,normalMinimum:s.normalMinimum,masteryValue:s.masteryValue,externalScored:s.externalScored,variableIdentifierRef:s.variableIdentifierRef})}),i}serializeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value)})}),i}serializeValidationMessages(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,message:s.message})}),i}serializeVariableValue(t,i){return t!=="record"?JSON.parse(JSON.stringify(i)):this.serializeRecordVariableValue(i)}serializeVariableState(t){return JSON.parse(JSON.stringify(t))}resolveBaseType(t){return typeof t>"u"?null:t}serializeRecordVariableValue(t){const i=this.strMapToJson(t);return this.jsonToStrMap(i)}strMapToJson(t){return JSON.stringify(this.strMapToObj(t))}jsonToStrMap(t){return this.objToStrMap(JSON.parse(t))}strMapToObj(t){let i=Object.create(null);for(let[s,n]of t)i[s]=typeof n=="object"&&n!==null?n.getValue():n;return i}objToStrMap(t){let i=new Map;for(let s of Object.keys(t))i.set(s,t[s]);return i}}class Wb{constructor(){J(this,"itemTimer");J(this,"itemDuration");this.setTime(0)}getTime(){return this.itemDuration}setTime(t){this.itemDuration=t}startTimer(){this.clearTimer(),this.setTime(0),this.itemTimer=setInterval(this.updateTime.bind(this),1e3)}updateTime(){++this.itemDuration}resetTimer(){this.clearTimer(),this.setTime(0)}clearTimer(){clearInterval(this.itemTimer)}}var zb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Tc=Math.ceil,Yt=Math.floor,Ct="[BigNumber Error] ",yf=Ct+"Number primitive has more than 15 significant digits: ",fi=1e14,ye=14,wf=9007199254740991,Sc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ws=1e7,Ot=1e9;function bf(e){var t,i,s,n=x.prototype={constructor:x,toString:null,valueOf:null},r=new x(1),a=20,o=4,u=-7,h=21,f=-1e7,m=1e7,y=!1,w=1,b=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function x(p,v){var C,N,V,L,q,A,M,k,R=this;if(!(R instanceof x))return new x(p,v);if(v==null){if(p&&p._isBigNumber===!0){R.s=p.s,!p.c||p.e>m?R.c=R.e=null:p.e<f?R.c=[R.e=0]:(R.e=p.e,R.c=p.c.slice());return}if((A=typeof p=="number")&&p*0==0){if(R.s=1/p<0?(p=-p,-1):1,p===~~p){for(L=0,q=p;q>=10;q/=10,L++);L>m?R.c=R.e=null:(R.e=L,R.c=[p]);return}k=String(p)}else{if(!zb.test(k=String(p)))return s(R,k,A);R.s=k.charCodeAt(0)==45?(k=k.slice(1),-1):1}(L=k.indexOf("."))>-1&&(k=k.replace(".","")),(q=k.search(/e/i))>0?(L<0&&(L=q),L+=+k.slice(q+1),k=k.substring(0,q)):L<0&&(L=k.length)}else{if(De(v,2,T.length,"Base"),v==10&&$)return R=new x(p),Q(R,a+R.e+1,o);if(k=String(p),A=typeof p=="number"){if(p*0!=0)return s(R,k,A,v);if(R.s=1/p<0?(k=k.slice(1),-1):1,x.DEBUG&&k.replace(/^0\.0*|\./,"").length>15)throw Error(yf+p)}else R.s=k.charCodeAt(0)===45?(k=k.slice(1),-1):1;for(C=T.slice(0,v),L=q=0,M=k.length;q<M;q++)if(C.indexOf(N=k.charAt(q))<0){if(N=="."){if(q>L){L=M;continue}}else if(!V&&(k==k.toUpperCase()&&(k=k.toLowerCase())||k==k.toLowerCase()&&(k=k.toUpperCase()))){V=!0,q=-1,L=0;continue}return s(R,String(p),A,v)}A=!1,k=i(k,v,10,R.s),(L=k.indexOf("."))>-1?k=k.replace(".",""):L=k.length}for(q=0;k.charCodeAt(q)===48;q++);for(M=k.length;k.charCodeAt(--M)===48;);if(k=k.slice(q,++M)){if(M-=q,A&&x.DEBUG&&M>15&&(p>wf||p!==Yt(p)))throw Error(yf+R.s*p);if((L=L-q-1)>m)R.c=R.e=null;else if(L<f)R.c=[R.e=0];else{if(R.e=L,R.c=[],q=(L+1)%ye,L<0&&(q+=ye),q<M){for(q&&R.c.push(+k.slice(0,q)),M-=ye;q<M;)R.c.push(+k.slice(q,q+=ye));q=ye-(k=k.slice(q)).length}else q-=M;for(;q--;k+="0");R.c.push(+k)}}else R.c=[R.e=0]}x.clone=bf,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(p){var v,C;if(p!=null)if(typeof p=="object"){if(p.hasOwnProperty(v="DECIMAL_PLACES")&&(C=p[v],De(C,0,Ot,v),a=C),p.hasOwnProperty(v="ROUNDING_MODE")&&(C=p[v],De(C,0,8,v),o=C),p.hasOwnProperty(v="EXPONENTIAL_AT")&&(C=p[v],C&&C.pop?(De(C[0],-1e9,0,v),De(C[1],0,Ot,v),u=C[0],h=C[1]):(De(C,-1e9,Ot,v),u=-(h=C<0?-C:C))),p.hasOwnProperty(v="RANGE"))if(C=p[v],C&&C.pop)De(C[0],-1e9,-1,v),De(C[1],1,Ot,v),f=C[0],m=C[1];else if(De(C,-1e9,Ot,v),C)f=-(m=C<0?-C:C);else throw Error(Ct+v+" cannot be zero: "+C);if(p.hasOwnProperty(v="CRYPTO"))if(C=p[v],C===!!C)if(C)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))y=C;else throw y=!C,Error(Ct+"crypto unavailable");else y=C;else throw Error(Ct+v+" not true or false: "+C);if(p.hasOwnProperty(v="MODULO_MODE")&&(C=p[v],De(C,0,9,v),w=C),p.hasOwnProperty(v="POW_PRECISION")&&(C=p[v],De(C,0,Ot,v),b=C),p.hasOwnProperty(v="FORMAT"))if(C=p[v],typeof C=="object")S=C;else throw Error(Ct+v+" not an object: "+C);if(p.hasOwnProperty(v="ALPHABET"))if(C=p[v],typeof C=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(C))$=C.slice(0,10)=="0123456789",T=C;else throw Error(Ct+v+" invalid: "+C)}else throw Error(Ct+"Object expected: "+p);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[u,h],RANGE:[f,m],CRYPTO:y,MODULO_MODE:w,POW_PRECISION:b,FORMAT:S,ALPHABET:T}},x.isBigNumber=function(p){if(!p||p._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var v,C,N=p.c,V=p.e,L=p.s;e:if({}.toString.call(N)=="[object Array]"){if((L===1||L===-1)&&V>=-1e9&&V<=Ot&&V===Yt(V)){if(N[0]===0){if(V===0&&N.length===1)return!0;break e}if(v=(V+1)%ye,v<1&&(v+=ye),String(N[0]).length==v){for(v=0;v<N.length;v++)if(C=N[v],C<0||C>=fi||C!==Yt(C))break e;if(C!==0)return!0}}}else if(N===null&&V===null&&(L===null||L===1||L===-1))return!0;throw Error(Ct+"Invalid BigNumber: "+p)},x.maximum=x.max=function(){return E(arguments,-1)},x.minimum=x.min=function(){return E(arguments,1)},x.random=function(){var p=9007199254740992,v=Math.random()*p&2097151?function(){return Yt(Math.random()*p)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var N,V,L,q,A,M=0,k=[],R=new x(r);if(C==null?C=a:De(C,0,Ot),q=Tc(C/ye),y)if(crypto.getRandomValues){for(N=crypto.getRandomValues(new Uint32Array(q*=2));M<q;)A=N[M]*131072+(N[M+1]>>>11),A>=9e15?(V=crypto.getRandomValues(new Uint32Array(2)),N[M]=V[0],N[M+1]=V[1]):(k.push(A%1e14),M+=2);M=q/2}else if(crypto.randomBytes){for(N=crypto.randomBytes(q*=7);M<q;)A=(N[M]&31)*281474976710656+N[M+1]*1099511627776+N[M+2]*4294967296+N[M+3]*16777216+(N[M+4]<<16)+(N[M+5]<<8)+N[M+6],A>=9e15?crypto.randomBytes(7).copy(N,M):(k.push(A%1e14),M+=7);M=q/7}else throw y=!1,Error(Ct+"crypto unavailable");if(!y)for(;M<q;)A=v(),A<9e15&&(k[M++]=A%1e14);for(q=k[--M],C%=ye,q&&C&&(A=Sc[ye-C],k[M]=Yt(q/A)*A);k[M]===0;k.pop(),M--);if(M<0)k=[L=0];else{for(L=-1;k[0]===0;k.splice(0,1),L-=ye);for(M=1,A=k[0];A>=10;A/=10,M++);M<ye&&(L-=ye-M)}return R.e=L,R.c=k,R}}(),x.sum=function(){for(var p=1,v=arguments,C=new x(v[0]);p<v.length;)C=C.plus(v[p++]);return C},i=function(){var p="0123456789";function v(C,N,V,L){for(var q,A=[0],M,k=0,R=C.length;k<R;){for(M=A.length;M--;A[M]*=N);for(A[0]+=L.indexOf(C.charAt(k++)),q=0;q<A.length;q++)A[q]>V-1&&(A[q+1]==null&&(A[q+1]=0),A[q+1]+=A[q]/V|0,A[q]%=V)}return A.reverse()}return function(C,N,V,L,q){var A,M,k,R,Y,Z,ne,de,ge=C.indexOf("."),Ee=a,D=o;for(ge>=0&&(R=b,b=0,C=C.replace(".",""),de=new x(N),Z=de.pow(C.length-ge),b=R,de.c=v(Ji(Zt(Z.c),Z.e,"0"),10,V,p),de.e=de.c.length),ne=v(C,N,V,q?(A=T,p):(A=p,T)),k=R=ne.length;ne[--R]==0;ne.pop());if(!ne[0])return A.charAt(0);if(ge<0?--k:(Z.c=ne,Z.e=k,Z.s=L,Z=t(Z,de,Ee,D,V),ne=Z.c,Y=Z.r,k=Z.e),M=k+Ee+1,ge=ne[M],R=V/2,Y=Y||M<0||ne[M+1]!=null,Y=D<4?(ge!=null||Y)&&(D==0||D==(Z.s<0?3:2)):ge>R||ge==R&&(D==4||Y||D==6&&ne[M-1]&1||D==(Z.s<0?8:7)),M<1||!ne[0])C=Y?Ji(A.charAt(1),-Ee,A.charAt(0)):A.charAt(0);else{if(ne.length=M,Y)for(--V;++ne[--M]>V;)ne[M]=0,M||(++k,ne=[1].concat(ne));for(R=ne.length;!ne[--R];);for(ge=0,C="";ge<=R;C+=A.charAt(ne[ge++]));C=Ji(C,k,A.charAt(0))}return C}}(),t=function(){function p(N,V,L){var q,A,M,k,R=0,Y=N.length,Z=V%ws,ne=V/ws|0;for(N=N.slice();Y--;)M=N[Y]%ws,k=N[Y]/ws|0,q=ne*M+k*Z,A=Z*M+q%ws*ws+R,R=(A/L|0)+(q/ws|0)+ne*k,N[Y]=A%L;return R&&(N=[R].concat(N)),N}function v(N,V,L,q){var A,M;if(L!=q)M=L>q?1:-1;else for(A=M=0;A<L;A++)if(N[A]!=V[A]){M=N[A]>V[A]?1:-1;break}return M}function C(N,V,L,q){for(var A=0;L--;)N[L]-=A,A=N[L]<V[L]?1:0,N[L]=A*q+N[L]-V[L];for(;!N[0]&&N.length>1;N.splice(0,1));}return function(N,V,L,q,A){var M,k,R,Y,Z,ne,de,ge,Ee,D,z,Me,qe,vt,rt,He,dt,Fe=N.s==V.s?1:-1,Oe=N.c,Ie=V.c;if(!Oe||!Oe[0]||!Ie||!Ie[0])return new x(!N.s||!V.s||(Oe?Ie&&Oe[0]==Ie[0]:!Ie)?NaN:Oe&&Oe[0]==0||!Ie?Fe*0:Fe/0);for(ge=new x(Fe),Ee=ge.c=[],k=N.e-V.e,Fe=L+k+1,A||(A=fi,k=Xt(N.e/ye)-Xt(V.e/ye),Fe=Fe/ye|0),R=0;Ie[R]==(Oe[R]||0);R++);if(Ie[R]>(Oe[R]||0)&&k--,Fe<0)Ee.push(1),Y=!0;else{for(vt=Oe.length,He=Ie.length,R=0,Fe+=2,Z=Yt(A/(Ie[0]+1)),Z>1&&(Ie=p(Ie,Z,A),Oe=p(Oe,Z,A),He=Ie.length,vt=Oe.length),qe=He,D=Oe.slice(0,He),z=D.length;z<He;D[z++]=0);dt=Ie.slice(),dt=[0].concat(dt),rt=Ie[0],Ie[1]>=A/2&&rt++;do{if(Z=0,M=v(Ie,D,He,z),M<0){if(Me=D[0],He!=z&&(Me=Me*A+(D[1]||0)),Z=Yt(Me/rt),Z>1)for(Z>=A&&(Z=A-1),ne=p(Ie,Z,A),de=ne.length,z=D.length;v(ne,D,de,z)==1;)Z--,C(ne,He<de?dt:Ie,de,A),de=ne.length,M=1;else Z==0&&(M=Z=1),ne=Ie.slice(),de=ne.length;if(de<z&&(ne=[0].concat(ne)),C(D,ne,z,A),z=D.length,M==-1)for(;v(Ie,D,He,z)<1;)Z++,C(D,He<z?dt:Ie,z,A),z=D.length}else M===0&&(Z++,D=[0]);Ee[R++]=Z,D[0]?D[z++]=Oe[qe]||0:(D=[Oe[qe]],z=1)}while((qe++<vt||D[0]!=null)&&Fe--);Y=D[0]!=null,Ee[0]||Ee.splice(0,1)}if(A==fi){for(R=1,Fe=Ee[0];Fe>=10;Fe/=10,R++);Q(ge,L+(ge.e=R+k*ye-1)+1,q,Y)}else ge.e=k,ge.r=+Y;return ge}}();function B(p,v,C,N){var V,L,q,A,M;if(C==null?C=o:De(C,0,8),!p.c)return p.toString();if(V=p.c[0],q=p.e,v==null)M=Zt(p.c),M=N==1||N==2&&(q<=u||q>=h)?Eo(M,q):Ji(M,q,"0");else if(p=Q(new x(p),v,C),L=p.e,M=Zt(p.c),A=M.length,N==1||N==2&&(v<=L||L<=u)){for(;A<v;M+="0",A++);M=Eo(M,L)}else if(v-=q,M=Ji(M,L,"0"),L+1>A){if(--v>0)for(M+=".";v--;M+="0");}else if(v+=L-A,v>0)for(L+1==A&&(M+=".");v--;M+="0");return p.s<0&&V?"-"+M:M}function E(p,v){for(var C,N,V=1,L=new x(p[0]);V<p.length;V++)N=new x(p[V]),(!N.s||(C=Qs(L,N))===v||C===0&&L.s===v)&&(L=N);return L}function G(p,v,C){for(var N=1,V=v.length;!v[--V];v.pop());for(V=v[0];V>=10;V/=10,N++);return(C=N+C*ye-1)>m?p.c=p.e=null:C<f?p.c=[p.e=0]:(p.e=C,p.c=v),p}s=function(){var p=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,C=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,V=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(L,q,A,M){var k,R=A?q:q.replace(V,"");if(N.test(R))L.s=isNaN(R)?null:R<0?-1:1;else{if(!A&&(R=R.replace(p,function(Y,Z,ne){return k=(ne=ne.toLowerCase())=="x"?16:ne=="b"?2:8,!M||M==k?Z:Y}),M&&(k=M,R=R.replace(v,"$1").replace(C,"0.$1")),q!=R))return new x(R,k);if(x.DEBUG)throw Error(Ct+"Not a"+(M?" base "+M:"")+" number: "+q);L.s=null}L.c=L.e=null}}();function Q(p,v,C,N){var V,L,q,A,M,k,R,Y=p.c,Z=Sc;if(Y){e:{for(V=1,A=Y[0];A>=10;A/=10,V++);if(L=v-V,L<0)L+=ye,q=v,M=Y[k=0],R=Yt(M/Z[V-q-1]%10);else if(k=Tc((L+1)/ye),k>=Y.length)if(N){for(;Y.length<=k;Y.push(0));M=R=0,V=1,L%=ye,q=L-ye+1}else break e;else{for(M=A=Y[k],V=1;A>=10;A/=10,V++);L%=ye,q=L-ye+V,R=q<0?0:Yt(M/Z[V-q-1]%10)}if(N=N||v<0||Y[k+1]!=null||(q<0?M:M%Z[V-q-1]),N=C<4?(R||N)&&(C==0||C==(p.s<0?3:2)):R>5||R==5&&(C==4||N||C==6&&(L>0?q>0?M/Z[V-q]:0:Y[k-1])%10&1||C==(p.s<0?8:7)),v<1||!Y[0])return Y.length=0,N?(v-=p.e+1,Y[0]=Z[(ye-v%ye)%ye],p.e=-v||0):Y[0]=p.e=0,p;if(L==0?(Y.length=k,A=1,k--):(Y.length=k+1,A=Z[ye-L],Y[k]=q>0?Yt(M/Z[V-q]%Z[q])*A:0),N)for(;;)if(k==0){for(L=1,q=Y[0];q>=10;q/=10,L++);for(q=Y[0]+=A,A=1;q>=10;q/=10,A++);L!=A&&(p.e++,Y[0]==fi&&(Y[0]=1));break}else{if(Y[k]+=A,Y[k]!=fi)break;Y[k--]=0,A=1}for(L=Y.length;Y[--L]===0;Y.pop());}p.e>m?p.c=p.e=null:p.e<f&&(p.c=[p.e=0])}return p}function ee(p){var v,C=p.e;return C===null?p.toString():(v=Zt(p.c),v=C<=u||C>=h?Eo(v,C):Ji(v,C,"0"),p.s<0?"-"+v:v)}return n.absoluteValue=n.abs=function(){var p=new x(this);return p.s<0&&(p.s=1),p},n.comparedTo=function(p,v){return Qs(this,new x(p,v))},n.decimalPlaces=n.dp=function(p,v){var C,N,V,L=this;if(p!=null)return De(p,0,Ot),v==null?v=o:De(v,0,8),Q(new x(L),p+L.e+1,v);if(!(C=L.c))return null;if(N=((V=C.length-1)-Xt(this.e/ye))*ye,V=C[V])for(;V%10==0;V/=10,N--);return N<0&&(N=0),N},n.dividedBy=n.div=function(p,v){return t(this,new x(p,v),a,o)},n.dividedToIntegerBy=n.idiv=function(p,v){return t(this,new x(p,v),0,1)},n.exponentiatedBy=n.pow=function(p,v){var C,N,V,L,q,A,M,k,R,Y=this;if(p=new x(p),p.c&&!p.isInteger())throw Error(Ct+"Exponent not an integer: "+ee(p));if(v!=null&&(v=new x(v)),A=p.e>14,!Y.c||!Y.c[0]||Y.c[0]==1&&!Y.e&&Y.c.length==1||!p.c||!p.c[0])return R=new x(Math.pow(+ee(Y),A?p.s*(2-vo(p)):+ee(p))),v?R.mod(v):R;if(M=p.s<0,v){if(v.c?!v.c[0]:!v.s)return new x(NaN);N=!M&&Y.isInteger()&&v.isInteger(),N&&(Y=Y.mod(v))}else{if(p.e>9&&(Y.e>0||Y.e<-1||(Y.e==0?Y.c[0]>1||A&&Y.c[1]>=24e7:Y.c[0]<8e13||A&&Y.c[0]<=9999975e7)))return L=Y.s<0&&vo(p)?-0:0,Y.e>-1&&(L=1/L),new x(M?1/L:L);b&&(L=Tc(b/ye+2))}for(A?(C=new x(.5),M&&(p.s=1),k=vo(p)):(V=Math.abs(+ee(p)),k=V%2),R=new x(r);;){if(k){if(R=R.times(Y),!R.c)break;L?R.c.length>L&&(R.c.length=L):N&&(R=R.mod(v))}if(V){if(V=Yt(V/2),V===0)break;k=V%2}else if(p=p.times(C),Q(p,p.e+1,1),p.e>14)k=vo(p);else{if(V=+ee(p),V===0)break;k=V%2}Y=Y.times(Y),L?Y.c&&Y.c.length>L&&(Y.c.length=L):N&&(Y=Y.mod(v))}return N?R:(M&&(R=r.div(R)),v?R.mod(v):L?Q(R,b,o,q):R)},n.integerValue=function(p){var v=new x(this);return p==null?p=o:De(p,0,8),Q(v,v.e+1,p)},n.isEqualTo=n.eq=function(p,v){return Qs(this,new x(p,v))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(p,v){return Qs(this,new x(p,v))>0},n.isGreaterThanOrEqualTo=n.gte=function(p,v){return(v=Qs(this,new x(p,v)))===1||v===0},n.isInteger=function(){return!!this.c&&Xt(this.e/ye)>this.c.length-2},n.isLessThan=n.lt=function(p,v){return Qs(this,new x(p,v))<0},n.isLessThanOrEqualTo=n.lte=function(p,v){return(v=Qs(this,new x(p,v)))===-1||v===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(p,v){var C,N,V,L,q=this,A=q.s;if(p=new x(p,v),v=p.s,!A||!v)return new x(NaN);if(A!=v)return p.s=-v,q.plus(p);var M=q.e/ye,k=p.e/ye,R=q.c,Y=p.c;if(!M||!k){if(!R||!Y)return R?(p.s=-v,p):new x(Y?q:NaN);if(!R[0]||!Y[0])return Y[0]?(p.s=-v,p):new x(R[0]?q:o==3?-0:0)}if(M=Xt(M),k=Xt(k),R=R.slice(),A=M-k){for((L=A<0)?(A=-A,V=R):(k=M,V=Y),V.reverse(),v=A;v--;V.push(0));V.reverse()}else for(N=(L=(A=R.length)<(v=Y.length))?A:v,A=v=0;v<N;v++)if(R[v]!=Y[v]){L=R[v]<Y[v];break}if(L&&(V=R,R=Y,Y=V,p.s=-p.s),v=(N=Y.length)-(C=R.length),v>0)for(;v--;R[C++]=0);for(v=fi-1;N>A;){if(R[--N]<Y[N]){for(C=N;C&&!R[--C];R[C]=v);--R[C],R[N]+=fi}R[N]-=Y[N]}for(;R[0]==0;R.splice(0,1),--k);return R[0]?G(p,R,k):(p.s=o==3?-1:1,p.c=[p.e=0],p)},n.modulo=n.mod=function(p,v){var C,N,V=this;return p=new x(p,v),!V.c||!p.s||p.c&&!p.c[0]?new x(NaN):!p.c||V.c&&!V.c[0]?new x(V):(w==9?(N=p.s,p.s=1,C=t(V,p,0,3),p.s=N,C.s*=N):C=t(V,p,0,w),p=V.minus(C.times(p)),!p.c[0]&&w==1&&(p.s=V.s),p)},n.multipliedBy=n.times=function(p,v){var C,N,V,L,q,A,M,k,R,Y,Z,ne,de,ge,Ee,D=this,z=D.c,Me=(p=new x(p,v)).c;if(!z||!Me||!z[0]||!Me[0])return!D.s||!p.s||z&&!z[0]&&!Me||Me&&!Me[0]&&!z?p.c=p.e=p.s=null:(p.s*=D.s,!z||!Me?p.c=p.e=null:(p.c=[0],p.e=0)),p;for(N=Xt(D.e/ye)+Xt(p.e/ye),p.s*=D.s,M=z.length,Y=Me.length,M<Y&&(de=z,z=Me,Me=de,V=M,M=Y,Y=V),V=M+Y,de=[];V--;de.push(0));for(ge=fi,Ee=ws,V=Y;--V>=0;){for(C=0,Z=Me[V]%Ee,ne=Me[V]/Ee|0,q=M,L=V+q;L>V;)k=z[--q]%Ee,R=z[q]/Ee|0,A=ne*k+R*Z,k=Z*k+A%Ee*Ee+de[L]+C,C=(k/ge|0)+(A/Ee|0)+ne*R,de[L--]=k%ge;de[L]=C}return C?++N:de.splice(0,1),G(p,de,N)},n.negated=function(){var p=new x(this);return p.s=-p.s||null,p},n.plus=function(p,v){var C,N=this,V=N.s;if(p=new x(p,v),v=p.s,!V||!v)return new x(NaN);if(V!=v)return p.s=-v,N.minus(p);var L=N.e/ye,q=p.e/ye,A=N.c,M=p.c;if(!L||!q){if(!A||!M)return new x(V/0);if(!A[0]||!M[0])return M[0]?p:new x(A[0]?N:V*0)}if(L=Xt(L),q=Xt(q),A=A.slice(),V=L-q){for(V>0?(q=L,C=M):(V=-V,C=A),C.reverse();V--;C.push(0));C.reverse()}for(V=A.length,v=M.length,V-v<0&&(C=M,M=A,A=C,v=V),V=0;v;)V=(A[--v]=A[v]+M[v]+V)/fi|0,A[v]=fi===A[v]?0:A[v]%fi;return V&&(A=[V].concat(A),++q),G(p,A,q)},n.precision=n.sd=function(p,v){var C,N,V,L=this;if(p!=null&&p!==!!p)return De(p,1,Ot),v==null?v=o:De(v,0,8),Q(new x(L),p,v);if(!(C=L.c))return null;if(V=C.length-1,N=V*ye+1,V=C[V]){for(;V%10==0;V/=10,N--);for(V=C[0];V>=10;V/=10,N++);}return p&&L.e+1>N&&(N=L.e+1),N},n.shiftedBy=function(p){return De(p,-9007199254740991,wf),this.times("1e"+p)},n.squareRoot=n.sqrt=function(){var p,v,C,N,V,L=this,q=L.c,A=L.s,M=L.e,k=a+4,R=new x("0.5");if(A!==1||!q||!q[0])return new x(!A||A<0&&(!q||q[0])?NaN:q?L:1/0);if(A=Math.sqrt(+ee(L)),A==0||A==1/0?(v=Zt(q),(v.length+M)%2==0&&(v+="0"),A=Math.sqrt(+v),M=Xt((M+1)/2)-(M<0||M%2),A==1/0?v="5e"+M:(v=A.toExponential(),v=v.slice(0,v.indexOf("e")+1)+M),C=new x(v)):C=new x(A+""),C.c[0]){for(M=C.e,A=M+k,A<3&&(A=0);;)if(V=C,C=R.times(V.plus(t(L,V,k,1))),Zt(V.c).slice(0,A)===(v=Zt(C.c)).slice(0,A))if(C.e<M&&--A,v=v.slice(A-3,A+1),v=="9999"||!N&&v=="4999"){if(!N&&(Q(V,V.e+a+2,0),V.times(V).eq(L))){C=V;break}k+=4,A+=4,N=1}else{(!+v||!+v.slice(1)&&v.charAt(0)=="5")&&(Q(C,C.e+a+2,1),p=!C.times(C).eq(L));break}}return Q(C,C.e+a+1,o,p)},n.toExponential=function(p,v){return p!=null&&(De(p,0,Ot),p++),B(this,p,v,1)},n.toFixed=function(p,v){return p!=null&&(De(p,0,Ot),p=p+this.e+1),B(this,p,v)},n.toFormat=function(p,v,C){var N,V=this;if(C==null)p!=null&&v&&typeof v=="object"?(C=v,v=null):p&&typeof p=="object"?(C=p,p=v=null):C=S;else if(typeof C!="object")throw Error(Ct+"Argument not an object: "+C);if(N=V.toFixed(p,v),V.c){var L,q=N.split("."),A=+C.groupSize,M=+C.secondaryGroupSize,k=C.groupSeparator||"",R=q[0],Y=q[1],Z=V.s<0,ne=Z?R.slice(1):R,de=ne.length;if(M&&(L=A,A=M,M=L,de-=L),A>0&&de>0){for(L=de%A||A,R=ne.substr(0,L);L<de;L+=A)R+=k+ne.substr(L,A);M>0&&(R+=k+ne.slice(L)),Z&&(R="-"+R)}N=Y?R+(C.decimalSeparator||"")+((M=+C.fractionGroupSize)?Y.replace(new RegExp("\\d{"+M+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):Y):R}return(C.prefix||"")+N+(C.suffix||"")},n.toFraction=function(p){var v,C,N,V,L,q,A,M,k,R,Y,Z,ne=this,de=ne.c;if(p!=null&&(A=new x(p),!A.isInteger()&&(A.c||A.s!==1)||A.lt(r)))throw Error(Ct+"Argument "+(A.isInteger()?"out of range: ":"not an integer: ")+ee(A));if(!de)return new x(ne);for(v=new x(r),k=C=new x(r),N=M=new x(r),Z=Zt(de),L=v.e=Z.length-ne.e-1,v.c[0]=Sc[(q=L%ye)<0?ye+q:q],p=!p||A.comparedTo(v)>0?L>0?v:k:A,q=m,m=1/0,A=new x(Z),M.c[0]=0;R=t(A,v,0,1),V=C.plus(R.times(N)),V.comparedTo(p)!=1;)C=N,N=V,k=M.plus(R.times(V=k)),M=V,v=A.minus(R.times(V=v)),A=V;return V=t(p.minus(C),N,0,1),M=M.plus(V.times(k)),C=C.plus(V.times(N)),M.s=k.s=ne.s,L=L*2,Y=t(k,N,L,o).minus(ne).abs().comparedTo(t(M,C,L,o).minus(ne).abs())<1?[k,N]:[M,C],m=q,Y},n.toNumber=function(){return+ee(this)},n.toPrecision=function(p,v){return p!=null&&De(p,1,Ot),B(this,p,v,2)},n.toString=function(p){var v,C=this,N=C.s,V=C.e;return V===null?N?(v="Infinity",N<0&&(v="-"+v)):v="NaN":(p==null?v=V<=u||V>=h?Eo(Zt(C.c),V):Ji(Zt(C.c),V,"0"):p===10&&$?(C=Q(new x(C),a+V+1,o),v=Ji(Zt(C.c),C.e,"0")):(De(p,2,T.length,"Base"),v=i(Ji(Zt(C.c),V,"0"),10,p,N,!0)),N<0&&C.c[0]&&(v="-"+v)),v},n.valueOf=n.toJSON=function(){return ee(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,e!=null&&x.set(e),x}function Xt(e){var t=e|0;return e>0||e===t?t:t-1}function Zt(e){for(var t,i,s=1,n=e.length,r=e[0]+"";s<n;){for(t=e[s++]+"",i=ye-t.length;i--;t="0"+t);r+=t}for(n=r.length;r.charCodeAt(--n)===48;);return r.slice(0,n+1||1)}function Qs(e,t){var i,s,n=e.c,r=t.c,a=e.s,o=t.s,u=e.e,h=t.e;if(!a||!o)return null;if(i=n&&!n[0],s=r&&!r[0],i||s)return i?s?0:-o:a;if(a!=o)return a;if(i=a<0,s=u==h,!n||!r)return s?0:!n^i?1:-1;if(!s)return u>h^i?1:-1;for(o=(u=n.length)<(h=r.length)?u:h,a=0;a<o;a++)if(n[a]!=r[a])return n[a]>r[a]^i?1:-1;return u==h?0:u>h^i?1:-1}function De(e,t,i,s){if(e<t||e>i||e!==Yt(e))throw Error(Ct+(s||"Argument")+(typeof e=="number"?e<t||e>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function vo(e){var t=e.c.length-1;return Xt(e.e/ye)==t&&e.c[t]%2!=0}function Eo(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Ji(e,t,i){var s,n;if(t<0){for(n=i+".";++t;n+=i);e=n+e}else if(s=e.length,++t>s){for(n=i,t-=s;--t;n+=i);e+=n}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=bf();class O extends Error{constructor(t){super(t),this.name="QtiEvaluationException"}}class te{QTI_RESPONSE_RULES(){return["qti-response-processing-fragment","qti-response-condition","qti-set-outcome-value","qti-lookup-outcome-value","qti-get-outcome-value","qti-exit-response"]}QTI_TEMPLATE_RULES(){return["qti-set-template-value","qti-exit-template","qti-template-condition","qti-set-default-value","qti-set-correct-response","qti-template-constraint"]}QTI_EXPRESSIONS(){return["qti-base-value","qti-variable","qti-correct","qti-default","qti-is-null","qti-null","qti-and","qti-or","qti-not","qti-match","qti-map-response","qti-member","qti-subtract","qti-sum","qti-random","qti-random-float","qti-random-integer","qti-index","qti-integer-divide","qti-integer-modulus","qti-integer-to-float","qti-equal","qti-equal-rounded","qti-field-value","qti-multiple","qti-ordered","qti-map-response-point","qti-product","qti-delete","qti-string-match","qti-pattern-match","qti-substring","qti-round","qti-round-to","qti-truncate","qti-divide","qti-gt","qti-gte","qti-lt","qti-lte","qti-max","qti-min","qti-custom-operator","qti-math-operator","qti-math-constant","qti-repeat","qti-gcd","qti-lcm","qti-stats-operator","qti-power","qti-any-n","qti-inside","qti-test-variables"]}constructor(){}isExpressionNode(t){return this.QTI_EXPRESSIONS().includes(t)}isResponseRuleNode(t){return this.QTI_RESPONSE_RULES().includes(t)}isTemplateRuleNode(t){return this.QTI_TEMPLATE_RULES().includes(t)}nullValue(){return null}isNullValue(t){return typeof t>"u"||t===null}isBaseTypeNumeric(t){return t==="float"||t==="integer"}isSingleValuesMatch(t,i,s){if(this.isBaseTypeNumeric(t)){let n=new j(i),r=new j(s);return n.comparedTo(r)==0}return i===s}isMultipleValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;const n=i.concat().sort(),r=s.concat().sort();if(this.isBaseTypeNumeric(t)){for(let a=0;a<n.length;a++)if(!this.isSingleValuesMatch(t,n[a],r[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==r[a])return!1;return!0}isOrderedValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;if(this.isBaseTypeNumeric(t)){for(let n=0;n<i.length;n++)if(!this.isSingleValuesMatch(t,i[n],s[n]))return!1}else for(let n=0;n<i.length;n++)if(i[n]!==s[n])return!1;return!0}mapResponse(t){if(this.isNullValue(t.value))return t.mapping.getDefaultValue();const i=t.mapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.isBaseTypeNumeric(t.baseType)?new j(t.value).toString():t.value;for(let r=0;r<s;r++){const a=i[r];if(this.isSingleValuesMatch("string",a.caseSensitive?a.mapKey:a.mapKey.toLowerCase(),a.caseSensitive?n:n.toLowerCase()))return t.mapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"||t.cardinality==="ordered"){let n=new j(0),r=t.value;if(this.isBaseTypeNumeric(t.baseType))for(let a=0;a<r.length;a++)r[a]!==null&&(r[a]=new j(r[a]).toString());r=this.mappingEliminateNullsAndDuplicates(r);for(let a=0;a<s;a++){const o=i[a];for(let u=0;u<r.length;u++)this.isSingleValuesMatch("string",o.caseSensitive?o.mapKey:o.mapKey.toLowerCase(),o.caseSensitive?r[u]:r[u].toLowerCase())&&(n=n.plus(o.mappedValue))}return t.mapping.applyConstraints(n)}return t.mapping.getDefaultValue()}mappingEliminateNullsAndDuplicates(t){let i=t.length,s=[],n={};for(let r=0;r<i;r++)t[r]!==null&&(n[t[r]]=0);for(let r in n)s.push(r);return s}mapValueFromLookupTable(t,i){if(this.isNullValue(t.lookupTable))return this.nullValue();if(this.isNullValue(i))return t.lookupTable.getDefaultValue();const s=t.lookupTable.getValue(),n=t.lookupTable.getTableType();if(i=new j(i),n==="interpolation"){s.sort(function(r,a){return r.sourceValue-a.sourceValue});for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)<0||a.includeBoundary&&i.comparedTo(o)===0)return a.targetValue}}else if(n==="match"){i=new j(i);for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)===0)return a.targetValue}}return t.lookupTable.getDefaultValue()}mapResponsePoint(t){if(this.isNullValue(t.value))return t.areaMapping.getDefaultValue();const i=t.areaMapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.toPointObject(t.value);for(let r=0;r<s;r++){const a=i[r];if(this.isPointInside(a.mapShape,a.mapCoords,n))return t.areaMapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"){let n=new j(0),r=t.value,a=Array.from(r);for(let o=0;o<s;o++){const u=i[o];let h=!0;for(let f=0;f<r.length;f++){let m=this.toPointObject(r[f]);if(this.isPointInside(u.mapShape,u.mapCoords,m)){h&&(n=n.plus(u.mappedValue),h=!1);const y=a.indexOf(r[f]);y>-1&&a.splice(y,1)}}}return n=n.plus(new j(t.areaMapping.getDefaultValue()).times(a.length)),t.areaMapping.applyConstraints(n)}return t.areaMapping.getDefaultValue()}toPointObject(t){if(t===null||typeof t!="string")return null;const i=t.split(" ");if(i.length!=2)return null;const s=new j(i[0]).toNumber(),n=new j(i[1]).toNumber();return{x:s,y:n}}shuffleArray(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1)),n=t[i];t[i]=t[s],t[s]=n}}shuffleArrayFixed(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1));if(t[i].fixed||t[s].fixed)continue;let n=t[i];t[i]=t[s],t[s]=n}}generalizedLcm(t,i){let s=i[0];for(let n=1;n<t;n++){if(s===0||i[n]===0)return 0;s=this.lcm(s,i[n])}return s}lcm(t,i){return new j(t).multipliedBy(i).dividedBy(this.gcd(t,i)).toNumber()}generalizedGcd(t,i){let s=i[0];for(let n=1;n<t;n++)s=this.gcd(s,i[n]);return s}gcd(t,i){return i=new j(i),i.isZero()?t:this.gcd(i.toNumber(),new j(t).modulo(i).toNumber())}getParametersFromDefinition(t){let i=new Map;if(typeof t>"u"||(t=t.trim(),t.length===0))return i;let s=t.split("|||");for(let n=0;n<s.length;n++){const r=s[n].split("=");i.set(r[0],r.length<2?"":r[1].replaceAll("&equals;","="))}return i}computeWordCount(t){const i=t.match(/\S+/g);return i===null?0:i.length}isPointInside(t,i,s){const n={COORDS_LENGTH:3,CENTER_X:0,CENTER_Y:1,RADIUS:2,isInside(o,u){const h=Math.pow(u.x-o[this.CENTER_X],2),f=Math.pow(u.y-o[this.CENTER_Y],2);return h+f<=Math.pow(o[this.RADIUS],2)}},r={COORDS_LENGTH:4,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(o,u){return u.x>=o[this.LEFT_X]&&u.x<=o[this.RIGHT_X]&&u.y>=o[this.TOP_Y]&&u.y<=o[this.BOTTOM_Y]}},a={MINIMUM_COORDS_LENGTH:6,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(o,u){let h=o;if(h[0]!=h[h.length-2]||h[1]!=h[h.length-1]){let b=h;b.push(h[0]),b.push(h[1]),h=b}let f=new j(0);const m=new j(u.x).integerValue(),y=new j(u.y).integerValue();for(let b=0;b<h.length-3;b+=2){const S=new j(h[b]).integerValue(),T=new j(h[b+1]).integerValue(),$=new j(h[b+2]).integerValue(),x=new j(h[b+3]).integerValue(),B=m.minus($).pow(2).plus(y.minus(x).pow(2)).sqrt(),E=$.minus(S).pow(2).plus(x.minus(T).pow(2)).sqrt(),G=S.minus(m).pow(2).plus(T.minus(y).pow(2)).sqrt(),Q=new j(Math.acos((Math.pow(B.toNumber(),2)-Math.pow(E.toNumber(),2)+Math.pow(G.toNumber(),2))/(2*B.toNumber()*G.toNumber()))*180/Math.PI),ee=$.minus(m).times(y.minus(T)),p=x.minus(y).times(m.minus(S)),v=ee.minus(p);if(Q.isNaN())return!0;v.gte(new j(0))?f=f.plus(Q):f=f.minus(Q)}let w=new j(f);return w=w.dp(6,j.ROUND_HALF_UP),!w.isZero()}};if(t==="circle")return n.isInside(i,s);if(t==="rect")return r.isInside(i,s);if(t==="poly")return a.isInside(i,s);if(t==="default")return!0;if(t==="ellipse")return!1}valueToPciJson(t,i,s){return t===null?{base:null}:s==="single"?{base:this.baseValueToPciJson(t,i)}:s==="multiple"||s==="ordered"?{list:this.baseValueToPciJson(t,i)}:s==="record"?{record:this.recordValueToPciJson(t)}:{base:null}}baseValueToPciJson(t,i){let s={};switch(i){case"string":case"identifier":case"integer":case"float":case"duration":case"boolean":case"point":case"directedPair":case"pair":case"uri":case"file":return s[i]=t,s;case"intOrIdentifier":return s[i]=null,s;default:return s[i]=null,s}}recordValueToPciJson(t){let i=[];for(let s of t.values())i.push({name:s.fieldIdentifier,base:s.value===null?null:this.valueToPciJson(s.value,s.baseType,s.cardinality)});return i}processInteractionResponse(t,i){return t.interactionType==="PortableCustom"?this.getValueFromPciJson(t.node.getResponse(),i):t.node.getResponse()}getValueFromPciJson(t,i){if(console.log("[GetValueFromPciJson][Value]",t,i),t===null||typeof i>"u")return this.nullValue();try{if(typeof t!="object")throw new O("Improper value encoding. Must be an Object.");if(Array.isArray(t))throw new O("Improper value encoding. Found Array. Must be an Object.");if(t.base!==void 0){if(i.cardinality==="single")return this.baseValueFromPciJson(t.base,i.baseType);throw new O("Inconsistent value cardinality [base] for this variable. Variable must be single cardinality.")}if(t.list!==void 0){if(i.cardinality==="multiple"||i.cardinality==="ordered")return this.baseValueFromPciJson(t.list,i.baseType);throw new O("Inconsistent value cardinality [list] for this variable. Variable must be multiple or ordered cardinality.")}if(t.record!==void 0){if(i.cardinality==="record")return this.recordValueFromPciJson(t.record,i);throw new O("Inconsistent value cardinality [record] for this variable. Variable must be record cardinality.")}throw new O('Improper value encoding. Must be one of "base", "list", "record".')}catch({name:s,message:n}){return console.log("[PciDecodingException][ValueFromJson] ",n),this.nullValue()}}baseValueFromPciJson(t,i){if(t===null)return this.nullValue();try{if(typeof t!="object")throw new O("Invalid value. Must be an Object.");if(Array.isArray(t))throw new O("Invalid value. Found Array. Must be an Object.");if(t[i]!==void 0)return t[i];throw new O(`Value does not have the required base-type. Expecting ${i}.`)}catch({name:s,message:n}){return console.log("[PciDecodingException][BaseValueFromJson] ",n,t),this.nullValue()}}recordValueFromPciJson(t,i){try{let s=this.getRecordVariableFieldDefinition(i);if(s===null)throw new O(`Unable to retrieve ${i.identifier} record field definition.`);if(typeof t!="object")throw new O("Improper record value encoding. Must be an Array.");if(!Array.isArray(t))throw new O("Improper record value encoding. Must be an Array.");const n=new Map;for(let[r,a]of s)for(let o=0;o<t.length;o++)if(t[o].name!==void 0&&t[o].base!==void 0&&t[o].name===r){const u=this.baseValueFromPciJson(t[o].base,a.getBaseType()),h=new Xe(r,a.getBaseType(),u);n.set(r,h);break}return n}catch({name:s,message:n}){return console.log("[VariableDecodingException][RecordValueFromJson] ",n),new Map}}getRecordVariableFieldDefinition(t){return t==null?null:t.defaultValue!==null?t.defaultValue:t.correctResponse}computeProcessingContext(t){return this.computeProcessingType(t)==="OUTCOME"?"TEST":"ITEM"}computeProcessingType(t){return t===null?"UNKNOWN":t.$options.name==="QtiOutcomeProcessing"?"OUTCOME":t.$options.name==="QtiResponseProcessing"?"RESPONSE":t.$options.name==="QtiTemplateProcessing"?"TEMPLATE":t.$options.name==="QtiBranchRule"?"OUTCOME":this.computeProcessingType(t.$parent)}computeNodeContext(t){return t===null||t.$options.name==="QtiAssessmentItem"?"ITEM":t.$options.name==="QtiAssessmentTest"?"TEST":this.computeNodeContext(t.$parent)}base64ToBytes(t){const i=atob(t);return Uint8Array.from(i,s=>s.codePointAt(0))}bytesToBase64(t){const i=Array.from(t,s=>String.fromCodePoint(s)).join("");return btoa(i)}encodeBytesToBase64(t){const i=new TextEncoder;return this.bytesToBase64(i.encode(t))}decodeBase64ToBytes(t){return new TextDecoder().decode(this.base64ToBytes(t))}}const Kb=new te,I={player:null,state:{item:null,itemBody:null,identifier:"",title:"",responseDeclarations:[],outcomeDeclarations:[],templateDeclarations:[],contextDeclarations:[],stimulusRefs:[],interactions:[],processing:[],feedbacks:[],templates:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[],asyncStateMap:new Map},itemContext:{guid:null,pnp:null,sc:null,state:null,validationMessages:[],lifecycleStatus:null},itemTimer:new Wb,pciContext:{renderer2p0:"assets/pci/pci.html"},pciMessageHandler:null,windowResizeHandler:null,getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getTemplateDeclarations(){return this.state.templateDeclarations},getTemplateMathParameterVariables(){return this.state.templateDeclarations.filter(e=>e.mathVariable===!0)},getTemplateDeclaration(e){return this.state.templateDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getStimulusRefs(){return this.state.stimulusRefs},getStimulusRef(e){return this.state.stimulusRefs.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.templateDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getInteraction(e){return this.state.interactions.find(t=>t.identifier===e)},getInteractions(){return this.state.interactions},getProcessing(e){return this.state.processing.find(t=>t.processingType===e)},getFeedbacks(){return this.state.feedbacks},getTemplates(){return this.state.templates},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},getItem(){return this.state.item},setItem(e){this.state.item=e.item},getItemBody(){return this.state.itemBody},setItemBody(e){this.state.itemBody=e},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTemplateDeclaration(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.templateDeclarations[t]=e:this.state.templateDeclarations.push(e)},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineStimulusRef(e){let t=this.state.stimulusRefs.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.stimulusRefs[t]=e:this.state.stimulusRefs.push(e)},defineInteraction(e){let t=this.state.interactions.findIndex(s=>s.identifier==e.identifier);if(t<0){console.log("[DefineInteraction]["+e.identifier+"]"),this.state.interactions.push(e);return}let i=this.state.interactions[t];i.interactionType=e.interactionType,i.isValidResponse=e.isValidResponse,i.invalidResponseMessage=e.invalidResponseMessage,i.maxSelectionsMessage=e.maxSelectionsMessage,i.node=e.node,i.resetValue=e.resetValue},defineProcessing(e){let t=e.processingType,i=this.state.processing.findIndex(s=>s.processingType==t);i>-1?this.state.processing[i]=e:this.state.processing.push(e),t=="response"?console.log("[QtiResponseProcessing][Defined]",e):t=="template"?console.log("[QtiTemplateProcessing][Defined]",e):t=="outcome"&&console.log("[QtiOutcomeProcessing][Defined]",e)},defineResponseProcessing(e){this.defineProcessing({processingType:"response",node:e.node})},defineTemplateProcessing(e){this.defineProcessing({processingType:"template",node:e.node})},defineItemBody(e){this.setItemBody(e.node)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},defineTemplate(e){this.state.templates.push(e)},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.item=null,this.state.itemBody=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.templateDeclarations.splice(0,this.state.templateDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.stimulusRefs.splice(0,this.state.stimulusRefs.length),this.state.interactions.splice(0,this.state.interactions.length),this.state.processing.splice(0,this.state.processing.length),this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.templates.splice(0,this.state.templates.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.state.asyncStateMap.clear(),this.resetItemTimer(),this.itemContext.guid=null,this.itemContext.state=null,this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length),this.itemContext.lifecycleStatus=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new Xe("candidateIdentifier","string",null)),t.set("testIdentifier",new Xe("testIdentifier","string",null)),t.set("environmentIdentifier",new Xe("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentItem][QTI_CONTEXT] initialized"),this.defineOutcomeDeclaration({identifier:"SCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][SCORE] initialized"),this.defineOutcomeDeclaration({identifier:"MAXSCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][MAXSCORE] initialized"),this.defineOutcomeDeclaration({identifier:"completionStatus",baseType:"identifier",cardinality:"single",value:"not_attempted",defaultValue:"not_attempted",lookupTable:null,lookupTableType:null,normalMaximum:null,normalMinimum:null,externalScored:null,interpretation:null}),console.log("[QtiAssessmentItem][completionStatus] initialized"),this.defineResponseDeclaration({identifier:"numAttempts",baseType:"integer",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][numAttempts] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][duration] initialized")},restoreContextVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"contextVariables"in e&&e.contextVariables!==null&&e.contextVariables.forEach(t=>{let i=this.state.contextDeclarations.findIndex(s=>s.identifier==t.identifier);i<0||(this.state.contextDeclarations[i].value=t.value)},this)},restoreOutcomeVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"outcomeVariables"in e&&e.outcomeVariables!==null&&e.outcomeVariables.forEach(t=>{this.setOutcomeVariableValue({identifier:t.identifier,value:t.value})},this)},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e);return t<0?null:this.state.responseDeclarations[t].correctResponse},setResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.correctResponse=e.value},setInteractionIsValidResponse(e){let t=this.state.interactions.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.interactions[t].isValidResponse=e.isValidResponse)},resetInteractionStateIsValidResponse(){this.state.interactions.forEach(e=>{e.interactionType!=="EndAttemptInteraction"&&(e.isValidResponse=!1)})},restoreResponseVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"responseVariables"in e&&e.responseVariables!==null&&e.responseVariables.forEach(t=>{this.setResponseVariableValue({identifier:t.identifier,value:t.value,state:t.state}),"correctResponse"in t&&this.setResponseVariableCorrectResponse({identifier:t.identifier,value:t.correctResponse})},this)},setResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=e.value,i.state=e.state},resetResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=i.defaultValue!==null?i.defaultValue:null},incrementNumAttempts(){let e=this.state.responseDeclarations.findIndex(t=>t.identifier=="numAttempts");this.state.responseDeclarations[e].value+=1},updateItemDuration(){const e=this.getResponseDeclaration("duration");e.value+=this.itemTimer.getTime(),this.restartItemTimer()},restartItemTimer(){this.itemTimer.startTimer()},resetItemTimer(){this.itemTimer.resetTimer()},setTemplateVariableValue(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.templateDeclarations[t].value=e.value)},resetTemplateVariables(){this.state.templateDeclarations.forEach(e=>{e.node.reset()})},setVariableDefaultValue(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);if(t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}if(t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier),t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}},getPciContext(){return this.pciContext},setPciContext(e){this.pciContext=e},getPciContextRenderer(){return this.pciContext.renderer2p0},setPciContextRenderer(e){this.pciContext.renderer2p0=e},initializePciMessageListener(){this.pciMessageHandler=this.PciMessageListener.bind(this),this.windowResizeHandler=this.WindowResize.bind(this),window.addEventListener("message",this.pciMessageHandler),window.addEventListener("resize",this.windowResizeHandler)},removePciMessageListener(){this.pciMessageHandler!==null&&window.removeEventListener("message",this.pciMessageHandler),this.windowResizeHandler!==null&&window.removeEventListener("resize",this.windowResizeHandler)},PciMessageListener(e){switch(e.data.message){case"PciChildLoaded":console.log("[PCI Parent] PCI Frame Loaded: "+e.data.identifier),this.pciInitialize(e.data.identifier);break;case"PciReady":console.log("[PCI Parent] PCI Ready: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciReady(e.data.identifier),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!0);break;case"PciResize":console.log("[PCI Parent] PCI Resize: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!1);break;case"PciGetState_Reply":console.log("[PCI Parent] PCI GetState Reply: "+e.data.identifier+", state:",e.data.state),this.pciSaveState(e.data.identifier,e.data.state);break}},WindowResize(){this.getInteractions().forEach(e=>{e.interactionType==="PortableCustom"&&e.node.pciResizeIframeWidthToContainer()})},pciInitialize(e){let t=I.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciInitialize()},pciReady(e){let t=I.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciSetReady()},pciResizeIframe(e,t,i,s){let n=I.getInteraction(e);typeof n>"u"||n.interactionType!=="PortableCustom"||(s?n.node.pciResizeIframe(t,n.node.initialWidth):n.node.pciResizeIframe(t,i))},pciSaveState(e,t){let i=I.getInteraction(e);typeof i>"u"||i.interactionType!=="PortableCustom"||i.node.pciSaveState(t)},getAsyncStateMap(){return this.state.asyncStateMap},getItemContextGuid(){return this.itemContext.guid},setItemContextGuid(e){this.itemContext.guid=e},initializeItemContextPnp(){this.itemContext.pnp=new Ds},getItemContextPnp(){return this.itemContext.pnp},setItemContextPnp(e){this.itemContext.pnp===null&&this.initializeItemContextPnp(),this.itemContext.pnp.setPnp(e)},initializeItemContextSessionControl(){this.itemContext.sc=new jb},getItemContextSessionControl(){return this.itemContext.sc},setItemContextSessionControl(e){this.itemContext.sc===null&&this.initializeItemContextSessionControl(),this.itemContext.sc.setSessionControl(e)},getItemContextState(){return this.itemContext.state},setItemContextState(e){const t=new Cc,i=e===null?e:t.createStateFromState(e);this.itemContext.state=i},getItemContextStateVariable(e){if(!this.hasItemContextState())return null;const t=this.getItemContextState();let i=t.outcomeVariables.find(s=>s.identifier===e);return typeof i<"u"||(i=t.responseVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.templateVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.contextDeclarations.find(s=>s.identifier===e),typeof i<"u")?i:null},hasItemContextState(){return this.getItemContextState()!==null},getItemContextValidationMessages(){return this.itemContext.validationMessages},addItemContextValidationMessage(e){this.itemContext.validationMessages.push(e)},resetItemContextValidationMessages(){this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length)},getItemLifecycleStatus(){return this.lifecycleStatus},setItemLifecycleStatus(e){this.lifecycleStatus=e},NotifyPlayerReady(e){this.player=e.player},NotifyEndAttempt(e){this.state.item.endAttempt(e,(function(){this.state.item.notifyEndAttemptInteractionResults("itemEndAttemptReady")}).bind(this))},NotifyNewTemplate(e){this.state.item.newTemplate(e)},NotifyItemReady(e){this.setItem(e),this.getItem().isAdaptive||this.restartItemTimer(),this.getItem().isAdaptiveItemCompleted()||this.restartItemTimer()},NotifyInteractionSelectionsLimit(e){const t={icon:"warning",message:e};this.player.displayAlertMessage(t)},NotifyInteractionStateReady(e){console.log("[InteractionStateReady][Interaction]",e.identifier);const t=this.getInteraction(e.identifier);typeof t>"u"||typeof this.getAsyncStateMap().get(t.identifier)>"u"||(this.setResponseVariableValue({identifier:t.identifier,value:Kb.processInteractionResponse(t,this.getResponseDeclaration(t.identifier)),state:t.node.getState()}),this.getAsyncStateMap().delete(t.identifier),this.getAsyncStateMap().size===0&&this.getItem().triggerGetResponsesComplete())}},Ze={player:null,state:{test:null,identifier:"",title:"",responseDeclarations:[],contextDeclarations:[],outcomeDeclarations:[],timeLimit:null,testParts:[],outcomeProcessing:null,feedbacks:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[]},testContext:{guid:null,pnp:null},sectionItemStates:new Map,getTest(){return this.state.test},setTest(e){this.state.test=e.test},getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getTimeLimit(){return this.timeLimit},getTestParts(){return this.state.testParts},getTestPart(e){return this.state.testParts.find(t=>t.identifier===e)},getOutcomeProcessing(){return this.state.outcomeProcessing},getFeedbacks(){return this.state.feedbacks},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTimeLimit(e){this.state.timeLimit=e.node},defineTestPart(e){let t=this.state.testParts.findIndex(i=>i.identifier==e.identifier);if(t<0){this.state.testParts.push(e.testPart);return}this.state.testParts[t]=e.testPart},defineProcessing(e){this.state.processing=e,console.log("[QtiOutcomeProcessing][Defined]",e)},defineOutcomeProcessing(e){const t={processingType:"outcome",node:e.node};this.state.outcomeProcessing=t,console.log("[QtiOutcomeProcessing][Defined]",t)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.test=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.timeLimit=null,this.state.testParts.splice(0,this.state.testParts.length),this.state.outcomeProcessing=null,this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.testContext.guid=null,this.testContext.state=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new Xe("candidateIdentifier","string",null)),t.set("testIdentifier",new Xe("testIdentifier","string",null)),t.set("environmentIdentifier",new Xe("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentTest][QTI_CONTEXT] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentTest][duration] initialized")},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getTestContextGuid(){return this.testContext.guid},setTestContextGuid(e){this.testContext.guid=e},initializeTestContextPnp(){this.testContext.pnp=new Ds},getTestContextPnp(){return this.testContext.pnp},setTestContextPnp(e){this.testContext.pnp===null&&this.initializeTestContextPnp(),this.testContext.pnp.setPnp(e)},getAllTestStateItemStatesMap(){return this.sectionItemStates},setTestStateItemState(e,t,i,s){console.log("[TestStore][SetState][Part:"+e+"][Section:"+t+"][Item:"+i+"]",s);const n=`${e}~~${t}`;let r=this.getItemStateMapBySectionIdentifier(n);r!=null&&r.set(i,s)},getItemStateMapBySectionIdentifier(e){return this.sectionItemStates.has(e)?this.sectionItemStates.get(e):this.initializePartSectionItemStateMap(e)},getPartSectionMapBySectionIdentifier(e){for(let[t,i]of this.sectionItemStates)if(t.endsWith(e))return i;return null},initializePartSectionItemStateMap(e){return this.sectionItemStates.set(e,new Map),this.sectionItemStates.get(e)},findItemVariableValueByIdentifier(e,t){const i=this.findVariableByIdentifier(e.contextVariables,t);if(typeof i<"u")return i;const s=this.findVariableByIdentifier(e.outcomeVariables,t);if(typeof s<"u")return s;const n=this.findVariableByIdentifier(e.responseVariables,t);if(typeof n<"u")return n;const r=this.findVariableByIdentifier(e.templateVariables,t);return typeof r<"u"?r:null},findVariableByIdentifier(e,t){return e.find(i=>i.identifier===t)},getSerializedState(){return{contextVariables:this.serializeVariables(this.getContextDeclarations()),outcomeVariables:this.serializeVariables(this.getOutcomeDeclarations())}},serializeVariables(e){let t=[];return e.forEach(i=>{t.push({identifier:i.identifier,cardinality:i.cardinality,baseType:i.baseType,value:this.serializeVariableValue(i.cardinality,i.value)})}),t},serializeVariableValue(e,t){return e!=="record"?JSON.parse(JSON.stringify(t)):this.serializeRecordVariableValue(t)},serializeVariableState(e){return JSON.parse(JSON.stringify(e))},serializeRecordVariableValue(e){const t=this.strMapToJson(e);return this.jsonToStrMap(t)},strMapToJson(e){return JSON.stringify(this.strMapToObj(e))},jsonToStrMap(e){return this.objToStrMap(JSON.parse(e))},strMapToObj(e){let t=Object.create(null);for(let[i,s]of e)t[i]=s;return t},objToStrMap(e){let t=new Map;for(let i of Object.keys(e))t.set(i,e[i]);return t},NotifyTestPlayerReady(e){this.player=e.player},NotifyTestReady(e){this.setTest(e)}};class Yb{constructor(){J(this,"xmlDeclaration",null);J(this,"rxTrackSource",null);this.xmlDeclaration=new RegExp(/<\?xml.*?\?>/s),this.rxTrackSource=new RegExp(/<(track|source)[^>]+?\/>/g)}filterXmlDeclaration(t){return t.replace(this.xmlDeclaration,"")}filterCdata(t){return t.replaceAll("<![CDATA[","").replaceAll("]]>","")}filterStyle(t){return t.replaceAll("<style>","<amp-style>").replaceAll("</style>","</amp-style>")}filterMedia(t){return t=t.replaceAll("<video>","<amp-video>").replaceAll("<video ","<amp-video ").replaceAll("</video>","</amp-video>").replaceAll("<audio>","<amp-audio>").replaceAll("<audio ","<amp-audio ").replaceAll("</audio>","</amp-audio>"),this.filterTrackSource(t)}filterTrackSource(t){return t.replace(this.rxTrackSource,i=>i.replace(/\/>/g,">"))}}/*!
1
+ (function(l,Xe){typeof exports=="object"&&typeof module<"u"?module.exports=Xe(require("vue")):typeof define=="function"&&define.amd?define(["vue"],Xe):(l=typeof globalThis<"u"?globalThis:l||self,l.Qti3Player=Xe(l.Vue))})(this,function(l){"use strict";var y4=Object.defineProperty;var w4=(l,Xe,Ds)=>Xe in l?y4(l,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ds}):l[Xe]=Ds;var J=(l,Xe,Ds)=>w4(l,typeof Xe!="symbol"?Xe+"":Xe,Ds);class Xe{constructor(t,i,s){this.fieldIdentifier=t,this.value=s,this.baseType=i,this.cardinality="single"}getValue(){return this.value}setValue(t){this.value=t}getBaseType(){return this.baseType}setBaseType(t){this.baseType=t}getCardinality(){return this.cardinality}getFieldIdentifier(){return this.fieldIdentifier}setFieldIdentifier(t){this.fieldIdentifier=t}}class Ds{constructor(){J(this,"constants",{COLOR_DEFAULT:"qti3-player-color-default",COLOR_DEFAULT_REVERSE:"qti3-player-color-defaultreverse",COLOR_BLACK_WHITE:"qti3-player-color-blackwhite",COLOR_WHITE_BLACK:"qti3-player-color-whiteblack",COLOR_BLACK_ROSE:"qti3-player-color-blackrose",COLOR_ROSE_BLACK:"qti3-player-color-roseblack",COLOR_YELLOW_BLUE:"qti3-player-color-yellowblue",COLOR_BLUE_YELLOW:"qti3-player-color-blueyellow",COLOR_MGRAY_DGRAY:"qti3-player-color-mgraydgray",COLOR_DGRAY_MGRAY:"qti3-player-color-dgraymgray",COLOR_BLACK_CYAN:"qti3-player-color-blackcyan",COLOR_CYAN_BLACK:"qti3-player-color-cyanblack",COLOR_BLACK_CREAM:"qti3-player-color-blackcream",COLOR_CREAM_BLACK:"qti3-player-color-creamblack",GLOSSARY_ON:"glossary-on",GLOSSARY_OFF:"glossary-off",KEYWORD_TRANS_OFF:"ktlang-off",KEYWORD_TRANS_AR:"ktlang-ar",KEYWORD_TRANS_CMN:"ktlang-cmn",KEYWORD_TRANS_DE:"ktlang-de",KEYWORD_TRANS_EN:"ktlang-en",KEYWORD_TRANS_ES:"ktlang-es",KEYWORD_TRANS_FR:"ktlang-fr",KEYWORD_TRANS_HMN:"ktlang-hmn",KEYWORD_TRANS_IT:"ktlang-it",KEYWORD_TRANS_JA:"ktlang-ja",KEYWORD_TRANS_KO:"ktlang-ko",KEYWORD_TRANS_MY:"ktlang-my",KEYWORD_TRANS_NL:"ktlang-nl",KEYWORD_TRANS_PA:"ktlang-pa",KEYWORD_TRANS_RU:"ktlang-ru",KEYWORD_TRANS_SO:"ktlang-so",KEYWORD_TRANS_TL:"ktlang-tl",KEYWORD_TRANS_UK:"ktlang-uk",KEYWORD_TRANS_VI:"ktlang-vi",KEYWORD_TRANS_YUE:"ktlang-yue",KEYWORD_TRANS_ZH:"ktlang-zh",EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:"sbacGlossaryIllustration-on",EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:"sbacGlossaryIllustration-off"});return this.pnp=this.defaultPnp(),this}defaultPnp(){return{textAppearance:{colorStyle:this.constants.COLOR_DEFAULT},glossaryOnScreen:!0,keywordTranslationLanguage:"",extSbacGlossaryIllustration:!1,layoutSingleColumn:!1}}setPnp(t){typeof t>"u"||(t===null&&(this.pnp=this.defaultPnp()),"textAppearance"in t&&t.textAppearance!==null&&"colorStyle"in t.textAppearance&&this.setColorStyle(t.textAppearance.colorStyle),"glossaryOnScreen"in t&&t.glossaryOnScreen!==null&&this.setGlossaryOnScreen(t.glossaryOnScreen),"keywordTranslationLanguage"in t&&this.setKeywordTranslationLanguage(t.keywordTranslationLanguage),"extSbacGlossaryIllustration"in t&&t.extSbacGlossaryIllustration!==null&&this.setExtSbacGlossaryIllustration(t.extSbacGlossaryIllustration),"layoutSingleColumn"in t&&t.layoutSingleColumn!==null&&this.setLayoutSingleColumn(t.layoutSingleColumn))}getPnp(){return this.pnp}getColorStyle(){return this.pnp.textAppearance.colorStyle}setColorStyle(t){this.pnp.textAppearance.colorStyle=t}getGlossaryOnScreen(){return this.pnp.glossaryOnScreen}setGlossaryOnScreen(t){this.pnp.glossaryOnScreen=t}getKeywordTranslationLanguage(){return this.pnp.keywordTranslationLanguage}setKeywordTranslationLanguage(t){this.pnp.keywordTranslationLanguage=t}getExtSbacGlossaryIllustration(){return this.pnp.extSbacGlossaryIllustration}setExtSbacGlossaryIllustration(t){this.pnp.extSbacGlossaryIllustration=t}getLayoutSingleColumn(){return this.pnp.layoutSingleColumn}setLayoutSingleColumn(t){this.pnp.layoutSingleColumn=t}evaluatePnpEvent(t){let i=!1;switch(t){case this.constants.GLOSSARY_ON:this.getGlossaryOnScreen()===!1&&(this.setGlossaryOnScreen(!0),i=!0);break;case this.constants.GLOSSARY_OFF:this.getGlossaryOnScreen()===!0&&(this.setGlossaryOnScreen(!1),i=!0);break;case this.constants.KEYWORD_TRANS_OFF:this.getKeywordTranslationLanguage()!==""&&(this.setKeywordTranslationLanguage(""),i=!0);break;case this.constants.KEYWORD_TRANS_AR:this.getKeywordTranslationLanguage()!=="ar"&&(this.setKeywordTranslationLanguage("ar"),i=!0);break;case this.constants.KEYWORD_TRANS_CMN:this.getKeywordTranslationLanguage()!=="cmn"&&(this.setKeywordTranslationLanguage("cmn"),i=!0);break;case this.constants.KEYWORD_TRANS_DE:this.getKeywordTranslationLanguage()!=="de"&&(this.setKeywordTranslationLanguage("de"),i=!0);break;case this.constants.KEYWORD_TRANS_EN:this.getKeywordTranslationLanguage()!=="en"&&(this.setKeywordTranslationLanguage("en"),i=!0);break;case this.constants.KEYWORD_TRANS_ES:this.getKeywordTranslationLanguage()!=="es"&&(this.setKeywordTranslationLanguage("es"),i=!0);break;case this.constants.KEYWORD_TRANS_FR:this.getKeywordTranslationLanguage()!=="fr"&&(this.setKeywordTranslationLanguage("fr"),i=!0);break;case this.constants.KEYWORD_TRANS_HMN:this.getKeywordTranslationLanguage()!=="hmn"&&(this.setKeywordTranslationLanguage("hmn"),i=!0);break;case this.constants.KEYWORD_TRANS_IT:this.getKeywordTranslationLanguage()!=="it"&&(this.setKeywordTranslationLanguage("it"),i=!0);break;case this.constants.KEYWORD_TRANS_JA:this.getKeywordTranslationLanguage()!=="ja"&&(this.setKeywordTranslationLanguage("ja"),i=!0);break;case this.constants.KEYWORD_TRANS_KO:this.getKeywordTranslationLanguage()!=="ko"&&(this.setKeywordTranslationLanguage("ko"),i=!0);break;case this.constants.KEYWORD_TRANS_MY:this.getKeywordTranslationLanguage()!=="my"&&(this.setKeywordTranslationLanguage("my"),i=!0);break;case this.constants.KEYWORD_TRANS_NL:this.getKeywordTranslationLanguage()!=="nl"&&(this.setKeywordTranslationLanguage("nl"),i=!0);break;case this.constants.KEYWORD_TRANS_PA:this.getKeywordTranslationLanguage()!=="pa"&&(this.setKeywordTranslationLanguage("pa"),i=!0);break;case this.constants.KEYWORD_TRANS_RU:this.getKeywordTranslationLanguage()!=="ru"&&(this.setKeywordTranslationLanguage("ru"),i=!0);break;case this.constants.KEYWORD_TRANS_SO:this.getKeywordTranslationLanguage()!=="so"&&(this.setKeywordTranslationLanguage("so"),i=!0);break;case this.constants.KEYWORD_TRANS_TL:this.getKeywordTranslationLanguage()!=="tl"&&(this.setKeywordTranslationLanguage("tl"),i=!0);break;case this.constants.KEYWORD_TRANS_UK:this.getKeywordTranslationLanguage()!=="uk"&&(this.setKeywordTranslationLanguage("uk"),i=!0);break;case this.constants.KEYWORD_TRANS_VI:this.getKeywordTranslationLanguage()!=="vi"&&(this.setKeywordTranslationLanguage("vi"),i=!0);break;case this.constants.KEYWORD_TRANS_YUE:this.getKeywordTranslationLanguage()!=="yue"&&(this.setKeywordTranslationLanguage("yue"),i=!0);break;case this.constants.KEYWORD_TRANS_ZH:this.getKeywordTranslationLanguage()!=="zh"&&(this.setKeywordTranslationLanguage("zh"),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_ON:this.getExtSbacGlossaryIllustration()===!1&&(this.setExtSbacGlossaryIllustration(!0),i=!0);break;case this.constants.EXT_SBAC_GLOSSARY_ILLUSTRATION_OFF:this.getExtSbacGlossaryIllustration()===!0&&(this.setExtSbacGlossaryIllustration(!1),i=!0);break}return i}}class jb{constructor(){J(this,"constants",{TIME_LIMITS_DEFAULT:{min_time:null,max_time:null,allow_late_submission:!1},ATTEMPTS_UNLIMITED:0});return this.sc=this.defaultSessionControl(),this}defaultSessionControl(){return this.sc={allow_comment:!1,allow_review:!0,allow_skipping:!0,max_attempts:this.constants.ATTEMPTS_UNLIMITED,show_feedback:!1,show_solution:!1,time_limits:this.constants.TIME_LIMITS_DEFAULT,validate_responses:!1},this.sc}setSessionControl(t){if(!(typeof t>"u")){if(t===null)return this.sc=this.defaultSessionControl();"allow_comment"in t&&t.allow_comment!==null&&this.setAllowComment(t.allow_comment),"allow_review"in t&&t.allow_review!==null&&this.setAllowReview(t.allow_review),"allow_skipping"in t&&t.allow_skipping!==null&&this.setAllowSkipping(t.allow_skipping),"max_attempts"in t&&t.max_attempts!==null&&this.setMaxAttempts(t.max_attempts),"show_feedback"in t&&t.show_feedback!==null&&this.setShowFeedback(t.show_feedback),"show_solution"in t&&t.show_solution!==null&&this.setShowSolution(t.show_solution),"time_limits"in t&&t.time_limits!==null&&("min_time"in t.time_limits&&this.setTimeLimitsMinTime(t.time_limits.min_time),"max_time"in t.time_limits&&this.setTimeLimitsMaxTime(t.time_limits.max_time),"allow_late_submission"in t.time_limits&&this.setTimeLimitsAllowLateSubmission(t.time_limits.allow_late_submission)),"validate_responses"in t&&t.validate_responses!==null&&this.setValidateResponses(t.validate_responses)}}getSessionControl(){return{allow_comment:this.getAllowComment(),allow_review:this.getAllowReview(),allow_skipping:this.getAllowSkipping(),max_attempts:this.getMaxAttempts(),show_feedback:this.getShowFeedback(),show_solution:this.getShowSolution(),time_limits:this.getTimeLimits(),validate_responses:this.getValidateResponses()}}getAllowComment(){return this.sc.allow_comment}setAllowComment(t){this.sc.allow_comment=t}getAllowReview(){return this.sc.allow_review}setAllowReview(t){this.sc.allow_review=t}getAllowSkipping(){return this.sc.allow_skipping}setAllowSkipping(t){this.sc.allow_skipping=t}getMaxAttempts(){return this.sc.max_attempts}setMaxAttempts(t){this.sc.max_attempts=t}getShowFeedback(){return this.sc.show_feedback}setShowFeedback(t){this.sc.show_feedback=t}getShowSolution(){return this.sc.show_solution}setShowSolution(t){this.sc.show_solution=t}getTimeLimits(){return this.sc.time_limits}setTimeLimits(t=null,i=null,s=!1){this.setTimeLimitsMinTime(t),this.setTimeLimitsMaxTime(i),this.setTimeLimitsAllowLateSubmission(s)}getTimeLimitsMinTime(){return this.sc.time_limits.min_time}setTimeLimitsMinTime(t){this.sc.time_limits.min_time=t}getTimeLimitsMaxTime(){return this.sc.time_limits.max_time}setTimeLimitsMaxTime(t){this.sc.time_limits.max_time=t}getTimeLimitsAllowLateSubmission(){return this.sc.time_limits.allow_late_submission}setTimeLimitsAllowLateSubmission(t){this.sc.time_limits.allow_late_submission=t}getValidateResponses(){return this.sc.validate_responses}setValidateResponses(t){this.sc.validate_responses=t}}class Cc{constructor(t,i){return typeof t>"u"?this:(this.identifier=t,this.guid=i.getItemContextGuid(),this.contextVariables=i.getContextDeclarations(),this.responseVariables=i.getResponseDeclarations(),this.templateVariables=i.getTemplateDeclarations(),this.outcomeVariables=i.getOutcomeDeclarations(),this.validationMessages=i.getItemContextValidationMessages(),this)}createStateFromState(t){return this.identifier=t.identifier,this.guid=t.guid,this.contextVariables=t.contextVariables,this.responseVariables=t.responseVariables,this.templateVariables=t.templateVariables,this.outcomeVariables=t.outcomeVariables,this.validationMessages=t.validationMessages,this.getSerializedState()}getSerializedState(){return{identifier:this.identifier,guid:this.guid,contextVariables:this.serializeVariables(this.contextVariables),responseVariables:this.serializeResponseVariables(this.responseVariables),outcomeVariables:this.serializeOutcomeVariables(this.outcomeVariables),templateVariables:this.serializeVariables(this.templateVariables),validationMessages:this.serializeValidationMessages(this.validationMessages)}}serializeResponseVariables(t){let i=[];return t.forEach(s=>{let n={identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),state:this.serializeVariableState(s.state)};"correctResponse"in s&&(n.correctResponse=this.serializeVariableValue(s.cardinality,s.correctResponse)),i.push(n)}),i}serializeOutcomeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value),view:s.view,interpretation:s.interpretation,longInterpretation:s.longInterpretation,normalMaximum:s.normalMaximum,normalMinimum:s.normalMinimum,masteryValue:s.masteryValue,externalScored:s.externalScored,variableIdentifierRef:s.variableIdentifierRef})}),i}serializeVariables(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,cardinality:s.cardinality,baseType:this.resolveBaseType(s.baseType),value:this.serializeVariableValue(s.cardinality,s.value)})}),i}serializeValidationMessages(t){let i=[];return t.forEach(s=>{i.push({identifier:s.identifier,message:s.message})}),i}serializeVariableValue(t,i){return t!=="record"?JSON.parse(JSON.stringify(i)):this.serializeRecordVariableValue(i)}serializeVariableState(t){return JSON.parse(JSON.stringify(t))}resolveBaseType(t){return typeof t>"u"?null:t}serializeRecordVariableValue(t){const i=this.strMapToJson(t);return this.jsonToStrMap(i)}strMapToJson(t){return JSON.stringify(this.strMapToObj(t))}jsonToStrMap(t){return this.objToStrMap(JSON.parse(t))}strMapToObj(t){let i=Object.create(null);for(let[s,n]of t)i[s]=typeof n=="object"&&n!==null?n.getValue():n;return i}objToStrMap(t){let i=new Map;for(let s of Object.keys(t))i.set(s,t[s]);return i}}class Wb{constructor(){J(this,"itemTimer");J(this,"itemDuration");this.setTime(0)}getTime(){return this.itemDuration}setTime(t){this.itemDuration=t}startTimer(){this.clearTimer(),this.setTime(0),this.itemTimer=setInterval(this.updateTime.bind(this),1e3)}updateTime(){++this.itemDuration}resetTimer(){this.clearTimer(),this.setTime(0)}clearTimer(){clearInterval(this.itemTimer)}}var zb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Tc=Math.ceil,Yt=Math.floor,Ct="[BigNumber Error] ",yf=Ct+"Number primitive has more than 15 significant digits: ",fi=1e14,ye=14,wf=9007199254740991,Sc=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ws=1e7,Ot=1e9;function bf(e){var t,i,s,n=x.prototype={constructor:x,toString:null,valueOf:null},r=new x(1),a=20,o=4,u=-7,h=21,f=-1e7,m=1e7,y=!1,w=1,b=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function x(p,v){var C,N,V,L,q,A,M,k,R=this;if(!(R instanceof x))return new x(p,v);if(v==null){if(p&&p._isBigNumber===!0){R.s=p.s,!p.c||p.e>m?R.c=R.e=null:p.e<f?R.c=[R.e=0]:(R.e=p.e,R.c=p.c.slice());return}if((A=typeof p=="number")&&p*0==0){if(R.s=1/p<0?(p=-p,-1):1,p===~~p){for(L=0,q=p;q>=10;q/=10,L++);L>m?R.c=R.e=null:(R.e=L,R.c=[p]);return}k=String(p)}else{if(!zb.test(k=String(p)))return s(R,k,A);R.s=k.charCodeAt(0)==45?(k=k.slice(1),-1):1}(L=k.indexOf("."))>-1&&(k=k.replace(".","")),(q=k.search(/e/i))>0?(L<0&&(L=q),L+=+k.slice(q+1),k=k.substring(0,q)):L<0&&(L=k.length)}else{if(De(v,2,T.length,"Base"),v==10&&$)return R=new x(p),Q(R,a+R.e+1,o);if(k=String(p),A=typeof p=="number"){if(p*0!=0)return s(R,k,A,v);if(R.s=1/p<0?(k=k.slice(1),-1):1,x.DEBUG&&k.replace(/^0\.0*|\./,"").length>15)throw Error(yf+p)}else R.s=k.charCodeAt(0)===45?(k=k.slice(1),-1):1;for(C=T.slice(0,v),L=q=0,M=k.length;q<M;q++)if(C.indexOf(N=k.charAt(q))<0){if(N=="."){if(q>L){L=M;continue}}else if(!V&&(k==k.toUpperCase()&&(k=k.toLowerCase())||k==k.toLowerCase()&&(k=k.toUpperCase()))){V=!0,q=-1,L=0;continue}return s(R,String(p),A,v)}A=!1,k=i(k,v,10,R.s),(L=k.indexOf("."))>-1?k=k.replace(".",""):L=k.length}for(q=0;k.charCodeAt(q)===48;q++);for(M=k.length;k.charCodeAt(--M)===48;);if(k=k.slice(q,++M)){if(M-=q,A&&x.DEBUG&&M>15&&(p>wf||p!==Yt(p)))throw Error(yf+R.s*p);if((L=L-q-1)>m)R.c=R.e=null;else if(L<f)R.c=[R.e=0];else{if(R.e=L,R.c=[],q=(L+1)%ye,L<0&&(q+=ye),q<M){for(q&&R.c.push(+k.slice(0,q)),M-=ye;q<M;)R.c.push(+k.slice(q,q+=ye));q=ye-(k=k.slice(q)).length}else q-=M;for(;q--;k+="0");R.c.push(+k)}}else R.c=[R.e=0]}x.clone=bf,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(p){var v,C;if(p!=null)if(typeof p=="object"){if(p.hasOwnProperty(v="DECIMAL_PLACES")&&(C=p[v],De(C,0,Ot,v),a=C),p.hasOwnProperty(v="ROUNDING_MODE")&&(C=p[v],De(C,0,8,v),o=C),p.hasOwnProperty(v="EXPONENTIAL_AT")&&(C=p[v],C&&C.pop?(De(C[0],-1e9,0,v),De(C[1],0,Ot,v),u=C[0],h=C[1]):(De(C,-1e9,Ot,v),u=-(h=C<0?-C:C))),p.hasOwnProperty(v="RANGE"))if(C=p[v],C&&C.pop)De(C[0],-1e9,-1,v),De(C[1],1,Ot,v),f=C[0],m=C[1];else if(De(C,-1e9,Ot,v),C)f=-(m=C<0?-C:C);else throw Error(Ct+v+" cannot be zero: "+C);if(p.hasOwnProperty(v="CRYPTO"))if(C=p[v],C===!!C)if(C)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))y=C;else throw y=!C,Error(Ct+"crypto unavailable");else y=C;else throw Error(Ct+v+" not true or false: "+C);if(p.hasOwnProperty(v="MODULO_MODE")&&(C=p[v],De(C,0,9,v),w=C),p.hasOwnProperty(v="POW_PRECISION")&&(C=p[v],De(C,0,Ot,v),b=C),p.hasOwnProperty(v="FORMAT"))if(C=p[v],typeof C=="object")S=C;else throw Error(Ct+v+" not an object: "+C);if(p.hasOwnProperty(v="ALPHABET"))if(C=p[v],typeof C=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(C))$=C.slice(0,10)=="0123456789",T=C;else throw Error(Ct+v+" invalid: "+C)}else throw Error(Ct+"Object expected: "+p);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[u,h],RANGE:[f,m],CRYPTO:y,MODULO_MODE:w,POW_PRECISION:b,FORMAT:S,ALPHABET:T}},x.isBigNumber=function(p){if(!p||p._isBigNumber!==!0)return!1;if(!x.DEBUG)return!0;var v,C,N=p.c,V=p.e,L=p.s;e:if({}.toString.call(N)=="[object Array]"){if((L===1||L===-1)&&V>=-1e9&&V<=Ot&&V===Yt(V)){if(N[0]===0){if(V===0&&N.length===1)return!0;break e}if(v=(V+1)%ye,v<1&&(v+=ye),String(N[0]).length==v){for(v=0;v<N.length;v++)if(C=N[v],C<0||C>=fi||C!==Yt(C))break e;if(C!==0)return!0}}}else if(N===null&&V===null&&(L===null||L===1||L===-1))return!0;throw Error(Ct+"Invalid BigNumber: "+p)},x.maximum=x.max=function(){return E(arguments,-1)},x.minimum=x.min=function(){return E(arguments,1)},x.random=function(){var p=9007199254740992,v=Math.random()*p&2097151?function(){return Yt(Math.random()*p)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var N,V,L,q,A,M=0,k=[],R=new x(r);if(C==null?C=a:De(C,0,Ot),q=Tc(C/ye),y)if(crypto.getRandomValues){for(N=crypto.getRandomValues(new Uint32Array(q*=2));M<q;)A=N[M]*131072+(N[M+1]>>>11),A>=9e15?(V=crypto.getRandomValues(new Uint32Array(2)),N[M]=V[0],N[M+1]=V[1]):(k.push(A%1e14),M+=2);M=q/2}else if(crypto.randomBytes){for(N=crypto.randomBytes(q*=7);M<q;)A=(N[M]&31)*281474976710656+N[M+1]*1099511627776+N[M+2]*4294967296+N[M+3]*16777216+(N[M+4]<<16)+(N[M+5]<<8)+N[M+6],A>=9e15?crypto.randomBytes(7).copy(N,M):(k.push(A%1e14),M+=7);M=q/7}else throw y=!1,Error(Ct+"crypto unavailable");if(!y)for(;M<q;)A=v(),A<9e15&&(k[M++]=A%1e14);for(q=k[--M],C%=ye,q&&C&&(A=Sc[ye-C],k[M]=Yt(q/A)*A);k[M]===0;k.pop(),M--);if(M<0)k=[L=0];else{for(L=-1;k[0]===0;k.splice(0,1),L-=ye);for(M=1,A=k[0];A>=10;A/=10,M++);M<ye&&(L-=ye-M)}return R.e=L,R.c=k,R}}(),x.sum=function(){for(var p=1,v=arguments,C=new x(v[0]);p<v.length;)C=C.plus(v[p++]);return C},i=function(){var p="0123456789";function v(C,N,V,L){for(var q,A=[0],M,k=0,R=C.length;k<R;){for(M=A.length;M--;A[M]*=N);for(A[0]+=L.indexOf(C.charAt(k++)),q=0;q<A.length;q++)A[q]>V-1&&(A[q+1]==null&&(A[q+1]=0),A[q+1]+=A[q]/V|0,A[q]%=V)}return A.reverse()}return function(C,N,V,L,q){var A,M,k,R,Y,Z,ne,de,ge=C.indexOf("."),Ee=a,D=o;for(ge>=0&&(R=b,b=0,C=C.replace(".",""),de=new x(N),Z=de.pow(C.length-ge),b=R,de.c=v(Ji(Zt(Z.c),Z.e,"0"),10,V,p),de.e=de.c.length),ne=v(C,N,V,q?(A=T,p):(A=p,T)),k=R=ne.length;ne[--R]==0;ne.pop());if(!ne[0])return A.charAt(0);if(ge<0?--k:(Z.c=ne,Z.e=k,Z.s=L,Z=t(Z,de,Ee,D,V),ne=Z.c,Y=Z.r,k=Z.e),M=k+Ee+1,ge=ne[M],R=V/2,Y=Y||M<0||ne[M+1]!=null,Y=D<4?(ge!=null||Y)&&(D==0||D==(Z.s<0?3:2)):ge>R||ge==R&&(D==4||Y||D==6&&ne[M-1]&1||D==(Z.s<0?8:7)),M<1||!ne[0])C=Y?Ji(A.charAt(1),-Ee,A.charAt(0)):A.charAt(0);else{if(ne.length=M,Y)for(--V;++ne[--M]>V;)ne[M]=0,M||(++k,ne=[1].concat(ne));for(R=ne.length;!ne[--R];);for(ge=0,C="";ge<=R;C+=A.charAt(ne[ge++]));C=Ji(C,k,A.charAt(0))}return C}}(),t=function(){function p(N,V,L){var q,A,M,k,R=0,Y=N.length,Z=V%ws,ne=V/ws|0;for(N=N.slice();Y--;)M=N[Y]%ws,k=N[Y]/ws|0,q=ne*M+k*Z,A=Z*M+q%ws*ws+R,R=(A/L|0)+(q/ws|0)+ne*k,N[Y]=A%L;return R&&(N=[R].concat(N)),N}function v(N,V,L,q){var A,M;if(L!=q)M=L>q?1:-1;else for(A=M=0;A<L;A++)if(N[A]!=V[A]){M=N[A]>V[A]?1:-1;break}return M}function C(N,V,L,q){for(var A=0;L--;)N[L]-=A,A=N[L]<V[L]?1:0,N[L]=A*q+N[L]-V[L];for(;!N[0]&&N.length>1;N.splice(0,1));}return function(N,V,L,q,A){var M,k,R,Y,Z,ne,de,ge,Ee,D,z,Me,qe,vt,rt,He,dt,Fe=N.s==V.s?1:-1,Oe=N.c,Ie=V.c;if(!Oe||!Oe[0]||!Ie||!Ie[0])return new x(!N.s||!V.s||(Oe?Ie&&Oe[0]==Ie[0]:!Ie)?NaN:Oe&&Oe[0]==0||!Ie?Fe*0:Fe/0);for(ge=new x(Fe),Ee=ge.c=[],k=N.e-V.e,Fe=L+k+1,A||(A=fi,k=Xt(N.e/ye)-Xt(V.e/ye),Fe=Fe/ye|0),R=0;Ie[R]==(Oe[R]||0);R++);if(Ie[R]>(Oe[R]||0)&&k--,Fe<0)Ee.push(1),Y=!0;else{for(vt=Oe.length,He=Ie.length,R=0,Fe+=2,Z=Yt(A/(Ie[0]+1)),Z>1&&(Ie=p(Ie,Z,A),Oe=p(Oe,Z,A),He=Ie.length,vt=Oe.length),qe=He,D=Oe.slice(0,He),z=D.length;z<He;D[z++]=0);dt=Ie.slice(),dt=[0].concat(dt),rt=Ie[0],Ie[1]>=A/2&&rt++;do{if(Z=0,M=v(Ie,D,He,z),M<0){if(Me=D[0],He!=z&&(Me=Me*A+(D[1]||0)),Z=Yt(Me/rt),Z>1)for(Z>=A&&(Z=A-1),ne=p(Ie,Z,A),de=ne.length,z=D.length;v(ne,D,de,z)==1;)Z--,C(ne,He<de?dt:Ie,de,A),de=ne.length,M=1;else Z==0&&(M=Z=1),ne=Ie.slice(),de=ne.length;if(de<z&&(ne=[0].concat(ne)),C(D,ne,z,A),z=D.length,M==-1)for(;v(Ie,D,He,z)<1;)Z++,C(D,He<z?dt:Ie,z,A),z=D.length}else M===0&&(Z++,D=[0]);Ee[R++]=Z,D[0]?D[z++]=Oe[qe]||0:(D=[Oe[qe]],z=1)}while((qe++<vt||D[0]!=null)&&Fe--);Y=D[0]!=null,Ee[0]||Ee.splice(0,1)}if(A==fi){for(R=1,Fe=Ee[0];Fe>=10;Fe/=10,R++);Q(ge,L+(ge.e=R+k*ye-1)+1,q,Y)}else ge.e=k,ge.r=+Y;return ge}}();function B(p,v,C,N){var V,L,q,A,M;if(C==null?C=o:De(C,0,8),!p.c)return p.toString();if(V=p.c[0],q=p.e,v==null)M=Zt(p.c),M=N==1||N==2&&(q<=u||q>=h)?Eo(M,q):Ji(M,q,"0");else if(p=Q(new x(p),v,C),L=p.e,M=Zt(p.c),A=M.length,N==1||N==2&&(v<=L||L<=u)){for(;A<v;M+="0",A++);M=Eo(M,L)}else if(v-=q,M=Ji(M,L,"0"),L+1>A){if(--v>0)for(M+=".";v--;M+="0");}else if(v+=L-A,v>0)for(L+1==A&&(M+=".");v--;M+="0");return p.s<0&&V?"-"+M:M}function E(p,v){for(var C,N,V=1,L=new x(p[0]);V<p.length;V++)N=new x(p[V]),(!N.s||(C=Qs(L,N))===v||C===0&&L.s===v)&&(L=N);return L}function G(p,v,C){for(var N=1,V=v.length;!v[--V];v.pop());for(V=v[0];V>=10;V/=10,N++);return(C=N+C*ye-1)>m?p.c=p.e=null:C<f?p.c=[p.e=0]:(p.e=C,p.c=v),p}s=function(){var p=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,C=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,V=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(L,q,A,M){var k,R=A?q:q.replace(V,"");if(N.test(R))L.s=isNaN(R)?null:R<0?-1:1;else{if(!A&&(R=R.replace(p,function(Y,Z,ne){return k=(ne=ne.toLowerCase())=="x"?16:ne=="b"?2:8,!M||M==k?Z:Y}),M&&(k=M,R=R.replace(v,"$1").replace(C,"0.$1")),q!=R))return new x(R,k);if(x.DEBUG)throw Error(Ct+"Not a"+(M?" base "+M:"")+" number: "+q);L.s=null}L.c=L.e=null}}();function Q(p,v,C,N){var V,L,q,A,M,k,R,Y=p.c,Z=Sc;if(Y){e:{for(V=1,A=Y[0];A>=10;A/=10,V++);if(L=v-V,L<0)L+=ye,q=v,M=Y[k=0],R=Yt(M/Z[V-q-1]%10);else if(k=Tc((L+1)/ye),k>=Y.length)if(N){for(;Y.length<=k;Y.push(0));M=R=0,V=1,L%=ye,q=L-ye+1}else break e;else{for(M=A=Y[k],V=1;A>=10;A/=10,V++);L%=ye,q=L-ye+V,R=q<0?0:Yt(M/Z[V-q-1]%10)}if(N=N||v<0||Y[k+1]!=null||(q<0?M:M%Z[V-q-1]),N=C<4?(R||N)&&(C==0||C==(p.s<0?3:2)):R>5||R==5&&(C==4||N||C==6&&(L>0?q>0?M/Z[V-q]:0:Y[k-1])%10&1||C==(p.s<0?8:7)),v<1||!Y[0])return Y.length=0,N?(v-=p.e+1,Y[0]=Z[(ye-v%ye)%ye],p.e=-v||0):Y[0]=p.e=0,p;if(L==0?(Y.length=k,A=1,k--):(Y.length=k+1,A=Z[ye-L],Y[k]=q>0?Yt(M/Z[V-q]%Z[q])*A:0),N)for(;;)if(k==0){for(L=1,q=Y[0];q>=10;q/=10,L++);for(q=Y[0]+=A,A=1;q>=10;q/=10,A++);L!=A&&(p.e++,Y[0]==fi&&(Y[0]=1));break}else{if(Y[k]+=A,Y[k]!=fi)break;Y[k--]=0,A=1}for(L=Y.length;Y[--L]===0;Y.pop());}p.e>m?p.c=p.e=null:p.e<f&&(p.c=[p.e=0])}return p}function ee(p){var v,C=p.e;return C===null?p.toString():(v=Zt(p.c),v=C<=u||C>=h?Eo(v,C):Ji(v,C,"0"),p.s<0?"-"+v:v)}return n.absoluteValue=n.abs=function(){var p=new x(this);return p.s<0&&(p.s=1),p},n.comparedTo=function(p,v){return Qs(this,new x(p,v))},n.decimalPlaces=n.dp=function(p,v){var C,N,V,L=this;if(p!=null)return De(p,0,Ot),v==null?v=o:De(v,0,8),Q(new x(L),p+L.e+1,v);if(!(C=L.c))return null;if(N=((V=C.length-1)-Xt(this.e/ye))*ye,V=C[V])for(;V%10==0;V/=10,N--);return N<0&&(N=0),N},n.dividedBy=n.div=function(p,v){return t(this,new x(p,v),a,o)},n.dividedToIntegerBy=n.idiv=function(p,v){return t(this,new x(p,v),0,1)},n.exponentiatedBy=n.pow=function(p,v){var C,N,V,L,q,A,M,k,R,Y=this;if(p=new x(p),p.c&&!p.isInteger())throw Error(Ct+"Exponent not an integer: "+ee(p));if(v!=null&&(v=new x(v)),A=p.e>14,!Y.c||!Y.c[0]||Y.c[0]==1&&!Y.e&&Y.c.length==1||!p.c||!p.c[0])return R=new x(Math.pow(+ee(Y),A?p.s*(2-vo(p)):+ee(p))),v?R.mod(v):R;if(M=p.s<0,v){if(v.c?!v.c[0]:!v.s)return new x(NaN);N=!M&&Y.isInteger()&&v.isInteger(),N&&(Y=Y.mod(v))}else{if(p.e>9&&(Y.e>0||Y.e<-1||(Y.e==0?Y.c[0]>1||A&&Y.c[1]>=24e7:Y.c[0]<8e13||A&&Y.c[0]<=9999975e7)))return L=Y.s<0&&vo(p)?-0:0,Y.e>-1&&(L=1/L),new x(M?1/L:L);b&&(L=Tc(b/ye+2))}for(A?(C=new x(.5),M&&(p.s=1),k=vo(p)):(V=Math.abs(+ee(p)),k=V%2),R=new x(r);;){if(k){if(R=R.times(Y),!R.c)break;L?R.c.length>L&&(R.c.length=L):N&&(R=R.mod(v))}if(V){if(V=Yt(V/2),V===0)break;k=V%2}else if(p=p.times(C),Q(p,p.e+1,1),p.e>14)k=vo(p);else{if(V=+ee(p),V===0)break;k=V%2}Y=Y.times(Y),L?Y.c&&Y.c.length>L&&(Y.c.length=L):N&&(Y=Y.mod(v))}return N?R:(M&&(R=r.div(R)),v?R.mod(v):L?Q(R,b,o,q):R)},n.integerValue=function(p){var v=new x(this);return p==null?p=o:De(p,0,8),Q(v,v.e+1,p)},n.isEqualTo=n.eq=function(p,v){return Qs(this,new x(p,v))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(p,v){return Qs(this,new x(p,v))>0},n.isGreaterThanOrEqualTo=n.gte=function(p,v){return(v=Qs(this,new x(p,v)))===1||v===0},n.isInteger=function(){return!!this.c&&Xt(this.e/ye)>this.c.length-2},n.isLessThan=n.lt=function(p,v){return Qs(this,new x(p,v))<0},n.isLessThanOrEqualTo=n.lte=function(p,v){return(v=Qs(this,new x(p,v)))===-1||v===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(p,v){var C,N,V,L,q=this,A=q.s;if(p=new x(p,v),v=p.s,!A||!v)return new x(NaN);if(A!=v)return p.s=-v,q.plus(p);var M=q.e/ye,k=p.e/ye,R=q.c,Y=p.c;if(!M||!k){if(!R||!Y)return R?(p.s=-v,p):new x(Y?q:NaN);if(!R[0]||!Y[0])return Y[0]?(p.s=-v,p):new x(R[0]?q:o==3?-0:0)}if(M=Xt(M),k=Xt(k),R=R.slice(),A=M-k){for((L=A<0)?(A=-A,V=R):(k=M,V=Y),V.reverse(),v=A;v--;V.push(0));V.reverse()}else for(N=(L=(A=R.length)<(v=Y.length))?A:v,A=v=0;v<N;v++)if(R[v]!=Y[v]){L=R[v]<Y[v];break}if(L&&(V=R,R=Y,Y=V,p.s=-p.s),v=(N=Y.length)-(C=R.length),v>0)for(;v--;R[C++]=0);for(v=fi-1;N>A;){if(R[--N]<Y[N]){for(C=N;C&&!R[--C];R[C]=v);--R[C],R[N]+=fi}R[N]-=Y[N]}for(;R[0]==0;R.splice(0,1),--k);return R[0]?G(p,R,k):(p.s=o==3?-1:1,p.c=[p.e=0],p)},n.modulo=n.mod=function(p,v){var C,N,V=this;return p=new x(p,v),!V.c||!p.s||p.c&&!p.c[0]?new x(NaN):!p.c||V.c&&!V.c[0]?new x(V):(w==9?(N=p.s,p.s=1,C=t(V,p,0,3),p.s=N,C.s*=N):C=t(V,p,0,w),p=V.minus(C.times(p)),!p.c[0]&&w==1&&(p.s=V.s),p)},n.multipliedBy=n.times=function(p,v){var C,N,V,L,q,A,M,k,R,Y,Z,ne,de,ge,Ee,D=this,z=D.c,Me=(p=new x(p,v)).c;if(!z||!Me||!z[0]||!Me[0])return!D.s||!p.s||z&&!z[0]&&!Me||Me&&!Me[0]&&!z?p.c=p.e=p.s=null:(p.s*=D.s,!z||!Me?p.c=p.e=null:(p.c=[0],p.e=0)),p;for(N=Xt(D.e/ye)+Xt(p.e/ye),p.s*=D.s,M=z.length,Y=Me.length,M<Y&&(de=z,z=Me,Me=de,V=M,M=Y,Y=V),V=M+Y,de=[];V--;de.push(0));for(ge=fi,Ee=ws,V=Y;--V>=0;){for(C=0,Z=Me[V]%Ee,ne=Me[V]/Ee|0,q=M,L=V+q;L>V;)k=z[--q]%Ee,R=z[q]/Ee|0,A=ne*k+R*Z,k=Z*k+A%Ee*Ee+de[L]+C,C=(k/ge|0)+(A/Ee|0)+ne*R,de[L--]=k%ge;de[L]=C}return C?++N:de.splice(0,1),G(p,de,N)},n.negated=function(){var p=new x(this);return p.s=-p.s||null,p},n.plus=function(p,v){var C,N=this,V=N.s;if(p=new x(p,v),v=p.s,!V||!v)return new x(NaN);if(V!=v)return p.s=-v,N.minus(p);var L=N.e/ye,q=p.e/ye,A=N.c,M=p.c;if(!L||!q){if(!A||!M)return new x(V/0);if(!A[0]||!M[0])return M[0]?p:new x(A[0]?N:V*0)}if(L=Xt(L),q=Xt(q),A=A.slice(),V=L-q){for(V>0?(q=L,C=M):(V=-V,C=A),C.reverse();V--;C.push(0));C.reverse()}for(V=A.length,v=M.length,V-v<0&&(C=M,M=A,A=C,v=V),V=0;v;)V=(A[--v]=A[v]+M[v]+V)/fi|0,A[v]=fi===A[v]?0:A[v]%fi;return V&&(A=[V].concat(A),++q),G(p,A,q)},n.precision=n.sd=function(p,v){var C,N,V,L=this;if(p!=null&&p!==!!p)return De(p,1,Ot),v==null?v=o:De(v,0,8),Q(new x(L),p,v);if(!(C=L.c))return null;if(V=C.length-1,N=V*ye+1,V=C[V]){for(;V%10==0;V/=10,N--);for(V=C[0];V>=10;V/=10,N++);}return p&&L.e+1>N&&(N=L.e+1),N},n.shiftedBy=function(p){return De(p,-9007199254740991,wf),this.times("1e"+p)},n.squareRoot=n.sqrt=function(){var p,v,C,N,V,L=this,q=L.c,A=L.s,M=L.e,k=a+4,R=new x("0.5");if(A!==1||!q||!q[0])return new x(!A||A<0&&(!q||q[0])?NaN:q?L:1/0);if(A=Math.sqrt(+ee(L)),A==0||A==1/0?(v=Zt(q),(v.length+M)%2==0&&(v+="0"),A=Math.sqrt(+v),M=Xt((M+1)/2)-(M<0||M%2),A==1/0?v="5e"+M:(v=A.toExponential(),v=v.slice(0,v.indexOf("e")+1)+M),C=new x(v)):C=new x(A+""),C.c[0]){for(M=C.e,A=M+k,A<3&&(A=0);;)if(V=C,C=R.times(V.plus(t(L,V,k,1))),Zt(V.c).slice(0,A)===(v=Zt(C.c)).slice(0,A))if(C.e<M&&--A,v=v.slice(A-3,A+1),v=="9999"||!N&&v=="4999"){if(!N&&(Q(V,V.e+a+2,0),V.times(V).eq(L))){C=V;break}k+=4,A+=4,N=1}else{(!+v||!+v.slice(1)&&v.charAt(0)=="5")&&(Q(C,C.e+a+2,1),p=!C.times(C).eq(L));break}}return Q(C,C.e+a+1,o,p)},n.toExponential=function(p,v){return p!=null&&(De(p,0,Ot),p++),B(this,p,v,1)},n.toFixed=function(p,v){return p!=null&&(De(p,0,Ot),p=p+this.e+1),B(this,p,v)},n.toFormat=function(p,v,C){var N,V=this;if(C==null)p!=null&&v&&typeof v=="object"?(C=v,v=null):p&&typeof p=="object"?(C=p,p=v=null):C=S;else if(typeof C!="object")throw Error(Ct+"Argument not an object: "+C);if(N=V.toFixed(p,v),V.c){var L,q=N.split("."),A=+C.groupSize,M=+C.secondaryGroupSize,k=C.groupSeparator||"",R=q[0],Y=q[1],Z=V.s<0,ne=Z?R.slice(1):R,de=ne.length;if(M&&(L=A,A=M,M=L,de-=L),A>0&&de>0){for(L=de%A||A,R=ne.substr(0,L);L<de;L+=A)R+=k+ne.substr(L,A);M>0&&(R+=k+ne.slice(L)),Z&&(R="-"+R)}N=Y?R+(C.decimalSeparator||"")+((M=+C.fractionGroupSize)?Y.replace(new RegExp("\\d{"+M+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):Y):R}return(C.prefix||"")+N+(C.suffix||"")},n.toFraction=function(p){var v,C,N,V,L,q,A,M,k,R,Y,Z,ne=this,de=ne.c;if(p!=null&&(A=new x(p),!A.isInteger()&&(A.c||A.s!==1)||A.lt(r)))throw Error(Ct+"Argument "+(A.isInteger()?"out of range: ":"not an integer: ")+ee(A));if(!de)return new x(ne);for(v=new x(r),k=C=new x(r),N=M=new x(r),Z=Zt(de),L=v.e=Z.length-ne.e-1,v.c[0]=Sc[(q=L%ye)<0?ye+q:q],p=!p||A.comparedTo(v)>0?L>0?v:k:A,q=m,m=1/0,A=new x(Z),M.c[0]=0;R=t(A,v,0,1),V=C.plus(R.times(N)),V.comparedTo(p)!=1;)C=N,N=V,k=M.plus(R.times(V=k)),M=V,v=A.minus(R.times(V=v)),A=V;return V=t(p.minus(C),N,0,1),M=M.plus(V.times(k)),C=C.plus(V.times(N)),M.s=k.s=ne.s,L=L*2,Y=t(k,N,L,o).minus(ne).abs().comparedTo(t(M,C,L,o).minus(ne).abs())<1?[k,N]:[M,C],m=q,Y},n.toNumber=function(){return+ee(this)},n.toPrecision=function(p,v){return p!=null&&De(p,1,Ot),B(this,p,v,2)},n.toString=function(p){var v,C=this,N=C.s,V=C.e;return V===null?N?(v="Infinity",N<0&&(v="-"+v)):v="NaN":(p==null?v=V<=u||V>=h?Eo(Zt(C.c),V):Ji(Zt(C.c),V,"0"):p===10&&$?(C=Q(new x(C),a+V+1,o),v=Ji(Zt(C.c),C.e,"0")):(De(p,2,T.length,"Base"),v=i(Ji(Zt(C.c),V,"0"),10,p,N,!0)),N<0&&C.c[0]&&(v="-"+v)),v},n.valueOf=n.toJSON=function(){return ee(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,e!=null&&x.set(e),x}function Xt(e){var t=e|0;return e>0||e===t?t:t-1}function Zt(e){for(var t,i,s=1,n=e.length,r=e[0]+"";s<n;){for(t=e[s++]+"",i=ye-t.length;i--;t="0"+t);r+=t}for(n=r.length;r.charCodeAt(--n)===48;);return r.slice(0,n+1||1)}function Qs(e,t){var i,s,n=e.c,r=t.c,a=e.s,o=t.s,u=e.e,h=t.e;if(!a||!o)return null;if(i=n&&!n[0],s=r&&!r[0],i||s)return i?s?0:-o:a;if(a!=o)return a;if(i=a<0,s=u==h,!n||!r)return s?0:!n^i?1:-1;if(!s)return u>h^i?1:-1;for(o=(u=n.length)<(h=r.length)?u:h,a=0;a<o;a++)if(n[a]!=r[a])return n[a]>r[a]^i?1:-1;return u==h?0:u>h^i?1:-1}function De(e,t,i,s){if(e<t||e>i||e!==Yt(e))throw Error(Ct+(s||"Argument")+(typeof e=="number"?e<t||e>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function vo(e){var t=e.c.length-1;return Xt(e.e/ye)==t&&e.c[t]%2!=0}function Eo(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Ji(e,t,i){var s,n;if(t<0){for(n=i+".";++t;n+=i);e=n+e}else if(s=e.length,++t>s){for(n=i,t-=s;--t;n+=i);e+=n}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var j=bf();class O extends Error{constructor(t){super(t),this.name="QtiEvaluationException"}}class te{QTI_RESPONSE_RULES(){return["qti-response-processing-fragment","qti-response-condition","qti-set-outcome-value","qti-lookup-outcome-value","qti-get-outcome-value","qti-exit-response"]}QTI_TEMPLATE_RULES(){return["qti-set-template-value","qti-exit-template","qti-template-condition","qti-set-default-value","qti-set-correct-response","qti-template-constraint"]}QTI_EXPRESSIONS(){return["qti-base-value","qti-variable","qti-correct","qti-default","qti-is-null","qti-null","qti-and","qti-or","qti-not","qti-match","qti-map-response","qti-member","qti-subtract","qti-sum","qti-random","qti-random-float","qti-random-integer","qti-index","qti-integer-divide","qti-integer-modulus","qti-integer-to-float","qti-equal","qti-equal-rounded","qti-field-value","qti-multiple","qti-ordered","qti-map-response-point","qti-product","qti-delete","qti-string-match","qti-pattern-match","qti-substring","qti-round","qti-round-to","qti-truncate","qti-divide","qti-gt","qti-gte","qti-lt","qti-lte","qti-max","qti-min","qti-custom-operator","qti-math-operator","qti-math-constant","qti-repeat","qti-gcd","qti-lcm","qti-stats-operator","qti-power","qti-any-n","qti-inside","qti-test-variables"]}constructor(){}isExpressionNode(t){return this.QTI_EXPRESSIONS().includes(t)}isResponseRuleNode(t){return this.QTI_RESPONSE_RULES().includes(t)}isTemplateRuleNode(t){return this.QTI_TEMPLATE_RULES().includes(t)}nullValue(){return null}isNullValue(t){return typeof t>"u"||t===null}isBaseTypeNumeric(t){return t==="float"||t==="integer"}isSingleValuesMatch(t,i,s){if(this.isBaseTypeNumeric(t)){let n=new j(i),r=new j(s);return n.comparedTo(r)==0}return i===s}isMultipleValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;const n=i.concat().sort(),r=s.concat().sort();if(this.isBaseTypeNumeric(t)){for(let a=0;a<n.length;a++)if(!this.isSingleValuesMatch(t,n[a],r[a]))return!1}else for(let a=0;a<n.length;a++)if(n[a]!==r[a])return!1;return!0}isOrderedValuesMatch(t,i,s){if(!Array.isArray(i)||!Array.isArray(s)||i.length!==s.length)return!1;if(this.isBaseTypeNumeric(t)){for(let n=0;n<i.length;n++)if(!this.isSingleValuesMatch(t,i[n],s[n]))return!1}else for(let n=0;n<i.length;n++)if(i[n]!==s[n])return!1;return!0}mapResponse(t){if(this.isNullValue(t.value))return t.mapping.getDefaultValue();const i=t.mapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.isBaseTypeNumeric(t.baseType)?new j(t.value).toString():t.value;for(let r=0;r<s;r++){const a=i[r];if(this.isSingleValuesMatch("string",a.caseSensitive?a.mapKey:a.mapKey.toLowerCase(),a.caseSensitive?n:n.toLowerCase()))return t.mapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"||t.cardinality==="ordered"){let n=new j(0),r=t.value;if(this.isBaseTypeNumeric(t.baseType))for(let a=0;a<r.length;a++)r[a]!==null&&(r[a]=new j(r[a]).toString());r=this.mappingEliminateNullsAndDuplicates(r);for(let a=0;a<s;a++){const o=i[a];for(let u=0;u<r.length;u++)this.isSingleValuesMatch("string",o.caseSensitive?o.mapKey:o.mapKey.toLowerCase(),o.caseSensitive?r[u]:r[u].toLowerCase())&&(n=n.plus(o.mappedValue))}return t.mapping.applyConstraints(n)}return t.mapping.getDefaultValue()}mappingEliminateNullsAndDuplicates(t){let i=t.length,s=[],n={};for(let r=0;r<i;r++)t[r]!==null&&(n[t[r]]=0);for(let r in n)s.push(r);return s}mapValueFromLookupTable(t,i){if(this.isNullValue(t.lookupTable))return this.nullValue();if(this.isNullValue(i))return t.lookupTable.getDefaultValue();const s=t.lookupTable.getValue(),n=t.lookupTable.getTableType();if(i=new j(i),n==="interpolation"){s.sort(function(r,a){return r.sourceValue-a.sourceValue});for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)<0||a.includeBoundary&&i.comparedTo(o)===0)return a.targetValue}}else if(n==="match"){i=new j(i);for(let r=0;r<s.length;r++){let a=s[r];const o=new j(a.sourceValue);if(i.comparedTo(o)===0)return a.targetValue}}return t.lookupTable.getDefaultValue()}mapResponsePoint(t){if(this.isNullValue(t.value))return t.areaMapping.getDefaultValue();const i=t.areaMapping.getValue(),s=i.length;if(t.cardinality==="single"){let n=this.toPointObject(t.value);for(let r=0;r<s;r++){const a=i[r];if(this.isPointInside(a.mapShape,a.mapCoords,n))return t.areaMapping.applyConstraints(new j(a.mappedValue))}}else if(t.cardinality==="multiple"){let n=new j(0),r=t.value,a=Array.from(r);for(let o=0;o<s;o++){const u=i[o];let h=!0;for(let f=0;f<r.length;f++){let m=this.toPointObject(r[f]);if(this.isPointInside(u.mapShape,u.mapCoords,m)){h&&(n=n.plus(u.mappedValue),h=!1);const y=a.indexOf(r[f]);y>-1&&a.splice(y,1)}}}return n=n.plus(new j(t.areaMapping.getDefaultValue()).times(a.length)),t.areaMapping.applyConstraints(n)}return t.areaMapping.getDefaultValue()}toPointObject(t){if(t===null||typeof t!="string")return null;const i=t.split(" ");if(i.length!=2)return null;const s=new j(i[0]).toNumber(),n=new j(i[1]).toNumber();return{x:s,y:n}}shuffleArray(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1)),n=t[i];t[i]=t[s],t[s]=n}}shuffleArrayFixed(t){for(let i=t.length-1;i>0;i--){let s=Math.floor(Math.random()*(i+1));if(t[i].fixed||t[s].fixed)continue;let n=t[i];t[i]=t[s],t[s]=n}}generalizedLcm(t,i){let s=i[0];for(let n=1;n<t;n++){if(s===0||i[n]===0)return 0;s=this.lcm(s,i[n])}return s}lcm(t,i){return new j(t).multipliedBy(i).dividedBy(this.gcd(t,i)).toNumber()}generalizedGcd(t,i){let s=i[0];for(let n=1;n<t;n++)s=this.gcd(s,i[n]);return s}gcd(t,i){return i=new j(i),i.isZero()?t:this.gcd(i.toNumber(),new j(t).modulo(i).toNumber())}getParametersFromDefinition(t){let i=new Map;if(typeof t>"u"||(t=t.trim(),t.length===0))return i;let s=t.split("|||");for(let n=0;n<s.length;n++){const r=s[n].split("=");i.set(r[0],r.length<2?"":r[1].replaceAll("&equals;","="))}return i}computeWordCount(t){const i=t.match(/\S+/g);return i===null?0:i.length}isPointInside(t,i,s){const n={COORDS_LENGTH:3,CENTER_X:0,CENTER_Y:1,RADIUS:2,isInside(o,u){const h=Math.pow(u.x-o[this.CENTER_X],2),f=Math.pow(u.y-o[this.CENTER_Y],2);return h+f<=Math.pow(o[this.RADIUS],2)}},r={COORDS_LENGTH:4,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(o,u){return u.x>=o[this.LEFT_X]&&u.x<=o[this.RIGHT_X]&&u.y>=o[this.TOP_Y]&&u.y<=o[this.BOTTOM_Y]}},a={MINIMUM_COORDS_LENGTH:6,LEFT_X:0,TOP_Y:1,RIGHT_X:2,BOTTOM_Y:3,isInside(o,u){let h=o;if(h[0]!=h[h.length-2]||h[1]!=h[h.length-1]){let b=h;b.push(h[0]),b.push(h[1]),h=b}let f=new j(0);const m=new j(u.x).integerValue(),y=new j(u.y).integerValue();for(let b=0;b<h.length-3;b+=2){const S=new j(h[b]).integerValue(),T=new j(h[b+1]).integerValue(),$=new j(h[b+2]).integerValue(),x=new j(h[b+3]).integerValue(),B=m.minus($).pow(2).plus(y.minus(x).pow(2)).sqrt(),E=$.minus(S).pow(2).plus(x.minus(T).pow(2)).sqrt(),G=S.minus(m).pow(2).plus(T.minus(y).pow(2)).sqrt(),Q=new j(Math.acos((Math.pow(B.toNumber(),2)-Math.pow(E.toNumber(),2)+Math.pow(G.toNumber(),2))/(2*B.toNumber()*G.toNumber()))*180/Math.PI),ee=$.minus(m).times(y.minus(T)),p=x.minus(y).times(m.minus(S)),v=ee.minus(p);if(Q.isNaN())return!0;v.gte(new j(0))?f=f.plus(Q):f=f.minus(Q)}let w=new j(f);return w=w.dp(6,j.ROUND_HALF_UP),!w.isZero()}};if(t==="circle")return n.isInside(i,s);if(t==="rect")return r.isInside(i,s);if(t==="poly")return a.isInside(i,s);if(t==="default")return!0;if(t==="ellipse")return!1}valueToPciJson(t,i,s){return t===null?{base:null}:s==="single"?{base:this.baseValueToPciJson(t,i)}:s==="multiple"||s==="ordered"?{list:this.baseValueToPciJson(t,i)}:s==="record"?{record:this.recordValueToPciJson(t)}:{base:null}}baseValueToPciJson(t,i){let s={};switch(i){case"string":case"identifier":case"integer":case"float":case"duration":case"boolean":case"uri":case"file":return s[i]=t,s;case"point":s[i]=n=>n.split(" ").map(Number);return;case"directedPair":case"pair":return s[i]=t.split(" "),s;case"intOrIdentifier":return s[i]=null,s;default:return s[i]=null,s}}recordValueToPciJson(t){let i=[];for(let s of t.values())i.push({name:s.fieldIdentifier,base:s.value===null?null:this.valueToPciJson(s.value,s.baseType,s.cardinality)});return i}processInteractionResponse(t,i){return t.interactionType==="PortableCustom"?this.getValueFromPciJson(t.node.getResponse(),i):t.node.getResponse()}getValueFromPciJson(t,i){if(console.log("[GetValueFromPciJson][Value]",t,i),t===null||typeof i>"u")return this.nullValue();try{if(typeof t!="object")throw new O("Improper value encoding. Must be an Object.");if(Array.isArray(t))throw new O("Improper value encoding. Found Array. Must be an Object.");if(t.base!==void 0){if(i.cardinality==="single")return this.baseValueFromPciJson(t.base,i.baseType);throw new O("Inconsistent value cardinality [base] for this variable. Variable must be single cardinality.")}if(t.list!==void 0){if(i.cardinality==="multiple"||i.cardinality==="ordered")return this.baseValueFromPciJson(t.list,i.baseType);throw new O("Inconsistent value cardinality [list] for this variable. Variable must be multiple or ordered cardinality.")}if(t.record!==void 0){if(i.cardinality==="record")return this.recordValueFromPciJson(t.record,i);throw new O("Inconsistent value cardinality [record] for this variable. Variable must be record cardinality.")}throw new O('Improper value encoding. Must be one of "base", "list", "record".')}catch({name:s,message:n}){return console.log("[PciDecodingException][ValueFromJson] ",n),this.nullValue()}}baseValueFromPciJson(t,i){if(t===null)return this.nullValue();try{if(typeof t!="object")throw new O("Invalid value. Must be an Object.");if(Array.isArray(t))throw new O("Invalid value. Found Array. Must be an Object.");if(t[i]!==void 0){if(i==="point"||i==="directedPair"||i==="pair"){if(!Array.isArray(t[i]))throw new O(`Invalid value. For baseType "${i}", must be an Array`);if(t[i].length!==2)throw new O(`Invalid value. For baseType "${i}", Array must have 2 elements`);return`${t[i][0]} ${t[i][1]}`}return t[i]}throw new O(`Value does not have the required base-type. Expecting ${i}.`)}catch({name:s,message:n}){return console.log("[PciDecodingException][BaseValueFromJson] ",n,t),this.nullValue()}}recordValueFromPciJson(t,i){try{let s=this.getRecordVariableFieldDefinition(i);if(s===null)throw new O(`Unable to retrieve ${i.identifier} record field definition.`);if(typeof t!="object")throw new O("Improper record value encoding. Must be an Array.");if(!Array.isArray(t))throw new O("Improper record value encoding. Must be an Array.");const n=new Map;for(let[r,a]of s)for(let o=0;o<t.length;o++)if(t[o].name!==void 0&&t[o].base!==void 0&&t[o].name===r){const u=this.baseValueFromPciJson(t[o].base,a.getBaseType()),h=new Xe(r,a.getBaseType(),u);n.set(r,h);break}return n}catch({name:s,message:n}){return console.log("[VariableDecodingException][RecordValueFromJson] ",n),new Map}}getRecordVariableFieldDefinition(t){return t==null?null:t.defaultValue!==null?t.defaultValue:t.correctResponse}computeProcessingContext(t){return this.computeProcessingType(t)==="OUTCOME"?"TEST":"ITEM"}computeProcessingType(t){return t===null?"UNKNOWN":t.$options.name==="QtiOutcomeProcessing"?"OUTCOME":t.$options.name==="QtiResponseProcessing"?"RESPONSE":t.$options.name==="QtiTemplateProcessing"?"TEMPLATE":t.$options.name==="QtiBranchRule"?"OUTCOME":this.computeProcessingType(t.$parent)}computeNodeContext(t){return t===null||t.$options.name==="QtiAssessmentItem"?"ITEM":t.$options.name==="QtiAssessmentTest"?"TEST":this.computeNodeContext(t.$parent)}base64ToBytes(t){const i=atob(t);return Uint8Array.from(i,s=>s.codePointAt(0))}bytesToBase64(t){const i=Array.from(t,s=>String.fromCodePoint(s)).join("");return btoa(i)}encodeBytesToBase64(t){const i=new TextEncoder;return this.bytesToBase64(i.encode(t))}decodeBase64ToBytes(t){return new TextDecoder().decode(this.base64ToBytes(t))}}const Kb=new te,I={player:null,state:{item:null,itemBody:null,identifier:"",title:"",responseDeclarations:[],outcomeDeclarations:[],templateDeclarations:[],contextDeclarations:[],stimulusRefs:[],interactions:[],processing:[],feedbacks:[],templates:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[],asyncStateMap:new Map},itemContext:{guid:null,pnp:null,sc:null,state:null,validationMessages:[],lifecycleStatus:null},itemTimer:new Wb,pciContext:{renderer2p0:"assets/pci/pci.html"},pciMessageHandler:null,windowResizeHandler:null,getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getTemplateDeclarations(){return this.state.templateDeclarations},getTemplateMathParameterVariables(){return this.state.templateDeclarations.filter(e=>e.mathVariable===!0)},getTemplateDeclaration(e){return this.state.templateDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getStimulusRefs(){return this.state.stimulusRefs},getStimulusRef(e){return this.state.stimulusRefs.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.templateDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getInteraction(e){return this.state.interactions.find(t=>t.identifier===e)},getInteractions(){return this.state.interactions},getProcessing(e){return this.state.processing.find(t=>t.processingType===e)},getFeedbacks(){return this.state.feedbacks},getTemplates(){return this.state.templates},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},getItem(){return this.state.item},setItem(e){this.state.item=e.item},getItemBody(){return this.state.itemBody},setItemBody(e){this.state.itemBody=e},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTemplateDeclaration(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.templateDeclarations[t]=e:this.state.templateDeclarations.push(e)},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineStimulusRef(e){let t=this.state.stimulusRefs.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.stimulusRefs[t]=e:this.state.stimulusRefs.push(e)},defineInteraction(e){let t=this.state.interactions.findIndex(s=>s.identifier==e.identifier);if(t<0){console.log("[DefineInteraction]["+e.identifier+"]"),this.state.interactions.push(e);return}let i=this.state.interactions[t];i.interactionType=e.interactionType,i.isValidResponse=e.isValidResponse,i.invalidResponseMessage=e.invalidResponseMessage,i.maxSelectionsMessage=e.maxSelectionsMessage,i.node=e.node,i.resetValue=e.resetValue},defineProcessing(e){let t=e.processingType,i=this.state.processing.findIndex(s=>s.processingType==t);i>-1?this.state.processing[i]=e:this.state.processing.push(e),t=="response"?console.log("[QtiResponseProcessing][Defined]",e):t=="template"?console.log("[QtiTemplateProcessing][Defined]",e):t=="outcome"&&console.log("[QtiOutcomeProcessing][Defined]",e)},defineResponseProcessing(e){this.defineProcessing({processingType:"response",node:e.node})},defineTemplateProcessing(e){this.defineProcessing({processingType:"template",node:e.node})},defineItemBody(e){this.setItemBody(e.node)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},defineTemplate(e){this.state.templates.push(e)},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.item=null,this.state.itemBody=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.templateDeclarations.splice(0,this.state.templateDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.stimulusRefs.splice(0,this.state.stimulusRefs.length),this.state.interactions.splice(0,this.state.interactions.length),this.state.processing.splice(0,this.state.processing.length),this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.templates.splice(0,this.state.templates.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.state.asyncStateMap.clear(),this.resetItemTimer(),this.itemContext.guid=null,this.itemContext.state=null,this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length),this.itemContext.lifecycleStatus=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new Xe("candidateIdentifier","string",null)),t.set("testIdentifier",new Xe("testIdentifier","string",null)),t.set("environmentIdentifier",new Xe("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentItem][QTI_CONTEXT] initialized"),this.defineOutcomeDeclaration({identifier:"SCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][SCORE] initialized"),this.defineOutcomeDeclaration({identifier:"MAXSCORE",baseType:"float",cardinality:"single",value:0,defaultValue:0,lookupTable:null,lookupTableType:null,view:null,interpretation:null,longInterpretation:null,normalMaximum:null,normalMinimum:null,masteryValue:null,externalScored:null,variableIdentifierRef:null}),console.log("[QtiAssessmentItem][MAXSCORE] initialized"),this.defineOutcomeDeclaration({identifier:"completionStatus",baseType:"identifier",cardinality:"single",value:"not_attempted",defaultValue:"not_attempted",lookupTable:null,lookupTableType:null,normalMaximum:null,normalMinimum:null,externalScored:null,interpretation:null}),console.log("[QtiAssessmentItem][completionStatus] initialized"),this.defineResponseDeclaration({identifier:"numAttempts",baseType:"integer",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][numAttempts] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentItem][duration] initialized")},restoreContextVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"contextVariables"in e&&e.contextVariables!==null&&e.contextVariables.forEach(t=>{let i=this.state.contextDeclarations.findIndex(s=>s.identifier==t.identifier);i<0||(this.state.contextDeclarations[i].value=t.value)},this)},restoreOutcomeVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"outcomeVariables"in e&&e.outcomeVariables!==null&&e.outcomeVariables.forEach(t=>{this.setOutcomeVariableValue({identifier:t.identifier,value:t.value})},this)},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e);return t<0?null:this.state.responseDeclarations[t].correctResponse},setResponseVariableCorrectResponse(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.correctResponse=e.value},setInteractionIsValidResponse(e){let t=this.state.interactions.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.interactions[t].isValidResponse=e.isValidResponse)},resetInteractionStateIsValidResponse(){this.state.interactions.forEach(e=>{e.interactionType!=="EndAttemptInteraction"&&(e.isValidResponse=!1)})},restoreResponseVariables(){if(!this.hasItemContextState())return null;const e=this.getItemContextState();"responseVariables"in e&&e.responseVariables!==null&&e.responseVariables.forEach(t=>{this.setResponseVariableValue({identifier:t.identifier,value:t.value,state:t.state}),"correctResponse"in t&&this.setResponseVariableCorrectResponse({identifier:t.identifier,value:t.correctResponse})},this)},setResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=e.value,i.state=e.state},resetResponseVariableValue(e){let t=this.state.responseDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.responseDeclarations[t];i.value=i.defaultValue!==null?i.defaultValue:null},incrementNumAttempts(){let e=this.state.responseDeclarations.findIndex(t=>t.identifier=="numAttempts");this.state.responseDeclarations[e].value+=1},updateItemDuration(){const e=this.getResponseDeclaration("duration");e.value+=this.itemTimer.getTime(),this.restartItemTimer()},restartItemTimer(){this.itemTimer.startTimer()},resetItemTimer(){this.itemTimer.resetTimer()},setTemplateVariableValue(e){let t=this.state.templateDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.templateDeclarations[t].value=e.value)},resetTemplateVariables(){this.state.templateDeclarations.forEach(e=>{e.node.reset()})},setVariableDefaultValue(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);if(t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}if(t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier),t>-1){let i=this.state.responseDeclarations[t];i.defaultValue=e.value;return}},getPciContext(){return this.pciContext},setPciContext(e){this.pciContext=e},getPciContextRenderer(){return this.pciContext.renderer2p0},setPciContextRenderer(e){this.pciContext.renderer2p0=e},initializePciMessageListener(){this.pciMessageHandler=this.PciMessageListener.bind(this),this.windowResizeHandler=this.WindowResize.bind(this),window.addEventListener("message",this.pciMessageHandler),window.addEventListener("resize",this.windowResizeHandler)},removePciMessageListener(){this.pciMessageHandler!==null&&window.removeEventListener("message",this.pciMessageHandler),this.windowResizeHandler!==null&&window.removeEventListener("resize",this.windowResizeHandler)},PciMessageListener(e){switch(e.data.message){case"PciChildLoaded":console.log("[PCI Parent] PCI Frame Loaded: "+e.data.identifier),this.pciInitialize(e.data.identifier);break;case"PciReady":console.log("[PCI Parent] PCI Ready: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciReady(e.data.identifier),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!0);break;case"PciResize":console.log("[PCI Parent] PCI Resize: "+e.data.identifier+", height: "+e.data.height+", width: "+e.data.width),this.pciResizeIframe(e.data.identifier,e.data.height,e.data.width,!1);break;case"PciGetState_Reply":console.log("[PCI Parent] PCI GetState Reply: "+e.data.identifier+", state:",e.data.state),this.pciSaveState(e.data.identifier,e.data.state);break}},WindowResize(){this.getInteractions().forEach(e=>{e.interactionType==="PortableCustom"&&e.node.pciResizeIframeWidthToContainer()})},pciInitialize(e){let t=I.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciInitialize()},pciReady(e){let t=I.getInteraction(e);typeof t>"u"||t.interactionType!=="PortableCustom"||t.node.pciSetReady()},pciResizeIframe(e,t,i,s){let n=I.getInteraction(e);typeof n>"u"||n.interactionType!=="PortableCustom"||(s?n.node.pciResizeIframe(t,n.node.initialWidth):n.node.pciResizeIframe(t,i))},pciSaveState(e,t){let i=I.getInteraction(e);typeof i>"u"||i.interactionType!=="PortableCustom"||i.node.pciSaveState(t)},getAsyncStateMap(){return this.state.asyncStateMap},getItemContextGuid(){return this.itemContext.guid},setItemContextGuid(e){this.itemContext.guid=e},initializeItemContextPnp(){this.itemContext.pnp=new Ds},getItemContextPnp(){return this.itemContext.pnp},setItemContextPnp(e){this.itemContext.pnp===null&&this.initializeItemContextPnp(),this.itemContext.pnp.setPnp(e)},initializeItemContextSessionControl(){this.itemContext.sc=new jb},getItemContextSessionControl(){return this.itemContext.sc},setItemContextSessionControl(e){this.itemContext.sc===null&&this.initializeItemContextSessionControl(),this.itemContext.sc.setSessionControl(e)},getItemContextState(){return this.itemContext.state},setItemContextState(e){const t=new Cc,i=e===null?e:t.createStateFromState(e);this.itemContext.state=i},getItemContextStateVariable(e){if(!this.hasItemContextState())return null;const t=this.getItemContextState();let i=t.outcomeVariables.find(s=>s.identifier===e);return typeof i<"u"||(i=t.responseVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.templateVariables.find(s=>s.identifier===e),typeof i<"u")||(i=t.contextDeclarations.find(s=>s.identifier===e),typeof i<"u")?i:null},hasItemContextState(){return this.getItemContextState()!==null},getItemContextValidationMessages(){return this.itemContext.validationMessages},addItemContextValidationMessage(e){this.itemContext.validationMessages.push(e)},resetItemContextValidationMessages(){this.itemContext.validationMessages.splice(0,this.itemContext.validationMessages.length)},getItemLifecycleStatus(){return this.lifecycleStatus},setItemLifecycleStatus(e){this.lifecycleStatus=e},NotifyPlayerReady(e){this.player=e.player},NotifyEndAttempt(e){this.state.item.endAttempt(e,(function(){this.state.item.notifyEndAttemptInteractionResults("itemEndAttemptReady")}).bind(this))},NotifyNewTemplate(e){this.state.item.newTemplate(e)},NotifyItemReady(e){this.setItem(e),this.getItem().isAdaptive||this.restartItemTimer(),this.getItem().isAdaptiveItemCompleted()||this.restartItemTimer()},NotifyInteractionSelectionsLimit(e){const t={icon:"warning",message:e};this.player.displayAlertMessage(t)},NotifyInteractionStateReady(e){console.log("[InteractionStateReady][Interaction]",e.identifier);const t=this.getInteraction(e.identifier);typeof t>"u"||typeof this.getAsyncStateMap().get(t.identifier)>"u"||(this.setResponseVariableValue({identifier:t.identifier,value:Kb.processInteractionResponse(t,this.getResponseDeclaration(t.identifier)),state:t.node.getState()}),this.getAsyncStateMap().delete(t.identifier),this.getAsyncStateMap().size===0&&this.getItem().triggerGetResponsesComplete())}},Ze={player:null,state:{test:null,identifier:"",title:"",responseDeclarations:[],contextDeclarations:[],outcomeDeclarations:[],timeLimit:null,testParts:[],outcomeProcessing:null,feedbacks:[],printedVariables:[],catalogs:[],scoringRubricBlocks:[]},testContext:{guid:null,pnp:null},sectionItemStates:new Map,getTest(){return this.state.test},setTest(e){this.state.test=e.test},getResponseDeclarations(){return this.state.responseDeclarations},getResponseDeclaration(e){return this.state.responseDeclarations.find(t=>t.identifier===e)},getOutcomeDeclarations(){return this.state.outcomeDeclarations},getOutcomeDeclaration(e){return this.state.outcomeDeclarations.find(t=>t.identifier===e)},getContextDeclarations(){return this.state.contextDeclarations},getContextDeclaration(e){return this.state.contextDeclarations.find(t=>t.identifier===e)},getVariableDeclaration(e){let t=this.state.outcomeDeclarations.find(i=>i.identifier===e);return typeof t<"u"||(t=this.state.contextDeclarations.find(i=>i.identifier===e),typeof t<"u")||(t=this.state.responseDeclarations.find(i=>i.identifier===e),typeof t<"u")?t:null},getTimeLimit(){return this.timeLimit},getTestParts(){return this.state.testParts},getTestPart(e){return this.state.testParts.find(t=>t.identifier===e)},getOutcomeProcessing(){return this.state.outcomeProcessing},getFeedbacks(){return this.state.feedbacks},getPrintedVariables(){return this.state.printedVariables},getCatalog(e){return this.state.catalogs.find(t=>t.id===e)},getCatalogs(){return this.state.catalogs},getScoringRubricBlocks(){return this.state.scoringRubricBlocks},defineContextDeclaration(e){let t=this.state.contextDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.contextDeclarations[t]=e:this.state.contextDeclarations.push(e)},defineResponseDeclaration(e){let t=this.state.responseDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.responseDeclarations[t]=e:this.state.responseDeclarations.push(e)},defineOutcomeDeclaration(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t>-1?this.state.outcomeDeclarations[t]=e:this.state.outcomeDeclarations.push(e)},defineTimeLimit(e){this.state.timeLimit=e.node},defineTestPart(e){let t=this.state.testParts.findIndex(i=>i.identifier==e.identifier);if(t<0){this.state.testParts.push(e.testPart);return}this.state.testParts[t]=e.testPart},defineProcessing(e){this.state.processing=e,console.log("[QtiOutcomeProcessing][Defined]",e)},defineOutcomeProcessing(e){const t={processingType:"outcome",node:e.node};this.state.outcomeProcessing=t,console.log("[QtiOutcomeProcessing][Defined]",t)},defineFeedback(e){this.state.feedbacks.push(e),console.log("[DefineFeedback]["+e.outcomeIdentifier+"]["+e.identifier+"]")},definePrintedVariable(e){this.state.printedVariables.push(e)},defineCatalog(e){let t=this.state.catalogs.findIndex(i=>i.id==e.id);if(t<0){this.state.catalogs.push(e);return}this.state.catalogs[t]=e},defineScoringRubricBlock(e){this.state.scoringRubricBlocks.push(e)},resetAll(){this.state.test=null,this.state.identifier="",this.state.title="",this.state.responseDeclarations.splice(0,this.state.responseDeclarations.length),this.state.outcomeDeclarations.splice(0,this.state.outcomeDeclarations.length),this.state.contextDeclarations.splice(0,this.state.contextDeclarations.length),this.state.timeLimit=null,this.state.testParts.splice(0,this.state.testParts.length),this.state.outcomeProcessing=null,this.state.feedbacks.splice(0,this.state.feedbacks.length),this.state.printedVariables.splice(0,this.state.printedVariables.length),this.state.catalogs.splice(0,this.state.catalogs.length),this.state.scoringRubricBlocks.splice(0,this.state.scoringRubricBlocks.length),this.testContext.guid=null,this.testContext.state=null},initializeBuiltInDeclarations(){function e(){return 0}const t=new Map;t.set("candidateIdentifier",new Xe("candidateIdentifier","string",null)),t.set("testIdentifier",new Xe("testIdentifier","string",null)),t.set("environmentIdentifier",new Xe("environmentIdentifier","string",null)),this.defineContextDeclaration({identifier:"QTI_CONTEXT",baseType:null,cardinality:"record",value:t,defaultValue:t}),console.log("[QtiAssessmentTest][QTI_CONTEXT] initialized"),this.defineResponseDeclaration({identifier:"duration",baseType:"duration",cardinality:"single",value:0,resetValue:e,defaultValue:0,state:null}),console.log("[QtiAssessmentTest][duration] initialized")},setOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(i=>i.identifier==e.identifier);t<0||(this.state.outcomeDeclarations[t].value=e.value)},resetOutcomeVariableValue(e){let t=this.state.outcomeDeclarations.findIndex(s=>s.identifier==e.identifier);if(t<0)return;let i=this.state.outcomeDeclarations[t];if(i.defaultValue!==null){i.value=this.defaultValue;return}if(i.cardinality==="record"||i.cardinality==="multiple"||i.cardinality==="ordered"){i.value=null;return}if(i.baseType==="integer"||i.baseType==="float"){i.value=0;return}i.value=null},getTestContextGuid(){return this.testContext.guid},setTestContextGuid(e){this.testContext.guid=e},initializeTestContextPnp(){this.testContext.pnp=new Ds},getTestContextPnp(){return this.testContext.pnp},setTestContextPnp(e){this.testContext.pnp===null&&this.initializeTestContextPnp(),this.testContext.pnp.setPnp(e)},getAllTestStateItemStatesMap(){return this.sectionItemStates},setTestStateItemState(e,t,i,s){console.log("[TestStore][SetState][Part:"+e+"][Section:"+t+"][Item:"+i+"]",s);const n=`${e}~~${t}`;let r=this.getItemStateMapBySectionIdentifier(n);r!=null&&r.set(i,s)},getItemStateMapBySectionIdentifier(e){return this.sectionItemStates.has(e)?this.sectionItemStates.get(e):this.initializePartSectionItemStateMap(e)},getPartSectionMapBySectionIdentifier(e){for(let[t,i]of this.sectionItemStates)if(t.endsWith(e))return i;return null},initializePartSectionItemStateMap(e){return this.sectionItemStates.set(e,new Map),this.sectionItemStates.get(e)},findItemVariableValueByIdentifier(e,t){const i=this.findVariableByIdentifier(e.contextVariables,t);if(typeof i<"u")return i;const s=this.findVariableByIdentifier(e.outcomeVariables,t);if(typeof s<"u")return s;const n=this.findVariableByIdentifier(e.responseVariables,t);if(typeof n<"u")return n;const r=this.findVariableByIdentifier(e.templateVariables,t);return typeof r<"u"?r:null},findVariableByIdentifier(e,t){return e.find(i=>i.identifier===t)},getSerializedState(){return{contextVariables:this.serializeVariables(this.getContextDeclarations()),outcomeVariables:this.serializeVariables(this.getOutcomeDeclarations())}},serializeVariables(e){let t=[];return e.forEach(i=>{t.push({identifier:i.identifier,cardinality:i.cardinality,baseType:i.baseType,value:this.serializeVariableValue(i.cardinality,i.value)})}),t},serializeVariableValue(e,t){return e!=="record"?JSON.parse(JSON.stringify(t)):this.serializeRecordVariableValue(t)},serializeVariableState(e){return JSON.parse(JSON.stringify(e))},serializeRecordVariableValue(e){const t=this.strMapToJson(e);return this.jsonToStrMap(t)},strMapToJson(e){return JSON.stringify(this.strMapToObj(e))},jsonToStrMap(e){return this.objToStrMap(JSON.parse(e))},strMapToObj(e){let t=Object.create(null);for(let[i,s]of e)t[i]=s;return t},objToStrMap(e){let t=new Map;for(let i of Object.keys(e))t.set(i,e[i]);return t},NotifyTestPlayerReady(e){this.player=e.player},NotifyTestReady(e){this.setTest(e)}};class Yb{constructor(){J(this,"xmlDeclaration",null);J(this,"rxTrackSource",null);this.xmlDeclaration=new RegExp(/<\?xml.*?\?>/s),this.rxTrackSource=new RegExp(/<(track|source)[^>]+?\/>/g)}filterXmlDeclaration(t){return t.replace(this.xmlDeclaration,"")}filterCdata(t){return t.replaceAll("<![CDATA[","").replaceAll("]]>","")}filterStyle(t){return t.replaceAll("<style>","<amp-style>").replaceAll("</style>","</amp-style>")}filterMedia(t){return t=t.replaceAll("<video>","<amp-video>").replaceAll("<video ","<amp-video ").replaceAll("</video>","</amp-video>").replaceAll("<audio>","<amp-audio>").replaceAll("<audio ","<amp-audio ").replaceAll("</audio>","</amp-audio>"),this.filterTrackSource(t)}filterTrackSource(t){return t.replace(this.rxTrackSource,i=>i.replace(/\/>/g,">"))}}/*!
2
2
  * sweetalert2 v11.14.0
3
3
  * Released under the MIT License.
4
4
  */function vf(e,t,i){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}function Xb(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ef(e,t){return e.get(vf(e,t))}function Zb(e,t,i){Xb(e,t),t.set(e,i)}function Jb(e,t,i){return e.set(vf(e,t),i),i}const ev=100,he={},tv=()=>{he.previousActiveElement instanceof HTMLElement?(he.previousActiveElement.focus(),he.previousActiveElement=null):document.body&&document.body.focus()},iv=e=>new Promise(t=>{if(!e)return t();const i=window.scrollX,s=window.scrollY;he.restoreFocusTimeout=setTimeout(()=>{tv(),t()},ev),window.scrollTo(i,s)}),Cf="swal2-",H=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"].reduce((e,t)=>(e[t]=Cf+t,e),{}),Co=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=Cf+t,e),{}),Tf="SweetAlert2:",xc=e=>e.charAt(0).toUpperCase()+e.slice(1),Tt=e=>{console.warn(`${Tf} ${typeof e=="object"?e.join(" "):e}`)},Hs=e=>{console.error(`${Tf} ${e}`)},Sf=[],sv=e=>{Sf.includes(e)||(Sf.push(e),Tt(e))},xf=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;sv(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},To=e=>typeof e=="function"?e():e,Ic=e=>e&&typeof e.toPromise=="function",Nr=e=>Ic(e)?e.toPromise():Promise.resolve(e),_c=e=>e&&Promise.resolve(e)===e,St=()=>document.body.querySelector(`.${H.container}`),Rr=e=>{const t=St();return t?t.querySelector(e):null},Pt=e=>Rr(`.${e}`),Le=()=>Pt(H.popup),kr=()=>Pt(H.icon),nv=()=>Pt(H["icon-content"]),If=()=>Pt(H.title),Vc=()=>Pt(H["html-container"]),_f=()=>Pt(H.image),Ac=()=>Pt(H["progress-steps"]),So=()=>Pt(H["validation-message"]),Li=()=>Rr(`.${H.actions} .${H.confirm}`),_n=()=>Rr(`.${H.actions} .${H.cancel}`),Fs=()=>Rr(`.${H.actions} .${H.deny}`),rv=()=>Pt(H["input-label"]),Vn=()=>Rr(`.${H.loader}`),qr=()=>Pt(H.actions),Vf=()=>Pt(H.footer),xo=()=>Pt(H["timer-progress-bar"]),$c=()=>Pt(H.close),av=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qti3-item-player-vue3",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "QTI 3 Item Player implemented with Vue 3",
5
5
  "author": {
6
6
  "name": "Paul Grudnitski",