",{class:"h5p-element-outer "+r+"-outer-element"}).css({background:"rgba(255,255,255,"+(void 0===e.backgroundOpacity?0:e.backgroundOpacity/100)+")"}).appendTo(s),r=H5P.jQuery("
",{class:"h5p-element-inner"}).appendTo(r),t.on("set-size",function(e){for(var t in e.data)s.get(0).style[t]=e.data[t]}),t.attach(r),void 0!==e.action&&"H5P.InteractiveVideo"===e.action.library.substr(0,20)&&(r=function(){t.$container.addClass("h5p-fullscreen"),t.controls.$fullscreen&&t.controls.$fullscreen.remove(),t.hasFullScreen=!0,t.controls.$play.hasClass("h5p-pause")?t.$controls.addClass("h5p-autohide"):t.enableAutoHide()},void 0!==t.controls?r():t.on("controls",r)),this.setOverflowTabIndex()),void 0!==this.editor?this.editor.processElement(e,s,i,t):(e.solution&&this.addElementSolutionButton(e,t,s),this.hasAnswerElements=this.hasAnswerElements||void 0!==t.exportAnswers),s},r.prototype.disableTabIndexes=function(){var n=this.$container.find(".h5p-popup-container");this.$tabbables=this.$container.find("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]").filter(function(){var e=(0,p.jQuery)(this),t=p.jQuery.contains(n.get(0),e.get(0));if(e.data("tabindex"))return!0;if(t)return!1;t=e.attr("tabindex");return e.data("tabindex",t),e.attr("tabindex","-1"),!0})},r.prototype.restoreTabIndexes=function(){this.$tabbables&&this.$tabbables.each(function(){var e=(0,p.jQuery)(this),t=e.data("tabindex");e.hasClass("ui-slider-handle")?(e.attr("tabindex",0),e.removeData("tabindex")):void 0!==t?(e.attr("tabindex",t),e.removeData("tabindex")):e.removeAttr("tabindex")})},r.prototype.createInteractionButton=function(e,t){var n=this,i=e.action.params&&e.action.params.cpAutoplay,r=e.action.metadata?e.action.metadata.title:"";""===r&&(r=e.action.params&&e.action.params.contentName||e.action.library.split(" ")[0].split(".")[1]);var o=this.getLibraryTypePmz(e.action.library),s=(0,p.jQuery)("
",{role:"button",tabindex:0,"aria-label":r,"aria-popup":!0,"aria-expanded":!1,class:"h5p-element-button h5p-element-button-"+e.buttonSize+" "+o+"-button"}),a=(0,p.jQuery)('
');t.attach(a);var l="h5p-advancedtext"===o?{x:e.x,y:e.y}:null;return(0,h.addClickAndKeyboardListeners)(s,function(){var e;s.attr("aria-expanded","true"),n.showInteractionPopup(t,s,a,o,i,(e=s,function(){return e.attr("aria-expanded","false")}),l),n.disableTabIndexes()}),void 0!==e.action&&"H5P.InteractiveVideo"===e.action.library.substr(0,20)&&t.on("controls",function(){t.controls.$fullscreen&&t.controls.$fullscreen.remove()}),s},r.prototype.showInteractionPopup=function(e,t,n,i,r,o){function s(){e.trigger("resize")}var a=this,l=6
",{role:"button",tabindex:0,title:r.l10n.solutionsButtonTitle,"aria-popup":!0,"aria-expanded":!1,class:"h5p-element-solution"}).append('').appendTo(i),t={x:n.x,y:n.y},n.displayAsButton||(t.x+=n.width-4,t.y+=n.height-12),(0,h.addClickAndKeyboardListeners)(e,function(){return r.showPopup(n.solution,e,t)}))},void 0!==n.alwaysDisplayComments&&n.alwaysDisplayComments&&e.showCPComments()},r.prototype.showPopup=function(e,t){function n(e){i?i=!1:(void 0!==o&&setTimeout(function(){o(),s.restoreTabIndexes()},100),e.preventDefault(),l.addClass("h5p-animate"),l.find(".h5p-popup-container").addClass("h5p-animate"),setTimeout(function(){l.remove()},100),t.focus())}var i,r=2
'),c=l.find(".h5p-popup-wrapper");e instanceof H5P.jQuery?c.append(e):c.html(e);e=l.find(".h5p-popup-container");return function(e,t,n){if(n){t.css({visibility:"hidden"}),e.prependTo(a.$wrapper);var i=t.height(),r=t.width(),o=e.height(),s=r*(100/e.width()),r=i*(100/o);if(50
i?s=i:n.x<7.5&&(s=7.5);o=100-(r=t.height()*(100/o))-10,r=n.y;n.y>o?r=o:n.y<10&&(r=10),e.detach(),t.css({left:s+"%",top:r+"%"})}}(l,e,r),l.addClass("h5p-animate"),e.css({visibility:""}).addClass("h5p-animate"),l.prependTo(this.$wrapper).focus().removeClass("h5p-animate").click(n).find(".h5p-popup-container").removeClass("h5p-animate").click(function(){i=!0}).keydown(function(e){e.which===h.keyCode.ESC&&n(e)}).end(),(0,h.addClickAndKeyboardListeners)(l.find(".h5p-close-popup"),n),l},r.prototype.checkForSolutions=function(e){return void 0!==e.showSolutions||void 0!==e.showCPComments},r.prototype.initKeyEvents=function(){var t,n;void 0!==this.keydown||this.activeSurface||(n=!1,(t=this).keydown=function(e){n||((37!==e.keyCode&&33!==e.keyCode||!t.previousSlide())&&(39!==e.keyCode&&34!==e.keyCode||!t.nextSlide())||(e.preventDefault(),n=!0),n&&setTimeout(function(){n=!1},300))},H5P.jQuery("body").keydown(this.keydown))},r.prototype.initTouchEvents=function(){function i(e){return{"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,transform:e}}var r,o,s,a,l,c,u=this,d=!1,p=!1,t=i("");this.$slidesWrapper.bind("touchstart",function(e){p=!1,s=r=e.originalEvent.touches[0].pageX,o=e.originalEvent.touches[0].pageY;e=u.$slidesWrapper.width();a=0===u.currentSlideIndex?0:-e,l=u.currentSlideIndex+1>=u.slides.length?0:e,d=!(c=null)}).bind("touchmove",function(e){var t=e.originalEvent.touches;d&&(u.$current.prev().addClass("h5p-touch-move"),u.$current.next().addClass("h5p-touch-move"),d=!1),s=t[0].pageX;var n=r-s;null===c&&(c=Math.abs(o-e.originalEvent.touches[0].pageY)>Math.abs(n)),1!==t.length||c||(e.preventDefault(),p||(n<0?u.$current.prev().css(i("translateX("+(a-n)+"px")):u.$current.next().css(i("translateX("+(l-n)+"px)")),u.$current.css(i("translateX("+-n+"px)"))))}).bind("touchend",function(){if(!c){var e=r-s;if(e>u.swipeThreshold&&u.nextSlide()||e<-u.swipeThreshold&&u.previousSlide())return}u.$slidesWrapper.children().css(t).removeClass("h5p-touch-move")})},r.prototype.updateTouchPopup=function(e,t,n,i){var r;arguments.length<=0?void 0!==this.touchPopup&&this.touchPopup.remove():(r="",void 0!==this.$keywords&&void 0!==this.$keywords.children(":eq("+t+")").find("span").html()?r+=this.$keywords.children(":eq("+t+")").find("span").html():r+=this.l10n.slide+" "+(t+1),void 0===this.editor&&t>=this.slides.length-1&&(r=this.l10n.showSolutions),void 0===this.touchPopup?this.touchPopup=H5P.jQuery("",{class:"h5p-touch-popup"}).insertAfter(e):this.touchPopup.insertAfter(e),i-.15*e.parent().height()<0?i=0:i-=.15*e.parent().height(),this.touchPopup.css({"max-width":e.width()-n,left:n,top:i}),this.touchPopup.html(r))},r.prototype.previousSlide=function(e){var t=this.$current.prev();return!!t.length&&this.jumpToSlide(t.index(),e,!1)},r.prototype.nextSlide=function(e){var t=this.$current.next();return!!t.length&&this.jumpToSlide(t.index(),e,!1)},r.prototype.isCurrentSlide=function(e){return this.currentSlideIndex===e},r.prototype.getCurrentSlideIndex=function(){return this.currentSlideIndex},r.prototype.attachAllElements=function(){for(var e=this.$slidesWrapper.children(),t=0;t=this.cp.slides.length-1,e=!this.cp.showSummarySlide&&this.cp.hasAnswerElements;a&&(s.cp.presentation.keywordListEnabled&&s.cp.presentation.keywordListAlwaysShow&&s.cp.hideKeywords(),this.$summarySlide.children().remove(),a=s.cp.getSlideScores(t),t=s.outputScoreStats(a),(0,l.jQuery)(t).appendTo(s.$summarySlide),e||(n=s.totalScores(a),isNaN(n.totalPercentage)||((a=l.JoubelUI.createScoreBar(n.totalMaxScore,"","","")).setScore(n.totalScore),i=(0,l.jQuery)(".h5p-summary-total-score",s.$summarySlide),a.appendTo(i),setTimeout(function(){i.append((0,l.jQuery)("",{"aria-live":"polite",class:"hidden-but-read",html:s.cp.l10n.summary+". "+s.cp.l10n.accessibilityTotalScore.replace("@score",n.totalScore).replace("@maxScore",n.totalMaxScore)}))},100)),1==s.cp.enableTwitterShare&&(r=(0,l.jQuery)(".h5p-summary-twitter-message",s.$summarySlide),this.addTwitterScoreLinkTo(r,n)),1==s.cp.enableFacebookShare&&(r=(0,l.jQuery)(".h5p-summary-facebook-message",s.$summarySlide),this.addFacebookScoreLinkTo(r,n)),1==s.cp.enableGoogleShare&&(o=(0,l.jQuery)(".h5p-summary-google-message",s.$summarySlide),this.addGoogleScoreLinkTo(o)),s.$summarySlide.find(".h5p-td > .h5p-slide-link").each(function(){var t=(0,l.jQuery)(this);t.click(function(e){s.cp.jumpToSlide(parseInt(t.data("slide"),10)-1),e.preventDefault()})})),o=(0,l.jQuery)(".h5p-summary-footer",s.$summarySlide),this.cp.showSummarySlideSolutionButton&&l.JoubelUI.createButton({class:"h5p-show-solutions",html:s.cp.l10n.showSolutions,on:{click:function(){s.toggleSolutionMode(!0)}},appendTo:o}),this.cp.showSummarySlideRetryButton&&l.JoubelUI.createButton({class:"h5p-cp-retry-button",html:s.cp.l10n.retry,on:{click:function(){s.cp.resetTask()}},appendTo:o}),s.cp.hasAnswerElements&&l.JoubelUI.createButton({class:"h5p-eta-export",html:s.cp.l10n.exportAnswers,on:{click:function(){H5P.ExportableTextArea.Exporter.run(s.cp.slides,s.cp.elementInstances)}},appendTo:o}))},i.prototype.outputScoreStats=function(e){if(void 0===e)return this.$summarySlide.addClass("h5p-summary-only-export"),'';for(var t=this,n=0,i=0,r="",o=0,s="",a=0;a]+)>)/gi,"")+" "+o+'%" data-slide="'+e[a].slide+'">'+t.cp.l10n.slide+" "+e[a].slide+": "+s.replace(/(<([^>]+)>)/gi,"")+' | '+o+"% "+e[a].score+"/"+e[a].maxScore+" | ",n+=e[a].score,i+=e[a].maxScore;t.cp.triggerXAPICompleted(n,i);var l=t.cp.enableTwitterShare||t.cp.enableFacebookShare||t.cp.enableGoogleShare?''+t.cp.l10n.shareResult+"":"",c=1==t.cp.enableTwitterShare?'':"",u=1==t.cp.enableFacebookShare?'':"",d=1==t.cp.enableGoogleShare?'':"";return''},i.prototype.getSlideDescription=function(e){var t,n,i,r=this.cp.slides[e.slide-1].elements;return 1",{class:"h5p-progressbar-part"}).appendTo(n.cp.$progressbar),u=d("",{href:"#",html:''+l+"",tabindex:"-1"}).data("slideNumber",o).click(r).appendTo(c);this.progresbarKeyboardControls.addElement(u.get(0)),f.isIOS||function(){var e=d("",{class:"h5p-progressbar-popup",html:l,"aria-hidden":"true"}).appendTo(c);c.mouseenter(function(){return t.ensurePopupVisible(e)})}(),this.isSummarySlide(o)&&c.addClass("progressbar-part-summary-slide"),0===o&&c.addClass("h5p-progressbar-part-show"),o===i&&c.addClass("h5p-progressbar-part-selected"),n.cp.progressbarParts.push(c),this.updateSlideTitle(o),this.cp.slides.length<=60&&a.elements&&0",{class:"h5p-progressbar-part-has-task"}).appendTo(u),this.setTaskAnswered(o,a)))}},g.prototype.ensurePopupVisible=function(e){var t=this.cp.$container.width(),n=e.outerWidth(),i=e.offset().left;i<0?(e.css("left",0),e.css("transform","translateX(0)")):t",{class:"h5p-footer-left-adjusted"}).appendTo(n),r=d("",{class:"h5p-footer-center-adjusted"}).appendTo(n),n=d("",{role:"toolbar",class:"h5p-footer-right-adjusted"}).appendTo(n);this.cp.$keywordsButton=d("",{class:"h5p-footer-button h5p-footer-toggle-keywords","aria-expanded":"false","aria-label":this.cp.l10n.showKeywords,title:this.cp.l10n.showKeywords,role:"button",tabindex:"0",html:''}).appendTo(i),(0,f.addClickAndKeyboardListeners)(this.cp.$keywordsButton,function(e){t.cp.presentation.keywordListAlwaysShow||(t.cp.toggleKeywords(),e.stopPropagation())}),!this.cp.presentation.keywordListAlwaysShow&&this.cp.initKeywords||this.cp.$keywordsButton.hide(),this.cp.presentation.keywordListEnabled||this.cp.$keywordsWrapper.add(this.$keywordsButton).hide(),this.updateFooterKeyword(0),this.cp.$prevSlideButton=d("",{class:"h5p-footer-button h5p-footer-previous-slide","aria-label":this.cp.l10n.prevSlide,title:this.cp.l10n.prevSlide,role:"button",tabindex:"-1","aria-disabled":"true"}).appendTo(r),(0,f.addClickAndKeyboardListeners)(this.cp.$prevSlideButton,function(){return e.cp.previousSlide()});i=d("",{class:"h5p-footer-slide-count"}).appendTo(r);this.cp.$footerCurrentSlide=d("",{html:"1",class:"h5p-footer-slide-count-current",title:this.cp.l10n.currentSlide,"aria-hidden":"true"}).appendTo(i),this.cp.$footerCounter=d("",{class:"hidden-but-read",html:this.cp.l10n.slideCount.replace("@index","1").replace("@total",this.cp.slides.length.toString())}).appendTo(r),d("",{html:"/",class:"h5p-footer-slide-count-delimiter","aria-hidden":"true"}).appendTo(i),this.cp.$footerMaxSlide=d("",{html:this.cp.slides.length,class:"h5p-footer-slide-count-max",title:this.cp.l10n.lastSlide,"aria-hidden":"true"}).appendTo(i),this.cp.$nextSlideButton=d("",{class:"h5p-footer-button h5p-footer-next-slide","aria-label":this.cp.l10n.nextSlide,title:this.cp.l10n.nextSlide,role:"button",tabindex:"0"}).appendTo(r),(0,f.addClickAndKeyboardListeners)(this.cp.$nextSlideButton,function(){return e.cp.nextSlide()}),void 0===this.cp.editor&&(this.cp.$exitSolutionModeButton=d("",{role:"button",class:"h5p-footer-exit-solution-mode","aria-label":this.cp.l10n.solutionModeTitle,title:this.cp.l10n.solutionModeTitle,tabindex:"0"}).appendTo(n),(0,f.addClickAndKeyboardListeners)(this.cp.$exitSolutionModeButton,function(){return t.cp.jumpToSlide(t.cp.slides.length-1)}),this.cp.enablePrintButton&&o.default.supported()&&(this.cp.$printButton=d("",{class:"h5p-footer-button h5p-footer-print","aria-label":this.cp.l10n.printTitle,title:this.cp.l10n.printTitle,role:"button",tabindex:"0"}).appendTo(n),(0,f.addClickAndKeyboardListeners)(this.cp.$printButton,function(){return t.openPrintDialog()})),H5P.fullscreenSupported&&(this.cp.$fullScreenButton=d("",{class:"h5p-footer-button h5p-footer-toggle-full-screen","aria-label":this.cp.l10n.fullscreen,title:this.cp.l10n.fullscreen,role:"button",tabindex:"0"}),(0,f.addClickAndKeyboardListeners)(this.cp.$fullScreenButton,function(){return t.cp.toggleFullScreen()}),this.cp.$fullScreenButton.appendTo(n))),this.cp.$exitSolutionModeText=d("",{html:"",class:"h5p-footer-exit-solution-mode-text"}).appendTo(this.cp.$exitSolutionModeButton)},g.prototype.openPrintDialog=function(){var t=this,n=d(".h5p-wrapper");o.default.showDialog(this.cp.l10n,n,function(e){o.default.print(t.cp,n,e)}).children('[role="dialog"]').focus()},g.prototype.updateProgressBar=function(e,t,n){for(var i=this,r=0;r=this.cp.slides.length-1&&(n=this.cp.l10n.summary),this.cp.$keywordsButton.children(".current-slide-title").html((0,f.defaultValue)(n,""))},g);function g(e){this.cp=e,this.answeredLabels=(r(e={},a,this.cp.l10n.containsNotCompleted),r(e,l,this.cp.l10n.containsCompleted),r(e,c,this.cp.l10n.containsOnlyCorrect),r(e,u,this.cp.l10n.containsIncorrectAnswers),r(e,s,"@slideName"),e),this.initProgressbar(this.cp.slidesWithSolutions),this.initFooter(),this.initTaskAnsweredListener(),this.toggleNextAndPreviousButtonDisabled(this.cp.getCurrentSlideIndex())}t.default=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l,a,c=n(1),n=(l=H5P.jQuery,a=0,i.supported=function(){return"function"==typeof window.print},i.print=function(e,t,n){e.trigger("printing",{finished:!1,allSlides:n});var i=l(".h5p-slide.h5p-current"),r=i.height(),o=i.width()/670,s=l(".h5p-slide");s.css({height:r/o+"px",width:"670px",fontSize:Math.floor(100/o)+"%"});var a=t.height();t.css("height","auto"),s.toggleClass("doprint",!0===n),i.addClass("doprint"),setTimeout(function(){window.print(),s.css({height:"",width:"",fontSize:""}),t.css("height",a+"px"),e.trigger("printing",{finished:!0})},500)},i.showDialog=function(e,t,n){var i=this,r=a++,o="h5p-cp-print-dialog-"+r+"-title",r="h5p-cp-print-dialog-"+r+"-ingress",s=l('