Sindbad~EG File Manager
(()=>{var e,t,r={734:(e,t,r)=>{"use strict";var n,i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=function(){return"object"===("undefined"==typeof window?"undefined":a(window))},o=s()?window:r.g,c=!!s()&&document.attachEvent,d=!1,l=null,h=null,p=null,u=null,b=function(e){var t=e.__resizeTriggers__,r=t.firstElementChild,n=t.lastElementChild,i=r.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,i.style.width=r.offsetWidth+1+"px",i.style.height=r.offsetHeight+1+"px",r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight},v=(n=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(e){return setTimeout(e,20)},function(e){return n(e)}),y=(i=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||o.clearTimeout,function(e){return i(e)}),g=function(e){var t=this;b(this),this.__resizeRAF__&&y(this.__resizeRAF__),this.__resizeRAF__=v((function(){(function(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height})(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(r){r.call(t,e)})))}))};if(s()&&!c){var m=!1,f="";u="animationstart";var S="Webkit Moz O ms".split(" "),L="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),x=document.createElement("fakeelement");if(void 0!==x.style.animationName&&(m=!0),!1===m)for(var B=0;B<S.length;B++)if(void 0!==x.style[S[B]+"AnimationName"]){f="-"+S[B].toLowerCase()+"-",u=L[B],m=!0;break}h="@"+f+"keyframes "+(l="resizeanim")+" { from { opacity: 0; } to { opacity: 0; } } ",p=f+"animation: 1ms "+l+"; "}t.kp=function(e,t){c?e.attachEvent("onresize",t):s()&&(e.__resizeTriggers__||("static"==getComputedStyle(e).position&&(e.style.position="relative"),function(){if(!d){var e=(h||"")+".resize-triggers { "+(p||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e)),t.appendChild(r),d=!0}}(),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement("div")).className="resize-triggers",e.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',e.appendChild(e.__resizeTriggers__),b(e),e.addEventListener("scroll",g,!0),u&&e.__resizeTriggers__.addEventListener(u,(function(t){t.animationName==l&&b(e)}))),e.__resizeListeners__.push(t))}}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,i),a.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}H5P=H5P||{},H5P.BranchingScenario=function(t,r){var n=this;H5P.EventDispatcher.call(n),n.contentId=r,n.startScreen={},n.libraryScreen={},n.endScreens={},n.navigating,n.currentHeight,n.currentId=-1,n.xAPIDataCollector=[],n.userPath=[],n.backwardsAllowedFlags=[],n.proceedButtonInProgress=!1,n.isReverseTransition=!1;var i=function t(){for(var r=1;r<arguments.length;r++)for(var n in arguments[r])arguments[r].hasOwnProperty(n)&&("object"===e(arguments[0][n])&&"object"===e(arguments[r][n])?t(arguments[0][n],arguments[r][n]):arguments[0][n]=arguments[r][n]);return arguments[0]};(t=i({content:[],startScreen:{startScreenTitle:"",startScreenSubtitle:""},endScreens:[{endScreenTitle:"",endScreenSubtitle:"",contentId:-1}],scoringOptionGroup:{scoringOption:"no-score"},l10n:{},behaviour:"individual"},t.branchingScenario)).l10n=i({startScreenButtonText:"Start the course",endScreenButtonText:"Restart the course",proceedButtonText:"Proceed",scoreText:"Your score:",backButtonText:"Back",fullscreenAria:"Fullscreen",replayButtonText:"Replay the video",disableProceedButtonText:"Require to complete the current module"},t.l10n),t.content.forEach((function(e,r){e.contentId=r,void 0===e.nextContentId&&(e.nextContentId=-1),t.behaviour.randomizeBranchingQuestions&&-1!==e.type.library.indexOf("H5P.BranchingQuestion")&&(e.type.params.branchingQuestion.randomize=!0),void 0===e.proceedButtonText&&(e.proceedButtonText=t.l10n.proceedButtonText)})),n.backwardsAllowedFlags=t.content.map((function(e){return"useBehavioural"===e.contentBehaviour?t.behaviour.enableBackwardsNavigation:"enabled"===e.contentBehaviour})),n.params=t,n.scoring=new H5P.BranchingScenario.Scoring(t);var a=function(e){var r=new H5P.BranchingScenario.GenericScreen(n,{isStartScreen:!1,titleText:e.endScreenTitle,subtitleText:e.endScreenSubtitle,image:e.endScreenImage,buttonText:t.l10n.endScreenButtonText,fullscreenAria:t.l10n.fullscreenAria,isCurrentScreen:!1,scoreText:t.l10n.scoreText,score:n.scoring.getScore(e.endScreenScore),maxScore:n.scoring.getMaxScore(),showScore:n.scoring.shouldShowScore()});return r.on("toggleFullScreen",(function(){n.toggleFullScreen()})),r};n.getLibrary=function(e){return void 0!==t.content[e]&&t.content[e]},n.on("exitFullScreen",(function(){setTimeout((function(){n.trigger("resize")}),100)})),n.on("started",(function(){var e=this.params.content[0];!1===n.canEnableBackButton(0)?n.disableBackButton():n.enableBackButton(),e&&e.type&&e.type.library&&"H5P.BranchingQuestion"===e.type.library.split(" ")[0]?n.trigger("navigated",{nextContentId:0}):(n.startScreen.hide(),n.libraryScreen.show(),n.triggerXAPI("progressed"),n.userPath.push(0)),n.currentId=0})),n.on("navigated",(function(e){e.data.reverse&&(n.libraryScreen&&n.libraryScreen.wrapper&&(n.libraryScreen.wrapper.style.height=""),n.userPath.pop(),e.data.nextContentId=n.userPath.pop()||0);var r=parseInt(e.data.nextContentId);n.userPath.push(r),n.currentId>-1&&H5P.BranchingScenario.LibraryScreen.isBranching(n.getLibrary(n.currentId))&&n.$container.find('.h5p-back-button[isBQ="true"]').length&&n.$container.find('.h5p-back-button[isBQ="true"]').remove();var i=n.getLibrary(r),s=!0;if(n.libraryScreen){if(n.libraryScreen.stopPlayback(n.currentId),!this.params.preventXAPI){var o=n.libraryScreen.getXAPIData(n.currentId),c=H5P.BranchingScenario.LibraryScreen.isBranching(n.getLibrary(n.currentId)),d=c&&o.statement&&o.statement.result&&void 0!==o.statement.result.response;!o||c&&!d||n.xAPIDataCollector.push(o)}}else n.libraryScreen=new H5P.BranchingScenario.LibraryScreen(n,t.startScreen.startScreenTitle,i),n.libraryScreen.on("toggleFullScreen",(function(){n.toggleFullScreen()})),n.$container.append(n.libraryScreen.getElement()),n.currentId=r;if(H5P.BranchingScenario.LibraryScreen.isBranching(n.getLibrary(n.currentId))&&document.querySelector(".h5p-current-screen").setAttribute("aria-hidden",!0),n.currentEndScreen&&n.currentEndScreen.isShowing?i?H5P.BranchingScenario.LibraryScreen.isBranching(i)||(n.currentEndScreen.hide(),n.currentEndScreen=null,n.libraryScreen.show()):(n.libraryScreen.hideFeedbackDialogs(),n.currentEndScreen.hide(),n.currentEndScreen=null):n.startScreen&&n.startScreen.isShowing&&i?H5P.BranchingScenario.LibraryScreen.isBranching(i)||(n.startScreen.hide(),n.libraryScreen.show(),s=!1):n.libraryScreen.hideFeedbackDialogs(),s&&n.trigger("resize"),-1!==n.currentId){n.triggerXAPI("progressed");var l={};n.libraryScreen.currentLibraryInstance&&n.libraryScreen.currentLibraryInstance.getScore&&(l={score:n.libraryScreen.currentLibraryInstance.getScore(),maxScore:n.libraryScreen.currentLibraryInstance.getMaxScore()}),n.scoring.addLibraryScore(this.currentId,this.libraryScreen.currentLibraryId,e.data.chosenAlternative,l)}if(!1===i){if(n.currentEndScreen=n.endScreens[r],e.data.feedback){var h=a({endScreenTitle:e.data.feedback.title||"",endScreenSubtitle:e.data.feedback.subtitle||"",endScreenImage:e.data.feedback.image,endScreenScore:e.data.feedback.endScreenScore});n.$container.append(h.getElement()),n.currentEndScreen=h}else n.scoring.isDynamicScoring()&&(n.currentEndScreen.setScore(n.getScore()),n.currentEndScreen.setMaxScore(n.getMaxScore()));n.startScreen.hide(),n.libraryScreen.hide(!0),n.currentEndScreen.show(),n.triggerXAPICompleted(n.scoring.getScore(n.currentEndScreen.getScore()),n.scoring.getMaxScore())}else n.libraryScreen.showNextLibrary(i,e.data.reverse),!1===n.canEnableBackButton(r)?n.disableBackButton():n.enableBackButton(),n.currentId=r;if(0!==e.data.nextContentId&&document.querySelector(".h5p-start-screen").classList.contains("h5p-current-screen")){var p=n.libraryScreen.wrapper.querySelector(".h5p-slide-in");p&&(p.classList.remove("h5p-next"),n.startScreen.hide(),n.libraryScreen.show())}})),n.on("restarted",(function(){n.currentEndScreen&&(n.currentEndScreen.hide(),n.currentEndScreen=null),n.scoring.restart(),n.xAPIDataCollector=[],n.startScreen.screenWrapper.style.height="",n.startScreen.screenWrapper.classList.remove("h5p-slide-out"),n.startScreen.show(n.isReverseTransition),n.isReverseTransition=!1,n.currentId=-1,n.userPath=[],n.libraryScreen&&n.libraryScreen.remove(),n.libraryScreen=new H5P.BranchingScenario.LibraryScreen(n,t.startScreen.startScreenTitle,n.getLibrary(0)),n.libraryScreen.on("toggleFullScreen",(function(){n.toggleFullScreen()})),n.$container.append(n.libraryScreen.getElement())})),n.on("resize",(function(t){if(!n.bubblingUpwards){n.changeLayoutToFitWidth(),n.libraryScreen&&"object"===e(n.libraryScreen)&&0!==Object.keys(n.libraryScreen).length&&n.libraryScreen.resize(t);var r=n.$container[0].getBoundingClientRect();r.width<=480?n.$container.addClass("h5p-phone-size"):n.$container.removeClass("h5p-phone-size"),r.width<768?n.$container.addClass("h5p-medium-tablet-size"):n.$container.removeClass("h5p-medium-tablet-size")}})),n.toggleFullScreen=function(){n.isFullScreen()?H5P.exitFullScreen&&H5P.exitFullScreen():H5P.fullScreen(n.$container,this)},n.isFullScreen=function(){return H5P.isFullscreen||n.$container&&n.$container[0].classList.contains("h5p-fullscreen")||n.$container&&n.$container[0].classList.contains("h5p-semi-fullscreen")},n.disableNavButton=function(){n.libraryScreen.navButton&&(n.libraryScreen.navButton.classList.add("h5p-disabled"),n.libraryScreen.navButton.setAttribute("disabled",!0),n.libraryScreen.navButton.setAttribute("title",t.l10n.disableProceedButtonText))},n.enableNavButton=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.libraryScreen.navButton&&(n.libraryScreen.navButton.classList.remove("h5p-disabled"),n.libraryScreen.navButton.removeAttribute("disabled"),n.libraryScreen.navButton.removeAttribute("title"),e&&n.animateNavButton())},n.hideNavButton=function(){n.libraryScreen.navButton&&n.libraryScreen.navButton.classList.add("h5p-hidden")},n.showNavButton=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(n.libraryScreen.navButton){n.libraryScreen.navButton.classList.remove("h5p-hidden"),document.activeElement.blur();var t=100;e&&n.animateNavButton(),setTimeout((function(){n.libraryScreen.navButton.focus()}),t)}},n.animateNavButton=function(){n.libraryScreen.navButton.classList.contains("h5p-animate")||n.libraryScreen.navButton.classList.add("h5p-animate")},n.unanimateNavButton=function(){n.libraryScreen.navButton.classList.remove("h5p-animate")},n.getScore=function(){return n.scoring.getScore()},n.getMaxScore=function(){return n.scoring.getMaxScore()},n.changeLayoutToFitWidth=function(){var e=parseInt(window.getComputedStyle(document.getElementsByTagName("body")[0]).fontSize,10);this.$container.width()/e>43?n.$container[0].classList.add("h5p-wide-screen"):n.$container[0].classList.add("h5p-mobile-screen")},n.disableBackButton=function(){n.libraryScreen&&n.libraryScreen.backButton&&(n.libraryScreen.backButton.classList.add("h5p-disabled"),n.libraryScreen.backButton.setAttribute("disabled",!0))},n.enableBackButton=function(){n.libraryScreen&&n.libraryScreen.backButton&&(n.libraryScreen.backButton.classList.remove("h5p-disabled"),n.libraryScreen.backButton.removeAttribute("disabled"))},n.getUserPath=function(){return n.userPath},n.canEnableBackButton=function(e){return"number"==typeof e&&!(e<0||e>n.backwardsAllowedFlags.length-1)&&n.backwardsAllowedFlags[e]},n.attach=function(e){if(void 0!==this.isRoot&&this.isRoot()&&this.setActivityStarted(),n.$container=e,e.addClass("h5p-branching-scenario").html(""),!t.content||0===t.content.length){var r=document.createElement("div");return r.innerHTML="No content",void n.$container.append(r)}var i,s,o,c,d,l;n.startScreen=(!0,s=(i=t.startScreen).startScreenTitle,o=i.startScreenSubtitle,c=i.startScreenImage,d=i.startScreenAltText,(l=new H5P.BranchingScenario.GenericScreen(n,{isStartScreen:!0,titleText:s,subtitleText:o,image:c,altText:d,fullscreenAria:t.l10n.fullscreenAria,buttonText:t.l10n.startScreenButtonText,isCurrentScreen:true})).on("toggleFullScreen",(function(){n.toggleFullScreen()})),l),n.$container.append(n.startScreen.getElement()),n.currentId=-1,n.libraryScreen=new H5P.BranchingScenario.LibraryScreen(n,t.startScreen.startScreenTitle,n.getLibrary(0)),n.libraryScreen.on("toggleFullScreen",(function(){n.toggleFullScreen()})),n.$container.append(n.libraryScreen.getElement()),t.endScreens.forEach((function(e){n.endScreens[e.contentId]=a(e),n.$container.append(n.endScreens[e.contentId].getElement())}))},n.getXAPIData=function(){if(n.currentEndScreen){var e=n.createXAPIEventTemplate("answered"),t=e.getVerifiedStatementValue(["object","definition"]);H5P.jQuery.extend(t,{interactionType:"compound",type:"http://adlnet.gov/expapi/activities/cmi.interaction"}),t.extensions={"https://h5p.org/x-api/no-question-score":1};var r=n.scoring.getScore(n.currentEndScreen.getScore()),i=n.scoring.getMaxScore();return e.setScoredResult(r,i,this,!0,r===i),{statement:e.data.statement,children:n.xAPIDataCollector}}console.error("Called getXAPIData before finished.")}},H5P.BranchingScenario.prototype=Object.create(H5P.EventDispatcher.prototype),H5P.BranchingScenario.prototype.constructor=H5P.BranchingScenario})(),H5P.BranchingScenario.GenericScreen=function(){function e(e,t){var r=this;H5P.EventDispatcher.call(this);var n=this;n.parent=e,n.isShowing=t.isStartScreen,n.isFeedbackAvailable=!1,n.screenWrapper=document.createElement("div"),n.screenWrapper.classList.add(t.isStartScreen?"h5p-start-screen":"h5p-end-screen"),n.screenWrapper.classList.add(t.isCurrentScreen?"h5p-current-screen":"h5p-next-screen"),t.isCurrentScreen?n.parent.currentHeight="45em":this.screenWrapper.classList.add("h5p-branching-hidden");var i=document.createElement("div");i.classList.add("h5p-branching-scenario-screen-content");var a=document.createElement("div");a.classList.add("h5p-feedback-content-content"),i.appendChild(a),n.feedbackText=a;var s=document.createElement("h1");s.className="h5p-branching-scenario-title-text",s.innerHTML=t.titleText;var o=document.createElement("div");o.className="h5p-branching-scenario-subtitle-text",o.innerHTML=t.subtitleText;var c=document.createElement("button");c.classList.add(t.isStartScreen?"h5p-start-button":"h5p-end-button"),c.classList.add("transition"),c.onclick=function(){t.isStartScreen?n.parent.trigger("started"):n.parent.trigger("restarted");var e=document.getElementsByClassName("h5p-start-screen")[0];t.isStartScreen||(e.style.height=""),n.parent.navigating=!0},n.navButton=c;var d=document.createTextNode(t.buttonText);if(c.appendChild(d),a.appendChild(s),a.appendChild(o),i.appendChild(c),t.showScore&&void 0!==t.score&&(n.scoreWrapper=this.createResultContainer(t.scoreText,t.score,t.maxScore),i.insertBefore(n.scoreWrapper,i.firstChild)),H5P.canHasFullScreen){var l=document.createElement("button");l.className="h5p-branching-full-screen",l.setAttribute("aria-label",this.parent.params.l10n.fullscreenAria),l.addEventListener("click",(function(){r.trigger("toggleFullScreen")})),n.screenWrapper.appendChild(l)}n.screenWrapper.appendChild(n.createScreenBackground(t.isStartScreen,t.image,t.altText)),n.screenWrapper.appendChild(i),(t.showScore&&void 0!==t.score||""!==t.titleText||""!==t.subtitleText)&&(a.tabIndex=-1,n.isFeedbackAvailable=!0),n.getScore=function(){return t.score},n.getMaxScore=function(){return t.maxScore},n.checkIntroReset=function(){var e=document.getElementsByClassName("h5p-start-screen")[0];["h5p-end-screen","h5p-current-screen"].every((function(e){return n.screenWrapper.classList.contains(e)}))?e.classList.add("h5p-reset-start"):e.classList.contains("h5p-reset-start")&&e.classList.remove("h5p-reset-start")}}return e.prototype.getElement=function(){return this.screenWrapper},e.prototype.setScore=function(e){this.scoreValue&&void 0!==e&&(this.scoreValue.textContent=e.toString())},e.prototype.setMaxScore=function(e){void 0!==e&&(this.maxScoreValue.textContent=e.toString())},e.prototype.createResultContainer=function(e,t,r){var n=document.createElement("div");n.classList.add("h5p-result-wrapper");var i=document.createElement("div");i.classList.add("h5p-result-container");var a=document.createElement("div");a.classList.add("h5p-score-text"),a.appendChild(document.createTextNode(e));var s=document.createElement("div");s.classList.add("h5p-score-circle");var o=document.createElement("span");o.className="h5p-score-value",this.scoreValue=document.createTextNode(t.toString()),o.appendChild(this.scoreValue),s.appendChild(o);var c=document.createElement("span");c.className="h5p-score-delimiter",c.textContent="/",s.appendChild(c);var d=document.createElement("span");return d.className="h5p-max-score",this.maxScoreValue=document.createTextNode(r.toString()),d.appendChild(this.maxScoreValue),s.appendChild(d),i.appendChild(a),i.appendChild(s),n.appendChild(i),n},e.prototype.createScreenBackground=function(e,t,r){var n=this,i=document.createElement("div");i.classList.add("h5p-screen-background");var a=document.createElement("div");a.classList.add("h5p-screen-banner");var s=document.createElement("img");return s.classList.add("h5p-background-image"),t&&t.path?s.src=H5P.getPath(t.path,this.parent.contentId):s.src=e?this.parent.getLibraryFilePath("assets/start-screen-default.jpg"):this.parent.getLibraryFilePath("assets/end-screen-default.jpg"),r&&r.length&&s.setAttribute("aria-label",r),s.addEventListener("load",(function(){n.parent.trigger("resize")})),i.appendChild(a),i.appendChild(s),i},e.prototype.show=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;t.isShowing=!0,e&&t.screenWrapper.classList.add("h5p-previous"),t.screenWrapper.classList.add("h5p-slide-in"),t.screenWrapper.classList.remove("h5p-branching-hidden"),t.screenWrapper.addEventListener("animationend",(function(r){"slide-in"===r.animationName&&(e&&t.screenWrapper.classList.remove("h5p-previous"),t.screenWrapper.classList.remove("h5p-next-screen"),t.screenWrapper.classList.remove("h5p-slide-in"),t.screenWrapper.classList.add("h5p-current-screen"),t.screenWrapper.setAttribute("aria-hidden",!1),t.parent.trigger("resize"),t.isFeedbackAvailable?t.feedbackText.focus():t.navButton.focus(),t.checkIntroReset())}))},e.prototype.hide=function(){var e=this;e.isShowing=!1,e.screenWrapper.classList.add("h5p-slide-out"),e.screenWrapper.addEventListener("animationend",(function(t){"slide-out"===t.animationName&&(e.screenWrapper.classList.add("h5p-branching-hidden"),e.screenWrapper.classList.remove("h5p-current-screen"),e.screenWrapper.classList.add("h5p-next-screen"),e.screenWrapper.classList.remove("h5p-slide-out"))}))},e}(),(()=>{"use strict";var e=i(734);H5P.BranchingScenario.LibraryScreen=function(t){function r(e,t,r){var n=this;H5P.EventDispatcher.call(this),this.parent=e,this.currentLibraryElement,this.currentLibraryInstance,this.currentLibraryId=0,this.nextLibraryId=r.nextContentId,this.libraryFeedback=r.feedback,this.nextLibraries={},this.libraryInstances={},this.libraryFinishingRequirements=[],this.libraryTitle,this.branchingQuestions=[],this.navButton,this.header,this.isShowing=!1,this.contentOverlays=[];var i=r.type&&r.type.metadata&&r.type.metadata.title?r.type.metadata.title:"";this.wrapper=this.createWrapper(t,i||"Untitled Content",r.showContentTitle&&i),this.wrapper.classList.add("h5p-next-screen"),this.wrapper.classList.add("h5p-branching-hidden");var a=this.createLibraryElement(r,!1);this.currentLibraryWrapper=a,this.currentLibraryElement=a.getElementsByClassName("h5p-branching-scenario-content")[0],this.currentLibraryInstance=this.libraryInstances[0],this.createNextLibraries(r),this.wrapper.appendChild(a),this.createNavButtons(),e.on("enterFullScreen",(function(){setTimeout((function(){n.currentLibraryInstance&&n.currentLibraryInstance.trigger("resize")}),500)}))}return r.prototype.handleLibraryResize=function(){if(this.parent.isFullScreen())return this.currentLibraryWrapper.style.height="",void(this.wrapper.style.minHeight="");this.currentLibraryWrapper.style.height=this.currentLibraryElement.clientHeight+40+"px",this.wrapper.style.minHeight=this.currentLibraryElement.clientHeight+40+70.17+"px",this.currentLibraryWrapper.offsetHeight<this.currentLibraryElement.scrollHeight&&(this.currentLibraryElement.tabIndex=0)},r.prototype.createWrapper=function(t,r,n){var i=this,a=this,s=this.parent,o=document.createElement("div"),c=document.createElement("div");if(c.classList.add("h5p-title-wrapper"),H5P.canHasFullScreen){var d=document.createElement("button");d.className="h5p-branching-full-screen",d.setAttribute("aria-label",this.parent.params.l10n.fullscreenAria),d.addEventListener("click",(function(){i.trigger("toggleFullScreen")})),c.appendChild(d)}var l=document.createElement("div");l.className="h5p-branching-header";var h=document.createElement("h1");h.innerHTML=t,l.appendChild(h);var p=document.createElement("h2");p.classList.add("library-subtitle"),p.innerHTML=n?r:" ",p.setAttribute("tabindex","-1"),p.setAttribute("aria-label",r),l.appendChild(p),c.appendChild(l),this.libraryTitle=p;var u=document.createElement("div");return u.classList.add("h5p-screen-header"),this.header=u,u.appendChild(c),o.appendChild(u),(0,e.kp)(o,(function(){i.wrapper.clientHeight>500&&(i.wrapper.style.minHeight=i.wrapper.clientHeight+"px")})),o.addEventListener("animationend",(function(t){"slide-in"===t.animationName&&a.currentLibraryElement&&(s.trigger("resize"),setTimeout((function(){(0,e.kp)(a.currentLibraryElement,(function(){a.handleLibraryResize(),s.trigger("resize")}))}),100))})),o},r.prototype.createBackButton=function(e){var t=this,r=this,n=document.createElement("button");return n.classList.add("transition"),n.classList.add("h5p-back-button"),n.addEventListener("click",(function(e){if(e.currentTarget.hasAttribute("isBQ"))return t.overlay&&(null!==t.overlay.parentNode&&t.overlay.parentNode.removeChild(t.overlay),t.overlay=void 0,t.branchingQuestions.forEach((function(e){null!==e.parentNode&&e.parentNode.removeChild(e)})),t.showBackgroundToReadspeaker()),"H5P.BranchingQuestion"===r.parent.params.content[0].type.library.split(" ")[0]&&0===r.parent.currentId?(r.parent.trigger("restarted"),n):void r.parent.trigger("navigated",{reverse:!0});if(!0!==r.parent.navigating){if(0===r.currentLibraryId&&"H5P.BranchingQuestion"!==r.parent.params.content[r.parent.currentId].type.library.split(" ")[0])return r.parent.isReverseTransition=!0,r.parent.trigger("restarted"),n;r.parent.trigger("navigated",{reverse:!0}),r.parent.navigating=!0}})),n.appendChild(document.createTextNode(e)),n},r.prototype.handleProceed=function(){var e=this,t=!0;if(!1===this.parent.navigating){var r=this.libraryFeedback.title&&this.libraryFeedback.title.trim(),n=this.libraryFeedback.subtitle&&this.libraryFeedback.subtitle.trim(),i=!!(r||n||this.libraryFeedback.image);if(i&&-1!==this.nextLibraryId){void 0===this.overlay&&(this.overlay=document.createElement("div"),this.overlay.className="h5p-branching-scenario-overlay",this.wrapper.appendChild(this.overlay),this.hideBackgroundFromReadspeaker());var a=document.createElement("div");a.classList.add("h5p-branching-question-wrapper"),a.classList.add("h5p-branching-scenario-feedback-dialog");var s=document.createElement("div");s.classList.add("h5p-branching-question-container"),a.appendChild(s);var o=this.createFeedbackScreen(this.libraryFeedback,this.nextLibraryId);s.appendChild(o),s.classList.add("h5p-start-outside"),s.classList.add("h5p-fly-in"),this.currentLibraryWrapper.style.zIndex=0,setTimeout((function(){e.wrapper.appendChild(a),parseInt(e.currentLibraryWrapper.style.height)<s.offsetHeight&&(e.currentLibraryElement.style.height=s.offsetHeight+"px",e.wrapper.style.height=s.offsetHeight+"px",e.parent.trigger("resize"))}),100),o.focus(),this.parent.navigating=!0}else{var c={nextContentId:this.nextLibraryId};(i||void 0!==this.libraryFeedback.endScreenScore)&&(c.feedback=this.libraryFeedback);var d=this;t=!1,new Promise((function(e){e(d.parent.trigger("navigated",c))})).then((function(){e.parent.proceedButtonInProgress=!1,e.parent.navigating=!0}))}}if(t)return t},r.prototype.createFeedbackScreen=function(e,t){var n=this,i="h5p-branching-feedback-title-"+r.idCounter++,a=document.createElement("div");if(a.classList.add("h5p-branching-question"),a.classList.add(void 0!==e.image?"h5p-feedback-has-image":"h5p-feedback-default"),a.setAttribute("role","dialog"),a.setAttribute("tabindex","-1"),a.setAttribute("aria-labelledby",i),void 0!==e.image&&void 0!==e.image.path){var s=document.createElement("div");s.classList.add("h5p-branching-question"),s.classList.add("h5p-feedback-image");var o=document.createElement("img");o.src=H5P.getPath(e.image.path,n.parent.contentId),s.appendChild(o),a.appendChild(s)}var c=document.createElement("div");c.classList.add("h5p-branching-question"),c.classList.add("h5p-feedback-content");var d=document.createElement("div");d.classList.add("h5p-feedback-content-content"),c.appendChild(d);var l=document.createElement("h1");if(l.id=i,l.innerHTML=e.title||"",d.appendChild(l),e.subtitle){var h=document.createElement("div");h.innerHTML=e.subtitle||"",d.appendChild(h)}var p=document.createElement("button");p.onclick=function(){n.parent.trigger("navigated",{nextContentId:t})};var u=n.parent.getLibrary(n.currentLibraryId).proceedButtonText,b=document.createTextNode(u);return p.appendChild(b),c.appendChild(p),a.appendChild(c),a},r.prototype.createLibraryElement=function(e,t){var r=this,n=document.createElement("div");n.classList.add("h5p-library-wrapper");var i=document.createElement("div");i.classList.add("h5p-branching-scenario-content"),this.appendRunnable(i,e.type,e.contentId);var a=e.type&&e.type.library.split(" ")[0];return this.contentOverlays[e.contentId]=new H5P.BranchingScenario.LibraryScreenOverlay(this),n.appendChild(this.contentOverlays[e.contentId].getDOM()),"H5P.InteractiveVideo"!==a&&"H5P.Video"!==a||(this.contentOverlays[e.contentId].addButton("replay",this.parent.params.l10n.replayButtonText,(function(){r.handleReplayVideo(a,e)})),this.contentOverlays[e.contentId].addButton("proceed",e.proceedButtonText,(function(){r.handleProceedAfterVideo()}))),n.appendChild(i),t&&(n.classList.add("h5p-next"),i.classList.add("h5p-branching-hidden")),"H5P.BranchingQuestion"===a&&i.classList.add("h5p-branching-hidden"),n},r.prototype.handleReplayVideo=function(e,t){this.contentOverlays[this.currentLibraryId].hide(),!0===this.libraryFinishingRequirements[t.contentId]&&this.hasValidVideo(t)&&this.parent.disableNavButton(),this.currentLibraryInstance.currentState=3,this.currentLibraryInstance.seek(0),this.currentLibraryInstance.play(),"H5P.InteractiveVideo"===e&&this.resetIVProgress()},r.prototype.resetIVProgress=function(){this.currentLibraryInstance.interactions.forEach((function(e){e.resetTask()}));var e=this.currentLibraryInstance;e.addSliderInteractions(),e.endscreen&&(e.endscreen.update(),e.endscreen.$closeButton[0].click(),this.wrapper.getElementsByClassName("h5p-star-foreground")[0].classList.remove("h5p-star-active"))},r.prototype.handleProceedAfterVideo=function(){this.contentOverlays[this.currentLibraryId].hide(),this.handleProceed()},r.prototype.appendRunnable=function(e,t,r){var n=this,i=this.parent,a=t.library.split(" ")[0];if("H5P.Video"===a)t.params.visuals.fit=!1;else if("H5P.BranchingQuestion"===a){var s=i.getLibrary(r).proceedButtonText;t.params.proceedButtonText=s}var o=H5P.jQuery.extend(!0,{},t),c=H5P.newRunnable(o,this.parent.contentId,H5P.jQuery(e),!0,{parent:this.parent});if(("enabled"===this.parent.params.content[r].forceContentFinished||"useBehavioural"===this.parent.params.content[r].forceContentFinished&&!0===this.parent.params.behaviour.forceContentFinished)&&(this.libraryFinishingRequirements[r]=this.forceContentFinished(c,a),this.addFinishedListeners(c,a)),c.setActivityStarted(),"H5P.Video"===a&&this.nextIsBranching(r)?c.on("stateChange",(function(e){e.data===H5P.Video.ENDED&&n.navButton&&n.handleProceed()})):"H5P.Image"===a&&c.on("loaded",(function(){n.handleLibraryResize(),n.parent.trigger("resize")})),"H5P.Video"===a||"H5P.InteractiveVideo"===a){var d="H5P.Video"===a?c:c.video;d.on("loaded",(function(){n.handleLibraryResize()})),d.on("error",(function(){n.parent.enableNavButton()}))}c.on("navigated",(function(e){i.trigger("navigated",e.data)})),this.libraryInstances[r]=c,this.bubbleUp(c,"resize",i),this.disableFullscreen(c)},r.prototype.stopPlayback=function(e){var t=this.libraryInstances[e];if(t)try{if(void 0!==t.pause&&(t.pause instanceof Function||"function"==typeof t.pause))t.pause();else if(void 0!==t.video&&void 0!==t.video.pause&&(t.video.pause instanceof Function||"function"==typeof t.video.pause))t.video.pause();else if(void 0!==t.stop&&(t.stop instanceof Function||"function"==typeof t.stop))t.stop();else if(void 0!==t.pauseMedia&&(t.pauseMedia instanceof Function||"function"==typeof t.pauseMedia)&&t.elementInstances[t.currentSlideIndex])for(var r=0;r<t.elementInstances[t.currentSlideIndex].length;r++)t.pauseMedia(t.elementInstances[t.currentSlideIndex][r])}catch(e){H5P.error(e)}},r.prototype.forceContentFinished=function(e,t){var r=!1;return e&&(r=r||e.getScore&&"function"==typeof e.getScore),t&&(r=r||"H5P.Audio"===t||"H5P.Video"===t),("H5P.CoursePresentation"===t&&e&&e.children.length+(e.isTask?1:0)===1||!0===e.activeSurface)&&(r=!1),r},r.prototype.addFinishedListeners=function(e,t){var r=this,n=this;if("string"==typeof t&&e)switch(t){case"H5P.CoursePresentation":e.on("xAPI",(function(t){"progressed"===t.data.statement.verb.display["en-US"]&&parseInt(t.data.statement.object.definition.extensions["http://id.tincanapi.com/extension/ending-point"])===e.children.length+(e.isTask?1:0)&&r.navButton.classList.contains("h5p-disabled")&&n.parent.enableNavButton(!0)}));break;case"H5P.InteractiveVideo":e.on("xAPI",(function(e){"completed"===e.data.statement.verb.display["en-US"]&&n.handleVideoOver()})),e.video.on("stateChange",(function(t){if(t.data===H5P.Video.ENDED||t.data===H5P.Video.PLAYING&&!1===n.contentOverlays[n.currentLibraryId].hidden){var r=e.interactions.filter((function(e){return void 0!==e.getProgress()}));e.hasStar&&r.length>0?n.parent.enableNavButton():n.handleVideoOver(),this.pause()}}));break;case"H5P.Video":e.on("stateChange",(function(e){e.data===H5P.Video.ENDED&&(n.nextIsBranching(n.currentLibraryId)||n.handleVideoOver())}));break;case"H5P.Audio":e.audio.on("ended",(function(){n.parent.enableNavButton()}));break;default:"function"==typeof e.getAnswerGiven&&e.on("xAPI",(function(e){"answered"!==e.data.statement.verb.display["en-US"]&&"completed"!==e.data.statement.verb.display["en-US"]||n.parent.enableNavButton()}))}},r.prototype.handleVideoOver=function(){this.nextIsBranching(this.currentLibraryId)?this.handleProceed():this.showContentOverlay(),this.parent.enableNavButton()},r.prototype.showContentOverlay=function(){this.contentOverlays[this.currentLibraryId].show()},r.prototype.hideContentOverlay=function(){this.contentOverlays[this.currentLibraryId].hide()},r.prototype.getXAPIData=function(e){if(this.libraryInstances[e]&&this.libraryInstances[e].getXAPIData)return this.libraryInstances[e].getXAPIData()},r.prototype.nextIsBranching=function(e){var t=void 0!==e?this.parent.params.content[e].nextContentId:void 0;return void 0!==t&&t>0&&r.isBranching(this.parent.params.content[t])},r.prototype.createNextLibraries=function(e){this.removeNextLibraries(),this.nextLibraries={},this.loadLibrary(e)},r.prototype.createNextLibrary=function(e){this.removeNextLibraries(),this.nextLibraries={},this.loadLibrary(e,e.contentId)},r.prototype.loadLibrary=function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=null!==r?r:e.nextContentId;if("H5P.BranchingQuestion"!==e.type.library.split(" ")[0]){var i=this.parent.getLibrary(n);if(!1===i)return;i.type&&"H5P.BranchingQuestion"!==i.type.library.split(" ")[0]&&(this.nextLibraries[n]=this.createLibraryElement(i,!0),this.wrapper.appendChild(this.nextLibraries[n]))}else{var a=e.type.params.branchingQuestion.alternatives||[],s=a.map((function(e){return e.nextContentId}));s.forEach((function(e){var r=t.parent.getLibrary(e);!1!==r&&r.type&&"H5P.BranchingQuestion"!==r.type.library.split(" ")[0]&&(t.nextLibraries[e]=t.createLibraryElement(r,!0),t.wrapper.appendChild(t.nextLibraries[e]))}))}},r.prototype.removeNextLibraries=function(){for(var e=this.wrapper.getElementsByClassName("h5p-next"),t=0;t<e.length;t++)e[t].parentNode.removeChild(e[t])},r.prototype.disableFullscreen=function(e){switch(e.libraryInfo.machineName){case"H5P.CoursePresentation":e.$fullScreenButton&&e.$fullScreenButton.remove();break;case"H5P.InteractiveVideo":e.on("controls",(function(){e.controls.$fullscreen&&e.controls.$fullscreen.remove()}))}},r.prototype.bubbleUp=function(e,t,r){e.on(t,(function(e){r.bubblingUpwards=!0,r.trigger(t,e),r.bubblingUpwards=!1}))},r.prototype.hasValidVideo=function(e){var t=e.type,r=t.metadata.contentType,n="Interactive Video"===r?t.params.interactiveVideo.video.files:t.params.sources;return!(!t||"Interactive Video"!==r&&"Video"!==r||!n||!n[0].mime||"video/unknown"===n[0].mime||!("video/webm"!==n[0].mime&&"video/mp4"!==n[0].mime||H5P.VideoHtml5.canPlay(n)))},r.prototype.show=function(){var e=this,t=e.parent.params.content[e.currentLibraryId];!0!==e.libraryFinishingRequirements[e.currentLibraryId]||!e.hasValidVideo(t)&&"H5P.CoursePresentation"!==t.type.library.split(" ")[0]||(e.contentOverlays[e.currentLibraryId].hide(),e.parent.disableNavButton()),e.isShowing=!0,e.wrapper.classList.add("h5p-slide-in"),e.wrapper.classList.remove("h5p-branching-hidden"),e.wrapper.addEventListener("animationend",(function(t){"h5p-next-screen h5p-slide-in"===t.target.className&&(e.wrapper.classList.remove("h5p-next-screen"),e.wrapper.classList.remove("h5p-slide-in"),e.wrapper.classList.add("h5p-current-screen"),e.parent.navigating=!1,e.wrapper.style.minHeight=e.parent.currentHeight,e.libraryTitle.focus())}))},r.prototype.hide=function(e){var t=this;t.isShowing=!1;for(var r=0;r<this.nextLibraries.length;r++)this.nextLibraries[r].style.display="none",null!==this.nextLibraries[r].parentNode&&this.nextLibraries[r].parentNode.removeChild(this.nextLibraries[r]);function n(){t.wrapper.classList.remove("h5p-current-screen"),t.wrapper.classList.add("h5p-next-screen"),t.wrapper.classList.remove("h5p-slide-out"),t.wrapper.classList.remove("h5p-slide-out-reverse"),t.wrapper.classList.remove("h5p-slide-pseudo"),setTimeout((function(){null!==t.wrapper.parentNode&&(t.wrapper.parentNode.removeChild(t.wrapper),t.remove(),t.parent.libraryScreen=null,t.parent.trigger("resize"))}),100)}this.overlay&&(null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.branchingQuestions.forEach((function(e){null!==e.parentNode&&e.parentNode.removeChild(e)}))),t.wrapper.classList.add("h5p-slide-out"),e?setTimeout((function(){n()}),800):t.wrapper.addEventListener("animationend",n)},r.prototype.hideBranchingQuestion=function(e){this.nextLibraryId=e.nextContentId,this.libraryFeedback=e.feedback,null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.branchingQuestions.forEach((function(e){null!==e.parentNode&&e.parentNode.removeChild(e)})),this.createNextLibraries(e),this.parent.navigating=!1,this.navButton.focus(),this.showBackgroundToReadspeaker()},r.prototype.hideFeedbackDialogs=function(){this.overlay&&(null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.showBackgroundToReadspeaker());var e=document.querySelector(".h5p-current-screen");if(e){var t=e.querySelector(".h5p-branching-question-wrapper");t&&t.parentNode.removeChild(t)}},r.prototype.resizeScreen=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.questionContainer){var t=e?this.parent.startScreen.screenWrapper:this.wrapper,r=parseInt(window.getComputedStyle(this.questionContainer,null).getPropertyValue("padding-top"),10);t.style.height=this.questionContainer.offsetHeight+r+"px"}},r.prototype.showNextLibrary=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.nextLibraryId=e.nextContentId,this.libraryFeedback=e.feedback,r.isBranching(e)){!0===this.parent.params.behaviour&&this.parent.disableNavButton(),this.branchingQuestions.forEach((function(e){null!==e.parentNode&&e.parentNode.removeChild(e)}));var n=document.querySelector(".h5p-current-screen");void 0===this.overlay&&(this.overlay=document.createElement("div"),this.overlay.className="h5p-branching-scenario-overlay",n.appendChild(this.overlay),this.hideBackgroundFromReadspeaker());var i=document.createElement("div");i.classList.add("h5p-nav-button-wrapper"),-1!==this.parent.backwardsAllowedFlags.indexOf(!0)&&(this.bqBackButton=this.createBackButton(this.parent.params.l10n.backButtonText),this.bqBackButton.setAttribute("isBQ",!0),!1===this.parent.canEnableBackButton(e.contentId)&&(this.bqBackButton.classList.add("h5p-disabled"),this.bqBackButton.setAttribute("disabled",!0)),i.appendChild(this.bqBackButton));var a=document.createElement("div");a.className="h5p-branching-question-wrapper",this.appendRunnable(a,e.type,e.contentId),n.appendChild(a),this.branchingQuestions.push(a);var s="h5p-branching-question-title-"+r.idCounter++,o=a.querySelector(".h5p-branching-question-container");this.questionContainer=o,o.setAttribute("role","dialog"),o.setAttribute("tabindex","-1"),o.setAttribute("aria-labelledby",s),o.classList.add("h5p-start-outside"),o.classList.add("h5p-fly-in"),a.querySelector(".h5p-branching-question-title").id=s;var c=a.querySelector(".h5p-multichoice-wrapper");c.setAttribute("role","group"),c.setAttribute("aria-labelledby",s),document.querySelector(".h5p-branching-question").appendChild(i),this.currentLibraryWrapper.style.zIndex=0;var d=this.parent.isFullScreen(),l=this.parent.$container[0].classList.contains("h5p-mobile-screen");""!==this.currentLibraryWrapper.style.height||this.parent.startScreen.isShowing||d||l?this.parent.startScreen.isShowing&&!d?this.resizeScreen(!0):parseInt(this.currentLibraryWrapper.style.height)<o.offsetHeight&&(this.currentLibraryWrapper.style.height=o.offsetHeight+"px"):this.resizeScreen(),this.createNextLibraries(e),this.parent.navigating=!1,a.addEventListener("animationend",(function(){void 0!==a.querySelectorAll(".h5p-branching-question-alternative")[0]&&o.focus()}))}else{var h=!0;!0!==this.libraryFinishingRequirements[e.contentId]||!this.hasValidVideo(e)&&"H5P.CoursePresentation"!==e.type.library.split(" ")[0]||(this.contentOverlays[this.currentLibraryId].hide(),this.parent.disableNavButton(),h=!1);var p=document.querySelector(".h5p-proceed-button");p.innerHTML=e.proceedButtonText;var u=e.type&&e.type.metadata&&e.type.metadata.title?e.type.metadata.title:"";this.libraryTitle.setAttribute("aria-label",u||"Untitled Content"),this.libraryTitle.innerHTML=e.showContentTitle&&u?u:" ",this.currentLibraryId===e.contentId?this.currentLibraryWrapper.classList.add("h5p-slide-pseudo"):t?this.currentLibraryWrapper.classList.add("h5p-slide-out-reverse"):this.currentLibraryWrapper.classList.add("h5p-slide-out"),this.overlay&&(null!==this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=void 0,this.branchingQuestions.forEach((function(e){null!==e.parentNode&&e.parentNode.removeChild(e)})),this.showBackgroundToReadspeaker()),this.nextLibraries[e.contentId]||this.createNextLibrary(e);var b=this.nextLibraries[e.contentId];if(!b.offsetParent){var v=document.querySelector(".h5p-screen-footer");this.wrapper.insertBefore(b,v)}t&&(b.classList.remove("h5p-next"),b.classList.add("h5p-previous")),b.classList.add("h5p-slide-in");var y=b.getElementsByClassName("h5p-branching-scenario-content")[0];y.classList.remove("h5p-branching-hidden"),this.currentLibraryId=e.contentId,this.currentLibraryInstance=this.libraryInstances[e.contentId],this.currentLibraryInstance.resize&&this.currentLibraryInstance.resize();var g=this;this.currentLibraryWrapper.addEventListener("animationend",(function(){null!==g.currentLibraryWrapper.parentNode&&g.currentLibraryWrapper.parentNode.removeChild(g.currentLibraryWrapper),g.currentLibraryWrapper=b,g.wrapper.setAttribute("aria-hidden",!1),g.currentLibraryWrapper.classList.remove("h5p-previous"),g.currentLibraryWrapper.classList.remove("h5p-next"),g.currentLibraryWrapper.classList.remove("h5p-slide-in"),g.currentLibraryElement=b.getElementsByClassName("h5p-branching-scenario-content")[0],g.createNextLibraries(e),g.parent.navigating=!1,g.libraryTitle.focus(),h&&g.parent.enableNavButton(),g.resize(new H5P.Event("resize",{element:y}))}))}},r.prototype.hideBackgroundFromReadspeaker=function(){var e=this;this.header.setAttribute("aria-hidden","true"),this.currentLibraryWrapper.setAttribute("aria-hidden","true");var t=document.querySelector(".h5p-container");(t||(t=document.querySelector(".preview-wrapper")))&&(this.tabbables=[],t.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button, iframe, object, embed, *[tabindex], *[contenteditable], video, audio").forEach((function(t){if(t instanceof HTMLMediaElement)t.controls&&(t.controls=!1,e.tabbables.push({element:t}));else{var r=t.classList.contains("ui-slider-handle")?0:t.getAttribute("tabindex");t.setAttribute("tabindex","-1"),e.tabbables.push({element:t,tabindex:r})}})))},r.prototype.showBackgroundToReadspeaker=function(){this.header.setAttribute("aria-hidden","false"),this.currentLibraryWrapper.setAttribute("aria-hidden","false"),this.tabbables&&(this.tabbables.forEach((function(e){var t=e.element;t instanceof HTMLMediaElement?t.controls=!0:void 0!==e.tabindex&&null!==e.tabindex?t.setAttribute("tabindex",e.tabindex):t.removeAttribute("tabindex")})),this.tabbables=null)},r.prototype.getElement=function(){return this.wrapper},r.prototype.remove=function(){null!==this.wrapper.parentNode&&this.wrapper.parentNode.removeChild(this.wrapper)},r.prototype.resize=function(e){var t=this.currentLibraryInstance,r=e&&e.data&&e.data.element?e.data.element:this.currentLibraryElement,n=t&&"H5P.Image"===t.libraryInfo.machineName,i=t&&"H5P.CoursePresentation"===t.libraryInfo.machineName,a=t&&"H5P.ImageHotspots"===t.libraryInfo.machineName,s=t&&"H5P.Video"===t.libraryInfo.machineName,o=t&&"H5P.InteractiveVideo"===t.libraryInfo.machineName,c=t&&t.width&&t.height,d=r.classList.contains("h5p-youtube"),l=c&&(n||i)||a||s;if(l&&(r.style.width="",r.style.height="",a&&(r.style.maxWidth="")),this.parent.isFullScreen()){if(r.classList.add("h5p-fullscreen"),o&&t.$videoWrapper[0].firstChild.style&&(t.videoHeight=t.$videoWrapper[0].firstChild.style.height),l){var h=s&&void 0!==this.parent.params.content[this.currentLibraryId].type.params.sources?r.getBoundingClientRect():null;if(s&&void 0===this.parent.params.content[this.currentLibraryId].type.params.sources?r.classList.add("h5p-video-no-source"):r.classList.remove("h5p-video-no-source"),h||a||i||n){var p=a?t.options.image.height:s?h.height:t.height,u=a?t.options.image.width:i?t.ratio*p:s?h.width:t.width,b=p/u,v=o?r.lastChild:r,y=v.getBoundingClientRect();b>y.height/y.width?a?v.style.maxWidth=y.height*(u/p)+"px":v.style.width=y.height*(u/p)+"px":(v.style.height=y.width*b+"px",d&&null!==r.querySelector("iframe")&&(r.querySelector("iframe").style.height=y.width*b+"px"))}}}else{this.parent.startScreen.isShowing?this.resizeScreen(!0):this.overlay?this.resizeScreen():this.wrapper.style.height="";var g=r.getElementsByClassName("h5p-video-wrapper");if(o&&g.length>0){var m=g[0].firstChild;m.style&&(m.style.height=t.videoHeight)}else d&&null!==r.querySelector("iframe")&&(r.querySelector("iframe").style.height="");r.classList.remove("h5p-fullscreen")}t&&(t.trigger("resize",e),this.handleLibraryResize())},r.isBranching=function(e){return!!(e&&e.type&&e.type.library)&&0===e.type.library.indexOf("H5P.BranchingQuestion ")},r.prototype.createNavButtons=function(){var e=this,t=this,r=this.parent,n=document.createElement("div");n.classList.add("h5p-nav-button-wrapper"),-1!==r.backwardsAllowedFlags.indexOf(!0)&&(this.backButton=this.createBackButton(r.params.l10n.backButtonText),n.appendChild(this.backButton));var i=document.createElement("button");i.classList.add("transition"),i.onclick=function(){if(!1===r.navigating){var e=t.libraryFeedback.title&&t.libraryFeedback.title.trim(),n=t.libraryFeedback.subtitle&&t.libraryFeedback.subtitle.trim(),i=!!(e||n||t.libraryFeedback.image);if(i&&-1!==t.nextLibraryId){void 0===t.overlay&&(t.overlay=document.createElement("div"),t.overlay.className="h5p-branching-scenario-overlay",t.wrapper.appendChild(t.overlay),t.hideBackgroundFromReadspeaker());var a=document.createElement("div");a.classList.add("h5p-branching-question-wrapper"),a.classList.add("h5p-branching-scenario-feedback-dialog");var s=document.createElement("div");s.classList.add("h5p-branching-question-container"),a.appendChild(s);var o=t.createFeedbackScreen(t.libraryFeedback,t.nextLibraryId);s.appendChild(o),s.classList.add("h5p-start-outside"),s.classList.add("h5p-fly-in"),t.currentLibraryWrapper.style.zIndex=0,t.wrapper.appendChild(a),o.focus()}else{var c={nextContentId:t.nextLibraryId};(i||void 0!==t.libraryFeedback.endScreenScore)&&(c.feedback=t.libraryFeedback),r.trigger("navigated",c)}r.navigating=!0}},i.classList.add("h5p-nav-button"),this.navButton=document.createElement("button"),this.navButton.classList.add("transition"),this.navButton.addEventListener("animationend",(function(){e.parent.unanimateNavButton()})),this.navButton.addEventListener("click",(function(){if(!e.parent.proceedButtonInProgress){e.parent.proceedButtonInProgress=!0;var t=e;new Promise((function(e){t.handleProceed()&&e(!0)})).then((function(){t.parent.proceedButtonInProgress=!1}))}})),this.navButton.classList.add("h5p-nav-button","h5p-proceed-button");var a=r.getLibrary(this.currentLibraryId).proceedButtonText;this.navButton.appendChild(document.createTextNode(a)),n.appendChild(this.navButton);var s=document.createElement("div");s.classList.add("h5p-screen-footer"),s.appendChild(n),t.wrapper.appendChild(s)},r.idCounter=0,r}(H5P.jQuery)})(),H5P.BranchingScenario.LibraryScreenOverlay=function(){function e(e){this.hidden=!0,this.parent=e,this.overlay=document.createElement("div"),this.overlay.classList.add("h5p-content-overlay"),this.overlay.classList.add("h5p-hidden"),this.buttonsContainer=document.createElement("div"),this.buttonsContainer.classList.add("h5p-content-overlay-buttons-container"),this.overlay.appendChild(this.buttonsContainer),this.buttons={}}return e.prototype.getDOM=function(){return this.overlay},e.prototype.show=function(){var e=this;this.overlay.classList.remove("h5p-hidden"),window.requestAnimationFrame((function(){e.buttonsContainer.classList.remove("h5p-hidden"),e.hidden=!1,Object.values(e.buttons)[Object.keys(e.buttons).length-1].focus()}))},e.prototype.hide=function(){this.hidden=!0,this.overlay.classList.add("h5p-hidden"),this.buttonsContainer.classList.add("h5p-hidden")},e.prototype.isVisible=function(){return!this.hidden},e.prototype.addButton=function(e,t,r){if(!e&&0!==e||!t||"function"!=typeof r||this.buttons[e])return null;var n=document.createElement("button");return n.classList.add("transition"),n.classList.add("h5p-nav-button"),n.classList.add("h5p-nav-button-".concat(e)),n.innerText=t,n.addEventListener("click",(function(t){r(e)})),this.buttons[e]=n,this.buttonsContainer.appendChild(n),n},e.prototype.removeButton=function(e){(e||0===e)&&this.buttons[e]&&(this.buttonsContainer.removeChild(this.buttons[e]),delete this.buttons[e])},e}(),H5P.BranchingScenario.Scoring=(e="static-end-score",t="dynamic-score",function(r){var n=this,i=[],a=0,s=function(e){return e&&e.feedback&&void 0!==e.feedback.endScreenScore};this.getScore=function(n){return r.scoringOptionGroup.scoringOption===t?i.reduce((function(e,t){return e+t.score}),0):r.scoringOptionGroup.scoringOption===e?n:0},this.getMaxScore=function(){return r.scoringOptionGroup.scoringOption===e?(o=r.endScreens[0].endScreenScore,c=void 0!==o?o:0,r.content.reduce((function(e,t){var r=[t];return n.isBranchingQuestion(t)&&(r=t.type.params.branchingQuestion.alternatives),e.concat(r)}),[]).filter((function(e){return-1===e.nextContentId})).reduce((function(e,t){var r=s(t)?t.feedback.endScreenScore:c;return e>=r?e:r}),0)):r.scoringOptionGroup.scoringOption===t?(a=0,i.forEach((function(e){a+=e.maxScore})),a):0;var a,o,c},this.restart=function(){i=[],a=0},this.addLibraryScore=function(e,t,n,o){a+=1;var c=r.content[e],d=0,l=0;e!==t||0===e&&this.isBranchingQuestion(c)?(d=function(e,t){if(!(t>=0))return 0;if(!(e&&e.type&&e.type.params&&e.type.params.branchingQuestion&&e.type.params.branchingQuestion.alternatives&&e.type.params.branchingQuestion.alternatives[t]))return 0;var r=e.type.params.branchingQuestion.alternatives[t];return!s(r)||void 0===r.nextContentId||r.nextContentId<0?0:r.feedback.endScreenScore}(c,n),l=function(e,t){if(!(t>=0))return 0;var r=e.type.params.branchingQuestion.alternatives,n=0;return r.forEach((function(e,t){r[t].feedback.endScreenScore>n&&-1!==r[t].nextContentId&&(n=r[t].feedback.endScreenScore)})),n}(c,n)):(s(c)&&c.nextContentId&&c.nextContentId>-1&&(d=c.feedback.endScreenScore,l=c.feedback.endScreenScore),r.scoringOptionGroup.includeInteractionsScores&&0!==Object.entries(o).length&&(d+=o.score,l+=o.maxScore));var h=!1,p=null,u=-1;i.forEach((function(t,n){t.id===e&&(t.score=d,t.visitedIndex=a,u=t.visitedIndex,i.length>n+1&&r.content[t.id].nextContentId===i[n+1].id?h=!0:p=n)})),h?(i=i.filter((function(e){return e.visitedIndex<=u})),a=u):(null!==p&&i.splice(p,1),i.push({visitedIndex:a,id:e,score:d,maxScore:l}))},this.isBranchingQuestion=function(e){var t=e;return e&&e.type&&e.type.library&&(t=e.type.library),"H5P.BranchingQuestion"===t.split(" ")[0]},this.isDynamicScoring=function(){return r.scoringOptionGroup.scoringOption===t},this.shouldShowScore=function(){return r.scoringOptionGroup.scoringOption===e||this.isDynamicScoring()}})})();
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists