From 16f0d1054a80306e462694c4013c2036b79d830d Mon Sep 17 00:00:00 2001 From: Michael Sharman Date: Wed, 24 Jul 2024 16:50:22 +1000 Subject: [PATCH] Removing "Upload" button label on click. Disabling upload button on click. Auto-clicking "OK" button after upload complete (only for background images). Added "Reset" button to event listener (to set up observer). Added listener for self-hosted (URL) images to enable observer when modal closes. Fixed issue where extension uploader was rendering in simple features for audio and video. We've turned it off completely in the simple feature and resource modals. --- dist/assessment/core.js | 2 +- dist/assessment/index.js | 2 +- dist/authoring/core.js | 2 +- dist/authoring/index.js | 2 +- dist/version.js | 2 +- ...ensions_Assessment_themes_juniorQuest.html | 3 +- ...le-Extensions_Authoring_imageUploader.html | 2 + package-lock.json | 4 +- package.json | 2 +- .../extensions/ui/themes/juniorQuest/index.js | 3 +- .../extensions/ui/imageUploader/index.js | 168 +++++++++++++++--- 11 files changed, 155 insertions(+), 37 deletions(-) diff --git a/dist/assessment/core.js b/dist/assessment/core.js index 325eb24..3b7698e 100644 --- a/dist/assessment/core.js +++ b/dist/assessment/core.js @@ -1 +1 @@ -var t={7738:(t,e,n)=>{n.r(e),n.d(e,{activity:()=>r,activityId:()=>a,activitySubTitle:()=>f,activityTags:()=>p,activityTemplateId:()=>c,activityTitle:()=>u,adaptiveType:()=>l,annotationsConfig:()=>d,autoSaveConfig:()=>m,elapsedTime:()=>g,hasActivityTemplate:()=>v,hasAnnotations:()=>h,hasAutoSave:()=>y,hasEvents:()=>b,hasItemPool:()=>I,hasResourceItems:()=>A,hasSections:()=>w,hasShuffledItems:()=>_,hasTryAgain:()=>S,isAdaptive:()=>k,isResuming:()=>q,itemBank:()=>P,itemPool:()=>T,maxTime:()=>x,region:()=>O,resourceItems:()=>R,sessionId:()=>B,state:()=>E,timeRemaining:()=>C,totalItems:()=>F,userId:()=>W});var i=n(2844),o=n(8511),s=n(7484);function r(){return i.appInstance().getActivity()}function a(){return r().activity_id}function c(){return r().activity_template_id}function u(){return r().config.title}function f(){return r().config.subtitle}function p(){return i.appInstance().getTags()}function l(){return k()&&r().adaptive.hasOwnProperty("type")?r().adaptive.type:""}function d(){return h()&&r()?.config?.annotations_api_init_options?r().config.annotations_api_init_options:{}}function m(){const t=r();return t?.config?.navigation?.auto_save?t.config.navigation.auto_save:{}}function g(){return i.appInstance().getTime()}function v(){return r().hasOwnProperty("activity_template_id")}function h(){const t=r();return Boolean(!0===t?.config?.annotations||t?.config?.annotations_api_init_options)}function y(){const t=r();return t.hasOwnProperty("config")&&t.config.hasOwnProperty("navigation")&&t.config.navigation.hasOwnProperty("auto_save")&&!1!==t.config.navigation.auto_save}function _(){return Boolean(r()?.config?.configuration?.shuffle_items)}function b(){const t=r();return t.hasOwnProperty("events")&&!1!==t.events}function I(){return r().hasOwnProperty("item_pool_id")}function A(){return Boolean(r()?.config?.navigation?.resource_items)}function w(){return r().hasOwnProperty("sections")}function S(){return r()?.dynamic_items.hasOwnProperty("try_again")}function k(){return r().hasOwnProperty("adaptive")}function q(){return r().existing_session}function P(){return r()?.organisation_id}function T(){return r()?.item_pool_id}function x(){return r()?.config?.time?.max_time?r().config.time.max_time:0}function O(){return r()?.config?.regions}function R(){return r()?.config?.navigation?.resource_items}function B(){return r()?.session_id}function E(){let t;return t=void 0===r()?.state?"initial":r().state,t}function C(){return 0===x()?null:x()-g()}function F(){if(w()){let t=0,e=o.sections();for(let n=0;n{n.r(e),n.d(e,{annotationsApp:()=>c,appInstance:()=>a,assessApp:()=>u,eventsApp:()=>f,init:()=>r,questionsApp:()=>p});var i=n(1634),o=n(7066);const s={};function r(t){s.app=t,s.app.on("all",(t=>{(0,i.handleEvent)(t)})),s.app.on("item:load",(t=>{(0,o.questionResponseIds)().forEach((t=>{s.app.question(t).on("changed",(t=>{(0,i.handleEvent)("changed")}))}))}))}function a(){return s.app}function c(){return void 0!==a().annotationsApp()?a().annotationsApp():null}function u(){return a().assessApp()}function f(){return a().eventsApp()}function p(){return a().questionsApp()}},1634:(t,e,n)=>{n.r(e),n.d(e,{diagnostics:()=>c,filterEvent:()=>u,handleEvent:()=>f,listen:()=>p});var i=n(2844),o=n(7738),s=n(7484);const r="2.14.1",a={events:{broadcast:!1,listenFor:"item"}};function c(){let t=window.LearnosityApp?LearnosityApp.versions:{};return{apps:{annotations:{app:i.annotationsApp(),config:o.annotationsConfig(),enabled:o.hasAnnotations()},assess:{app:i.assessApp()},events:{app:i.eventsApp(),enabled:o.hasEvents()},items:{app:i.appInstance(),metadata:o.activity().config.metadata},questions:{app:i.questionsApp()}},activity:{activity:o.activityId(),activityTemplate:o.activityTemplateId(),autoSave:{config:o.autoSaveConfig(),enabled:o.hasAutoSave()},itemBank:o.itemBank(),itemPool:o.itemPool(),session:o.sessionId(),state:o.state(),type:o.activity().type,user:o.userId()},LT:{version:r},versions:t}}function u(t){/^[a-zA-Z:*]*$/.test(t)?a.events.listenFor=t:s.A.warn("Invalid event type")}function f(t){if(a.events.broadcast){const e=a.events.listenFor,n=e.replaceAll("*","");1===e.length&&"*"===e||"all"===e?s.A.info(t):e.startsWith("*")&&!e.endsWith("*")?t.endsWith(n)&&s.A.info(t):e.endsWith("*")&&!e.startsWith("*")?t.startsWith(n)&&s.A.info(t):e.startsWith("*")&&e.endsWith("*")?t.includes(n)&&s.A.info(t):t.startsWith(n)&&s.A.info(t)}}function p(t=!0){a.events.broadcast=Boolean(t),Boolean(t)?s.A.info(`👂 listening for '${a.events.listenFor}'`):s.A.info("🚫👂 not listening")}},3191:(t,e,n)=>{n.r(e),n.d(e,{dynamic:()=>a,flag:()=>c,isDynamicItem:()=>u,isFirstItem:()=>f,isFlagged:()=>l,isItemFullyAttempted:()=>d,isLastItem:()=>p,isMaskingEnabled:()=>m,item:()=>g,itemAttemptStatus:()=>v,itemByResponseId:()=>h,itemElement:()=>y,itemPosition:()=>_,itemReference:()=>b,itemTags:()=>I});var i=n(2844),o=n(7738),s=n(7066),r=n(8511);function a(){const t=b();return i.assessApp().item(t).dynamic||{}}function c(){const t=b();i.assessApp().item(t).flag()}function u(){return g()?.source.hasOwnProperty("data_table_seed")}function f(){let t;return o.hasSections()?(t="object"==typeof r.sections()[0].items[0]?r.sections()[0].items[0].reference:r.sections()[0].items[0],t===g().reference):(t="object"==typeof o.activity().items[0]?o.activity().items[0].reference:o.activity().items[0],t===g().reference)}function p(){return g().is_last_item}function l(){return g().user_flagged}function d(t){let e,n,o;if(e=t?i.appInstance().getItems()[t].questions:s.questions(),Array.isArray(e)&&e.length)for(let t=0;tvoid 0===t)).length)return!1;if(o.value.filter((t=>null===t)).length)return!1}n=!0}else n=!0;return n}function m(){return Boolean(document.querySelector(".lrn-masking"))}function g(t){return t?i.appInstance().getItems()[t]:i.appInstance().getCurrentItem()}function v(){return i.appInstance().getCurrentItem().attempt_status}function h(t){const e=i.appInstance().getItems();let n;for(const i in e)if(e[i].response_ids.includes(t)){n=e[i];break}return n}function y(){return document.querySelector(`div[data-reference='${b()}']`)}function _(){return i.appInstance().assessApp().getItemPosition(b())+1}function b(){return i.appInstance().getCurrentItem().reference}function I(t){return i.appInstance().getTags()[t||b()]||[]}},1570:(t,e,n)=>{n.r(e),n.d(e,{dialog:()=>r,hideDialog:()=>a,isResponsiveMode:()=>c,isReviewScreen:()=>u,navigate:()=>f,next:()=>p,previous:()=>l,review:()=>d,submit:()=>m});var i=n(2844),o=n(3191),s=n(7484);function r(t){i.assessApp().dialogs().custom.show(t)}function a(){i.assessApp().dialogs().custom.hide()}function c(){return Boolean(document.querySelector(".has-menu-region"))}function u(){let t=!1;setTimeout((()=>(null===document.getElementsByClassName("review-screen")[0].getAttribute("aria-hidden")&&(t=!0),t)),500)}function f(t){switch(t){case"previous":i.appInstance().items().previous();break;case"next":o.isLastItem()||i.appInstance().items().next();break;case"review":null===document.getElementsByClassName("review-screen")[0].getAttribute("aria-hidden")?i.appInstance().dialogs().reviewScreen.hide():i.appInstance().dialogs().reviewScreen.show();break;case"submit":let e={show_submit_confirmation:!0,show_submit_ui:!0,success:function(t){alert("Test saved!")},error:function(t){alert("Test submit failed...check browser log"),console.log("Submission failed: ",t)}};i.appInstance().submit(e);break;default:"number"==typeof Number(t)&&Number(t)>=0?i.appInstance().items().goto(Number(t)):s.A.warn(`Invalid target (${t})`)}}function p(){f("next")}function l(){f("previous")}function d(){f("review")}function m(){f("submit")}},7066:(t,e,n)=>{n.r(e),n.d(e,{hasCheckAnswer:()=>a,isAutoScorable:()=>c,question:()=>u,questionInstance:()=>f,questionResponse:()=>l,questionResponseIds:()=>d,questionScore:()=>m,questions:()=>p});var i=n(2844),o=n(3191),s=n(7738),r=n(7484);function a(t){if(!c(t))return!1;const e=(0,s.activity)()?.config?.questions_api_init_options?.attribute_overrides&&(0,s.activity)().config.questions_api_init_options.attribute_overrides.hasOwnProperty("instant_feedback")&&"boolean"==typeof(0,s.activity)().config.questions_api_init_options.attribute_overrides.instant_feedback,n=u(t);return e?(0,s.activity)().config.questions_api_init_options.attribute_overrides.instant_feedback:!(!n.hasOwnProperty("instant_feedback")||"boolean"!=typeof n.instant_feedback)&&n.instant_feedback}function c(t){return u(t),f(t).checkValidation().has_validation}function u(t){let e=t||d()[0];return e?i.appInstance().question(e).getQuestion():(r.A.error(`Question not found (index ${e})`),{})}function f(t){let e=t||d()[0];return e?i.appInstance().question(e):{}}function p(){return o.item().questions}function l(t){let e=t||d()[0];return e?function(t){return i.appInstance().question(t)?i.appInstance().question(t).getResponse():void r.A.error(`Response not found ${t}`)}(e):{}}function d(){return p().map((t=>t.response_id))}function m(t){let e=t||d()[0];return e&&i.appInstance().getScores()[e]||{}}},8511:(t,e,n)=>{n.r(e),n.d(e,{isFirstItemInSection:()=>s,isLastItemInSection:()=>r,section:()=>a,sectionHasShuffledItems:()=>c,sectionIndex:()=>u,sectionItemPosition:()=>f,sections:()=>p,totalItemsInSection:()=>l});var i=n(7738),o=n(3191);function s(){return 1===f()}function r(){return f()===l()}function a(){if(i.hasSections()){const t=o.itemReference(),e=p();let n=-1,i=!1;for(let o=0;o{n.d(e,{A:()=>i});const i={debug:function(t,e){"DEBUG"===e&&console.log(t)},error:function(t){console.error("%cError:%c "+t,"display:inline-block;background-color:#e0005a;color:#fff;font-weight:bold;padding:3px 7px;border-radius:3px","")},info:function(t){console.info("%cInfo:%c "+t,"display:inline-block;background-color:#46C0FF;color:#000;font-weight:bold;padding:3px 7px;border-radius:3px","")},log:function(t){console.log(t)},warn:function(t,e="log"){console.warn("%cWarning:%c "+t,"display:inline-block;background-color:gold;color:#000;font-weight:bold;padding:3px 7px;border-radius:3px","")}}}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};n.d(i,{LT:()=>a});var o=n(2844),s=n(7738),r=n(1634);const a={...o,...n(3191),...s,...n(1570),...n(7066),...n(8511),...r,utils:{logger:n(7484).A}};var c=i.LT;export{c as LT}; \ No newline at end of file +var t={7738:(t,e,n)=>{n.r(e),n.d(e,{activity:()=>r,activityId:()=>a,activitySubTitle:()=>f,activityTags:()=>p,activityTemplateId:()=>c,activityTitle:()=>u,adaptiveType:()=>l,annotationsConfig:()=>d,autoSaveConfig:()=>m,elapsedTime:()=>g,hasActivityTemplate:()=>v,hasAnnotations:()=>h,hasAutoSave:()=>y,hasEvents:()=>b,hasItemPool:()=>I,hasResourceItems:()=>A,hasSections:()=>w,hasShuffledItems:()=>_,hasTryAgain:()=>S,isAdaptive:()=>k,isResuming:()=>q,itemBank:()=>P,itemPool:()=>T,maxTime:()=>x,region:()=>O,resourceItems:()=>R,sessionId:()=>B,state:()=>E,timeRemaining:()=>C,totalItems:()=>F,userId:()=>W});var i=n(2844),o=n(8511),s=n(7484);function r(){return i.appInstance().getActivity()}function a(){return r().activity_id}function c(){return r().activity_template_id}function u(){return r().config.title}function f(){return r().config.subtitle}function p(){return i.appInstance().getTags()}function l(){return k()&&r().adaptive.hasOwnProperty("type")?r().adaptive.type:""}function d(){return h()&&r()?.config?.annotations_api_init_options?r().config.annotations_api_init_options:{}}function m(){const t=r();return t?.config?.navigation?.auto_save?t.config.navigation.auto_save:{}}function g(){return i.appInstance().getTime()}function v(){return r().hasOwnProperty("activity_template_id")}function h(){const t=r();return Boolean(!0===t?.config?.annotations||t?.config?.annotations_api_init_options)}function y(){const t=r();return t.hasOwnProperty("config")&&t.config.hasOwnProperty("navigation")&&t.config.navigation.hasOwnProperty("auto_save")&&!1!==t.config.navigation.auto_save}function _(){return Boolean(r()?.config?.configuration?.shuffle_items)}function b(){const t=r();return t.hasOwnProperty("events")&&!1!==t.events}function I(){return r().hasOwnProperty("item_pool_id")}function A(){return Boolean(r()?.config?.navigation?.resource_items)}function w(){return r().hasOwnProperty("sections")}function S(){return r()?.dynamic_items.hasOwnProperty("try_again")}function k(){return r().hasOwnProperty("adaptive")}function q(){return r().existing_session}function P(){return r()?.organisation_id}function T(){return r()?.item_pool_id}function x(){return r()?.config?.time?.max_time?r().config.time.max_time:0}function O(){return r()?.config?.regions}function R(){return r()?.config?.navigation?.resource_items}function B(){return r()?.session_id}function E(){let t;return t=void 0===r()?.state?"initial":r().state,t}function C(){return 0===x()?null:x()-g()}function F(){if(w()){let t=0,e=o.sections();for(let n=0;n{n.r(e),n.d(e,{annotationsApp:()=>c,appInstance:()=>a,assessApp:()=>u,eventsApp:()=>f,init:()=>r,questionsApp:()=>p});var i=n(1634),o=n(7066);const s={};function r(t){s.app=t,s.app.on("all",(t=>{(0,i.handleEvent)(t)})),s.app.on("item:load",(t=>{(0,o.questionResponseIds)().forEach((t=>{s.app.question(t).on("changed",(t=>{(0,i.handleEvent)("changed")}))}))}))}function a(){return s.app}function c(){return void 0!==a().annotationsApp()?a().annotationsApp():null}function u(){return a().assessApp()}function f(){return a().eventsApp()}function p(){return a().questionsApp()}},1634:(t,e,n)=>{n.r(e),n.d(e,{diagnostics:()=>c,filterEvent:()=>u,handleEvent:()=>f,listen:()=>p});var i=n(2844),o=n(7738),s=n(7484);const r="2.14.2",a={events:{broadcast:!1,listenFor:"item"}};function c(){let t=window.LearnosityApp?LearnosityApp.versions:{};return{apps:{annotations:{app:i.annotationsApp(),config:o.annotationsConfig(),enabled:o.hasAnnotations()},assess:{app:i.assessApp()},events:{app:i.eventsApp(),enabled:o.hasEvents()},items:{app:i.appInstance(),metadata:o.activity().config.metadata},questions:{app:i.questionsApp()}},activity:{activity:o.activityId(),activityTemplate:o.activityTemplateId(),autoSave:{config:o.autoSaveConfig(),enabled:o.hasAutoSave()},itemBank:o.itemBank(),itemPool:o.itemPool(),session:o.sessionId(),state:o.state(),type:o.activity().type,user:o.userId()},LT:{version:r},versions:t}}function u(t){/^[a-zA-Z:*]*$/.test(t)?a.events.listenFor=t:s.A.warn("Invalid event type")}function f(t){if(a.events.broadcast){const e=a.events.listenFor,n=e.replaceAll("*","");1===e.length&&"*"===e||"all"===e?s.A.info(t):e.startsWith("*")&&!e.endsWith("*")?t.endsWith(n)&&s.A.info(t):e.endsWith("*")&&!e.startsWith("*")?t.startsWith(n)&&s.A.info(t):e.startsWith("*")&&e.endsWith("*")?t.includes(n)&&s.A.info(t):t.startsWith(n)&&s.A.info(t)}}function p(t=!0){a.events.broadcast=Boolean(t),Boolean(t)?s.A.info(`👂 listening for '${a.events.listenFor}'`):s.A.info("🚫👂 not listening")}},3191:(t,e,n)=>{n.r(e),n.d(e,{dynamic:()=>a,flag:()=>c,isDynamicItem:()=>u,isFirstItem:()=>f,isFlagged:()=>l,isItemFullyAttempted:()=>d,isLastItem:()=>p,isMaskingEnabled:()=>m,item:()=>g,itemAttemptStatus:()=>v,itemByResponseId:()=>h,itemElement:()=>y,itemPosition:()=>_,itemReference:()=>b,itemTags:()=>I});var i=n(2844),o=n(7738),s=n(7066),r=n(8511);function a(){const t=b();return i.assessApp().item(t).dynamic||{}}function c(){const t=b();i.assessApp().item(t).flag()}function u(){return g()?.source.hasOwnProperty("data_table_seed")}function f(){let t;return o.hasSections()?(t="object"==typeof r.sections()[0].items[0]?r.sections()[0].items[0].reference:r.sections()[0].items[0],t===g().reference):(t="object"==typeof o.activity().items[0]?o.activity().items[0].reference:o.activity().items[0],t===g().reference)}function p(){return g().is_last_item}function l(){return g().user_flagged}function d(t){let e,n,o;if(e=t?i.appInstance().getItems()[t].questions:s.questions(),Array.isArray(e)&&e.length)for(let t=0;tvoid 0===t)).length)return!1;if(o.value.filter((t=>null===t)).length)return!1}n=!0}else n=!0;return n}function m(){return Boolean(document.querySelector(".lrn-masking"))}function g(t){return t?i.appInstance().getItems()[t]:i.appInstance().getCurrentItem()}function v(){return i.appInstance().getCurrentItem().attempt_status}function h(t){const e=i.appInstance().getItems();let n;for(const i in e)if(e[i].response_ids.includes(t)){n=e[i];break}return n}function y(){return document.querySelector(`div[data-reference='${b()}']`)}function _(){return i.appInstance().assessApp().getItemPosition(b())+1}function b(){return i.appInstance().getCurrentItem().reference}function I(t){return i.appInstance().getTags()[t||b()]||[]}},1570:(t,e,n)=>{n.r(e),n.d(e,{dialog:()=>r,hideDialog:()=>a,isResponsiveMode:()=>c,isReviewScreen:()=>u,navigate:()=>f,next:()=>p,previous:()=>l,review:()=>d,submit:()=>m});var i=n(2844),o=n(3191),s=n(7484);function r(t){i.assessApp().dialogs().custom.show(t)}function a(){i.assessApp().dialogs().custom.hide()}function c(){return Boolean(document.querySelector(".has-menu-region"))}function u(){let t=!1;setTimeout((()=>(null===document.getElementsByClassName("review-screen")[0].getAttribute("aria-hidden")&&(t=!0),t)),500)}function f(t){switch(t){case"previous":i.appInstance().items().previous();break;case"next":o.isLastItem()||i.appInstance().items().next();break;case"review":null===document.getElementsByClassName("review-screen")[0].getAttribute("aria-hidden")?i.appInstance().dialogs().reviewScreen.hide():i.appInstance().dialogs().reviewScreen.show();break;case"submit":let e={show_submit_confirmation:!0,show_submit_ui:!0,success:function(t){alert("Test saved!")},error:function(t){alert("Test submit failed...check browser log"),console.log("Submission failed: ",t)}};i.appInstance().submit(e);break;default:"number"==typeof Number(t)&&Number(t)>=0?i.appInstance().items().goto(Number(t)):s.A.warn(`Invalid target (${t})`)}}function p(){f("next")}function l(){f("previous")}function d(){f("review")}function m(){f("submit")}},7066:(t,e,n)=>{n.r(e),n.d(e,{hasCheckAnswer:()=>a,isAutoScorable:()=>c,question:()=>u,questionInstance:()=>f,questionResponse:()=>l,questionResponseIds:()=>d,questionScore:()=>m,questions:()=>p});var i=n(2844),o=n(3191),s=n(7738),r=n(7484);function a(t){if(!c(t))return!1;const e=(0,s.activity)()?.config?.questions_api_init_options?.attribute_overrides&&(0,s.activity)().config.questions_api_init_options.attribute_overrides.hasOwnProperty("instant_feedback")&&"boolean"==typeof(0,s.activity)().config.questions_api_init_options.attribute_overrides.instant_feedback,n=u(t);return e?(0,s.activity)().config.questions_api_init_options.attribute_overrides.instant_feedback:!(!n.hasOwnProperty("instant_feedback")||"boolean"!=typeof n.instant_feedback)&&n.instant_feedback}function c(t){return u(t),f(t).checkValidation().has_validation}function u(t){let e=t||d()[0];return e?i.appInstance().question(e).getQuestion():(r.A.error(`Question not found (index ${e})`),{})}function f(t){let e=t||d()[0];return e?i.appInstance().question(e):{}}function p(){return o.item().questions}function l(t){let e=t||d()[0];return e?function(t){return i.appInstance().question(t)?i.appInstance().question(t).getResponse():void r.A.error(`Response not found ${t}`)}(e):{}}function d(){return p().map((t=>t.response_id))}function m(t){let e=t||d()[0];return e&&i.appInstance().getScores()[e]||{}}},8511:(t,e,n)=>{n.r(e),n.d(e,{isFirstItemInSection:()=>s,isLastItemInSection:()=>r,section:()=>a,sectionHasShuffledItems:()=>c,sectionIndex:()=>u,sectionItemPosition:()=>f,sections:()=>p,totalItemsInSection:()=>l});var i=n(7738),o=n(3191);function s(){return 1===f()}function r(){return f()===l()}function a(){if(i.hasSections()){const t=o.itemReference(),e=p();let n=-1,i=!1;for(let o=0;o{n.d(e,{A:()=>i});const i={debug:function(t,e){"DEBUG"===e&&console.log(t)},error:function(t){console.error("%cError:%c "+t,"display:inline-block;background-color:#e0005a;color:#fff;font-weight:bold;padding:3px 7px;border-radius:3px","")},info:function(t){console.info("%cInfo:%c "+t,"display:inline-block;background-color:#46C0FF;color:#000;font-weight:bold;padding:3px 7px;border-radius:3px","")},log:function(t){console.log(t)},warn:function(t,e="log"){console.warn("%cWarning:%c "+t,"display:inline-block;background-color:gold;color:#000;font-weight:bold;padding:3px 7px;border-radius:3px","")}}}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};n.d(i,{LT:()=>a});var o=n(2844),s=n(7738),r=n(1634);const a={...o,...n(3191),...s,...n(1570),...n(7066),...n(8511),...r,utils:{logger:n(7484).A}};var c=i.LT;export{c as LT}; \ No newline at end of file diff --git a/dist/assessment/index.js b/dist/assessment/index.js index fb370b7..2df8c81 100644 --- a/dist/assessment/index.js +++ b/dist/assessment/index.js @@ -1,2 +1,2 @@ /*! For license information please see index.js.LICENSE.txt */ -var t,e,n,r,i={4196:(t,e,n)=>{var r;!function(){var i=function(){this.init()};i.prototype={init:function(){var t=this||s;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var e=this||s;if(t=parseFloat(t),e.ctx||p(),void 0!==t&&t>=0&&t<=1){if(e._volume=t,e._muted)return e;e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t,s.ctx.currentTime);for(var n=0;n=0;e--)t._howls[e].unload();return t.usingWebAudio&&t.ctx&&void 0!==t.ctx.close&&(t.ctx.close(),t.ctx=null,p()),t},codecs:function(t){return(this||s)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||s;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(e){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(t){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||s,e=null;try{e="undefined"!=typeof Audio?new Audio:null}catch(e){return t}if(!e||"function"!=typeof e.canPlayType)return t;var n=e.canPlayType("audio/mpeg;").replace(/^no$/,""),r=t._navigator?t._navigator.userAgent:"",i=r.match(/OPR\/(\d+)/g),a=i&&parseInt(i[0].split("/")[1],10)<33,o=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),l=r.match(/Version\/(.*?) /),c=o&&l&&parseInt(l[1],10)<15;return t._codecs={mp3:!(a||!n&&!e.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(e.canPlayType('audio/wav; codecs="1"')||e.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!e.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!e.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(e.canPlayType("audio/x-m4b;")||e.canPlayType("audio/m4b;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(e.canPlayType("audio/x-mp4;")||e.canPlayType("audio/mp4;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(c||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!e.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(e.canPlayType("audio/x-flac;")||e.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||s;if(!t._audioUnlocked&&t.ctx){t._audioUnlocked=!1,t.autoUnlock=!1,t._mobileUnloaded||44100===t.ctx.sampleRate||(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var e=function(n){for(;t._html5AudioPool.length0?o._seek:n._sprite[t][0]/1e3),d=Math.max(0,(n._sprite[t][0]+n._sprite[t][1])/1e3-c),h=1e3*d/Math.abs(o._rate),u=n._sprite[t][0]/1e3,p=(n._sprite[t][0]+n._sprite[t][1])/1e3;o._sprite=t,o._ended=!1;var f=function(){o._paused=!1,o._seek=c,o._start=u,o._stop=p,o._loop=!(!o._loop&&!n._sprite[t][2])};if(!(c>=p)){var m=o._node;if(n._webAudio){var g=function(){n._playLock=!1,f(),n._refreshBuffer(o);var t=o._muted||n._muted?0:o._volume;m.gain.setValueAtTime(t,s.ctx.currentTime),o._playStart=s.ctx.currentTime,void 0===m.bufferSource.start?o._loop?m.bufferSource.noteGrainOn(0,c,86400):m.bufferSource.noteGrainOn(0,c,d):o._loop?m.bufferSource.start(0,c,86400):m.bufferSource.start(0,c,d),h!==1/0&&(n._endTimers[o._id]=setTimeout(n._ended.bind(n,o),h)),e||setTimeout((function(){n._emit("play",o._id),n._loadQueue()}),0)};"running"===s.state&&"interrupted"!==s.ctx.state?g():(n._playLock=!0,n.once("resume",g),n._clearTimer(o._id))}else{var v=function(){m.currentTime=c,m.muted=o._muted||n._muted||s._muted||m.muted,m.volume=o._volume*s.volume(),m.playbackRate=o._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(n._playLock=!0,f(),r.then((function(){n._playLock=!1,m._unlocked=!0,e?n._loadQueue():n._emit("play",o._id)})).catch((function(){n._playLock=!1,n._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0}))):e||(n._playLock=!1,f(),n._emit("play",o._id)),m.playbackRate=o._rate,m.paused)return void n._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==t||o._loop?n._endTimers[o._id]=setTimeout(n._ended.bind(n,o),h):(n._endTimers[o._id]=function(){n._ended(o),m.removeEventListener("ended",n._endTimers[o._id],!1)},m.addEventListener("ended",n._endTimers[o._id],!1))}catch(t){n._emit("playerror",o._id,t)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=n._src,m.load());var b=window&&window.ejecta||!m.readyState&&s._navigator.isCocoonJS;if(m.readyState>=3||b)v();else{n._playLock=!0,n._state="loading";var y=function(){n._state="loaded",v(),m.removeEventListener(s._canPlayEvent,y,!1)};m.addEventListener(s._canPlayEvent,y,!1),n._clearTimer(o._id)}}return o._id}n._ended(o)},pause:function(t){var e=this;if("loaded"!==e._state||e._playLock)return e._queue.push({event:"pause",action:function(){e.pause(t)}}),e;for(var n=e._getSoundIds(t),r=0;r=0?e=parseInt(i[0],10):t=parseFloat(i[0]):i.length>=2&&(t=parseFloat(i[0]),e=parseInt(i[1],10)),!(void 0!==t&&t>=0&&t<=1))return(n=e?r._soundById(e):r._sounds[0])?n._volume:0;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"volume",action:function(){r.volume.apply(r,i)}}),r;void 0===e&&(r._volume=t),e=r._getSoundIds(e);for(var a=0;a0?r/c:r),h=Date.now();t._fadeTo=n,t._interval=setInterval((function(){var i=(Date.now()-h)/r;h=Date.now(),o+=l*i,o=Math.round(100*o)/100,o=l<0?Math.max(n,o):Math.min(n,o),a._webAudio?t._volume=o:a.volume(o,t._id,!0),s&&(a._volume=o),(ne&&o>=n)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,a.volume(n,t._id),a._emit("fade",t._id))}),d)},_stopFade:function(t){var e=this,n=e._soundById(t);return n&&n._interval&&(e._webAudio&&n._node.gain.cancelScheduledValues(s.ctx.currentTime),clearInterval(n._interval),n._interval=null,e.volume(n._fadeTo,t),n._fadeTo=null,e._emit("fade",t)),e},loop:function(){var t,e,n,r=this,i=arguments;if(0===i.length)return r._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=r._soundById(parseInt(i[0],10)))&&n._loop;t=i[0],r._loop=t}else 2===i.length&&(t=i[0],e=parseInt(i[1],10));for(var s=r._getSoundIds(e),a=0;a=0?e=parseInt(i[0],10):t=parseFloat(i[0]):2===i.length&&(t=parseFloat(i[0]),e=parseInt(i[1],10)),"number"!=typeof t)return(n=r._soundById(e))?n._rate:r._rate;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"rate",action:function(){r.rate.apply(r,i)}}),r;void 0===e&&(r._rate=t),e=r._getSoundIds(e);for(var a=0;a=0?e=parseInt(r[0],10):n._sounds.length&&(e=n._sounds[0]._id,t=parseFloat(r[0])):2===r.length&&(t=parseFloat(r[0]),e=parseInt(r[1],10)),void 0===e)return 0;if("number"==typeof t&&("loaded"!==n._state||n._playLock))return n._queue.push({event:"seek",action:function(){n.seek.apply(n,r)}}),n;var i=n._soundById(e);if(i){if(!("number"==typeof t&&t>=0)){if(n._webAudio){var a=n.playing(e)?s.ctx.currentTime-i._playStart:0,o=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(o+a*Math.abs(i._rate))}return i._node.currentTime}var l=n.playing(e);l&&n.pause(e,!0),i._seek=t,i._ended=!1,n._clearTimer(e),n._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=t);var c=function(){l&&n.play(e,!0),n._emit("seek",e)};if(l&&!n._webAudio){var d=function(){n._playLock?setTimeout(d,0):c()};setTimeout(d,0)}else c()}return n},playing:function(t){var e=this;if("number"==typeof t){var n=e._soundById(t);return!!n&&!n._paused}for(var r=0;r=0&&s._howls.splice(r,1);var i=!0;for(n=0;n=0){i=!1;break}return l&&i&&delete l[t._src],s.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,e,n,r){var i=this["_on"+t];return"function"==typeof e&&i.push(r?{id:n,fn:e,once:r}:{id:n,fn:e}),this},off:function(t,e,n){var r=this,i=r["_on"+t],s=0;if("number"==typeof e&&(n=e,e=null),e||n)for(s=0;s=0;s--)i[s].id&&i[s].id!==e&&"load"!==t||(setTimeout(function(t){t.call(this,e,n)}.bind(r,i[s].fn),0),i[s].once&&r.off(t,i[s].fn,i[s].id));return r._loadQueue(t),r},_loadQueue:function(t){var e=this;if(e._queue.length>0){var n=e._queue[0];n.event===t&&(e._queue.shift(),e._loadQueue()),t||n.action()}return e},_ended:function(t){var e=this,n=t._sprite;if(!e._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime=0;r--){if(n<=e)return;t._sounds[r]._ended&&(t._webAudio&&t._sounds[r]._node&&t._sounds[r]._node.disconnect(0),t._sounds.splice(r,1),n--)}}},_getSoundIds:function(t){if(void 0===t){for(var e=[],n=0;n=0;if(!t.bufferSource)return this;if(s._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),e))try{t.bufferSource.buffer=s._scratchBuffer}catch(t){}return t.bufferSource=null,this},_clearSound:function(t){/MSIE |Trident\//.test(s._navigator&&s._navigator.userAgent)||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var o=function(t){this._parent=t,this.init()};o.prototype={init:function(){var t=this,e=t._parent;return t._muted=e._muted,t._loop=e._loop,t._volume=e._volume,t._rate=e._rate,t._seek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++s._counter,e._sounds.push(t),t.create(),t},create:function(){var t=this,e=t._parent,n=s._muted||t._muted||t._parent._muted?0:t._volume;return e._webAudio?(t._node=void 0===s.ctx.createGain?s.ctx.createGainNode():s.ctx.createGain(),t._node.gain.setValueAtTime(n,s.ctx.currentTime),t._node.paused=!0,t._node.connect(s.masterGain)):s.noAudio||(t._node=s._obtainHtml5Audio(),t._errorFn=t._errorListener.bind(t),t._node.addEventListener("error",t._errorFn,!1),t._loadFn=t._loadListener.bind(t),t._node.addEventListener(s._canPlayEvent,t._loadFn,!1),t._endFn=t._endListener.bind(t),t._node.addEventListener("ended",t._endFn,!1),t._node.src=e._src,t._node.preload=!0===e._preload?"auto":e._preload,t._node.volume=n*s.volume(),t._node.load()),t},reset:function(){var t=this,e=t._parent;return t._muted=e._muted,t._loop=e._loop,t._volume=e._volume,t._rate=e._rate,t._seek=0,t._rateSeek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++s._counter,t},_errorListener:function(){var t=this;t._parent._emit("loaderror",t._id,t._node.error?t._node.error.code:0),t._node.removeEventListener("error",t._errorFn,!1)},_loadListener:function(){var t=this,e=t._parent;e._duration=Math.ceil(10*t._node.duration)/10,0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue()),t._node.removeEventListener(s._canPlayEvent,t._loadFn,!1)},_endListener:function(){var t=this,e=t._parent;e._duration===1/0&&(e._duration=Math.ceil(10*t._node.duration)/10,e._sprite.__default[1]===1/0&&(e._sprite.__default[1]=1e3*e._duration),e._ended(t)),t._node.removeEventListener("ended",t._endFn,!1)}};var l={},c=function(t){var e=t._src;if(l[e])return t._duration=l[e].duration,void u(t);if(/^data:[^;]+;base64,/.test(e)){for(var n=atob(e.split(",")[1]),r=new Uint8Array(n.length),i=0;i0?(l[e._src]=t,u(e,t)):n()};"undefined"!=typeof Promise&&1===s.ctx.decodeAudioData.length?s.ctx.decodeAudioData(t).then(r).catch(n):s.ctx.decodeAudioData(t,r,n)},u=function(t,e){e&&!t._duration&&(t._duration=e.duration),0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue())},p=function(){if(s.usingWebAudio){try{"undefined"!=typeof AudioContext?s.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?s.ctx=new webkitAudioContext:s.usingWebAudio=!1}catch(t){s.usingWebAudio=!1}s.ctx||(s.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(s._navigator&&s._navigator.platform),e=s._navigator&&s._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),n=e?parseInt(e[1],10):null;if(t&&n&&n<9){var r=/safari/.test(s._navigator&&s._navigator.userAgent.toLowerCase());s._navigator&&!r&&(s.usingWebAudio=!1)}s.usingWebAudio&&(s.masterGain=void 0===s.ctx.createGain?s.ctx.createGainNode():s.ctx.createGain(),s.masterGain.gain.setValueAtTime(s._muted?0:s._volume,s.ctx.currentTime),s.masterGain.connect(s.ctx.destination)),s._setup()}};void 0===(r=function(){return{Howler:s,Howl:a}}.apply(e,[]))||(t.exports=r),e.Howler=s,e.Howl=a,void 0!==n.g?(n.g.HowlerGlobal=i,n.g.Howler=s,n.g.Howl=a,n.g.Sound=o):"undefined"!=typeof window&&(window.HowlerGlobal=i,window.Howler=s,window.Howl=a,window.Sound=o)}(),function(){var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var n=e._howls.length-1;n>=0;n--)e._howls[n].stereo(t);return e},HowlerGlobal.prototype.pos=function(t,e,n){var r=this;return r.ctx&&r.ctx.listener?(e="number"!=typeof e?r._pos[1]:e,n="number"!=typeof n?r._pos[2]:n,"number"!=typeof t?r._pos:(r._pos=[t,e,n],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(t,e,n,r,i,s){var a=this;if(!a.ctx||!a.ctx.listener)return a;var o=a._orientation;return e="number"!=typeof e?o[1]:e,n="number"!=typeof n?o[2]:n,r="number"!=typeof r?o[3]:r,i="number"!=typeof i?o[4]:i,s="number"!=typeof s?o[5]:s,"number"!=typeof t?o:(a._orientation=[t,e,n,r,i,s],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(s,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(t,e,n,r,i,s),a)},Howl.prototype.init=(t=Howl.prototype.init,function(e){var n=this;return n._orientation=e.orientation||[1,0,0],n._stereo=e.stereo||null,n._pos=e.pos||null,n._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},n._onstereo=e.onstereo?[{fn:e.onstereo}]:[],n._onpos=e.onpos?[{fn:e.onpos}]:[],n._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,n){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(t,n)}}),r;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof t)return r._stereo;r._stereo=t,r._pos=[t,0,0]}for(var s=r._getSoundIds(n),a=0;a{var r;!function(i,s,a){if(i){for(var o,l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},c={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},d={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},h={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},u=1;u<20;++u)l[111+u]="f"+u;for(u=0;u<=9;++u)l[u+96]=u.toString();y.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},y.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},y.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},y.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},y.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(b(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},y.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},y.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(l[e]=t[e]);o=null},y.init=function(){var t=y(s);for(var e in t)"_"!==e.charAt(0)&&(y[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},y.init(),i.Mousetrap=y,t.exports&&(t.exports=y),void 0===(r=function(){return y}.call(e,n,e,t))||(t.exports=r)}function p(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function f(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return l[t.which]?l[t.which]:c[t.which]?c[t.which]:String.fromCharCode(t.which).toLowerCase()}function m(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function g(t,e,n){return n||(n=function(){if(!o)for(var t in o={},l)t>95&&t<112||l.hasOwnProperty(t)&&(o[l[t]]=t);return o}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function v(t,e){var n,r,i,s=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),i=0;i1?function(t,e,s,a){function c(e){return function(){o=e,++r[t],clearTimeout(n),n=setTimeout(l,1e3)}}function h(e){d(s,e,t),"keyup"!==a&&(i=f(e)),setTimeout(l,10)}r[t]=0;for(var p=0;p0,s.tv=i.includes("TV"),l=navigator.getGamepads?Array.from(navigator.getGamepads()).filter((function(t){return null!=t})).length:0,s.gamepad=l>0,t("(orientation: portrait)",(function(t){s.portrait=t,s.landscape=!t,s.orientation=t?"portrait":"landscape",o("portrait",s.portrait),o("landscape",s.landscape),o("orientation",s.orientation)})),t("(any-pointer: coarse)",(function(t){e("touch",t),e("formfactor",d())&&c()})),t("(hover: hover)",(function(t){e("mouse",t),e("input",t?"mouse":"touch"),e("formfactor",d())&&c()}))}}return s.csp=s.uwp||!1,s.nwjs?s.dev="sdk"===process.versions["nw-flavor"]:s.electron?s.dev=process.execPath.replace(/\\/g,"/").includes("node_modules/electron/"):s.uwp?s.dev=Windows.ApplicationModel.Package.current.isDevelopmentMode:s.node?s.dev=!1:s.dev=void 0,s}()},7391:(t,e,n)=>{var r=n(7180),i=n(3181),s=n(3031),a=n(9067),o=n(6833),l=n(3717),c=n(4801);c.alea=r,c.xor128=i,c.xorwow=s,c.xorshift7=a,c.xor4096=o,c.tychei=l,t.exports=c},7180:function(t,e,n){var r;!function(t,i,s){function a(t){var e,n=this,r=(e=4022871197,function(t){t=t.toString();for(var n=0;n>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(t),n.s0<0&&(n.s0+=1),n.s1-=r(t),n.s1<0&&(n.s1+=1),n.s2-=r(t),n.s2<0&&(n.s2+=1),r=null}function o(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function l(t,e){var n=new a(t),r=e&&e.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,r&&("object"==typeof r&&o(r,n),i.state=function(){return o(n,{})}),i}i&&i.exports?i.exports=l:n.amdD&&n.amdO?void 0===(r=function(){return l}.call(e,n,e,i))||(i.exports=r):this.alea=l}(0,t=n.nmd(t),n.amdD)},3717:function(t,e,n){var r;!function(t,i,s){function a(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,r=e.d,i=e.a;return t=t<<25^t>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-r|0,e.d=r<<16^n>>>16^i,e.a=i-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&o(r,n),i.state=function(){return o(n,{})}),i}i&&i.exports?i.exports=l:n.amdD&&n.amdO?void 0===(r=function(){return l}.call(e,n,e,i))||(i.exports=r):this.tychei=l}(0,t=n.nmd(t),n.amdD)},3181:function(t,e,n){var r;!function(t,i,s){function a(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&o(r,n),i.state=function(){return o(n,{})}),i}i&&i.exports?i.exports=l:n.amdD&&n.amdO?void 0===(r=function(){return l}.call(e,n,e,i))||(i.exports=r):this.xor128=l}(0,t=n.nmd(t),n.amdD)},6833:function(t,e,n){var r;!function(t,i,s){function a(t){var e=this;e.next=function(){var t,n,r=e.w,i=e.X,s=e.i;return e.w=r=r+1640531527|0,n=i[s+34&127],t=i[s=s+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=i[s]=n^t,e.i=s,n+(r^r>>>16)|0},function(t,e){var n,r,i,s,a,o=[],l=128;for(e===(0|e)?(r=e,e=null):(e+="\0",r=0,l=Math.max(l,e.length)),i=0,s=-32;s>>15,r^=r<<4,r^=r>>>13,s>=0&&(a=a+1640531527|0,i=0==(n=o[127&s]^=r+a)?i+1:0);for(i>=128&&(o[127&(e&&e.length||0)]=-1),i=127,s=512;s>0;--s)r=o[i+34&127],n=o[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,o[i]=r^n;t.w=a,t.X=o,t.i=i}(e,t)}function o(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function l(t,e){null==t&&(t=+new Date);var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&(r.X&&o(r,n),i.state=function(){return o(n,{})}),i}i&&i.exports?i.exports=l:n.amdD&&n.amdO?void 0===(r=function(){return l}.call(e,n,e,i))||(i.exports=r):this.xor4096=l}(0,t=n.nmd(t),n.amdD)},9067:function(t,e,n){var r;!function(t,i,s){function a(t){var e=this;e.next=function(){var t,n,r=e.x,i=e.i;return t=r[i],n=(t^=t>>>7)^t<<24,n^=(t=r[i+1&7])^t>>>10,n^=(t=r[i+3&7])^t>>>3,n^=(t=r[i+4&7])^t<<7,t=r[i+7&7],n^=(t^=t<<13)^t<<9,r[i]=n,e.i=i+1&7,n},function(t,e){var n,r=[];if(e===(0|e))r[0]=e;else for(e=""+e,n=0;n0;--n)t.next()}(e,t)}function o(t,e){return e.x=t.x.slice(),e.i=t.i,e}function l(t,e){null==t&&(t=+new Date);var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&(r.x&&o(r,n),i.state=function(){return o(n,{})}),i}i&&i.exports?i.exports=l:n.amdD&&n.amdO?void 0===(r=function(){return l}.call(e,n,e,i))||(i.exports=r):this.xorshift7=l}(0,t=n.nmd(t),n.amdD)},3031:function(t,e,n){var r;!function(t,i,s){function a(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var r=0;r>>4),e.next()}function o(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function l(t,e){var n=new a(t),r=e&&e.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&o(r,n),i.state=function(){return o(n,{})}),i}i&&i.exports?i.exports=l:n.amdD&&n.amdO?void 0===(r=function(){return l}.call(e,n,e,i))||(i.exports=r):this.xorwow=l}(0,t=n.nmd(t),n.amdD)},4801:(t,e,n)=>{var r;!function(i,s){var a,o=(0,eval)("this"),l=256,c="random",d=s.pow(l,6),h=s.pow(2,52),u=2*h,p=l-1;function f(t,e,n){var r=[],p=b(v((e=1==e?{entropy:!0}:e||{}).entropy?[t,y(i)]:null==t?function(){try{var t;return a&&(t=a.randomBytes)?t=t(l):(t=new Uint8Array(l),(o.crypto||o.msCrypto).getRandomValues(t)),y(t)}catch(t){var e=o.navigator,n=e&&e.plugins;return[+new Date,o,n,o.screen,y(i)]}}():t,3),r),f=new m(r),_=function(){for(var t=f.g(6),e=d,n=0;t=u;)t/=2,e/=2,n>>>=1;return(t+n)/e};return _.int32=function(){return 0|f.g(4)},_.quick=function(){return f.g(4)/4294967296},_.double=_,b(y(f.S),i),(e.pass||n||function(t,e,n,r){return r&&(r.S&&g(r,f),t.state=function(){return g(f,{})}),n?(s[c]=t,e):t})(_,p,"global"in e?e.global:this==s,e.state)}function m(t){var e,n=t.length,r=this,i=0,s=r.i=r.j=0,a=r.S=[];for(n||(t=[n++]);i{n(7391);var r=n(2287);t.exports=r},2287:function(t){(function(){var e={};Math.seedrandom&&(seedrandom=Math.seedrandom);var n=function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=function(t){return/(number|string)/i.test(Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1])?t:isNaN(t)?Number(String(this.strSeed=t).split("").map((function(t){return t.charCodeAt(0)})).join("")):t},i=function(t,e,n){return Math.floor(t()*(n-e+1))+e};e.shuffle=function(t,e){if(!n(t))return null;e=r(e)||"none";for(var s=t.length,a=seedrandom(e),o=[],l=[],c=0;c{n.d(e,{LT:()=>a});var r=n(2844),i=n(7738),s=n(1634);const a={...r,...n(3191),...i,...n(1570),...n(7066),...n(8511),...s,utils:{logger:n(7484).A}}},7738:(t,e,n)=>{n.r(e),n.d(e,{activity:()=>a,activityId:()=>o,activitySubTitle:()=>d,activityTags:()=>h,activityTemplateId:()=>l,activityTitle:()=>c,adaptiveType:()=>u,annotationsConfig:()=>p,autoSaveConfig:()=>f,elapsedTime:()=>m,hasActivityTemplate:()=>g,hasAnnotations:()=>v,hasAutoSave:()=>b,hasEvents:()=>_,hasItemPool:()=>A,hasResourceItems:()=>w,hasSections:()=>x,hasShuffledItems:()=>y,hasTryAgain:()=>E,isAdaptive:()=>S,isResuming:()=>T,itemBank:()=>C,itemPool:()=>k,maxTime:()=>M,region:()=>I,resourceItems:()=>R,sessionId:()=>P,state:()=>D,timeRemaining:()=>L,totalItems:()=>F,userId:()=>O});var r=n(2844),i=n(8511),s=n(7484);function a(){return r.appInstance().getActivity()}function o(){return a().activity_id}function l(){return a().activity_template_id}function c(){return a().config.title}function d(){return a().config.subtitle}function h(){return r.appInstance().getTags()}function u(){return S()&&a().adaptive.hasOwnProperty("type")?a().adaptive.type:""}function p(){return v()&&a()?.config?.annotations_api_init_options?a().config.annotations_api_init_options:{}}function f(){const t=a();return t?.config?.navigation?.auto_save?t.config.navigation.auto_save:{}}function m(){return r.appInstance().getTime()}function g(){return a().hasOwnProperty("activity_template_id")}function v(){const t=a();return Boolean(!0===t?.config?.annotations||t?.config?.annotations_api_init_options)}function b(){const t=a();return t.hasOwnProperty("config")&&t.config.hasOwnProperty("navigation")&&t.config.navigation.hasOwnProperty("auto_save")&&!1!==t.config.navigation.auto_save}function y(){return Boolean(a()?.config?.configuration?.shuffle_items)}function _(){const t=a();return t.hasOwnProperty("events")&&!1!==t.events}function A(){return a().hasOwnProperty("item_pool_id")}function w(){return Boolean(a()?.config?.navigation?.resource_items)}function x(){return a().hasOwnProperty("sections")}function E(){return a()?.dynamic_items.hasOwnProperty("try_again")}function S(){return a().hasOwnProperty("adaptive")}function T(){return a().existing_session}function C(){return a()?.organisation_id}function k(){return a()?.item_pool_id}function M(){return a()?.config?.time?.max_time?a().config.time.max_time:0}function I(){return a()?.config?.regions}function R(){return a()?.config?.navigation?.resource_items}function P(){return a()?.session_id}function D(){let t;return t=void 0===a()?.state?"initial":a().state,t}function L(){return 0===M()?null:M()-m()}function F(){if(x()){let t=0,e=i.sections();for(let n=0;n{n.r(e),n.d(e,{annotationsApp:()=>l,appInstance:()=>o,assessApp:()=>c,eventsApp:()=>d,init:()=>a,questionsApp:()=>h});var r=n(1634),i=n(7066);const s={};function a(t){s.app=t,s.app.on("all",(t=>{(0,r.handleEvent)(t)})),s.app.on("item:load",(t=>{(0,i.questionResponseIds)().forEach((t=>{s.app.question(t).on("changed",(t=>{(0,r.handleEvent)("changed")}))}))}))}function o(){return s.app}function l(){return void 0!==o().annotationsApp()?o().annotationsApp():null}function c(){return o().assessApp()}function d(){return o().eventsApp()}function h(){return o().questionsApp()}},1634:(t,e,n)=>{n.r(e),n.d(e,{diagnostics:()=>l,filterEvent:()=>c,handleEvent:()=>d,listen:()=>h});var r=n(2844),i=n(7738),s=n(7484);const a="2.14.1",o={events:{broadcast:!1,listenFor:"item"}};function l(){let t=window.LearnosityApp?LearnosityApp.versions:{};return{apps:{annotations:{app:r.annotationsApp(),config:i.annotationsConfig(),enabled:i.hasAnnotations()},assess:{app:r.assessApp()},events:{app:r.eventsApp(),enabled:i.hasEvents()},items:{app:r.appInstance(),metadata:i.activity().config.metadata},questions:{app:r.questionsApp()}},activity:{activity:i.activityId(),activityTemplate:i.activityTemplateId(),autoSave:{config:i.autoSaveConfig(),enabled:i.hasAutoSave()},itemBank:i.itemBank(),itemPool:i.itemPool(),session:i.sessionId(),state:i.state(),type:i.activity().type,user:i.userId()},LT:{version:a},versions:t}}function c(t){/^[a-zA-Z:*]*$/.test(t)?o.events.listenFor=t:s.A.warn("Invalid event type")}function d(t){if(o.events.broadcast){const e=o.events.listenFor,n=e.replaceAll("*","");1===e.length&&"*"===e||"all"===e?s.A.info(t):e.startsWith("*")&&!e.endsWith("*")?t.endsWith(n)&&s.A.info(t):e.endsWith("*")&&!e.startsWith("*")?t.startsWith(n)&&s.A.info(t):e.startsWith("*")&&e.endsWith("*")?t.includes(n)&&s.A.info(t):t.startsWith(n)&&s.A.info(t)}}function h(t=!0){o.events.broadcast=Boolean(t),Boolean(t)?s.A.info(`👂 listening for '${o.events.listenFor}'`):s.A.info("🚫👂 not listening")}},3191:(t,e,n)=>{n.r(e),n.d(e,{dynamic:()=>o,flag:()=>l,isDynamicItem:()=>c,isFirstItem:()=>d,isFlagged:()=>u,isItemFullyAttempted:()=>p,isLastItem:()=>h,isMaskingEnabled:()=>f,item:()=>m,itemAttemptStatus:()=>g,itemByResponseId:()=>v,itemElement:()=>b,itemPosition:()=>y,itemReference:()=>_,itemTags:()=>A});var r=n(2844),i=n(7738),s=n(7066),a=n(8511);function o(){const t=_();return r.assessApp().item(t).dynamic||{}}function l(){const t=_();r.assessApp().item(t).flag()}function c(){return m()?.source.hasOwnProperty("data_table_seed")}function d(){let t;return i.hasSections()?(t="object"==typeof a.sections()[0].items[0]?a.sections()[0].items[0].reference:a.sections()[0].items[0],t===m().reference):(t="object"==typeof i.activity().items[0]?i.activity().items[0].reference:i.activity().items[0],t===m().reference)}function h(){return m().is_last_item}function u(){return m().user_flagged}function p(t){let e,n,i;if(e=t?r.appInstance().getItems()[t].questions:s.questions(),Array.isArray(e)&&e.length)for(let t=0;tvoid 0===t)).length)return!1;if(i.value.filter((t=>null===t)).length)return!1}n=!0}else n=!0;return n}function f(){return Boolean(document.querySelector(".lrn-masking"))}function m(t){return t?r.appInstance().getItems()[t]:r.appInstance().getCurrentItem()}function g(){return r.appInstance().getCurrentItem().attempt_status}function v(t){const e=r.appInstance().getItems();let n;for(const r in e)if(e[r].response_ids.includes(t)){n=e[r];break}return n}function b(){return document.querySelector(`div[data-reference='${_()}']`)}function y(){return r.appInstance().assessApp().getItemPosition(_())+1}function _(){return r.appInstance().getCurrentItem().reference}function A(t){return r.appInstance().getTags()[t||_()]||[]}},1570:(t,e,n)=>{n.r(e),n.d(e,{dialog:()=>a,hideDialog:()=>o,isResponsiveMode:()=>l,isReviewScreen:()=>c,navigate:()=>d,next:()=>h,previous:()=>u,review:()=>p,submit:()=>f});var r=n(2844),i=n(3191),s=n(7484);function a(t){r.assessApp().dialogs().custom.show(t)}function o(){r.assessApp().dialogs().custom.hide()}function l(){return Boolean(document.querySelector(".has-menu-region"))}function c(){let t=!1;setTimeout((()=>(null===document.getElementsByClassName("review-screen")[0].getAttribute("aria-hidden")&&(t=!0),t)),500)}function d(t){switch(t){case"previous":r.appInstance().items().previous();break;case"next":i.isLastItem()||r.appInstance().items().next();break;case"review":null===document.getElementsByClassName("review-screen")[0].getAttribute("aria-hidden")?r.appInstance().dialogs().reviewScreen.hide():r.appInstance().dialogs().reviewScreen.show();break;case"submit":let e={show_submit_confirmation:!0,show_submit_ui:!0,success:function(t){alert("Test saved!")},error:function(t){alert("Test submit failed...check browser log"),console.log("Submission failed: ",t)}};r.appInstance().submit(e);break;default:"number"==typeof Number(t)&&Number(t)>=0?r.appInstance().items().goto(Number(t)):s.A.warn(`Invalid target (${t})`)}}function h(){d("next")}function u(){d("previous")}function p(){d("review")}function f(){d("submit")}},7066:(t,e,n)=>{n.r(e),n.d(e,{hasCheckAnswer:()=>o,isAutoScorable:()=>l,question:()=>c,questionInstance:()=>d,questionResponse:()=>u,questionResponseIds:()=>p,questionScore:()=>f,questions:()=>h});var r=n(2844),i=n(3191),s=n(7738),a=n(7484);function o(t){if(!l(t))return!1;const e=(0,s.activity)()?.config?.questions_api_init_options?.attribute_overrides&&(0,s.activity)().config.questions_api_init_options.attribute_overrides.hasOwnProperty("instant_feedback")&&"boolean"==typeof(0,s.activity)().config.questions_api_init_options.attribute_overrides.instant_feedback,n=c(t);return e?(0,s.activity)().config.questions_api_init_options.attribute_overrides.instant_feedback:!(!n.hasOwnProperty("instant_feedback")||"boolean"!=typeof n.instant_feedback)&&n.instant_feedback}function l(t){return c(t),d(t).checkValidation().has_validation}function c(t){let e=t||p()[0];return e?r.appInstance().question(e).getQuestion():(a.A.error(`Question not found (index ${e})`),{})}function d(t){let e=t||p()[0];return e?r.appInstance().question(e):{}}function h(){return i.item().questions}function u(t){let e=t||p()[0];return e?function(t){return r.appInstance().question(t)?r.appInstance().question(t).getResponse():void a.A.error(`Response not found ${t}`)}(e):{}}function p(){return h().map((t=>t.response_id))}function f(t){let e=t||p()[0];return e&&r.appInstance().getScores()[e]||{}}},8511:(t,e,n)=>{n.r(e),n.d(e,{isFirstItemInSection:()=>s,isLastItemInSection:()=>a,section:()=>o,sectionHasShuffledItems:()=>l,sectionIndex:()=>c,sectionItemPosition:()=>d,sections:()=>h,totalItemsInSection:()=>u});var r=n(7738),i=n(3191);function s(){return 1===d()}function a(){return d()===u()}function o(){if(r.hasSections()){const t=i.itemReference(),e=h();let n=-1,r=!1;for(let i=0;i{n.r(e),n.d(e,{run:()=>s});var r=n(2844),i=n(7738);function s(){r.appInstance().on("item:load",(()=>{let t=i.totalItems(),e=Array.from(document.getElementsByClassName("item-prev")),n=Array.from(document.getElementsByClassName("item-next")),r=e.concat(n);for(let e=0;e{n.r(e),n.d(e,{run:()=>a});var r=n(2844),i=n(3191);const s={renderedCss:!1,resize:{triggered:!1}};function a(){s.renderedCss||function(){const t=document.createElement("style");t.textContent="\n/* Learnosity column resizer styles */\n.lrn-resizer {\n background-color: #e8e8e8;\n cursor: grab;\n width: 3px;\n padding: 0;\n position: relative;\n}\n.lrn-resizer span {\n position: relative;\n width: 45px;\n height: 30px;\n border: 1px solid #e4e4e4;\n left: -22px;\n border-radius: 3px;\n cursor: grab;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.5em;\n z-index: 2;\n padding-bottom: 3px;\n color: #444;\n\n -webkit-user-select: none;\n user-select: none;\n\n background: rgb(233,233,233);\n background: linear-gradient(0deg, rgba(233,233,233,1) 0%, rgba(250,250,250,1) 51%, rgba(238,238,238,1) 100%);\n}\n.row {\n display: flex;\n}\n.col-xs-6.lrn-column-left {\n display: flex;\n min-width: 5em;\n overflow: hidden;\n}\n.col-xs-6.lrn-column-right {\n display: flex;\n\n flex: 1;\n display: flex;\n flex-direction: column;\n min-width: 5em;\n overflow: hidden;\n}\n.lrn-column-left .lrn_widget,\n.lrn-column-right .lrn_widget {\n padding: 1.5em;\n}\n@media (max-width: 650px) {\n .lrn-resizer {\n display: none;\n }\n}\n",document.head.append(t),s.renderedCss=!0}(),r.appInstance().on("item:load",(()=>{o()})),window.addEventListener("resize",function(t,e){let n;return s.resize.triggered||(s.resize.triggered=!0,t.apply(this)),(...e)=>{clearTimeout(n),n=setTimeout((()=>{s.resize.triggered=!1,t.apply(this,e)}),250)}}(o))}function o(){let t=i.itemElement(),e=t.querySelectorAll('[class^="col-"]'),n=Boolean(t.querySelector(".lrn-resizer")),r=Boolean(document.querySelector(".lrn-layout-single-column"));if(2===e.length){if(r||n)r&&n&&function(t,e){let n=t.querySelector(".lrn-resizer");n&&n.remove(),e[0].removeAttribute("style"),window.dispatchEvent(new Event("resize"))}(t,e);else{let t=document.createElement("div");t.setAttribute("tooltip","Click and hold to drag column width");let n=document.createElement("span");n.innerHTML="↤ ↦",t.classList.add("lrn-resizer"),e[0].classList.add("lrn-column-left"),e[1].classList.add("lrn-column-right"),t.append(n),e[0].after(t)}!function(t){let e=t.querySelector(".lrn-resizer");e&&function(t){const e=t.previousElementSibling;let n=0,r=0;const i=t=>{n=t instanceof MouseEvent?t.clientX:t.targetTouches[0].clientX;const i=e.getBoundingClientRect();r=i.width,document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.addEventListener("touchmove",s),document.addEventListener("touchend",a)},s=i=>{let s;s=i instanceof MouseEvent?i.clientX-n:i.targetTouches[0].clientX-n;const a=100*(r+s)/t.parentNode.getBoundingClientRect().width;a>=10&&a<=90&&(e.style.width=a+"%")},a=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a)};t.addEventListener("mousedown",i),t.addEventListener("touchstart",i)}(e)}(t)}}},1499:(t,e,n)=>{n.r(e),n.d(e,{run:()=>a});var r=n(2844),i=n(7066),s=n(3184);function a(t){let e=t||1,n="LRN Hide Alternatives:";r.appInstance().on("item:load",(()=>{let t=i.questions();Object.values(t).forEach((function(t){if("mcq"===t.type)if(function(t){return!t.multiple_responses||!1===t.multiple_responses}(t))if(function(t,e){return t.options.length-e>1}(t,e))if(function(t){return"validation"in t&&t.validation}(t))if(r=t.validation,Boolean(r.valid_response.value&&r.valid_response.value.length)){let n=[],r=function(t){return t.valid_response.value}(t.validation);Object.values(r).forEach((function(e){Object.values(t.options).forEach((function(t){e!==t.value&&n.push(t.value)}))}));let i=[];for(let r=0;r{n.r(e),n.d(e,{run:()=>c});var r=n(2844),i=n(3191),s=n(7066),a=n(6254),o=n(6411);const l={supportedPlatforms:["chromeos","macos","windows"]};function c(t={global:[{bindings:{chromeos:["ctrl+shift+v"],macos:["command+shift+v"],windows:["ctrl+shift+v"]},type:"item.flag"},{bindings:{chromeos:["ctrl+alt+0"],macos:["command+option+0"],windows:["ctrl+alt+0"]},type:"masking.enable"}],item:[{bindings:{chromeos:["ctrl+shift+1","ctrl+shift+2","ctrl+shift+3","ctrl+shift+4","ctrl+shift+5","ctrl+shift+6"],macos:["command+ctrl+1","command+ctrl+2","command+ctrl+3","command+ctrl+4","command+ctrl+5","command+ctrl+6"],windows:["ctrl+shift+1","ctrl+shift+2","ctrl+shift+3","ctrl+shift+4","ctrl+shift+5","ctrl+shift+6"]},restrictTo:["mcq"],type:"response.set"},{bindings:{chromeos:["ctrl+alt+1","ctrl+alt+2","ctrl+alt+3","ctrl+alt+4","ctrl+alt+5","ctrl+alt+6"],macos:["command+option+1","command+option+2","command+option+3","command+option+4","command+option+5","command+option+6"],windows:["ctrl+alt+1","ctrl+alt+2","ctrl+alt+3","ctrl+alt+4","ctrl+alt+5","ctrl+alt+6"]},type:"response.mask"}]}){const e=function(){let t;return l.supportedPlatforms.forEach((e=>{a[e]&&(t=e)})),t}();l.bindings=t,e&&(o.prototype.stopCallback=function(t,e,n){let r=document.activeElement;return"radio"!==r.getAttribute("type")&&"checkbox"!==r.getAttribute("type")&&!((" "+e.className+" ").indexOf(" mousetrap ")>-1)&&("INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.contentEditable&&"true"==e.contentEditable)},l.bindings.hasOwnProperty("global")&&Array.isArray(l.bindings.global)&&l.bindings.global.forEach((t=>{if(t.hasOwnProperty("type"))switch(t.type){case"item.flag":n=t.bindings[e],o.bind(n,((t,e)=>{i.flag()}));break;case"masking.enable":!function(t){s.questionInstance().isMaskable()&&o.bind(t,(t=>{r.appInstance().questionsApp().masking(!i.isMaskingEnabled())}))}(t.bindings[e])}var n})),l.bindings.hasOwnProperty("item")&&Array.isArray(l.bindings.item)&&r.appInstance().on("item:load",(()=>{l.bindings.item.forEach((t=>{if(t.hasOwnProperty("type"))switch(t.type){case"response.mask":!function(t){let e=s.questions(),n=0;e.forEach((t=>{"mcq"===t.type&&n++})),1===n&&Object.values(e).forEach((function(e){"mcq"===e.type&&o.bind(t,((t,n)=>{if(i.isMaskingEnabled()){let t=Number(n.at(-1));if(e.options?.length>=t){let e=i.itemElement().querySelectorAll(".lrn-mcq-option")[t-1].querySelector(".lrn-mask");e&&e.click()}}}))}))}(t.bindings[e]);break;case"response.set":!function(t){let e=s.questions(),n=0;e.forEach((t=>{"mcq"===t.type&&n++})),1===n&&Object.values(e).forEach((function(e){"mcq"===e.type&&o.bind(t,(t=>{e.options?.length>=t.key&&document.getElementById(`${e.response_id}`).querySelectorAll(".lrn-input")[t.key-1].click()}))}))}(t.bindings[e])}}))})))}},3835:(t,e,n)=>{n.r(e),n.d(e,{run:()=>s});var r=n(2844),i=n(3191);function s(t,e="lrn__magnifier"){t||(t={zoom:4,shape:"square",width:350,height:350});const n=document.querySelectorAll(`.${e}`),s=new a(t);n.forEach((t=>{t.addEventListener("click",(()=>{s.toggle()}))})),r.appInstance().on("item:load",function(t){let e=i.itemElement().querySelectorAll("img");e&&e.forEach((e=>{e.addEventListener("click",(e=>{t.isVisible()||t.show(e)}))}))}(s))}function a(t){const e=this;e.options=Object.assign({zoom:2,shape:"square",width:200,height:200},t),window.MutationObserver||window.WebKitMutationObserver;let n,r,i,s,a,o=!1,l={};function c(t,e,n){t.style.left=`${e}px`,t.style.top=`${n}px`}function d(t,e,n){t.style.width=`${e}px`,t.style.height=`${n}px`}function h(){switch(e.options.shape){case"square":d(n,e.options.width,e.options.height);break;case"circle":d(n,e.options.width,e.options.height),n.style.borderRadius="50%"}r.style.WebkitTransform=r.style.MozTransform=r.style.OTransform=r.style.MsTransform=r.style.transform=`scale(${e.options.zoom})`}function u(t,e){let n=e;for(;null!=n;){if(n==t)return!0;n=n.parentNode}return!1}function p(){o&&(y(),v(),A())}function f(){o&&(window.clearTimeout(s),s=window.setTimeout(p,100))}function m(){o&&f()}function g(t,n){const r=l[t];if(r)for(let t=0;t0)for(let t=0;t0&&s.length===o.length)for(let t=0;t0&&t.push(e[n]);for(let e=0;e